@weavecode/weave 0.1.1 → 0.1.2

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 (166) hide show
  1. package/node_modules/@weavecode/cli/dist/cli.js +4 -4
  2. package/node_modules/@weavecode/cli/dist/commands/chpass.js +1 -1
  3. package/node_modules/@weavecode/cli/dist/commands/daemon-auth.js +1 -1
  4. package/node_modules/@weavecode/cli/dist/commands/daemon.d.ts +7 -0
  5. package/node_modules/@weavecode/cli/dist/commands/daemon.js +2 -2
  6. package/node_modules/@weavecode/cli/dist/commands/dashboard.js +2 -2
  7. package/node_modules/@weavecode/cli/dist/commands/doctor.js +1 -1
  8. package/node_modules/@weavecode/cli/dist/commands/init.js +1 -1
  9. package/node_modules/@weavecode/cli/dist/commands/scan.js +1 -1
  10. package/node_modules/@weavecode/cli/dist/commands/status.js +2 -2
  11. package/node_modules/@weavecode/cli/dist/commands/uninstall.js +1 -1
  12. package/node_modules/@weavecode/cli/dist/i18n/dict/en.js +1 -9
  13. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.d.ts +0 -1
  14. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +2 -10
  15. package/node_modules/@weavecode/cli/dist/i18n/index.js +1 -1
  16. package/node_modules/@weavecode/cli/dist/i18n/t.js +1 -1
  17. package/node_modules/@weavecode/cli/dist/init/claudemd-gen.d.ts +2 -3
  18. package/node_modules/@weavecode/cli/dist/init/claudemd-gen.js +4 -4
  19. package/node_modules/@weavecode/cli/dist/init/executor.js +3 -3
  20. package/node_modules/@weavecode/cli/dist/init/git-commit.js +2 -2
  21. package/node_modules/@weavecode/cli/dist/init/harnesses/claude.js +7 -7
  22. package/node_modules/@weavecode/cli/dist/init/harnesses/codex.js +1 -1
  23. package/node_modules/@weavecode/cli/dist/init/harnesses/zcode.d.ts +29 -0
  24. package/node_modules/@weavecode/cli/dist/init/harnesses/zcode.js +1 -0
  25. package/node_modules/@weavecode/cli/dist/init/instruction-link.js +1 -1
  26. package/node_modules/@weavecode/cli/dist/init/plugin-templates.js +1 -1
  27. package/node_modules/@weavecode/cli/dist/init/prompt.js +4 -4
  28. package/node_modules/@weavecode/cli/dist/init/uninstall.js +6 -6
  29. package/node_modules/@weavecode/cli/dist/init/wiring.js +1 -1
  30. package/node_modules/@weavecode/cli/dist/parser.js +1 -1
  31. package/node_modules/@weavecode/cli/dist/statusline/ansi.js +1 -1
  32. package/node_modules/@weavecode/cli/dist/statusline/mock-input.js +1 -1
  33. package/node_modules/@weavecode/cli/dist/statusline/preview.js +2 -2
  34. package/node_modules/@weavecode/cli/package.json +5 -5
  35. package/node_modules/@weavecode/core/dist/harness-checks.js +1 -1
  36. package/node_modules/@weavecode/core/dist/index.d.ts +1 -1
  37. package/node_modules/@weavecode/core/dist/index.js +1 -1
  38. package/node_modules/@weavecode/core/dist/platform.js +1 -1
  39. package/node_modules/@weavecode/core/dist/types.d.ts +0 -8
  40. package/node_modules/@weavecode/core/dist/types.js +1 -1
  41. package/node_modules/@weavecode/core/dist/utils/fs.js +1 -1
  42. package/node_modules/@weavecode/core/dist/utils/logger.js +1 -1
  43. package/node_modules/@weavecode/core/package.json +1 -1
  44. package/node_modules/@weavecode/harness/dist/claude/assets.d.ts +10 -0
  45. package/node_modules/@weavecode/harness/dist/claude/assets.js +4 -1
  46. package/node_modules/@weavecode/harness/dist/claude/capture.d.ts +4 -2
  47. package/node_modules/@weavecode/harness/dist/claude/capture.js +15 -9
  48. package/node_modules/@weavecode/harness/dist/claude/detect.js +1 -1
  49. package/node_modules/@weavecode/harness/dist/claude/event-source.js +1 -1
  50. package/node_modules/@weavecode/harness/dist/claude/index.d.ts +6 -1
  51. package/node_modules/@weavecode/harness/dist/claude/index.js +1 -1
  52. package/node_modules/@weavecode/harness/dist/claude/mcp-gen.js +1 -1
  53. package/node_modules/@weavecode/harness/dist/claude/messaging.js +2 -2
  54. package/node_modules/@weavecode/harness/dist/claude/model-aliases.d.ts +14 -0
  55. package/node_modules/@weavecode/harness/dist/claude/model-aliases.js +1 -1
  56. package/node_modules/@weavecode/harness/dist/claude/peers.js +1 -1
  57. package/node_modules/@weavecode/harness/dist/claude/plan.d.ts +2 -0
  58. package/node_modules/@weavecode/harness/dist/claude/plan.js +1 -0
  59. package/node_modules/@weavecode/harness/dist/claude/plugins.js +4 -4
  60. package/node_modules/@weavecode/harness/dist/claude/prompt-inbox.js +1 -1
  61. package/node_modules/@weavecode/harness/dist/claude/prompt.js +3 -3
  62. package/node_modules/@weavecode/harness/dist/claude/questions.js +2 -2
  63. package/node_modules/@weavecode/harness/dist/claude/settings-gen.js +1 -1
  64. package/node_modules/@weavecode/harness/dist/claude/side-question.d.ts +12 -0
  65. package/node_modules/@weavecode/harness/dist/claude/side-question.js +1 -0
  66. package/node_modules/@weavecode/harness/dist/claude/statusline/config.d.ts +200 -0
  67. package/node_modules/@weavecode/harness/dist/claude/statusline/config.js +1 -0
  68. package/node_modules/@weavecode/harness/dist/claude/statusline/generator.d.ts +12 -0
  69. package/node_modules/@weavecode/harness/dist/claude/statusline/generator.js +745 -0
  70. package/node_modules/@weavecode/harness/dist/claude/statusline/git-cache.d.ts +10 -0
  71. package/node_modules/@weavecode/harness/dist/claude/statusline/git-cache.js +1 -0
  72. package/node_modules/@weavecode/harness/dist/claude/statusline/surface.d.ts +20 -0
  73. package/node_modules/@weavecode/harness/dist/claude/statusline/surface.js +2 -0
  74. package/node_modules/@weavecode/harness/dist/claude/transcript.js +3 -3
  75. package/node_modules/@weavecode/harness/dist/codex/assets.js +1 -1
  76. package/node_modules/@weavecode/harness/dist/codex/detect.js +1 -1
  77. package/node_modules/@weavecode/harness/dist/codex/index.d.ts +1 -0
  78. package/node_modules/@weavecode/harness/dist/codex/index.js +1 -1
  79. package/node_modules/@weavecode/harness/dist/codex/mcp.d.ts +30 -0
  80. package/node_modules/@weavecode/harness/dist/codex/mcp.js +1 -0
  81. package/node_modules/@weavecode/harness/dist/codex/messaging.js +1 -1
  82. package/node_modules/@weavecode/harness/dist/codex/plugin-state.js +1 -1
  83. package/node_modules/@weavecode/harness/dist/codex/toml.js +9 -9
  84. package/node_modules/@weavecode/harness/dist/driver.d.ts +110 -2
  85. package/node_modules/@weavecode/harness/dist/driver.js +1 -1
  86. package/node_modules/@weavecode/harness/dist/init/generated.js +2 -2
  87. package/node_modules/@weavecode/harness/dist/init/pipeline.js +1 -1
  88. package/node_modules/@weavecode/harness/dist/registry-wiring.js +1 -1
  89. package/node_modules/@weavecode/harness/dist/shared/install-link.js +1 -1
  90. package/node_modules/@weavecode/harness/dist/zcode/assets.d.ts +8 -0
  91. package/node_modules/@weavecode/harness/dist/zcode/assets.js +1 -0
  92. package/node_modules/@weavecode/harness/dist/zcode/capture.d.ts +36 -0
  93. package/node_modules/@weavecode/harness/dist/zcode/capture.js +3 -0
  94. package/node_modules/@weavecode/harness/dist/zcode/detect.d.ts +2 -0
  95. package/node_modules/@weavecode/harness/dist/zcode/detect.js +1 -0
  96. package/node_modules/@weavecode/harness/dist/zcode/event-source.d.ts +8 -0
  97. package/node_modules/@weavecode/harness/dist/zcode/event-source.js +1 -0
  98. package/node_modules/@weavecode/harness/dist/zcode/index.d.ts +13 -0
  99. package/node_modules/@weavecode/harness/dist/zcode/index.js +1 -0
  100. package/node_modules/@weavecode/harness/dist/zcode/mcp.d.ts +6 -0
  101. package/node_modules/@weavecode/harness/dist/zcode/mcp.js +2 -0
  102. package/node_modules/@weavecode/harness/dist/zcode/messaging.d.ts +13 -0
  103. package/node_modules/@weavecode/harness/dist/zcode/messaging.js +1 -0
  104. package/node_modules/@weavecode/harness/dist/zcode/resume.d.ts +7 -0
  105. package/node_modules/@weavecode/harness/dist/zcode/resume.js +1 -0
  106. package/node_modules/@weavecode/harness/package.json +2 -2
  107. package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
  108. package/node_modules/@weavecode/server/dist/daemon/hook-pipeline.d.ts +8 -1
  109. package/node_modules/@weavecode/server/dist/daemon/hook-pipeline.js +1 -1
  110. package/node_modules/@weavecode/server/dist/daemon/hooks-routes.js +1 -1
  111. package/node_modules/@weavecode/server/dist/daemon/server.d.ts +7 -0
  112. package/node_modules/@weavecode/server/dist/daemon/server.js +8 -6
  113. package/node_modules/@weavecode/server/dist/daemon/session-probe.d.ts +13 -0
  114. package/node_modules/@weavecode/server/dist/daemon/session-probe.js +1 -1
  115. package/node_modules/@weavecode/server/dist/daemon/snapshot-refresher.d.ts +7 -1
  116. package/node_modules/@weavecode/server/dist/daemon/snapshot-refresher.js +1 -1
  117. package/node_modules/@weavecode/server/dist/daemon/sse-hub.d.ts +40 -0
  118. package/node_modules/@weavecode/server/dist/daemon/sse-hub.js +1 -0
  119. package/node_modules/@weavecode/server/dist/daemon/start.js +1 -1
  120. package/node_modules/@weavecode/server/dist/db/db.js +20 -2
  121. package/node_modules/@weavecode/server/dist/hooks/bus.d.ts +5 -0
  122. package/node_modules/@weavecode/server/dist/hooks/inbox-worker.d.ts +8 -1
  123. package/node_modules/@weavecode/server/dist/hooks/inbox-worker.js +3 -3
  124. package/node_modules/@weavecode/server/dist/hooks/message-deliverer.d.ts +29 -0
  125. package/node_modules/@weavecode/server/dist/hooks/message-deliverer.js +2 -2
  126. package/node_modules/@weavecode/server/dist/hooks/mirror.d.ts +9 -4
  127. package/node_modules/@weavecode/server/dist/hooks/mirror.js +4 -4
  128. package/node_modules/@weavecode/server/dist/hooks/session-purge.d.ts +3 -0
  129. package/node_modules/@weavecode/server/dist/hooks/session-purge.js +1 -1
  130. package/node_modules/@weavecode/server/dist/hooks/side-questions.d.ts +41 -0
  131. package/node_modules/@weavecode/server/dist/hooks/side-questions.js +1 -0
  132. package/node_modules/@weavecode/server/dist/hooks/toolkit.js +5 -5
  133. package/node_modules/@weavecode/server/dist/install/apply-update.js +1 -1
  134. package/node_modules/@weavecode/server/dist/install/capabilities.d.ts +10 -0
  135. package/node_modules/@weavecode/server/dist/install/capabilities.js +1 -1
  136. package/node_modules/@weavecode/server/dist/install/codex-toml.d.ts +8 -26
  137. package/node_modules/@weavecode/server/dist/install/codex-toml.js +1 -1
  138. package/node_modules/@weavecode/server/dist/install/global-config.d.ts +2 -4
  139. package/node_modules/@weavecode/server/dist/install/global-config.js +1 -2
  140. package/node_modules/@weavecode/server/dist/install/installer.d.ts +3 -5
  141. package/node_modules/@weavecode/server/dist/install/installer.js +1 -3
  142. package/node_modules/@weavecode/server/dist/install/mcp-rows.d.ts +5 -5
  143. package/node_modules/@weavecode/server/dist/install/mcp-rows.js +1 -1
  144. package/node_modules/@weavecode/server/dist/registry.js +2 -2
  145. package/node_modules/@weavecode/server/dist/repositories/hook-events.d.ts +7 -0
  146. package/node_modules/@weavecode/server/dist/repositories/hook-events.js +2 -2
  147. package/node_modules/@weavecode/server/dist/repositories/sessions.d.ts +15 -4
  148. package/node_modules/@weavecode/server/dist/repositories/sessions.js +2 -2
  149. package/node_modules/@weavecode/server/dist/repositories/side-questions.d.ts +50 -0
  150. package/node_modules/@weavecode/server/dist/repositories/side-questions.js +6 -0
  151. package/node_modules/@weavecode/server/dist/statusline/config.d.ts +4 -198
  152. package/node_modules/@weavecode/server/dist/statusline/config.js +1 -1
  153. package/node_modules/@weavecode/server/dist/statusline/generator.d.ts +5 -0
  154. package/node_modules/@weavecode/server/dist/statusline/generator.js +1 -717
  155. package/node_modules/@weavecode/server/dist/statusline/manager.d.ts +5 -5
  156. package/node_modules/@weavecode/server/dist/statusline/manager.js +3 -4
  157. package/node_modules/@weavecode/server/dist/surfaces.d.ts +11 -1
  158. package/node_modules/@weavecode/server/dist/surfaces.js +1 -1
  159. package/node_modules/@weavecode/server/package.json +4 -4
  160. package/node_modules/@weavecode/server/web/dist/assets/index-CHWbLAje.js +594 -0
  161. package/node_modules/@weavecode/server/web/dist/assets/index-D0s5v8QS.css +11 -0
  162. package/node_modules/@weavecode/server/web/dist/index.html +2 -2
  163. package/node_modules/@weavecode/templates/package.json +2 -2
  164. package/package.json +6 -6
  165. package/node_modules/@weavecode/server/web/dist/assets/index-D5WFh77i.css +0 -11
  166. package/node_modules/@weavecode/server/web/dist/assets/index-DJibaGnJ.js +0 -585
@@ -0,0 +1,594 @@
1
+ var gw=e=>{throw TypeError(e)};var Gm=(e,t,n)=>t.has(e)||gw("Cannot "+n);var ae=(e,t,n)=>(Gm(e,t,"read from private field"),n?n.call(e):t.get(e)),et=(e,t,n)=>t.has(e)?gw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ye=(e,t,n,s)=>(Gm(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),xt=(e,t,n)=>(Gm(e,t,"access private method"),n);var mf=(e,t,n,s)=>({set _(r){Ye(e,t,r,n)},get _(){return ae(e,t,s)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var bw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var EC={exports:{}},Kp={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var oD=Symbol.for("react.transitional.element"),cD=Symbol.for("react.fragment");function _C(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:oD,type:e,key:s,ref:t!==void 0?t:null,props:n}}Kp.Fragment=cD;Kp.jsx=_C;Kp.jsxs=_C;EC.exports=Kp;var o=EC.exports,CC={exports:{}},at={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Sy=Symbol.for("react.transitional.element"),uD=Symbol.for("react.portal"),dD=Symbol.for("react.fragment"),fD=Symbol.for("react.strict_mode"),hD=Symbol.for("react.profiler"),pD=Symbol.for("react.consumer"),mD=Symbol.for("react.context"),gD=Symbol.for("react.forward_ref"),bD=Symbol.for("react.suspense"),xD=Symbol.for("react.memo"),TC=Symbol.for("react.lazy"),yD=Symbol.for("react.activity"),xw=Symbol.iterator;function vD(e){return e===null||typeof e!="object"?null:(e=xw&&e[xw]||e["@@iterator"],typeof e=="function"?e:null)}var AC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},MC=Object.assign,jC={};function wc(e,t,n){this.props=e,this.context=t,this.refs=jC,this.updater=n||AC}wc.prototype.isReactComponent={};wc.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")};wc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function RC(){}RC.prototype=wc.prototype;function Ny(e,t,n){this.props=e,this.context=t,this.refs=jC,this.updater=n||AC}var Ey=Ny.prototype=new RC;Ey.constructor=Ny;MC(Ey,wc.prototype);Ey.isPureReactComponent=!0;var yw=Array.isArray;function W0(){}var Yt={H:null,A:null,T:null,S:null},OC=Object.prototype.hasOwnProperty;function _y(e,t,n){var s=n.ref;return{$$typeof:Sy,type:e,key:t,ref:s!==void 0?s:null,props:n}}function kD(e,t){return _y(e.type,t,e.props)}function Cy(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sy}function wD(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var vw=/\/+/g;function Km(e,t){return typeof e=="object"&&e!==null&&e.key!=null?wD(""+e.key):t.toString(36)}function SD(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(W0,W0):(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 no(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Sy:case uD:a=!0;break;case TC:return a=e._init,no(a(e._payload),t,n,s,r)}}if(a)return r=r(e),a=s===""?"."+Km(e,0):s,yw(r)?(n="",a!=null&&(n=a.replace(vw,"$&/")+"/"),no(r,t,n,"",function(u){return u})):r!=null&&(Cy(r)&&(r=kD(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(vw,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=s===""?".":s+":";if(yw(e))for(var c=0;c<e.length;c++)s=e[c],i=l+Km(s,c),a+=no(s,t,n,i,r);else if(c=vD(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,i=l+Km(s,c++),a+=no(s,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return no(SD(e),t,n,s,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function gf(e,t,n){if(e==null)return e;var s=[],r=0;return no(e,s,"","",function(i){return t.call(n,i,r++)}),s}function ND(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var kw=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!==null&&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)},ED={map:gf,forEach:function(e,t,n){gf(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return gf(e,function(){t++}),t},toArray:function(e){return gf(e,function(t){return t})||[]},only:function(e){if(!Cy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};at.Activity=yD;at.Children=ED;at.Component=wc;at.Fragment=dD;at.Profiler=hD;at.PureComponent=Ny;at.StrictMode=fD;at.Suspense=bD;at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Yt;at.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Yt.H.useMemoCache(e)}};at.cache=function(e){return function(){return e.apply(null,arguments)}};at.cacheSignal=function(){return null};at.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=MC({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!OC.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(s[i]=t[i]);var i=arguments.length-2;if(i===1)s.children=n;else if(1<i){for(var a=Array(i),l=0;l<i;l++)a[l]=arguments[l+2];s.children=a}return _y(e.type,r,s)};at.createContext=function(e){return e={$$typeof:mD,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:pD,_context:e},e};at.createElement=function(e,t,n){var s,r={},i=null;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)OC.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(s in a=e.defaultProps,a)r[s]===void 0&&(r[s]=a[s]);return _y(e,i,r)};at.createRef=function(){return{current:null}};at.forwardRef=function(e){return{$$typeof:gD,render:e}};at.isValidElement=Cy;at.lazy=function(e){return{$$typeof:TC,_payload:{_status:-1,_result:e},_init:ND}};at.memo=function(e,t){return{$$typeof:xD,type:e,compare:t===void 0?null:t}};at.startTransition=function(e){var t=Yt.T,n={};Yt.T=n;try{var s=e(),r=Yt.S;r!==null&&r(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(W0,kw)}catch(i){kw(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),Yt.T=t}};at.unstable_useCacheRefresh=function(){return Yt.H.useCacheRefresh()};at.use=function(e){return Yt.H.use(e)};at.useActionState=function(e,t,n){return Yt.H.useActionState(e,t,n)};at.useCallback=function(e,t){return Yt.H.useCallback(e,t)};at.useContext=function(e){return Yt.H.useContext(e)};at.useDebugValue=function(){};at.useDeferredValue=function(e,t){return Yt.H.useDeferredValue(e,t)};at.useEffect=function(e,t){return Yt.H.useEffect(e,t)};at.useEffectEvent=function(e){return Yt.H.useEffectEvent(e)};at.useId=function(){return Yt.H.useId()};at.useImperativeHandle=function(e,t,n){return Yt.H.useImperativeHandle(e,t,n)};at.useInsertionEffect=function(e,t){return Yt.H.useInsertionEffect(e,t)};at.useLayoutEffect=function(e,t){return Yt.H.useLayoutEffect(e,t)};at.useMemo=function(e,t){return Yt.H.useMemo(e,t)};at.useOptimistic=function(e,t){return Yt.H.useOptimistic(e,t)};at.useReducer=function(e,t,n){return Yt.H.useReducer(e,t,n)};at.useRef=function(e){return Yt.H.useRef(e)};at.useState=function(e){return Yt.H.useState(e)};at.useSyncExternalStore=function(e,t,n){return Yt.H.useSyncExternalStore(e,t,n)};at.useTransition=function(){return Yt.H.useTransition()};at.version="19.2.8";CC.exports=at;var b=CC.exports;const ss=Cd(b);var DC={exports:{}},qp={},IC={exports:{}},LC={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(C,D){var U=C.length;C.push(D);e:for(;0<U;){var B=U-1>>>1,R=C[B];if(0<r(R,D))C[B]=D,C[U]=R,U=B;else break e}}function n(C){return C.length===0?null:C[0]}function s(C){if(C.length===0)return null;var D=C[0],U=C.pop();if(U!==D){C[0]=U;e:for(var B=0,R=C.length,_=R>>>1;B<_;){var K=2*(B+1)-1,T=C[K],X=K+1,ne=C[X];if(0>r(T,U))X<R&&0>r(ne,T)?(C[B]=ne,C[X]=U,B=X):(C[B]=T,C[K]=U,B=K);else if(X<R&&0>r(ne,U))C[B]=ne,C[X]=U,B=X;else break e}}return D}function r(C,D){var U=C.sortIndex-D.sortIndex;return U!==0?U:C.id-D.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,k=!1,w=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function S(C){for(var D=n(u);D!==null;){if(D.callback===null)s(u);else if(D.startTime<=C)s(u),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(u)}}function A(C){if(k=!1,S(C),!m)if(n(c)!==null)m=!0,E||(E=!0,G());else{var D=n(u);D!==null&&L(A,D.startTime-C)}}var E=!1,M=-1,j=5,O=-1;function N(){return w?!0:!(e.unstable_now()-O<j)}function F(){if(w=!1,E){var C=e.unstable_now();O=C;var D=!0;try{e:{m=!1,k&&(k=!1,y(M),M=-1),p=!0;var U=h;try{t:{for(S(C),f=n(c);f!==null&&!(f.expirationTime>C&&N());){var B=f.callback;if(typeof B=="function"){f.callback=null,h=f.priorityLevel;var R=B(f.expirationTime<=C);if(C=e.unstable_now(),typeof R=="function"){f.callback=R,S(C),D=!0;break t}f===n(c)&&s(c),S(C)}else s(c);f=n(c)}if(f!==null)D=!0;else{var _=n(u);_!==null&&L(A,_.startTime-C),D=!1}}break e}finally{f=null,h=U,p=!1}D=void 0}}finally{D?G():E=!1}}}var G;if(typeof x=="function")G=function(){x(F)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,I=H.port2;H.port1.onmessage=F,G=function(){I.postMessage(null)}}else G=function(){g(F,0)};function L(C,D){M=g(function(){C(e.unstable_now())},D)}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(C){C.callback=null},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(C){switch(h){case 1:case 2:case 3:var D=3;break;default:D=h}var U=h;h=D;try{return C()}finally{h=U}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(C,D){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var U=h;h=C;try{return D()}finally{h=U}},e.unstable_scheduleCallback=function(C,D,U){var B=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?B+U:B):U=B,C){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=U+R,C={id:d++,callback:D,priorityLevel:C,startTime:U,expirationTime:R,sortIndex:-1},U>B?(C.sortIndex=U,t(u,C),n(c)===null&&C===n(u)&&(k?(y(M),M=-1):k=!0,L(A,U-B))):(C.sortIndex=R,t(c,C),m||p||(m=!0,E||(E=!0,G()))),C},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(C){var D=h;return function(){var U=h;h=D;try{return C.apply(this,arguments)}finally{h=U}}}})(LC);IC.exports=LC;var _D=IC.exports,PC={exports:{}},as={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var CD=b;function zC(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 zi(){}var is={d:{f:zi,r:function(){throw Error(zC(522))},D:zi,C:zi,L:zi,m:zi,X:zi,S:zi,M:zi},p:0,findDOMNode:null},TD=Symbol.for("react.portal");function AD(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:TD,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}var pu=CD.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Yp(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}as.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=is;as.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(zC(299));return AD(e,t,null,n)};as.flushSync=function(e){var t=pu.T,n=is.p;try{if(pu.T=null,is.p=2,e)return e()}finally{pu.T=t,is.p=n,is.d.f()}};as.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,is.d.C(e,t))};as.prefetchDNS=function(e){typeof e=="string"&&is.d.D(e)};as.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=Yp(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?is.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:i}):n==="script"&&is.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};as.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Yp(t.as,t.crossOrigin);is.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==null&&is.d.M(e)};as.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=Yp(n,t.crossOrigin);is.d.L(e,n,{crossOrigin:s,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})}};as.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Yp(t.as,t.crossOrigin);is.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 is.d.m(e)};as.requestFormReset=function(e){is.d.r(e)};as.unstable_batchedUpdates=function(e,t){return e(t)};as.useFormState=function(e,t,n){return pu.H.useFormState(e,t,n)};as.useFormStatus=function(){return pu.H.useHostTransitionStatus()};as.version="19.2.8";function UC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(UC)}catch(e){console.error(e)}}UC(),PC.exports=as;var sn=PC.exports;/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var En=_D,FC=b,MD=sn;function je(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 BC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Td(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 HC(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 ww(e){if(Td(e)!==e)throw Error(je(188))}function jD(e){var t=e.alternate;if(!t){if(t=Td(e),t===null)throw Error(je(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return ww(r),e;if(i===s)return ww(r),t;i=i.sibling}throw Error(je(188))}if(n.return!==s.return)n=r,s=i;else{for(var a=!1,l=r.child;l;){if(l===n){a=!0,n=r,s=i;break}if(l===s){a=!0,s=r,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,s=r;break}if(l===s){a=!0,s=i,n=r;break}l=l.sibling}if(!a)throw Error(je(189))}}if(n.alternate!==s)throw Error(je(190))}if(n.tag!==3)throw Error(je(188));return n.stateNode.current===n?e:t}function GC(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=GC(e),t!==null)return t;e=e.sibling}return null}var Xt=Object.assign,RD=Symbol.for("react.element"),bf=Symbol.for("react.transitional.element"),eu=Symbol.for("react.portal"),oo=Symbol.for("react.fragment"),KC=Symbol.for("react.strict_mode"),Z0=Symbol.for("react.profiler"),qC=Symbol.for("react.consumer"),gi=Symbol.for("react.context"),Ty=Symbol.for("react.forward_ref"),J0=Symbol.for("react.suspense"),eb=Symbol.for("react.suspense_list"),Ay=Symbol.for("react.memo"),Qi=Symbol.for("react.lazy"),tb=Symbol.for("react.activity"),OD=Symbol.for("react.memo_cache_sentinel"),Sw=Symbol.iterator;function Uc(e){return e===null||typeof e!="object"?null:(e=Sw&&e[Sw]||e["@@iterator"],typeof e=="function"?e:null)}var DD=Symbol.for("react.client.reference");function nb(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===DD?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case oo:return"Fragment";case Z0:return"Profiler";case KC:return"StrictMode";case J0:return"Suspense";case eb:return"SuspenseList";case tb:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case eu:return"Portal";case gi:return e.displayName||"Context";case qC:return(e._context.displayName||"Context")+".Consumer";case Ty:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ay:return t=e.displayName||null,t!==null?t:nb(e.type)||"Memo";case Qi:t=e._payload,e=e._init;try{return nb(e(t))}catch{}}return null}var tu=Array.isArray,nt=FC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Mt=MD.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,hl={pending:!1,data:null,method:null,action:null},sb=[],co=-1;function Gr(e){return{current:e}}function On(e){0>co||(e.current=sb[co],sb[co]=null,co--)}function Bt(e,t){co++,sb[co]=e.current,e.current=t}var Ur=Gr(null),zu=Gr(null),ya=Gr(null),Gh=Gr(null);function Kh(e,t){switch(Bt(ya,t),Bt(zu,e),Bt(Ur,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?A1(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=A1(t),e=fA(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}On(Ur),Bt(Ur,e)}function Zo(){On(Ur),On(zu),On(ya)}function rb(e){e.memoizedState!==null&&Bt(Gh,e);var t=Ur.current,n=fA(t,e.type);t!==n&&(Bt(zu,e),Bt(Ur,n))}function qh(e){zu.current===e&&(On(Ur),On(zu)),Gh.current===e&&(On(Gh),Xu._currentValue=hl)}var qm,Nw;function Xa(e){if(qm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qm=t&&t[1]||"",Nw=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+qm+e+Nw}var Ym=!1;function Vm(e,t){if(!e||Ym)return"";Ym=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(p){var h=p}Reflect.construct(e,[],f)}else{try{f.call()}catch(p){h=p}e.call(f.prototype)}}else{try{throw Error()}catch(p){h=p}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(p){if(p&&h&&typeof p.stack=="string")return[p.stack,h.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=s.DetermineComponentFrameRoot(),a=i[0],l=i[1];if(a&&l){var c=a.split(`
44
+ `),u=l.split(`
45
+ `);for(r=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(s===c.length||r===u.length)for(s=c.length-1,r=u.length-1;1<=s&&0<=r&&c[s]!==u[r];)r--;for(;1<=s&&0<=r;s--,r--)if(c[s]!==u[r]){if(s!==1||r!==1)do if(s--,r--,0>r||c[s]!==u[r]){var d=`
46
+ `+c[s].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=s&&0<=r);break}}}finally{Ym=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Xa(n):""}function ID(e,t){switch(e.tag){case 26:case 27:case 5:return Xa(e.type);case 16:return Xa("Lazy");case 13:return e.child!==t&&t!==null?Xa("Suspense Fallback"):Xa("Suspense");case 19:return Xa("SuspenseList");case 0:case 15:return Vm(e.type,!1);case 11:return Vm(e.type.render,!1);case 1:return Vm(e.type,!0);case 31:return Xa("Activity");default:return""}}function Ew(e){try{var t="",n=null;do t+=ID(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var ib=Object.prototype.hasOwnProperty,My=En.unstable_scheduleCallback,Xm=En.unstable_cancelCallback,LD=En.unstable_shouldYield,PD=En.unstable_requestPaint,As=En.unstable_now,zD=En.unstable_getCurrentPriorityLevel,YC=En.unstable_ImmediatePriority,VC=En.unstable_UserBlockingPriority,Yh=En.unstable_NormalPriority,UD=En.unstable_LowPriority,XC=En.unstable_IdlePriority,FD=En.log,BD=En.unstable_setDisableYieldValue,Ad=null,Ms=null;function fa(e){if(typeof FD=="function"&&BD(e),Ms&&typeof Ms.setStrictMode=="function")try{Ms.setStrictMode(Ad,e)}catch{}}var js=Math.clz32?Math.clz32:GD,HD=Math.log,$D=Math.LN2;function GD(e){return e>>>=0,e===0?32:31-(HD(e)/$D|0)|0}var xf=256,yf=262144,vf=4194304;function Qa(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 Vp(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~i,s!==0?r=Qa(s):(a&=l,a!==0?r=Qa(a):n||(n=l&~e,n!==0&&(r=Qa(n))))):(l=s&~i,l!==0?r=Qa(l):a!==0?r=Qa(a):n||(n=s&~e,n!==0&&(r=Qa(n)))),r===0?0:t!==0&&t!==r&&!(t&i)&&(i=r&-r,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:r}function Md(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function KD(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 QC(){var e=vf;return vf<<=1,!(vf&62914560)&&(vf=4194304),e}function Qm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function jd(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qD(e,t,n,s,r,i){var a=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 l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0<n;){var d=31-js(n),f=1<<d;l[d]=0,c[d]=-1;var h=u[d];if(h!==null)for(u[d]=null,d=0;d<h.length;d++){var p=h[d];p!==null&&(p.lane&=-536870913)}n&=~f}s!==0&&WC(e,s,0),i!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=i&~(a&~t))}function WC(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-js(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function ZC(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-js(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}function JC(e,t){var n=t&-t;return n=n&42?1:jy(n),n&(e.suspendedLanes|t)?0:n}function jy(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 Ry(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function eT(){var e=Mt.p;return e!==0?e:(e=window.event,e===void 0?32:SA(e.type))}function _w(e,t){var n=Mt.p;try{return Mt.p=e,t()}finally{Mt.p=n}}var Ia=Math.random().toString(36).slice(2),zn="__reactFiber$"+Ia,bs="__reactProps$"+Ia,Sc="__reactContainer$"+Ia,ab="__reactEvents$"+Ia,YD="__reactListeners$"+Ia,VD="__reactHandles$"+Ia,Cw="__reactResources$"+Ia,Rd="__reactMarker$"+Ia;function Oy(e){delete e[zn],delete e[bs],delete e[ab],delete e[YD],delete e[VD]}function uo(e){var t=e[zn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sc]||n[zn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=D1(e);e!==null;){if(n=e[zn])return n;e=D1(e)}return t}e=n,n=e.parentNode}return null}function Nc(e){if(e=e[zn]||e[Sc]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function nu(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(je(33))}function Eo(e){var t=e[Cw];return t||(t=e[Cw]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Rn(e){e[Rd]=!0}var tT=new Set,nT={};function Hl(e,t){Jo(e,t),Jo(e+"Capture",t)}function Jo(e,t){for(nT[e]=t,e=0;e<t.length;e++)tT.add(t[e])}var XD=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]*$"),Tw={},Aw={};function QD(e){return ib.call(Aw,e)?!0:ib.call(Tw,e)?!1:XD.test(e)?Aw[e]=!0:(Tw[e]=!0,!1)}function bh(e,t,n){if(QD(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function kf(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 ni(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function Bs(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sT(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function WD(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,i=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lb(e){if(!e._valueTracker){var t=sT(e)?"checked":"value";e._valueTracker=WD(e,t,""+e[t])}}function rT(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=sT(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Vh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ZD=/[\n"\\]/g;function Ks(e){return e.replace(ZD,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ob(e,t,n,s,r,i,a,l){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Bs(t)):e.value!==""+Bs(t)&&(e.value=""+Bs(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?cb(e,a,Bs(t)):n!=null?cb(e,a,Bs(n)):s!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Bs(l):e.removeAttribute("name")}function iT(e,t,n,s,r,i,a,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){lb(e);return}n=n!=null?""+Bs(n):"",t=t!=null?""+Bs(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),lb(e)}function cb(e,t,n){t==="number"&&Vh(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function _o(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Bs(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function aT(e,t,n){if(t!=null&&(t=""+Bs(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Bs(n):""}function lT(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(je(92));if(tu(s)){if(1<s.length)throw Error(je(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=Bs(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),lb(e)}function ec(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var JD=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 Mw(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||JD.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function oT(e,t,n){if(t!=null&&typeof t!="object")throw Error(je(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var r in t)s=t[r],t.hasOwnProperty(r)&&n[r]!==s&&Mw(e,r,s)}else for(var i in t)t.hasOwnProperty(i)&&Mw(e,i,t[i])}function Dy(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 eI=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"]]),tI=/^[\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 xh(e){return tI.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function bi(){}var ub=null;function Iy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fo=null,Co=null;function jw(e){var t=Nc(e);if(t&&(e=t.stateNode)){var n=e[bs]||null;e:switch(e=t.stateNode,t.type){case"input":if(ob(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="'+Ks(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=s[bs]||null;if(!r)throw Error(je(90));ob(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&rT(s)}break e;case"textarea":aT(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&_o(e,!!n.multiple,t,!1)}}}var Wm=!1;function cT(e,t,n){if(Wm)return e(t,n);Wm=!0;try{var s=e(t);return s}finally{if(Wm=!1,(fo!==null||Co!==null)&&(am(),fo&&(t=fo,e=Co,Co=fo=null,jw(t),e)))for(t=0;t<e.length;t++)jw(e[t])}}function Uu(e,t){var n=e.stateNode;if(n===null)return null;var s=n[bs]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(je(231,t,typeof n));return n}var Ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),db=!1;if(Ni)try{var Fc={};Object.defineProperty(Fc,"passive",{get:function(){db=!0}}),window.addEventListener("test",Fc,Fc),window.removeEventListener("test",Fc,Fc)}catch{db=!1}var ha=null,Ly=null,yh=null;function uT(){if(yh)return yh;var e,t=Ly,n=t.length,s,r="value"in ha?ha.value:ha.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var a=n-e;for(s=1;s<=a&&t[n-s]===r[i-s];s++);return yh=r.slice(e,1<s?1-s:void 0)}function vh(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 wf(){return!0}function Rw(){return!1}function xs(e){function t(n,s,r,i,a){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?wf:Rw,this.isPropagationStopped=Rw,this}return Xt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=wf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=wf)},persist:function(){},isPersistent:wf}),t}var $l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xp=xs($l),Od=Xt({},$l,{view:0,detail:0}),nI=xs(Od),Zm,Jm,Bc,Qp=Xt({},Od,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Py,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!==Bc&&(Bc&&e.type==="mousemove"?(Zm=e.screenX-Bc.screenX,Jm=e.screenY-Bc.screenY):Jm=Zm=0,Bc=e),Zm)},movementY:function(e){return"movementY"in e?e.movementY:Jm}}),Ow=xs(Qp),sI=Xt({},Qp,{dataTransfer:0}),rI=xs(sI),iI=Xt({},Od,{relatedTarget:0}),eg=xs(iI),aI=Xt({},$l,{animationName:0,elapsedTime:0,pseudoElement:0}),lI=xs(aI),oI=Xt({},$l,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cI=xs(oI),uI=Xt({},$l,{data:0}),Dw=xs(uI),dI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fI={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"},hI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hI[e])?!!t[e]:!1}function Py(){return pI}var mI=Xt({},Od,{key:function(e){if(e.key){var t=dI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Py,charCode:function(e){return e.type==="keypress"?vh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gI=xs(mI),bI=Xt({},Qp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Iw=xs(bI),xI=Xt({},Od,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Py}),yI=xs(xI),vI=Xt({},$l,{propertyName:0,elapsedTime:0,pseudoElement:0}),kI=xs(vI),wI=Xt({},Qp,{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}),SI=xs(wI),NI=Xt({},$l,{newState:0,oldState:0}),EI=xs(NI),_I=[9,13,27,32],zy=Ni&&"CompositionEvent"in window,mu=null;Ni&&"documentMode"in document&&(mu=document.documentMode);var CI=Ni&&"TextEvent"in window&&!mu,dT=Ni&&(!zy||mu&&8<mu&&11>=mu),Lw=" ",Pw=!1;function fT(e,t){switch(e){case"keyup":return _I.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ho=!1;function TI(e,t){switch(e){case"compositionend":return hT(t);case"keypress":return t.which!==32?null:(Pw=!0,Lw);case"textInput":return e=t.data,e===Lw&&Pw?null:e;default:return null}}function AI(e,t){if(ho)return e==="compositionend"||!zy&&fT(e,t)?(e=uT(),yh=Ly=ha=null,ho=!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 dT&&t.locale!=="ko"?null:t.data;default:return null}}var MI={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 zw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!MI[e.type]:t==="textarea"}function pT(e,t,n,s){fo?Co?Co.push(s):Co=[s]:fo=s,t=fp(t,"onChange"),0<t.length&&(n=new Xp("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var gu=null,Fu=null;function jI(e){cA(e,0)}function Wp(e){var t=nu(e);if(rT(t))return e}function Uw(e,t){if(e==="change")return t}var mT=!1;if(Ni){var tg;if(Ni){var ng="oninput"in document;if(!ng){var Fw=document.createElement("div");Fw.setAttribute("oninput","return;"),ng=typeof Fw.oninput=="function"}tg=ng}else tg=!1;mT=tg&&(!document.documentMode||9<document.documentMode)}function Bw(){gu&&(gu.detachEvent("onpropertychange",gT),Fu=gu=null)}function gT(e){if(e.propertyName==="value"&&Wp(Fu)){var t=[];pT(t,Fu,e,Iy(e)),cT(jI,t)}}function RI(e,t,n){e==="focusin"?(Bw(),gu=t,Fu=n,gu.attachEvent("onpropertychange",gT)):e==="focusout"&&Bw()}function OI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wp(Fu)}function DI(e,t){if(e==="click")return Wp(t)}function II(e,t){if(e==="input"||e==="change")return Wp(t)}function LI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Os=typeof Object.is=="function"?Object.is:LI;function Bu(e,t){if(Os(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!ib.call(t,r)||!Os(e[r],t[r]))return!1}return!0}function Hw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $w(e,t){var n=Hw(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Hw(n)}}function bT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xT(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Vh(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=Vh(e.document)}return t}function Uy(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 PI=Ni&&"documentMode"in document&&11>=document.documentMode,po=null,fb=null,bu=null,hb=!1;function Gw(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;hb||po==null||po!==Vh(s)||(s=po,"selectionStart"in s&&Uy(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),bu&&Bu(bu,s)||(bu=s,s=fp(fb,"onSelect"),0<s.length&&(t=new Xp("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=po)))}function Ga(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mo={animationend:Ga("Animation","AnimationEnd"),animationiteration:Ga("Animation","AnimationIteration"),animationstart:Ga("Animation","AnimationStart"),transitionrun:Ga("Transition","TransitionRun"),transitionstart:Ga("Transition","TransitionStart"),transitioncancel:Ga("Transition","TransitionCancel"),transitionend:Ga("Transition","TransitionEnd")},sg={},yT={};Ni&&(yT=document.createElement("div").style,"AnimationEvent"in window||(delete mo.animationend.animation,delete mo.animationiteration.animation,delete mo.animationstart.animation),"TransitionEvent"in window||delete mo.transitionend.transition);function Gl(e){if(sg[e])return sg[e];if(!mo[e])return e;var t=mo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yT)return sg[e]=t[n];return e}var vT=Gl("animationend"),kT=Gl("animationiteration"),wT=Gl("animationstart"),zI=Gl("transitionrun"),UI=Gl("transitionstart"),FI=Gl("transitioncancel"),ST=Gl("transitionend"),NT=new Map,pb="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(" ");pb.push("scrollEnd");function br(e,t){NT.set(e,t),Hl(t,[e])}var Xh=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!==null&&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)},zs=[],go=0,Fy=0;function Zp(){for(var e=go,t=Fy=go=0;t<e;){var n=zs[t];zs[t++]=null;var s=zs[t];zs[t++]=null;var r=zs[t];zs[t++]=null;var i=zs[t];if(zs[t++]=null,s!==null&&r!==null){var a=s.pending;a===null?r.next=r:(r.next=a.next,a.next=r),s.pending=r}i!==0&&ET(n,r,i)}}function Jp(e,t,n,s){zs[go++]=e,zs[go++]=t,zs[go++]=n,zs[go++]=s,Fy|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function By(e,t,n,s){return Jp(e,t,n,s),Qh(e)}function Kl(e,t){return Jp(e,null,null,t),Qh(e)}function ET(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var r=!1,i=e.return;i!==null;)i.childLanes|=n,s=i.alternate,s!==null&&(s.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(r=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,r&&t!==null&&(r=31-js(n),e=i.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=n|536870912),i):null}function Qh(e){if(50<_u)throw _u=0,Ib=null,Error(je(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bo={};function BI(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _s(e,t,n,s){return new BI(e,t,n,s)}function Hy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vi(e,t){var n=e.alternate;return n===null?(n=_s(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 _T(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 kh(e,t,n,s,r,i){var a=0;if(s=e,typeof e=="function")Hy(e)&&(a=1);else if(typeof e=="string")a=q4(e,n,Ur.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case tb:return e=_s(31,n,t,r),e.elementType=tb,e.lanes=i,e;case oo:return pl(n.children,r,i,t);case KC:a=8,r|=24;break;case Z0:return e=_s(12,n,t,r|2),e.elementType=Z0,e.lanes=i,e;case J0:return e=_s(13,n,t,r),e.elementType=J0,e.lanes=i,e;case eb:return e=_s(19,n,t,r),e.elementType=eb,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gi:a=10;break e;case qC:a=9;break e;case Ty:a=11;break e;case Ay:a=14;break e;case Qi:a=16,s=null;break e}a=29,n=Error(je(130,e===null?"null":typeof e,"")),s=null}return t=_s(a,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function pl(e,t,n,s){return e=_s(7,e,s,t),e.lanes=n,e}function rg(e,t,n){return e=_s(6,e,null,t),e.lanes=n,e}function CT(e){var t=_s(18,null,null,0);return t.stateNode=e,t}function ig(e,t,n){return t=_s(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Kw=new WeakMap;function qs(e,t){if(typeof e=="object"&&e!==null){var n=Kw.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ew(t)},Kw.set(e,t),t)}return{value:e,source:t,stack:Ew(t)}}var xo=[],yo=0,Wh=null,Hu=0,Hs=[],$s=0,Aa=null,Ir=1,Lr="";function ui(e,t){xo[yo++]=Hu,xo[yo++]=Wh,Wh=e,Hu=t}function TT(e,t,n){Hs[$s++]=Ir,Hs[$s++]=Lr,Hs[$s++]=Aa,Aa=e;var s=Ir;e=Lr;var r=32-js(s)-1;s&=~(1<<r),n+=1;var i=32-js(t)+r;if(30<i){var a=r-r%5;i=(s&(1<<a)-1).toString(32),s>>=a,r-=a,Ir=1<<32-js(t)+r|n<<r|s,Lr=i+e}else Ir=1<<i|n<<r|s,Lr=e}function $y(e){e.return!==null&&(ui(e,1),TT(e,1,0))}function Gy(e){for(;e===Wh;)Wh=xo[--yo],xo[yo]=null,Hu=xo[--yo],xo[yo]=null;for(;e===Aa;)Aa=Hs[--$s],Hs[$s]=null,Lr=Hs[--$s],Hs[$s]=null,Ir=Hs[--$s],Hs[$s]=null}function AT(e,t){Hs[$s++]=Ir,Hs[$s++]=Lr,Hs[$s++]=Aa,Ir=t.id,Lr=t.overflow,Aa=e}var Un=null,qt=null,kt=!1,va=null,Ys=!1,mb=Error(je(519));function Ma(e){var t=Error(je(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw $u(qs(t,e)),mb}function qw(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[zn]=e,t[bs]=s,n){case"dialog":gt("cancel",t),gt("close",t);break;case"iframe":case"object":case"embed":gt("load",t);break;case"video":case"audio":for(n=0;n<Yu.length;n++)gt(Yu[n],t);break;case"source":gt("error",t);break;case"img":case"image":case"link":gt("error",t),gt("load",t);break;case"details":gt("toggle",t);break;case"input":gt("invalid",t),iT(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":gt("invalid",t);break;case"textarea":gt("invalid",t),lT(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||dA(t.textContent,n)?(s.popover!=null&&(gt("beforetoggle",t),gt("toggle",t)),s.onScroll!=null&&gt("scroll",t),s.onScrollEnd!=null&&gt("scrollend",t),s.onClick!=null&&(t.onclick=bi),t=!0):t=!1,t||Ma(e,!0)}function Yw(e){for(Un=e.return;Un;)switch(Un.tag){case 5:case 31:case 13:Ys=!1;return;case 27:case 3:Ys=!0;return;default:Un=Un.return}}function Wl(e){if(e!==Un)return!1;if(!kt)return Yw(e),kt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Fb(e.type,e.memoizedProps)),n=!n),n&&qt&&Ma(e),Yw(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(je(317));qt=O1(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(je(317));qt=O1(e)}else t===27?(t=qt,La(e.type)?(e=Gb,Gb=null,qt=e):qt=t):qt=Un?Ws(e.stateNode.nextSibling):null;return!0}function Cl(){qt=Un=null,kt=!1}function ag(){var e=va;return e!==null&&(hs===null?hs=e:hs.push.apply(hs,e),va=null),e}function $u(e){va===null?va=[e]:va.push(e)}var gb=Gr(null),ql=null,xi=null;function ea(e,t,n){Bt(gb,t._currentValue),t._currentValue=n}function ki(e){e._currentValue=gb.current,On(gb)}function bb(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function xb(e,t,n,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=r.dependencies;if(i!==null){var a=r.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),bb(i.return,n,e),s||(a=null);break e}i=l.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(je(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),bb(a,n,e),a=null}else a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===e){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function Ec(e,t,n,s){e=null;for(var r=t,i=!1;r!==null;){if(!i){if(r.flags&524288)i=!0;else if(r.flags&262144)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(je(387));if(a=a.memoizedProps,a!==null){var l=r.type;Os(r.pendingProps.value,a.value)||(e!==null?e.push(l):e=[l])}}else if(r===Gh.current){if(a=r.alternate,a===null)throw Error(je(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Xu):e=[Xu])}r=r.return}e!==null&&xb(t,e,n,s),t.flags|=262144}function Zh(e){for(e=e.firstContext;e!==null;){if(!Os(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Tl(e){ql=e,xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Fn(e){return MT(ql,e)}function Sf(e,t){return ql===null&&Tl(e),MT(e,t)}function MT(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},xi===null){if(e===null)throw Error(je(308));xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xi=xi.next=t;return n}var HI=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},$I=En.unstable_scheduleCallback,GI=En.unstable_NormalPriority,mn={$$typeof:gi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ky(){return{controller:new HI,data:new Map,refCount:0}}function Dd(e){e.refCount--,e.refCount===0&&$I(GI,function(){e.controller.abort()})}var xu=null,yb=0,tc=0,To=null;function KI(e,t){if(xu===null){var n=xu=[];yb=0,tc=gv(),To={status:"pending",value:void 0,then:function(s){n.push(s)}}}return yb++,t.then(Vw,Vw),t}function Vw(){if(--yb===0&&xu!==null){To!==null&&(To.status="fulfilled");var e=xu;xu=null,tc=0,To=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function qI(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),s}var Xw=nt.S;nt.S=function(e,t){G2=As(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&KI(e,t),Xw!==null&&Xw(e,t)};var ml=Gr(null);function qy(){var e=ml.current;return e!==null?e:Ut.pooledCache}function wh(e,t){t===null?Bt(ml,ml.current):Bt(ml,t.pool)}function jT(){var e=qy();return e===null?null:{parent:mn._currentValue,pool:e}}var _c=Error(je(460)),Yy=Error(je(474)),em=Error(je(542)),Jh={then:function(){}};function Qw(e){return e=e.status,e==="fulfilled"||e==="rejected"}function RT(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bi,bi),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zw(e),e;default:if(typeof t.status=="string")t.then(bi,bi);else{if(e=Ut,e!==null&&100<e.shellSuspendCounter)throw Error(je(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zw(e),e}throw gl=t,_c}}function Wa(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(gl=n,_c):n}}var gl=null;function Ww(){if(gl===null)throw Error(je(459));var e=gl;return gl=null,e}function Zw(e){if(e===_c||e===em)throw Error(je(483))}var Ao=null,Gu=0;function Nf(e){var t=Gu;return Gu+=1,Ao===null&&(Ao=[]),RT(Ao,e,t)}function Hc(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ef(e,t){throw t.$$typeof===RD?Error(je(525)):(e=Object.prototype.toString.call(t),Error(je(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function OT(e){function t(g,y){if(e){var x=g.deletions;x===null?(g.deletions=[y],g.flags|=16):x.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function s(g){for(var y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function r(g,y){return g=vi(g,y),g.index=0,g.sibling=null,g}function i(g,y,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<y?(g.flags|=67108866,y):x):(g.flags|=67108866,y)):(g.flags|=1048576,y)}function a(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function l(g,y,x,S){return y===null||y.tag!==6?(y=rg(x,g.mode,S),y.return=g,y):(y=r(y,x),y.return=g,y)}function c(g,y,x,S){var A=x.type;return A===oo?d(g,y,x.props.children,S,x.key):y!==null&&(y.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Qi&&Wa(A)===y.type)?(y=r(y,x.props),Hc(y,x),y.return=g,y):(y=kh(x.type,x.key,x.props,null,g.mode,S),Hc(y,x),y.return=g,y)}function u(g,y,x,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=ig(x,g.mode,S),y.return=g,y):(y=r(y,x.children||[]),y.return=g,y)}function d(g,y,x,S,A){return y===null||y.tag!==7?(y=pl(x,g.mode,S,A),y.return=g,y):(y=r(y,x),y.return=g,y)}function f(g,y,x){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=rg(""+y,g.mode,x),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case bf:return x=kh(y.type,y.key,y.props,null,g.mode,x),Hc(x,y),x.return=g,x;case eu:return y=ig(y,g.mode,x),y.return=g,y;case Qi:return y=Wa(y),f(g,y,x)}if(tu(y)||Uc(y))return y=pl(y,g.mode,x,null),y.return=g,y;if(typeof y.then=="function")return f(g,Nf(y),x);if(y.$$typeof===gi)return f(g,Sf(g,y),x);Ef(g,y)}return null}function h(g,y,x,S){var A=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return A!==null?null:l(g,y,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case bf:return x.key===A?c(g,y,x,S):null;case eu:return x.key===A?u(g,y,x,S):null;case Qi:return x=Wa(x),h(g,y,x,S)}if(tu(x)||Uc(x))return A!==null?null:d(g,y,x,S,null);if(typeof x.then=="function")return h(g,y,Nf(x),S);if(x.$$typeof===gi)return h(g,y,Sf(g,x),S);Ef(g,x)}return null}function p(g,y,x,S,A){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return g=g.get(x)||null,l(y,g,""+S,A);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case bf:return g=g.get(S.key===null?x:S.key)||null,c(y,g,S,A);case eu:return g=g.get(S.key===null?x:S.key)||null,u(y,g,S,A);case Qi:return S=Wa(S),p(g,y,x,S,A)}if(tu(S)||Uc(S))return g=g.get(x)||null,d(y,g,S,A,null);if(typeof S.then=="function")return p(g,y,x,Nf(S),A);if(S.$$typeof===gi)return p(g,y,x,Sf(y,S),A);Ef(y,S)}return null}function m(g,y,x,S){for(var A=null,E=null,M=y,j=y=0,O=null;M!==null&&j<x.length;j++){M.index>j?(O=M,M=null):O=M.sibling;var N=h(g,M,x[j],S);if(N===null){M===null&&(M=O);break}e&&M&&N.alternate===null&&t(g,M),y=i(N,y,j),E===null?A=N:E.sibling=N,E=N,M=O}if(j===x.length)return n(g,M),kt&&ui(g,j),A;if(M===null){for(;j<x.length;j++)M=f(g,x[j],S),M!==null&&(y=i(M,y,j),E===null?A=M:E.sibling=M,E=M);return kt&&ui(g,j),A}for(M=s(M);j<x.length;j++)O=p(M,g,j,x[j],S),O!==null&&(e&&O.alternate!==null&&M.delete(O.key===null?j:O.key),y=i(O,y,j),E===null?A=O:E.sibling=O,E=O);return e&&M.forEach(function(F){return t(g,F)}),kt&&ui(g,j),A}function k(g,y,x,S){if(x==null)throw Error(je(151));for(var A=null,E=null,M=y,j=y=0,O=null,N=x.next();M!==null&&!N.done;j++,N=x.next()){M.index>j?(O=M,M=null):O=M.sibling;var F=h(g,M,N.value,S);if(F===null){M===null&&(M=O);break}e&&M&&F.alternate===null&&t(g,M),y=i(F,y,j),E===null?A=F:E.sibling=F,E=F,M=O}if(N.done)return n(g,M),kt&&ui(g,j),A;if(M===null){for(;!N.done;j++,N=x.next())N=f(g,N.value,S),N!==null&&(y=i(N,y,j),E===null?A=N:E.sibling=N,E=N);return kt&&ui(g,j),A}for(M=s(M);!N.done;j++,N=x.next())N=p(M,g,j,N.value,S),N!==null&&(e&&N.alternate!==null&&M.delete(N.key===null?j:N.key),y=i(N,y,j),E===null?A=N:E.sibling=N,E=N);return e&&M.forEach(function(G){return t(g,G)}),kt&&ui(g,j),A}function w(g,y,x,S){if(typeof x=="object"&&x!==null&&x.type===oo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case bf:e:{for(var A=x.key;y!==null;){if(y.key===A){if(A=x.type,A===oo){if(y.tag===7){n(g,y.sibling),S=r(y,x.props.children),S.return=g,g=S;break e}}else if(y.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Qi&&Wa(A)===y.type){n(g,y.sibling),S=r(y,x.props),Hc(S,x),S.return=g,g=S;break e}n(g,y);break}else t(g,y);y=y.sibling}x.type===oo?(S=pl(x.props.children,g.mode,S,x.key),S.return=g,g=S):(S=kh(x.type,x.key,x.props,null,g.mode,S),Hc(S,x),S.return=g,g=S)}return a(g);case eu:e:{for(A=x.key;y!==null;){if(y.key===A)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(g,y.sibling),S=r(y,x.children||[]),S.return=g,g=S;break e}else{n(g,y);break}else t(g,y);y=y.sibling}S=ig(x,g.mode,S),S.return=g,g=S}return a(g);case Qi:return x=Wa(x),w(g,y,x,S)}if(tu(x))return m(g,y,x,S);if(Uc(x)){if(A=Uc(x),typeof A!="function")throw Error(je(150));return x=A.call(x),k(g,y,x,S)}if(typeof x.then=="function")return w(g,y,Nf(x),S);if(x.$$typeof===gi)return w(g,y,Sf(g,x),S);Ef(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,y!==null&&y.tag===6?(n(g,y.sibling),S=r(y,x),S.return=g,g=S):(n(g,y),S=rg(x,g.mode,S),S.return=g,g=S),a(g)):n(g,y)}return function(g,y,x,S){try{Gu=0;var A=w(g,y,x,S);return Ao=null,A}catch(M){if(M===_c||M===em)throw M;var E=_s(29,M,null,g.mode);return E.lanes=S,E.return=g,E}finally{}}}var Al=OT(!0),DT=OT(!1),Wi=!1;function Vy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vb(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 ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wa(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Tt&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=Qh(e),ET(e,null,n),t}return Jp(e,s,t,n),Qh(e)}function yu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,ZC(e,n)}}function lg(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?r=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var kb=!1;function vu(){if(kb){var e=To;if(e!==null)throw e}}function ku(e,t,n,s){kb=!1;var r=e.updateQueue;Wi=!1;var i=r.firstBaseUpdate,a=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=r.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane&-536870913,p=h!==l.lane;if(p?(yt&h)===h:(s&h)===h){h!==0&&h===tc&&(kb=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,k=l;h=t;var w=n;switch(k.tag){case 1:if(m=k.payload,typeof m=="function"){f=m.call(w,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=k.payload,h=typeof m=="function"?m.call(w,f,h):m,h==null)break e;f=Xt({},f,h);break e;case 2:Wi=!0}}h=l.callback,h!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[h]:p.push(h))}else p={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,i===null&&(r.shared.lanes=0),Ra|=a,e.lanes=a,e.memoizedState=f}}function IT(e,t){if(typeof e!="function")throw Error(je(191,e));e.call(t)}function LT(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)IT(n[e],t)}var nc=Gr(null),ep=Gr(0);function Jw(e,t){e=Ti,Bt(ep,e),Bt(nc,t),Ti=e|t.baseLanes}function wb(){Bt(ep,Ti),Bt(nc,nc.current)}function Xy(){Ti=ep.current,On(nc),On(ep)}var Ds=Gr(null),Qs=null;function ta(e){var t=e.alternate;Bt(cn,cn.current&1),Bt(Ds,e),Qs===null&&(t===null||nc.current!==null||t.memoizedState!==null)&&(Qs=e)}function Sb(e){Bt(cn,cn.current),Bt(Ds,e),Qs===null&&(Qs=e)}function PT(e){e.tag===22?(Bt(cn,cn.current),Bt(Ds,e),Qs===null&&(Qs=e)):na()}function na(){Bt(cn,cn.current),Bt(Ds,Ds.current)}function Es(e){On(Ds),Qs===e&&(Qs=null),On(cn)}var cn=Gr(0);function tp(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Hb(n)||$b(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 Ei=0,ot=null,Pt=null,hn=null,np=!1,Mo=!1,Ml=!1,sp=0,Ku=0,jo=null,YI=0;function ln(){throw Error(je(321))}function Qy(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Os(e[n],t[n]))return!1;return!0}function Wy(e,t,n,s,r,i){return Ei=i,ot=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,nt.H=e===null||e.memoizedState===null?p2:ov,Ml=!1,i=n(s,r),Ml=!1,Mo&&(i=UT(t,n,s,r)),zT(e),i}function zT(e){nt.H=qu;var t=Pt!==null&&Pt.next!==null;if(Ei=0,hn=Pt=ot=null,np=!1,Ku=0,jo=null,t)throw Error(je(300));e===null||bn||(e=e.dependencies,e!==null&&Zh(e)&&(bn=!0))}function UT(e,t,n,s){ot=e;var r=0;do{if(Mo&&(jo=null),Ku=0,Mo=!1,25<=r)throw Error(je(301));if(r+=1,hn=Pt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}nt.H=m2,i=t(n,s)}while(Mo);return i}function VI(){var e=nt.H,t=e.useState()[0];return t=typeof t.then=="function"?Id(t):t,e=e.useState()[0],(Pt!==null?Pt.memoizedState:null)!==e&&(ot.flags|=1024),t}function Zy(){var e=sp!==0;return sp=0,e}function Jy(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ev(e){if(np){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}np=!1}Ei=0,hn=Pt=ot=null,Mo=!1,Ku=sp=0,jo=null}function ts(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?ot.memoizedState=hn=e:hn=hn.next=e,hn}function un(){if(Pt===null){var e=ot.alternate;e=e!==null?e.memoizedState:null}else e=Pt.next;var t=hn===null?ot.memoizedState:hn.next;if(t!==null)hn=t,Pt=e;else{if(e===null)throw ot.alternate===null?Error(je(467)):Error(je(310));Pt=e,e={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},hn===null?ot.memoizedState=hn=e:hn=hn.next=e}return hn}function tm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Id(e){var t=Ku;return Ku+=1,jo===null&&(jo=[]),e=RT(jo,e,t),t=ot,(hn===null?t.memoizedState:hn.next)===null&&(t=t.alternate,nt.H=t===null||t.memoizedState===null?p2:ov),e}function nm(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Id(e);if(e.$$typeof===gi)return Fn(e)}throw Error(je(438,String(e)))}function tv(e){var t=null,n=ot.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=ot.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=tm(),ot.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=OD;return t.index++,n}function _i(e,t){return typeof t=="function"?t(e):t}function Sh(e){var t=un();return nv(t,Pt,e)}function nv(e,t,n){var s=e.queue;if(s===null)throw Error(je(311));s.lastRenderedReducer=n;var r=e.baseQueue,i=s.pending;if(i!==null){if(r!==null){var a=r.next;r.next=i.next,i.next=a}t.baseQueue=r=i,s.pending=null}if(i=e.baseState,r===null)e.memoizedState=i;else{t=r.next;var l=a=null,c=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(yt&f)===f:(Ei&f)===f){var h=u.revertLane;if(h===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===tc&&(d=!0);else if((Ei&h)===h){u=u.next,h===tc&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=f,a=i):c=c.next=f,ot.lanes|=h,Ra|=h;f=u.action,Ml&&n(i,f),i=u.hasEagerState?u.eagerState:n(i,f)}else h={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=h,a=i):c=c.next=h,ot.lanes|=f,Ra|=f;u=u.next}while(u!==null&&u!==t);if(c===null?a=i:c.next=l,!Os(i,e.memoizedState)&&(bn=!0,d&&(n=To,n!==null)))throw n;e.memoizedState=i,e.baseState=a,e.baseQueue=c,s.lastRenderedState=i}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function og(e){var t=un(),n=t.queue;if(n===null)throw Error(je(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do i=e(i,a.action),a=a.next;while(a!==r);Os(i,t.memoizedState)||(bn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function FT(e,t,n){var s=ot,r=un(),i=kt;if(i){if(n===void 0)throw Error(je(407));n=n()}else n=t();var a=!Os((Pt||r).memoizedState,n);if(a&&(r.memoizedState=n,bn=!0),r=r.queue,sv($T.bind(null,s,r,e),[e]),r.getSnapshot!==t||a||hn!==null&&hn.memoizedState.tag&1){if(s.flags|=2048,sc(9,{destroy:void 0},HT.bind(null,s,r,n,t),null),Ut===null)throw Error(je(349));i||Ei&127||BT(s,t,n)}return n}function BT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ot.updateQueue,t===null?(t=tm(),ot.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function HT(e,t,n,s){t.value=n,t.getSnapshot=s,GT(t)&&KT(e)}function $T(e,t,n){return n(function(){GT(t)&&KT(e)})}function GT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Os(e,n)}catch{return!0}}function KT(e){var t=Kl(e,2);t!==null&&gs(t,e,2)}function Nb(e){var t=ts();if(typeof e=="function"){var n=e;if(e=n(),Ml){fa(!0);try{n()}finally{fa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:e},t}function qT(e,t,n,s){return e.baseState=n,nv(e,Pt,typeof s=="function"?s:_i)}function XI(e,t,n,s,r){if(rm(e))throw Error(je(485));if(e=t.action,e!==null){var i={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){i.listeners.push(a)}};nt.T!==null?n(!0):i.isTransition=!1,s(i),n=t.pending,n===null?(i.next=t.pending=i,YT(t,i)):(i.next=n.next,t.pending=n.next=i)}}function YT(e,t){var n=t.action,s=t.payload,r=e.state;if(t.isTransition){var i=nt.T,a={};nt.T=a;try{var l=n(r,s),c=nt.S;c!==null&&c(a,l),e1(e,t,l)}catch(u){Eb(e,t,u)}finally{i!==null&&a.types!==null&&(i.types=a.types),nt.T=i}}else try{i=n(r,s),e1(e,t,i)}catch(u){Eb(e,t,u)}}function e1(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){t1(e,t,s)},function(s){return Eb(e,t,s)}):t1(e,t,n)}function t1(e,t,n){t.status="fulfilled",t.value=n,VT(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,YT(e,n)))}function Eb(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,VT(t),t=t.next;while(t!==s)}e.action=null}function VT(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function XT(e,t){return t}function n1(e,t){if(kt){var n=Ut.formState;if(n!==null){e:{var s=ot;if(kt){if(qt){t:{for(var r=qt,i=Ys;r.nodeType!==8;){if(!i){r=null;break t}if(r=Ws(r.nextSibling),r===null){r=null;break t}}i=r.data,r=i==="F!"||i==="F"?r:null}if(r){qt=Ws(r.nextSibling),s=r.data==="F!";break e}}Ma(s)}s=!1}s&&(t=n[0])}}return n=ts(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:XT,lastRenderedState:t},n.queue=s,n=d2.bind(null,ot,s),s.dispatch=n,s=Nb(!1),i=lv.bind(null,ot,!1,s.queue),s=ts(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,n=XI.bind(null,ot,r,i,n),r.dispatch=n,s.memoizedState=e,[t,n,!1]}function s1(e){var t=un();return QT(t,Pt,e)}function QT(e,t,n){if(t=nv(e,t,XT)[0],e=Sh(_i)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Id(t)}catch(a){throw a===_c?em:a}else s=t;t=un();var r=t.queue,i=r.dispatch;return n!==t.memoizedState&&(ot.flags|=2048,sc(9,{destroy:void 0},QI.bind(null,r,n),null)),[s,i,e]}function QI(e,t){e.action=t}function r1(e){var t=un(),n=Pt;if(n!==null)return QT(t,n,e);un(),t=t.memoizedState,n=un();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function sc(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=ot.updateQueue,t===null&&(t=tm(),ot.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function WT(){return un().memoizedState}function Nh(e,t,n,s){var r=ts();ot.flags|=e,r.memoizedState=sc(1|t,{destroy:void 0},n,s===void 0?null:s)}function sm(e,t,n,s){var r=un();s=s===void 0?null:s;var i=r.memoizedState.inst;Pt!==null&&s!==null&&Qy(s,Pt.memoizedState.deps)?r.memoizedState=sc(t,i,n,s):(ot.flags|=e,r.memoizedState=sc(1|t,i,n,s))}function i1(e,t){Nh(8390656,8,e,t)}function sv(e,t){sm(2048,8,e,t)}function WI(e){ot.flags|=4;var t=ot.updateQueue;if(t===null)t=tm(),ot.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ZT(e){var t=un().memoizedState;return WI({ref:t,nextImpl:e}),function(){if(Tt&2)throw Error(je(440));return t.impl.apply(void 0,arguments)}}function JT(e,t){return sm(4,2,e,t)}function e2(e,t){return sm(4,4,e,t)}function t2(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 n2(e,t,n){n=n!=null?n.concat([e]):null,sm(4,4,t2.bind(null,t,e),n)}function rv(){}function s2(e,t){var n=un();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Qy(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function r2(e,t){var n=un();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Qy(t,s[1]))return s[0];if(s=e(),Ml){fa(!0);try{e()}finally{fa(!1)}}return n.memoizedState=[s,t],s}function iv(e,t,n){return n===void 0||Ei&1073741824&&!(yt&261930)?e.memoizedState=t:(e.memoizedState=n,e=q2(),ot.lanes|=e,Ra|=e,n)}function i2(e,t,n,s){return Os(n,t)?n:nc.current!==null?(e=iv(e,n,s),Os(e,t)||(bn=!0),e):!(Ei&42)||Ei&1073741824&&!(yt&261930)?(bn=!0,e.memoizedState=n):(e=q2(),ot.lanes|=e,Ra|=e,t)}function a2(e,t,n,s,r){var i=Mt.p;Mt.p=i!==0&&8>i?i:8;var a=nt.T,l={};nt.T=l,lv(e,!1,t,n);try{var c=r(),u=nt.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=qI(c,s);wu(e,t,d,Rs(e))}else wu(e,t,s,Rs(e))}catch(f){wu(e,t,{then:function(){},status:"rejected",reason:f},Rs())}finally{Mt.p=i,a!==null&&l.types!==null&&(a.types=l.types),nt.T=a}}function ZI(){}function _b(e,t,n,s){if(e.tag!==5)throw Error(je(476));var r=l2(e).queue;a2(e,r,t,hl,n===null?ZI:function(){return o2(e),n(s)})}function l2(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:hl,baseState:hl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:hl},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function o2(e){var t=l2(e);t.next===null&&(t=e.alternate.memoizedState),wu(e,t.next.queue,{},Rs())}function av(){return Fn(Xu)}function c2(){return un().memoizedState}function u2(){return un().memoizedState}function JI(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Rs();e=ka(n);var s=wa(t,e,n);s!==null&&(gs(s,t,n),yu(s,t,n)),t={cache:Ky()},e.payload=t;return}t=t.return}}function e4(e,t,n){var s=Rs();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},rm(e)?f2(t,n):(n=By(e,t,n,s),n!==null&&(gs(n,e,s),h2(n,t,s)))}function d2(e,t,n){var s=Rs();wu(e,t,n,s)}function wu(e,t,n,s){var r={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(rm(e))f2(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(r.hasEagerState=!0,r.eagerState=l,Os(l,a))return Jp(e,t,r,0),Ut===null&&Zp(),!1}catch{}finally{}if(n=By(e,t,r,s),n!==null)return gs(n,e,s),h2(n,t,s),!0}return!1}function lv(e,t,n,s){if(s={lane:2,revertLane:gv(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},rm(e)){if(t)throw Error(je(479))}else t=By(e,n,s,2),t!==null&&gs(t,e,2)}function rm(e){var t=e.alternate;return e===ot||t!==null&&t===ot}function f2(e,t){Mo=np=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function h2(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,ZC(e,n)}}var qu={readContext:Fn,use:nm,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};qu.useEffectEvent=ln;var p2={readContext:Fn,use:nm,useCallback:function(e,t){return ts().memoizedState=[e,t===void 0?null:t],e},useContext:Fn,useEffect:i1,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Nh(4194308,4,t2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nh(4194308,4,e,t)},useInsertionEffect:function(e,t){Nh(4,2,e,t)},useMemo:function(e,t){var n=ts();t=t===void 0?null:t;var s=e();if(Ml){fa(!0);try{e()}finally{fa(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=ts();if(n!==void 0){var r=n(t);if(Ml){fa(!0);try{n(t)}finally{fa(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=e4.bind(null,ot,e),[s.memoizedState,e]},useRef:function(e){var t=ts();return e={current:e},t.memoizedState=e},useState:function(e){e=Nb(e);var t=e.queue,n=d2.bind(null,ot,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:rv,useDeferredValue:function(e,t){var n=ts();return iv(n,e,t)},useTransition:function(){var e=Nb(!1);return e=a2.bind(null,ot,e.queue,!0,!1),ts().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=ot,r=ts();if(kt){if(n===void 0)throw Error(je(407));n=n()}else{if(n=t(),Ut===null)throw Error(je(349));yt&127||BT(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,i1($T.bind(null,s,i,e),[e]),s.flags|=2048,sc(9,{destroy:void 0},HT.bind(null,s,i,n,t),null),n},useId:function(){var e=ts(),t=Ut.identifierPrefix;if(kt){var n=Lr,s=Ir;n=(s&~(1<<32-js(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=sp++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=YI++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:av,useFormState:n1,useActionState:n1,useOptimistic:function(e){var t=ts();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lv.bind(null,ot,!0,n),n.dispatch=t,[e,t]},useMemoCache:tv,useCacheRefresh:function(){return ts().memoizedState=JI.bind(null,ot)},useEffectEvent:function(e){var t=ts(),n={impl:e};return t.memoizedState=n,function(){if(Tt&2)throw Error(je(440));return n.impl.apply(void 0,arguments)}}},ov={readContext:Fn,use:nm,useCallback:s2,useContext:Fn,useEffect:sv,useImperativeHandle:n2,useInsertionEffect:JT,useLayoutEffect:e2,useMemo:r2,useReducer:Sh,useRef:WT,useState:function(){return Sh(_i)},useDebugValue:rv,useDeferredValue:function(e,t){var n=un();return i2(n,Pt.memoizedState,e,t)},useTransition:function(){var e=Sh(_i)[0],t=un().memoizedState;return[typeof e=="boolean"?e:Id(e),t]},useSyncExternalStore:FT,useId:c2,useHostTransitionStatus:av,useFormState:s1,useActionState:s1,useOptimistic:function(e,t){var n=un();return qT(n,Pt,e,t)},useMemoCache:tv,useCacheRefresh:u2};ov.useEffectEvent=ZT;var m2={readContext:Fn,use:nm,useCallback:s2,useContext:Fn,useEffect:sv,useImperativeHandle:n2,useInsertionEffect:JT,useLayoutEffect:e2,useMemo:r2,useReducer:og,useRef:WT,useState:function(){return og(_i)},useDebugValue:rv,useDeferredValue:function(e,t){var n=un();return Pt===null?iv(n,e,t):i2(n,Pt.memoizedState,e,t)},useTransition:function(){var e=og(_i)[0],t=un().memoizedState;return[typeof e=="boolean"?e:Id(e),t]},useSyncExternalStore:FT,useId:c2,useHostTransitionStatus:av,useFormState:r1,useActionState:r1,useOptimistic:function(e,t){var n=un();return Pt!==null?qT(n,Pt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:tv,useCacheRefresh:u2};m2.useEffectEvent=ZT;function cg(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:Xt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cb={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Rs(),r=ka(s);r.payload=t,n!=null&&(r.callback=n),t=wa(e,r,s),t!==null&&(gs(t,e,s),yu(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Rs(),r=ka(s);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=wa(e,r,s),t!==null&&(gs(t,e,s),yu(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rs(),s=ka(n);s.tag=2,t!=null&&(s.callback=t),t=wa(e,s,n),t!==null&&(gs(t,e,n),yu(t,e,n))}};function a1(e,t,n,s,r,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,a):t.prototype&&t.prototype.isPureReactComponent?!Bu(n,s)||!Bu(r,i):!0}function l1(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Cb.enqueueReplaceState(t,t.state,null)}function jl(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=Xt({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function g2(e){Xh(e)}function b2(e){console.error(e)}function x2(e){Xh(e)}function rp(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function o1(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Tb(e,t,n){return n=ka(n),n.tag=3,n.payload={element:null},n.callback=function(){rp(e,t)},n}function y2(e){return e=ka(e),e.tag=3,e}function v2(e,t,n,s){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=s.value;e.payload=function(){return r(i)},e.callback=function(){o1(t,n,s)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){o1(t,n,s),typeof r!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var l=s.stack;this.componentDidCatch(s.value,{componentStack:l!==null?l:""})})}function t4(e,t,n,s,r){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Ec(t,n,r,!0),n=Ds.current,n!==null){switch(n.tag){case 31:case 13:return Qs===null?cp():n.alternate===null&&on===0&&(on=3),n.flags&=-257,n.flags|=65536,n.lanes=r,s===Jh?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),vg(e,s,r)),!1;case 22:return n.flags|=65536,s===Jh?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),vg(e,s,r)),!1}throw Error(je(435,n.tag))}return vg(e,s,r),cp(),!1}if(kt)return t=Ds.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==mb&&(e=Error(je(422),{cause:s}),$u(qs(e,n)))):(s!==mb&&(t=Error(je(423),{cause:s}),$u(qs(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=qs(s,n),r=Tb(e.stateNode,s,r),lg(e,r),on!==4&&(on=2)),!1;var i=Error(je(520),{cause:s});if(i=qs(i,n),Eu===null?Eu=[i]:Eu.push(i),on!==4&&(on=2),t===null)return!0;s=qs(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Tb(n.stateNode,s,e),lg(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Sa===null||!Sa.has(i))))return n.flags|=65536,r&=-r,n.lanes|=r,r=y2(r),v2(r,e,n,s),lg(n,r),!1}n=n.return}while(n!==null);return!1}var cv=Error(je(461)),bn=!1;function In(e,t,n,s){t.child=e===null?DT(t,null,n,s):Al(t,e.child,n,s)}function c1(e,t,n,s,r){n=n.render;var i=t.ref;if("ref"in s){var a={};for(var l in s)l!=="ref"&&(a[l]=s[l])}else a=s;return Tl(t),s=Wy(e,t,n,a,i,r),l=Zy(),e!==null&&!bn?(Jy(e,t,r),Ci(e,t,r)):(kt&&l&&$y(t),t.flags|=1,In(e,t,s,r),t.child)}function u1(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!Hy(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,k2(e,t,i,s,r)):(e=kh(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!uv(e,r)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Bu,n(a,s)&&e.ref===t.ref)return Ci(e,t,r)}return t.flags|=1,e=vi(i,s),e.ref=t.ref,e.return=t,t.child=e}function k2(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(Bu(i,s)&&e.ref===t.ref)if(bn=!1,t.pendingProps=s=i,uv(e,r))e.flags&131072&&(bn=!0);else return t.lanes=e.lanes,Ci(e,t,r)}return Ab(e,t,n,s,r)}function w2(e,t,n,s){var r=s.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|n:n,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~i}else s=0,t.child=null;return d1(e,t,i,n,s)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&wh(t,i!==null?i.cachePool:null),i!==null?Jw(t,i):wb(),PT(t);else return s=t.lanes=536870912,d1(e,t,i!==null?i.baseLanes|n:n,n,s)}else i!==null?(wh(t,i.cachePool),Jw(t,i),na(),t.memoizedState=null):(e!==null&&wh(t,null),wb(),na());return In(e,t,r,n),t.child}function su(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function d1(e,t,n,s,r){var i=qy();return i=i===null?null:{parent:mn._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&wh(t,null),wb(),PT(t),e!==null&&Ec(e,t,s,!0),t.childLanes=r,null}function Eh(e,t){return t=ip({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function f1(e,t,n){return Al(t,e.child,null,n),e=Eh(t,t.pendingProps),e.flags|=2,Es(t),t.memoizedState=null,e}function n4(e,t,n){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(kt){if(s.mode==="hidden")return e=Eh(t,s),t.lanes=536870912,su(null,e);if(Sb(t),(e=qt)?(e=pA(e,Ys),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Aa!==null?{id:Ir,overflow:Lr}:null,retryLane:536870912,hydrationErrors:null},n=CT(e),n.return=t,t.child=n,Un=t,qt=null)):e=null,e===null)throw Ma(t);return t.lanes=536870912,null}return Eh(t,s)}var i=e.memoizedState;if(i!==null){var a=i.dehydrated;if(Sb(t),r)if(t.flags&256)t.flags&=-257,t=f1(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(je(558));else if(bn||Ec(e,t,n,!1),r=(n&e.childLanes)!==0,bn||r){if(s=Ut,s!==null&&(a=JC(s,n),a!==0&&a!==i.retryLane))throw i.retryLane=a,Kl(e,a),gs(s,e,a),cv;cp(),t=f1(e,t,n)}else e=i.treeContext,qt=Ws(a.nextSibling),Un=t,kt=!0,va=null,Ys=!1,e!==null&&AT(t,e),t=Eh(t,s),t.flags|=4096;return t}return e=vi(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _h(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(je(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ab(e,t,n,s,r){return Tl(t),n=Wy(e,t,n,s,void 0,r),s=Zy(),e!==null&&!bn?(Jy(e,t,r),Ci(e,t,r)):(kt&&s&&$y(t),t.flags|=1,In(e,t,n,r),t.child)}function h1(e,t,n,s,r,i){return Tl(t),t.updateQueue=null,n=UT(t,s,n,r),zT(e),s=Zy(),e!==null&&!bn?(Jy(e,t,i),Ci(e,t,i)):(kt&&s&&$y(t),t.flags|=1,In(e,t,n,i),t.child)}function p1(e,t,n,s,r){if(Tl(t),t.stateNode===null){var i=bo,a=n.contextType;typeof a=="object"&&a!==null&&(i=Fn(a)),i=new n(s,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Cb,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=s,i.state=t.memoizedState,i.refs={},Vy(t),a=n.contextType,i.context=typeof a=="object"&&a!==null?Fn(a):bo,i.state=t.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(cg(t,n,a,s),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(a=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),a!==i.state&&Cb.enqueueReplaceState(i,i.state,null),ku(t,s,i,r),vu(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=jl(n,l);i.props=c;var u=i.context,d=n.contextType;a=bo,typeof d=="object"&&d!==null&&(a=Fn(d));var f=n.getDerivedStateFromProps;d=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||u!==a)&&l1(t,i,s,a),Wi=!1;var h=t.memoizedState;i.state=h,ku(t,s,i,r),vu(),u=t.memoizedState,l||h!==u||Wi?(typeof f=="function"&&(cg(t,n,f,s),u=t.memoizedState),(c=Wi||a1(t,n,c,s,h,u,a))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=u),i.props=s,i.state=u,i.context=a,s=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{i=t.stateNode,vb(e,t),a=t.memoizedProps,d=jl(n,a),i.props=d,f=t.pendingProps,h=i.context,u=n.contextType,c=bo,typeof u=="object"&&u!==null&&(c=Fn(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==f||h!==c)&&l1(t,i,s,c),Wi=!1,h=t.memoizedState,i.state=h,ku(t,s,i,r),vu();var p=t.memoizedState;a!==f||h!==p||Wi||e!==null&&e.dependencies!==null&&Zh(e.dependencies)?(typeof l=="function"&&(cg(t,n,l,s),p=t.memoizedState),(d=Wi||a1(t,n,d,s,h,p,c)||e!==null&&e.dependencies!==null&&Zh(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(s,p,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(s,p,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=p),i.props=s,i.state=p,i.context=c,s=d):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),s=!1)}return i=s,_h(e,t),s=(t.flags&128)!==0,i||s?(i=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&s?(t.child=Al(t,e.child,null,r),t.child=Al(t,null,n,r)):In(e,t,n,r),t.memoizedState=i.state,e=t.child):e=Ci(e,t,r),e}function m1(e,t,n,s){return Cl(),t.flags|=256,In(e,t,n,s),t.child}var ug={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function dg(e){return{baseLanes:e,cachePool:jT()}}function fg(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Ts),e}function S2(e,t,n){var s=t.pendingProps,r=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(cn.current&2)!==0),a&&(r=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(kt){if(r?ta(t):na(),(e=qt)?(e=pA(e,Ys),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Aa!==null?{id:Ir,overflow:Lr}:null,retryLane:536870912,hydrationErrors:null},n=CT(e),n.return=t,t.child=n,Un=t,qt=null)):e=null,e===null)throw Ma(t);return $b(e)?t.lanes=32:t.lanes=536870912,null}var l=s.children;return s=s.fallback,r?(na(),r=t.mode,l=ip({mode:"hidden",children:l},r),s=pl(s,r,n,null),l.return=t,s.return=t,l.sibling=s,t.child=l,s=t.child,s.memoizedState=dg(n),s.childLanes=fg(e,a,n),t.memoizedState=ug,su(null,s)):(ta(t),Mb(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(ta(t),t.flags&=-257,t=hg(e,t,n)):t.memoizedState!==null?(na(),t.child=e.child,t.flags|=128,t=null):(na(),l=s.fallback,r=t.mode,s=ip({mode:"visible",children:s.children},r),l=pl(l,r,n,null),l.flags|=2,s.return=t,l.return=t,s.sibling=l,t.child=s,Al(t,e.child,null,n),s=t.child,s.memoizedState=dg(n),s.childLanes=fg(e,a,n),t.memoizedState=ug,t=su(null,s));else if(ta(t),$b(l)){if(a=l.nextSibling&&l.nextSibling.dataset,a)var u=a.dgst;a=u,s=Error(je(419)),s.stack="",s.digest=a,$u({value:s,source:null,stack:null}),t=hg(e,t,n)}else if(bn||Ec(e,t,n,!1),a=(n&e.childLanes)!==0,bn||a){if(a=Ut,a!==null&&(s=JC(a,n),s!==0&&s!==c.retryLane))throw c.retryLane=s,Kl(e,s),gs(a,e,s),cv;Hb(l)||cp(),t=hg(e,t,n)}else Hb(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,qt=Ws(l.nextSibling),Un=t,kt=!0,va=null,Ys=!1,e!==null&&AT(t,e),t=Mb(t,s.children),t.flags|=4096);return t}return r?(na(),l=s.fallback,r=t.mode,c=e.child,u=c.sibling,s=vi(c,{mode:"hidden",children:s.children}),s.subtreeFlags=c.subtreeFlags&65011712,u!==null?l=vi(u,l):(l=pl(l,r,n,null),l.flags|=2),l.return=t,s.return=t,s.sibling=l,t.child=s,su(null,s),s=t.child,l=e.child.memoizedState,l===null?l=dg(n):(r=l.cachePool,r!==null?(c=mn._currentValue,r=r.parent!==c?{parent:c,pool:c}:r):r=jT(),l={baseLanes:l.baseLanes|n,cachePool:r}),s.memoizedState=l,s.childLanes=fg(e,a,n),t.memoizedState=ug,su(e.child,s)):(ta(t),n=e.child,e=n.sibling,n=vi(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=n,t.memoizedState=null,n)}function Mb(e,t){return t=ip({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ip(e,t){return e=_s(22,e,null,t),e.lanes=0,e}function hg(e,t,n){return Al(t,e.child,null,n),e=Mb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function g1(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),bb(e.return,t,n)}function pg(e,t,n,s,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r,treeForkCount:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=r,a.treeForkCount=i)}function N2(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=s.tail;s=s.children;var a=cn.current,l=(a&2)!==0;if(l?(a=a&1|2,t.flags|=128):a&=1,Bt(cn,a),In(e,t,s,n),s=kt?Hu:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&g1(e,n,t);else if(e.tag===19)g1(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&tp(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),pg(t,!1,r,n,i,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&tp(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}pg(t,!0,n,null,i,s);break;case"together":pg(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Ci(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ra|=t.lanes,!(n&t.childLanes))if(e!==null){if(Ec(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(je(153));if(t.child!==null){for(e=t.child,n=vi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=vi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function uv(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Zh(e)))}function s4(e,t,n){switch(t.tag){case 3:Kh(t,t.stateNode.containerInfo),ea(t,mn,e.memoizedState.cache),Cl();break;case 27:case 5:rb(t);break;case 4:Kh(t,t.stateNode.containerInfo);break;case 10:ea(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Sb(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(ta(t),t.flags|=128,null):n&t.child.childLanes?S2(e,t,n):(ta(t),e=Ci(e,t,n),e!==null?e.sibling:null);ta(t);break;case 19:var r=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Ec(e,t,n,!1),s=(n&t.childLanes)!==0),r){if(s)return N2(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Bt(cn,cn.current),s)break;return null;case 22:return t.lanes=0,w2(e,t,n,t.pendingProps);case 24:ea(t,mn,e.memoizedState.cache)}return Ci(e,t,n)}function E2(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)bn=!0;else{if(!uv(e,n)&&!(t.flags&128))return bn=!1,s4(e,t,n);bn=!!(e.flags&131072)}else bn=!1,kt&&t.flags&1048576&&TT(t,Hu,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Wa(t.elementType),t.type=e,typeof e=="function")Hy(e)?(s=jl(e,s),t.tag=1,t=p1(null,t,e,s,n)):(t.tag=0,t=Ab(null,t,e,s,n));else{if(e!=null){var r=e.$$typeof;if(r===Ty){t.tag=11,t=c1(null,t,e,s,n);break e}else if(r===Ay){t.tag=14,t=u1(null,t,e,s,n);break e}}throw t=nb(e)||e,Error(je(306,t,""))}}return t;case 0:return Ab(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,r=jl(s,t.pendingProps),p1(e,t,s,r,n);case 3:e:{if(Kh(t,t.stateNode.containerInfo),e===null)throw Error(je(387));s=t.pendingProps;var i=t.memoizedState;r=i.element,vb(e,t),ku(t,s,null,n);var a=t.memoizedState;if(s=a.cache,ea(t,mn,s),s!==i.cache&&xb(t,[mn],n,!0),vu(),s=a.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=m1(e,t,s,n);break e}else if(s!==r){r=qs(Error(je(424)),t),$u(r),t=m1(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(qt=Ws(e.firstChild),Un=t,kt=!0,va=null,Ys=!0,n=DT(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Cl(),s===r){t=Ci(e,t,n);break e}In(e,t,s,n)}t=t.child}return t;case 26:return _h(e,t),e===null?(n=L1(t.type,null,t.pendingProps,null))?t.memoizedState=n:kt||(n=t.type,e=t.pendingProps,s=hp(ya.current).createElement(n),s[zn]=t,s[bs]=e,Bn(s,n,e),Rn(s),t.stateNode=s):t.memoizedState=L1(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return rb(t),e===null&&kt&&(s=t.stateNode=mA(t.type,t.pendingProps,ya.current),Un=t,Ys=!0,r=qt,La(t.type)?(Gb=r,qt=Ws(s.firstChild)):qt=r),In(e,t,t.pendingProps.children,n),_h(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&kt&&((r=s=qt)&&(s=O4(s,t.type,t.pendingProps,Ys),s!==null?(t.stateNode=s,Un=t,qt=Ws(s.firstChild),Ys=!1,r=!0):r=!1),r||Ma(t)),rb(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,Fb(r,i)?s=null:a!==null&&Fb(r,a)&&(t.flags|=32),t.memoizedState!==null&&(r=Wy(e,t,VI,null,null,n),Xu._currentValue=r),_h(e,t),In(e,t,s,n),t.child;case 6:return e===null&&kt&&((e=n=qt)&&(n=D4(n,t.pendingProps,Ys),n!==null?(t.stateNode=n,Un=t,qt=null,e=!0):e=!1),e||Ma(t)),null;case 13:return S2(e,t,n);case 4:return Kh(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Al(t,null,s,n):In(e,t,s,n),t.child;case 11:return c1(e,t,t.type,t.pendingProps,n);case 7:return In(e,t,t.pendingProps,n),t.child;case 8:return In(e,t,t.pendingProps.children,n),t.child;case 12:return In(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,ea(t,t.type,s.value),In(e,t,s.children,n),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,Tl(t),r=Fn(r),s=s(r),t.flags|=1,In(e,t,s,n),t.child;case 14:return u1(e,t,t.type,t.pendingProps,n);case 15:return k2(e,t,t.type,t.pendingProps,n);case 19:return N2(e,t,n);case 31:return n4(e,t,n);case 22:return w2(e,t,n,t.pendingProps);case 24:return Tl(t),s=Fn(mn),e===null?(r=qy(),r===null&&(r=Ut,i=Ky(),r.pooledCache=i,i.refCount++,i!==null&&(r.pooledCacheLanes|=n),r=i),t.memoizedState={parent:s,cache:r},Vy(t),ea(t,mn,r)):(e.lanes&n&&(vb(e,t),ku(t,null,null,n),vu()),r=e.memoizedState,i=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),ea(t,mn,s)):(s=i.cache,ea(t,mn,s),s!==r.cache&&xb(t,[mn],n,!0))),In(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(je(156,t.tag))}function si(e){e.flags|=4}function mg(e,t,n,s,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(X2())e.flags|=8192;else throw gl=Jh,Yy}else e.flags&=-16777217}function b1(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!xA(t))if(X2())e.flags|=8192;else throw gl=Jh,Yy}function _f(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?QC():536870912,e.lanes|=t,rc|=t)}function $c(e,t){if(!kt)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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function $t(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function r4(e,t,n){var s=t.pendingProps;switch(Gy(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $t(t),null;case 1:return $t(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ki(mn),Zo(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wl(t)?si(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ag())),$t(t),null;case 26:var r=t.type,i=t.memoizedState;return e===null?(si(t),i!==null?($t(t),b1(t,i)):($t(t),mg(t,r,null,s,n))):i?i!==e.memoizedState?(si(t),$t(t),b1(t,i)):($t(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&si(t),$t(t),mg(t,r,e,s,n)),null;case 27:if(qh(t),n=ya.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&si(t);else{if(!s){if(t.stateNode===null)throw Error(je(166));return $t(t),null}e=Ur.current,Wl(t)?qw(t):(e=mA(r,s,n),t.stateNode=e,si(t))}return $t(t),null;case 5:if(qh(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&si(t);else{if(!s){if(t.stateNode===null)throw Error(je(166));return $t(t),null}if(i=Ur.current,Wl(t))qw(t);else{var a=hp(ya.current);switch(i){case 1:i=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:i=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":i=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":i=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":i=a.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof s.is=="string"?a.createElement("select",{is:s.is}):a.createElement("select"),s.multiple?i.multiple=!0:s.size&&(i.size=s.size);break;default:i=typeof s.is=="string"?a.createElement(r,{is:s.is}):a.createElement(r)}}i[zn]=t,i[bs]=s;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)i.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=i;e:switch(Bn(i,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&si(t)}}return $t(t),mg(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&si(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(je(166));if(e=ya.current,Wl(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,r=Un,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[zn]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||dA(e.nodeValue,n)),e||Ma(t,!0)}else e=hp(e).createTextNode(s),e[zn]=t,t.stateNode=e}return $t(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Wl(t),n!==null){if(e===null){if(!s)throw Error(je(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(je(557));e[zn]=t}else Cl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$t(t),e=!1}else n=ag(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Es(t),t):(Es(t),null);if(t.flags&128)throw Error(je(558))}return $t(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Wl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(je(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(je(317));r[zn]=t}else Cl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$t(t),r=!1}else r=ag(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Es(t),t):(Es(t),null)}return Es(t),t.flags&128?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==r&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_f(t,t.updateQueue),$t(t),null);case 4:return Zo(),e===null&&bv(t.stateNode.containerInfo),$t(t),null;case 10:return ki(t.type),$t(t),null;case 19:if(On(cn),s=t.memoizedState,s===null)return $t(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)$c(s,!1);else{if(on!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=tp(e),i!==null){for(t.flags|=128,$c(s,!1),e=i.updateQueue,t.updateQueue=e,_f(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)_T(n,e),n=n.sibling;return Bt(cn,cn.current&1|2),kt&&ui(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&As()>lp&&(t.flags|=128,r=!0,$c(s,!1),t.lanes=4194304)}else{if(!r)if(e=tp(i),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,_f(t,e),$c(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!kt)return $t(t),null}else 2*As()-s.renderingStartTime>lp&&n!==536870912&&(t.flags|=128,r=!0,$c(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(e=s.last,e!==null?e.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=As(),e.sibling=null,n=cn.current,Bt(cn,r?n&1|2:n&1),kt&&ui(t,s.treeForkCount),e):($t(t),null);case 22:case 23:return Es(t),Xy(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&($t(t),t.subtreeFlags&6&&(t.flags|=8192)):$t(t),n=t.updateQueue,n!==null&&_f(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&On(ml),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ki(mn),$t(t),null;case 25:return null;case 30:return null}throw Error(je(156,t.tag))}function i4(e,t){switch(Gy(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ki(mn),Zo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return qh(t),null;case 31:if(t.memoizedState!==null){if(Es(t),t.alternate===null)throw Error(je(340));Cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Es(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(je(340));Cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return On(cn),null;case 4:return Zo(),null;case 10:return ki(t.type),null;case 22:case 23:return Es(t),Xy(),e!==null&&On(ml),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ki(mn),null;case 25:return null;default:return null}}function _2(e,t){switch(Gy(t),t.tag){case 3:ki(mn),Zo();break;case 26:case 27:case 5:qh(t);break;case 4:Zo();break;case 31:t.memoizedState!==null&&Es(t);break;case 13:Es(t);break;case 19:On(cn);break;case 10:ki(t.type);break;case 22:case 23:Es(t),Xy(),e!==null&&On(ml);break;case 24:ki(mn)}}function Ld(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){s=void 0;var i=n.create,a=n.inst;s=i(),a.destroy=s}n=n.next}while(n!==r)}}catch(l){Dt(t,t.return,l)}}function ja(e,t,n){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var i=r.next;s=i;do{if((s.tag&e)===e){var a=s.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){Dt(r,c,d)}}}s=s.next}while(s!==i)}}catch(d){Dt(t,t.return,d)}}function C2(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{LT(t,n)}catch(s){Dt(e,e.return,s)}}}function T2(e,t,n){n.props=jl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Dt(e,t,s)}}function Su(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(r){Dt(e,t,r)}}function Pr(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(r){Dt(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Dt(e,t,r)}else n.current=null}function A2(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(r){Dt(e,e.return,r)}}function gg(e,t,n){try{var s=e.stateNode;C4(s,e.type,n,t),s[bs]=t}catch(r){Dt(e,e.return,r)}}function M2(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&La(e.type)||e.tag===4}function bg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||M2(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&&La(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jb(e,t,n){var s=e.tag;if(s===5||s===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=bi));else if(s!==4&&(s===27&&La(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(jb(e,t,n),e=e.sibling;e!==null;)jb(e,t,n),e=e.sibling}function ap(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&La(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ap(e,t,n),e=e.sibling;e!==null;)ap(e,t,n),e=e.sibling}function j2(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Bn(t,s,n),t[zn]=e,t[bs]=n}catch(i){Dt(e,e.return,i)}}var hi=!1,pn=!1,xg=!1,x1=typeof WeakSet=="function"?WeakSet:Set,Mn=null;function a4(e,t){if(e=e.containerInfo,zb=bp,e=xT(e),Uy(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||r!==0&&f.nodeType!==3||(l=a+r),f!==i||s!==0&&f.nodeType!==3||(c=a+s),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=a),h===i&&++d===s&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ub={focusedElem:e,selectionRange:n},bp=!1,Mn=t;Mn!==null;)if(t=Mn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Mn=e;else for(;Mn!==null;){switch(t=Mn,i=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)r=e[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,r=i.memoizedProps,i=i.memoizedState,s=n.stateNode;try{var m=jl(n.type,r);e=s.getSnapshotBeforeUpdate(m,i),s.__reactInternalSnapshotBeforeUpdate=e}catch(k){Dt(n,n.return,k)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Bb(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bb(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(je(163))}if(e=t.sibling,e!==null){e.return=t.return,Mn=e;break}Mn=t.return}}function R2(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:ii(e,n),s&4&&Ld(5,n);break;case 1:if(ii(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(a){Dt(n,n.return,a)}else{var r=jl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){Dt(n,n.return,a)}}s&64&&C2(n),s&512&&Su(n,n.return);break;case 3:if(ii(e,n),s&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{LT(e,t)}catch(a){Dt(n,n.return,a)}}break;case 27:t===null&&s&4&&j2(n);case 26:case 5:ii(e,n),t===null&&s&4&&A2(n),s&512&&Su(n,n.return);break;case 12:ii(e,n);break;case 31:ii(e,n),s&4&&I2(e,n);break;case 13:ii(e,n),s&4&&L2(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=m4.bind(null,n),I4(e,n))));break;case 22:if(s=n.memoizedState!==null||hi,!s){t=t!==null&&t.memoizedState!==null||pn,r=hi;var i=pn;hi=s,(pn=t)&&!i?oi(e,n,(n.subtreeFlags&8772)!==0):ii(e,n),hi=r,pn=i}break;case 30:break;default:ii(e,n)}}function O2(e){var t=e.alternate;t!==null&&(e.alternate=null,O2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Oy(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 Zt=null,fs=!1;function ri(e,t,n){for(n=n.child;n!==null;)D2(e,t,n),n=n.sibling}function D2(e,t,n){if(Ms&&typeof Ms.onCommitFiberUnmount=="function")try{Ms.onCommitFiberUnmount(Ad,n)}catch{}switch(n.tag){case 26:pn||Pr(n,t),ri(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:pn||Pr(n,t);var s=Zt,r=fs;La(n.type)&&(Zt=n.stateNode,fs=!1),ri(e,t,n),Cu(n.stateNode),Zt=s,fs=r;break;case 5:pn||Pr(n,t);case 6:if(s=Zt,r=fs,Zt=null,ri(e,t,n),Zt=s,fs=r,Zt!==null)if(fs)try{(Zt.nodeType===9?Zt.body:Zt.nodeName==="HTML"?Zt.ownerDocument.body:Zt).removeChild(n.stateNode)}catch(i){Dt(n,t,i)}else try{Zt.removeChild(n.stateNode)}catch(i){Dt(n,t,i)}break;case 18:Zt!==null&&(fs?(e=Zt,j1(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),oc(e)):j1(Zt,n.stateNode));break;case 4:s=Zt,r=fs,Zt=n.stateNode.containerInfo,fs=!0,ri(e,t,n),Zt=s,fs=r;break;case 0:case 11:case 14:case 15:ja(2,n,t),pn||ja(4,n,t),ri(e,t,n);break;case 1:pn||(Pr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&T2(n,t,s)),ri(e,t,n);break;case 21:ri(e,t,n);break;case 22:pn=(s=pn)||n.memoizedState!==null,ri(e,t,n),pn=s;break;default:ri(e,t,n)}}function I2(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{oc(e)}catch(n){Dt(t,t.return,n)}}}function L2(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{oc(e)}catch(n){Dt(t,t.return,n)}}function l4(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new x1),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new x1),t;default:throw Error(je(435,e.tag))}}function Cf(e,t){var n=l4(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var r=g4.bind(null,e,s);s.then(r,r)}})}function cs(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s],i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 27:if(La(l.type)){Zt=l.stateNode,fs=!1;break e}break;case 5:Zt=l.stateNode,fs=!1;break e;case 3:case 4:Zt=l.stateNode.containerInfo,fs=!0;break e}l=l.return}if(Zt===null)throw Error(je(160));D2(i,a,r),Zt=null,fs=!1,i=r.alternate,i!==null&&(i.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)P2(t,e),t=t.sibling}var ir=null;function P2(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:cs(t,e),us(e),s&4&&(ja(3,e,e.return),Ld(3,e),ja(5,e,e.return));break;case 1:cs(t,e),us(e),s&512&&(pn||n===null||Pr(n,n.return)),s&64&&hi&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var r=ir;if(cs(t,e),us(e),s&512&&(pn||n===null||Pr(n,n.return)),s&4){var i=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(s){case"title":i=r.getElementsByTagName("title")[0],(!i||i[Rd]||i[zn]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=r.createElement(s),r.head.insertBefore(i,r.querySelector("head > title"))),Bn(i,s,n),i[zn]=e,Rn(i),s=i;break e;case"link":var a=z1("link","href",r).get(s+(n.href||""));if(a){for(var l=0;l<a.length;l++)if(i=a[l],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(l,1);break t}}i=r.createElement(s),Bn(i,s,n),r.head.appendChild(i);break;case"meta":if(a=z1("meta","content",r).get(s+(n.content||""))){for(l=0;l<a.length;l++)if(i=a[l],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(l,1);break t}}i=r.createElement(s),Bn(i,s,n),r.head.appendChild(i);break;default:throw Error(je(468,s))}i[zn]=e,Rn(i),s=i}e.stateNode=s}else U1(r,e.type,e.stateNode);else e.stateNode=P1(r,s,e.memoizedProps);else i!==s?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,s===null?U1(r,e.type,e.stateNode):P1(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&gg(e,e.memoizedProps,n.memoizedProps)}break;case 27:cs(t,e),us(e),s&512&&(pn||n===null||Pr(n,n.return)),n!==null&&s&4&&gg(e,e.memoizedProps,n.memoizedProps);break;case 5:if(cs(t,e),us(e),s&512&&(pn||n===null||Pr(n,n.return)),e.flags&32){r=e.stateNode;try{ec(r,"")}catch(m){Dt(e,e.return,m)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,gg(e,r,n!==null?n.memoizedProps:r)),s&1024&&(xg=!0);break;case 6:if(cs(t,e),us(e),s&4){if(e.stateNode===null)throw Error(je(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(m){Dt(e,e.return,m)}}break;case 3:if(Ah=null,r=ir,ir=pp(t.containerInfo),cs(t,e),ir=r,us(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{oc(t.containerInfo)}catch(m){Dt(e,e.return,m)}xg&&(xg=!1,z2(e));break;case 4:s=ir,ir=pp(e.stateNode.containerInfo),cs(t,e),us(e),ir=s;break;case 12:cs(t,e),us(e);break;case 31:cs(t,e),us(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Cf(e,s)));break;case 13:cs(t,e),us(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(im=As()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Cf(e,s)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,u=hi,d=pn;if(hi=u||r,pn=d||c,cs(t,e),pn=d,hi=u,us(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||hi||pn||Za(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(i=c.stateNode,r)a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{l=c.stateNode;var f=c.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(m){Dt(c,c.return,m)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(m){Dt(c,c.return,m)}}}else if(t.tag===18){if(n===null){c=t;try{var p=c.stateNode;r?R1(p,!0):R1(c.stateNode,!1)}catch(m){Dt(c,c.return,m)}}}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 e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Cf(e,n))));break;case 19:cs(t,e),us(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Cf(e,s)));break;case 30:break;case 21:break;default:cs(t,e),us(e)}}function us(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(M2(s)){n=s;break}s=s.return}if(n==null)throw Error(je(160));switch(n.tag){case 27:var r=n.stateNode,i=bg(e);ap(e,i,r);break;case 5:var a=n.stateNode;n.flags&32&&(ec(a,""),n.flags&=-33);var l=bg(e);ap(e,l,a);break;case 3:case 4:var c=n.stateNode.containerInfo,u=bg(e);jb(e,u,c);break;default:throw Error(je(161))}}catch(d){Dt(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function z2(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;z2(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ii(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)R2(e,t.alternate,t),t=t.sibling}function Za(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ja(4,t,t.return),Za(t);break;case 1:Pr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&T2(t,t.return,n),Za(t);break;case 27:Cu(t.stateNode);case 26:case 5:Pr(t,t.return),Za(t);break;case 22:t.memoizedState===null&&Za(t);break;case 30:Za(t);break;default:Za(t)}e=e.sibling}}function oi(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,i=t,a=i.flags;switch(i.tag){case 0:case 11:case 15:oi(r,i,n),Ld(4,i);break;case 1:if(oi(r,i,n),s=i,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){Dt(s,s.return,u)}if(s=i,r=s.updateQueue,r!==null){var l=s.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)IT(c[r],l)}catch(u){Dt(s,s.return,u)}}n&&a&64&&C2(i),Su(i,i.return);break;case 27:j2(i);case 26:case 5:oi(r,i,n),n&&s===null&&a&4&&A2(i),Su(i,i.return);break;case 12:oi(r,i,n);break;case 31:oi(r,i,n),n&&a&4&&I2(r,i);break;case 13:oi(r,i,n),n&&a&4&&L2(r,i);break;case 22:i.memoizedState===null&&oi(r,i,n),Su(i,i.return);break;case 30:break;default:oi(r,i,n)}t=t.sibling}}function dv(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&&Dd(n))}function fv(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Dd(e))}function nr(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)U2(e,t,n,s),t=t.sibling}function U2(e,t,n,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:nr(e,t,n,s),r&2048&&Ld(9,t);break;case 1:nr(e,t,n,s);break;case 3:nr(e,t,n,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Dd(e)));break;case 12:if(r&2048){nr(e,t,n,s),e=t.stateNode;try{var i=t.memoizedProps,a=i.id,l=i.onPostCommit;typeof l=="function"&&l(a,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Dt(t,t.return,c)}}else nr(e,t,n,s);break;case 31:nr(e,t,n,s);break;case 13:nr(e,t,n,s);break;case 23:break;case 22:i=t.stateNode,a=t.alternate,t.memoizedState!==null?i._visibility&2?nr(e,t,n,s):Nu(e,t):i._visibility&2?nr(e,t,n,s):(i._visibility|=2,so(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),r&2048&&dv(a,t);break;case 24:nr(e,t,n,s),r&2048&&fv(t.alternate,t);break;default:nr(e,t,n,s)}}function so(e,t,n,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,a=t,l=n,c=s,u=a.flags;switch(a.tag){case 0:case 11:case 15:so(i,a,l,c,r),Ld(8,a);break;case 23:break;case 22:var d=a.stateNode;a.memoizedState!==null?d._visibility&2?so(i,a,l,c,r):Nu(i,a):(d._visibility|=2,so(i,a,l,c,r)),r&&u&2048&&dv(a.alternate,a);break;case 24:so(i,a,l,c,r),r&&u&2048&&fv(a.alternate,a);break;default:so(i,a,l,c,r)}t=t.sibling}}function Nu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,r=s.flags;switch(s.tag){case 22:Nu(n,s),r&2048&&dv(s.alternate,s);break;case 24:Nu(n,s),r&2048&&fv(s.alternate,s);break;default:Nu(n,s)}t=t.sibling}}var ru=8192;function Zl(e,t,n){if(e.subtreeFlags&ru)for(e=e.child;e!==null;)F2(e,t,n),e=e.sibling}function F2(e,t,n){switch(e.tag){case 26:Zl(e,t,n),e.flags&ru&&e.memoizedState!==null&&Y4(n,ir,e.memoizedState,e.memoizedProps);break;case 5:Zl(e,t,n);break;case 3:case 4:var s=ir;ir=pp(e.stateNode.containerInfo),Zl(e,t,n),ir=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=ru,ru=16777216,Zl(e,t,n),ru=s):Zl(e,t,n));break;default:Zl(e,t,n)}}function B2(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 Gc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Mn=s,$2(s,e)}B2(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)H2(e),e=e.sibling}function H2(e){switch(e.tag){case 0:case 11:case 15:Gc(e),e.flags&2048&&ja(9,e,e.return);break;case 3:Gc(e);break;case 12:Gc(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ch(e)):Gc(e);break;default:Gc(e)}}function Ch(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Mn=s,$2(s,e)}B2(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ja(8,t,t.return),Ch(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ch(t));break;default:Ch(t)}e=e.sibling}}function $2(e,t){for(;Mn!==null;){var n=Mn;switch(n.tag){case 0:case 11:case 15:ja(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Dd(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Mn=s;else e:for(n=e;Mn!==null;){s=Mn;var r=s.sibling,i=s.return;if(O2(s),s===n){Mn=null;break e}if(r!==null){r.return=i,Mn=r;break e}Mn=i}}}var o4={getCacheForType:function(e){var t=Fn(mn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Fn(mn).controller.signal}},c4=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Ut=null,bt=null,yt=0,Ot=0,Ns=null,pa=!1,Cc=!1,hv=!1,Ti=0,on=0,Ra=0,bl=0,pv=0,Ts=0,rc=0,Eu=null,hs=null,Rb=!1,im=0,G2=0,lp=1/0,op=null,Sa=null,Nn=0,Na=null,ic=null,wi=0,Ob=0,Db=null,K2=null,_u=0,Ib=null;function Rs(){return Tt&2&&yt!==0?yt&-yt:nt.T!==null?gv():eT()}function q2(){if(Ts===0)if(!(yt&536870912)||kt){var e=yf;yf<<=1,!(yf&3932160)&&(yf=262144),Ts=e}else Ts=536870912;return e=Ds.current,e!==null&&(e.flags|=32),Ts}function gs(e,t,n){(e===Ut&&(Ot===2||Ot===9)||e.cancelPendingCommit!==null)&&(ac(e,0),ma(e,yt,Ts,!1)),jd(e,n),(!(Tt&2)||e!==Ut)&&(e===Ut&&(!(Tt&2)&&(bl|=n),on===4&&ma(e,yt,Ts,!1)),Kr(e))}function Y2(e,t,n){if(Tt&6)throw Error(je(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Md(e,t),r=s?f4(e,t):yg(e,t,!0),i=s;do{if(r===0){Cc&&!s&&ma(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!u4(n)){r=yg(e,t,!1),i=!1;continue}if(r===2){if(i=t,e.errorRecoveryDisabledLanes&i)var a=0;else a=e.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){t=a;e:{var l=e;r=Eu;var c=l.current.memoizedState.isDehydrated;if(c&&(ac(l,a).flags|=256),a=yg(l,a,!1),a!==2){if(hv&&!c){l.errorRecoveryDisabledLanes|=i,bl|=i,r=4;break e}i=hs,hs=r,i!==null&&(hs===null?hs=i:hs.push.apply(hs,i))}r=a}if(i=!1,r!==2)continue}}if(r===1){ac(e,0),ma(e,t,0,!0);break}e:{switch(s=e,i=r,i){case 0:case 1:throw Error(je(345));case 4:if((t&4194048)!==t)break;case 6:ma(s,t,Ts,!pa);break e;case 2:hs=null;break;case 3:case 5:break;default:throw Error(je(329))}if((t&62914560)===t&&(r=im+300-As(),10<r)){if(ma(s,t,Ts,!pa),Vp(s,0,!0)!==0)break e;wi=t,s.timeoutHandle=hA(y1.bind(null,s,n,hs,op,Rb,t,Ts,bl,rc,pa,i,"Throttled",-0,0),r);break e}y1(s,n,hs,op,Rb,t,Ts,bl,rc,pa,i,null,-0,0)}}break}while(!0);Kr(e)}function y1(e,t,n,s,r,i,a,l,c,u,d,f,h,p){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bi},F2(t,i,f);var m=(i&62914560)===i?im-As():(i&4194048)===i?G2-As():0;if(m=V4(f,m),m!==null){wi=i,e.cancelPendingCommit=m(k1.bind(null,e,t,i,n,s,r,a,l,c,d,f,null,h,p)),ma(e,i,a,!u);return}}k1(e,t,i,n,s,r,a,l,c)}function u4(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 s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!Os(i(),r))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 ma(e,t,n,s){t&=~pv,t&=~bl,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var i=31-js(r),a=1<<i;s[i]=-1,r&=~a}n!==0&&WC(e,n,t)}function am(){return Tt&6?!0:(Pd(0),!1)}function mv(){if(bt!==null){if(Ot===0)var e=bt.return;else e=bt,xi=ql=null,ev(e),Ao=null,Gu=0,e=bt;for(;e!==null;)_2(e.alternate,e),e=e.return;bt=null}}function ac(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,M4(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),wi=0,mv(),Ut=e,bt=n=vi(e.current,null),yt=t,Ot=0,Ns=null,pa=!1,Cc=Md(e,t),hv=!1,rc=Ts=pv=bl=Ra=on=0,hs=Eu=null,Rb=!1,t&8&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-js(s),i=1<<r;t|=e[r],s&=~i}return Ti=t,Zp(),n}function V2(e,t){ot=null,nt.H=qu,t===_c||t===em?(t=Ww(),Ot=3):t===Yy?(t=Ww(),Ot=4):Ot=t===cv?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ns=t,bt===null&&(on=1,rp(e,qs(t,e.current)))}function X2(){var e=Ds.current;return e===null?!0:(yt&4194048)===yt?Qs===null:(yt&62914560)===yt||yt&536870912?e===Qs:!1}function Q2(){var e=nt.H;return nt.H=qu,e===null?qu:e}function W2(){var e=nt.A;return nt.A=o4,e}function cp(){on=4,pa||(yt&4194048)!==yt&&Ds.current!==null||(Cc=!0),!(Ra&134217727)&&!(bl&134217727)||Ut===null||ma(Ut,yt,Ts,!1)}function yg(e,t,n){var s=Tt;Tt|=2;var r=Q2(),i=W2();(Ut!==e||yt!==t)&&(op=null,ac(e,t)),t=!1;var a=on;e:do try{if(Ot!==0&&bt!==null){var l=bt,c=Ns;switch(Ot){case 8:mv(),a=6;break e;case 3:case 2:case 9:case 6:Ds.current===null&&(t=!0);var u=Ot;if(Ot=0,Ns=null,vo(e,l,c,u),n&&Cc){a=0;break e}break;default:u=Ot,Ot=0,Ns=null,vo(e,l,c,u)}}d4(),a=on;break}catch(d){V2(e,d)}while(!0);return t&&e.shellSuspendCounter++,xi=ql=null,Tt=s,nt.H=r,nt.A=i,bt===null&&(Ut=null,yt=0,Zp()),a}function d4(){for(;bt!==null;)Z2(bt)}function f4(e,t){var n=Tt;Tt|=2;var s=Q2(),r=W2();Ut!==e||yt!==t?(op=null,lp=As()+500,ac(e,t)):Cc=Md(e,t);e:do try{if(Ot!==0&&bt!==null){t=bt;var i=Ns;t:switch(Ot){case 1:Ot=0,Ns=null,vo(e,t,i,1);break;case 2:case 9:if(Qw(i)){Ot=0,Ns=null,v1(t);break}t=function(){Ot!==2&&Ot!==9||Ut!==e||(Ot=7),Kr(e)},i.then(t,t);break e;case 3:Ot=7;break e;case 4:Ot=5;break e;case 7:Qw(i)?(Ot=0,Ns=null,v1(t)):(Ot=0,Ns=null,vo(e,t,i,7));break;case 5:var a=null;switch(bt.tag){case 26:a=bt.memoizedState;case 5:case 27:var l=bt;if(a?xA(a):l.stateNode.complete){Ot=0,Ns=null;var c=l.sibling;if(c!==null)bt=c;else{var u=l.return;u!==null?(bt=u,lm(u)):bt=null}break t}}Ot=0,Ns=null,vo(e,t,i,5);break;case 6:Ot=0,Ns=null,vo(e,t,i,6);break;case 8:mv(),on=6;break e;default:throw Error(je(462))}}h4();break}catch(d){V2(e,d)}while(!0);return xi=ql=null,nt.H=s,nt.A=r,Tt=n,bt!==null?0:(Ut=null,yt=0,Zp(),on)}function h4(){for(;bt!==null&&!LD();)Z2(bt)}function Z2(e){var t=E2(e.alternate,e,Ti);e.memoizedProps=e.pendingProps,t===null?lm(e):bt=t}function v1(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=h1(n,t,t.pendingProps,t.type,void 0,yt);break;case 11:t=h1(n,t,t.pendingProps,t.type.render,t.ref,yt);break;case 5:ev(t);default:_2(n,t),t=bt=_T(t,Ti),t=E2(n,t,Ti)}e.memoizedProps=e.pendingProps,t===null?lm(e):bt=t}function vo(e,t,n,s){xi=ql=null,ev(t),Ao=null,Gu=0;var r=t.return;try{if(t4(e,r,t,n,yt)){on=1,rp(e,qs(n,e.current)),bt=null;return}}catch(i){if(r!==null)throw bt=r,i;on=1,rp(e,qs(n,e.current)),bt=null;return}t.flags&32768?(kt||s===1?e=!0:Cc||yt&536870912?e=!1:(pa=e=!0,(s===2||s===9||s===3||s===6)&&(s=Ds.current,s!==null&&s.tag===13&&(s.flags|=16384))),J2(t,e)):lm(t)}function lm(e){var t=e;do{if(t.flags&32768){J2(t,pa);return}e=t.return;var n=r4(t.alternate,t,Ti);if(n!==null){bt=n;return}if(t=t.sibling,t!==null){bt=t;return}bt=t=e}while(t!==null);on===0&&(on=5)}function J2(e,t){do{var n=i4(e.alternate,e);if(n!==null){n.flags&=32767,bt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){bt=e;return}bt=e=n}while(e!==null);on=6,bt=null}function k1(e,t,n,s,r,i,a,l,c){e.cancelPendingCommit=null;do om();while(Nn!==0);if(Tt&6)throw Error(je(327));if(t!==null){if(t===e.current)throw Error(je(177));if(i=t.lanes|t.childLanes,i|=Fy,qD(e,n,i,a,l,c),e===Ut&&(bt=Ut=null,yt=0),ic=t,Na=e,wi=n,Ob=i,Db=r,K2=s,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,b4(Yh,function(){return rA(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=nt.T,nt.T=null,r=Mt.p,Mt.p=2,a=Tt,Tt|=4;try{a4(e,t,n)}finally{Tt=a,Mt.p=r,nt.T=s}}Nn=1,eA(),tA(),nA()}}function eA(){if(Nn===1){Nn=0;var e=Na,t=ic,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=nt.T,nt.T=null;var s=Mt.p;Mt.p=2;var r=Tt;Tt|=4;try{P2(t,e);var i=Ub,a=xT(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(a!==l&&l&&l.ownerDocument&&bT(l.ownerDocument.documentElement,l)){if(c!==null&&Uy(l)){var u=c.start,d=c.end;if(d===void 0&&(d=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(d,l.value.length);else{var f=l.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var p=h.getSelection(),m=l.textContent.length,k=Math.min(c.start,m),w=c.end===void 0?k:Math.min(c.end,m);!p.extend&&k>w&&(a=w,w=k,k=a);var g=$w(l,k),y=$w(l,w);if(g&&y&&(p.rangeCount!==1||p.anchorNode!==g.node||p.anchorOffset!==g.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var x=f.createRange();x.setStart(g.node,g.offset),p.removeAllRanges(),k>w?(p.addRange(x),p.extend(y.node,y.offset)):(x.setEnd(y.node,y.offset),p.addRange(x))}}}}for(f=[],p=l;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var S=f[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}bp=!!zb,Ub=zb=null}finally{Tt=r,Mt.p=s,nt.T=n}}e.current=t,Nn=2}}function tA(){if(Nn===2){Nn=0;var e=Na,t=ic,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=nt.T,nt.T=null;var s=Mt.p;Mt.p=2;var r=Tt;Tt|=4;try{R2(e,t.alternate,t)}finally{Tt=r,Mt.p=s,nt.T=n}}Nn=3}}function nA(){if(Nn===4||Nn===3){Nn=0,PD();var e=Na,t=ic,n=wi,s=K2;t.subtreeFlags&10256||t.flags&10256?Nn=5:(Nn=0,ic=Na=null,sA(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Sa=null),Ry(n),t=t.stateNode,Ms&&typeof Ms.onCommitFiberRoot=="function")try{Ms.onCommitFiberRoot(Ad,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=nt.T,r=Mt.p,Mt.p=2,nt.T=null;try{for(var i=e.onRecoverableError,a=0;a<s.length;a++){var l=s[a];i(l.value,{componentStack:l.stack})}}finally{nt.T=t,Mt.p=r}}wi&3&&om(),Kr(e),r=e.pendingLanes,n&261930&&r&42?e===Ib?_u++:(_u=0,Ib=e):_u=0,Pd(0)}}function sA(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Dd(t)))}function om(){return eA(),tA(),nA(),rA()}function rA(){if(Nn!==5)return!1;var e=Na,t=Ob;Ob=0;var n=Ry(wi),s=nt.T,r=Mt.p;try{Mt.p=32>n?32:n,nt.T=null,n=Db,Db=null;var i=Na,a=wi;if(Nn=0,ic=Na=null,wi=0,Tt&6)throw Error(je(331));var l=Tt;if(Tt|=4,H2(i.current),U2(i,i.current,a,n),Tt=l,Pd(0,!1),Ms&&typeof Ms.onPostCommitFiberRoot=="function")try{Ms.onPostCommitFiberRoot(Ad,i)}catch{}return!0}finally{Mt.p=r,nt.T=s,sA(e,t)}}function w1(e,t,n){t=qs(n,t),t=Tb(e.stateNode,t,2),e=wa(e,t,2),e!==null&&(jd(e,2),Kr(e))}function Dt(e,t,n){if(e.tag===3)w1(e,e,n);else for(;t!==null;){if(t.tag===3){w1(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Sa===null||!Sa.has(s))){e=qs(n,e),n=y2(2),s=wa(t,n,2),s!==null&&(v2(n,s,t,e),jd(s,2),Kr(s));break}}t=t.return}}function vg(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new c4;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(hv=!0,r.add(n),e=p4.bind(null,e,t,n),t.then(e,e))}function p4(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ut===e&&(yt&n)===n&&(on===4||on===3&&(yt&62914560)===yt&&300>As()-im?!(Tt&2)&&ac(e,0):pv|=n,rc===yt&&(rc=0)),Kr(e)}function iA(e,t){t===0&&(t=QC()),e=Kl(e,t),e!==null&&(jd(e,t),Kr(e))}function m4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),iA(e,n)}function g4(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(je(314))}s!==null&&s.delete(t),iA(e,n)}function b4(e,t){return My(e,t)}var up=null,ro=null,Lb=!1,dp=!1,kg=!1,ga=0;function Kr(e){e!==ro&&e.next===null&&(ro===null?up=ro=e:ro=ro.next=e),dp=!0,Lb||(Lb=!0,y4())}function Pd(e,t){if(!kg&&dp){kg=!0;do for(var n=!1,s=up;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var i=0;else{var a=s.suspendedLanes,l=s.pingedLanes;i=(1<<31-js(42|e)+1)-1,i&=r&~(a&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,S1(s,i))}else i=yt,i=Vp(s,s===Ut?i:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(i&3)||Md(s,i)||(n=!0,S1(s,i));s=s.next}while(n);kg=!1}}function x4(){aA()}function aA(){dp=Lb=!1;var e=0;ga!==0&&A4()&&(e=ga);for(var t=As(),n=null,s=up;s!==null;){var r=s.next,i=lA(s,t);i===0?(s.next=null,n===null?up=r:n.next=r,r===null&&(ro=n)):(n=s,(e!==0||i&3)&&(dp=!0)),s=r}Nn!==0&&Nn!==5||Pd(e),ga!==0&&(ga=0)}function lA(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var a=31-js(i),l=1<<a,c=r[a];c===-1?(!(l&n)||l&s)&&(r[a]=KD(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=Ut,n=yt,n=Vp(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(Ot===2||Ot===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Xm(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Md(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Xm(s),Ry(n)){case 2:case 8:n=VC;break;case 32:n=Yh;break;case 268435456:n=XC;break;default:n=Yh}return s=oA.bind(null,e),n=My(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Xm(s),e.callbackPriority=2,e.callbackNode=null,2}function oA(e,t){if(Nn!==0&&Nn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(om()&&e.callbackNode!==n)return null;var s=yt;return s=Vp(e,e===Ut?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Y2(e,s,t),lA(e,As()),e.callbackNode!=null&&e.callbackNode===n?oA.bind(null,e):null)}function S1(e,t){if(om())return null;Y2(e,t,!0)}function y4(){j4(function(){Tt&6?My(YC,x4):aA()})}function gv(){if(ga===0){var e=tc;e===0&&(e=xf,xf<<=1,!(xf&261888)&&(xf=256)),ga=e}return ga}function N1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:xh(""+e)}function E1(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 v4(e,t,n,s,r){if(t==="submit"&&n&&n.stateNode===r){var i=N1((r[bs]||null).action),a=s.submitter;a&&(t=(t=a[bs]||null)?N1(t.formAction):a.getAttribute("formAction"),t!==null&&(i=t,a=null));var l=new Xp("action","action",null,s,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ga!==0){var c=a?E1(r,a):new FormData(r);_b(n,{pending:!0,data:c,method:r.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=a?E1(r,a):new FormData(r),_b(n,{pending:!0,data:c,method:r.method,action:i},i,c))},currentTarget:r}]})}}for(var wg=0;wg<pb.length;wg++){var Sg=pb[wg],k4=Sg.toLowerCase(),w4=Sg[0].toUpperCase()+Sg.slice(1);br(k4,"on"+w4)}br(vT,"onAnimationEnd");br(kT,"onAnimationIteration");br(wT,"onAnimationStart");br("dblclick","onDoubleClick");br("focusin","onFocus");br("focusout","onBlur");br(zI,"onTransitionRun");br(UI,"onTransitionStart");br(FI,"onTransitionCancel");br(ST,"onTransitionEnd");Jo("onMouseEnter",["mouseout","mouseover"]);Jo("onMouseLeave",["mouseout","mouseover"]);Jo("onPointerEnter",["pointerout","pointerover"]);Jo("onPointerLeave",["pointerout","pointerover"]);Hl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Hl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Hl("onBeforeInput",["compositionend","keypress","textInput","paste"]);Hl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Hl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Hl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yu="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(" "),S4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yu));function cA(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var a=s.length-1;0<=a;a--){var l=s[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(d){Xh(d)}r.currentTarget=null,i=c}else for(a=0;a<s.length;a++){if(l=s[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(d){Xh(d)}r.currentTarget=null,i=c}}}}function gt(e,t){var n=t[ab];n===void 0&&(n=t[ab]=new Set);var s=e+"__bubble";n.has(s)||(uA(t,e,2,!1),n.add(s))}function Ng(e,t,n){var s=0;t&&(s|=4),uA(n,e,s,t)}var Tf="_reactListening"+Math.random().toString(36).slice(2);function bv(e){if(!e[Tf]){e[Tf]=!0,tT.forEach(function(n){n!=="selectionchange"&&(S4.has(n)||Ng(n,!1,e),Ng(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tf]||(t[Tf]=!0,Ng("selectionchange",!1,t))}}function uA(e,t,n,s){switch(SA(t)){case 2:var r=W4;break;case 8:r=Z4;break;default:r=kv}n=r.bind(null,t,n,e),r=void 0,!db||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Eg(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var a=s.tag;if(a===3||a===4){var l=s.stateNode.containerInfo;if(l===r)break;if(a===4)for(a=s.return;a!==null;){var c=a.tag;if((c===3||c===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;l!==null;){if(a=uo(l),a===null)return;if(c=a.tag,c===5||c===6||c===26||c===27){s=i=a;continue e}l=l.parentNode}}s=s.return}cT(function(){var u=i,d=Iy(n),f=[];e:{var h=NT.get(e);if(h!==void 0){var p=Xp,m=e;switch(e){case"keypress":if(vh(n)===0)break e;case"keydown":case"keyup":p=gI;break;case"focusin":m="focus",p=eg;break;case"focusout":m="blur",p=eg;break;case"beforeblur":case"afterblur":p=eg;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Ow;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=rI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=yI;break;case vT:case kT:case wT:p=lI;break;case ST:p=kI;break;case"scroll":case"scrollend":p=nI;break;case"wheel":p=SI;break;case"copy":case"cut":case"paste":p=cI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Iw;break;case"toggle":case"beforetoggle":p=EI}var k=(t&4)!==0,w=!k&&(e==="scroll"||e==="scrollend"),g=k?h!==null?h+"Capture":null:h;k=[];for(var y=u,x;y!==null;){var S=y;if(x=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||x===null||g===null||(S=Uu(y,g),S!=null&&k.push(Vu(y,S,x))),w)break;y=y.return}0<k.length&&(h=new p(h,m,null,n,d),f.push({event:h,listeners:k}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==ub&&(m=n.relatedTarget||n.fromElement)&&(uo(m)||m[Sc]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?uo(m):null,m!==null&&(w=Td(m),k=m.tag,m!==w||k!==5&&k!==27&&k!==6)&&(m=null)):(p=null,m=u),p!==m)){if(k=Ow,S="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(k=Iw,S="onPointerLeave",g="onPointerEnter",y="pointer"),w=p==null?h:nu(p),x=m==null?h:nu(m),h=new k(S,y+"leave",p,n,d),h.target=w,h.relatedTarget=x,S=null,uo(d)===u&&(k=new k(g,y+"enter",m,n,d),k.target=x,k.relatedTarget=w,S=k),w=S,p&&m)t:{for(k=N4,g=p,y=m,x=0,S=g;S;S=k(S))x++;S=0;for(var A=y;A;A=k(A))S++;for(;0<x-S;)g=k(g),x--;for(;0<S-x;)y=k(y),S--;for(;x--;){if(g===y||y!==null&&g===y.alternate){k=g;break t}g=k(g),y=k(y)}k=null}else k=null;p!==null&&_1(f,h,p,k,!1),m!==null&&w!==null&&_1(f,w,m,k,!0)}}e:{if(h=u?nu(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var E=Uw;else if(zw(h))if(mT)E=II;else{E=OI;var M=RI}else p=h.nodeName,!p||p.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?u&&Dy(u.elementType)&&(E=Uw):E=DI;if(E&&(E=E(e,u))){pT(f,E,n,d);break e}M&&M(e,h,u),e==="focusout"&&u&&h.type==="number"&&u.memoizedProps.value!=null&&cb(h,"number",h.value)}switch(M=u?nu(u):window,e){case"focusin":(zw(M)||M.contentEditable==="true")&&(po=M,fb=u,bu=null);break;case"focusout":bu=fb=po=null;break;case"mousedown":hb=!0;break;case"contextmenu":case"mouseup":case"dragend":hb=!1,Gw(f,n,d);break;case"selectionchange":if(PI)break;case"keydown":case"keyup":Gw(f,n,d)}var j;if(zy)e:{switch(e){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else ho?fT(e,n)&&(O="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(O="onCompositionStart");O&&(dT&&n.locale!=="ko"&&(ho||O!=="onCompositionStart"?O==="onCompositionEnd"&&ho&&(j=uT()):(ha=d,Ly="value"in ha?ha.value:ha.textContent,ho=!0)),M=fp(u,O),0<M.length&&(O=new Dw(O,e,null,n,d),f.push({event:O,listeners:M}),j?O.data=j:(j=hT(n),j!==null&&(O.data=j)))),(j=CI?TI(e,n):AI(e,n))&&(O=fp(u,"onBeforeInput"),0<O.length&&(M=new Dw("onBeforeInput","beforeinput",null,n,d),f.push({event:M,listeners:O}),M.data=j)),v4(f,e,u,n,d)}cA(f,t)})}function Vu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fp(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||i===null||(r=Uu(e,n),r!=null&&s.unshift(Vu(e,r,i)),r=Uu(e,t),r!=null&&s.push(Vu(e,r,i))),e.tag===3)return s;e=e.return}return[]}function N4(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function _1(e,t,n,s,r){for(var i=t._reactName,a=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===s)break;l!==5&&l!==26&&l!==27||u===null||(c=u,r?(u=Uu(n,i),u!=null&&a.unshift(Vu(n,u,c))):r||(u=Uu(n,i),u!=null&&a.push(Vu(n,u,c)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var E4=/\r\n?/g,_4=/\u0000|\uFFFD/g;function C1(e){return(typeof e=="string"?e:""+e).replace(E4,`
49
+ `).replace(_4,"")}function dA(e,t){return t=C1(t),C1(e)===t}function Lt(e,t,n,s,r,i){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||ec(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&ec(e,""+s);break;case"className":kf(e,"class",s);break;case"tabIndex":kf(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":kf(e,n,s);break;case"style":oT(e,s,i);break;case"data":if(t!=="object"){kf(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=xh(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="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}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&Lt(e,t,"name",r.name,r,null),Lt(e,t,"formEncType",r.formEncType,r,null),Lt(e,t,"formMethod",r.formMethod,r,null),Lt(e,t,"formTarget",r.formTarget,r,null)):(Lt(e,t,"encType",r.encType,r,null),Lt(e,t,"method",r.method,r,null),Lt(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=xh(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=bi);break;case"onScroll":s!=null&&gt("scroll",e);break;case"onScrollEnd":s!=null&&gt("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(je(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(je(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=xh(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":gt("beforetoggle",e),gt("toggle",e),bh(e,"popover",s);break;case"xlinkActuate":ni(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ni(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ni(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ni(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ni(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ni(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ni(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ni(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ni(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":bh(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=eI.get(n)||n,bh(e,n,s))}}function Pb(e,t,n,s,r,i){switch(n){case"style":oT(e,s,i);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(je(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(je(60));e.innerHTML=n}}break;case"children":typeof s=="string"?ec(e,s):(typeof s=="number"||typeof s=="bigint")&&ec(e,""+s);break;case"onScroll":s!=null&&gt("scroll",e);break;case"onScrollEnd":s!=null&&gt("scrollend",e);break;case"onClick":s!=null&&(e.onclick=bi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!nT.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),i=e[bs]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,r),typeof s=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,r);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):bh(e,n,s)}}}function Bn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gt("error",e),gt("load",e);var s=!1,r=!1,i;for(i in n)if(n.hasOwnProperty(i)){var a=n[i];if(a!=null)switch(i){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(je(137,t));default:Lt(e,t,i,a,n,null)}}r&&Lt(e,t,"srcSet",n.srcSet,n,null),s&&Lt(e,t,"src",n.src,n,null);return;case"input":gt("invalid",e);var l=i=a=r=null,c=null,u=null;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(d!=null)switch(s){case"name":r=d;break;case"type":a=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":i=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(je(137,t));break;default:Lt(e,t,s,d,n,null)}}iT(e,i,l,c,u,a,r,!1);return;case"select":gt("invalid",e),s=a=i=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":i=l;break;case"defaultValue":a=l;break;case"multiple":s=l;default:Lt(e,t,r,l,n,null)}t=i,n=a,e.multiple=!!s,t!=null?_o(e,!!s,t,!1):n!=null&&_o(e,!!s,n,!0);return;case"textarea":gt("invalid",e),i=r=s=null;for(a in n)if(n.hasOwnProperty(a)&&(l=n[a],l!=null))switch(a){case"value":s=l;break;case"defaultValue":r=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(je(91));break;default:Lt(e,t,a,l,n,null)}lT(e,s,r,i);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(s=n[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Lt(e,t,c,s,n,null)}return;case"dialog":gt("beforetoggle",e),gt("toggle",e),gt("cancel",e),gt("close",e);break;case"iframe":case"object":gt("load",e);break;case"video":case"audio":for(s=0;s<Yu.length;s++)gt(Yu[s],e);break;case"image":gt("error",e),gt("load",e);break;case"details":gt("toggle",e);break;case"embed":case"source":case"link":gt("error",e),gt("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)&&(s=n[u],s!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(je(137,t));default:Lt(e,t,u,s,n,null)}return;default:if(Dy(t)){for(d in n)n.hasOwnProperty(d)&&(s=n[d],s!==void 0&&Pb(e,t,d,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(s=n[l],s!=null&&Lt(e,t,l,s,n,null))}function C4(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,i=null,a=null,l=null,c=null,u=null,d=null;for(p in n){var f=n[p];if(n.hasOwnProperty(p)&&f!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":c=f;default:s.hasOwnProperty(p)||Lt(e,t,p,null,s,f)}}for(var h in s){var p=s[h];if(f=n[h],s.hasOwnProperty(h)&&(p!=null||f!=null))switch(h){case"type":i=p;break;case"name":r=p;break;case"checked":u=p;break;case"defaultChecked":d=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(je(137,t));break;default:p!==f&&Lt(e,t,h,p,s,f)}}ob(e,a,l,c,u,d,i,r);return;case"select":p=a=l=h=null;for(i in n)if(c=n[i],n.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":p=c;default:s.hasOwnProperty(i)||Lt(e,t,i,null,s,c)}for(r in s)if(i=s[r],c=n[r],s.hasOwnProperty(r)&&(i!=null||c!=null))switch(r){case"value":h=i;break;case"defaultValue":l=i;break;case"multiple":a=i;default:i!==c&&Lt(e,t,r,i,s,c)}t=l,n=a,s=p,h!=null?_o(e,!!n,h,!1):!!s!=!!n&&(t!=null?_o(e,!!n,t,!0):_o(e,!!n,n?[]:"",!1));return;case"textarea":p=h=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!s.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Lt(e,t,l,null,s,r)}for(a in s)if(r=s[a],i=n[a],s.hasOwnProperty(a)&&(r!=null||i!=null))switch(a){case"value":h=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(je(91));break;default:r!==i&&Lt(e,t,a,r,s,i)}aT(e,h,p);return;case"option":for(var m in n)if(h=n[m],n.hasOwnProperty(m)&&h!=null&&!s.hasOwnProperty(m))switch(m){case"selected":e.selected=!1;break;default:Lt(e,t,m,null,s,h)}for(c in s)if(h=s[c],p=n[c],s.hasOwnProperty(c)&&h!==p&&(h!=null||p!=null))switch(c){case"selected":e.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Lt(e,t,c,h,s,p)}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 k in n)h=n[k],n.hasOwnProperty(k)&&h!=null&&!s.hasOwnProperty(k)&&Lt(e,t,k,null,s,h);for(u in s)if(h=s[u],p=n[u],s.hasOwnProperty(u)&&h!==p&&(h!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(je(137,t));break;default:Lt(e,t,u,h,s,p)}return;default:if(Dy(t)){for(var w in n)h=n[w],n.hasOwnProperty(w)&&h!==void 0&&!s.hasOwnProperty(w)&&Pb(e,t,w,void 0,s,h);for(d in s)h=s[d],p=n[d],!s.hasOwnProperty(d)||h===p||h===void 0&&p===void 0||Pb(e,t,d,h,s,p);return}}for(var g in n)h=n[g],n.hasOwnProperty(g)&&h!=null&&!s.hasOwnProperty(g)&&Lt(e,t,g,null,s,h);for(f in s)h=s[f],p=n[f],!s.hasOwnProperty(f)||h===p||h==null&&p==null||Lt(e,t,f,h,s,p)}function T1(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function T4(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var r=n[s],i=r.transferSize,a=r.initiatorType,l=r.duration;if(i&&l&&T1(a)){for(a=0,l=r.responseEnd,s+=1;s<n.length;s++){var c=n[s],u=c.startTime;if(u>l)break;var d=c.transferSize,f=c.initiatorType;d&&T1(f)&&(c=c.responseEnd,a+=d*(c<l?1:(l-u)/(c-u)))}if(--s,t+=8*(i+a)/(r.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 zb=null,Ub=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function A1(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 fA(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 Fb(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 _g=null;function A4(){var e=window.event;return e&&e.type==="popstate"?e===_g?!1:(_g=e,!0):(_g=null,!1)}var hA=typeof setTimeout=="function"?setTimeout:void 0,M4=typeof clearTimeout=="function"?clearTimeout:void 0,M1=typeof Promise=="function"?Promise:void 0,j4=typeof queueMicrotask=="function"?queueMicrotask:typeof M1<"u"?function(e){return M1.resolve(null).then(e).catch(R4)}:hA;function R4(e){setTimeout(function(){throw e})}function La(e){return e==="head"}function j1(e,t){var n=t,s=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(r),oc(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")Cu(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Cu(n);for(var i=n.firstChild;i;){var a=i.nextSibling,l=i.nodeName;i[Rd]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=a}}else n==="body"&&Cu(e.ownerDocument.body);n=r}while(n);oc(t)}function R1(e,t){var n=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function Bb(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":Bb(n),Oy(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function O4(e,t,n,s){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Rd])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Ws(e.nextSibling),e===null)break}return null}function D4(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ws(e.nextSibling),e===null))return null;return e}function pA(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ws(e.nextSibling),e===null))return null;return e}function Hb(e){return e.data==="$?"||e.data==="$~"}function $b(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function I4(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Ws(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 Gb=null;function O1(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ws(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function D1(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 mA(e,t,n){switch(t=hp(n),e){case"html":if(e=t.documentElement,!e)throw Error(je(452));return e;case"head":if(e=t.head,!e)throw Error(je(453));return e;case"body":if(e=t.body,!e)throw Error(je(454));return e;default:throw Error(je(451))}}function Cu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Oy(e)}var Js=new Map,I1=new Set;function pp(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ri=Mt.d;Mt.d={f:L4,r:P4,D:z4,C:U4,L:F4,m:B4,X:$4,S:H4,M:G4};function L4(){var e=Ri.f(),t=am();return e||t}function P4(e){var t=Nc(e);t!==null&&t.tag===5&&t.type==="form"?o2(t):Ri.r(e)}var Tc=typeof document>"u"?null:document;function gA(e,t,n){var s=Tc;if(s&&typeof t=="string"&&t){var r=Ks(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),I1.has(r)||(I1.add(r),e={rel:e,crossOrigin:n,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),Bn(t,"link",e),Rn(t),s.head.appendChild(t)))}}function z4(e){Ri.D(e),gA("dns-prefetch",e,null)}function U4(e,t){Ri.C(e,t),gA("preconnect",e,t)}function F4(e,t,n){Ri.L(e,t,n);var s=Tc;if(s&&e&&t){var r='link[rel="preload"][as="'+Ks(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Ks(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Ks(n.imageSizes)+'"]')):r+='[href="'+Ks(e)+'"]';var i=r;switch(t){case"style":i=lc(e);break;case"script":i=Ac(e)}Js.has(i)||(e=Xt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Js.set(i,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(zd(i))||t==="script"&&s.querySelector(Ud(i))||(t=s.createElement("link"),Bn(t,"link",e),Rn(t),s.head.appendChild(t)))}}function B4(e,t){Ri.m(e,t);var n=Tc;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ks(s)+'"][href="'+Ks(e)+'"]',i=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Ac(e)}if(!Js.has(i)&&(e=Xt({rel:"modulepreload",href:e},t),Js.set(i,e),n.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ud(i)))return}s=n.createElement("link"),Bn(s,"link",e),Rn(s),n.head.appendChild(s)}}}function H4(e,t,n){Ri.S(e,t,n);var s=Tc;if(s&&e){var r=Eo(s).hoistableStyles,i=lc(e);t=t||"default";var a=r.get(i);if(!a){var l={loading:0,preload:null};if(a=s.querySelector(zd(i)))l.loading=5;else{e=Xt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Js.get(i))&&xv(e,n);var c=a=s.createElement("link");Rn(c),Bn(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Th(a,t,s)}a={type:"stylesheet",instance:a,count:1,state:l},r.set(i,a)}}}function $4(e,t){Ri.X(e,t);var n=Tc;if(n&&e){var s=Eo(n).hoistableScripts,r=Ac(e),i=s.get(r);i||(i=n.querySelector(Ud(r)),i||(e=Xt({src:e,async:!0},t),(t=Js.get(r))&&yv(e,t),i=n.createElement("script"),Rn(i),Bn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function G4(e,t){Ri.M(e,t);var n=Tc;if(n&&e){var s=Eo(n).hoistableScripts,r=Ac(e),i=s.get(r);i||(i=n.querySelector(Ud(r)),i||(e=Xt({src:e,async:!0,type:"module"},t),(t=Js.get(r))&&yv(e,t),i=n.createElement("script"),Rn(i),Bn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function L1(e,t,n,s){var r=(r=ya.current)?pp(r):null;if(!r)throw Error(je(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=lc(n.href),n=Eo(r).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=lc(n.href);var i=Eo(r).hoistableStyles,a=i.get(e);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,a),(i=r.querySelector(zd(e)))&&!i._p&&(a.instance=i,a.state.loading=5),Js.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},Js.set(e,n),i||K4(r,e,n,a.state))),t&&s===null)throw Error(je(528,""));return a}if(t&&s!==null)throw Error(je(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ac(n),n=Eo(r).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(je(444,e))}}function lc(e){return'href="'+Ks(e)+'"'}function zd(e){return'link[rel="stylesheet"]['+e+"]"}function bA(e){return Xt({},e,{"data-precedence":e.precedence,precedence:null})}function K4(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Bn(t,"link",n),Rn(t),e.head.appendChild(t))}function Ac(e){return'[src="'+Ks(e)+'"]'}function Ud(e){return"script[async]"+e}function P1(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Ks(n.href)+'"]');if(s)return t.instance=s,Rn(s),s;var r=Xt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Rn(s),Bn(s,"style",r),Th(s,n.precedence,e),t.instance=s;case"stylesheet":r=lc(n.href);var i=e.querySelector(zd(r));if(i)return t.state.loading|=4,t.instance=i,Rn(i),i;s=bA(n),(r=Js.get(r))&&xv(s,r),i=(e.ownerDocument||e).createElement("link"),Rn(i);var a=i;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Bn(i,"link",s),t.state.loading|=4,Th(i,n.precedence,e),t.instance=i;case"script":return i=Ac(n.src),(r=e.querySelector(Ud(i)))?(t.instance=r,Rn(r),r):(s=n,(r=Js.get(i))&&(s=Xt({},n),yv(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),Rn(r),Bn(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(je(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,Th(s,n.precedence,e));return t.instance}function Th(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,i=r,a=0;a<s.length;a++){var l=s[a];if(l.dataset.precedence===t)i=l;else if(i!==r)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function xv(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function yv(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ah=null;function z1(e,t,n){if(Ah===null){var s=new Map,r=Ah=new Map;r.set(n,s)}else r=Ah,s=r.get(n),s||(s=new Map,r.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var i=n[r];if(!(i[Rd]||i[zn]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var a=i.getAttribute(t)||"";a=e+a;var l=s.get(a);l?l.push(i):s.set(a,[i])}}return s}function U1(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function q4(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 xA(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function Y4(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=lc(s.href),i=t.querySelector(zd(r));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=mp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,Rn(i);return}i=t.ownerDocument||t,s=bA(s),(r=Js.get(r))&&xv(s,r),i=i.createElement("link"),Rn(i);var a=i;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Bn(i,"link",s),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=mp.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Cg=0;function V4(e,t){return e.stylesheets&&e.count===0&&Mh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&Mh(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Cg===0&&(Cg=62500*T4());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Mh(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Cg?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function mp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var gp=null;function Mh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,gp=new Map,t.forEach(X4,e),gp=null,mp.call(e))}function X4(e,t){if(!(t.state.loading&4)){var n=gp.get(e);if(n)var s=n.get(null);else{n=new Map,gp.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<r.length;i++){var a=r[i];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),s=a)}s&&n.set(null,s)}r=t.instance,a=r.getAttribute("data-precedence"),i=n.get(a)||s,i===s&&n.set(null,r),n.set(a,r),this.count++,s=mp.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),i?i.parentNode.insertBefore(r,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Xu={$$typeof:gi,Provider:null,Consumer:null,_currentValue:hl,_currentValue2:hl,_threadCount:0};function Q4(e,t,n,s,r,i,a,l,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=Qm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qm(0),this.hiddenUpdates=Qm(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=i,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function yA(e,t,n,s,r,i,a,l,c,u,d,f){return e=new Q4(e,t,n,a,c,u,d,f,l),t=1,i===!0&&(t|=24),i=_s(3,null,null,t),e.current=i,i.stateNode=e,t=Ky(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:s,isDehydrated:n,cache:t},Vy(i),e}function vA(e){return e?(e=bo,e):bo}function kA(e,t,n,s,r,i){r=vA(r),s.context===null?s.context=r:s.pendingContext=r,s=ka(t),s.payload={element:n},i=i===void 0?null:i,i!==null&&(s.callback=i),n=wa(e,s,t),n!==null&&(gs(n,e,t),yu(n,e,t))}function F1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vv(e,t){F1(e,t),(e=e.alternate)&&F1(e,t)}function wA(e){if(e.tag===13||e.tag===31){var t=Kl(e,67108864);t!==null&&gs(t,e,67108864),vv(e,67108864)}}function B1(e){if(e.tag===13||e.tag===31){var t=Rs();t=jy(t);var n=Kl(e,t);n!==null&&gs(n,e,t),vv(e,t)}}var bp=!0;function W4(e,t,n,s){var r=nt.T;nt.T=null;var i=Mt.p;try{Mt.p=2,kv(e,t,n,s)}finally{Mt.p=i,nt.T=r}}function Z4(e,t,n,s){var r=nt.T;nt.T=null;var i=Mt.p;try{Mt.p=8,kv(e,t,n,s)}finally{Mt.p=i,nt.T=r}}function kv(e,t,n,s){if(bp){var r=Kb(s);if(r===null)Eg(e,t,s,xp,n),H1(e,s);else if(eL(r,e,t,n,s))s.stopPropagation();else if(H1(e,s),t&4&&-1<J4.indexOf(e)){for(;r!==null;){var i=Nc(r);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var a=Qa(i.pendingLanes);if(a!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;a;){var c=1<<31-js(a);l.entanglements[1]|=c,a&=~c}Kr(i),!(Tt&6)&&(lp=As()+500,Pd(0))}}break;case 31:case 13:l=Kl(i,2),l!==null&&gs(l,i,2),am(),vv(i,2)}if(i=Kb(s),i===null&&Eg(e,t,s,xp,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else Eg(e,t,s,null,n)}}function Kb(e){return e=Iy(e),wv(e)}var xp=null;function wv(e){if(xp=null,e=uo(e),e!==null){var t=Td(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=HC(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 xp=e,null}function SA(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(zD()){case YC:return 2;case VC:return 8;case Yh:case UD:return 32;case XC:return 268435456;default:return 32}default:return 32}}var qb=!1,Ea=null,_a=null,Ca=null,Qu=new Map,Wu=new Map,sa=[],J4="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 H1(e,t){switch(e){case"focusin":case"focusout":Ea=null;break;case"dragenter":case"dragleave":_a=null;break;case"mouseover":case"mouseout":Ca=null;break;case"pointerover":case"pointerout":Qu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wu.delete(t.pointerId)}}function Kc(e,t,n,s,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},t!==null&&(t=Nc(t),t!==null&&wA(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function eL(e,t,n,s,r){switch(t){case"focusin":return Ea=Kc(Ea,e,t,n,s,r),!0;case"dragenter":return _a=Kc(_a,e,t,n,s,r),!0;case"mouseover":return Ca=Kc(Ca,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return Qu.set(i,Kc(Qu.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,Wu.set(i,Kc(Wu.get(i)||null,e,t,n,s,r)),!0}return!1}function NA(e){var t=uo(e.target);if(t!==null){var n=Td(t);if(n!==null){if(t=n.tag,t===13){if(t=HC(n),t!==null){e.blockedOn=t,_w(e.priority,function(){B1(n)});return}}else if(t===31){if(t=$C(n),t!==null){e.blockedOn=t,_w(e.priority,function(){B1(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 jh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Kb(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);ub=s,n.target.dispatchEvent(s),ub=null}else return t=Nc(n),t!==null&&wA(t),e.blockedOn=n,!1;t.shift()}return!0}function $1(e,t,n){jh(e)&&n.delete(t)}function tL(){qb=!1,Ea!==null&&jh(Ea)&&(Ea=null),_a!==null&&jh(_a)&&(_a=null),Ca!==null&&jh(Ca)&&(Ca=null),Qu.forEach($1),Wu.forEach($1)}function Af(e,t){e.blockedOn===t&&(e.blockedOn=null,qb||(qb=!0,En.unstable_scheduleCallback(En.unstable_NormalPriority,tL)))}var Mf=null;function G1(e){Mf!==e&&(Mf=e,En.unstable_scheduleCallback(En.unstable_NormalPriority,function(){Mf===e&&(Mf=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(wv(s||n)===null)continue;break}var i=Nc(n);i!==null&&(e.splice(t,3),t-=3,_b(i,{pending:!0,data:r,method:n.method,action:s},s,r))}}))}function oc(e){function t(c){return Af(c,e)}Ea!==null&&Af(Ea,e),_a!==null&&Af(_a,e),Ca!==null&&Af(Ca,e),Qu.forEach(t),Wu.forEach(t);for(var n=0;n<sa.length;n++){var s=sa[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<sa.length&&(n=sa[0],n.blockedOn===null);)NA(n),n.blockedOn===null&&sa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var r=n[s],i=n[s+1],a=r[bs]||null;if(typeof i=="function")a||G1(n);else if(a){var l=null;if(i&&i.hasAttribute("formAction")){if(r=i,a=i[bs]||null)l=a.formAction;else if(wv(r)!==null)continue}else l=a.action;typeof l=="function"?n[s+1]=l:(n.splice(s,3),s-=3),G1(n)}}}function EA(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function Sv(e){this._internalRoot=e}cm.prototype.render=Sv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(je(409));var n=t.current,s=Rs();kA(n,s,e,t,null,null)};cm.prototype.unmount=Sv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kA(e.current,2,null,e,null,null),am(),t[Sc]=null}};function cm(e){this._internalRoot=e}cm.prototype.unstable_scheduleHydration=function(e){if(e){var t=eT();e={blockedOn:null,target:e,priority:t};for(var n=0;n<sa.length&&t!==0&&t<sa[n].priority;n++);sa.splice(n,0,e),n===0&&NA(e)}};var K1=FC.version;if(K1!=="19.2.8")throw Error(je(527,K1,"19.2.8"));Mt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(je(188)):(e=Object.keys(e).join(","),Error(je(268,e)));return e=jD(t),e=e!==null?GC(e):null,e=e===null?null:e.stateNode,e};var nL={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:nt,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jf.isDisabled&&jf.supportsFiber)try{Ad=jf.inject(nL),Ms=jf}catch{}}qp.createRoot=function(e,t){if(!BC(e))throw Error(je(299));var n=!1,s="",r=g2,i=b2,a=x2;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=yA(e,1,!1,null,null,n,s,null,r,i,a,EA),e[Sc]=t.current,bv(e),new Sv(t)};qp.hydrateRoot=function(e,t,n){if(!BC(e))throw Error(je(299));var s=!1,r="",i=g2,a=b2,l=x2,c=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=yA(e,1,!0,t,n??null,s,r,c,i,a,l,EA),t.context=vA(null),n=t.current,s=Rs(),s=jy(s),r=ka(s),r.callback=null,wa(n,r,s),n=s,t.current.lanes=n,jd(t,n),Kr(t),e[Sc]=t.current,bv(e),new cm(t)};qp.version="19.2.8";function _A(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_A)}catch(e){console.error(e)}}_A(),DC.exports=qp;var sL=DC.exports;const rL=Cd(sL),CA=b.createContext(void 0),TA=e=>{const t=b.useContext(CA);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},iL=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(CA.Provider,{value:e,children:t})),aL={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var ia,wy,mC,lL=(mC=class{constructor(){et(this,ia,aL);et(this,wy,!1)}setTimeoutProvider(e){Ye(this,ia,e)}setTimeout(e,t){return ae(this,ia).setTimeout(e,t)}clearTimeout(e){ae(this,ia).clearTimeout(e)}setInterval(e,t){return ae(this,ia).setInterval(e,t)}clearInterval(e){ae(this,ia).clearInterval(e)}},ia=new WeakMap,wy=new WeakMap,mC);const nl=new lL;function oL(e){setTimeout(e,0)}const cL=typeof window>"u"||"Deno"in globalThis;function ps(){}function uL(e,t){return typeof e=="function"?e(t):e}function AA(e){return typeof e=="number"&&e>=0&&e!==1/0}function MA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jt(e,t){return typeof e=="function"?e(t):e}function q1(e,t){const{type:n="all",exact:s,fetchStatus:r,predicate:i,queryKey:a,stale:l}=e;if(a){if(s){if(t.queryHash!==Nv(a,t.options))return!1}else if(!cc(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||r&&r!==t.state.fetchStatus||i&&!i(t))}function Y1(e,t){const{exact:n,status:s,predicate:r,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Zu(t.options.mutationKey)!==Zu(i))return!1}else if(!cc(t.options.mutationKey,i))return!1}return!(s&&t.state.status!==s||r&&!r(t))}function Nv(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zu)(e)}function Zu(e){return JSON.stringify(e,(t,n)=>Yb(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function cc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let s=0;s<t.length;s++)if(!cc(e[s],t[s]))return!1;return!0}const n=Object.keys(t);for(const s of n)if(!cc(e[s],t[s]))return!1;return!0}return!1}const dL=Object.prototype.hasOwnProperty;function jA(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=V1(e)&&V1(t);if(!s&&!(Yb(e)&&Yb(t)))return t;const r=(s?e:Object.keys(e)).length,i=s?t:Object.keys(t),a=i.length,l=s?new Array(a):{};let c=0;for(let u=0;u<a;u++){const d=s?u:i[u],f=e[d],h=t[d];if(f===h){l[d]=f,(s?u<r:dL.call(e,d))&&c++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){l[d]=h;continue}const p=jA(f,h,n+1);l[d]=p,p===f&&c++}return r===a&&c===r?e:l}function Tg(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function V1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yb(e){if(!X1(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const s=n.prototype;return!(!X1(s)||!s.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function X1(e){return Object.prototype.toString.call(e)==="[object Object]"}function fL(e){return new Promise(t=>{nl.setTimeout(t,e)})}function Vb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?jA(e,t):t}function hL(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function pL(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}const Ev=Symbol();function RA(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ev?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function OA(e,t){return typeof e=="function"?e(...t):!!e}function mL(e,t,n){let s=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??(r=t()),s||(s=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),e}let gL=()=>cL;const _v=()=>gL();var Fd=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(){}},rl,aa,Uo,gC,bL=(gC=class extends Fd{constructor(){super();et(this,rl);et(this,aa);et(this,Uo);Ye(this,Uo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ae(this,aa)||this.setEventListener(ae(this,Uo))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,aa))==null||t.call(this),Ye(this,aa,void 0))}setEventListener(t){var n;Ye(this,Uo,t),(n=ae(this,aa))==null||n.call(this),Ye(this,aa,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){ae(this,rl)!==t&&(Ye(this,rl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ae(this,rl)=="boolean"?ae(this,rl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},rl=new WeakMap,aa=new WeakMap,Uo=new WeakMap,gC);const Cv=new bL,xL=oL;function yL(){let e=[],t=0,n=l=>{l()},s=l=>{l()},r=xL;const i=l=>{t?e.push(l):r(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&r(()=>{s(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{s=l},setScheduler:l=>{r=l}}}const Ln=yL();var Fo,la,Bo,bC,vL=(bC=class extends Fd{constructor(){super();et(this,Fo,!0);et(this,la);et(this,Bo);Ye(this,Bo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){ae(this,la)||this.setEventListener(ae(this,Bo))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,la))==null||t.call(this),Ye(this,la,void 0))}setEventListener(t){var n;Ye(this,Bo,t),(n=ae(this,la))==null||n.call(this),Ye(this,la,t(this.setOnline.bind(this)))}setOnline(t){ae(this,Fo)!==t&&(Ye(this,Fo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return ae(this,Fo)}},Fo=new WeakMap,la=new WeakMap,Bo=new WeakMap,bC);const yp=new vL;function kL(e){return Math.min(1e3*2**e,3e4)}function DA(e){return(e??"online")==="online"?yp.isOnline():!0}var Xb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function IA(e){let t=!1,n=0,s,r="pending",i,a;const l=new Promise((y,x)=>{i=y,a=x});l.catch(ps);const c=()=>r!=="pending",u=y=>{var x;if(!c()){const S=new Xb(y);k(S),(x=e.onCancel)==null||x.call(e,S)}},d=()=>{t=!0},f=()=>{t=!1},h=()=>Cv.isFocused()&&(e.networkMode==="always"||yp.isOnline())&&e.canRun(),p=()=>DA(e.networkMode)&&e.canRun(),m=y=>{c()||(s==null||s(),r="resolved",i(y))},k=y=>{c()||(s==null||s(),r="rejected",a(y))},w=y=>new Promise(x=>{var S;s=A=>{(c()||y())&&x(A)},(S=e.onPause)==null||S.call(e)}).then(()=>{var x;s=void 0,c()||(x=e.onContinue)==null||x.call(e)}),g=()=>{if(c())return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(S){y=Promise.reject(S)}Promise.resolve(y).then(m).catch(S=>{var O;if(c())return;const A=e.retry??(_v()?0:3),E=e.retryDelay??kL,M=typeof E=="function"?E(n,S):E,j=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,S);if(t||!j){k(S);return}n++,(O=e.onFail)==null||O.call(e,n,S),fL(M).then(()=>h()?void 0:w(h)).then(()=>{t?k(S):g()})})};return{promise:l,status:()=>r,cancel:u,continue:()=>(s==null||s(),l),cancelRetry:d,continueRetry:f,canStart:p,start:()=>(p()?g():w(p).then(g),l)}}var il,xC,LA=(xC=class{constructor(){et(this,il)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),AA(this.gcTime)&&Ye(this,il,nl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_v()?1/0:3e5))}clearGcTimeout(){ae(this,il)!==void 0&&(nl.clearTimeout(ae(this,il)),Ye(this,il,void 0))}},il=new WeakMap,xC);function wL(e){return{onFetch:(t,n)=>{var d,f,h,p,m;const s=t.options,r=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],a=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let k=!1;const w=x=>{mL(x,()=>t.signal,()=>k=!0)},g=RA(t.options,t.fetchOptions),y=async(x,S,A)=>{if(k)return Promise.reject(t.signal.reason);if(S==null&&x.pages.length)return Promise.resolve(x);const M=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:S,direction:A?"backward":"forward",meta:t.options.meta};return w(F),F})(),j=await g(M),{maxPages:O}=t.options,N=A?pL:hL;return{pages:N(x.pages,j,O),pageParams:N(x.pageParams,S,O)}};if(r&&i.length){const x=r==="backward",S=x?SL:Q1,A={pages:i,pageParams:a};l=await y(A,S(s,A),x)}else{const x=e??i.length;do{const S=c===0?a[0]??s.initialPageParam:Q1(s,l);if(c>0&&S==null)break;l=await y(l,S),c++}while(c<x)}return l};t.options.persister?t.fetchFn=()=>{var k,w;return(w=(k=t.options).persister)==null?void 0:w.call(k,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Q1(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function SL(e,{pages:t,pageParams:n}){var s;return t.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,n[0],n):void 0}var Ho,al,$o,Ps,ll,vn,wd,ol,sr,ci,yC,NL=(yC=class extends LA{constructor(t){super();et(this,sr);et(this,Ho);et(this,al);et(this,$o);et(this,Ps);et(this,ll);et(this,vn);et(this,wd);et(this,ol);Ye(this,ol,!1),Ye(this,wd,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ye(this,ll,t.client),Ye(this,Ps,ae(this,ll).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ye(this,al,Z1(this.options)),this.state=t.state??ae(this,al),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ae(this,Ho)}get promise(){var t;return(t=ae(this,vn))==null?void 0:t.promise}setOptions(t){if(this.options={...ae(this,wd),...t},t!=null&&t._type&&Ye(this,Ho,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Z1(this.options);n.data!==void 0&&(this.setState(W1(n.data,n.dataUpdatedAt)),Ye(this,al,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ae(this,Ps).remove(this)}setData(t,n){const s=Vb(this.state.data,t,this.options);return xt(this,sr,ci).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(t){xt(this,sr,ci).call(this,{type:"setState",state:t})}cancel(t){var s,r;const n=(s=ae(this,vn))==null?void 0:s.promise;return(r=ae(this,vn))==null||r.cancel(t),n?n.then(ps).catch(ps):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ae(this,al)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Jt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ev||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Jt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!MA(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(s=>s.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=ae(this,vn))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(s=>s.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=ae(this,vn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ae(this,Ps).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(ae(this,vn)&&(ae(this,ol)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?ae(this,vn).cancel({revert:!0}):ae(this,vn).cancelRetry()),this.scheduleGc()),ae(this,Ps).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||xt(this,sr,ci).call(this,{type:"invalidate"})}async fetch(t,n){var u,d,f,h,p,m,k,w,g,y,x,S;if(this.state.fetchStatus!=="idle"&&((u=ae(this,vn))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ae(this,vn))return ae(this,vn).continueRetry(),ae(this,vn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(E=>E.options.queryFn);A&&this.setOptions(A.options)}const s=new AbortController,r=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(Ye(this,ol,!0),s.signal)})},i=()=>{const A=RA(this.options,n),M=(()=>{const j={client:ae(this,ll),queryKey:this.queryKey,meta:this.meta};return r(j),j})();return Ye(this,ol,!1),this.options.persister?this.options.persister(A,M,this):A(M)},l=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ae(this,ll),state:this.state,fetchFn:i};return r(A),A})();(d=ae(this,Ho)==="infinite"?wL(this.options.pages):this.options.behavior)==null||d.onFetch(l,this),Ye(this,$o,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&xt(this,sr,ci).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const c=Ye(this,vn,IA({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:A=>{A instanceof Xb&&A.revert&&this.setState({...ae(this,$o),fetchStatus:"idle"}),s.abort()},onFail:(A,E)=>{xt(this,sr,ci).call(this,{type:"failed",failureCount:A,error:E})},onPause:()=>{xt(this,sr,ci).call(this,{type:"pause"})},onContinue:()=>{xt(this,sr,ci).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const A=await c.start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(m=(p=ae(this,Ps).config).onSuccess)==null||m.call(p,A,this),(w=(k=ae(this,Ps).config).onSettled)==null||w.call(k,A,this.state.error,this),A}catch(A){if(A instanceof Xb){if(A.silent)return ae(this,vn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw xt(this,sr,ci).call(this,{type:"error",error:A}),(y=(g=ae(this,Ps).config).onError)==null||y.call(g,A,this),(S=(x=ae(this,Ps).config).onSettled)==null||S.call(x,this.state.data,A,this),A}finally{ae(this,vn)===c&&Ye(this,vn,void 0),this.scheduleGc()}}},Ho=new WeakMap,al=new WeakMap,$o=new WeakMap,Ps=new WeakMap,ll=new WeakMap,vn=new WeakMap,wd=new WeakMap,ol=new WeakMap,sr=new WeakSet,ci=function(t){const n=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...PA(s.data,this.options),fetchMeta:t.meta??null};case"success":const r={...s,...W1(t.data,t.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ye(this,$o,t.manual?r:void 0),r;case"error":const i=t.error;return{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=n(this.state),Ln.batch(()=>{this.observers.slice().forEach(s=>{s.onQueryUpdate()}),ae(this,Ps).notify({query:this,type:"updated",action:t})})},yC);function PA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:DA(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function W1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Z1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Jn,vt,Sd,es,cl,Go,di,Nd,Ko,qo,ul,dl,oa,Yo,At,iu,Qb,Wb,Zb,Jb,ex,tx,nx,sx,vC,EL=(vC=class extends Fd{constructor(t,n){super();et(this,At);et(this,Jn);et(this,vt);et(this,Sd);et(this,es);et(this,cl);et(this,Go);et(this,di);et(this,Nd);et(this,Ko);et(this,qo);et(this,ul);et(this,dl);et(this,oa);et(this,Yo,new Set);this.options=n,Ye(this,Jn,t),Ye(this,di,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ae(this,vt).addObserver(this),J1(ae(this,vt),this.options)?xt(this,At,iu).call(this):this.updateResult(),xt(this,At,ex).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rx(ae(this,vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rx(ae(this,vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xt(this,At,tx).call(this),xt(this,At,nx).call(this),ae(this,vt).removeObserver(this)}setOptions(t){const n=this.options,s=ae(this,vt);if(this.options=ae(this,Jn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Jt(this.options.enabled,ae(this,vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");xt(this,At,sx).call(this),ae(this,vt).setOptions(this.options),n._defaulted&&!Tg(this.options,n)&&ae(this,Jn).getQueryCache().notify({type:"observerOptionsUpdated",query:ae(this,vt),observer:this});const r=this.hasListeners();r&&eS(ae(this,vt),s,this.options,n)&&xt(this,At,iu).call(this),this.updateResult(),r&&(ae(this,vt)!==s||Jt(this.options.enabled,ae(this,vt))!==Jt(n.enabled,ae(this,vt))||Jt(this.options.staleTime,ae(this,vt))!==Jt(n.staleTime,ae(this,vt)))&&xt(this,At,Wb).call(this);const i=xt(this,At,Zb).call(this);r&&(ae(this,vt)!==s||Jt(this.options.enabled,ae(this,vt))!==Jt(n.enabled,ae(this,vt))||i!==ae(this,oa))&&xt(this,At,Jb).call(this,i)}getOptimisticResult(t){const n=ae(this,Jn).getQueryCache().build(ae(this,Jn),t),s=this.createResult(n,t);return Tg(this.getCurrentResult(),s)||(Ye(this,es,s),Ye(this,Go,this.options),Ye(this,cl,ae(this,vt).state)),s}getCurrentResult(){return ae(this,es)}trackResult(t,n){return new Proxy(t,{get:(s,r)=>(this.trackProp(r),n==null||n(r),Reflect.get(s,r))})}trackProp(t){ae(this,Yo).add(t)}getCurrentQuery(){return ae(this,vt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ae(this,Jn).defaultQueryOptions(t),s=ae(this,Jn).getQueryCache().build(ae(this,Jn),n);let r=()=>{},i;const a=new Promise(l=>{i=l,r=ae(this,Jn).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===s.queryHash&&s.state.data!==void 0&&(r(),l(this.createResult(s,n)))})});return Promise.race([s.fetch().then(()=>{const l=this.createResult(s,n);return i==null||i(l),l}).finally(()=>{r()}),a])}fetch(t){return xt(this,At,iu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ae(this,es)))}createResult(t,n){var E;const s=ae(this,vt),r=this.options,i=ae(this,es),a=ae(this,cl),l=ae(this,Go),c=t!==s?t.state:ae(this,Sd),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const M=this.hasListeners(),j=!M&&J1(t,n),O=M&&eS(t,s,n,r);(j||O)&&(d={...d,...PA(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:k}=d;h=d.data;let w=!1;if(n.placeholderData!==void 0&&h===void 0&&k==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(M=i.data,w=!0):M=typeof n.placeholderData=="function"?n.placeholderData((E=ae(this,qo))==null?void 0:E.state.data,ae(this,qo)):n.placeholderData,M!==void 0&&(k="success",h=Vb(i==null?void 0:i.data,M,n),f=!0)}if(n.select&&h!==void 0&&!w)if(i&&h===(a==null?void 0:a.data)&&n.select===ae(this,Nd))h=ae(this,Ko);else try{Ye(this,Nd,n.select),h=n.select(h),h=Vb(i==null?void 0:i.data,h,n),Ye(this,Ko,h),Ye(this,di,null)}catch(M){Ye(this,di,M)}else h===void 0&&Ye(this,di,null);ae(this,di)&&(p=ae(this,di),h=ae(this,Ko),m=Date.now(),k="error",f=!1);const g=d.fetchStatus==="fetching",y=k==="pending",x=k==="error",S=y&&g,A=h!==void 0;return{status:k,fetchStatus:d.fetchStatus,isPending:y,isSuccess:k==="success",isError:x,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:g,isRefetching:g&&!y,isLoadingError:x&&!A,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&A,isStale:Tv(t,n),refetch:this.refetch,isEnabled:Jt(n.enabled,t)!==!1}}updateResult(){const t=ae(this,es),n=this.createResult(ae(this,vt),this.options);if(Ye(this,cl,ae(this,vt).state),Ye(this,Go,this.options),ae(this,cl).data!==void 0&&Ye(this,qo,ae(this,vt)),Tg(n,t))return;Ye(this,es,n);const r=(()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ae(this,Yo).size)return!0;const l=new Set(a??ae(this,Yo));return this.options.throwOnError&&l.add("error"),Object.keys(ae(this,es)).some(c=>{const u=c;return ae(this,es)[u]!==t[u]&&l.has(u)})})();Ln.batch(()=>{r&&this.listeners.forEach(i=>{i(ae(this,es))}),ae(this,Jn).getQueryCache().notify({query:ae(this,vt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xt(this,At,ex).call(this)}},Jn=new WeakMap,vt=new WeakMap,Sd=new WeakMap,es=new WeakMap,cl=new WeakMap,Go=new WeakMap,di=new WeakMap,Nd=new WeakMap,Ko=new WeakMap,qo=new WeakMap,ul=new WeakMap,dl=new WeakMap,oa=new WeakMap,Yo=new WeakMap,At=new WeakSet,iu=function(t){xt(this,At,sx).call(this);let n=ae(this,vt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ps)),n},Qb=function(t){return!_v()&&Jt(this.options.enabled,ae(this,vt))!==!1&&AA(t)},Wb=function(){xt(this,At,tx).call(this);const t=Jt(this.options.staleTime,ae(this,vt));if(ae(this,es).isStale||!xt(this,At,Qb).call(this,t))return;const n=MA(ae(this,es).dataUpdatedAt,t)+1;Ye(this,ul,nl.setTimeout(()=>{ae(this,es).isStale||this.updateResult()},n))},Zb=function(){return Jt(this.options.refetchInterval,ae(this,vt))??!1},Jb=function(t){xt(this,At,nx).call(this),Ye(this,oa,t),!(ae(this,oa)===0||!xt(this,At,Qb).call(this,ae(this,oa)))&&Ye(this,dl,nl.setInterval(()=>{(this.options.refetchIntervalInBackground||Cv.isFocused())&&xt(this,At,iu).call(this)},ae(this,oa)))},ex=function(){xt(this,At,Wb).call(this),xt(this,At,Jb).call(this,xt(this,At,Zb).call(this))},tx=function(){ae(this,ul)!==void 0&&(nl.clearTimeout(ae(this,ul)),Ye(this,ul,void 0))},nx=function(){ae(this,dl)!==void 0&&(nl.clearInterval(ae(this,dl)),Ye(this,dl,void 0))},sx=function(){const t=ae(this,Jn).getQueryCache().build(ae(this,Jn),this.options);if(t===ae(this,vt))return;const n=ae(this,vt);Ye(this,vt,t),Ye(this,Sd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},vC);function _L(e,t){return Jt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Jt(t.retryOnMount,e)===!1)}function J1(e,t){return _L(e,t)||e.state.data!==void 0&&rx(e,t,t.refetchOnMount)}function rx(e,t,n){if(Jt(t.enabled,e)!==!1&&Jt(t.staleTime,e)!=="static"){const s=Jt(n,e);return s==="always"||s!==!1&&Tv(e,t)}return!1}function eS(e,t,n,s){return(e!==t||Jt(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Tv(e,n)}function Tv(e,t){return Jt(t.enabled,e)!==!1&&e.isStaleByTime(Jt(t.staleTime,e))}var Ed,jr,Gn,fl,Rr,Xi,kC,CL=(kC=class extends LA{constructor(t){super();et(this,Rr);et(this,Ed);et(this,jr);et(this,Gn);et(this,fl);Ye(this,Ed,t.client),this.mutationId=t.mutationId,Ye(this,Gn,t.mutationCache),Ye(this,jr,[]),this.state=t.state||TL(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ae(this,jr).includes(t)||(ae(this,jr).push(t),this.clearGcTimeout(),ae(this,Gn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ye(this,jr,ae(this,jr).filter(n=>n!==t)),this.scheduleGc(),ae(this,Gn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ae(this,jr).length||(this.state.status==="pending"?this.scheduleGc():ae(this,Gn).remove(this))}continue(){var t;return((t=ae(this,fl))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var l,c,u,d,f,h,p,m,k,w,g,y,x,S,A,E,M,j;const n=()=>{xt(this,Rr,Xi).call(this,{type:"continue"})},s={client:ae(this,Ed),meta:this.options.meta,mutationKey:this.options.mutationKey},r=Ye(this,fl,IA({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(O,N)=>{xt(this,Rr,Xi).call(this,{type:"failed",failureCount:O,error:N})},onPause:()=>{xt(this,Rr,Xi).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ae(this,Gn).canRun(this)})),i=this.state.status==="pending",a=!r.canStart();try{if(i)n();else{xt(this,Rr,Xi).call(this,{type:"pending",variables:t,isPaused:a}),ae(this,Gn).config.onMutate&&await ae(this,Gn).config.onMutate(t,this,s);const N=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,s));N!==this.state.context&&xt(this,Rr,Xi).call(this,{type:"pending",context:N,variables:t,isPaused:a})}const O=await r.start();return await((d=(u=ae(this,Gn).config).onSuccess)==null?void 0:d.call(u,O,t,this.state.context,this,s)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,O,t,this.state.context,s)),await((m=(p=ae(this,Gn).config).onSettled)==null?void 0:m.call(p,O,null,this.state.variables,this.state.context,this,s)),await((w=(k=this.options).onSettled)==null?void 0:w.call(k,O,null,t,this.state.context,s)),xt(this,Rr,Xi).call(this,{type:"success",data:O}),O}catch(O){try{await((y=(g=ae(this,Gn).config).onError)==null?void 0:y.call(g,O,t,this.state.context,this,s))}catch(N){Promise.reject(N)}try{await((S=(x=this.options).onError)==null?void 0:S.call(x,O,t,this.state.context,s))}catch(N){Promise.reject(N)}try{await((E=(A=ae(this,Gn).config).onSettled)==null?void 0:E.call(A,void 0,O,this.state.variables,this.state.context,this,s))}catch(N){Promise.reject(N)}try{await((j=(M=this.options).onSettled)==null?void 0:j.call(M,void 0,O,t,this.state.context,s))}catch(N){Promise.reject(N)}throw xt(this,Rr,Xi).call(this,{type:"error",error:O}),O}finally{ae(this,fl)===r&&Ye(this,fl,void 0),ae(this,Gn).runNext(this)}}},Ed=new WeakMap,jr=new WeakMap,Gn=new WeakMap,fl=new WeakMap,Rr=new WeakSet,Xi=function(t){const n=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ln.batch(()=>{ae(this,jr).forEach(s=>{s.onMutationUpdate(t)}),ae(this,Gn).notify({mutation:this,type:"updated",action:t})})},kC);function TL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fi,rr,_d,wC,AL=(wC=class extends Fd{constructor(t={}){super();et(this,fi);et(this,rr);et(this,_d);this.config=t,Ye(this,fi,new Set),Ye(this,rr,new Map),Ye(this,_d,0)}build(t,n,s){const r=new CL({client:t,mutationCache:this,mutationId:++mf(this,_d)._,options:t.defaultMutationOptions(n),state:s});return this.add(r),r}add(t){ae(this,fi).add(t);const n=Rf(t);if(typeof n=="string"){const s=ae(this,rr).get(n);s?s.push(t):ae(this,rr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ae(this,fi).delete(t)){const n=Rf(t);if(typeof n=="string"){const s=ae(this,rr).get(n);if(s)if(s.length>1){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}else s[0]===t&&ae(this,rr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var s;const n=Rf(t);if(typeof n=="string"){const r=(s=ae(this,rr).get(n))==null?void 0:s.find(i=>i.state.status==="pending");return!r||r===t}else return!0}runNext(t){var s,r;const n=Rf(t);return typeof n=="string"?((r=(s=ae(this,rr).get(n))==null?void 0:s.find(i=>i!==t&&i.state.isPaused))==null?void 0:r.continue())??Promise.resolve():Promise.resolve()}clear(){Ln.batch(()=>{ae(this,fi).forEach(t=>{this.notify({type:"removed",mutation:t})}),ae(this,fi).clear(),ae(this,rr).clear()})}getAll(){return Array.from(ae(this,fi))}find(t){const n={exact:!0,...t};return this.getAll().find(s=>Y1(n,s))}findAll(t={}){return this.getAll().filter(n=>Y1(t,n))}notify(t){Ln.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ln.batch(()=>Promise.all(t.map(n=>n.continue().catch(ps))))}},fi=new WeakMap,rr=new WeakMap,_d=new WeakMap,wC);function Rf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Or,SC,ML=(SC=class extends Fd{constructor(t={}){super();et(this,Or);this.config=t,Ye(this,Or,new Map)}build(t,n,s){const r=n.queryKey,i=n.queryHash??Nv(r,n);let a=this.get(i);return a||(a=new NL({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(n),state:s,defaultOptions:t.getQueryDefaults(r)}),this.add(a)),a}add(t){ae(this,Or).has(t.queryHash)||(ae(this,Or).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){ae(this,Or).get(t.queryHash)===t&&(t.destroy(),ae(this,Or).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ln.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ae(this,Or).get(t)}getAll(){return[...ae(this,Or).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(s=>q1(n,s))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(s=>q1(t,s)):n}notify(t){Ln.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ln.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ln.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Or=new WeakMap,SC),nn,ca,ua,Vo,Xo,da,Qo,Wo,NC,jL=(NC=class{constructor(e={}){et(this,nn);et(this,ca);et(this,ua);et(this,Vo);et(this,Xo);et(this,da);et(this,Qo);et(this,Wo);Ye(this,nn,e.queryCache||new ML),Ye(this,ca,e.mutationCache||new AL),Ye(this,ua,e.defaultOptions||{}),Ye(this,Vo,new Map),Ye(this,Xo,new Map),Ye(this,da,0)}mount(){mf(this,da)._++,ae(this,da)===1&&(Ye(this,Qo,Cv.subscribe(async e=>{e&&(await this.resumePausedMutations(),ae(this,nn).onFocus())})),Ye(this,Wo,yp.subscribe(async e=>{e&&(await this.resumePausedMutations(),ae(this,nn).onOnline())})))}unmount(){var e,t;mf(this,da)._--,ae(this,da)===0&&((e=ae(this,Qo))==null||e.call(this),Ye(this,Qo,void 0),(t=ae(this,Wo))==null||t.call(this),Ye(this,Wo,void 0))}isFetching(e){return ae(this,nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ae(this,ca).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ae(this,nn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ae(this,nn).build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Jt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return ae(this,nn).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var a;const s=this.defaultQueryOptions({queryKey:e}),r=(a=ae(this,nn).get(s.queryHash))==null?void 0:a.state.data,i=uL(t,r);if(i!==void 0)return ae(this,nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ln.batch(()=>ae(this,nn).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ae(this,nn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ae(this,nn);Ln.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ae(this,nn);return Ln.batch(()=>{const s=n.findAll(e),r=new Set(s);return s.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>r.has(i)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},s=Ln.batch(()=>ae(this,nn).findAll(e).map(r=>r.cancel(n)));return Promise.all(s).then(ps).catch(ps)}invalidateQueries(e,t={}){return Ln.batch(()=>(ae(this,nn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=Ln.batch(()=>ae(this,nn).findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,n);return n.throwOnError||(i=i.catch(ps)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(ps)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ae(this,nn).build(this,t),s=n.isStaleByTime(Jt(t.staleTime,n))?await n.fetch(t):n.state.data,r=t.select;return r?r(s):s}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ae(this,nn).build(this,t);return n.isStaleByTime(Jt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ps).catch(ps)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ps).catch(ps)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return yp.isOnline()?ae(this,ca).resumePausedMutations():Promise.resolve()}getQueryCache(){return ae(this,nn)}getMutationCache(){return ae(this,ca)}getDefaultOptions(){return ae(this,ua)}setDefaultOptions(e){Ye(this,ua,e)}setQueryDefaults(e,t){ae(this,Vo).set(Zu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ae(this,Vo).values()],n={};return t.forEach(s=>{cc(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){ae(this,Xo).set(Zu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ae(this,Xo).values()],n={};return t.forEach(s=>{cc(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ae(this,ua).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nv(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===Ev&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ae(this,ua).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ae(this,nn).clear(),ae(this,ca).clear()}},nn=new WeakMap,ca=new WeakMap,ua=new WeakMap,Vo=new WeakMap,Xo=new WeakMap,da=new WeakMap,Qo=new WeakMap,Wo=new WeakMap,NC);const zA=b.createContext(!1),RL=()=>b.useContext(zA);zA.Provider;function OL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const DL=b.createContext(OL()),IL=()=>b.useContext(DL),LL=(e,t,n)=>{const s=n!=null&&n.state.error&&typeof e.throwOnError=="function"?OA(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||s)&&(t.isReset()||(e.retryOnMount=!1))},PL=e=>{b.useEffect(()=>{e.clearReset()},[e])},zL=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(r&&e.data===void 0||OA(n,[e.error,s])),UL=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},FL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,BL=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function HL(e,t,n){const s=RL(),r=IL(),i=TA(),a=i.defaultQueryOptions(e),l=i.getQueryCache().get(a.queryHash),c=e.subscribed!==!1;a._optimisticResults=s?"isRestoring":c?"optimistic":void 0,UL(a),LL(a,r,l),PL(r);const[u]=b.useState(()=>new t(i,a)),d=u.getOptimisticResult(a),f=!s&&c;if(b.useSyncExternalStore(b.useCallback(h=>{const p=f?u.subscribe(Ln.batchCalls(h)):ps;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(a)},[a,u]),FL(a,d))throw BL(a,u,r);if(zL({result:d,errorResetBoundary:r,throwOnError:a.throwOnError,query:l,suspense:a.suspense}))throw d.error;return a.notifyOnChangeProps?d:u.trackResult(d)}function vp(e,t){return HL(e,EL)}function $L(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>s=>{t.forEach(r=>r(s))},t)}const um=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Av(e){return"nodeType"in e}function ys(e){var t,n;return e?Mc(e)?e:Av(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Mv(e){const{Document:t}=ys(e);return e instanceof t}function Bd(e){return Mc(e)?!1:e instanceof ys(e).HTMLElement}function UA(e){return e instanceof ys(e).SVGElement}function jc(e){return e?Mc(e)?e.document:Av(e)?Mv(e)?e:Bd(e)||UA(e)?e.ownerDocument:document:document:document}const Hr=um?b.useLayoutEffect:b.useEffect;function jv(e){const t=b.useRef(e);return Hr(()=>{t.current=e}),b.useCallback(function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return t.current==null?void 0:t.current(...s)},[])}function GL(){const e=b.useRef(null),t=b.useCallback((s,r)=>{e.current=setInterval(s,r)},[]),n=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ju(e,t){t===void 0&&(t=[e]);const n=b.useRef(e);return Hr(()=>{n.current!==e&&(n.current=e)},t),n}function Hd(e,t){const n=b.useRef();return b.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function kp(e){const t=jv(e),n=b.useRef(null),s=b.useCallback(r=>{r!==n.current&&(t==null||t(r,n.current)),n.current=r},[]);return[n,s]}function ix(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let Ag={};function $d(e,t){return b.useMemo(()=>{if(t)return t;const n=Ag[e]==null?0:Ag[e]+1;return Ag[e]=n,e+"-"+n},[e,t])}function FA(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return s.reduce((i,a)=>{const l=Object.entries(a);for(const[c,u]of l){const d=i[c];d!=null&&(i[c]=d+e*u)}return i},{...t})}}const Ro=FA(1),wp=FA(-1);function KL(e){return"clientX"in e&&"clientY"in e}function Rv(e){if(!e)return!1;const{KeyboardEvent:t}=ys(e.target);return t&&e instanceof t}function qL(e){if(!e)return!1;const{TouchEvent:t}=ys(e.target);return t&&e instanceof t}function ax(e){if(qL(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return KL(e)?{x:e.clientX,y:e.clientY}:null}const Sp=Object.freeze({Translate:{toString(e){if(!e)return;const{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;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Sp.Translate.toString(e),Sp.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),tS="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function YL(e){return e.matches(tS)?e:e.querySelector(tS)}const VL={display:"none"};function XL(e){let{id:t,value:n}=e;return ss.createElement("div",{id:t,style:VL},n)}function QL(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const r={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"};return ss.createElement("div",{id:t,style:r,role:"status","aria-live":s,"aria-atomic":!0},n)}function WL(){const[e,t]=b.useState("");return{announce:b.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const BA=b.createContext(null);function ZL(e){const t=b.useContext(BA);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function JL(){const[e]=b.useState(()=>new Set),t=b.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[b.useCallback(s=>{let{type:r,event:i}=s;e.forEach(a=>{var l;return(l=a[r])==null?void 0:l.call(a,i)})},[e]),t]}const eP={draggable:`
50
+ To pick up a draggable item, press the space bar.
51
+ While dragging, use the arrow keys to move the item.
52
+ Press space again to drop the item in its new position, or press escape to cancel.
53
+ `},tP={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 nP(e){let{announcements:t=tP,container:n,hiddenTextDescribedById:s,screenReaderInstructions:r=eP}=e;const{announce:i,announcement:a}=WL(),l=$d("DndLiveRegion"),[c,u]=b.useState(!1);if(b.useEffect(()=>{u(!0)},[]),ZL(b.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&i(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;i(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;i(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;i(t.onDragCancel({active:h,over:p}))}}),[i,t])),!c)return null;const d=ss.createElement(ss.Fragment,null,ss.createElement(XL,{id:s,value:r.draggable}),ss.createElement(QL,{id:l,announcement:a}));return n?sn.createPortal(d,n):d}var wn;(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"})(wn||(wn={}));function Np(){}function ed(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Ov(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const pr=Object.freeze({x:0,y:0});function sP(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function rP(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function iP(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function aP(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function nS(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const lP=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const r=nS(t,t.left,t.top),i=[];for(const a of s){const{id:l}=a,c=n.get(l);if(c){const u=sP(nS(c),r);i.push({id:l,data:{droppableContainer:a,value:u}})}}return i.sort(rP)};function oP(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-s,l=i-n;if(s<r&&n<i){const c=t.width*t.height,u=e.width*e.height,d=a*l,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const cP=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const r=[];for(const i of s){const{id:a}=i,l=n.get(a);if(l){const c=oP(l,t);c>0&&r.push({id:a,data:{droppableContainer:i,value:c}})}}return r.sort(iP)};function uP(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function HA(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pr}function dP(e){return function(n){for(var s=arguments.length,r=new Array(s>1?s-1:0),i=1;i<s;i++)r[i-1]=arguments[i];return r.reduce((a,l)=>({...a,top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),{...n})}}const fP=dP(1);function hP(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function pP(e,t,n){const s=hP(t);if(!s)return e;const{scaleX:r,scaleY:i,x:a,y:l}=s,c=e.left-a-(1-r)*parseFloat(n),u=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const mP={ignoreTransform:!1};function Rc(e,t){t===void 0&&(t=mP);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=ys(e).getComputedStyle(e);u&&(n=pP(n,u,d))}const{top:s,left:r,width:i,height:a,bottom:l,right:c}=n;return{top:s,left:r,width:i,height:a,bottom:l,right:c}}function sS(e){return Rc(e,{ignoreTransform:!0})}function gP(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function bP(e,t){return t===void 0&&(t=ys(e).getComputedStyle(e)),t.position==="fixed"}function xP(e,t){t===void 0&&(t=ys(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const i=t[r];return typeof i=="string"?n.test(i):!1})}function Dv(e,t){const n=[];function s(r){if(t!=null&&n.length>=t||!r)return n;if(Mv(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Bd(r)||UA(r)||n.includes(r))return n;const i=ys(e).getComputedStyle(r);return r!==e&&xP(r,i)&&n.push(r),bP(r,i)?n:s(r.parentNode)}return e?s(e):n}function $A(e){const[t]=Dv(e,1);return t??null}function Mg(e){return!um||!e?null:Mc(e)?e:Av(e)?Mv(e)||e===jc(e).scrollingElement?window:Bd(e)?e:null:null}function GA(e){return Mc(e)?e.scrollX:e.scrollLeft}function KA(e){return Mc(e)?e.scrollY:e.scrollTop}function lx(e){return{x:GA(e),y:KA(e)}}var jn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(jn||(jn={}));function qA(e){return!um||!e?!1:e===document.scrollingElement}function YA(e){const t={x:0,y:0},n=qA(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},r=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,a=e.scrollTop>=s.y,l=e.scrollLeft>=s.x;return{isTop:r,isLeft:i,isBottom:a,isRight:l,maxScroll:s,minScroll:t}}const yP={x:.2,y:.2};function vP(e,t,n,s,r){let{top:i,left:a,right:l,bottom:c}=n;s===void 0&&(s=10),r===void 0&&(r=yP);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=YA(e),p={x:0,y:0},m={x:0,y:0},k={height:t.height*r.y,width:t.width*r.x};return!u&&i<=t.top+k.height?(p.y=jn.Backward,m.y=s*Math.abs((t.top+k.height-i)/k.height)):!d&&c>=t.bottom-k.height&&(p.y=jn.Forward,m.y=s*Math.abs((t.bottom-k.height-c)/k.height)),!h&&l>=t.right-k.width?(p.x=jn.Forward,m.x=s*Math.abs((t.right-k.width-l)/k.width)):!f&&a<=t.left+k.width&&(p.x=jn.Backward,m.x=s*Math.abs((t.left+k.width-a)/k.width)),{direction:p,speed:m}}function kP(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:t,left:n,right:s,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:r,width:e.clientWidth,height:e.clientHeight}}function VA(e){return e.reduce((t,n)=>Ro(t,lx(n)),pr)}function wP(e){return e.reduce((t,n)=>t+GA(n),0)}function SP(e){return e.reduce((t,n)=>t+KA(n),0)}function NP(e,t){if(t===void 0&&(t=Rc),!e)return;const{top:n,left:s,bottom:r,right:i}=t(e);$A(e)&&(r<=0||i<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const EP=[["x",["left","right"],wP],["y",["top","bottom"],SP]];class Iv{constructor(t,n){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;const s=Dv(n),r=VA(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,l]of EP)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=l(s),d=r[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Tu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var r;(r=this.target)==null||r.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function _P(e){const{EventTarget:t}=ys(e);return e instanceof t?e:jc(e)}function jg(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var Fs;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Fs||(Fs={}));function rS(e){e.preventDefault()}function CP(e){e.stopPropagation()}var Ct;(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"})(Ct||(Ct={}));const XA={start:[Ct.Space,Ct.Enter],cancel:[Ct.Esc],end:[Ct.Space,Ct.Enter,Ct.Tab]},TP=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ct.Right:return{...n,x:n.x+25};case Ct.Left:return{...n,x:n.x-25};case Ct.Down:return{...n,y:n.y+25};case Ct.Up:return{...n,y:n.y-25}}};class QA{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Tu(jc(n)),this.windowListeners=new Tu(ys(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fs.Resize,this.handleCancel),this.windowListeners.add(Fs.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fs.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&NP(s),n(pr)}handleKeyDown(t){if(Rv(t)){const{active:n,context:s,options:r}=this.props,{keyboardCodes:i=XA,coordinateGetter:a=TP,scrollBehavior:l="smooth"}=r,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=s.current,d=u?{x:u.left,y:u.top}:pr;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(t,{active:n,context:s.current,currentCoordinates:d});if(f){const h=wp(f,d),p={x:0,y:0},{scrollableAncestors:m}=s.current;for(const k of m){const w=t.code,{isTop:g,isRight:y,isLeft:x,isBottom:S,maxScroll:A,minScroll:E}=YA(k),M=kP(k),j={x:Math.min(w===Ct.Right?M.right-M.width/2:M.right,Math.max(w===Ct.Right?M.left:M.left+M.width/2,f.x)),y:Math.min(w===Ct.Down?M.bottom-M.height/2:M.bottom,Math.max(w===Ct.Down?M.top:M.top+M.height/2,f.y))},O=w===Ct.Right&&!y||w===Ct.Left&&!x,N=w===Ct.Down&&!S||w===Ct.Up&&!g;if(O&&j.x!==f.x){const F=k.scrollLeft+h.x,G=w===Ct.Right&&F<=A.x||w===Ct.Left&&F>=E.x;if(G&&!h.y){k.scrollTo({left:F,behavior:l});return}G?p.x=k.scrollLeft-F:p.x=w===Ct.Right?k.scrollLeft-A.x:k.scrollLeft-E.x,p.x&&k.scrollBy({left:-p.x,behavior:l});break}else if(N&&j.y!==f.y){const F=k.scrollTop+h.y,G=w===Ct.Down&&F<=A.y||w===Ct.Up&&F>=E.y;if(G&&!h.x){k.scrollTo({top:F,behavior:l});return}G?p.y=k.scrollTop-F:p.y=w===Ct.Down?k.scrollTop-A.y:k.scrollTop-E.y,p.y&&k.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(t,Ro(wp(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}QA.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=XA,onActivation:r}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(s.start.includes(a)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),r==null||r({event:e.nativeEvent}),!0)}return!1}}];function iS(e){return!!(e&&"distance"in e)}function aS(e){return!!(e&&"delay"in e)}class Lv{constructor(t,n,s){var r;s===void 0&&(s=_P(t.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=t,this.events=n;const{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=jc(a),this.documentListeners=new Tu(this.document),this.listeners=new Tu(s),this.windowListeners=new Tu(ys(a)),this.initialCoordinates=(r=ax(i))!=null?r:pr,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(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:s}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Fs.Resize,this.handleCancel),this.windowListeners.add(Fs.DragStart,rS),this.windowListeners.add(Fs.VisibilityChange,this.handleCancel),this.windowListeners.add(Fs.ContextMenu,rS),this.documentListeners.add(Fs.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(aS(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(iS(n)){this.handlePending(n);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(t,n){const{active:s,onPending:r}=this.props;r(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Fs.Click,CP,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fs.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!r)return;const c=(n=ax(t))!=null?n:pr,u=wp(r,c);if(!s&&l){if(iS(l)){if(l.tolerance!=null&&jg(u,l.tolerance))return this.handleCancel();if(jg(u,l.distance))return this.handleStart()}if(aS(l)&&jg(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ct.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const AP={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Gd extends Lv{constructor(t){const{event:n}=t,s=jc(n.target);super(t,AP,s)}}Gd.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return!n.isPrimary||n.button!==0?!1:(s==null||s({event:n}),!0)}}];const MP={move:{name:"mousemove"},end:{name:"mouseup"}};var ox;(function(e){e[e.RightClick=2]="RightClick"})(ox||(ox={}));class jP extends Lv{constructor(t){super(t,MP,jc(t.event.target))}}jP.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===ox.RightClick?!1:(s==null||s({event:n}),!0)}}];const Rg={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Pv extends Lv{constructor(t){super(t,Rg)}static setup(){return window.addEventListener(Rg.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Rg.move.name,t)};function t(){}}}Pv.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:r}=n;return r.length>1?!1:(s==null||s({event:n}),!0)}}];var Au;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Au||(Au={}));var Ep;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ep||(Ep={}));function RP(e){let{acceleration:t,activator:n=Au.Pointer,canScroll:s,draggingRect:r,enabled:i,interval:a=5,order:l=Ep.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const p=DP({delta:f,disabled:!i}),[m,k]=GL(),w=b.useRef({x:0,y:0}),g=b.useRef({x:0,y:0}),y=b.useMemo(()=>{switch(n){case Au.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Au.DraggableRect:return r}},[n,r,c]),x=b.useRef(null),S=b.useCallback(()=>{const E=x.current;if(!E)return;const M=w.current.x*g.current.x,j=w.current.y*g.current.y;E.scrollBy(M,j)},[]),A=b.useMemo(()=>l===Ep.TreeOrder?[...u].reverse():u,[l,u]);b.useEffect(()=>{if(!i||!u.length||!y){k();return}for(const E of A){if((s==null?void 0:s(E))===!1)continue;const M=u.indexOf(E),j=d[M];if(!j)continue;const{direction:O,speed:N}=vP(E,j,y,t,h);for(const F of["x","y"])p[F][O[F]]||(N[F]=0,O[F]=0);if(N.x>0||N.y>0){k(),x.current=E,m(S,a),w.current=N,g.current=O;return}}w.current={x:0,y:0},g.current={x:0,y:0},k()},[t,S,s,k,i,a,JSON.stringify(y),JSON.stringify(p),m,u,A,d,JSON.stringify(h)])}const OP={x:{[jn.Backward]:!1,[jn.Forward]:!1},y:{[jn.Backward]:!1,[jn.Forward]:!1}};function DP(e){let{delta:t,disabled:n}=e;const s=ix(t);return Hd(r=>{if(n||!s||!r)return OP;const i={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[jn.Backward]:r.x[jn.Backward]||i.x===-1,[jn.Forward]:r.x[jn.Forward]||i.x===1},y:{[jn.Backward]:r.y[jn.Backward]||i.y===-1,[jn.Forward]:r.y[jn.Forward]||i.y===1}}},[n,t,s])}function IP(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return Hd(r=>{var i;return t==null?null:(i=s??r)!=null?i:null},[s,t])}function LP(e,t){return b.useMemo(()=>e.reduce((n,s)=>{const{sensor:r}=s,i=r.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,s)}));return[...n,...i]},[]),[e,t])}var td;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(td||(td={}));var cx;(function(e){e.Optimized="optimized"})(cx||(cx={}));const lS=new Map;function PP(e,t){let{dragging:n,dependencies:s,config:r}=t;const[i,a]=b.useState(null),{frequency:l,measure:c,strategy:u}=r,d=b.useRef(e),f=w(),h=Ju(f),p=b.useCallback(function(g){g===void 0&&(g=[]),!h.current&&a(y=>y===null?g:y.concat(g.filter(x=>!y.includes(x))))},[h]),m=b.useRef(null),k=Hd(g=>{if(f&&!n)return lS;if(!g||g===lS||d.current!==e||i!=null){const y=new Map;for(let x of e){if(!x)continue;if(i&&i.length>0&&!i.includes(x.id)&&x.rect.current){y.set(x.id,x.rect.current);continue}const S=x.node.current,A=S?new Iv(c(S),S):null;x.rect.current=A,A&&y.set(x.id,A)}return y}return g},[e,i,n,f,c]);return b.useEffect(()=>{d.current=e},[e]),b.useEffect(()=>{f||p()},[n,f]),b.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),b.useEffect(()=>{f||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},l))},[l,f,p,...s]),{droppableRects:k,measureDroppableContainers:p,measuringScheduled:i!=null};function w(){switch(u){case td.Always:return!1;case td.BeforeDragging:return n;default:return!n}}}function WA(e,t){return Hd(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function zP(e,t){return WA(e,t)}function UP(e){let{callback:t,disabled:n}=e;const s=jv(t),r=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(s)},[s,n]);return b.useEffect(()=>()=>r==null?void 0:r.disconnect(),[r]),r}function dm(e){let{callback:t,disabled:n}=e;const s=jv(t),r=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(s)},[n]);return b.useEffect(()=>()=>r==null?void 0:r.disconnect(),[r]),r}function FP(e){return new Iv(Rc(e),e)}function oS(e,t,n){t===void 0&&(t=FP);const[s,r]=b.useState(null);function i(){r(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const a=UP({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=dm({callback:i});return Hr(()=>{i(),e?(l==null||l.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[e]),s}function BP(e){const t=WA(e);return HA(e,t)}const cS=[];function HP(e){const t=b.useRef(e),n=Hd(s=>e?s&&s!==cS&&e&&t.current&&e.parentNode===t.current.parentNode?s:Dv(e):cS,[e]);return b.useEffect(()=>{t.current=e},[e]),n}function $P(e){const[t,n]=b.useState(null),s=b.useRef(e),r=b.useCallback(i=>{const a=Mg(i.target);a&&n(l=>l?(l.set(a,lx(a)),new Map(l)):null)},[]);return b.useEffect(()=>{const i=s.current;if(e!==i){a(i);const l=e.map(c=>{const u=Mg(c);return u?(u.addEventListener("scroll",r,{passive:!0}),[u,lx(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),s.current=e}return()=>{a(e),a(i)};function a(l){l.forEach(c=>{const u=Mg(c);u==null||u.removeEventListener("scroll",r)})}},[r,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,a)=>Ro(i,a),pr):VA(e):pr,[e,t])}function uS(e,t){t===void 0&&(t=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},t),b.useEffect(()=>{const s=e!==pr;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?wp(e,n.current):pr}function GP(e){b.useEffect(()=>{if(!um)return;const t=e.map(n=>{let{sensor:s}=n;return s.setup==null?void 0:s.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function KP(e,t){return b.useMemo(()=>e.reduce((n,s)=>{let{eventName:r,handler:i}=s;return n[r]=a=>{i(a,t)},n},{}),[e,t])}function ZA(e){return b.useMemo(()=>e?gP(e):null,[e])}const dS=[];function qP(e,t){t===void 0&&(t=Rc);const[n]=e,s=ZA(n?ys(n):null),[r,i]=b.useState(dS);function a(){i(()=>e.length?e.map(c=>qA(c)?s:new Iv(t(c),c)):dS)}const l=dm({callback:a});return Hr(()=>{l==null||l.disconnect(),a(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),r}function YP(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Bd(t)?t:e}function VP(e){let{measure:t}=e;const[n,s]=b.useState(null),r=b.useCallback(u=>{for(const{target:d}of u)if(Bd(d)){s(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=dm({callback:r}),a=b.useCallback(u=>{const d=YP(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),s(d?t(d):null)},[t,i]),[l,c]=kp(a);return b.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const XP=[{sensor:Gd,options:{}},{sensor:QA,options:{}}],QP={current:{}},Rh={draggable:{measure:sS},droppable:{measure:sS,strategy:td.WhileDragging,frequency:cx.Optimized},dragOverlay:{measure:Rc}};class Mu extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const WP={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Mu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Np},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Rh,measureDroppableContainers:Np,windowRect:null,measuringScheduled:!1},ZP={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Np,draggableNodes:new Map,over:null,measureDroppableContainers:Np},fm=b.createContext(ZP),JA=b.createContext(WP);function JP(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Mu}}}function e6(e,t){switch(t.type){case wn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case wn.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 wn.DragEnd:case wn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case wn.RegisterDroppable:{const{element:n}=t,{id:s}=n,r=new Mu(e.droppable.containers);return r.set(s,n),{...e,droppable:{...e.droppable,containers:r}}}case wn.SetDroppableDisabled:{const{id:n,key:s,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||s!==i.key)return e;const a=new Mu(e.droppable.containers);return a.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case wn.UnregisterDroppable:{const{id:n,key:s}=t,r=e.droppable.containers.get(n);if(!r||s!==r.key)return e;const i=new Mu(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function t6(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:r}=b.useContext(fm),i=ix(s),a=ix(n==null?void 0:n.id);return b.useEffect(()=>{if(!t&&!s&&i&&a!=null){if(!Rv(i)||document.activeElement===i.target)return;const l=r.get(a);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=YL(d);if(f){f.focus();break}}})}},[s,t,r,a,i]),null}function n6(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...s}),n):n}function s6(e){return b.useMemo(()=>({draggable:{...Rh.draggable,...e==null?void 0:e.draggable},droppable:{...Rh.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Rh.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function r6(e){let{activeNode:t,measure:n,initialRect:s,config:r=!0}=e;const i=b.useRef(!1),{x:a,y:l}=typeof r=="boolean"?{x:r,y:r}:r;Hr(()=>{if(!a&&!l||!t){i.current=!1;return}if(i.current||!s)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=HA(d,s);if(a||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=$A(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,a,l,s,n])}const eM=b.createContext({...pr,scaleX:1,scaleY:1});var Zi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Zi||(Zi={}));const zv=b.memo(function(t){var n,s,r,i;let{id:a,accessibility:l,autoScroll:c=!0,children:u,sensors:d=XP,collisionDetection:f=cP,measuring:h,modifiers:p,...m}=t;const k=b.useReducer(e6,void 0,JP),[w,g]=k,[y,x]=JL(),[S,A]=b.useState(Zi.Uninitialized),E=S===Zi.Initialized,{draggable:{active:M,nodes:j,translate:O},droppable:{containers:N}}=w,F=M!=null?j.get(M):null,G=b.useRef({initial:null,translated:null}),H=b.useMemo(()=>{var Me;return M!=null?{id:M,data:(Me=F==null?void 0:F.data)!=null?Me:QP,rect:G}:null},[M,F]),I=b.useRef(null),[L,C]=b.useState(null),[D,U]=b.useState(null),B=Ju(m,Object.values(m)),R=$d("DndDescribedBy",a),_=b.useMemo(()=>N.getEnabled(),[N]),K=s6(h),{droppableRects:T,measureDroppableContainers:X,measuringScheduled:ne}=PP(_,{dragging:E,dependencies:[O.x,O.y],config:K.droppable}),J=IP(j,M),pe=b.useMemo(()=>D?ax(D):null,[D]),q=Oe(),Y=zP(J,K.draggable.measure);r6({activeNode:M!=null?j.get(M):null,config:q.layoutShiftCompensation,initialRect:Y,measure:K.draggable.measure});const V=oS(J,K.draggable.measure,Y),ee=oS(J?J.parentElement:null),oe=b.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:T,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=N.getNodeFor((n=oe.current.over)==null?void 0:n.id),Re=VP({measure:K.dragOverlay.measure}),se=(s=Re.nodeRef.current)!=null?s:J,Q=E?(r=Re.rect)!=null?r:V:null,Te=!!(Re.nodeRef.current&&Re.rect),xe=BP(Te?null:V),ve=ZA(se?ys(se):null),ge=HP(E?ye??J:null),$e=qP(ge),dt=n6(p,{transform:{x:O.x-xe.x,y:O.y-xe.y,scaleX:1,scaleY:1},activatorEvent:D,active:H,activeNodeRect:V,containerNodeRect:ee,draggingNodeRect:Q,over:oe.current.over,overlayNodeRect:Re.rect,scrollableAncestors:ge,scrollableAncestorRects:$e,windowRect:ve}),mt=pe?Ro(pe,O):null,rt=$P(ge),ct=uS(rt),te=uS(rt,[V]),re=Ro(dt,ct),Ae=Q?fP(Q,dt):null,v=H&&Ae?f({active:H,collisionRect:Ae,droppableRects:T,droppableContainers:_,pointerCoordinates:mt}):null,Z=aP(v,"id"),[fe,be]=b.useState(null),he=Te?dt:Ro(dt,te),P=uP(he,(i=fe==null?void 0:fe.rect)!=null?i:null,V),ce=b.useRef(null),ue=b.useCallback((Me,Fe)=>{let{sensor:De,options:He}=Fe;if(I.current==null)return;const Ge=j.get(I.current);if(!Ge)return;const ft=Me.nativeEvent,St=new De({active:I.current,activeNode:Ge,event:ft,options:He,context:oe,onAbort(_t){if(!j.get(_t))return;const{onDragAbort:Rt}=B.current,Wt={id:_t};Rt==null||Rt(Wt),y({type:"onDragAbort",event:Wt})},onPending(_t,jt,Rt,Wt){if(!j.get(_t))return;const{onDragPending:Pe}=B.current,Ie={id:_t,constraint:jt,initialCoordinates:Rt,offset:Wt};Pe==null||Pe(Ie),y({type:"onDragPending",event:Ie})},onStart(_t){const jt=I.current;if(jt==null)return;const Rt=j.get(jt);if(!Rt)return;const{onDragStart:Wt}=B.current,ie={activatorEvent:ft,active:{id:jt,data:Rt.data,rect:G}};sn.unstable_batchedUpdates(()=>{Wt==null||Wt(ie),A(Zi.Initializing),g({type:wn.DragStart,initialCoordinates:_t,active:jt}),y({type:"onDragStart",event:ie}),C(ce.current),U(ft)})},onMove(_t){g({type:wn.DragMove,coordinates:_t})},onEnd:Nt(wn.DragEnd),onCancel:Nt(wn.DragCancel)});ce.current=St;function Nt(_t){return async function(){const{active:Rt,collisions:Wt,over:ie,scrollAdjustedTranslate:Pe}=oe.current;let Ie=null;if(Rt&&Pe){const{cancelDrop:Je}=B.current;Ie={activatorEvent:ft,active:Rt,collisions:Wt,delta:Pe,over:ie},_t===wn.DragEnd&&typeof Je=="function"&&await Promise.resolve(Je(Ie))&&(_t=wn.DragCancel)}I.current=null,sn.unstable_batchedUpdates(()=>{g({type:_t}),A(Zi.Uninitialized),be(null),C(null),U(null),ce.current=null;const Je=_t===wn.DragEnd?"onDragEnd":"onDragCancel";if(Ie){const Ze=B.current[Je];Ze==null||Ze(Ie),y({type:Je,event:Ie})}})}}},[j]),_e=b.useCallback((Me,Fe)=>(De,He)=>{const Ge=De.nativeEvent,ft=j.get(He);if(I.current!==null||!ft||Ge.dndKit||Ge.defaultPrevented)return;const St={active:ft};Me(De,Fe.options,St)===!0&&(Ge.dndKit={capturedBy:Fe.sensor},I.current=He,ue(De,Fe))},[j,ue]),ke=LP(d,_e);GP(d),Hr(()=>{V&&S===Zi.Initializing&&A(Zi.Initialized)},[V,S]),b.useEffect(()=>{const{onDragMove:Me}=B.current,{active:Fe,activatorEvent:De,collisions:He,over:Ge}=oe.current;if(!Fe||!De)return;const ft={active:Fe,activatorEvent:De,collisions:He,delta:{x:re.x,y:re.y},over:Ge};sn.unstable_batchedUpdates(()=>{Me==null||Me(ft),y({type:"onDragMove",event:ft})})},[re.x,re.y]),b.useEffect(()=>{const{active:Me,activatorEvent:Fe,collisions:De,droppableContainers:He,scrollAdjustedTranslate:Ge}=oe.current;if(!Me||I.current==null||!Fe||!Ge)return;const{onDragOver:ft}=B.current,St=He.get(Z),Nt=St&&St.rect.current?{id:St.id,rect:St.rect.current,data:St.data,disabled:St.disabled}:null,_t={active:Me,activatorEvent:Fe,collisions:De,delta:{x:Ge.x,y:Ge.y},over:Nt};sn.unstable_batchedUpdates(()=>{be(Nt),ft==null||ft(_t),y({type:"onDragOver",event:_t})})},[Z]),Hr(()=>{oe.current={activatorEvent:D,active:H,activeNode:J,collisionRect:Ae,collisions:v,droppableRects:T,draggableNodes:j,draggingNode:se,draggingNodeRect:Q,droppableContainers:N,over:fe,scrollableAncestors:ge,scrollAdjustedTranslate:re},G.current={initial:Q,translated:Ae}},[H,J,v,Ae,j,se,Q,T,N,fe,ge,re]),RP({...q,delta:O,draggingRect:Ae,pointerCoordinates:mt,scrollableAncestors:ge,scrollableAncestorRects:$e});const we=b.useMemo(()=>({active:H,activeNode:J,activeNodeRect:V,activatorEvent:D,collisions:v,containerNodeRect:ee,dragOverlay:Re,draggableNodes:j,droppableContainers:N,droppableRects:T,over:fe,measureDroppableContainers:X,scrollableAncestors:ge,scrollableAncestorRects:$e,measuringConfiguration:K,measuringScheduled:ne,windowRect:ve}),[H,J,V,D,v,ee,Re,j,N,T,fe,X,ge,$e,K,ne,ve]),Ne=b.useMemo(()=>({activatorEvent:D,activators:ke,active:H,activeNodeRect:V,ariaDescribedById:{draggable:R},dispatch:g,draggableNodes:j,over:fe,measureDroppableContainers:X}),[D,ke,H,V,g,R,j,fe,X]);return ss.createElement(BA.Provider,{value:x},ss.createElement(fm.Provider,{value:Ne},ss.createElement(JA.Provider,{value:we},ss.createElement(eM.Provider,{value:P},u)),ss.createElement(t6,{disabled:(l==null?void 0:l.restoreFocus)===!1})),ss.createElement(nP,{...l,hiddenTextDescribedById:R}));function Oe(){const Me=(L==null?void 0:L.autoScrollEnabled)===!1,Fe=typeof c=="object"?c.enabled===!1:c===!1,De=E&&!Me&&!Fe;return typeof c=="object"?{...c,enabled:De}:{enabled:De}}}),i6=b.createContext(null),fS="button",a6="Draggable";function hm(e){let{id:t,data:n,disabled:s=!1,attributes:r}=e;const i=$d(a6),{activators:a,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=b.useContext(fm),{role:p=fS,roleDescription:m="draggable",tabIndex:k=0}=r??{},w=(c==null?void 0:c.id)===t,g=b.useContext(w?eM:i6),[y,x]=kp(),[S,A]=kp(),E=KP(a,t),M=Ju(n);Hr(()=>(f.set(t,{id:t,key:i,node:y,activatorNode:S,data:M}),()=>{const O=f.get(t);O&&O.key===i&&f.delete(t)}),[f,t]);const j=b.useMemo(()=>({role:p,tabIndex:k,"aria-disabled":s,"aria-pressed":w&&p===fS?!0:void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[s,p,k,w,m,d.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:j,isDragging:w,listeners:s?void 0:E,node:y,over:h,setNodeRef:x,setActivatorNodeRef:A,transform:g}}function l6(){return b.useContext(JA)}const o6="Droppable",c6={timeout:25};function Uv(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:r}=e;const i=$d(o6),{active:a,dispatch:l,over:c,measureDroppableContainers:u}=b.useContext(fm),d=b.useRef({disabled:n}),f=b.useRef(!1),h=b.useRef(null),p=b.useRef(null),{disabled:m,updateMeasurementsFor:k,timeout:w}={...c6,...r},g=Ju(k??s),y=b.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),p.current=null},w)},[w]),x=dm({callback:y,disabled:m||!a}),S=b.useCallback((j,O)=>{x&&(O&&(x.unobserve(O),f.current=!1),j&&x.observe(j))},[x]),[A,E]=kp(S),M=Ju(t);return b.useEffect(()=>{!x||!A.current||(x.disconnect(),f.current=!1,x.observe(A.current))},[A,x]),b.useEffect(()=>(l({type:wn.RegisterDroppable,element:{id:s,key:i,disabled:n,node:A,rect:h,data:M}}),()=>l({type:wn.UnregisterDroppable,key:i,id:s})),[s]),b.useEffect(()=>{n!==d.current.disabled&&(l({type:wn.SetDroppableDisabled,id:s,key:i,disabled:n}),d.current.disabled=n)},[s,i,n,l]),{active:a,rect:h,isOver:(c==null?void 0:c.id)===s,node:A,over:c,setNodeRef:E}}/**
54
+ * @license lucide-react v0.460.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ */const u6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tM=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
59
+ * @license lucide-react v0.460.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */var d6={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"};/**
64
+ * @license lucide-react v0.460.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */const f6=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:r="",children:i,iconNode:a,...l},c)=>b.createElement("svg",{ref:c,...d6,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:tM("lucide",r),...l},[...a.map(([u,d])=>b.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
69
+ * @license lucide-react v0.460.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */const Be=(e,t)=>{const n=b.forwardRef(({className:s,...r},i)=>b.createElement(f6,{ref:i,iconNode:t,className:tM(`lucide-${u6(e)}`,s),...r}));return n.displayName=`${e}`,n};/**
74
+ * @license lucide-react v0.460.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */const nM=Be("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"}]]);/**
79
+ * @license lucide-react v0.460.0 - ISC
80
+ *
81
+ * This source code is licensed under the ISC license.
82
+ * See the LICENSE file in the root directory of this source tree.
83
+ */const h6=Be("ArchiveRestore",[["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"}]]);/**
84
+ * @license lucide-react v0.460.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */const Of=Be("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"}]]);/**
89
+ * @license lucide-react v0.460.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */const p6=Be("Asterisk",[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]]);/**
94
+ * @license lucide-react v0.460.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */const sM=Be("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
99
+ * @license lucide-react v0.460.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */const m6=Be("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/**
104
+ * @license lucide-react v0.460.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */const rM=Be("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
109
+ * @license lucide-react v0.460.0 - ISC
110
+ *
111
+ * This source code is licensed under the ISC license.
112
+ * See the LICENSE file in the root directory of this source tree.
113
+ */const ux=Be("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"}]]);/**
114
+ * @license lucide-react v0.460.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */const iM=Be("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
119
+ * @license lucide-react v0.460.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */const mr=Be("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
124
+ * @license lucide-react v0.460.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */const _n=Be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
129
+ * @license lucide-react v0.460.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */const Yn=Be("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
134
+ * @license lucide-react v0.460.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const Kd=Be("ChevronsDownUp",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);/**
139
+ * @license lucide-react v0.460.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const qd=Be("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
144
+ * @license lucide-react v0.460.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const g6=Be("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
149
+ * @license lucide-react v0.460.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */const aM=Be("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["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"}]]);/**
154
+ * @license lucide-react v0.460.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const b6=Be("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
159
+ * @license lucide-react v0.460.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const x6=Be("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
164
+ * @license lucide-react v0.460.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */const y6=Be("CodeXml",[["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"}]]);/**
169
+ * @license lucide-react v0.460.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */const Ta=Be("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"}]]);/**
174
+ * @license lucide-react v0.460.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */const v6=Be("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
179
+ * @license lucide-react v0.460.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */const k6=Be("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"}]]);/**
184
+ * @license lucide-react v0.460.0 - ISC
185
+ *
186
+ * This source code is licensed under the ISC license.
187
+ * See the LICENSE file in the root directory of this source tree.
188
+ */const pm=Be("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
189
+ * @license lucide-react v0.460.0 - ISC
190
+ *
191
+ * This source code is licensed under the ISC license.
192
+ * See the LICENSE file in the root directory of this source tree.
193
+ */const w6=Be("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
194
+ * @license lucide-react v0.460.0 - ISC
195
+ *
196
+ * This source code is licensed under the ISC license.
197
+ * See the LICENSE file in the root directory of this source tree.
198
+ */const S6=Be("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
199
+ * @license lucide-react v0.460.0 - ISC
200
+ *
201
+ * This source code is licensed under the ISC license.
202
+ * See the LICENSE file in the root directory of this source tree.
203
+ */const Oa=Be("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
204
+ * @license lucide-react v0.460.0 - ISC
205
+ *
206
+ * This source code is licensed under the ISC license.
207
+ * See the LICENSE file in the root directory of this source tree.
208
+ */const N6=Be("FileSymlink",[["path",{d:"m10 18 3-3-3-3",key:"18f6ys"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 11V4a2 2 0 0 1 2-2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7",key:"50q2rw"}]]);/**
209
+ * @license lucide-react v0.460.0 - ISC
210
+ *
211
+ * This source code is licensed under the ISC license.
212
+ * See the LICENSE file in the root directory of this source tree.
213
+ */const Yd=Be("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
214
+ * @license lucide-react v0.460.0 - ISC
215
+ *
216
+ * This source code is licensed under the ISC license.
217
+ * See the LICENSE file in the root directory of this source tree.
218
+ */const E6=Be("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
219
+ * @license lucide-react v0.460.0 - ISC
220
+ *
221
+ * This source code is licensed under the ISC license.
222
+ * See the LICENSE file in the root directory of this source tree.
223
+ */const lM=Be("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 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.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
224
+ * @license lucide-react v0.460.0 - ISC
225
+ *
226
+ * This source code is licensed under the ISC license.
227
+ * See the LICENSE file in the root directory of this source tree.
228
+ */const oM=Be("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
229
+ * @license lucide-react v0.460.0 - ISC
230
+ *
231
+ * This source code is licensed under the ISC license.
232
+ * See the LICENSE file in the root directory of this source tree.
233
+ */const cr=Be("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"}]]);/**
234
+ * @license lucide-react v0.460.0 - ISC
235
+ *
236
+ * This source code is licensed under the ISC license.
237
+ * See the LICENSE file in the root directory of this source tree.
238
+ */const dx=Be("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
239
+ * @license lucide-react v0.460.0 - ISC
240
+ *
241
+ * This source code is licensed under the ISC license.
242
+ * See the LICENSE file in the root directory of this source tree.
243
+ */const _6=Be("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
244
+ * @license lucide-react v0.460.0 - ISC
245
+ *
246
+ * This source code is licensed under the ISC license.
247
+ * See the LICENSE file in the root directory of this source tree.
248
+ */const xl=Be("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"}]]);/**
249
+ * @license lucide-react v0.460.0 - ISC
250
+ *
251
+ * This source code is licensed under the ISC license.
252
+ * See the LICENSE file in the root directory of this source tree.
253
+ */const C6=Be("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
254
+ * @license lucide-react v0.460.0 - ISC
255
+ *
256
+ * This source code is licensed under the ISC license.
257
+ * See the LICENSE file in the root directory of this source tree.
258
+ */const cM=Be("GripVertical",[["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"}]]);/**
259
+ * @license lucide-react v0.460.0 - ISC
260
+ *
261
+ * This source code is licensed under the ISC license.
262
+ * See the LICENSE file in the root directory of this source tree.
263
+ */const T6=Be("Grip",[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["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"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]]);/**
264
+ * @license lucide-react v0.460.0 - ISC
265
+ *
266
+ * This source code is licensed under the ISC license.
267
+ * See the LICENSE file in the root directory of this source tree.
268
+ */const A6=Be("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"}]]);/**
269
+ * @license lucide-react v0.460.0 - ISC
270
+ *
271
+ * This source code is licensed under the ISC license.
272
+ * See the LICENSE file in the root directory of this source tree.
273
+ */const fx=Be("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
274
+ * @license lucide-react v0.460.0 - ISC
275
+ *
276
+ * This source code is licensed under the ISC license.
277
+ * See the LICENSE file in the root directory of this source tree.
278
+ */const M6=Be("Hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]]);/**
279
+ * @license lucide-react v0.460.0 - ISC
280
+ *
281
+ * This source code is licensed under the ISC license.
282
+ * See the LICENSE file in the root directory of this source tree.
283
+ */const j6=Be("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
284
+ * @license lucide-react v0.460.0 - ISC
285
+ *
286
+ * This source code is licensed under the ISC license.
287
+ * See the LICENSE file in the root directory of this source tree.
288
+ */const au=Be("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
289
+ * @license lucide-react v0.460.0 - ISC
290
+ *
291
+ * This source code is licensed under the ISC license.
292
+ * See the LICENSE file in the root directory of this source tree.
293
+ */const R6=Be("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
294
+ * @license lucide-react v0.460.0 - ISC
295
+ *
296
+ * This source code is licensed under the ISC license.
297
+ * See the LICENSE file in the root directory of this source tree.
298
+ */const O6=Be("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
299
+ * @license lucide-react v0.460.0 - ISC
300
+ *
301
+ * This source code is licensed under the ISC license.
302
+ * See the LICENSE file in the root directory of this source tree.
303
+ */const uM=Be("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
304
+ * @license lucide-react v0.460.0 - ISC
305
+ *
306
+ * This source code is licensed under the ISC license.
307
+ * See the LICENSE file in the root directory of this source tree.
308
+ */const D6=Be("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
309
+ * @license lucide-react v0.460.0 - ISC
310
+ *
311
+ * This source code is licensed under the ISC license.
312
+ * See the LICENSE file in the root directory of this source tree.
313
+ */const gn=Be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
314
+ * @license lucide-react v0.460.0 - ISC
315
+ *
316
+ * This source code is licensed under the ISC license.
317
+ * See the LICENSE file in the root directory of this source tree.
318
+ */const I6=Be("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
319
+ * @license lucide-react v0.460.0 - ISC
320
+ *
321
+ * This source code is licensed under the ISC license.
322
+ * See the LICENSE file in the root directory of this source tree.
323
+ */const dM=Be("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["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"}]]);/**
324
+ * @license lucide-react v0.460.0 - ISC
325
+ *
326
+ * This source code is licensed under the ISC license.
327
+ * See the LICENSE file in the root directory of this source tree.
328
+ */const fM=Be("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
329
+ * @license lucide-react v0.460.0 - ISC
330
+ *
331
+ * This source code is licensed under the ISC license.
332
+ * See the LICENSE file in the root directory of this source tree.
333
+ */const hM=Be("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
334
+ * @license lucide-react v0.460.0 - ISC
335
+ *
336
+ * This source code is licensed under the ISC license.
337
+ * See the LICENSE file in the root directory of this source tree.
338
+ */const L6=Be("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
339
+ * @license lucide-react v0.460.0 - ISC
340
+ *
341
+ * This source code is licensed under the ISC license.
342
+ * See the LICENSE file in the root directory of this source tree.
343
+ */const P6=Be("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
344
+ * @license lucide-react v0.460.0 - ISC
345
+ *
346
+ * This source code is licensed under the ISC license.
347
+ * See the LICENSE file in the root directory of this source tree.
348
+ */const hx=Be("PackageX",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["path",{d:"m17 13 5 5m-5 0 5-5",key:"im3w4b"}]]);/**
349
+ * @license lucide-react v0.460.0 - ISC
350
+ *
351
+ * This source code is licensed under the ISC license.
352
+ * See the LICENSE file in the root directory of this source tree.
353
+ */const nd=Be("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
354
+ * @license lucide-react v0.460.0 - ISC
355
+ *
356
+ * This source code is licensed under the ISC license.
357
+ * See the LICENSE file in the root directory of this source tree.
358
+ */const z6=Be("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
359
+ * @license lucide-react v0.460.0 - ISC
360
+ *
361
+ * This source code is licensed under the ISC license.
362
+ * See the LICENSE file in the root directory of this source tree.
363
+ */const Fv=Be("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"}]]);/**
364
+ * @license lucide-react v0.460.0 - ISC
365
+ *
366
+ * This source code is licensed under the ISC license.
367
+ * See the LICENSE file in the root directory of this source tree.
368
+ */const Vd=Be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
369
+ * @license lucide-react v0.460.0 - ISC
370
+ *
371
+ * This source code is licensed under the ISC license.
372
+ * See the LICENSE file in the root directory of this source tree.
373
+ */const Yl=Be("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
374
+ * @license lucide-react v0.460.0 - ISC
375
+ *
376
+ * This source code is licensed under the ISC license.
377
+ * See the LICENSE file in the root directory of this source tree.
378
+ */const px=Be("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
379
+ * @license lucide-react v0.460.0 - ISC
380
+ *
381
+ * This source code is licensed under the ISC license.
382
+ * See the LICENSE file in the root directory of this source tree.
383
+ */const uc=Be("RefreshCw",[["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"}]]);/**
384
+ * @license lucide-react v0.460.0 - ISC
385
+ *
386
+ * This source code is licensed under the ISC license.
387
+ * See the LICENSE file in the root directory of this source tree.
388
+ */const Og=Be("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
389
+ * @license lucide-react v0.460.0 - ISC
390
+ *
391
+ * This source code is licensed under the ISC license.
392
+ * See the LICENSE file in the root directory of this source tree.
393
+ */const hS=Be("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
394
+ * @license lucide-react v0.460.0 - ISC
395
+ *
396
+ * This source code is licensed under the ISC license.
397
+ * See the LICENSE file in the root directory of this source tree.
398
+ */const pM=Be("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
399
+ * @license lucide-react v0.460.0 - ISC
400
+ *
401
+ * This source code is licensed under the ISC license.
402
+ * See the LICENSE file in the root directory of this source tree.
403
+ */const U6=Be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
404
+ * @license lucide-react v0.460.0 - ISC
405
+ *
406
+ * This source code is licensed under the ISC license.
407
+ * See the LICENSE file in the root directory of this source tree.
408
+ */const mM=Be("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
409
+ * @license lucide-react v0.460.0 - ISC
410
+ *
411
+ * This source code is licensed under the ISC license.
412
+ * See the LICENSE file in the root directory of this source tree.
413
+ */const mm=Be("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
414
+ * @license lucide-react v0.460.0 - ISC
415
+ *
416
+ * This source code is licensed under the ISC license.
417
+ * See the LICENSE file in the root directory of this source tree.
418
+ */const gM=Be("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
419
+ * @license lucide-react v0.460.0 - ISC
420
+ *
421
+ * This source code is licensed under the ISC license.
422
+ * See the LICENSE file in the root directory of this source tree.
423
+ */const bM=Be("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
424
+ * @license lucide-react v0.460.0 - ISC
425
+ *
426
+ * This source code is licensed under the ISC license.
427
+ * See the LICENSE file in the root directory of this source tree.
428
+ */const pS=Be("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
429
+ * @license lucide-react v0.460.0 - ISC
430
+ *
431
+ * This source code is licensed under the ISC license.
432
+ * See the LICENSE file in the root directory of this source tree.
433
+ */const xM=Be("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
434
+ * @license lucide-react v0.460.0 - ISC
435
+ *
436
+ * This source code is licensed under the ISC license.
437
+ * See the LICENSE file in the root directory of this source tree.
438
+ */const F6=Be("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
439
+ * @license lucide-react v0.460.0 - ISC
440
+ *
441
+ * This source code is licensed under the ISC license.
442
+ * See the LICENSE file in the root directory of this source tree.
443
+ */const Bv=Be("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
444
+ * @license lucide-react v0.460.0 - ISC
445
+ *
446
+ * This source code is licensed under the ISC license.
447
+ * See the LICENSE file in the root directory of this source tree.
448
+ */const er=Be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
449
+ * @license lucide-react v0.460.0 - ISC
450
+ *
451
+ * This source code is licensed under the ISC license.
452
+ * See the LICENSE file in the root directory of this source tree.
453
+ */const yl=Be("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
454
+ * @license lucide-react v0.460.0 - ISC
455
+ *
456
+ * This source code is licensed under the ISC license.
457
+ * See the LICENSE file in the root directory of this source tree.
458
+ */const mx=Be("Waypoints",[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]]);/**
459
+ * @license lucide-react v0.460.0 - ISC
460
+ *
461
+ * This source code is licensed under the ISC license.
462
+ * See the LICENSE file in the root directory of this source tree.
463
+ */const B6=Be("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
464
+ * @license lucide-react v0.460.0 - ISC
465
+ *
466
+ * This source code is licensed under the ISC license.
467
+ * See the LICENSE file in the root directory of this source tree.
468
+ */const yM=Be("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"}]]);/**
469
+ * @license lucide-react v0.460.0 - ISC
470
+ *
471
+ * This source code is licensed under the ISC license.
472
+ * See the LICENSE file in the root directory of this source tree.
473
+ */const H6=Be("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
474
+ * @license lucide-react v0.460.0 - ISC
475
+ *
476
+ * This source code is licensed under the ISC license.
477
+ * See the LICENSE file in the root directory of this source tree.
478
+ */const Vt=Be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
479
+ * @license lucide-react v0.460.0 - ISC
480
+ *
481
+ * This source code is licensed under the ISC license.
482
+ * See the LICENSE file in the root directory of this source tree.
483
+ */const gm=Be("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"}]]),dc={claude:{label:"Claude",tooltip:"Claude Code",badge:"border-orange-800/50 bg-orange-900/40 text-orange-300",source:"bg-orange-900/40 text-orange-300",icon:p6,iconRunning:"text-orange-400",iconIdle:"text-orange-400/45",runAnimation:"harness-run-claude",dotDir:".claude"},codex:{label:"Codex",tooltip:"Codex",badge:"border-cyan-800/50 bg-cyan-900/40 text-cyan-300",source:"bg-cyan-900/40 text-cyan-300",icon:M6,iconRunning:"text-cyan-400",iconIdle:"text-cyan-400/45",runAnimation:"harness-run-codex",dotDir:".codex"}},Dg={label:"",tooltip:"",badge:"border-neutral-700/50 bg-neutral-800/40 text-neutral-300",source:"bg-neutral-800 text-neutral-400",icon:gn,iconRunning:"text-neutral-300",iconIdle:"text-neutral-500",runAnimation:"",dotDir:""},en=Object.keys(dc);function Kn(e){return e&&e in dc?dc[e]:{...Dg,label:e??Dg.label,tooltip:e??Dg.tooltip}}class vM extends Error{constructor(t,n){super(t),this.status=n,this.name="AuthError"}}const Hv="/api";let gx="unknown";const bx=new Set;function sd(e){if(gx!==e){gx=e;for(const t of bx)t()}}function $v(){return gx}function kM(e){return bx.add(e),()=>bx.delete(e)}function wM(){return b.useSyncExternalStore(kM,$v)}async function $6(e){const t=await e.text();try{const n=JSON.parse(t);if(typeof n.error=="string"&&n.error)return n.error}catch{}return t||String(e.status)}async function SM(){try{const e=await fetch(`${Hv}/auth/status`);if(!e.ok){sd("anonymous");return}const t=await e.json();sd(t.authenticated===!0?"authenticated":"anonymous")}catch{}}async function G6(e){const t=await fetch(`${Hv}/auth/login`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({password:e})});if(!t.ok)throw new vM(await $6(t),t.status);sd("authenticated")}async function K6(){try{await fetch(`${Hv}/auth/logout`,{method:"POST"})}catch{}sd("anonymous")}function q6(){sd("anonymous")}function Y6(){SM()}const Fr="/api",Ka=Fr;async function Ue(e,t){const n=await fetch(`${Fr}${e}`,{...t,headers:{"content-type":"application/json",...t==null?void 0:t.headers}});if(n.status===401)throw q6(),new Error(await mS(n));if(!n.ok)throw new Error(await mS(n));return await n.json()}async function mS(e){const t=await e.text();try{const n=JSON.parse(t);if(typeof n.error=="string"&&n.error)return n.error;if(typeof n.message=="string"&&n.message)return n.message}catch{}return t?`${e.status} ${t}`:String(e.status)}function rd(e){return e.kind==="claude-event"?{kind:"hook-event",harness:"claude",event:e.event}:e}function V6(e){return e.kind==="claude-event"?"claude":e.kind==="hook-event"?e.harness:null}const NM=["PreToolUse","PostToolUse","UserPromptSubmit","SessionStart","Stop","SubagentStop","Notification","PreCompact","SessionEnd","PreModelSwitch","PostModelSwitch"],Ig=["PostToolUse","UserPromptSubmit","SessionStart","Stop","SubagentStop"],EM=["command","agent","workflow","rule","output-style"];function Xd(e){return en.find(t=>e.startsWith(t))??null}const _M=["gray","red","green","yellow","blue","magenta","cyan"],gS="0.1.0",X6={project:["name","path"],git:["branch","repo","ahead","behind","sync"],git_user:["user","email"],changes:["added","deleted","files"],model:["model"],thinking:["level"],context:["bar","used","total","percent","remaining"],tokens:["total","percent"],cost:["cost","duration","api_duration","lines_added","lines_removed"],rate:["percent","limit","resets"],time:["time"],version:["version"],output_style:["style"],session:["name"],exceeds200k:["over"],fast_mode:["mode"],vim:["mode"],pr:["number","state","url"],worktree:["name","branch"],agent:["name"]},CM={project:"{name}",git:"{branch} {sync}",git_user:"{user} <{email}>",changes:"{files}",model:"{model}",thinking:"{level}",context:"{percent}% {bar}",tokens:"{total}",cost:"{cost}",rate:"{limit} {percent}%",time:"{time}",version:"{version}",output_style:"{style}",session:"{name}",exceeds200k:"{over}",fast_mode:"{mode}",vim:"{mode}",pr:"#{number}",worktree:"{name}",agent:"{name}"},Q6={percent:"{percent}%",bar:"{bar}",both:"{percent}% {bar}"},Ce={listProjects:()=>Ue("/projects").then(e=>e.projects),listArchivedProjects:()=>Ue("/projects/archived").then(e=>e.projects),archiveProject:e=>Ue(`/projects/${e}/archive`,{method:"POST"}),restoreProject:e=>Ue(`/projects/${e}/restore`,{method:"POST"}),reorderProjects:e=>Ue("/projects/order",{method:"PUT",body:JSON.stringify({ids:e})}).then(t=>t.projects),listAssets:e=>Ue(`/assets?path=${encodeURIComponent(e)}`).then(t=>t.assets),listGlobalFileAssets:()=>Ue("/global-file-assets").then(e=>e.assets),listSessionHooks:(e,t,n=300,s,r)=>Ue(`/projects/${e}/hooks?sessionId=${encodeURIComponent(t)}&limit=${n}${s===void 0?"":`&beforeId=${s}`}${r!=null&&r.length?`&types=${encodeURIComponent(r.join(","))}`:""}`).then(i=>i.events),listHooksRules:e=>Ue(`/hooks/rules${e===void 0?"":`?projectId=${e}`}`).then(t=>t.rules),createHookRule:e=>Ue("/hooks/rules",{method:"POST",body:JSON.stringify(e)}).then(t=>t.rule),updateHookRule:(e,t)=>Ue(`/hooks/rules/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}).then(n=>n.rule),deleteHookRule:e=>Ue(`/hooks/rules/${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),listHookPlugins:e=>Ue(`/hooks/plugins${e===void 0?"":`?projectId=${e}`}`).then(t=>t.plugins),toggleHookPlugin:(e,t,n)=>Ue(`/hooks/plugins/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify(n===void 0?{enabled:t}:{enabled:t,projectId:n})}).then(()=>{}),installHookPlugin:e=>Ue("/hooks/plugins",{method:"POST",body:JSON.stringify({src:e})}),uninstallHookPlugin:e=>Ue(`/hooks/plugins/${encodeURIComponent(e)}/uninstall`,{method:"POST"}).then(()=>{}),rescanHookPlugins:()=>Ue("/hooks/plugins/rescan",{method:"POST"}).then(e=>e.plugins),listToolkit:e=>Ue(`/projects/${e}/toolkit`),toggleToolkit:(e,t,n,s)=>Ue(`/projects/${e}/toolkit/${encodeURIComponent(t)}/${n?"enable":"disable"}${s?`?source=${encodeURIComponent(s)}`:""}`,{method:"POST"}),cleanupToolkitLegacyCopies:e=>Ue(`/projects/${e}/toolkit/legacy-copies/cleanup`,{method:"POST"}),uninstallToolkit:(e,t,n)=>Ue(`/projects/${e}/toolkit/${encodeURIComponent(t)}/uninstall${n?`?source=${encodeURIComponent(n)}`:""}`,{method:"POST"}),listHookDispatches:e=>{const t=new URLSearchParams;e!=null&&e.ruleId&&t.set("ruleId",e.ruleId),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.sessionId&&t.set("sessionId",e.sessionId),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit));const n=t.toString();return Ue(`/hooks/dispatches${n?`?${n}`:""}`).then(s=>s.dispatches)},runHookDispatch:(e,t)=>Ue(`/hooks/dispatches/${e}/run`,{method:"POST",body:JSON.stringify({sessionId:t})}),listSessions:e=>Ue(`/sessions${e===void 0?"":`?projectId=${e}`}`),renameSession:(e,t)=>Ue(`/sessions/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({title:t})}).then(n=>n.session),openSessionTerminal:(e,t)=>Ue(`/sessions/${encodeURIComponent(e)}/open-terminal`,{method:"POST",body:JSON.stringify(t?{target:t}:{})}),closeSessionPane:e=>Ue(`/sessions/${encodeURIComponent(e)}/close-pane`,{method:"POST"}),closeProjectTerminal:(e,t)=>Ue(`/projects/${e}/close-terminal`,{method:"POST",body:JSON.stringify({paneIds:t})}),listProjectPanes:e=>Ue(`/projects/${e}/panes`).then(t=>t.panes),startProjectSession:(e,t)=>Ue(`/projects/${e}/new-session`,{method:"POST",body:JSON.stringify(t?{harness:t}:{})}),listProjectTerminals:e=>Ue(`/projects/${e}/terminals`).then(t=>t.terminals),deleteSession:e=>Ue(`/sessions/${encodeURIComponent(e)}`,{method:"DELETE"}),listSessionMessages:e=>Ue(`/sessions/${encodeURIComponent(e)}/messages`).then(t=>t.messages),sessionPlan:e=>Ue(`/sessions/${encodeURIComponent(e)}/plan`).then(t=>t.plan),sendSessionMessage:(e,t)=>Ue(`/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:JSON.stringify(t)}),uploadImage:e=>Ue("/uploads",{method:"POST",body:JSON.stringify(e)}).then(t=>t.upload),resendSessionMessage:(e,t)=>Ue(`/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}/resend`,{method:"POST"}),dismissSessionMessage:(e,t)=>Ue(`/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}/dismiss`,{method:"POST"}),messagingCapabilities:()=>Ue("/messaging/capabilities").then(e=>e.capabilities),listQuestions:()=>Ue("/messaging/questions").then(e=>e.questions),answerQuestion:(e,t)=>Ue(`/sessions/${encodeURIComponent(e)}/answer`,{method:"POST",body:JSON.stringify({answers:t})}),interruptSession:e=>Ue(`/sessions/${encodeURIComponent(e)}/interrupt`,{method:"POST"}),cycleSessionMode:e=>Ue(`/sessions/${encodeURIComponent(e)}/mode`,{method:"POST"}),setSessionModel:(e,t)=>Ue(`/sessions/${encodeURIComponent(e)}/model`,{method:"POST",body:JSON.stringify({model:t})}),askSideQuestion:(e,t)=>Ue(`/sessions/${encodeURIComponent(e)}/side-question`,{method:"POST",body:JSON.stringify({question:t})}),listSideQuestions:(e,t={})=>{const n=new URLSearchParams;t.beforeId!=null&&n.set("beforeId",String(t.beforeId)),t.limit!=null&&n.set("limit",String(t.limit));const s=n.toString();return Ue(`/sessions/${encodeURIComponent(e)}/side-questions${s?`?${s}`:""}`).then(r=>r.sideQuestions)},listSessionWatches:()=>Ue("/messaging/watches").then(e=>e.watches),createSessionWatch:(e,t={})=>Ue(`/sessions/${encodeURIComponent(e)}/watch`,{method:"POST",body:JSON.stringify(t)}),deleteSessionWatch:(e,t)=>Ue(`/sessions/${encodeURIComponent(e)}/watch`,{method:"DELETE",body:JSON.stringify({watchId:t})}),pushPublicKey:()=>Ue("/messaging/push/key"),pushSubscribe:e=>Ue("/messaging/push/subscribe",{method:"POST",body:JSON.stringify(e)}),pushUnsubscribe:e=>Ue("/messaging/push/unsubscribe",{method:"POST",body:JSON.stringify({endpoint:e})}),listSessionSequences:()=>Ue("/messaging/sequences").then(e=>e.sequences),createSequence:e=>Ue("/messaging/sequences",{method:"POST",body:JSON.stringify(e)}),cancelSequence:e=>Ue(`/messaging/sequences/${e}`,{method:"DELETE"}),capabilities:()=>Ue("/capabilities"),listLibraries:()=>Ue("/libraries").then(e=>e.libraries),addLibrary:(e,t)=>Ue("/libraries",{method:"POST",body:JSON.stringify({path:e,kind:t})}),removeLibrary:e=>Ue(`/libraries/${e}`,{method:"DELETE"}).then(()=>{}),listMarket:()=>Ue("/market").then(e=>e.items),importMarketDir:e=>Ue("/market",{method:"POST",body:JSON.stringify({kind:"dir",path:e})}).then(t=>t.item),importMarketGit:e=>Ue("/market",{method:"POST",body:JSON.stringify({kind:"git",url:e})}).then(t=>t.item),removeMarket:e=>Ue(`/market/${e}`,{method:"DELETE"}),checkMarketUpdates:e=>Ue("/market/check-updates",{method:"POST",body:JSON.stringify(e!=null&&e.length?{ids:e}:{})}).then(t=>t.results),refreshMarketCache:e=>Ue("/market/refresh",{method:"POST",body:JSON.stringify(e!=null&&e.length?{ids:e}:{})}).then(t=>t.results),migrateLibrary:e=>Ue(`/libraries/${e}/market-import`,{method:"POST"}).then(t=>t.item),listFsRoots:()=>Ue("/fs/roots").then(e=>e.roots),listFsChildren:e=>Ue(`/fs/children?path=${encodeURIComponent(e)}`).then(t=>t.children),install:(e,t)=>fetch(`${Ka}/projects/${e}/install`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),uninstall:(e,t)=>fetch(`${Ka}/projects/${e}/uninstall`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),readFile:(e,t)=>Ue(`/projects/${e}/file?path=${encodeURIComponent(t)}`),readGlobalFile:e=>Ue(`/global-file?path=${encodeURIComponent(e)}`),listMcp:e=>Ue(`/projects/${e}/mcp`).then(t=>t.rows),getStatusline:e=>Ue(`/projects/${e}/statusline`),putStatusline:(e,t)=>fetch(`${Ka}/projects/${e}/statusline`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),getFactoryStatusline:()=>Ue("/statusline/default").then(e=>e.config),putGlobalStatusline:e=>fetch(`${Ka}/statusline/global`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),listUpdates:e=>Ue(`/projects/${e}/updates`),updateAsset:(e,t)=>fetch(`${Ka}/projects/${e}/update`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),syncAll:e=>fetch(`${Ka}/projects/${e}/sync-all`,{method:"POST"}),listGlobalSkills:e=>Ue(`/projects/${e}/skills/global`).then(t=>t.groups),listGlobalSkillFiles:(e,t)=>{const n=new URLSearchParams({source:t.source,name:t.name});return t.pluginKey&&n.set("pluginKey",t.pluginKey),Ue(`/projects/${e}/skills/global/files?${n}`).then(s=>s.files)},readGlobalSkillFile:(e,t)=>{const n=new URLSearchParams({source:t.source,name:t.name,path:t.path});return t.pluginKey&&n.set("pluginKey",t.pluginKey),Ue(`/projects/${e}/skills/global/file?${n}`)},listPluginState:e=>Ue(`/projects/${e}/plugins/state`).then(t=>t.rows),putPluginState:(e,t,n,s,r)=>Ue(`/projects/${e}/plugins/state`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({runtime:t,key:n,scope:s,state:r})}),uninstallPluginPack:(e,t)=>Ue(`/projects/${e}/plugins/uninstall`,{method:"POST",body:JSON.stringify(t)}),putMcpEnable:(e,t,n)=>Ue(`/projects/${e}/mcp/enable`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t,state:n})}),getProjectConfig:e=>Ue(`/projects/${e}/config`),getHarnessChecks:e=>Ue(`/projects/${e}/harness-checks`),openProject:(e,t)=>Ue(`/projects/${e}/open`,{method:"POST",body:JSON.stringify({target:t})}),getDaemonSettings:()=>Ue("/settings"),putDaemonSettings:e=>Ue("/settings",{method:"PUT",body:JSON.stringify(e)}),getCapture:()=>Ue("/capture").then(e=>e.rows),putCapture:(e,t)=>Ue("/capture",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({harness:e,enabled:t})}),putProjectConfig:(e,t)=>fetch(`${Ka}/projects/${e}/config`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),listLibraryAssets:e=>Ue(`/libraries/${e}/assets`),eventsUrl:(e=null)=>e===null?`${Fr}/events`:`${Fr}/events?since=${encodeURIComponent(e)}`};function ba(e,t){const n=t==null?void 0:t.categories[e];return{surfaces:(n==null?void 0:n.surfaces)??en.map(r=>({harness:r,scopes:["project","user"]}))}}const W6={claude:"capability.reason.codexOnly",codex:"capability.reason.claudeOnly"};function Oo(e,t){const n=e.surfaces.find(s=>s.harness===t.agent);return n?n.scopes.includes(t.scope)?{ok:!0,reasonKey:null}:{ok:!1,reasonKey:t.scope==="user"?"capability.reason.projectOnly":"capability.reason.globalOnly"}:{ok:!1,reasonKey:W6[t.agent]??"capability.reason.harnessUnsupported"}}function Z6(e,t,n,s){return EM.includes(e)?Oo(ba(e,s),{scope:n,agent:t}).ok:!1}function Lg(e,t){return{...e,attrs:ba(e.category,t)}}const J6=new Set,Oh=new Map,Dh=new Map,xx=new Set,lu=new Map,Ih=new Map;let Us=null,yx=null,Df=Date.now();const ez=65e3,tz=15e3;let bS=null;const xS="weave:sse-resync",nz=1e4;function sz(){const e=Number(sessionStorage.getItem(xS)??0);Date.now()-e<nz||(sessionStorage.setItem(xS,String(Date.now())),location.reload())}function Oc(){return $v()!=="authenticated"?null:Us||(Us=new EventSource(Ce.eventsUrl(yx)),Df=Date.now(),Us.onopen=()=>{Df=Date.now()},Us.onmessage=e=>{Df=Date.now(),e.lastEventId&&(yx=e.lastEventId);let t;try{t=JSON.parse(e.data)}catch{return}if(t.type==="resync"){sz();return}for(const n of Oh.get(t.type)??[])n(t);if(t.type==="push")for(const n of Dh.get(String(t.key))??[])n(t.payload);if(t.type==="hook"&&typeof t.kind=="string"){const n=t;for(const s of xx)s(n);for(const[s,r]of lu)if(s===t.kind||s.endsWith(".")&&t.kind.startsWith(s))for(const i of r)i(n)}if(t.type==="invalidate")for(const n of Ih.get(String(t.key))??[])n();for(const n of J6)n(t)},Us.onerror=()=>{Y6()},bS===null&&(bS=setInterval(()=>{!Us||Date.now()-Df<ez||(TM(),Oc())},tz)),Us)}function TM(){Us==null||Us.close(),Us=null}kM(()=>{if($v()==="authenticated"){Oc();return}TM(),yx=null});function vx(e,t){Oc();const n=Oh.get(e)??new Set;return Oh.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Oh.delete(e)}}function ko(e,t){Oc();const n=Dh.get(e)??new Set;return Dh.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Dh.delete(e)}}function Ai(e,t){if(Oc(),!t)return xx.add(e),()=>{xx.delete(e)};for(const n of t){const s=lu.get(n)??new Set;lu.set(n,s),s.add(e)}return()=>{for(const n of t){const s=lu.get(n);s&&(s.delete(e),s.size===0&&lu.delete(n))}}}function $r(e,t){Oc();const n=Ih.get(e)??new Set;return Ih.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Ih.delete(e)}}function id(e){try{const t=JSON.parse(e);return{toolName:typeof t.toolName=="string"?t.toolName:null,toolInput:t.toolInput??null,toolResponse:t.toolResponse??null,cwd:typeof t.cwd=="string"?t.cwd:null,transcriptPath:typeof t.transcriptPath=="string"?t.transcriptPath:null}}catch{return{toolName:null,toolInput:null,toolResponse:null,cwd:null,transcriptPath:null}}}const AM={PreToolUse:"bg-blue-900/40 text-blue-300",PostToolUse:"bg-emerald-900/40 text-emerald-300",UserPromptSubmit:"bg-cyan-900/40 text-cyan-300",SessionStart:"bg-purple-900/40 text-purple-300",SessionEnd:"bg-pink-900/40 text-pink-300",Notification:"bg-amber-900/40 text-amber-300",Stop:"bg-orange-900/40 text-orange-300",StopFailure:"bg-red-900/40 text-red-300",SubagentStop:"bg-orange-900/40 text-orange-300",SubagentStart:"bg-orange-900/40 text-orange-300",PostToolUseFailure:"bg-red-900/40 text-red-300",PermissionRequest:"bg-amber-900/40 text-amber-300",PermissionDenied:"bg-red-900/40 text-red-300"};Object.fromEntries(Object.entries(dc).map(([e,t])=>[e,t.source]));function lr(e){return new Date(e).toLocaleTimeString()}function qc(e){const t=new Date(e),n=t.toLocaleTimeString();return t.toDateString()===new Date().toDateString()?n:`${t.getMonth()+1}/${t.getDate()} ${n}`}const yS="[weave] ",rz="weave",iz=/<cross-session-message([^>]*)>([\s\S]*)<\/cross-session-message>/,az=/from-name="([^"]*)"/,lz=/^\[weave one-way injection — no reply is expected[^\]]*\]\s*/;function MM(e){var i;let t=e.startsWith(yS)?e.slice(yS.length):e;const n=t!==e,s=iz.exec(t),r=s?((i=az.exec(s[1]))==null?void 0:i[1])??null:null;return s&&(t=s[2],t=t.startsWith(`
484
+ `)?t.slice(1):t),t=t.replace(lz,""),{text:t.trim(),fromWeave:n||r===rz,fromName:r}}function oz(e){return kn(Oi(e).prompt)}function cz(e){return kn(Oi(e).last_assistant_message)}function Sn(e,t){return e??t.slice(0,8)}const vS=new WeakMap;function Gv(e){const t=vS.get(e);if(t!==void 0)return t;let n={};try{const s=JSON.parse(e.payload);s&&typeof s=="object"&&(n=s)}catch{}return vS.set(e,n),n}function Oi(e){const t=Gv(e);return t.raw&&typeof t.raw=="object"?t.raw:{}}const If=e=>e.replace(/\s+/g," ").trim(),kn=e=>typeof e=="string"&&e?e:null;function kx(e){if(e.eventType!=="PostToolUse")return null;const t=Gv(e),n=t.toolResponse;if(!n||typeof n.agentId!="string"||!n.agentId)return null;const s=t.raw;return{agentId:n.agentId,toolUseId:kn(s==null?void 0:s.tool_use_id),model:kn(n.resolvedModel)}}function bm(e){const t=Gv(e).raw,n=kn(t==null?void 0:t.prompt);if(!n||!n.startsWith("<task-notification>"))return null;const s=r=>{const i=n.match(new RegExp(`<${r}>([^<]*)</${r}>`));return i&&i[1].trim()||null};return{taskId:s("task-id"),toolUseId:s("tool-use-id"),status:s("status"),summary:s("summary")}}function ju(e){const t=Oi(e),n=id(e.payload);switch(e.eventType){case"UserPromptSubmit":{const s=bm(e);return s?[s.status,s.summary].filter(Boolean).join(" · "):If(kn(t.prompt)??"")}case"PreToolUse":case"PostToolUse":{const s=n.toolInput??{},r=kn(s.file_path)??kn(s.path)??kn(s.description)??kn(s.pattern)??kn(s.url)??kn(s.command)??"",i=If([n.toolName,r].filter(Boolean).join(" "));if(e.eventType==="PostToolUse"){const a=n.toolResponse,l=a&&typeof a=="object"?kn(a.stdout)??kn(a.type):null;if(l)return`${i} → ${If(l).slice(0,90)}`}return i}case"Notification":{const s=kn(t.message)??"",r=kn(t.notification_type);return r&&s?`${r} · ${s}`:r??s}case"SubagentStop":return If(kn(t.last_assistant_message)??"");case"SessionStart":case"SessionEnd":{const s=kn(t.session_title)??"",r=kn(t.source)??"";return[s,r].filter(Boolean).join(" · ")}default:return""}}async function kS(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const s={...t?{body:t}:{},...n?{tag:n}:{}},r="serviceWorker"in navigator?await navigator.serviceWorker.getRegistration():void 0;if(r){await r.showNotification(e,Object.keys(s).length?s:void 0);return}new Notification(e,Object.keys(s).length?s:void 0)}catch{}}async function jM(){if(typeof Notification>"u")return"unsupported";if(globalThis.isSecureContext===!1)return"insecure";if(Notification.permission==="granted")return"granted";if(Notification.permission==="denied")return"denied";try{return await Notification.requestPermission()==="granted"?"granted":"denied"}catch{return"denied"}}function xm(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function uz(e,t){return e.reduce((n,s,r)=>{const i=t.get(s);return i&&(n[r]=i),n},Array(e.length))}function Lf(e){return e!==null&&e>=0}function dz(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 fz(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Pf={scaleX:1,scaleY:1},hz=e=>{var t;let{rects:n,activeNodeRect:s,activeIndex:r,overIndex:i,index:a}=e;const l=(t=n[r])!=null?t:s;if(!l)return null;const c=pz(n,a,r);if(a===r){const u=n[i];return u?{x:r<i?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...Pf}:null}return a>r&&a<=i?{x:-l.width-c,y:0,...Pf}:a<r&&a>=i?{x:l.width+c,y:0,...Pf}:{x:0,y:0,...Pf}};function pz(e,t,n){const s=e[t],r=e[t-1],i=e[t+1];return!s||!r&&!i?0:n<t?r?s.left-(r.left+r.width):i.left-(s.left+s.width):i?i.left-(s.left+s.width):s.left-(r.left+r.width)}const RM=e=>{let{rects:t,activeIndex:n,overIndex:s,index:r}=e;const i=xm(t,s,n),a=t[r],l=i[r];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},zf={scaleX:1,scaleY:1},mz=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:r,rects:i,overIndex:a}=e;const l=(t=i[n])!=null?t:s;if(!l)return null;if(r===n){const u=i[a];return u?{x:0,y:n<a?u.top+u.height-(l.top+l.height):u.top-l.top,...zf}:null}const c=gz(i,r,n);return r>n&&r<=a?{x:0,y:-l.height-c,...zf}:r<n&&r>=a?{x:0,y:l.height+c,...zf}:{x:0,y:0,...zf}};function gz(e,t,n){const s=e[t],r=e[t-1],i=e[t+1];return s?n<t?r?s.top-(r.top+r.height):i?i.top-(s.top+s.height):0:i?i.top-(s.top+s.height):r?s.top-(r.top+r.height):0:0}const OM="Sortable",DM=ss.createContext({activeIndex:-1,containerId:OM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:RM,disabled:{draggable:!1,droppable:!1}});function IM(e){let{children:t,id:n,items:s,strategy:r=RM,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:d}=l6(),f=$d(OM,n),h=l.rect!==null,p=b.useMemo(()=>s.map(E=>typeof E=="object"&&"id"in E?E.id:E),[s]),m=a!=null,k=a?p.indexOf(a.id):-1,w=u?p.indexOf(u.id):-1,g=b.useRef(p),y=!dz(p,g.current),x=w!==-1&&k===-1||y,S=fz(i);Hr(()=>{y&&m&&d(p)},[y,p,m,d]),b.useEffect(()=>{g.current=p},[p]);const A=b.useMemo(()=>({activeIndex:k,containerId:f,disabled:S,disableTransforms:x,items:p,overIndex:w,useDragOverlay:h,sortedRects:uz(p,c),strategy:r}),[k,f,S.draggable,S.droppable,x,p,w,c,h,r]);return ss.createElement(DM.Provider,{value:A},t)}const bz=e=>{let{id:t,items:n,activeIndex:s,overIndex:r}=e;return xm(n,s,r).indexOf(t)},xz=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:r,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!s||l!==i&&r===a?!1:n?!0:a!==r&&t===c},yz={duration:200,easing:"ease"},LM="transform",vz=Sp.Transition.toString({property:LM,duration:0,easing:"linear"}),kz={roleDescription:"sortable"};function wz(e){let{disabled:t,index:n,node:s,rect:r}=e;const[i,a]=b.useState(null),l=b.useRef(n);return Hr(()=>{if(!t&&n!==l.current&&s.current){const c=r.current;if(c){const u=Rc(s.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&a(d)}}n!==l.current&&(l.current=n)},[t,n,s,r]),b.useEffect(()=>{i&&a(null)},[i]),i}function PM(e){let{animateLayoutChanges:t=xz,attributes:n,disabled:s,data:r,getNewIndex:i=bz,id:a,strategy:l,resizeObserverConfig:c,transition:u=yz}=e;const{items:d,containerId:f,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:k,overIndex:w,useDragOverlay:g,strategy:y}=b.useContext(DM),x=Sz(s,p),S=d.indexOf(a),A=b.useMemo(()=>({sortable:{containerId:f,index:S,items:d},...r}),[f,r,S,d]),E=b.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:M,node:j,isOver:O,setNodeRef:N}=Uv({id:a,data:A,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:F,activatorEvent:G,activeNodeRect:H,attributes:I,setNodeRef:L,listeners:C,isDragging:D,over:U,setActivatorNodeRef:B,transform:R}=hm({id:a,data:A,attributes:{...kz,...n},disabled:x.draggable}),_=$L(N,L),K=!!F,T=K&&!m&&Lf(h)&&Lf(w),X=!g&&D,ne=X&&T?R:null,pe=T?ne??(l??y)({rects:k,activeNodeRect:H,activeIndex:h,overIndex:w,index:S}):null,q=Lf(h)&&Lf(w)?i({id:a,items:d,activeIndex:h,overIndex:w}):S,Y=F==null?void 0:F.id,V=b.useRef({activeId:Y,items:d,newIndex:q,containerId:f}),ee=d!==V.current.items,oe=t({active:F,containerId:f,isDragging:D,isSorting:K,id:a,index:S,items:d,newIndex:V.current.newIndex,previousItems:V.current.items,previousContainerId:V.current.containerId,transition:u,wasDragging:V.current.activeId!=null}),ye=wz({disabled:!oe,index:S,node:j,rect:M});return b.useEffect(()=>{K&&V.current.newIndex!==q&&(V.current.newIndex=q),f!==V.current.containerId&&(V.current.containerId=f),d!==V.current.items&&(V.current.items=d)},[K,q,f,d]),b.useEffect(()=>{if(Y===V.current.activeId)return;if(Y&&!V.current.activeId){V.current.activeId=Y;return}const se=setTimeout(()=>{V.current.activeId=Y},50);return()=>clearTimeout(se)},[Y]),{active:F,activeIndex:h,attributes:I,data:A,rect:M,index:S,newIndex:q,items:d,isOver:O,isSorting:K,isDragging:D,listeners:C,node:j,overIndex:w,over:U,setNodeRef:_,setActivatorNodeRef:B,setDroppableNodeRef:N,setDraggableNodeRef:L,transform:ye??pe,transition:Re()};function Re(){if(ye||ee&&V.current.newIndex===S)return vz;if(!(X&&!Rv(G)||!u)&&(K||oe))return Sp.Transition.toString({...u,property:LM})}}function Sz(e,t){var n,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:t.droppable}}Ct.Down,Ct.Right,Ct.Up,Ct.Left;function zM(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=zM(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Nz(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=zM(e))&&(s&&(s+=" "),s+=t);return s}const Kv="-",Ez=e=>{const t=Cz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:a=>{const l=a.split(Kv);return l[0]===""&&l.length!==1&&l.shift(),UM(l,t)||_z(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&s[a]?[...c,...s[a]]:c}}},UM=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?UM(e.slice(1),s):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(Kv);return(a=t.validators.find(({validator:l})=>l(i)))==null?void 0:a.classGroupId},wS=/^\[(.+)\]$/,_z=e=>{if(wS.test(e)){const t=wS.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Cz=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return Az(Object.entries(e.classGroups),n).forEach(([i,a])=>{wx(a,s,i,t)}),s},wx=(e,t,n,s)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:SS(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(Tz(r)){wx(r(s),t,n,s);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,a])=>{wx(a,SS(t,i),n,s)})})},SS=(e,t)=>{let n=e;return t.split(Kv).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},Tz=e=>e.isThemeGetter,Az=(e,t)=>t?e.map(([n,s])=>{const r=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,l])=>[t+a,l])):i);return[n,r]}):e,Mz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=s.get(i))!==void 0)return r(i,a),a},set(i,a){n.has(i)?n.set(i,a):r(i,a)}}},FM="!",jz=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,r=t[0],i=t.length,a=l=>{const c=[];let u=0,d=0,f;for(let w=0;w<l.length;w++){let g=l[w];if(u===0){if(g===r&&(s||l.slice(w,w+i)===t)){c.push(l.slice(d,w)),d=w+i;continue}if(g==="/"){f=w;continue}}g==="["?u++:g==="]"&&u--}const h=c.length===0?l:l.substring(d),p=h.startsWith(FM),m=p?h.substring(1):h,k=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:k}};return n?l=>n({className:l,parseClassName:a}):a},Rz=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},Oz=e=>({cache:Mz(e.cacheSize),parseClassName:jz(e),...Ez(e)}),Dz=/\s+/,Iz=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r}=t,i=[],a=e.trim().split(Dz);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let m=!!p,k=s(m?h.substring(0,p):h);if(!k){if(!m){l=u+(l.length>0?" "+l:l);continue}if(k=s(h),!k){l=u+(l.length>0?" "+l:l);continue}m=!1}const w=Rz(d).join(":"),g=f?w+FM:w,y=g+k;if(i.includes(y))continue;i.push(y);const x=r(k,m);for(let S=0;S<x.length;++S){const A=x[S];i.push(g+A)}l=u+(l.length>0?" "+l:l)}return l};function Lz(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=BM(t))&&(s&&(s+=" "),s+=n);return s}const BM=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=BM(e[s]))&&(n&&(n+=" "),n+=t);return n};function Pz(e,...t){let n,s,r,i=a;function a(c){const u=t.reduce((d,f)=>f(d),e());return n=Oz(u),s=n.cache.get,r=n.cache.set,i=l,l(c)}function l(c){const u=s(c);if(u)return u;const d=Iz(c,n);return r(c,d),d}return function(){return i(Lz.apply(null,arguments))}}const Gt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},HM=/^\[(?:([a-z-]+):)?(.+)\]$/i,zz=/^\d+\/\d+$/,Uz=new Set(["px","full","screen"]),Fz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bz=/\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$/,Hz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ai=e=>Do(e)||Uz.has(e)||zz.test(e),Ui=e=>Dc(e,"length",Zz),Do=e=>!!e&&!Number.isNaN(Number(e)),Pg=e=>Dc(e,"number",Do),Yc=e=>!!e&&Number.isInteger(Number(e)),Kz=e=>e.endsWith("%")&&Do(e.slice(0,-1)),ut=e=>HM.test(e),Fi=e=>Fz.test(e),qz=new Set(["length","size","percentage"]),Yz=e=>Dc(e,qz,$M),Vz=e=>Dc(e,"position",$M),Xz=new Set(["image","url"]),Qz=e=>Dc(e,Xz,e9),Wz=e=>Dc(e,"",Jz),Vc=()=>!0,Dc=(e,t,n)=>{const s=HM.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},Zz=e=>Bz.test(e)&&!Hz.test(e),$M=()=>!1,Jz=e=>$z.test(e),e9=e=>Gz.test(e),t9=()=>{const e=Gt("colors"),t=Gt("spacing"),n=Gt("blur"),s=Gt("brightness"),r=Gt("borderColor"),i=Gt("borderRadius"),a=Gt("borderSpacing"),l=Gt("borderWidth"),c=Gt("contrast"),u=Gt("grayscale"),d=Gt("hueRotate"),f=Gt("invert"),h=Gt("gap"),p=Gt("gradientColorStops"),m=Gt("gradientColorStopPositions"),k=Gt("inset"),w=Gt("margin"),g=Gt("opacity"),y=Gt("padding"),x=Gt("saturate"),S=Gt("scale"),A=Gt("sepia"),E=Gt("skew"),M=Gt("space"),j=Gt("translate"),O=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",ut,t],G=()=>[ut,t],H=()=>["",ai,Ui],I=()=>["auto",Do,ut],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",ut],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>[Do,ut];return{cacheSize:500,separator:":",theme:{colors:[Vc],spacing:[ai,Ui],blur:["none","",Fi,ut],brightness:_(),borderColor:[e],borderRadius:["none","","full",Fi,ut],borderSpacing:G(),borderWidth:H(),contrast:_(),grayscale:B(),hueRotate:_(),invert:B(),gap:G(),gradientColorStops:[e],gradientColorStopPositions:[Kz,Ui],inset:F(),margin:F(),opacity:_(),padding:G(),saturate:_(),scale:_(),sepia:B(),skew:_(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",ut]}],container:["container"],columns:[{columns:[Fi]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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"],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:[...L(),ut]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Yc,ut]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ut]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",Yc,ut]}],"grid-cols":[{"grid-cols":[Vc]}],"col-start-end":[{col:["auto",{span:["full",Yc,ut]},ut]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Vc]}],"row-start-end":[{row:["auto",{span:[Yc,ut]},ut]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ut]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ut]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ut,t]}],"min-w":[{"min-w":[ut,t,"min","max","fit"]}],"max-w":[{"max-w":[ut,t,"none","full","min","max","fit","prose",{screen:[Fi]},Fi]}],h:[{h:[ut,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ut,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ut,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ut,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Fi,Ui]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pg]}],"font-family":[{font:[Vc]}],"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:["tighter","tight","normal","wide","wider","widest",ut]}],"line-clamp":[{"line-clamp":["none",Do,Pg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ai,ut]}],"list-image":[{"list-image":["none",ut]}],"list-style-type":[{list:["none","disc","decimal",ut]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...C(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ai,Ui]}],"underline-offset":[{"underline-offset":["auto",ai,ut]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ut]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),Vz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Yz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Qz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...C(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:C()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...C()]}],"outline-offset":[{"outline-offset":[ai,ut]}],"outline-w":[{outline:[ai,Ui]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[ai,Ui]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Fi,Wz]}],"shadow-color":[{shadow:[Vc]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Fi,ut]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ut]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",ut]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",ut]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Yc,ut]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ut]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",ut]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",ut]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ai,Ui,Pg]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},n9=Pz(t9);function de(...e){return n9(Nz(e))}const NS={default:"bg-neutral-800 text-neutral-100",skill:"bg-blue-900/40 text-blue-300",command:"bg-purple-900/40 text-purple-300",agent:"bg-emerald-900/40 text-emerald-300",helper:"bg-amber-900/40 text-amber-300",mcp:"bg-pink-900/40 text-pink-300",settings:"bg-cyan-900/40 text-cyan-300",warning:"bg-orange-900/40 text-orange-300",other:"bg-neutral-800 text-neutral-400"};function Qe({className:e,variant:t="default",...n}){return o.jsx("span",{className:de("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium tracking-tight",NS[t]??NS.default,e),...n})}function xr({agent:e,className:t}){return e?o.jsx(Qe,{className:de("shrink-0",Kn(e).badge,t),children:e}):null}function Si(e){const[t,n]=b.useState(()=>typeof window<"u"&&window.matchMedia(e).matches);return b.useEffect(()=>{const s=window.matchMedia(e),r=()=>n(s.matches);return r(),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),t}const GM=["zh-CN","en"],Sx="zh-CN",s9={"zh-CN":"中文(简体)",en:"English"},KM="weave:locale",r9={"common.close":"关闭","common.cancel":"取消","common.confirm":"确认","common.save":"保存","common.saving":"保存中…","common.loading":"加载中…","common.empty":"(空)","common.expand":"展开","common.collapse":"折叠","common.copy":"复制","common.copyFailed":"复制失败:浏览器未放行剪贴板(手机请用页面上的 HTTPS 地址访问)","common.decrease":"减少","common.increase":"增加","common.canvas.lines":"网格底纹","common.canvas.dots":"点阵底纹","common.canvas.cross":"十字底纹","common.canvas.none":"无底纹","common.canvas.tintNone":"默认底色","common.canvas.tintSky":"蓝色底色","common.canvas.tintViolet":"紫色底色","common.canvas.tintEmerald":"绿色底色","common.canvas.tintAmber":"琥珀底色"},i9={"common.close":"Close","common.cancel":"Cancel","common.confirm":"Confirm","common.save":"Save","common.saving":"Saving…","common.loading":"Loading…","common.empty":"(empty)","common.expand":"Expand","common.collapse":"Collapse","common.copy":"Copy","common.copyFailed":"Copy failed: the browser blocked clipboard access (on a phone, use the HTTPS address)","common.decrease":"Decrease","common.increase":"Increase","common.canvas.lines":"Grid pattern","common.canvas.dots":"Dot pattern","common.canvas.cross":"Cross pattern","common.canvas.none":"No pattern","common.canvas.tintNone":"Default background","common.canvas.tintSky":"Blue background","common.canvas.tintViolet":"Violet background","common.canvas.tintEmerald":"Green background","common.canvas.tintAmber":"Amber background"},a9={"settings.title":"设置","settings.language":"语言","settings.languageHint":"dashboard 与 weave CLI 共用的界面语言。","settings.defaultTerminal":"默认终端","settings.defaultTerminalHint":"「在终端中打开」使用的终端程序;自动 = 自动选择可用的终端。","settings.customCommand":"自定义命令","settings.pathHint":"会被替换为带引号的项目路径,例如:","settings.hooks":"Weave 总开关","settings.hooksHint":"Weave 总开关(规则级开关另控);关闭后规则不再生效。","settings.launchOnLogin":"开机自启 daemon","settings.launchOnLoginHint":"登录系统时自动启动 weave 后台服务,默认关闭。","settings.retentionDays":"事件日志保留天数","settings.retentionDaysHint":"超过该天数的事件日志会被自动清理;保存后下一条事件即生效。","settings.sessionIdleDays":"会话闲置保留天数","settings.sessionIdleDaysHint":"收到过消息的会话无操作 {n} 天后自动移除;没有消息的新会话 1 小时后过期。会话行内标注剩余存活时间。","settings.daysUnit":"天","settings.accessUrls":"访问地址","settings.accessUrlsHint":"本机与局域网设备访问 dashboard 的完整地址;https 端口用于手机浏览器通知(自签证书,首次访问需在浏览器接受)。","settings.urlLan":"局域网","settings.urlLocal":"本机","settings.push":"推送提醒","settings.pushHint":"页面关闭后仍能收到提醒(逐设备开关)。","settings.pushInsecure":"推送需 HTTPS 访问(当前是 HTTP,浏览器不支持)。","settings.pushUnsupported":"此浏览器不支持 Web Push(iOS 需将本站加到主屏幕后可用)。","settings.pushFailed":"推送订阅未成功——提醒保持「页面开着才通知」。"},l9={"settings.title":"Settings","settings.language":"Language","settings.languageHint":"UI language shared by the dashboard and the weave CLI.","settings.defaultTerminal":"Default terminal","settings.defaultTerminalHint":'Terminal used by "Open in terminal"; auto picks an available terminal.',"settings.customCommand":"Custom command","settings.pathHint":"is replaced with the quoted project path, e.g.:","settings.hooks":"Weave master switch","settings.hooksHint":"Weave master switch (rule-level switches stay independent); when off, no rules run.","settings.launchOnLogin":"Launch daemon on login","settings.launchOnLoginHint":"Start the weave daemon automatically at login. Off by default.","settings.retentionDays":"Event log retention (days)","settings.retentionDaysHint":"Event logs older than this are cleaned up automatically; takes effect on the next event.","settings.sessionIdleDays":"Session idle retention (days)","settings.sessionIdleDaysHint":"Prompted sessions are removed after {n} idle days; new sessions with no prompt expire in 1 hour. Each row shows its remaining lifetime.","settings.daysUnit":"days","settings.accessUrls":"Access URLs","settings.accessUrlsHint":"Full URLs for this dashboard on loopback and LAN devices; the https port is what phone browsers need for notifications (self-signed — accept it on first visit).","settings.urlLan":"LAN","settings.urlLocal":"Local","settings.push":"Push alerts","settings.pushHint":"Alerts arrive even with the page closed (per-device toggle).","settings.pushInsecure":"Push requires HTTPS (this page is HTTP, so the browser blocks it).","settings.pushUnsupported":"This browser has no Web Push support (on iOS, add the site to the Home Screen first).","settings.pushFailed":"Push subscription failed — alerts stay page-open-only."},o9={"preset.auto":"自动(探测可用终端)","preset.wt":"Windows Terminal","preset.powershell":"PowerShell","preset.cmd":"命令提示符 (cmd)","preset.terminal":"Terminal.app","preset.iterm":"iTerm2","preset.gnome":"gnome-terminal","preset.konsole":"Konsole","preset.wezterm":"WezTerm","preset.ghostty":"Ghostty","preset.custom":"自定义命令"},c9={"preset.auto":"Auto (detect available terminal)","preset.wt":"Windows Terminal","preset.powershell":"PowerShell","preset.cmd":"Command Prompt (cmd)","preset.terminal":"Terminal.app","preset.iterm":"iTerm2","preset.gnome":"gnome-terminal","preset.konsole":"Konsole","preset.wezterm":"WezTerm","preset.ghostty":"Ghostty","preset.custom":"Custom command"},u9={"app.projectCount":"{n} 个项目","app.settingsTooltip":"设置(默认终端等)","app.themeToLight":"切换到浅色","app.themeToDark":"切换到深色","app.resizeLeft":"拖拽调整左侧宽度","app.resizeRight":"拖拽调整右侧宽度","app.resizeTaskHeight":"拖拽调整任务区高度","app.resizeDialog":"拖拽调整窗口大小","app.globalTitle":"全局配置","app.globalSubtitle":"机器级 harness 默认模板 · 作用于所有项目","app.updateCountOne":"1 个更新","app.updateCount":"{n} 个更新","app.updateListTip":"点开查看更新列表","app.updateListTitle":"待更新 {n} 项","app.updateKindSkill":"技能","app.updateKindMcp":"MCP","app.updateKindFile":"文件","app.updateKindTemplate":"插件模板","app.updateKindInit":"初始化文件","app.syncAllTooltip":"同步全部 {n} 项:更新过期、装回缺失","app.syncAll":"全部同步","app.scopeCoverageTooltip":"同步覆盖 Skills、MCP、单文件资产与 init 生成物;会进 git 的 init 文件(如 CLAUDE.md)只提示不代写,需在终端跑 weave init。不含状态栏。","app.scopeCoverageChip":"覆盖 Skills · MCP · 资源管理 · init 生成物","app.selectProject":"请选择一个项目","app.selectProjectForAssets":"请选择一个项目,资产将安装到该项目。","app.mobileProjects":"项目列表","app.mobileLibrary":"资源市场","app.mobileDrawerClose":"收起","project.globalConfig":"全局配置","project.globalSubtitle":"机器级 harness 默认模板","project.sectionHeader":"项目","project.noneRegistered":"尚未注册任何项目","project.openInExplorer":"在资源管理器中打开","project.openInTerminal":"在终端中打开","project.dragToReorder":"拖动调整顺序","project.terminalsOpen":"{n} 个终端已打开","project.closeTerminal":"关闭该项目的 {n} 个终端","project.syncNow":"立即同步","project.syncPending":"有更新待同步({n})— 点击立即同步","project.needsInit":"待 init","project.needsInitTip":"有会进 git 的 init 文件变了,同步不会代写——请在终端执行 weave init","project.sessionsRunning":"{n} 个会话运行中","project.sessionsOpen":"{n} 个会话就绪(等输入)","project.harnessesTip":"本项目 init 时选择接入的 harness","project.archive":"归档项目","project.archiveConfirm":"归档「{name}」?历史会话将立即清空;基础信息保留,可随时恢复。","project.archivedSection":"归档项目","project.archivedCount":"{n} 个归档项目 — 点击查看","project.archivedOn":"归档于 {date}","project.restore":"恢复","project.restoreTooltip":"恢复为活跃项目(历史会话已清空,不会回来)","toast.projectArchived":"已归档「{name}」(清除 {sessions} 个会话 / {events} 条事件)","toast.projectRestored":"已恢复「{name}」","errors.archiveFailed":"归档失败:{error}","errors.restoreFailed":"恢复失败:{error}","skillDetail.readOnly":"只读","skillDetail.plugin":"插件","skillDetail.local":"本地","skillDetail.fileCount":"{n} 个文件","skillDetail.update":"待更新","skillDetail.custom":"自定义","skillDetail.uninstallTitle":"卸载 skill","skillDetail.expandAllDirs":"展开全部目录","skillDetail.collapseAllDirs":"折叠全部目录","skillDetail.expandAll":"全展开","skillDetail.collapseAll":"全折叠","skillDetail.noFiles":"无文件","skillDetail.emptySkillMd":"SKILL.md 为空","skillDetail.projectScopeHint":"项目级 skill — 位于 {root}/skills/","skillDetail.globalReadOnlyHint":"全局技能(只读)","skillDetail.globalPluginHint":"全局插件技能 — {runtime}","skillDetail.globalLocalHint":"全局本地技能 — {runtime}","errors.installFailed":"安装失败:{error}","errors.mcpInstallFailed":"MCP 安装失败:{error}","errors.uninstallFailed":"卸载失败:{error}","errors.mcpUninstallFailed":"MCP 卸载失败:{error}","errors.projectReorderFailed":"项目排序保存失败:{error}","toast.synced":"已同步 {n} 项","toast.nothingToSync":"没有需要同步的项","toast.sessionDeleted":"已删除会话({n} 条事件)","toast.sessionPaneClosed":"已关闭该会话(历史保留)","toast.terminalsClosed":"已关闭 {n} 个终端","errors.syncFailed":"同步失败:{error}","errors.updateFailed":"更新失败:{error}","errors.pluginToggleFailed":"插件启用状态更新失败:{error}","errors.openFailed":"打开失败:{error}","errors.closeTerminalFailed":"关闭终端失败:{error}"},d9={"app.projectCount":"{n} projects","app.settingsTooltip":"Settings (default terminal, etc.)","app.themeToLight":"Switch to light","app.themeToDark":"Switch to dark","app.resizeLeft":"Drag to resize the left pane","app.resizeRight":"Drag to resize the right pane","app.resizeTaskHeight":"Drag to resize the task area height","app.resizeDialog":"Drag to resize this window","app.globalTitle":"Global config","app.globalSubtitle":"Machine-level harness default template · applies to all projects","app.updateCountOne":"1 update","app.updateCount":"{n} updates","app.updateListTip":"Click to see what updates","app.updateListTitle":"{n} pending updates","app.updateKindSkill":"Skill","app.updateKindMcp":"MCP","app.updateKindFile":"File","app.updateKindTemplate":"Plugin template","app.updateKindInit":"Init file","app.syncAllTooltip":"Sync all {n}: update outdated, reinstall missing","app.syncAll":"Sync all","app.scopeCoverageTooltip":"Sync covers Skills, MCP, single-file assets and init artefacts; init files that enter git (e.g. CLAUDE.md) are only flagged — run `weave init` in a terminal. Excludes the statusline.","app.scopeCoverageChip":"Covers Skills · MCP · resources · init artefacts","app.selectProject":"Select a project","app.selectProjectForAssets":"Select a project to install assets into.","app.mobileProjects":"Projects","app.mobileLibrary":"Resource market","app.mobileDrawerClose":"Dismiss","project.globalConfig":"Global config","project.globalSubtitle":"Machine-level harness default template","project.sectionHeader":"Projects","project.noneRegistered":"No projects registered","project.openInExplorer":"Open in Explorer","project.openInTerminal":"Open in terminal","project.dragToReorder":"Drag to reorder","project.terminalsOpen":"{n} terminal(s) open","project.closeTerminal":"Close this project's {n} terminal(s)","project.syncNow":"Sync now","project.syncPending":"{n} update(s) pending — click to sync now","project.needsInit":"needs init","project.needsInitTip":"An init file that enters git changed — sync will not write it. Run `weave init` in a terminal.","project.sessionsRunning":"{n} session(s) running","project.sessionsOpen":"{n} session(s) ready (awaiting input)","project.harnessesTip":"Harness integrated for this project at init","project.archive":"Archive project","project.archiveConfirm":'Archive "{name}"? Session history is cleared immediately; basic info is kept — restore anytime.',"project.archivedSection":"Archived projects","project.archivedCount":"{n} archived — click to view","project.archivedOn":"Archived {date}","project.restore":"Restore","project.restoreTooltip":"Restore as an active project (session history is gone)","toast.projectArchived":'Archived "{name}" (purged {sessions} session(s) / {events} event(s))',"toast.projectRestored":'Restored "{name}"',"errors.archiveFailed":"Archive failed: {error}","errors.restoreFailed":"Restore failed: {error}","skillDetail.readOnly":"Read-only","skillDetail.plugin":"Plugin","skillDetail.local":"Local","skillDetail.fileCount":"{n} files","skillDetail.update":"update","skillDetail.custom":"custom","skillDetail.uninstallTitle":"Uninstall skill","skillDetail.expandAllDirs":"Expand all folders","skillDetail.collapseAllDirs":"Collapse all folders","skillDetail.expandAll":"Expand all","skillDetail.collapseAll":"Collapse all","skillDetail.noFiles":"No files","skillDetail.emptySkillMd":"Empty SKILL.md","skillDetail.projectScopeHint":"Project-scope skill — lives in {root}/skills/","skillDetail.globalReadOnlyHint":"Global skill (read-only)","skillDetail.globalPluginHint":"Global plugin skill — {runtime}","skillDetail.globalLocalHint":"Global skill (local) — {runtime}","errors.installFailed":"Install failed: {error}","errors.mcpInstallFailed":"MCP install failed: {error}","errors.uninstallFailed":"Uninstall failed: {error}","errors.mcpUninstallFailed":"MCP uninstall failed: {error}","errors.projectReorderFailed":"Failed to save project order: {error}","toast.synced":"Synced {n} item(s)","toast.nothingToSync":"Nothing needs syncing","toast.sessionDeleted":"Session deleted ({n} events)","toast.sessionPaneClosed":"Session closed (history kept)","toast.terminalsClosed":"Closed {n} terminal(s)","errors.syncFailed":"Sync failed: {error}","errors.updateFailed":"Update failed: {error}","errors.pluginToggleFailed":"Plugin toggle failed: {error}","errors.openFailed":"Open failed: {error}","errors.closeTerminalFailed":"Close terminal failed: {error}"},f9={"statusline.title":"状态栏","statusline.scopeGlobal":"全局模板","statusline.scopeProject":"项目配置","statusline.resetHint":"用出厂默认覆盖当前全局模板(需再次点击确认)","statusline.resetConfirm":"确认恢复出厂?","statusline.reset":"恢复出厂","statusline.saved":"已保存 ✓","statusline.retry":"重试","statusline.saveFailed":"保存失败:{error}","statusline.emptyRow":"(空行)","statusline.preview":" ← 预览","statusline.barTitle":"状态栏","statusline.tuiBadge":"TUI 注入","statusline.tuiHint":"这份配置会注入上面那个 harness 的 TUI 状态栏;没这条通道的 harness 只在对话页底条显示(且只摆当前有数据的块)。","statusline.followingGlobal":"跟随全局模板","statusline.editsDisabled":"编辑已禁用 — 切换为本地配置以自定义此项目。","statusline.customizeLocally":"本地自定义","statusline.localCustom":"本地自定义配置","statusline.ownConfig":"此项目已有自己的配置。","statusline.followHint":"改为跟随全局模板 — 本地自定义配置将被替换(再次点击确认,5 秒内有效)","statusline.followConfirm":"确认跟随?","statusline.follow":"跟随全局","statusline.syncHint":"用全局模板覆盖本地自定义配置(再次点击确认,5 秒内有效)","statusline.syncConfirm":"确认覆盖?","statusline.sync":"从全局同步","statusline.alignLabel":"对齐","statusline.refresh":"刷新","statusline.refreshHint":"空闲时的刷新间隔(秒)","statusline.refreshNote":"空闲时定时刷新;交互后即时更新","statusline.powerlineStyle":"Powerline 样式","statusline.powerlineHint":"(实心背景块,图标合并)","statusline.glyphSeparator":"分隔符","statusline.glyphStartCap":"左端","statusline.glyphEndCap":"右端","statusline.nerdFontHint":"需要 Nerd Font 终端字体","statusline.logo":"徽标","statusline.logoHint":"文字固定、不可隐藏,仅颜色可调","statusline.separator":"分隔符","statusline.separatorHint":"(powerline 模式下忽略)","statusline.bar":"进度条","statusline.barCellsHint":"进度条格数(1-40)","statusline.fill":"填充","statusline.emptyChar":"空白","statusline.labelSep":"标签分隔","statusline.labelSepHint":"渲染在段标签与取值之间","statusline.labelInputHint":"取值之前的静态前缀","statusline.lines":"行","statusline.addRow":"+ 添加行","statusline.rowN":"第 {n} 行","statusline.blockCount":"{n} 块","statusline.removeRow":"删除行","statusline.emptyRowHint":"空行 — 点 + 添加块,或把胶囊拖进来","statusline.addBlockHint":"添加块(选择类型;已在其他行的类型会移动过来)","statusline.addBlock":"+ 块","statusline.capsuleTitle":"{name} — 点击编辑,拖动排序","statusline.capsuleTitleOff":"{name}(未启用)— 点击编辑,拖动排序","statusline.addBlockTitle":"添加块","statusline.closeEsc":"关闭 (Esc)","statusline.tagOtherRow":"已在第 {n} 行 — 点击移至本行","statusline.rowShort":"第{n}行","statusline.pickHint":"选择一个块类型加入本行;已在其他行的类型会整体移动过来。","statusline.enabled":"已启用","statusline.disabled":"未启用","statusline.bold":"加粗","statusline.mergeHint":"并入下一块的背景","statusline.merge":"合并","statusline.iconPlaceholder":"图标","statusline.iconHint":"可选的 emoji / 符号前缀","statusline.fieldStyle":"样式","statusline.fieldMetric":"计量","statusline.fieldWindow":"窗口","statusline.metric.session":"会话","statusline.metric.context":"上下文","statusline.metric.sessionTitle":"本会话累计 token","statusline.metric.contextTitle":"当前上下文窗口中的 token","statusline.fgBg":"前景 / 背景","statusline.fieldLabel":"标签","statusline.labelPlaceholder":"标签","statusline.fieldFormat":"格式","statusline.tokensTitle":"模板 token:{tokens}","statusline.unplaceHint":"把该块移出行(配置保留,可从 + 块再加回)","statusline.unplace":"从行中移除","statusline.done":"完成","statusline.noBackground":"无背景","statusline.moreColorsCurrent":"更多颜色 — 当前:{color}","statusline.moreColors":"更多颜色(256 / hex)","statusline.pickTruecolor":"选取 truecolor 值","statusline.colorPlaceholder":"#rrggbb 或 ansi256:N","statusline.ok":"确定","statusline.disableCap":"禁用该端盖","statusline.none":"无","statusline.glyph.triangleRight":"右向三角","statusline.glyph.triangleLeft":"左向三角","statusline.glyph.roundRight":"右向圆角","statusline.glyph.roundLeft":"左向圆角","statusline.glyph.triangle":"三角","statusline.glyph.round":"圆角","statusline.glyph.lowerTriangle":"下三角","statusline.glyph.diagonal":"斜角","statusline.barStyle.percent":"%","statusline.barStyle.bar":"条形","statusline.barStyle.both":"两者","seg.project":"项目","seg.git":"Git","seg.gitUser":"Git 身份","seg.changes":"变更","seg.model":"模型","seg.thinking":"思考","seg.context":"上下文","seg.tokens":"Token","seg.cost":"费用","seg.rate":"限额","seg.time":"时间","seg.version":"版本","seg.output_style":"输出风格","seg.session":"会话","seg.exceeds200k":"200k+","seg.fast_mode":"快速模式","seg.vim":"Vim","seg.pr":"PR","seg.worktree":"Worktree","seg.agent":"智能体","align.left":"左","align.center":"居中","align.right":"右","rateWin.fiveHour.label":"5h","rateWin.fiveHour.title":"5 小时限额","rateWin.sevenDay.label":"7d","rateWin.sevenDay.title":"7 天限额","rateWin.spend.label":"花费","rateWin.spend.title":"花费限额"},h9={"statusline.title":"Statusline","statusline.scopeGlobal":"Global template","statusline.scopeProject":"Project config","statusline.resetHint":"Overwrite the current global template with factory defaults (click again to confirm)","statusline.resetConfirm":"Reset to factory?","statusline.reset":"Factory reset","statusline.saved":"Saved ✓","statusline.retry":"Retry","statusline.saveFailed":"Save failed: {error}","statusline.emptyRow":"(empty row)","statusline.preview":" ← preview","statusline.barTitle":"Statusline","statusline.tuiBadge":"TUI","statusline.tuiHint":"This config is injected into the TUI statusline of the harness above; harnesses without that channel only show it in the conversation footer (and only the blocks weave has data for).","statusline.followingGlobal":"following global template","statusline.editsDisabled":"Edits are disabled — switch to a local config to customize this project.","statusline.customizeLocally":"Customize locally","statusline.localCustom":"local custom config","statusline.ownConfig":"This project has its own config.","statusline.followHint":"Switch to the global template — the local custom config will be replaced (click again to confirm, valid for 5 seconds)","statusline.followConfirm":"Follow global?","statusline.follow":"Follow global","statusline.syncHint":"Overwrite the local custom config with the global template (click again to confirm, valid for 5 seconds)","statusline.syncConfirm":"Overwrite?","statusline.sync":"Sync from global","statusline.alignLabel":"Align","statusline.refresh":"Refresh","statusline.refreshHint":"Refresh interval while idle (seconds)","statusline.refreshNote":"Refreshes on a timer while idle; updates immediately after interaction","statusline.powerlineStyle":"Powerline style","statusline.powerlineHint":"(solid background blocks, icons merge)","statusline.glyphSeparator":"Separator","statusline.glyphStartCap":"Start cap","statusline.glyphEndCap":"End cap","statusline.nerdFontHint":"Requires a Nerd Font terminal font","statusline.logo":"Logo","statusline.logoHint":"Text is fixed and cannot be hidden; only the colour can be changed","statusline.separator":"Separator","statusline.separatorHint":"(powerline ignores it)","statusline.bar":"Bar","statusline.barCellsHint":"Bar cells (1-40)","statusline.fill":"fill","statusline.emptyChar":"empty","statusline.labelSep":"Label sep","statusline.labelSepHint":"Rendered between a segment's label and its value","statusline.labelInputHint":"Static prefix before the value","statusline.lines":"Lines","statusline.addRow":"+ Add row","statusline.rowN":"row {n}","statusline.blockCount":"{n} block(s)","statusline.removeRow":"Remove row","statusline.emptyRowHint":"Empty row — click + to add a block, or drag a capsule in","statusline.addBlockHint":"Add a block (pick a type; a type already on another row moves here)","statusline.addBlock":"+ Block","statusline.capsuleTitle":"{name} — click to edit, drag to reorder","statusline.capsuleTitleOff":"{name} (disabled) — click to edit, drag to reorder","statusline.addBlockTitle":"Add block","statusline.closeEsc":"Close (Esc)","statusline.tagOtherRow":"Already on row {n} — click to move here","statusline.rowShort":"row{n}","statusline.pickHint":"Pick a block type to add to this row; a type already on another row moves over as a whole.","statusline.enabled":"Enabled","statusline.disabled":"Disabled","statusline.bold":"Bold","statusline.mergeHint":"Merge into the next block's background","statusline.merge":"merge","statusline.iconPlaceholder":"icon","statusline.iconHint":"Optional emoji / symbol prefix","statusline.fieldStyle":"Style","statusline.fieldMetric":"Metric","statusline.fieldWindow":"Window","statusline.metric.session":"session","statusline.metric.context":"context","statusline.metric.sessionTitle":"Cumulative tokens for the session","statusline.metric.contextTitle":"Tokens currently in the context window","statusline.fgBg":"fg / bg","statusline.fieldLabel":"label","statusline.labelPlaceholder":"Label","statusline.fieldFormat":"format","statusline.tokensTitle":"Template tokens: {tokens}","statusline.unplaceHint":"Take this block out of its row (config is kept; re-add it from the + block button)","statusline.unplace":"Remove from row","statusline.done":"Done","statusline.noBackground":"No background","statusline.moreColorsCurrent":"More colours — current: {color}","statusline.moreColors":"More colours (256 / hex)","statusline.pickTruecolor":"Pick a truecolor value","statusline.colorPlaceholder":"#rrggbb or ansi256:N","statusline.ok":"OK","statusline.disableCap":"Disable this cap","statusline.none":"None","statusline.glyph.triangleRight":"Triangle Right","statusline.glyph.triangleLeft":"Triangle Left","statusline.glyph.roundRight":"Round Right","statusline.glyph.roundLeft":"Round Left","statusline.glyph.triangle":"Triangle","statusline.glyph.round":"Round","statusline.glyph.lowerTriangle":"Lower Triangle","statusline.glyph.diagonal":"Diagonal","statusline.barStyle.percent":"%","statusline.barStyle.bar":"bar","statusline.barStyle.both":"both","seg.project":"Project","seg.git":"Git","seg.gitUser":"Git Identity","seg.changes":"Changes","seg.model":"Model","seg.thinking":"Thinking","seg.context":"Context","seg.tokens":"Tokens","seg.cost":"Cost","seg.rate":"Rate","seg.time":"Time","seg.version":"Version","seg.output_style":"Output Style","seg.session":"Session","seg.exceeds200k":"200k+","seg.fast_mode":"Fast Mode","seg.vim":"Vim","seg.pr":"PR","seg.worktree":"Worktree","seg.agent":"Agent","align.left":"Left","align.center":"Center","align.right":"Right","rateWin.fiveHour.label":"5h","rateWin.fiveHour.title":"5-hour limit","rateWin.sevenDay.label":"7d","rateWin.sevenDay.title":"7-day limit","rateWin.spend.label":"spend","rateWin.spend.title":"Spend limit"},p9={"picker.title":"选择资源目录","picker.subtitle":"勾选一个或多个文件夹(点击箭头展开目录)","picker.quickAccess":"快速访问","picker.home":"主目录","picker.desktop":"桌面","picker.downloads":"下载","picker.documents":"文档","picker.libraryParent":"资源位置","picker.drive":"磁盘","picker.root":"根目录","picker.alreadyAdded":"已添加","picker.anchorTip":"资源位置是市场副本所在目录,其中的资源已在列表中,不能再作为来源导入","picker.selectFolder":"选择此文件夹","picker.unselect":"取消选择","picker.noneSelected":"尚未选择任何文件夹","picker.clickRemove":"点击移除","picker.selectedCount":"已选 {count} 项","picker.add":"添加","picker.addCount":"添加({count})","picker.pathPlaceholder":"完整路径:勾选文件夹后显示在此,也可粘贴一个路径","picker.addPathTip":"把这一路径加入选择","category.tabAllTip":"展示全部工具的资产","category.tabToolTip":"仅展示 {tool} 生效的资产","category.tabAll":"全部","category.emptySkillsGlobalCodex":"未安装 Codex 生效的全局 skills","category.emptySkillsProjectCodex":"该项目 .codex/skills/ 下暂无 skills","category.emptySkillsGlobal":"未安装全局 skills","category.emptySkillsProject":"该项目未安装 skills","category.emptyMcpCodex":"未配置 Codex MCP(~/.codex/config.toml)","category.emptyMcpGlobal":"未配置全局 MCP","category.emptyMcpProject":"该项目未配置 MCP","category.codexFilesPlaceholder":"该项目暂无 Codex 资源","category.emptyFilesOtherHarness":"该项目暂无 {harness} 资源","category.emptyFilesProject":"该项目暂无资源","category.globalFilesTitle":"全局资源","category.emptyFilesGlobalDesc":"~/.claude 与 ~/.codex 下暂无匹配的资源","category.personalizationGlobal":"全局 Claude 个性化配置(模板)","category.personalizationProject":"Claude Code 个性化配置","category.statuslineSource":"statusline:{source}","category.statuslineCustom":"项目自定义","category.statuslineFollowGlobal":"跟随全局模板","category.codexPersonalizationPlaceholder":"Codex 没有个性化配置的等价项。","category.personalizationUnsupported":"{harness} 没有等价的个性化配置","category.dropToInstall":"拖放以安装 skill","library.heading":"资源市场","library.expandAllTip":"展开全部分组与区块","library.collapseAllTip":"折叠全部分组与区块","library.expandAll":"全展开","library.collapseAll":"全折叠","library.installTo":"安装到","library.scopeGlobal":"全局","library.scopeProject":"项目","library.followsSelection":"跟随当前选择","library.addFoldersTip":"选择一个或多个文件夹导入资源市场","library.addFolders":"导入本地目录(可多选)","library.gitPlaceholder":"Git URL(https:// 或 git@…)","library.importGit":"导入","library.importGitTip":"克隆 git 仓库进资源市场(仅 https/ssh)","library.importGitOk":"已导入:{name}","library.importFailed":"导入失败:{error}","library.importDirOk":"已导入 {n} 个目录","library.importDirFail":"导入失败:{path}:{error}","library.badgeGit":"Git","library.badgeDir":"本地目录","library.badgeExternal":"外部源","library.marketSectionBuiltin":"内置","library.tagInstalled":"已装 {done} / {total}","library.marketSectionLocal":"本地","library.marketSectionGit":"Git","library.migrate":"迁入市场","library.migrateTip":"复制进资源市场(源目录保留)","library.migrating":"迁入中…","library.migratedOk":"已迁入市场:{name}","library.migrateFailed":"迁入失败:{error}","library.importedAt":"{date} 导入","library.removeMarketTip":"移除市场:删除副本并卸载该市场的插件","library.removeMarketTitle":"移除市场","library.removeMarketConfirm":"移除市场「{name}」?会删除市场副本并卸载从该市场安装的插件(连同插件数据);已安装的 skills 等保留。","library.removeLegacyTip":"从清单移除(外部目录保留)","library.removedOk":"已移除:{name}","library.removeFailed":"移除失败:{error}","library.removeDeregWarn":"市场副本已删,但注销市场未成功:{error}","library.noTemplates":"「{name}」分类暂无外部可安装模板。","library.noTemplatesHint":"切换到 Skills / MCP tab 查看可安装内容。","library.catPersonalization":"个性化配置","library.sectionSkills":"Skill 模板","library.sectionFiles":"文件模板","library.sectionMcp":"MCP 模板","library.sectionUpdates":"更新提示","library.hintDragInstall":"拖放安装","library.hintClickInstall":"点击安装","library.hintClickAdd":"点击添加","library.hintOverwrite":"会覆盖本地修改","library.scanning":"扫描中…","library.addLibrarySkills":"在上方导入资源以浏览 skills。","library.noSkillsFound":"未发现 skills。","library.checkUpdates":"批量检查更新","library.checking":"检查中…","library.checkUpdatesTip":"检查来源目录 / Git 远端有无更新","library.checkDone":"检查完成:{n} 项可更新","library.checkFailed":"检查更新失败:{error}","library.refreshUpdates":"一键更新","library.refreshUpdatesTip":"更新已安装的副本(CC 插件会自动重装)","library.refreshDone":"一键更新完成:{n} 项","library.refreshFailed":"一键更新失败:{error}","library.statusUptodate":"最新","library.statusUpdateAvailable":"有更新","library.statusOriginMissing":"源缺失","library.statusUnknown":"检查失败","library.sectionPlugins":"插件包","library.addLibraryPlugins":"在上方导入资源以浏览插件包。","library.noPlugins":"该库未发现插件包。","library.badgeCcPlugin":"CC 插件","library.badgeWeavePlugin":"Weave 规则包","library.ccPluginTip":"CC 原生插件:全局安装、项目启用","library.weavePluginTip":"Weave 规则包:项目级开关","library.pluginSkillsLabel":"包内 skills · 随插件启停","library.pluginSkillsFollowTip":"隶属该插件,不单独安装——随插件启用/停用","library.pluginNotInToolkit":"来源不在内置或市场导入中——无法在此安装","library.pluginsSectionHint":"「安装」= CC 插件装到全局并在当前项目启用,weave 规则包直接启用。启停与卸载在 资源管理 ▸ Plugins","library.installPackTip":"安装:CC 插件装到全局并在当前项目启用;weave 规则包直接启用","library.packInstalled":"已安装并启用:{name}","library.installing":"安装中…","library.installedManageTip":"已安装——启停与卸载在 资源管理 ▸ Plugins","library.pluginSourceDir":"来源目录","library.addLibraryTemplates":"在上方导入资源以浏览模板。","library.noFileTemplates":"资源中未发现文件模板。","library.noMcpTemplates":"未发现 MCP 模板。","library.rootName":"资源根目录","library.localBadge":"本地","library.install":"安装","library.installed":"已安装","library.installedOk":"已安装:{name}","library.update":"更新","library.updatedOk":"已更新:{name}","library.installTarget":"安装目标","library.tipSkillsClaude":"安装到 .claude/skills/","library.tipSkillsCodex":"安装到 .codex/skills/(全局则为 ~/.codex/skills/)","library.tipMcpClaude":"安装到 .mcp.json / ~/.claude.json","library.tipMcpCodex":"写入 ~/.codex/config.toml(全局)","library.addMcpServer":"添加 MCP Server","library.mcpNamePlaceholder":"名称","library.mcpCommandPlaceholder":"命令(如 npx)","library.mcpArgsPlaceholder":"参数(空格分隔)","library.mcpEnvPlaceholder":"环境变量(每行 KEY=value)","capability.reason.projectOnly":"该资源仅支持项目安装","capability.reason.globalOnly":"该资源仅支持全局安装","capability.reason.claudeOnly":"该资源不支持 Codex","capability.reason.codexOnly":"该资源不支持 Claude","capability.reason.harnessUnsupported":"该资源不支持此 harness"},m9={"picker.title":"Choose resource folder","picker.subtitle":"Check one or more folders (click the arrow to expand a directory)","picker.quickAccess":"Quick access","picker.home":"Home","picker.desktop":"Desktop","picker.downloads":"Downloads","picker.documents":"Documents","picker.libraryParent":"Resource location","picker.drive":"Drive","picker.root":"Root","picker.alreadyAdded":"Added","picker.anchorTip":"Resource location holds the market copies — its resources are already listed and cannot be imported again","picker.selectFolder":"Select this folder","picker.unselect":"Deselect","picker.noneSelected":"No folders selected yet","picker.clickRemove":"Click to remove","picker.selectedCount":"{count} selected","picker.add":"Add","picker.addCount":"Add ({count})","picker.pathPlaceholder":"Full path: shown here after checking a folder, or paste one","picker.addPathTip":"Add this path to the selection","category.tabAllTip":"Show assets from every tool","category.tabToolTip":"Show only assets effective for {tool}","category.tabAll":"All","category.emptySkillsGlobalCodex":"No global skills effective for Codex installed","category.emptySkillsProjectCodex":"No skills under .codex/skills/ in this project","category.emptySkillsGlobal":"No global skills installed","category.emptySkillsProject":"No skills installed in this project","category.emptyMcpCodex":"No Codex MCP configured (~/.codex/config.toml)","category.emptyMcpGlobal":"No global MCP configured","category.emptyMcpProject":"No MCP configured in this project","category.codexFilesPlaceholder":"This project has no Codex resources yet","category.emptyFilesOtherHarness":"This project has no {harness} resources yet","category.emptyFilesProject":"This project has no resources yet","category.globalFilesTitle":"Global resources","category.emptyFilesGlobalDesc":"No matching resources under ~/.claude and ~/.codex","category.personalizationGlobal":"Global Claude personalization config (templates)","category.personalizationProject":"Claude Code personalization config","category.statuslineSource":"statusline: {source}","category.statuslineCustom":"Project custom","category.statuslineFollowGlobal":"Follows global template","category.codexPersonalizationPlaceholder":"Codex has no personalization counterpart.","category.personalizationUnsupported":"{harness} has no equivalent personalization","category.dropToInstall":"Drop to install skill","library.heading":"Resource Market","library.expandAllTip":"Expand all groups and sections","library.collapseAllTip":"Collapse all groups and sections","library.expandAll":"Expand all","library.collapseAll":"Collapse all","library.installTo":"Install to","library.scopeGlobal":"Global","library.scopeProject":"Project","library.followsSelection":"Follows current selection","library.addFoldersTip":"Pick one or more folders to import into the resource market","library.addFolders":"Import local folders (multi-select)","library.gitPlaceholder":"Git URL (https:// or git@…)","library.importGit":"Import","library.importGitTip":"Clone a git repo into the resource market (https/ssh only)","library.importGitOk":"Imported: {name}","library.importFailed":"Import failed: {error}","library.importDirOk":"Imported {n} folder(s)","library.importDirFail":"Import failed: {path}: {error}","library.badgeGit":"Git","library.badgeDir":"Local dir","library.badgeExternal":"External","library.marketSectionBuiltin":"Builtin","library.tagInstalled":"{done} / {total} installed","library.marketSectionLocal":"Local","library.marketSectionGit":"Git","library.migrate":"Move into market","library.migrateTip":"Copy into the resource market (source kept)","library.migrating":"Moving…","library.migratedOk":"Moved into market: {name}","library.migrateFailed":"Move failed: {error}","library.importedAt":"imported {date}","library.removeMarketTip":"Remove the market: delete the copy and uninstall its plugins","library.removeMarketTitle":"Remove market","library.removeMarketConfirm":'Remove market "{name}"? The copy is deleted and plugins installed from it are uninstalled (including their data); installed skills are kept.',"library.removeLegacyTip":"Remove from the registry (external folder kept)","library.removedOk":"Removed: {name}","library.removeFailed":"Remove failed: {error}","library.removeDeregWarn":"Market copy removed, but deregistering it failed: {error}","library.noTemplates":'The "{name}" category has no externally installable templates.',"library.noTemplatesHint":"Switch to the Skills / MCP tab to view installable content.","library.catPersonalization":"Personalization","library.sectionSkills":"Skill templates","library.sectionFiles":"File templates","library.sectionMcp":"MCP templates","library.sectionUpdates":"Update hints","library.hintDragInstall":"Drag to install","library.hintClickInstall":"Click to install","library.hintClickAdd":"Click to add","library.hintOverwrite":"Overwrites local changes","library.scanning":"Scanning…","library.addLibrarySkills":"Import a resource above to browse skills.","library.noSkillsFound":"No skills found.","library.checkUpdates":"Check for updates","library.checking":"Checking…","library.checkUpdatesTip":"Check the source folder / git remote for updates","library.checkDone":"Check complete: {n} update(s) available","library.checkFailed":"Update check failed: {error}","library.refreshUpdates":"Update all","library.refreshUpdatesTip":"Refresh installed copies (CC plugins are reinstalled automatically)","library.refreshDone":"Update all finished: {n} item(s)","library.refreshFailed":"Update all failed: {error}","library.statusUptodate":"Up to date","library.statusUpdateAvailable":"Update","library.statusOriginMissing":"Source missing","library.statusUnknown":"Unknown","library.sectionPlugins":"Plugin packs","library.addLibraryPlugins":"Import a resource above to browse plugin packs.","library.noPlugins":"No plugin packs found in this library.","library.badgeCcPlugin":"CC plugin","library.badgeWeavePlugin":"Weave pack","library.ccPluginTip":"CC native plugin: installed globally, enabled per project","library.weavePluginTip":"Weave pack: toggled per project","library.pluginSkillsLabel":"Pack skills · follow plugin enablement","library.pluginSkillsFollowTip":"Belongs to this plugin — not installed separately; enabled/disabled with it","library.pluginNotInToolkit":"Source is neither builtin nor imported into the market — cannot install here","library.pluginsSectionHint":'"Install" adds CC plugins globally and enables them in this project; Weave packs are enabled directly. Manage enable/uninstall in Resource Management ▸ Plugins',"library.installPackTip":"Install: CC plugins go global and enable in this project; Weave packs are enabled directly","library.packInstalled":"Installed and enabled: {name}","library.installing":"Installing…","library.installedManageTip":"Installed — enable/disable and uninstall in Resource Management ▸ Plugins","library.pluginSourceDir":"Source path","library.addLibraryTemplates":"Import a resource above to browse templates.","library.noFileTemplates":"No file templates found in this resource.","library.noMcpTemplates":"No MCP templates found.","library.rootName":"resource root","library.localBadge":"Local","library.install":"install","library.installed":"installed","library.installedOk":"Installed: {name}","library.update":"update","library.updatedOk":"Updated: {name}","library.installTarget":"Install target","library.tipSkillsClaude":"Install to .claude/skills/","library.tipSkillsCodex":"Install to .codex/skills/ (global scope uses ~/.codex/skills/)","library.tipMcpClaude":"Install to .mcp.json / ~/.claude.json","library.tipMcpCodex":"Writes ~/.codex/config.toml (global)","library.addMcpServer":"Add MCP Server","library.mcpNamePlaceholder":"name","library.mcpCommandPlaceholder":"command (e.g. npx)","library.mcpArgsPlaceholder":"args (space-separated)","library.mcpEnvPlaceholder":"env (KEY=value per line)","capability.reason.projectOnly":"This resource only installs into a project","capability.reason.globalOnly":"This resource only installs globally","capability.reason.claudeOnly":"This resource does not support Codex","capability.reason.codexOnly":"This resource does not support Claude","capability.reason.harnessUnsupported":"This resource does not support this harness"},g9={"skillGrid.projectHeading":"项目 Skills","skillGrid.globalHeading":"全局 Skills","skillGrid.readOnly":"只读","skillGrid.globalTag":"全局","skillGrid.update":"待更新","skillGrid.custom":"自定义","skillGrid.openDetail":"打开 {name} 详情","skillGrid.uninstall":"卸载 {name}","skillGrid.uninstalled":"已卸载:{name}","skillGrid.uninstallGlobalTitle":"卸载全局技能","skillGrid.uninstallGlobalConfirm":"从全局技能位删除「{name}」?链接只移除链接本身,副本将递归删除。","skillGrid.uninstallPackTitle":"卸载插件包","skillGrid.uninstallPackConfirm":"从 Claude Code 卸载插件包「{key}」?市场副本保留,可随时重装。","skillGrid.packUninstalled":"已卸载插件包:{label}","skillGrid.effective":"已生效:{done} / {total}","skillGrid.effNone":"没有可统计的 skill","skillGrid.effAll":"{n} 个 skill 全部生效","skillGrid.effDisabled":"{n} 个 skill 因所属插件被禁用而未生效","skillGrid.expandAllGroups":"展开全部分组","skillGrid.collapseAllGroups":"折叠全部分组","skillGrid.expandAll":"全部展开","skillGrid.collapseAll":"全部折叠","skillGrid.plugin":"插件","skillGrid.enableDefault":"默认","skillGrid.enableOn":"启用","skillGrid.enableOff":"禁用","skillGrid.scopeUser":"全局","skillGrid.scopeProject":"项目","skillGrid.scopeLocal":"仅本人","skillGrid.enableTip":"{scope}:{state}——点击切换","skillGrid.keyTip":"插件所属市场","repo.local":"本地","repo.namespaceTip":"该市场下的全部插件","repo.packCount":"{n} 个包","repo.enabledCount":"已启 {done} / {total}","repo.formLink":"链接","repo.formCopy":"副本","repo.formLegend":"链接 / 副本","repo.formTip":"「链接」= 生效内容即源文件;「副本」= 建立链接失败后改用的复制。若环境禁用了链接创建,可在「设置 ▸ 系统 ▸ 开发者选项」启用开发者模式后重装","fileTree.all":"全部","fileTree.scopeGlobal":"全局","fileTree.scopeProject":"项目","fileTree.title":"资源管理","fileTree.pathsProject":"{dirs} · 根目录","fileTree.expandAllDirs":"展开全部目录","fileTree.collapseAllDirs":"折叠全部目录","fileTree.expandAll":"全展开","fileTree.collapseAll":"全折叠","fileTree.emptyFiltered":"没有匹配当前筛选的文件","fileTree.symlinkTitle":"{path} — 符号链接","fileTree.uninstall":"卸载 {name}","fileTree.uninstalled":"已卸载:{name}","fileTree.update":"待更新","fileTree.custom":"自定义","assetView.packs":"Plugins","assetView.files":"Files","category.externalAssets":"外部资源","category.externalAssetsNote":"不在任何插件包内","category.externalAssetsSummary":"技能 {skills} · MCP {mcp}","mcp.headingGlobal":"全局 MCP Servers","mcp.headingProject":"项目 MCP Servers","mcp.update":"待更新","mcp.remove":"移除 {name}","mcp.uninstalled":"已卸载:{name}","mcp.enableDefault":"默认","mcp.enableOn":"启用","mcp.enableOff":"禁用","mcp.enableTip":"{state} — 点击切换","mcp.enableFailed":"MCP 启用状态切换失败:{error}","catbar.files":"资源管理","catbar.personalization":"个性化配置","catbar.updateBadge":"{n} 待更新","catbar.custom":"自定义","catbar.followGlobal":"跟随全局","catbar.items":"{n} 项","task.heading":"任务({events} 条事件,{sessions} 个会话)","task.expandAll":"全部展开","task.collapseAll":"全部折叠","task.empty":"暂无 hook 事件","task.events":"{n} 条事件","task.noPayload":"无 payload 详情","task.copySessionId":"复制会话 ID","task.copied":"已复制","task.pendingTitle":"待生效","fm.title":"Frontmatter"},b9={"skillGrid.projectHeading":"Project Skills","skillGrid.globalHeading":"Global Skills","skillGrid.readOnly":"Read-only","skillGrid.globalTag":"Global","skillGrid.update":"update","skillGrid.custom":"custom","skillGrid.openDetail":"Open {name} detail","skillGrid.uninstall":"Uninstall {name}","skillGrid.uninstalled":"Uninstalled: {name}","skillGrid.uninstallGlobalTitle":"Uninstall global skill","skillGrid.uninstallGlobalConfirm":'Remove "{name}" from the global skills location? A link only removes the link itself; a copy is deleted recursively.',"skillGrid.uninstallPackTitle":"Uninstall plugin pack","skillGrid.uninstallPackConfirm":'Uninstall plugin pack "{key}" from Claude Code? The market copy is kept and it can be reinstalled anytime.',"skillGrid.packUninstalled":"Plugin pack uninstalled: {label}","skillGrid.effective":"In effect: {done} / {total}","skillGrid.effNone":"No skills to count","skillGrid.effAll":"All {n} skills in effect","skillGrid.effDisabled":"{n} skills not in effect because their plugin is disabled","skillGrid.expandAllGroups":"Expand all groups","skillGrid.collapseAllGroups":"Collapse all groups","skillGrid.expandAll":"Expand all","skillGrid.collapseAll":"Collapse all","skillGrid.plugin":"Plugin","skillGrid.enableDefault":"Default","skillGrid.enableOn":"Enabled","skillGrid.enableOff":"Disabled","skillGrid.scopeUser":"Global","skillGrid.scopeProject":"Project","skillGrid.scopeLocal":"Local only","skillGrid.enableTip":"{scope}: {state} — click to cycle","skillGrid.keyTip":"Plugin marketplace","repo.local":"Local","repo.namespaceTip":"Every plugin from this marketplace","repo.packCount":"{n} packs","repo.enabledCount":"{done} / {total} enabled","repo.formLink":"linked","repo.formCopy":"copied","repo.formLegend":"linked / copied","repo.formTip":"Linked = the source files are what takes effect; copied = creating a link failed and weave fell back to copying. If link creation is disabled in your environment, enable Developer Mode under Settings ▸ System ▸ For developers and reinstall","fileTree.all":"All","fileTree.scopeGlobal":"Global","fileTree.scopeProject":"Project","fileTree.title":"Resource Management","fileTree.pathsProject":"{dirs} · root dir","fileTree.expandAllDirs":"Expand all folders","fileTree.collapseAllDirs":"Collapse all folders","fileTree.expandAll":"Expand all","fileTree.collapseAll":"Collapse all","fileTree.emptyFiltered":"No files match the current filter","fileTree.symlinkTitle":"{path} — symlink","fileTree.uninstall":"Uninstall {name}","fileTree.uninstalled":"Uninstalled: {name}","fileTree.update":"update","fileTree.custom":"custom","assetView.packs":"Plugins","assetView.files":"Files","category.externalAssets":"External","category.externalAssetsNote":"not part of any plugin pack","category.externalAssetsSummary":"skills {skills} · MCP {mcp}","mcp.headingGlobal":"Global MCP Servers","mcp.headingProject":"Project MCP Servers","mcp.update":"update","mcp.remove":"Remove {name}","mcp.uninstalled":"Uninstalled: {name}","mcp.enableDefault":"Default","mcp.enableOn":"Enabled","mcp.enableOff":"Disabled","mcp.enableTip":"{state} — click to cycle","mcp.enableFailed":"MCP enable state toggle failed: {error}","catbar.files":"Resource Management","catbar.personalization":"Personalization","catbar.updateBadge":"{n} update","catbar.custom":"Custom","catbar.followGlobal":"Follow global","catbar.items":"{n} items","task.heading":"Tasks ({events} events, {sessions} sessions)","task.expandAll":"Expand all","task.collapseAll":"Collapse all","task.empty":"No hook events yet","task.events":"{n} events","task.noPayload":"No payload details","task.copySessionId":"Copy session ID","task.copied":"Copied","task.pendingTitle":"Pending","fm.title":"Frontmatter"},x9={"catbar.hooks":"Weave","hooks.title":"Weave 规则与数据流","hooks.flowTitle":"数据流画布","hooks.mindmap.pickSession":"会话","hooks.mindmap.hint":"每次 prompt 一个折叠根 · 展开看 hook / subagent / 指令子节点","hooks.mindmap.empty":"该会话暂无 hook 事件","hooks.mindmap.preSession":"会话引导","hooks.mindmap.openTag":"未正常结束","hooks.mindmap.runningTag":"执行中","hooks.mindmap.subagentCount":"subagent ×{n}","hooks.mindmap.agentDispatched":"子代理 ×{n}","hooks.mindmap.notifyTag":"子代理返回","hooks.mindmap.compactTag":"压缩会话","hooks.mindmap.agentRunning":"执行中","hooks.mindmap.agentPending":"已派发,等待子代理返回","hooks.mindmap.dispatchTag":"指令","hooks.mindmap.dispatchCount":"指令 ×{n}","hooks.mindmap.toolCluster":"工具调用","hooks.mindmap.pendingTip":"链路上存在待处理指令","hooks.mindmap.detailTitle":"节点明细","hooks.mindmap.closeDetail":"关闭明细","hooks.colSource":"事件源","hooks.colRule":"规则","hooks.colHandler":"处理器","hooks.emptyFlow":"还没有任何规则,链路图为空","hooks.emptyFlowDisabled":"没有已启用的规则,链路图为空","hooks.loading":"加载中…","hooks.loadFailed":"加载失败:{error}","hooks.actionFailed":"操作失败:{error}","hooks.pluginsAndRules":"插件与规则","hooks.localRules":"本地规则","hooks.newRule":"新建规则","hooks.rulesEmpty":"还没有规则,点击「新建规则」创建第一条。","hooks.thName":"名称","hooks.thEvent":"事件","hooks.thFilter":"过滤","hooks.thHandler":"处理器","hooks.thActions":"操作","hooks.filterNone":"无过滤","hooks.filterToolTip":"工具名:{names}","hooks.filterPathTip":"路径:{paths}","hooks.filterCrossTip":"仅跨项目命中时触发","hooks.scopeGlobal":"全局","hooks.scopeProjectName":"项目:{name}","hooks.scopeProjectId":"项目 #{id}","hooks.edit":"编辑","hooks.delete":"删除","hooks.confirmDelete":"确认删除?","hooks.toggleTip":"启用或停用「{name}」","hooks.form.createTitle":"新建规则","hooks.form.editTitle":"编辑规则","hooks.quickTemplate":"文档更新检查(一键模板)","hooks.quickTemplateTip":"填充一个 PostToolUse + *.md 的注入规则示例(默认停用)","hooks.quickTemplateName":"文档更新检查","hooks.quickTemplatePrompt":"请检查本次改动涉及的文档({file} 等)是否需要同步更新;如有过期内容请直接修改相关 Markdown 文档。","hooks.field.name":"名称","hooks.namePlaceholder":"如:文档更新检查","hooks.field.project":"生效范围","hooks.projectGlobal":"全局(所有项目)","hooks.field.event":"触发事件","hooks.eventInjectHint":"inject 处理器仅支持这些事件:{events}","hooks.field.sourceKind":"规则来源","hooks.sourceKind.hookEvent":"事件规则","hooks.sourceKind.legacy":"兼容旧版","hooks.field.harness":"目标 harness","hooks.harness.any":"任意(any)","hooks.field.handler":"处理器","hooks.handler.log":"仅记录","hooks.handler.webhook":"Webhook 转发","hooks.handler.inject":"注入会话","hooks.handler.manual":"手动指令","hooks.handler.plugin":"插件处理器","hooks.handlerLogTip":"只记录事件,不生成指令","hooks.handlerWebhookTip":"将事件摘要发送到外部地址","hooks.handlerInjectTip":"渲染指令并同步注入当前会话","hooks.handlerManualTip":"渲染为指令节点,等待复制或拖到会话执行","hooks.handlerPluginTip":"执行插件自带的处理器","hooks.field.toolNames":"工具名过滤","hooks.toolNamesPlaceholder":"逗号分隔,如 Read, Edit, Bash","hooks.field.pathGlobs":"路径 glob 过滤","hooks.pathGlobsPlaceholder":"逗号分隔,如 **/*.md, docs/**","hooks.field.crossProjectOnly":"仅跨项目命中时触发","hooks.field.template":"指令模板","hooks.templatePlaceholder":"支持占位符:{event} {tool} {file} {cwd} {session} {project} {rule}","hooks.field.url":"回调 URL","hooks.urlPlaceholder":"https://example.com/hook","hooks.field.secret":"签名密钥(可选)","hooks.field.pluginId":"插件 ID","hooks.pluginIdPlaceholder":"如 changelog-reminder","hooks.field.pluginHandlerType":"handlerType","hooks.pluginHandlerPlaceholder":"如 notify","hooks.field.record":"记录为指令","hooks.field.enabled":"启用","hooks.save":"保存","hooks.cancel":"取消","hooks.errNameRequired":"请填写规则名称","hooks.errTemplateRequired":"请填写指令模板","hooks.errUrlRequired":"请填写合法的回调 URL","hooks.errPluginRequired":"请填写 pluginId 与 handlerType","hooks.status.pending":"待执行","hooks.status.injected":"已注入","hooks.status.running":"运行中","hooks.status.succeeded":"成功","hooks.status.failed":"失败","hooks.status.timeout":"超时","hooks.runConfirm":"将指令 #{id} 执行到会话「{session}」?","hooks.runConfirmYes":"确认执行","hooks.plugins.hint":"放入约定目录即自动识别 · 见 docs/PLUGIN-SPEC.md","hooks.plugins.projectHint":"本项目启用状态(未单独设置则跟随全局)· 安装 / 卸载在全局侧操作","hooks.plugins.followGlobal":"跟随全局","hooks.plugins.projectOverride":"已单独设置","hooks.plugins.empty":"暂无插件——从内置仓或资源市场安装","hooks.plugins.rules":"{n} 条规则","hooks.plugins.toggleTip":"启停该插件的全部规则(各项目可单独覆盖)","hooks.plugins.rejectedTip":"插件校验失败,修复后热重载自动恢复","hooks.plugins.hotReload":"插件文件变更后 1 秒内热重载生效","hooks.plugins.rescan":"重新扫描","hooks.plugins.rescanTip":"重新扫描插件目录(守护进程启动后才出现的目录由此纳入)","hooks.plugins.rescanOk":"插件根已重新扫描(当前 {n} 个插件)","hooks.plugins.rescanFail":"重新扫描失败:{error}","hooks.plugins.expand":"展开该插件的规则","hooks.plugins.collapse":"折叠该插件的规则","hooks.plugins.uninstallTip":"卸载插件(删除目录)","hooks.plugins.uninstallTitle":"卸载插件","hooks.plugins.uninstallConfirm":"卸载插件 {id}?其规则将被级联移除。","hooks.plugins.toggleFail":"插件开关失败:{error}","hooks.plugins.uninstallOk":"已卸载:{id}","hooks.plugins.uninstallFail":"卸载失败:{error}","hooks.capture.title":"事件采集(user 档)","hooks.capture.hint":"跨项目采集全部会话事件","hooks.capture.note":"安装即启用;项目档已有的采集组会被自动清理,不会重复采集","hooks.capture.toggleTip":"安装 / 停用 user 档事件采集","hooks.capture.onOk":"user 档采集已安装","hooks.capture.offOk":"user 档采集已停用","hooks.capture.fail":"采集开关失败:{error}","hooks.capture.half":"半安装","hooks.capture.halfTip":"采集组已写但 helper 脚本缺失——关掉再打开即可修复"},y9={"catbar.hooks":"Weave","hooks.title":"Weave rules & data flow","hooks.flowTitle":"Data flow canvas","hooks.mindmap.pickSession":"Session","hooks.mindmap.hint":"One collapsible root per prompt · expand for hook / subagent / dispatch children","hooks.mindmap.empty":"No hook events in this session","hooks.mindmap.preSession":"Session intro","hooks.mindmap.openTag":"Interrupted","hooks.mindmap.runningTag":"Running","hooks.mindmap.subagentCount":"subagent ×{n}","hooks.mindmap.agentDispatched":"Agents ×{n}","hooks.mindmap.notifyTag":"Agent returned","hooks.mindmap.compactTag":"Compacted","hooks.mindmap.agentRunning":"Running","hooks.mindmap.agentPending":"Dispatched — awaiting the subagent","hooks.mindmap.dispatchTag":"Dispatch","hooks.mindmap.dispatchCount":"Dispatch ×{n}","hooks.mindmap.toolCluster":"Tool calls","hooks.mindmap.pendingTip":"A pending dispatch sits on this path","hooks.mindmap.detailTitle":"Node details","hooks.mindmap.closeDetail":"Close details","hooks.colSource":"Sources","hooks.colRule":"Rules","hooks.colHandler":"Handlers","hooks.emptyFlow":"No rules yet — the flow graph is empty","hooks.emptyFlowDisabled":"No enabled rules — the flow graph is empty","hooks.loading":"Loading…","hooks.loadFailed":"Failed to load: {error}","hooks.actionFailed":"Action failed: {error}","hooks.pluginsAndRules":"Plugins & rules","hooks.localRules":"Local rules","hooks.newRule":"New rule","hooks.rulesEmpty":'No rules yet — click "New rule" to create the first one.',"hooks.thName":"Name","hooks.thEvent":"Event","hooks.thFilter":"Filter","hooks.thHandler":"Handler","hooks.thActions":"Actions","hooks.filterNone":"No filter","hooks.filterToolTip":"Tool names: {names}","hooks.filterPathTip":"Paths: {paths}","hooks.filterCrossTip":"Only fires on cross-project matches","hooks.scopeGlobal":"Global","hooks.scopeProjectName":"Project: {name}","hooks.scopeProjectId":"Project #{id}","hooks.edit":"Edit","hooks.delete":"Delete","hooks.confirmDelete":"Confirm delete?","hooks.toggleTip":'Enable or disable "{name}"',"hooks.form.createTitle":"New rule","hooks.form.editTitle":"Edit rule","hooks.quickTemplate":"Docs update check (quick template)","hooks.quickTemplateTip":"Fills an example PostToolUse + *.md inject rule (disabled by default)","hooks.quickTemplateName":"Docs update check","hooks.quickTemplatePrompt":"Check whether docs touched by this change (e.g. {file}) need syncing; edit any stale Markdown docs directly.","hooks.field.name":"Name","hooks.namePlaceholder":"e.g. Docs update check","hooks.field.project":"Scope","hooks.projectGlobal":"Global (all projects)","hooks.field.event":"Trigger event","hooks.eventInjectHint":"The inject handler only supports these events: {events}","hooks.field.sourceKind":"Rule source","hooks.sourceKind.hookEvent":"Event rule","hooks.sourceKind.legacy":"Legacy","hooks.field.harness":"Target harness","hooks.harness.any":"Any","hooks.field.handler":"Handler","hooks.handler.log":"Log only","hooks.handler.webhook":"Webhook","hooks.handler.inject":"Inject into session","hooks.handler.manual":"Manual prompt","hooks.handler.plugin":"Plugin handler","hooks.handlerLogTip":"Records the event only; no prompt generated","hooks.handlerWebhookTip":"Sends an event summary to an external URL","hooks.handlerInjectTip":"Renders the prompt and injects it into the current session","hooks.handlerManualTip":"Renders the prompt as a node to copy or drag onto a session","hooks.handlerPluginTip":"Runs the plugin's own handler","hooks.field.toolNames":"Tool name filter","hooks.toolNamesPlaceholder":"Comma-separated, e.g. Read, Edit, Bash","hooks.field.pathGlobs":"Path glob filter","hooks.pathGlobsPlaceholder":"Comma-separated, e.g. **/*.md, docs/**","hooks.field.crossProjectOnly":"Only fire on cross-project matches","hooks.field.template":"Prompt template","hooks.templatePlaceholder":"Placeholders: {event} {tool} {file} {cwd} {session} {project} {rule}","hooks.field.url":"Webhook URL","hooks.urlPlaceholder":"https://example.com/hook","hooks.field.secret":"Signing secret (optional)","hooks.field.pluginId":"Plugin ID","hooks.pluginIdPlaceholder":"e.g. changelog-reminder","hooks.field.pluginHandlerType":"handlerType","hooks.pluginHandlerPlaceholder":"e.g. notify","hooks.field.record":"Record dispatches","hooks.field.enabled":"Enabled","hooks.save":"Save","hooks.cancel":"Cancel","hooks.errNameRequired":"Please enter a rule name","hooks.errTemplateRequired":"Please enter a prompt template","hooks.errUrlRequired":"Please enter a valid webhook URL","hooks.errPluginRequired":"Please fill in pluginId and handlerType","hooks.status.pending":"Pending","hooks.status.injected":"Injected","hooks.status.running":"Running","hooks.status.succeeded":"Succeeded","hooks.status.failed":"Failed","hooks.status.timeout":"Timeout","hooks.runConfirm":'Run prompt #{id} into session "{session}"?',"hooks.runConfirmYes":"Run","hooks.plugins.hint":"Drop a directory into a scan root to auto-register · see docs/PLUGIN-SPEC.md","hooks.plugins.projectHint":"Enabled state for this project (follows global until overridden) · install / uninstall at global scope","hooks.plugins.followGlobal":"Follows global","hooks.plugins.projectOverride":"Set for this project","hooks.plugins.empty":"No plugins yet — install from the builtin repository or a resource market","hooks.plugins.rules":"{n} rules","hooks.plugins.toggleTip":"Enable/disable all rules of this plugin (projects can override)","hooks.plugins.rejectedTip":"Plugin validation failed; fix it and hot reload recovers automatically","hooks.plugins.hotReload":"Plugin file changes hot reload within 1 second","hooks.plugins.rescan":"Rescan","hooks.plugins.rescanTip":"Rescan plugin directories (ones created after the daemon started get picked up)","hooks.plugins.rescanOk":"Plugin roots rescanned ({n} plugins)","hooks.plugins.rescanFail":"Rescan failed: {error}","hooks.plugins.expand":"Expand this plugin's rules","hooks.plugins.collapse":"Collapse this plugin's rules","hooks.plugins.uninstallTip":"Uninstall plugin (remove directory)","hooks.plugins.uninstallTitle":"Uninstall plugin","hooks.plugins.uninstallConfirm":"Uninstall plugin {id}? Its rules will be cascade-removed.","hooks.plugins.toggleFail":"Failed to toggle plugin: {error}","hooks.plugins.uninstallOk":"Uninstalled: {id}","hooks.plugins.uninstallFail":"Uninstall failed: {error}","hooks.capture.title":"Event capture (user scope)","hooks.capture.hint":"Captures session events across every project","hooks.capture.note":"Install = enabled; existing project-scope capture groups are cleaned up so nothing is captured twice","hooks.capture.toggleTip":"Install / disable user-scope event capture","hooks.capture.onOk":"User-scope capture installed","hooks.capture.offOk":"User-scope capture disabled","hooks.capture.fail":"Capture toggle failed: {error}","hooks.capture.half":"Half-installed","hooks.capture.halfTip":"Hook groups written but helper script missing — toggle off and on to repair"},v9={"catbar.tasks":"任务","tasks.heading":"任务视图","tasks.selectHint":"从左侧选择一个会话,查看它的数据流","tasks.emptySessions":"暂无会话——在项目里跑一次 Claude 会话即出现","tasks.listTitle":"会话","tasks.refresh":"刷新","tasks.refreshed":"已刷新","tasks.newSession":"新建会话","tasks.newSessionTip":"起一个新会话","tasks.newSessionNoHarness":"本项目已接入的 harness 都不能起交互会话——重跑 weave init 选一个","tasks.newSessionFailed":"新建会话失败:{error}","tasks.newSessionStarting":"正在新建会话…","tasks.statusRunning":"运行中","tasks.statusCompacting":"压缩中","tasks.statusFailed":"失败","tasks.statusOpen":"就绪","tasks.statusClosed":"关闭","tasks.statusTerminated":"已终止","tasks.statusInterrupted":"已中断","tasks.events":"{n} 事件","tasks.renameTip":"双击改名","tasks.renamePlaceholder":"会话标题","tasks.renameVerifyFail":"改名未生效,请重试","tasks.renamePendingTip":"已挂起,等会话下次活动时生效","tasks.dropTip":"把指令卡拖到这里执行","tasks.copySessionId":"复制完整 sessionId","tasks.copied":"已复制","tasks.openSessionTerminal":"在默认终端打开会话","tasks.sessionTerminalRunning":"该会话已在终端运行——不可重复打开","tasks.transcriptMissing":"转录已丢失","tasks.transcriptMissingTip":"该会话的转录文件已不在磁盘上(被清理或删除),接不回来了;会话行与已采集的事件照常保留,可以删掉这一行","tasks.closePaneTooltip":"关闭该会话的终端(退出会话;历史保留)","tasks.closePaneTitle":"关闭会话","tasks.closePaneConfirm":"关闭会话「{id}」的终端?会话会一起退出;历史保留。","tasks.closePaneFallback":"未命名窗格","tasks.closePaneFailed":"关闭会话失败:{error}","tasks.closeTerminalPickTitle":"选择要关闭的终端","tasks.closeTerminalConfirmLabel":"关闭 {n} 个","tasks.terminalPickTitle":"选择要附加到的终端","tasks.terminalPickCancel":"取消","tasks.harnessPickTitle":"在哪个 harness 里新建会话","tasks.terminalTargetFallback":"窗口 {w} · Tab {t}","tasks.terminalTargetActive":"当前聚焦","tasks.terminalTargetFull":"已满({n} 个窗格)","tasks.terminalTargetFullTip":"这个终端已满——新会话需另开终端","tasks.terminalTargetDetail":"{match} 个本项目的窗格(共 {total})","tasks.terminalBlock":"终端 {w}","tasks.terminalBlockTab":"终端 {w} · Tab {t}","tasks.terminalBlockSessions":"{n} 个会话","tasks.deleteSession":"删除会话","tasks.deleteTooltip":"删除该会话及其全部事件,不可撤销","tasks.deleteConfirm":"删除会话「{id}」及其全部事件?此操作不可撤销。","tasks.deleteFailed":"删除会话失败:{error}","tasks.messageTooltip":"对话:查看消息投递与回合总结","tasks.resizeList":"拖拽调整会话列表宽度","tasks.messagesTitle":"对话","tasks.messagesClose":"关闭","tasks.messagesMinimize":"最小化","tasks.msgCloseConfirmTitle":"关闭对话框","tasks.msgCloseConfirm":"输入框里还有未发送的内容,关闭会丢弃它们。","tasks.messagesEmpty":"还没有对话——从下方投递第一条","tasks.convAnswer":"回答","tasks.convPlan":"计划","tasks.convFold":"收起这条回复","tasks.convUnfold":"展开这条回复","tasks.convFilterAll":"全部","tasks.convFilterSent":"我发的","tasks.convFilterRecv":"回复","tasks.convFilterEmpty":"当前过滤下没有消息","tasks.convCount":"共 {n} 条","tasks.convSelect":"多选","tasks.convSelected":"已选 {n} 条","tasks.convCopy":"复制","tasks.convCancel":"取消","tasks.convCopyOk":"已复制 {n} 条(带时刻戳)","tasks.convCopyFailed":"复制失败:可手动选中文本复制","tasks.convSelectAll":"全选","tasks.convDeselectAll":"取消全选","tasks.convShare":"分享图片","tasks.convShareCopy":"复制到剪贴板","tasks.convShareDownload":"下载 PNG","tasks.convImgOk":"已复制 {n} 条对话图片","tasks.convImgCopyFailed":"复制图片失败:该浏览器不支持,可改用「下载 PNG」","tasks.convImgSaved":"图片已下载","tasks.convImgFailed":"生成图片失败:{error}","tasks.convRoleUser":"我","tasks.convRoleAssistant":"会话","tasks.msgEarlier":"加载更早的消息…","tasks.pullMore":"继续拉动加载更早的消息","tasks.pullMoreEvents":"继续拉动加载更早的事件","tasks.messagesPlaceholder":"输入要投递的消息…(Enter 发送,Shift+Enter 换行)","tasks.messagesSend":"发送","tasks.msgNewline":"换行","tasks.msgResizeInput":"拖拽调整输入框高度","tasks.msgSendFailed":"投递失败:{error}","tasks.msgUnsupported":"该会话不支持消息投递","tasks.msgImageAttach":"图片","tasks.msgImageRemove":"移除这张图","tasks.msgImageUnsupported":"该会话不收图","tasks.msgImageTooLarge":"图片超过 10MB","tasks.msgImageTooMany":"一条最多带 8 张图","tasks.msgImageBadType":"只支持 PNG / JPEG / GIF / WebP","tasks.msgImageUploadFailed":"图片上传失败:{error}","tasks.msgImagePreview":"关闭大图","tasks.modeLabel":"模式","tasks.modeUnknown":"未知","tasks.modeLastKnown":"最后一次活动时的模式","tasks.modeCycle":"切换执行模式","tasks.modeCycled":"已送出切换","tasks.modeCycleFailed":"切换模式失败:{error}","tasks.modeConfirmTitle":"切换执行模式","tasks.modeConfirm":"切换执行模式:顺序由会话决定,可能落到 plan 或 bypass 权限模式,且无法撤回。","tasks.modeConfirmAction":"切换","tasks.modelLabel":"模型","tasks.modelUnknown":"未知","tasks.modelLastKnown":"最近一轮用过的模型","tasks.modelSet":"已送出切换","tasks.modelSetFailed":"切换模型失败:{error}","tasks.msgGenerating":"生成中…","tasks.msgCompacting":"压缩会话中…","tasks.msgInterrupted":"已中断","tasks.msgStalled":"未回执 · 队列已暂停","tasks.msgResend":"重发","tasks.msgResendFailed":"重发失败:{error}","tasks.msgDismiss":"删除","tasks.msgDismissHint":"把这条从对话里删掉;已送到会话的内容不受影响","tasks.msgDismissQueuedHint":"这条还没送出去——删掉即取消发送","tasks.msgDismissFailed":"删除失败:{error}","tasks.msgOffline":"会话未运行——消息没有送出去(先打开该会话,再点重发)","tasks.msgOfflineToast":"会话未运行,消息没有送出去","tasks.msgClearIn":"{left} 后自动清除","tasks.msgStatusQueued":"排队中","tasks.msgStatusSent":"已发出","tasks.outboxDequeue":"取回编辑","tasks.outboxDequeueHint":"取回队列里最新这条,放回输入框改完再发","tasks.msgDequeueFailed":"出队失败:{error}","tasks.msgStatusDelivering":"投递中","tasks.msgStatusInjected":"已注入","tasks.msgStatusDelivered":"已送达","tasks.msgStatusRunning":"回合执行中","tasks.msgStatusSucceeded":"已完成","tasks.msgStatusFailed":"失败","tasks.msgStatusTimeout":"超时","tasks.msgModePrompt":"投递","tasks.msgModeAuto":"自动","tasks.msgModeInject":"注入","tasks.msgModeHeadless":"无头","tasks.msgModePromptHint":"投递(送进会话;未打开的排队)","tasks.msgModeAutoHint":"自动(忙时排队,闲时立刻开一轮)","tasks.msgModeInjectHint":"注入(排队,等会话下次活动再送)","tasks.msgModeHeadlessHint":"无头(只在空闲时,立刻开新回合)","tasks.msgOutput":"回合输出","tasks.watchTooltip":"会话提醒:订阅下一条命中的消息(一次性)","tasks.watchActiveTooltip":"已订阅提醒——剩余 {n} 次(点击调整/取消)","tasks.watchOn":"「{label}」已空闲","tasks.watchTurnEnd":"「{label}」一轮对话结束","tasks.watchMsgFailed":"「{label}」有消息投递失败","tasks.watchNotifyTitle":"会话提醒","tasks.questionPending":"「{label}」在等你作答","tasks.questionPendingTitle":"待答提醒","tasks.watchPickerTitle":"会话提醒","tasks.watchPickerHint":"订阅该会话「下一条」符合所选条件的消息,命中即提醒并自动失效。","tasks.watchKindIdle":"空闲","tasks.watchKindIdleHint":"该会话空闲时(一轮结束或会话退出)","tasks.watchKindTurnEnd":"一轮对话结束","tasks.watchKindTurnEndHint":"该会话跑完一轮对话","tasks.watchKindMessageFailed":"投递失败·超时","tasks.watchKindMessageFailedHint":"投递给该会话的消息失败或超时","tasks.watchTimes":"提醒次数","tasks.watchTimesLeft":"剩余次数","tasks.watchPersistent":"持久化(不失效)","tasks.watchSubscribe":"订阅","tasks.watchUpdate":"更新","tasks.watchUnwatch":"取消订阅","tasks.notifyDenied":"浏览器通知未授权——提醒只在页面内显示","tasks.notifyUnsupported":"此浏览器不支持通知——提醒只在页面内显示","tasks.notifyInsecure":"HTTP 访问无法使用浏览器通知(需 HTTPS 或 localhost)——提醒只在页面内显示","tasks.messageInflight":"{n} 条消息在途(未送达)","tasks.watchFailed":"订阅空闲提醒失败:{error}","tasks.unwatchFailed":"取消订阅失败:{error}","tasks.answerTooltip":"会话在等待作答(问题 / 计划 / 权限确认)","tasks.answerActiveTooltip":"{n} 个待答问题(点击远程作答)","tasks.answerPendingTag":"待答","tasks.answerPickerTitle":"待答问题","tasks.answerPickerHint":"单问点选项即提交;多问或多选选好后用下方按钮一次提交。","tasks.answerPickerHintPreview":"点选项只挪高亮,提交走「发送」;备注随高亮选项一起发。","tasks.answerIncomplete":"还有 {n} 个问题未作答","tasks.answerSend":"发送","tasks.answerFailed":"作答失败:{error}","tasks.pendingTitle":"改名待生效","tasks.chainTitle":"事件链","tasks.sideTitle":"旁路会话","tasks.sideHint":"旁路提问不占主对话上下文(claude 的 /btw):回答只回到这里。","tasks.sidePlaceholder":"问点别的,不打扰主回合…","tasks.sideEmpty":"还没有旁路提问","tasks.sidePending":"等待回答…","tasks.sideTimeout":"没有等到回答(宿主面板可能已经关掉)","tasks.sideLoading":"加载中…","tasks.sidePullOlder":"继续上拉看更早","tasks.sideFailed":"旁路提问失败:{error}","tasks.sideRoleAsk":"问","tasks.sideRoleAnswer":"答","tasks.chainEmpty":"该会话还没有采集到事件","tasks.chainCatchUp":"正在向前补拉更早的 prompt…","tasks.searchPlaceholder":"搜索事件名","tasks.searchMatches":"{n} 条匹配","tasks.searchNoMatch":"没有匹配的折叠条","tasks.dispatchQueue":"待派发 {n}","tasks.dispatchHint":"选择活跃会话后派发,结果在事件链中高亮","tasks.dispatchRun":"派发","tasks.dispatchRunFailed":"派发执行失败:{error}","tasks.legendNote":"历史事件链可能缺少这类节点","tasks.unnamedSession":"未命名会话","tasks.groupDispatches":"{n} 派发","tasks.groupOpen":"未正常结束","tasks.groupRunning":"执行中","tasks.groupSubagent":"子代理完成 ×{n}","tasks.groupAgents":"子代理 ×{n}","tasks.groupQuestions":"问答 ×{n}","tasks.copyPrompt":"复制 prompt","tasks.stop":"停止","tasks.stopTooltip":"停止会话","tasks.stopOk":"已送出停止","tasks.stopFail":"停止失败:{error}","tasks.groupPreSession":"会话引导","tasks.autoDeleteInDays":"{n} 天后自动移除","tasks.autoDeleteInHours":"{n} 小时后自动移除","tasks.autoDeleteInMinutes":"{n} 分钟后自动移除","tasks.autoDeleteSoon":"即将自动移除","tasks.yesterday":"昨天","tasks.overviewTitle":"全局任务总览","tasks.overviewEmpty":"暂无跨项目会话——在任意项目里跑一次 Claude 会话即出现","tasks.overviewProject":"项目","tasks.overviewSession":"会话","tasks.overviewStatus":"状态","tasks.overviewEvents":"事件","tasks.overviewTime":"时间","tasks.overviewUnknownProject":"未识别项目","tasks.overviewAllProjects":"全部项目","tasks.rangeAll":"全部时间","tasks.rangeToday":"当天","tasks.range1d":"1天内","tasks.range3d":"3天内","tasks.range7d":"7天内","tasks.range30d":"30天内","tasks.rangeOver30":"大于30天","tasks.rangeCustom":"自定义","tasks.rangeFrom":"起始日期","tasks.rangeTo":"结束日期","tasks.olderHint":"向下滚动或点击加载更早的 prompt(默认显示最新 10 条)","tasks.loadOlder":"加载更早 {n} 条","tasks.loadOlderEvents":"加载更早事件","tasks.loadAll":"加载全部","catbar.orchestrate":"编排","orch.title":"跨会话编排","orch.hint":"会话按类型分道排布,节点上显示在途消息数;点击可收消息的节点查看对话","orch.canvasEmpty":"本项目暂无会话——先在任务视图跑出会话,再回到这里编排","orch.messages":"{n} 条在途消息","orch.unknownLane":"未知 harness","orch.received":"在途 {n}","orch.builderTitle":"触发序列","orch.builderHint":"最多 3 步,前一步完成后自动发下一步","orch.namePlaceholder":"序列名(可选)","orch.stepTarget":"目标会话","orch.stepMode":"投递通道","orch.stepText":"消息内容","orch.addStep":"加一步","orch.removeStep":"移除该步","orch.trigger":"触发","orch.triggerFailed":"触发序列失败:{error}","orch.noCapableSessions":"暂无可收消息的会话","orch.sequencesTitle":"序列","orch.seqEmpty":"暂无序列——用上方触发器发起第一条","orch.seqNameFallback":"序列 #{id}","orch.seqProgress":"第 {cur}/{n} 步","orch.seqDone":"已完成","orch.seqCancelled":"已取消","orch.seqCancel":"取消","orch.seqCancelFailed":"取消序列失败:{error}","orch.seqStepPending":"未触发","orch.globalHint":"编排是项目级视图——选择一个项目后编排它的会话"},k9={"catbar.tasks":"Tasks","tasks.heading":"Task view","tasks.selectHint":"Pick a session on the left to see its data flow","tasks.emptySessions":"No sessions yet — run a Claude session in this project","tasks.listTitle":"Sessions","tasks.refresh":"Refresh","tasks.refreshed":"Refreshed","tasks.newSession":"New session","tasks.newSessionTip":"Start a new session","tasks.newSessionNoHarness":"No harness integrated in this project can start an interactive session — re-run weave init and pick one","tasks.newSessionFailed":"Failed to start a new session: {error}","tasks.newSessionStarting":"Starting a new session…","tasks.statusRunning":"Running","tasks.statusCompacting":"Compacting","tasks.statusFailed":"Failed","tasks.statusOpen":"Ready","tasks.statusClosed":"Closed","tasks.statusTerminated":"Terminated","tasks.statusInterrupted":"Interrupted","tasks.events":"{n} events","tasks.renameTip":"Double-click to rename","tasks.renamePlaceholder":"Session title","tasks.renameVerifyFail":"Rename did not take effect — please retry","tasks.renamePendingTip":"Queued — applies on the session’s next activity","tasks.dropTip":"Drop an instruction card here to run","tasks.copySessionId":"Copy full session id","tasks.copied":"Copied","tasks.openSessionTerminal":"Open in default terminal","tasks.sessionTerminalRunning":"A terminal is already running this session — cannot open again","tasks.transcriptMissing":"Transcript missing","tasks.transcriptMissingTip":"This session’s transcript file is gone from disk (cleaned up or deleted), so it can no longer be resumed; the row and its collected events remain — you can delete the row","tasks.closePaneTooltip":"Close this session’s terminal (exits the session; history is kept)","tasks.closePaneTitle":"Close session","tasks.closePaneConfirm":"Close the terminal running session “{id}”? The session exits too; history is kept.","tasks.closePaneFallback":"Unnamed pane","tasks.closePaneFailed":"Close session failed: {error}","tasks.closeTerminalPickTitle":"Choose terminals to close","tasks.closeTerminalConfirmLabel":"Close {n}","tasks.terminalPickTitle":"Choose a terminal to attach to","tasks.terminalPickCancel":"Cancel","tasks.harnessPickTitle":"New session in which harness?","tasks.terminalTargetFallback":"Window {w} · Tab {t}","tasks.terminalTargetActive":"Focused","tasks.terminalTargetFull":"Full ({n} panes)","tasks.terminalTargetFullTip":"This terminal is full — a new session needs its own terminal","tasks.terminalTargetDetail":"{match} pane(s) in this project ({total} total)","tasks.terminalBlock":"Terminal {w}","tasks.terminalBlockTab":"Terminal {w} · Tab {t}","tasks.terminalBlockSessions":"{n} session(s)","tasks.deleteSession":"Delete session","tasks.deleteTooltip":"Delete this session and all its events — cannot be undone","tasks.deleteConfirm":"Delete session “{id}” and all its events? This cannot be undone.","tasks.deleteFailed":"Failed to delete session: {error}","tasks.messageTooltip":"Conversation: view deliveries and turn summaries","tasks.resizeList":"Drag to resize the session list","tasks.messagesTitle":"Conversation","tasks.messagesClose":"Close","tasks.messagesMinimize":"Minimize","tasks.msgCloseConfirmTitle":"Close conversation","tasks.msgCloseConfirm":"The input box still has unsent content; closing will discard it.","tasks.messagesEmpty":"No conversation yet — deliver the first message below","tasks.convAnswer":"Answer","tasks.convPlan":"Plan","tasks.convFold":"Collapse this reply","tasks.convUnfold":"Expand this reply","tasks.convFilterAll":"All","tasks.convFilterSent":"Sent","tasks.convFilterRecv":"Replies","tasks.convFilterEmpty":"No messages under this filter","tasks.convCount":"{n} messages","tasks.convSelect":"Select messages","tasks.convSelected":"{n} selected","tasks.convCopy":"Copy","tasks.convCancel":"Cancel","tasks.convCopyOk":"Copied {n} messages (with timestamps)","tasks.convCopyFailed":"Copy failed: select the text to copy manually","tasks.convSelectAll":"Select all","tasks.convDeselectAll":"Clear selection","tasks.convShare":"Share image","tasks.convShareCopy":"Copy to clipboard","tasks.convShareDownload":"Download PNG","tasks.convImgOk":"Copied {n} messages as an image","tasks.convImgCopyFailed":'Copying the image failed: this browser cannot do it — use "Download PNG"',"tasks.convImgSaved":"Image downloaded","tasks.convImgFailed":"Rendering the image failed: {error}","tasks.convRoleUser":"Me","tasks.convRoleAssistant":"Session","tasks.msgEarlier":"Loading earlier messages…","tasks.pullMore":"Keep pulling to load earlier messages","tasks.pullMoreEvents":"Keep pulling to load earlier events","tasks.messagesPlaceholder":"Message to deliver… (Enter to send, Shift+Enter for newline)","tasks.messagesSend":"Send","tasks.msgNewline":"Newline","tasks.msgResizeInput":"Drag to resize the input","tasks.msgSendFailed":"Delivery failed: {error}","tasks.msgUnsupported":"This session supports no message delivery","tasks.msgImageAttach":"Image","tasks.msgImageRemove":"Remove this image","tasks.msgImageUnsupported":"This session takes no images","tasks.msgImageTooLarge":"Image exceeds 10MB","tasks.msgImageTooMany":"At most 8 images per message","tasks.msgImageBadType":"Only PNG / JPEG / GIF / WebP","tasks.msgImageUploadFailed":"Image upload failed: {error}","tasks.msgImagePreview":"Close preview","tasks.modeLabel":"Mode","tasks.modeUnknown":"unknown","tasks.modeLastKnown":"Mode at last activity","tasks.modeCycle":"Switch execution mode","tasks.modeCycled":"Switch sent","tasks.modeCycleFailed":"Mode switch failed: {error}","tasks.modeConfirmTitle":"Switch execution mode","tasks.modeConfirm":"Switches the execution mode: the session decides the order — it may land on plan or bypass permissions, with no undo.","tasks.modeConfirmAction":"Switch","tasks.modelLabel":"Model","tasks.modelUnknown":"unknown","tasks.modelLastKnown":"Model used in the last turn","tasks.modelSet":"Switch sent","tasks.modelSetFailed":"Model switch failed: {error}","tasks.msgGenerating":"Generating…","tasks.msgCompacting":"Compacting context…","tasks.msgInterrupted":"Interrupted","tasks.msgStalled":"No receipt · queue paused","tasks.msgResend":"Resend","tasks.msgResendFailed":"Resend failed: {error}","tasks.msgDismiss":"Delete","tasks.msgDismissHint":"Remove this row from the conversation; content already delivered to the session is unaffected","tasks.msgDismissQueuedHint":"Not sent yet — deleting it cancels the send","tasks.msgDismissFailed":"Delete failed: {error}","tasks.msgOffline":"Session is not running — the message was not sent (open the session, then resend)","tasks.msgOfflineToast":"Session is not running — nothing was sent","tasks.msgClearIn":"cleared in {left}","tasks.msgStatusQueued":"Queued","tasks.msgStatusSent":"Sent","tasks.outboxDequeue":"Edit","tasks.outboxDequeueHint":"Take the newest queued message back into the composer to edit it","tasks.msgDequeueFailed":"Could not take it out of the queue: {error}","tasks.msgStatusDelivering":"Delivering","tasks.msgStatusInjected":"Injected","tasks.msgStatusDelivered":"Delivered","tasks.msgStatusRunning":"Turn running","tasks.msgStatusSucceeded":"Succeeded","tasks.msgStatusFailed":"Failed","tasks.msgStatusTimeout":"Timed out","tasks.msgModePrompt":"Prompt","tasks.msgModeAuto":"Auto","tasks.msgModeInject":"Inject","tasks.msgModeHeadless":"Headless","tasks.msgModePromptHint":"Prompt (into the session; queues if closed)","tasks.msgModeAutoHint":"Auto (busy queues, idle starts a turn)","tasks.msgModeInjectHint":"Inject (queues until the session’s next activity)","tasks.msgModeHeadlessHint":"Headless (idle only, starts a new turn right away)","tasks.msgOutput":"Turn output","tasks.watchTooltip":"Session alert: subscribe to the next matching message (one-shot)","tasks.watchActiveTooltip":"Alert subscribed — {n} left (click to adjust / cancel)","tasks.watchOn":'"{label}" is now idle',"tasks.watchTurnEnd":'"{label}" finished a turn',"tasks.watchMsgFailed":'"{label}" had a failed message delivery',"tasks.watchNotifyTitle":"Session alert","tasks.questionPending":'"{label}" is waiting for your answer',"tasks.questionPendingTitle":"Answer needed","tasks.watchPickerTitle":"Session alert","tasks.watchPickerHint":'Subscribe to the "next" message matching the selected conditions — fires once, then expires.',"tasks.watchKindIdle":"Idle","tasks.watchKindIdleHint":"When the session goes idle (turn ends or session exits)","tasks.watchKindTurnEnd":"Turn finished","tasks.watchKindTurnEndHint":"When the session finishes a turn","tasks.watchKindMessageFailed":"Delivery failed / timed out","tasks.watchKindMessageFailedHint":"When a message to this session fails or times out","tasks.watchTimes":"Alert count","tasks.watchTimesLeft":"Alerts left","tasks.watchPersistent":"Persistent (never expires)","tasks.watchSubscribe":"Subscribe","tasks.watchUpdate":"Update","tasks.watchUnwatch":"Cancel","tasks.notifyDenied":"Browser notifications not allowed — alerts stay in-page","tasks.notifyUnsupported":"This browser has no notification support — alerts stay in-page","tasks.notifyInsecure":"Browser notifications need HTTPS (or localhost) — alerts stay in-page","tasks.messageInflight":"{n} message(s) in flight (not delivered yet)","tasks.watchFailed":"Failed to watch session: {error}","tasks.unwatchFailed":"Failed to cancel watch: {error}","tasks.answerTooltip":"Session is waiting for an answer (question / plan / permission)","tasks.answerActiveTooltip":"{n} pending question(s) — click to answer remotely","tasks.answerPendingTag":"Awaiting answer","tasks.answerPickerTitle":"Pending questions","tasks.answerPickerHint":"One question submits on click; several questions (or a multi-select) submit in one go with the buttons below.","tasks.answerPickerHintPreview":"Clicking an option only moves the highlight — Send commits; notes go with the highlighted option.","tasks.answerIncomplete":"{n} question(s) still unanswered","tasks.answerSend":"Send","tasks.answerFailed":"Failed to answer: {error}","tasks.pendingTitle":"Rename pending","tasks.chainTitle":"Event chain","tasks.sideTitle":"Side chat","tasks.sideHint":"Side questions stay out of the main conversation (claude `/btw`): answers land only here.","tasks.sidePlaceholder":"Ask something else without interrupting the turn…","tasks.sideEmpty":"No side questions yet","tasks.sidePending":"Waiting for an answer…","tasks.sideTimeout":"No answer arrived (the host panel may have been closed)","tasks.sideLoading":"Loading…","tasks.sidePullOlder":"Pull to load earlier","tasks.sideFailed":"Side question failed: {error}","tasks.sideRoleAsk":"Q","tasks.sideRoleAnswer":"A","tasks.chainEmpty":"No events captured for this session yet","tasks.chainCatchUp":"Catching up on earlier prompts…","tasks.searchPlaceholder":"Search event names","tasks.searchMatches":"{n} matches","tasks.searchNoMatch":"No matching prompt bars","tasks.dispatchQueue":"{n} pending dispatches","tasks.dispatchHint":"Pick an active session to dispatch; results highlight in the chain","tasks.dispatchRun":"Dispatch","tasks.dispatchRunFailed":"Failed to run dispatch: {error}","tasks.legendNote":"Historical chains may omit these nodes","tasks.unnamedSession":"Unnamed session","tasks.groupDispatches":"{n} dispatches","tasks.groupOpen":"Not ended normally","tasks.groupRunning":"Running","tasks.groupSubagent":"Subagents completed ×{n}","tasks.groupAgents":"Agents ×{n}","tasks.groupQuestions":"Q&A ×{n}","tasks.copyPrompt":"Copy prompt","tasks.stop":"Stop","tasks.stopTooltip":"Stop the session","tasks.stopOk":"Stop sent","tasks.stopFail":"Stop failed: {error}","tasks.groupPreSession":"Session kickoff","tasks.autoDeleteInDays":"Removes in {n}d","tasks.autoDeleteInHours":"Removes in {n}h","tasks.autoDeleteInMinutes":"Removes in {n}m","tasks.autoDeleteSoon":"Removes soon","tasks.yesterday":"Yesterday","tasks.overviewTitle":"Global task overview","tasks.overviewEmpty":"No sessions across projects yet — run a Claude session in any project","tasks.overviewProject":"Project","tasks.overviewSession":"Session","tasks.overviewStatus":"Status","tasks.overviewEvents":"Events","tasks.overviewTime":"Time","tasks.overviewUnknownProject":"Unknown project","tasks.overviewAllProjects":"All projects","tasks.rangeAll":"All time","tasks.rangeToday":"Today","tasks.range1d":"Within 1 day","tasks.range3d":"Within 3 days","tasks.range7d":"Within 7 days","tasks.range30d":"Within 30 days","tasks.rangeOver30":"Over 30 days","tasks.rangeCustom":"Custom","tasks.rangeFrom":"From date","tasks.rangeTo":"To date","tasks.olderHint":"Scroll down or click to load earlier prompts (latest 10 shown by default)","tasks.loadOlder":"Load {n} earlier","tasks.loadOlderEvents":"Load earlier events","tasks.loadAll":"Load all","catbar.orchestrate":"Orchestrate","orch.title":"Cross-session orchestration","orch.hint":"Sessions grouped into lanes by type, with in-flight counts on each node — click a message-capable node to open its conversation","orch.canvasEmpty":"No sessions in this project yet — run one from the Tasks view first","orch.messages":"{n} in-flight messages","orch.unknownLane":"Unknown harness","orch.received":"In flight {n}","orch.builderTitle":"Trigger a sequence","orch.builderHint":"Up to 3 steps; each fires when the previous one completes","orch.namePlaceholder":"Sequence name (optional)","orch.stepTarget":"Target session","orch.stepMode":"Channel","orch.stepText":"Message","orch.addStep":"Add step","orch.removeStep":"Remove step","orch.trigger":"Run","orch.triggerFailed":"Failed to trigger sequence: {error}","orch.noCapableSessions":"No message-capable sessions yet","orch.sequencesTitle":"Sequences","orch.seqEmpty":"No sequences yet — trigger the first one above","orch.seqNameFallback":"Sequence #{id}","orch.seqProgress":"Step {cur}/{n}","orch.seqDone":"Done","orch.seqCancelled":"Cancelled","orch.seqCancel":"Cancel","orch.seqCancelFailed":"Failed to cancel sequence: {error}","orch.seqStepPending":"Not fired","orch.globalHint":"Orchestration is a per-project view — pick a project to orchestrate its sessions"},w9={"health.badgeTip":"{count} 项健康检查未通过","health.okTip":"健康检查全部通过","health.check.instructionLinkNotMaterialised":'{agents} 是内容为 "{claude}" 的普通文件——git 把软链接检出成了文本。',"health.check.instructionFilesDuplicated":"{claude} 与 {agents} 都是独立文件——两者内容会各自漂移。","health.check.instructionLinkDangling":"{name} 是目标不存在的软链接。","health.check.statuslinePathUnresolved":"statusLine 命令无法解析出脚本路径:{command}","health.check.statuslinePathForeign":"statusLine 指向本项目之外({path})——它是为另一个检出生成的。","health.check.statuslineScriptMissing":"statusLine 脚本缺失:{path}"},S9={"health.badgeTip":"{count} health check(s) failing","health.okTip":"All health checks passing","health.check.instructionLinkNotMaterialised":'{agents} is a plain file containing "{claude}" — git checked the symlink out as text.',"health.check.instructionFilesDuplicated":"{claude} and {agents} are both regular files — they will drift apart.","health.check.instructionLinkDangling":"{name} is a symlink whose target does not exist.","health.check.statuslinePathUnresolved":"statusLine command does not resolve to a script path: {command}","health.check.statuslinePathForeign":"statusLine points outside this project ({path}) — it was generated for another checkout.","health.check.statuslineScriptMissing":"statusLine script is missing: {path}"},N9={"toolkit.hint":"CC 插件与 mod 整包启停,其余按包成分启停","toolkit.scopeRoot":"未分目录","toolkit.expandAll":"全部展开","toolkit.collapseAll":"全部折叠","toolkit.expandAllGroups":"展开全部分组","toolkit.collapseAllGroups":"折叠全部分组","toolkit.empty":"暂无工具包","toolkit.loading":"加载中…","toolkit.loadFailed":"加载失败:{error}","toolkit.toggleFailed":"操作失败:{error}","toolkit.uninstallFailed":"卸载失败:{error}","toolkit.uninstalled":"已卸载:{name}","toolkit.legacyCleaned":"已清理旧副本","toolkit.toggleTip":"启用/停用本项目(CC 插件与 mod 首次启用会先安装到全局)","toolkit.install":"安装","toolkit.installing":"安装中…","toolkit.installTip":"装到全局(user 档)","toolkit.installFailed":"安装失败:{error}","toolkit.userInstalled":"已装到全局:{key}","toolkit.enableDefault":"默认","toolkit.enableOn":"启用","toolkit.enableOff":"禁用","toolkit.enableTip":"{state} — 点击切换","toolkit.kind.skill":"skill","toolkit.kind.hook":"hook","toolkit.kind.mod":"mod","toolkit.kind.rule":"rule","toolkit.kind.surface":"surface","toolkit.prov.builtin":"内置","toolkit.prov.market":"市场","toolkit.targets":"目标:{targets}","toolkit.weaveRules":"规则 {n}","toolkit.keyTip":"插件所属市场 · 安装:{scopes}","toolkit.scopesNone":"未安装","toolkit.legacyTitle":"发现 {n} 个 Weave 旧插件副本","toolkit.legacyHint":"旧版本残留的副本,不会被加载,可安全清理","toolkit.legacyCleanup":"清理","toolkit.uninstall":"卸载","toolkit.uninstallTip":"彻底卸载(预置源保留,可重装)"},E9={"toolkit.hint":"CC plugins & mods toggle as a whole, others by component","toolkit.scopeRoot":"Ungrouped","toolkit.expandAll":"Expand all","toolkit.collapseAll":"Collapse all","toolkit.expandAllGroups":"Expand all groups","toolkit.collapseAllGroups":"Collapse all groups","toolkit.empty":"No toolkit packs","toolkit.loading":"Loading…","toolkit.loadFailed":"Load failed: {error}","toolkit.toggleFailed":"Operation failed: {error}","toolkit.uninstallFailed":"Uninstall failed: {error}","toolkit.uninstalled":"Uninstalled: {name}","toolkit.legacyCleaned":"Stale copies cleaned up","toolkit.toggleTip":"Enable/disable in this project (CC plugins & mods install globally on first enable)","toolkit.install":"Install","toolkit.installing":"Installing…","toolkit.installTip":"Install to user scope","toolkit.installFailed":"Install failed: {error}","toolkit.userInstalled":"Installed to user scope: {key}","toolkit.enableDefault":"Default","toolkit.enableOn":"Enabled","toolkit.enableOff":"Disabled","toolkit.enableTip":"{state} — click to cycle","toolkit.kind.skill":"skill","toolkit.kind.hook":"hook","toolkit.kind.mod":"mod","toolkit.kind.rule":"rule","toolkit.kind.surface":"surface","toolkit.prov.builtin":"builtin","toolkit.prov.market":"market","toolkit.targets":"Targets: {targets}","toolkit.weaveRules":"rules {n}","toolkit.keyTip":"Plugin marketplace · install: {scopes}","toolkit.scopesNone":"not installed","toolkit.legacyTitle":"Found {n} stale Weave plugin copies","toolkit.legacyHint":"Leftovers from an older version; never loaded, safe to clean up","toolkit.legacyCleanup":"Clean up","toolkit.uninstall":"Uninstall","toolkit.uninstallTip":"Uninstall completely (the shipped source is kept and can be reinstalled)"},_9={"auth.title":"weave 控制台","auth.passwordPlaceholder":"登录密码","auth.login":"登录","auth.wrongPassword":"密码错误","auth.logout":"退出登录","auth.hint":"初始密码见本机 `weave dashboard` 输出;改密用 `weave chpass <新密码>`(本机执行)。"},C9={"auth.title":"weave console","auth.passwordPlaceholder":"Login password","auth.login":"Log in","auth.wrongPassword":"Wrong password","auth.logout":"Log out","auth.hint":"The initial password is printed by `weave dashboard` on this machine; change it with `weave chpass <new password>`."},T9={"ai.title":"AI 助手","ai.open":"打开 AI 助手","ai.close":"关闭","ai.placeholder":"问点关于 weave 的…(Enter 发送,Shift+Enter 换行)","ai.send":"发送","ai.stop":"停止生成","ai.clear":"清空对话","ai.empty":"还没有对话。助手只回答 weave 相关问题——可直接提问。","ai.docsMissing":"(未找到 docs/,仅使用内置技能)","ai.intro":"回答范围仅限 weave(功能、用法、配置、技能),越界会拒答。","ai.thinking":"正在生成…","ai.emptyAnswer":"(没有返回内容——请检查模型名与接口地址)","ai.failed":"AI 请求失败:{error}","settings.ai":"AI 助手","settings.aiHint":"配置好 OpenAI 兼容端点后,右下角出现助手按钮。API key 只保存在服务端,不会回显到浏览器。","settings.aiBaseUrl":"API 地址","settings.aiBaseUrlPlaceholder":"https://api.example.com/v1","settings.aiModel":"模型","settings.aiModelPlaceholder":"gpt-4o-mini","settings.aiModelFetch":"拉取模型","settings.aiModelFetchTip":"拉取该地址可用的模型(地址与 key 齐了会自动拉一次)","settings.aiApiKey":"API Key","settings.aiApiKeySet":"已设置(留空 = 保持不变)","settings.aiApiKeyUnset":"未设置","settings.aiApiKeyClear":"清除","settings.aiApiKeyShow":"显示","settings.aiApiKeyHide":"隐藏"},A9={"ai.title":"AI assistant","ai.open":"Open the AI assistant","ai.close":"Close","ai.placeholder":"Ask about weave… (Enter to send, Shift+Enter for a newline)","ai.send":"Send","ai.stop":"Stop generating","ai.clear":"Clear chat","ai.empty":"No messages yet. The assistant answers weave questions only — just ask.","ai.docsMissing":" (docs/ not found — using built-in skills only)","ai.intro":"Scope is limited to weave (features, usage, config, skills); off-topic asks are declined.","ai.thinking":"Generating…","ai.emptyAnswer":"(No content returned — check the model name and base URL.)","ai.failed":"AI request failed: {error}","settings.ai":"AI assistant","settings.aiHint":"Point this at an OpenAI-compatible endpoint and the assistant button appears bottom-right. The API key is stored server-side and never sent back to the browser.","settings.aiBaseUrl":"API base URL","settings.aiBaseUrlPlaceholder":"https://api.example.com/v1","settings.aiModel":"Model","settings.aiModelPlaceholder":"gpt-4o-mini","settings.aiModelFetch":"Fetch models","settings.aiModelFetchTip":"Fetch the models available at this base URL (auto-fetched once URL and key are set)","settings.aiApiKey":"API key","settings.aiApiKeySet":"Set (leave blank to keep)","settings.aiApiKeyUnset":"Not set","settings.aiApiKeyClear":"Clear","settings.aiApiKeyShow":"Show","settings.aiApiKeyHide":"Hide"},qM={...r9,...a9,...o9,...u9,...f9,...p9,...g9,...x9,...v9,...w9,...N9,..._9,...T9},M9={...i9,...l9,...c9,...d9,...h9,...m9,...b9,...y9,...k9,...S9,...E9,...C9,...A9},ES={"zh-CN":qM,en:M9};function j9(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>s in t?String(t[s]):n):e}function R9(e,t){return(n,s)=>j9(e[n]??t[n]??String(n),s)}const YM=b.createContext(null);function O9(){try{const e=localStorage.getItem(KM);return e==="zh-CN"||e==="en"?e:Sx}catch{return Sx}}function _S(e){try{localStorage.setItem(KM,e)}catch{}}function D9({children:e}){const[t,n]=b.useState(O9);b.useEffect(()=>{let i=!0;return Ce.getDaemonSettings().then(a=>{if(!i)return;const l=a.settings.locale;GM.includes(l)&&(n(l),_S(l))}).catch(()=>{}),()=>{i=!1}},[]),b.useEffect(()=>{document.documentElement.lang=t},[t]);const s=b.useMemo(()=>R9(ES[t],ES[Sx]),[t]),r=b.useMemo(()=>({locale:t,t:s,setLocale:i=>{n(i),_S(i)}}),[t,s]);return o.jsx(YM.Provider,{value:r,children:e})}function VM(){const e=b.useContext(YM);if(!e)throw new Error("useI18n must be used inside <I18nProvider>");return e}function We(){return VM().t}function Rl({harness:e,running:t=!1,className:n}){if(e&&e in dc){const r=dc[e],i=r.icon;return o.jsx("span",{className:de("inline-flex shrink-0",t&&r.runAnimation,n),children:o.jsx(i,{className:de("h-3.5 w-3.5",t?r.iconRunning:r.iconIdle)})})}const s=Kn(null);return o.jsx(gn,{className:de("h-3.5 w-3.5 shrink-0",t?"animate-spin text-orange-400":s.iconIdle,n)})}function lt({state:e,icon:t,className:n}){return o.jsx("span",{className:"pointer-events-none inline-flex items-center",children:e==="loading"?o.jsx(gn,{className:de("animate-spin",n)}):e==="success"?o.jsx(mr,{className:de("text-emerald-400",n)}):t??null})}function Mi({open:e,title:t,message:n,confirmLabel:s,onConfirm:r,onClose:i}){const a=We();return e?sn.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:i}),o.jsxs("div",{className:"relative w-[380px] max-w-full rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac overflow-hidden flex flex-col",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx(yl,{className:"h-4 w-4 text-amber-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:t}),o.jsx("button",{onClick:i,className:"ml-auto p-1 rounded text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",title:a("common.close"),children:o.jsx(Vt,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"px-4 py-4",children:o.jsx("p",{className:"text-xs leading-relaxed text-neutral-400",children:n})}),o.jsxs("footer",{className:"shrink-0 border-t border-edge/[0.06] px-4 py-2.5 flex items-center justify-end gap-2 frosted",children:[o.jsx("button",{onClick:i,className:"rounded-lg bg-neutral-800 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-700",children:a("common.cancel")}),o.jsx("button",{onClick:()=>{r(),i()},className:"rounded-lg bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-500",children:s})]})]})]}),document.body):null}function XM({title:e,onClose:t,children:n,footer:s}){const r=We();return b.useEffect(()=>{const i=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t]),sn.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:t,children:o.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-edge/[0.08] bg-neutral-900 p-3 shadow-mac",onClick:i=>i.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsx("p",{className:"text-xs font-medium text-neutral-200",children:e}),o.jsx("button",{type:"button",title:r("tasks.terminalPickCancel"),"aria-label":r("tasks.terminalPickCancel"),onClick:t,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(Vt,{className:"h-3.5 w-3.5"})})]}),n,s]})}),document.body)}function I9({targets:e,busy:t,onPick:n,onClose:s}){const r=We();return o.jsx(XM,{title:r("tasks.terminalPickTitle"),onClose:s,children:o.jsx("ul",{className:"max-h-72 space-y-1 overflow-y-auto",children:e.map(i=>o.jsx("li",{children:o.jsxs("button",{type:"button",disabled:t||i.full,onClick:()=>n(i.id),title:i.full?r("tasks.terminalTargetFullTip"):void 0,className:"w-full rounded-lg border border-edge/[0.06] bg-edge/[0.02] px-2.5 py-2 text-left transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.06] disabled:opacity-50",children:[o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",children:i.title??r("tasks.terminalTargetFallback",{w:i.windowId,t:i.tabId})}),i.full&&o.jsx("span",{className:"shrink-0 rounded bg-amber-900/40 px-1 text-[10px] text-amber-300",children:r("tasks.terminalTargetFull",{n:i.paneCount})}),i.active&&o.jsx("span",{className:"shrink-0 rounded bg-emerald-900/40 px-1 text-[10px] text-emerald-300",children:r("tasks.terminalTargetActive")})]}),o.jsxs("span",{className:"mt-0.5 block text-[10px] text-neutral-500",children:[r("tasks.terminalTargetDetail",{match:i.matchCount,total:i.paneCount})," · ",r("tasks.terminalTargetFallback",{w:i.windowId,t:i.tabId})]})]})},i.id))})})}function L9({panes:e,onConfirm:t,onClose:n}){const s=We(),[r,i]=b.useState(()=>new Set),a=l=>i(c=>{const u=new Set(c);return u.has(l)?u.delete(l):u.add(l),u});return o.jsx(XM,{title:s("tasks.closeTerminalPickTitle"),onClose:n,footer:o.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[o.jsx("button",{type:"button",onClick:n,className:"rounded-lg bg-neutral-800 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-700",children:s("common.cancel")}),o.jsx("button",{type:"button",disabled:r.size===0,onClick:()=>t([...r]),className:"rounded-lg bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-500 disabled:opacity-50",children:s("tasks.closeTerminalConfirmLabel",{n:r.size})})]}),children:o.jsx("ul",{className:"max-h-72 space-y-1 overflow-y-auto",children:e.map(l=>{const c=r.has(l.id);return o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>a(l.id),className:de("w-full rounded-lg border px-2.5 py-2 text-left transition-colors",c?"border-blue-500 bg-blue-500/10":"border-edge/[0.06] bg-edge/[0.02] hover:border-edge/[0.16] hover:bg-edge/[0.06]"),children:[o.jsx("span",{className:"block truncate text-xs text-neutral-200",children:l.title??s("tasks.closePaneFallback")}),l.cwd&&o.jsx("span",{className:"mt-0.5 block truncate text-[10px] text-neutral-500",children:l.cwd})]})},l.id)})})})}function P9(e,t){return[...e,t]}function z9(e,t){return e.filter(n=>n.id!==t)}const U9={success:3e3,info:4e3,error:8e3},F9=2e3;function B9(e,t){return t==="start"?"loading":e!=="loading"?e:t==="ok"?"success":"idle"}function H9(e){return e!=="loading"}const CS={success:{box:"border-emerald-500/30 bg-emerald-950/80 text-emerald-100",icon:o.jsx(g6,{className:"mt-px h-3.5 w-3.5 shrink-0 text-emerald-400"})},error:{box:"border-red-500/30 bg-red-950/80 text-red-100",icon:o.jsx(b6,{className:"mt-px h-3.5 w-3.5 shrink-0 text-red-400"})},info:{box:"border-edge/[0.08] bg-neutral-900/90 text-neutral-200",icon:o.jsx(R6,{className:"mt-px h-3.5 w-3.5 shrink-0 text-neutral-400"})}},QM=b.createContext(null);function $9({children:e}){const[t,n]=b.useState([]),s=b.useRef(1),r=b.useCallback(l=>{n(c=>z9(c,l))},[]),i=b.useCallback((l,c)=>{const u=s.current++;n(d=>P9(d,{id:u,kind:l,message:c})),setTimeout(()=>r(u),U9[l])},[r]),a=b.useMemo(()=>({show:i}),[i]);return o.jsxs(QM.Provider,{value:a,children:[e,o.jsx("div",{className:"pointer-events-none fixed bottom-20 right-4 z-[60] flex w-80 flex-col gap-2",children:t.map(l=>o.jsxs("div",{role:"status",className:`pointer-events-auto flex items-start gap-2 rounded-lg border px-3 py-2 text-xs shadow-mac backdrop-blur ${CS[l.kind].box}`,children:[CS[l.kind].icon,o.jsx("span",{className:"min-w-0 flex-1 break-words",children:l.message}),o.jsx("button",{type:"button",onClick:()=>r(l.id),className:"shrink-0 rounded p-0.5 text-current/60 hover:text-current",children:o.jsx(Vt,{className:"h-3 w-3"})})]},l.id))})]})}function tn(){const e=b.useContext(QM);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function dn(){const[e,t]=b.useState({}),n=b.useRef({}),{show:s}=tn(),r=b.useRef({}),i=b.useCallback((c,u)=>{r.current={...r.current,[c]:B9(r.current[c]??"idle",u)},t(r.current)},[]);b.useEffect(()=>()=>{for(const c of Object.values(n.current))clearTimeout(c)},[]);const a=b.useCallback(async(c,u,d)=>{if(H9(r.current[c]??"idle")){i(c,"start");try{await u(),i(c,"ok"),clearTimeout(n.current[c]),n.current[c]=setTimeout(()=>{r.current={...r.current,[c]:"idle"},t(r.current)},F9)}catch(f){i(c,"fail"),s("error",d.fail(f))}}},[i,s]);return{stateOf:b.useCallback(c=>e[c]??"idle",[e]),run:a}}function qe(e){return e instanceof Error?e.message:String(e)}const G9=450,TS=8;function K9({projects:e,selectedId:t,globalActive:n,onSelect:s,onSelectGlobal:r,onOpenExplorer:i,onOpenTerminal:a,onHoverProject:l,updatesOf:c,needsInitOf:u,onSyncNow:d,syncStateOf:f,openExplorerStateOf:h,openTerminalStateOf:p,onCloseTerminal:m,closeTerminalStateOf:k,sessionStatsOf:w,terminalsOf:g,onReorder:y,archivedProjects:x=[],onArchive:S,onRestore:A,restoreStateOf:E}){const M=We(),{show:j}=tn(),O=Si("(pointer: fine)"),N=ed(Gd,{activationConstraint:{distance:5}}),F=ed(Pv,{activationConstraint:{delay:200,tolerance:8}}),G=Ov(O?N:F),[H,I]=b.useState(!1),[L,C]=b.useState(null),[D,U]=b.useState(null);b.useEffect(()=>{H&&x.length===0&&I(!1)},[H,x.length]);const B=q=>{const{active:Y,over:V}=q;if(!V||Y.id===V.id)return;const ee=e.findIndex(ye=>ye.id===Number(Y.id)),oe=e.findIndex(ye=>ye.id===Number(V.id));ee<0||oe<0||y==null||y(xm(e,ee,oe).map(ye=>ye.id))},[R,_]=b.useState(null),K=b.useRef(null);b.useEffect(()=>{if(!R)return;const q=Y=>{var V;(V=K.current)!=null&&V.contains(Y.target)||_(null)};return window.addEventListener("pointerdown",q,!0),window.addEventListener("contextmenu",q,!0),window.addEventListener("scroll",q,{capture:!0,passive:!0}),window.addEventListener("keydown",q),()=>{window.removeEventListener("pointerdown",q,!0),window.removeEventListener("contextmenu",q,!0),window.removeEventListener("scroll",q,!0),window.removeEventListener("keydown",q)}},[R]);const T=b.useRef(!1),X=b.useRef(null),ne=()=>{X.current&&(window.clearTimeout(X.current.timer),X.current=null)},J=q=>Y=>{if(T.current=!1,O||Y.button!==0)return;const{clientX:V,clientY:ee}=Y,oe=window.setTimeout(()=>{X.current=null,T.current=!0,_({x:V,y:ee,project:q})},G9);X.current={x:V,y:ee,timer:oe}},pe=q=>{const Y=X.current;Y&&(Math.abs(q.clientX-Y.x)>TS||Math.abs(q.clientY-Y.y)>TS)&&ne()};return o.jsxs("div",{className:"flex flex-col",children:[o.jsx("p",{className:"px-4 pt-2 pb-1 text-[11px] text-neutral-500 uppercase tracking-wide",children:M("project.globalConfig")}),o.jsx("div",{className:"px-2",children:o.jsxs("button",{onClick:r,className:de("w-full flex items-center gap-2 rounded-lg px-2 py-2 text-left transition-colors duration-200",n?"bg-neutral-800/80":"hover:bg-neutral-800/50"),children:[o.jsx(xl,{className:de("h-3.5 w-3.5 shrink-0",n?"text-emerald-400":"text-neutral-500")}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm",children:M("project.globalConfig")}),o.jsx("span",{className:"block text-[11px] text-neutral-500",children:M("project.globalSubtitle")})]})]})}),o.jsxs("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1",children:[o.jsx("p",{className:"flex-1 text-[11px] text-neutral-500 uppercase tracking-wide",children:M("project.sectionHeader")}),x.length>0&&o.jsxs("button",{type:"button","aria-label":M("project.archivedCount",{n:x.length}),title:M("project.archivedCount",{n:x.length}),onClick:()=>I(!0),className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-neutral-500 transition-colors hover:text-neutral-200 hover:bg-neutral-800/50",children:[o.jsx(Of,{className:"h-3 w-3"}),x.length]})]}),e.length===0&&o.jsx("p",{className:"p-3 text-xs text-neutral-500",children:M("project.noneRegistered")}),o.jsx("ul",{className:"p-2 space-y-1",children:o.jsx(zv,{sensors:G,onDragEnd:B,children:o.jsx(IM,{items:e.map(q=>q.id),strategy:mz,children:e.map(q=>{const Y=c==null?void 0:c(q.id),V=u==null?void 0:u(q.id),ee=(w==null?void 0:w(q.id))??[],oe=(g==null?void 0:g(q.id))??0;return o.jsx(q9,{id:q.id,children:({setNodeRef:ye,style:Re,attributes:se,listeners:Q,isDragging:Te})=>{var xe;return o.jsxs("li",{ref:ye,style:Re,className:de("group relative rounded-xl border transition-colors duration-200",!n&&t===q.id?"border-edge/[0.14] bg-neutral-800/60":"border-edge/[0.06] bg-neutral-900/50 hover:border-edge/[0.10]",Te&&"z-10 opacity-80"),onMouseEnter:()=>l==null?void 0:l(q.id),children:[o.jsxs("div",{className:"flex items-start",children:[o.jsx("span",{...se,...Q,title:M("project.dragToReorder"),className:"ml-1 mt-2 shrink-0 cursor-grab touch-none rounded p-0.5 text-neutral-600 transition-colors hover:text-neutral-300 active:cursor-grabbing",children:o.jsx(cM,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{onClick:()=>{if(T.current){T.current=!1;return}s(q)},onPointerDown:J(q),onPointerMove:pe,onPointerUp:ne,onPointerCancel:ne,onContextMenu:ve=>{ve.preventDefault(),ve.stopPropagation(),O&&_({x:ve.clientX,y:ve.clientY,project:q})},className:de("min-w-0 flex-1 flex items-start gap-2 rounded-lg px-1.5 py-1.5 text-left transition-colors duration-200","hover:bg-edge/[0.04]"),children:[o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm",title:q.name,children:q.name}),o.jsx("span",{className:"block truncate text-[11px] text-neutral-500",title:q.path,children:q.path}),(((xe=q.harnesses)==null?void 0:xe.length)??0)>0&&o.jsx("span",{className:"mt-1 flex flex-wrap items-center gap-1",title:M("project.harnessesTip"),children:q.harnesses.map(ve=>o.jsx(xr,{agent:ve.id},ve.id))})]}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5 mt-1.5",children:[o.jsx(V9,{counts:ee}),o.jsx(Q9,{projectId:q.id})]})]})]}),o.jsxs("div",{className:"flex items-center gap-1 px-2 pb-1 pl-9",children:[V&&o.jsx("span",{title:M("project.needsInitTip"),className:"shrink-0 rounded-full bg-amber-900/40 px-1.5 text-[10px] leading-4 text-amber-300",children:M("project.needsInit")}),o.jsxs("span",{className:"relative",children:[o.jsx(Uf,{title:`${Y?M("project.syncPending",{n:Y}):M("project.syncNow")}
485
+
486
+ ${M("app.scopeCoverageTooltip")}`,onClick:()=>d==null?void 0:d(q),children:o.jsx(lt,{state:(f==null?void 0:f(q.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(uc,{className:de("h-3.5 w-3.5",Y?"text-orange-300":"text-neutral-400")})})}),!!Y&&o.jsx("span",{className:"pointer-events-none absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-orange-500"})]}),o.jsx(Uf,{title:M("project.openInExplorer"),onClick:()=>i(q),children:o.jsx(lt,{state:(h==null?void 0:h(q.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(lM,{className:"h-3.5 w-3.5"})})}),o.jsxs("span",{className:"relative",children:[o.jsx(Uf,{title:oe>0?`${M("project.terminalsOpen",{n:oe})}
487
+
488
+ ${M("project.openInTerminal")}`:M("project.openInTerminal"),onClick:()=>a(q),children:o.jsx(lt,{state:(p==null?void 0:p(q.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(Bv,{className:de("h-3.5 w-3.5",oe>0&&"text-emerald-400")})})}),oe>0&&o.jsx("span",{className:"pointer-events-none absolute -top-1 -right-1.5 rounded-full bg-emerald-900/80 px-1 text-[9px] leading-3 text-emerald-300",children:oe})]}),oe>0&&m&&o.jsx(Uf,{danger:!0,title:M("project.closeTerminal",{n:oe}),onClick:()=>{Ce.listProjectPanes(q.id).then(ve=>U({project:q,panes:ve})).catch(ve=>j("error",M("errors.closeTerminalFailed",{error:qe(ve)})))},children:o.jsx(lt,{state:(k==null?void 0:k(q.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(Yl,{className:"h-3.5 w-3.5"})})})]})]})}},q.id)})})})}),H&&sn.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:()=>I(!1)}),o.jsxs("div",{className:"relative w-[680px] max-w-full rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac overflow-hidden flex flex-col",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx(Of,{className:"h-4 w-4 text-neutral-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:M("project.archivedSection")}),o.jsx("span",{className:"text-xs text-neutral-500",children:x.length}),o.jsx("button",{onClick:()=>I(!1),className:"ml-auto p-1 rounded text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",title:M("common.close"),children:o.jsx(Vt,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"p-4 max-h-[60vh] overflow-y-auto",children:o.jsx("div",{className:"grid grid-cols-3 gap-3",children:x.map(q=>o.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-edge/[0.06] bg-neutral-900/50 p-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Of,{className:"h-4 w-4 shrink-0 text-neutral-600"}),o.jsx("span",{className:"truncate text-sm text-neutral-200",title:q.name,children:q.name})]}),o.jsx("p",{className:"text-[11px] text-neutral-500 truncate",title:q.path,children:q.path}),q.archivedAt&&o.jsx("p",{className:"text-[11px] text-neutral-600",children:M("project.archivedOn",{date:new Date(q.archivedAt).toLocaleString()})}),o.jsxs("button",{type:"button",onClick:()=>A==null?void 0:A(q),title:M("project.restoreTooltip"),className:"mt-auto inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge/[0.08] bg-edge/[0.03] px-2.5 py-1.5 text-xs text-neutral-300 transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08] hover:text-neutral-100",children:[o.jsx(lt,{state:(E==null?void 0:E(q.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(h6,{className:"h-3.5 w-3.5"})}),M("project.restore")]})]},q.id))})})]})]}),document.body),o.jsx(Mi,{open:L!==null,title:M("project.archive"),message:L?M("project.archiveConfirm",{name:L.name}):"",confirmLabel:M("common.confirm"),onConfirm:()=>{L&&(S==null||S(L))},onClose:()=>C(null)}),D&&o.jsx(L9,{panes:D.panes,onConfirm:q=>{const{project:Y}=D;U(null),m==null||m(Y,q)},onClose:()=>U(null)}),R&&sn.createPortal(o.jsxs("div",{ref:K,style:{left:Math.min(R.x,window.innerWidth-200),top:Math.min(R.y,window.innerHeight-88)},className:"fixed z-50 w-48 rounded-lg border border-edge/[0.08] bg-neutral-900 shadow-mac py-1",onContextMenu:q=>q.preventDefault(),children:[o.jsx("p",{className:"px-3 pb-1 pt-0.5 text-[10px] text-neutral-500 truncate",title:R.project.path,children:R.project.name}),o.jsx(Y9,{icon:o.jsx(Of,{className:"h-3.5 w-3.5"}),label:M("project.archive"),onClick:()=>{C(R.project),_(null)}})]}),document.body)]})}function q9({id:e,children:t}){const{attributes:n,listeners:s,setNodeRef:r,transform:i,transition:a,isDragging:l}=PM({id:e}),c={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:a??void 0,position:"relative"};return t({setNodeRef:r,style:c,attributes:n,listeners:s,isDragging:l})}function Y9({icon:e,label:t,onClick:n}){return o.jsxs("button",{onClick:n,className:"w-full flex items-center gap-2 px-3 py-1.5 text-left text-xs text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx("span",{className:"text-neutral-400",children:e}),t]})}function Uf({title:e,pressed:t,onClick:n,danger:s,children:r}){return o.jsx("button",{type:"button",title:e,"aria-label":e,"aria-pressed":t,onClick:i=>{i.stopPropagation(),n()},className:de("pointer-events-auto [&_svg]:pointer-events-none inline-flex h-5 w-5 items-center justify-center rounded border border-edge/[0.08] bg-edge/[0.02] transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08]",s?"text-red-400 hover:border-red-500/30 hover:bg-red-500/10 hover:text-red-300":"text-neutral-400 hover:text-neutral-100"),children:r})}function V9({counts:e}){const t=We();return o.jsx(o.Fragment,{children:e.map(n=>o.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[n.running>0&&o.jsxs("span",{className:"flex items-center gap-0.5",title:t("project.sessionsRunning",{n:n.running}),children:[o.jsx(Rl,{harness:n.harness,running:!0}),o.jsx("span",{className:"text-[10px] font-medium text-orange-300",children:n.running})]}),n.open>0&&o.jsxs("span",{className:"flex items-center gap-0.5",title:t("project.sessionsOpen",{n:n.open}),children:[o.jsx(Rl,{harness:n.harness}),o.jsx("span",{className:"text-[10px] font-medium text-neutral-400",children:n.open})]})]},n.harness??"unknown"))})}const X9={"instruction-link-not-materialised":"health.check.instructionLinkNotMaterialised","instruction-files-duplicated":"health.check.instructionFilesDuplicated","instruction-link-dangling":"health.check.instructionLinkDangling","statusline-path-unresolved":"health.check.statuslinePathUnresolved","statusline-path-foreign":"health.check.statuslinePathForeign","statusline-script-missing":"health.check.statuslineScriptMissing"};function Q9({projectId:e}){const t=We(),{data:n}=vp({queryKey:["harnessChecks",e],queryFn:()=>Ce.getHarnessChecks(e),staleTime:6e4}),s=n?n.checks.filter(i=>!i.ok):null;if(s===null)return null;if(s.length===0)return o.jsx("span",{title:t("health.okTip"),className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"});const r=[t("health.badgeTip",{count:s.length}),...s.flatMap(i=>{const a=X9[i.id];return a?[t(a,i.params)]:[]})].join(`
489
+ `);return o.jsx("span",{title:r,className:"shrink-0",children:o.jsx(yl,{className:"h-3.5 w-3.5 text-amber-400"})})}const Qd={claude:{open:"UserPromptSubmit",close:["Stop","StopFailure"],closeFailed:["StopFailure"],sessionMarkers:["SessionStart","SessionEnd"],subagentStop:"SubagentStop",questionTools:["AskUserQuestion","ExitPlanMode"],sessionExit:"SessionEnd"},codex:{open:"",close:[],closeFailed:[],sessionMarkers:[],subagentStop:"",questionTools:[],sessionExit:null}},qv={claude:{start:"PreCompact",end:"SessionStart",endSource:"compact"},codex:{start:null,end:null,endSource:null}},WM={claude:{modeNames:["default","acceptEdits","plan","auto","dontAsk","bypassPermissions"],modelNames:["default","opus","sonnet","haiku","fable"]},codex:{modeNames:[],modelNames:[]}};function ZM(e){var t;return e==null?[]:((t=WM[e])==null?void 0:t.modeNames)??[]}function W9(e){var t;return e==null?[]:((t=WM[e])==null?void 0:t.modelNames)??[]}const AS=["#cbd5e1","#38bdf8","#a78bfa","#2dd4bf","#fbbf24","#f87171"];function Z9(e,t){if(!t)return null;const n=ZM(e).indexOf(t);return n>=0?AS[n%AS.length]:null}function Yv(e,t,n){if(e==null)return!1;const s=qv[e];return!(s!=null&&s.end)||!s.endSource?!1:t===s.end&&n===s.endSource}const J9=3e4,eU=5*6e4,tU=10*6e4,nU=10*6e4;function sU(e){var l;if(e.overlay)return e.overlay;if(e.hasRunningDispatch||e.hasRunningSubagent)return"running";if(e.latestDispatchFailed)return"failed";if(e.latestEventType==="SessionEnd")return"closed";if(e.pidAlive===!1)return"terminated";const t=e.now??Date.now(),n=e.latestEventAt?Date.parse(e.latestEventAt):NaN,s=Date.parse(e.lastSeenAt),r=Math.max(Number.isNaN(n)?0:n,Number.isNaN(s)?0:s),i=r>0?t-r:Number.POSITIVE_INFINITY;if(e.interruptedAt!=null&&e.interruptedAt>r)return"interrupted";const a=e.harness!=null?(l=qv[e.harness])==null?void 0:l.start:null;return a!=null&&e.latestEventType===a&&i<tU?"compacting":e.turnOpen===!0&&i<eU?"running":e.turnOpen===!1?"open":i<J9?"running":"open"}function Io(e){return e==="running"||e==="compacting"}function rU(e){var t;return e==null?!1:!!((t=Qd[e])!=null&&t.open)}function iU(e,t){return e==="closed"||e==="terminated"||e==="failed"||e==="interrupted"?!1:t===!0?!0:t===!1?!1:Io(e)}const JM={running:"tasks.statusRunning",compacting:"tasks.statusCompacting",failed:"tasks.statusFailed",open:"tasks.statusOpen",closed:"tasks.statusClosed",terminated:"tasks.statusTerminated",interrupted:"tasks.statusInterrupted"},aU={running:"bg-orange-400",compacting:"bg-amber-400",failed:"bg-red-500",open:"bg-neutral-500",closed:"bg-neutral-700",terminated:"bg-rose-800",interrupted:"bg-slate-400"},ej={running:"bg-orange-900/50 text-orange-300",compacting:"bg-amber-900/50 text-amber-300",failed:"bg-red-900/50 text-red-300",open:"bg-neutral-800 text-neutral-300",closed:"bg-neutral-900 text-neutral-500",terminated:"bg-rose-950/60 text-rose-400",interrupted:"bg-slate-800 text-slate-300"};function lU(e,t){const n=new Map;for(const r of e){const i=t.get(r.sessionId)??"open";if(i!=="running"&&i!=="compacting"&&i!=="open"&&i!=="interrupted")continue;const a=r.harness!=null&&en.includes(r.harness)?r.harness:null;let l=n.get(a);l||(l={harness:a,running:0,open:0},n.set(a,l)),i==="open"||i==="interrupted"?l.open+=1:l.running+=1}const s=r=>r===null?en.length:en.indexOf(r);return[...n.values()].sort((r,i)=>s(r.harness)-s(i.harness))}const tj=b.createContext(null);function MS(e,t){const{terminal:n,alive:s,interrupted:r}=t;if(!n&&!s&&!r)return e;let i=!1;const a=e.map(l=>{var f;let c=l;const u=n==null?void 0:n[l.sessionId];u!==void 0&&((f=c.terminal)==null?void 0:f.id)!==(u==null?void 0:u.id)&&(c={...c,terminal:u});const d=s==null?void 0:s[l.sessionId];if(d!==void 0&&c.pidAlive!==d&&(c={...c,pidAlive:d}),r){const h=r[l.sessionId]??null;(c.interruptedAt??null)!==h&&(c={...c,interruptedAt:h})}return c!==l&&(i=!0),c});return i?a:e}function oU({children:e}){const t=wM(),[n,s]=b.useState(null),[r,i]=b.useState([]),[a,l]=b.useState(null),[c,u]=b.useState(new Map),[d,f]=b.useState(new Map),[h,p]=b.useState(new Map),[m,k]=b.useState(new Map),[w,g]=b.useState({}),y=b.useRef({}),x=b.useCallback(async()=>{const[j,O,N]=await Promise.allSettled([Ce.listSessions(),Ce.listHookDispatches({limit:200}),Ce.listQuestions()]);if(O.status==="fulfilled"&&i(O.value),N.status==="fulfilled"&&k(new Map(N.value.map(G=>[G.sessionId,G]))),j.status==="fulfilled")return s(()=>MS(j.value.sessions,y.current)),g(j.value.modelCatalog??{}),l(null),null;const F=j.reason instanceof Error?j.reason.message:String(j.reason);return l(F),F},[]);b.useEffect(()=>{t==="authenticated"&&x()},[t,x]),b.useEffect(()=>ko("inflightCounts",j=>{p(new Map(Object.entries(j.counts??{})))}),[]),b.useEffect(()=>{const j=()=>s(N=>N&&MS(N,y.current)),O=[ko("sessionLiveness",N=>{N.alive&&(y.current.alive=N.alive),j()}),ko("sessionInterrupt",N=>{N.interrupted&&(y.current.interrupted=N.interrupted),j()}),ko("terminalTopology",N=>{N.terminals&&(y.current.terminal=N.terminals),j()})];return()=>{for(const N of O)N()}},[]),b.useEffect(()=>{let j=null;const O=()=>{j!==null&&window.clearTimeout(j),j=window.setTimeout(()=>{j=null,x().then(()=>{u(new Map)})},500)},F=Ai(G=>{switch(G.kind){case"event.ingested":{if(!G.sessionId)break;const H=G.sessionId;if(G.backgroundTasks){const I=G.agentId,L=Date.now(),C=new Map;for(const D of G.backgroundTasks)D.status==="running"&&D.id!==I&&C.set(D.id,L);f(D=>{const U=new Map(D);return C.size?U.set(H,C):U.delete(H),U})}else if(G.eventType==="SubagentStop"&&G.agentId){const I=G.agentId;f(L=>{const C=L.get(H);if(!(C!=null&&C.has(I)))return L;const D=new Map(C);D.delete(I);const U=new Map(L);return D.size?U.set(H,D):U.delete(H),U})}else if(G.spawnAgentId||G.agentId){const I=G.spawnAgentId??G.agentId;f(L=>{const C=new Map(L),D=new Map(C.get(H)??[]);return D.set(I,Date.now()),C.set(H,D),C})}break}case"dispatch.started":{G.sessionId&&u(H=>new Map(H).set(G.sessionId,"running"));break}case"dispatch.finished":{if(!G.sessionId)break;u(H=>{const I=new Map(H);return G.status==="failed"||G.status==="timeout"?I.set(G.sessionId,"failed"):I.delete(G.sessionId),I});break}}O()});return()=>{F(),j!==null&&window.clearTimeout(j)}},[x]);const S=b.useMemo(()=>{const j=new Map;for(const O of r){if(!O.sessionId)continue;const N=j.get(O.sessionId)??[];N.push(O),j.set(O.sessionId,N)}return j},[r]),A=b.useMemo(()=>{const j=Date.now(),O=new Map;for(const N of n??[]){const F=S.get(N.sessionId)??[],G=F[0],H=d.get(N.sessionId);let I=!1;if(H){for(const L of H.values())if(j-L<nU){I=!0;break}}O.set(N.sessionId,sU({lastSeenAt:N.lastSeenAt,latestEventType:N.lastEventType??void 0,pidAlive:N.pidAlive??void 0,hasRunningDispatch:F.some(L=>L.status==="running"),hasRunningSubagent:I,latestDispatchFailed:G!==void 0&&(G.status==="failed"||G.status==="timeout"),overlay:c.get(N.sessionId),turnOpen:N.turnOpen,interruptedAt:N.interruptedAt??void 0,harness:N.harness,now:j}))}return O},[n,S,d,c]),E=b.useMemo(()=>{const j=new Map;for(const N of n??[]){if(N.projectId==null)continue;const F=j.get(N.projectId)??[];F.push(N),j.set(N.projectId,F)}const O=new Map;for(const[N,F]of j)O.set(N,lU(F,A));return O},[n,A]),M=b.useMemo(()=>({sessions:n,dispatches:r,statuses:A,projectStats:E,error:a,inflight:h,questions:m,modelCatalog:w,refresh:x}),[n,r,A,E,a,h,m,w,x]);return o.jsx(tj.Provider,{value:M,children:e})}function Wd(){const e=b.useContext(tj);if(!e)throw new Error("useSessionStatus must be used within SessionStatusProvider");return e}const nj=[{key:"tasks",labelKey:"catbar.tasks",icon:D6},{key:"orchestrate",labelKey:"catbar.orchestrate",icon:mx},{key:"files",labelKey:"catbar.files",icon:Bv},{key:"personalization",labelKey:"catbar.personalization",icon:bM},{key:"weave",labelKey:"catbar.hooks",icon:yM}];function cU({category:e,onSelect:t,data:n}){const s=We(),r=a=>{switch(a){case"files":return n.files;case"personalization":return 1;case"weave":return n.hooksRules;case"tasks":return n.sessions;case"orchestrate":return n.sessions}},i=a=>{switch(a){case"files":return n.outdated>0?o.jsx(Qe,{variant:"warning",children:s("catbar.updateBadge",{n:n.outdated})}):null;case"personalization":return n.statuslineSource?o.jsx(Qe,{variant:n.statuslineSource==="custom"?"skill":"default",children:n.statuslineSource==="custom"?s("catbar.custom"):s("catbar.followGlobal")}):null;default:return null}};return o.jsx("div",{className:"flex flex-wrap gap-2 p-2 border-b border-edge/[0.06] overflow-x-auto",children:nj.map(({key:a,labelKey:l,icon:c})=>{const u=e===a;return o.jsxs("button",{onClick:()=>t(a),className:de("flex-1 min-w-[6.5rem] flex flex-wrap items-center gap-x-2 gap-y-1 rounded-lg px-2 py-2 text-left","border border-edge/[0.08] transition-all duration-200 ease-mac",u?"bg-neutral-800/90 ring-1 ring-blue-500/50 shadow-mac-sm":"bg-neutral-900/40 hover:bg-neutral-800/60"),children:[o.jsx(c,{className:de("h-4 w-4 shrink-0",a==="files"&&"text-purple-400",a==="personalization"&&"text-cyan-400",a==="tasks"&&"text-rose-400",a==="orchestrate"&&"text-teal-400",a==="weave"&&"text-amber-400")}),o.jsxs("span",{className:"min-w-0 flex-auto",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:s(l)}),o.jsx("span",{className:"block truncate text-[11px] text-neutral-500",children:s("catbar.items",{n:r(a)})})]}),o.jsx("span",{className:"flex flex-wrap items-center gap-1",children:i(a)})]},a)})})}const Da=b.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:de("rounded-xl border border-edge/[0.08] bg-gradient-to-b from-neutral-800/70 to-neutral-900/70 shadow-mac-sm backdrop-blur-sm",e),...t}));Da.displayName="Card";const Ol=b.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:de("flex p-3 border-b border-edge/[0.06]",e),...t}));Ol.displayName="CardHeader";const Dl=b.forwardRef(({className:e,...t},n)=>o.jsx("h3",{ref:n,className:de("text-sm font-semibold tracking-tight",e),...t}));Dl.displayName="CardTitle";const Il=b.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:de("p-3",e),...t}));Il.displayName="CardContent";function ad(e){let t=0,n=0;for(const s of e)n+=s.skills.length,s.enabled!==!1&&(t+=s.skills.length);return{effective:t,total:n}}function ld(e,t){return t===0?"none":e===t?"ok":"partial"}const uU={ok:"bg-emerald-900/40 text-emerald-300",partial:"bg-amber-900/30 text-amber-300",none:"bg-neutral-800 text-neutral-500"};function od({tone:e,title:t,children:n}){return o.jsx("span",{className:de("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium tabular-nums",uU[e]),title:t,children:n})}const sj="__local__";function rj(e){const t=new Map;for(const s of e){const r=s.namespace??sj,i=t.get(r)??{key:r,...s.namespace!==void 0?{namespace:s.namespace}:{},groups:[]};i.groups.push(s),t.set(r,i)}const n=s=>s.namespace===void 0?1:s.groups.some(r=>r.provenance==="builtin")?0:2;return[...t.values()].sort((s,r)=>n(s)-n(r)||(s.namespace??"").localeCompare(r.namespace??""))}function vl(e,t){const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function dU(e){return e.endsWith("-plugin")?Xd(e):null}const fU={inherit:"on",on:"off",off:"inherit"},jS={inherit:"skillGrid.enableDefault",on:"skillGrid.enableOn",off:"skillGrid.enableOff"},RS={user:"skillGrid.scopeUser",project:"skillGrid.scopeProject",local:"skillGrid.scopeLocal"},hU=e=>e.installScopes.length>0?fU[e.enable]:e.enable==="on"?"off":"on";function Vv({row:e,update:t,canUninstall:n,readOnly:s,onUninstallSkill:r,onOpenDetail:i}){var w;const a=We(),{show:l}=tn(),c=dn(),u=`skill-uninstall:${e.scope}:${e.agent??"claude"}:${e.name}`,d=c.stateOf(u),[f,h]=b.useState(!1),p=()=>void c.run(u,async()=>{await r(e.name,e.scope,e.agent),l("success",a("skillGrid.uninstalled",{name:e.name}))},{fail:g=>a("errors.uninstallFailed",{error:qe(g)})}),m=((w=e.source)==null?void 0:w.endsWith("-personal"))??!1,k=e.scope==="user"&&m&&e.form!==void 0;return o.jsxs(Da,{children:[o.jsxs(Ol,{className:"items-center gap-2",children:[o.jsxs("button",{onClick:()=>i(e.name,e.scope,e.source,e.pluginKey,e.agent),className:"flex items-center gap-2 text-left flex-1 min-w-0",title:a("skillGrid.openDetail",{name:e.name}),children:[o.jsx(Oa,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx(Dl,{className:"truncate",children:e.name}),o.jsx(xr,{agent:e.agent,className:"ml-1"}),s?o.jsx(Qe,{variant:"settings",className:"ml-1",children:a("skillGrid.globalTag")}):e.scope==="project"&&o.jsx(Qe,{variant:"settings",className:"ml-1",children:a("library.scopeProject")}),e.files.length>0&&o.jsx(Qe,{variant:"skill",className:"ml-1",children:e.files.length}),(t==null?void 0:t.outdated)&&o.jsx(Qe,{variant:"warning",className:"ml-1",children:a("skillGrid.update")}),(t==null?void 0:t.custom)&&o.jsx(Qe,{variant:"other",className:"ml-1",children:a("skillGrid.custom")}),k&&o.jsx("span",{className:de("ml-1 shrink-0 rounded px-1 py-0.5 text-[10px]",e.form==="link"?"bg-neutral-800 text-neutral-400":"bg-amber-900/30 text-amber-300"),title:a("repo.formTip"),children:e.form==="link"?a("repo.formLink"):a("repo.formCopy")})]}),n&&!s&&o.jsx("button",{type:"button",disabled:d==="loading",onClick:()=>e.scope==="user"?h(!0):p(),className:"text-neutral-500 hover:text-red-400 shrink-0 disabled:cursor-not-allowed [&_svg]:pointer-events-none",title:a("skillGrid.uninstall",{name:e.name}),children:o.jsx(lt,{state:d,className:"h-3.5 w-3.5",icon:o.jsx(er,{className:"h-3.5 w-3.5"})})})]}),e.scope==="user"&&o.jsx(Mi,{open:f,title:a("skillGrid.uninstallGlobalTitle"),message:a("skillGrid.uninstallGlobalConfirm",{name:e.name}),confirmLabel:a("common.confirm"),onConfirm:p,onClose:()=>h(!1)})]})}function pU({skills:e,groups:t,globalGroupsReadOnly:n,updates:s,empty:r,onUninstallSkill:i,onOpenDetail:a,onCyclePluginState:l,onUninstallPlugin:c}){const u=We(),d=p=>s==null?void 0:s.find(m=>m.name===p);if(t!==void 0&&t.length>0)return o.jsx(OS,{groups:t,updates:s,onUninstallSkill:i,onOpenDetail:a,onCyclePluginState:l,onUninstallPlugin:c});const f=!!e&&e.length>0,h=!!n&&n.length>0;return!f&&!h?o.jsx("p",{className:"text-xs text-neutral-600 border border-dashed border-edge/[0.06] rounded-md p-3",children:r}):o.jsxs("div",{className:"space-y-4",children:[f&&o.jsxs("section",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:u("skillGrid.projectHeading")}),o.jsx("span",{className:"ml-auto rounded-full bg-neutral-800/60 text-neutral-400 px-2 py-0.5 text-[11px] font-medium tabular-nums",children:e.length})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 items-start",children:e.map(p=>o.jsx(Vv,{row:p,update:d(p.name),canUninstall:p.scope==="project",onUninstallSkill:i,onOpenDetail:a},`${p.scope}-${p.name}`))})]}),h&&o.jsx(OS,{groups:n,updates:s,onUninstallSkill:i,onOpenDetail:a,onCyclePluginState:l,readOnly:!0})]})}function Nx({effective:e,total:t}){const n=We(),s=t===0?n("skillGrid.effNone"):e===t?n("skillGrid.effAll",{n:t}):n("skillGrid.effDisabled",{n:t-e});return o.jsxs(od,{tone:ld(e,t),title:s,children:[o.jsx(Yl,{className:"h-3 w-3"}),n("skillGrid.effective",{done:e,total:t})]})}function mU({group:e,collapsed:t,onToggle:n,findUpdate:s,onUninstallSkill:r,onOpenDetail:i,onCyclePluginState:a,onUninstallPlugin:l,readOnly:c}){var E;const u=We(),d=dn(),{show:f}=tn(),[h,p]=b.useState(!1),m=e.source.endsWith("-plugin"),k=dU(e.source),w=ad([e]),g=m&&!!e.installSurface&&!!l&&!c&&!!e.pluginKey,y=m&&!!k&&!!a&&(((E=e.scopeStates)==null?void 0:E.length)??0)>0,x=`pack-uninstall:${e.pluginKey??"-"}`,S=d.stateOf(x),A=()=>{!e.pluginKey||!l||d.run(x,async()=>{await l(k,e.pluginKey),f("success",u("skillGrid.packUninstalled",{label:e.label}))},{fail:M=>u("errors.uninstallFailed",{error:qe(M)})})};return o.jsxs("div",{className:"rounded-xl border border-edge/[0.06] bg-neutral-900/40 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),n())},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-edge/[0.02] cursor-pointer",children:[t?o.jsx(Yn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(_n,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(oM,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-300 truncate",children:e.label}),e.pluginKey&&o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",title:u("skillGrid.keyTip"),children:e.pluginKey}),o.jsx(Qe,{variant:m?"mcp":"skill",className:"ml-1",children:u(m?"skillGrid.plugin":"repo.local")}),o.jsx(xr,{agent:Xd(e.source)??void 0}),o.jsx(Nx,{effective:w.effective,total:w.total}),y&&o.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1",children:e.scopeStates.map(M=>{const j=`plugin-state:${k}:${e.pluginKey}:${M.scope}`;return o.jsxs("button",{type:"button",disabled:d.stateOf(j)==="loading",onClick:O=>{O.stopPropagation(),d.run(j,async()=>{await a(k,e.pluginKey,M.scope,hU(M))},{fail:N=>u("errors.pluginToggleFailed",{error:qe(N)})})},title:u("skillGrid.enableTip",{scope:u(RS[M.scope]),state:u(jS[M.enable])}),className:de("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium disabled:cursor-not-allowed [&_svg]:pointer-events-none",M.enable==="on"?"bg-emerald-900/40 text-emerald-300":"bg-neutral-800 text-neutral-500"),children:[o.jsx(lt,{state:d.stateOf(j),className:"h-3 w-3",icon:o.jsx(Yl,{className:"h-3 w-3"})}),u(RS[M.scope]),"·",u(jS[M.enable])]},M.scope)})}),g&&o.jsx("button",{type:"button",disabled:S==="loading",onClick:M=>{M.stopPropagation(),p(!0)},className:de("shrink-0 text-neutral-500 hover:text-red-400 disabled:cursor-not-allowed [&_svg]:pointer-events-none",!y&&"ml-auto"),title:u("skillGrid.uninstallPackTitle"),children:o.jsx(lt,{state:S,className:"h-3.5 w-3.5",icon:o.jsx(er,{className:"h-3.5 w-3.5"})})})]}),!t&&o.jsx("div",{className:"px-3 pb-3 pt-1",children:e.skills.length===0?o.jsx("p",{className:"text-xs text-neutral-600 py-2",children:u("common.empty")}):o.jsx("div",{className:"grid grid-cols-2 gap-3 items-start",children:e.skills.map(M=>o.jsx(Vv,{row:M,update:s(M.name),canUninstall:!1,readOnly:c,onUninstallSkill:r,onOpenDetail:i},`${M.scope}-${M.agent??"claude"}-${M.name}`))})}),o.jsx(Mi,{open:h,title:u("skillGrid.uninstallPackTitle"),message:u("skillGrid.uninstallPackConfirm",{key:e.pluginKey??""}),confirmLabel:u("common.confirm"),onConfirm:A,onClose:()=>p(!1)})]})}function OS({groups:e,updates:t,onUninstallSkill:n,onOpenDetail:s,onCyclePluginState:r,onUninstallPlugin:i,readOnly:a}){const l=We(),c=x=>t==null?void 0:t.find(S=>S.name===x),u=b.useMemo(()=>rj(e),[e]),d=b.useMemo(()=>e.map(x=>`${x.source}:${x.pluginKey??"-"}`),[e]),[f,h]=b.useState(new Set([sj])),[p,m]=b.useState(new Set),k=f.size>0||p.size>0,w=()=>{k?(h(new Set),m(new Set)):(h(new Set(u.map(x=>x.key))),m(new Set(d)))},{effective:g,total:y}=ad(e);return o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:[l("skillGrid.globalHeading"),a&&o.jsx("span",{className:"ml-1 text-[10px] text-neutral-600 normal-case",children:l("skillGrid.readOnly")})]}),o.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[o.jsx(Nx,{effective:g,total:y}),o.jsxs("button",{onClick:w,className:"inline-flex items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-2 py-0.5 text-[11px] hover:bg-neutral-700",title:l(k?"skillGrid.collapseAllGroups":"skillGrid.expandAllGroups"),children:[k?o.jsx(Kd,{className:"h-3 w-3"}):o.jsx(qd,{className:"h-3 w-3"}),l(k?"skillGrid.collapseAll":"skillGrid.expandAll")]})]})]}),o.jsx("div",{className:"space-y-3",children:u.map(x=>{const S=x.namespace,A=S===void 0,E=!f.has(x.key),M=ad(x.groups),j=x.groups.reduce((O,N)=>O+N.skills.length,0);return o.jsxs("div",{className:"rounded-2xl border border-edge/[0.08] bg-neutral-900/60 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>h(O=>vl(O,x.key)),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),h(N=>vl(N,x.key)))},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-edge/[0.03] cursor-pointer",children:[E?o.jsx(Yn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(_n,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(nd,{className:"h-3.5 w-3.5 shrink-0 text-violet-400"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-200 truncate",children:A?l("repo.local"):S}),!A&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",title:l("repo.namespaceTip"),children:l("repo.packCount",{n:x.groups.length})}),A&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",title:l("repo.formTip"),children:l("repo.formLegend")}),o.jsx(Qe,{variant:"skill",className:"ml-1",children:j}),o.jsx(Nx,{effective:M.effective,total:M.total})]}),!E&&(A?o.jsx("div",{className:"px-3 pb-3 pt-1",children:j===0?o.jsx("p",{className:"text-xs text-neutral-600 py-2",children:l("common.empty")}):o.jsx("div",{className:"grid grid-cols-2 gap-3 items-start",children:x.groups.flatMap(O=>O.skills).map(O=>o.jsx(Vv,{row:O,update:c(O.name),canUninstall:!a,readOnly:a,onUninstallSkill:n,onOpenDetail:s},`${O.scope}-${O.agent??"claude"}-${O.name}`))})}):o.jsx("div",{className:"px-3 pb-3 pt-1 space-y-2",children:x.groups.map(O=>{const N=`${O.source}:${O.pluginKey??"-"}`;return o.jsx(mU,{group:O,collapsed:!p.has(N),onToggle:()=>m(F=>vl(F,N)),findUpdate:c,onUninstallSkill:n,onOpenDetail:s,onCyclePluginState:r,onUninstallPlugin:i,readOnly:a},N)})}))]},x.key)})})]})}function gU(e){const t=new Map;for(const n of e){const s=n.relPath.match(/^[^/]+\/skills\/([^/]+)\//);if(!s)continue;const r=s[1],i=`${n.agent??""}\0${r}`,a=t.get(i)??{name:r,agent:n.agent,files:[]};a.files.push(n),t.set(i,a)}return[...t.values()].map(({name:n,agent:s,files:r})=>({name:n,scope:"project",agent:s,files:r})).sort((n,s)=>n.name.localeCompare(s.name))}const bU={inherit:"on",on:"off",off:"inherit"},DS={inherit:"mcp.enableDefault",on:"mcp.enableOn",off:"mcp.enableOff"},xU=e=>e.scope==="user"?"user":"project";function yU({rows:e,scope:t,updates:n,empty:s,onUninstallMcp:r,onCycleMcpEnable:i}){const a=We(),{show:l}=tn(),c=dn(),u=f=>{const h=`mcp-enable:${f.key}`;c.stateOf(h)!=="loading"&&c.run(h,async()=>i(f.key,bU[f.enable??"inherit"]),{fail:p=>a("mcp.enableFailed",{error:qe(p)})})};if(e.length===0)return o.jsx("p",{className:"text-xs text-neutral-600 border border-dashed border-edge/[0.06] rounded-md p-3",children:s});const d=(f,h)=>!!(n!=null&&n.find(p=>p.name===f&&p.outdated&&(p.agent??"claude")===(h??"claude")));return o.jsxs("section",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:a(t==="user"?"mcp.headingGlobal":"mcp.headingProject")}),o.jsx("span",{className:"ml-auto rounded-full bg-neutral-800/60 text-neutral-400 px-2 py-0.5 text-[11px] font-medium tabular-nums",children:e.length})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 items-start",children:e.map(f=>{const h=d(f.key,f.harness),p=f.enable!==null,m=f.enable??"inherit",k=`mcp-enable:${f.key}`,w=c.stateOf(k),g=`mcp-uninstall:${f.harness}:${f.scope}:${f.key}`,y=c.stateOf(g);return o.jsxs(Da,{children:[o.jsxs(Ol,{className:"items-center gap-2",children:[o.jsx(mm,{className:"h-3.5 w-3.5 shrink-0 text-pink-400"}),o.jsx(Dl,{className:"truncate",children:f.key}),o.jsx(xr,{agent:f.harness}),o.jsx(Qe,{variant:"settings",className:"ml-1",children:a(f.scope==="user"?"library.scopeGlobal":"library.scopeProject")}),h&&o.jsx(Qe,{variant:"warning",className:"ml-1",children:a("mcp.update")}),o.jsxs("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[p&&o.jsxs("button",{type:"button",disabled:w==="loading",onClick:()=>u(f),title:a("mcp.enableTip",{state:a(DS[m])}),className:de("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium disabled:cursor-not-allowed [&_svg]:pointer-events-none",m==="on"?"bg-emerald-900/40 text-emerald-300 hover:bg-emerald-900/60":"bg-neutral-800 text-neutral-500 hover:bg-neutral-700"),children:[o.jsx(lt,{state:w,className:"h-3 w-3",icon:o.jsx(Yl,{className:"h-3 w-3"})}),a(DS[m])]}),o.jsx("button",{type:"button",disabled:y==="loading",onClick:()=>void c.run(g,async()=>{await r(f.key,xU(f),f.harness),l("success",a("mcp.uninstalled",{name:f.key}))},{fail:x=>a("errors.mcpUninstallFailed",{error:qe(x)})}),className:"text-neutral-500 hover:text-red-400 disabled:cursor-not-allowed [&_svg]:pointer-events-none",title:a("mcp.remove",{name:f.key}),children:o.jsx(lt,{state:y,className:"h-3.5 w-3.5",icon:o.jsx(er,{className:"h-3.5 w-3.5"})})})]})]}),o.jsxs(Il,{className:"pt-0 text-xs font-mono text-neutral-400 break-all",children:[o.jsx("span",{className:"text-neutral-300",children:f.detail.command}),f.detail.args&&f.detail.args.length>0&&o.jsxs("span",{className:"text-neutral-500",children:[" ",f.detail.args.join(" ")]}),f.detail.env&&Object.keys(f.detail.env).length>0&&o.jsxs("div",{className:"mt-1 text-neutral-600",children:["env: ",Object.keys(f.detail.env).join(", ")]})]})]},`${f.harness}-${f.scope}-${f.key}`)})})]})}const Ex=["skill","mcp","hooks","workflow","rules","command","agent","output-style","instructions","settings","plugin","mods","other"];function _x(e,t){switch(e){case"skill":case"mcp":case"workflow":case"command":case"agent":case"output-style":case"instructions":case"settings":case"plugin":return[e];case"helper":return["hooks"];case"rule":return["rules"];case"mods":return["plugin","mods"]}return e==="other"&&/(^|\/)hooks\//.test(t)?["hooks"]:["other"]}const IS={instructions:{on:"text-teal-200",off:"text-teal-300/50 hover:text-teal-200"},command:{on:"text-purple-200",off:"text-purple-300/50 hover:text-purple-200"},agent:{on:"text-emerald-200",off:"text-emerald-300/50 hover:text-emerald-200"},hooks:{on:"text-amber-200",off:"text-amber-300/50 hover:text-amber-200"},rules:{on:"text-rose-200",off:"text-rose-300/50 hover:text-rose-200"},"output-style":{on:"text-fuchsia-200",off:"text-fuchsia-300/50 hover:text-fuchsia-200"},workflow:{on:"text-orange-200",off:"text-orange-300/50 hover:text-orange-200"},settings:{on:"text-cyan-200",off:"text-cyan-300/50 hover:text-cyan-200"},plugin:{on:"text-indigo-200",off:"text-indigo-300/50 hover:text-indigo-200"},mods:{on:"text-violet-200",off:"text-violet-300/50 hover:text-violet-200"},other:{on:"text-neutral-200",off:"text-neutral-400/70 hover:text-neutral-200"},skill:{on:"text-lime-200",off:"text-lime-300/50 hover:text-lime-200"},mcp:{on:"text-sky-200",off:"text-sky-300/50 hover:text-sky-200"}},Xv=e=>IS[e]??IS.other,Cx="shrink-0 rounded-full border border-transparent bg-neutral-800/60 px-1.5 py-0 text-[10px] font-medium font-sans",vU="border-neutral-700 bg-transparent text-neutral-400",kU="text-blue-200",wU="text-neutral-400 hover:text-neutral-300",SU="inline-flex items-center gap-1.5 rounded-full border border-transparent bg-neutral-800/60 px-2 py-0.5 text-[11px] font-medium transition-colors duration-150 hover:bg-neutral-700/60",NU="bg-neutral-700 ring-1 ring-blue-500/50 hover:bg-neutral-700";function _p(e){const t=e.lastIndexOf("/");return t<0?e:e.slice(t+1)}function LS(e){return _p(e).replace(/\.(md|js)$/u,"")}function EU(e){const t={children:[],fileCount:0};for(const s of e){const r=s.relPath.split("/");let i=t,a="";for(let l=0;l<r.length;l++){const c=r[l];if(a=a?`${a}/${c}`:c,l===r.length-1)i.children.push({type:"file",asset:s});else{let u=i.children.find(d=>d.type==="dir"&&d.name===c);u||(u={type:"dir",name:c,path:a,children:[],fileCount:0},i.children.push(u)),i=u}}}const n=s=>{s.children.sort((r,i)=>{const a=r.type==="dir",l=i.type==="dir";if(a!==l)return a?-1:1;const c=r.type==="file"?_p(r.asset.relPath):r.name,u=i.type==="file"?_p(i.asset.relPath):i.name;return c.localeCompare(u)}),s.children.forEach(r=>{r.type==="dir"&&n(r)}),s.fileCount=s.children.reduce((r,i)=>r+(i.type==="file"?1:i.fileCount),0)};return n(t),t.children}function PS({kind:e,active:t,onClick:n,children:s}){const r=e?Xv(e):{on:kU,off:wU};return o.jsx("button",{type:"button",onClick:n,"aria-pressed":t,className:de(SU,t&&NU,t?r.on:r.off),children:s})}function ij({node:e,depth:t,scope:n,capabilities:s,updateMap:r,collapsed:i,onToggle:a,onOpenFile:l,onUninstall:c}){const u=We(),{show:d}=tn(),f=dn(),h=8+t*14;if(e.type==="file"){const m=e.asset,k=_p(m.relPath),w=m.relPath.toLowerCase().endsWith(".md"),g=r==null?void 0:r.get(`${LS(m.relPath)}::${m.category}`),y=Z6(m.category,m.agent??"claude",n,s),x=_x(m.category,m.relPath),S={name:LS(m.relPath),category:m.category,relPath:m.relPath,...m.agent?{agent:m.agent}:{}},A=`uninstall:${m.relPath}`,E=f.stateOf(A);return o.jsxs("div",{className:"group/row relative",children:[o.jsxs("button",{type:"button",onClick:()=>l(m.relPath),style:{paddingLeft:h,paddingRight:30},className:"w-full flex items-center gap-1.5 rounded-md py-1 text-left text-xs font-mono text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800/50 [&_svg]:pointer-events-none",title:m.isSymlink?u("fileTree.symlinkTitle",{path:m.absPath}):m.absPath,children:[m.isSymlink?o.jsx(N6,{className:"h-3 w-3 shrink-0 text-amber-400"}):w?o.jsx(Yd,{className:"h-3 w-3 shrink-0 text-blue-400"}):o.jsx(Oa,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:k}),o.jsx(xr,{agent:m.agent,className:"shrink-0 px-1.5 py-0 text-[10px] font-sans"}),x.map(M=>o.jsx("span",{className:de(Cx,Xv(M).on),children:M},M)),m.namespace&&o.jsx("span",{className:de(Cx,vU),title:u("repo.namespaceTip"),children:m.namespace}),(g==null?void 0:g.outdated)&&o.jsx(Qe,{variant:"warning",className:"shrink-0 px-1.5 py-0 text-[10px] font-sans",children:u("fileTree.update")}),(g==null?void 0:g.custom)&&o.jsx(Qe,{variant:"other",className:"shrink-0 px-1.5 py-0 text-[10px] font-sans",children:u("fileTree.custom")})]}),y&&c&&o.jsx("button",{type:"button",disabled:E==="loading",onClick:()=>void f.run(A,async()=>{await(c==null?void 0:c(S)),d("success",u("fileTree.uninstalled",{name:k}))},{fail:M=>u("errors.uninstallFailed",{error:qe(M)})}),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-1 text-neutral-500 opacity-0 group-hover/row:opacity-100 max-lg:opacity-100 hover:text-red-400 hover:bg-neutral-800 disabled:cursor-not-allowed [&_svg]:pointer-events-none",title:u("fileTree.uninstall",{name:k}),children:o.jsx(lt,{state:E,className:"h-3 w-3",icon:o.jsx(er,{className:"h-3 w-3"})})})]})}const p=i.has(e.path);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",onClick:()=>a(e.path),style:{paddingLeft:h},className:"w-full flex items-center gap-1.5 rounded-md py-1 pr-1.5 text-left text-xs text-neutral-300 hover:bg-neutral-800/50",children:[p?o.jsx(Yn,{className:"h-3 w-3 shrink-0"}):o.jsx(_n,{className:"h-3 w-3 shrink-0"}),o.jsx(cr,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:e.name}),o.jsx("span",{className:"text-[10px] text-neutral-600 tabular-nums",children:e.fileCount})]}),!p&&e.children.map(m=>o.jsx(ij,{node:m,depth:t+1,scope:n,capabilities:s,updateMap:r,collapsed:i,onToggle:a,onOpenFile:l,onUninstall:c},m.type==="dir"?m.path:m.asset.relPath))]})}function zS({scope:e,assets:t,capabilities:n,updates:s,onUninstall:r,onOpenFile:i}){const a=We(),l=b.useMemo(()=>{const j=new Map;for(const O of Ex)j.set(O,0);for(const O of t)for(const N of _x(O.category,O.relPath))j.set(N,(j.get(N)??0)+1);return j},[t]),[c,u]=b.useState(new Set),d=b.useMemo(()=>{const j=new Set;for(const O of c)l.has(O)&&j.add(O);return j},[c,l]),f=b.useMemo(()=>d.size?t.filter(j=>_x(j.category,j.relPath).some(O=>d.has(O))):t,[t,d]),h=b.useMemo(()=>EU(f),[f]),p=b.useMemo(()=>{if(!s)return;const j=new Map;for(const O of s)j.set(`${O.name}::${O.category}`,O);return j},[s]),[m,k]=b.useState(new Set),w=j=>k(O=>{const N=new Set(O);return N.has(j)?N.delete(j):N.add(j),N}),g=b.useMemo(()=>{const j=[],O=N=>{for(const F of N)F.type==="dir"&&(j.push(F.path),O(F.children))};return O(h),j},[h]),y=m.size>0,x=()=>k(y?new Set:new Set(g)),S=b.useMemo(()=>{const j=new Map;return Ex.forEach((O,N)=>j.set(O,N)),[...l.keys()].sort((O,N)=>{const F=(l.get(N)??0)-(l.get(O)??0);return F!==0?F:(j.get(O)??1/0)-(j.get(N)??1/0)})},[l]),A=j=>{const O=new Set(d);O.delete(j)||O.add(j),u(O)},E=a(e==="user"?"fileTree.scopeGlobal":"fileTree.scopeProject"),M=en.map(j=>e==="user"?`~/${Kn(j).dotDir}/`:`${Kn(j).dotDir}/`).join(" · ");return o.jsxs("section",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:[E," ",a("fileTree.title")," ",o.jsx("span",{className:"text-neutral-600 normal-case font-normal",children:e==="user"?M:a("fileTree.pathsProject",{dirs:M})})]}),o.jsx("span",{className:"ml-auto rounded-full bg-neutral-800/60 text-neutral-400 px-2 py-0.5 text-[11px] font-medium tabular-nums",children:d.size?`${f.length} / ${t.length}`:t.length}),g.length>0&&o.jsxs("button",{type:"button",onClick:x,className:"inline-flex items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-1.5 py-0.5 text-[10px] hover:bg-neutral-700 [&_svg]:pointer-events-none",title:a(y?"fileTree.expandAllDirs":"fileTree.collapseAllDirs"),children:[y?o.jsx(qd,{className:"h-2.5 w-2.5"}):o.jsx(Kd,{className:"h-2.5 w-2.5"}),a(y?"fileTree.expandAll":"fileTree.collapseAll")]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsxs(PS,{active:d.size===0,onClick:()=>u(new Set),children:[a("fileTree.all"),o.jsx("span",{className:"tabular-nums text-[10px] opacity-70",children:t.length})]}),S.map(j=>o.jsxs(PS,{kind:j,active:d.has(j),onClick:()=>A(j),children:[j,o.jsx("span",{className:"tabular-nums text-[10px] opacity-70",children:l.get(j)??0})]},j))]}),h.length===0?o.jsx("p",{className:"text-xs text-neutral-600 border border-dashed border-edge/[0.06] rounded-md p-3",children:a("fileTree.emptyFiltered")}):o.jsx("div",{className:"max-h-[45vh] overflow-y-auto rounded-lg border border-edge/[0.06] bg-neutral-900/40 p-2 space-y-0.5",children:h.map(j=>o.jsx(ij,{node:j,depth:0,scope:e,capabilities:n,updateMap:p,collapsed:m,onToggle:w,onOpenFile:i,onUninstall:r},j.type==="dir"?j.path:j.asset.relPath))})]})}const aj={gray:"#6b7280",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#d946ef",cyan:"#06b6d4"},_U={gray:"#d1d5db",red:"#fca5a5",green:"#86efac",yellow:"#fde68a",blue:"#bfdbfe",magenta:"#f5d0fe",cyan:"#a5f3fc"},CU=["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"];function Qv(e){const t=Math.max(0,Math.min(255,Math.round(e)));if(t<16)return CU[t];const n=r=>r.toString(16).padStart(2,"0");if(t<232){const r=t-16,i=a=>a===0?0:55+a*40;return`#${n(i(Math.floor(r/36)))}${n(i(Math.floor(r%36/6)))}${n(i(r%6))}`}const s=8+(t-232)*10;return`#${n(s)}${n(s)}${n(s)}`}const ym=e=>e in aj;function Lh(e){return ym(e)?_U[e]:e.startsWith("ansi256:")?Qv(Number(e.slice(8))):e}function pi(e){return ym(e)?aj[e]:e.startsWith("ansi256:")?Qv(Number(e.slice(8))):e}function TU(e){return ym(e)?e:e.startsWith("ansi256:")?`ansi256 ${e.slice(8)}`:e}function AU(e){const t=e.trim();if(ym(t))return t;const n=/^ansi256:(\d{1,3})$/.exec(t);if(n){const r=Number(n[1]);return r>=0&&r<=255?`ansi256:${r}`:null}if(/^#[0-9a-fA-F]{6}$/.test(t))return t.toLowerCase();const s=/^#([0-9a-fA-F]{3})$/.exec(t);if(s){const r=s[1];return`#${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`.toLowerCase()}return null}const MU=Array.from({length:256},(e,t)=>Qv(t)),lj={project:{name:"my-project",path:"/workspace/my-project"},git:{branch:"main",repo:"acme/weave",ahead:"1",behind:"2",sync:"(2↓/1↑)"},git_user:{user:"yao",email:"yao@weave.dev"},changes:{added:"1",deleted:"1",files:"3"},model:{model:"claude-sonnet-5"},thinking:{level:"high"},context:{percent:"78",used:"780k",total:"1.0M",remaining:"22"},tokens:{total:"960.9k",percent:"42"},cost:{cost:"$0.42",duration:"12m",api_duration:"3m",lines_added:"42",lines_removed:"7"},rate:{percent:"45",limit:"5h",resets:""},time:{time:"12:30"},version:{version:"2.1.286"},output_style:{style:"explanatory"},session:{name:"feat-statusline"},exceeds200k:{over:"200k"},fast_mode:{mode:"fast"},vim:{mode:"INSERT"},pr:{number:"482",state:"approved",url:"https://github.com/acme/weave/pull/482"},worktree:{name:"weave-next",branch:"feat/x"},agent:{name:"reviewer"}};function jU(e,t){return t.format?t.format:e==="context"&&t.style?Q6[t.style]:CM[e]}function oj(e,t,n,s){const r={...s};if(e==="context"){const l=Number(r.percent);let c=Math.round(l/100*n.bar.cells);l>0&&c===0&&(c=1),r.bar=n.bar.fill.repeat(c)+n.bar.empty.repeat(n.bar.cells-c)}const i=jU(e,t).replace(/\{(\w+)\}/g,(l,c)=>r[c]??"").trim(),a=t.label?`${t.label}${n.labelSeparator}`:"";return(t.icon?`${t.icon} `:"")+a+i}function cj(e,t,n=lj){const s=[];for(const a of t){const l=e.segments[a];if(!l.enabled)continue;const c=n[a];if(!c)continue;const u=oj(a,l,e,c);u!==""&&s.push({text:u,fg:l.color,bold:l.bold,bg:l.backgroundColor,merge:l.merge})}const r=[];let i=[];for(const a of s){if(a.merge){i.push(a);continue}for(const l of i)l.bg=a.bg,l.joinsNext=!0;i=[],r.push(a)}for(const a of i)a.bg=null;return r.concat(i)}function cd({value:e,min:t,max:n,disabled:s,onChange:r,title:i}){const a=We(),l=c=>Math.min(n??Number.MAX_SAFE_INTEGER,Math.max(t,c));return o.jsxs("span",{role:"group","aria-label":i,className:de("inline-flex select-none items-stretch rounded border border-edge/[0.08] bg-neutral-950 focus-within:border-blue-500/40",s&&"opacity-40"),children:[o.jsx("button",{type:"button","aria-label":a("common.decrease"),title:a("common.decrease"),disabled:s||e<=t,onClick:()=>r(l(e-1)),className:"flex w-6 items-center justify-center rounded-l bg-edge/[0.04] text-neutral-400 transition-colors hover:bg-edge/[0.08] hover:text-neutral-100 disabled:pointer-events-none disabled:opacity-30",children:o.jsx(hM,{className:"h-3 w-3"})}),o.jsx("input",{type:"number",min:t,max:n,value:e,disabled:s,"aria-label":i,onChange:c=>r(l(Number(c.target.value)||t)),className:"w-14 bg-transparent px-1 text-center text-xs text-neutral-100 focus:outline-none disabled:opacity-40 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"}),o.jsx("button",{type:"button","aria-label":a("common.increase"),title:a("common.increase"),disabled:s||n!==void 0&&e>=n,onClick:()=>r(l(e+1)),className:"flex w-6 items-center justify-center rounded-r bg-edge/[0.04] text-neutral-400 transition-colors hover:bg-edge/[0.08] hover:text-neutral-100 disabled:pointer-events-none disabled:opacity-30",children:o.jsx(Vd,{className:"h-3 w-3"})})]})}const Tx=[{key:"project",labelKey:"seg.project",sample:"my-project"},{key:"git",labelKey:"seg.git",sample:"main (2↓/1↑)"},{key:"git_user",labelKey:"seg.gitUser",sample:"yao <yao@weave.dev>"},{key:"changes",labelKey:"seg.changes",sample:"3"},{key:"model",labelKey:"seg.model",sample:"claude-sonnet-5"},{key:"thinking",labelKey:"seg.thinking",sample:"high"},{key:"context",labelKey:"seg.context",sample:"78% ▰▰▰▰▰▰▰▱▱"},{key:"tokens",labelKey:"seg.tokens",sample:"12k"},{key:"cost",labelKey:"seg.cost",sample:"$0.42"},{key:"rate",labelKey:"seg.rate",sample:"5h 45%"},{key:"time",labelKey:"seg.time",sample:"12:30"},{key:"version",labelKey:"seg.version",sample:"2.1.286"},{key:"output_style",labelKey:"seg.output_style",sample:"explanatory"},{key:"session",labelKey:"seg.session",sample:"feat-statusline"},{key:"exceeds200k",labelKey:"seg.exceeds200k",sample:"200k"},{key:"fast_mode",labelKey:"seg.fast_mode",sample:"fast"},{key:"vim",labelKey:"seg.vim",sample:"INSERT"},{key:"pr",labelKey:"seg.pr",sample:"#482"},{key:"worktree",labelKey:"seg.worktree",sample:"weave-next"},{key:"agent",labelKey:"seg.agent",sample:"reviewer"}],RU=[..._M],OU=[{key:"left",labelKey:"align.left"},{key:"center",labelKey:"align.center"},{key:"right",labelKey:"align.right"}],DU=[{key:"percent",labelKey:"statusline.barStyle.percent"},{key:"bar",labelKey:"statusline.barStyle.bar"},{key:"both",labelKey:"statusline.barStyle.both"}],IU=[{key:"session",labelKey:"statusline.metric.session",titleKey:"statusline.metric.sessionTitle"},{key:"context",labelKey:"statusline.metric.context",titleKey:"statusline.metric.contextTitle"}],LU=[{key:"five_hour",labelKey:"rateWin.fiveHour.label",titleKey:"rateWin.fiveHour.title"},{key:"seven_day",labelKey:"rateWin.sevenDay.label",titleKey:"rateWin.sevenDay.title"},{key:"spend",labelKey:"rateWin.spend.label",titleKey:"rateWin.spend.title"}],Xs=(e,t)=>({char:String.fromCodePoint(e),nameKey:t}),uj=String.fromCodePoint(57520),dj=String.fromCodePoint(57522),fj=String.fromCodePoint(57520),PU=[Xs(57520,"statusline.glyph.triangleRight"),Xs(57522,"statusline.glyph.triangleLeft"),Xs(57524,"statusline.glyph.roundRight"),Xs(57526,"statusline.glyph.roundLeft")],zU=[Xs(57522,"statusline.glyph.triangle"),Xs(57526,"statusline.glyph.round"),Xs(57530,"statusline.glyph.lowerTriangle"),Xs(57534,"statusline.glyph.diagonal")],UU=[Xs(57520,"statusline.glyph.triangle"),Xs(57524,"statusline.glyph.round"),Xs(57528,"statusline.glyph.lowerTriangle"),Xs(57532,"statusline.glyph.diagonal")];function zg({label:e,value:t,fallback:n,presets:s,editable:r,allowNone:i,onChange:a}){const l=We(),c=t??n;return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-neutral-500",children:e}),s.map(u=>o.jsx("button",{onClick:()=>a(u.char),disabled:!r,title:`${l(u.nameKey)} (U+${u.char.codePointAt(0).toString(16).toUpperCase()})`,className:de("nerd-font w-6 h-6 rounded flex items-center justify-center disabled:opacity-30",c===u.char?"bg-neutral-800 text-neutral-100 ring-1 ring-edge/30":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-900"),children:u.char},u.nameKey)),i&&o.jsx("button",{onClick:()=>a(""),disabled:!r,title:l("statusline.disableCap"),className:de("rounded px-1.5 h-6 text-[10px] disabled:opacity-30",t===""?"bg-neutral-800 text-neutral-100 ring-1 ring-edge/30":"text-neutral-500 hover:text-neutral-300"),children:l("statusline.none")})]})}function Ax({value:e,editable:t,onChange:n,allowNone:s,noneSelected:r,onNone:i}){const[a,l]=b.useState(!1),[c,u]=b.useState(""),d=We(),f=()=>{const h=AU(c);h&&n(h),u("")};return o.jsxs("div",{className:"flex gap-1 items-center",children:[s&&o.jsx("button",{type:"button",onClick:i,disabled:!t,title:d("statusline.noBackground"),className:de("h-3.5 w-3.5 rounded border border-edge/20 disabled:opacity-30",r?"ring-2 ring-edge/60 bg-neutral-800":"opacity-40"),children:o.jsx("span",{className:"block h-px bg-neutral-500 rotate-45"})}),RU.map(h=>o.jsx("button",{type:"button",onClick:()=>n(h),disabled:!t,title:h,style:{backgroundColor:pi(h)},className:de("h-3.5 w-3.5 rounded-full disabled:opacity-30",e===h?"ring-2 ring-edge/60":"opacity-50")},h)),o.jsx("button",{type:"button",onClick:()=>l(h=>!h),disabled:!t,title:e&&!Ff(e)?d("statusline.moreColorsCurrent",{color:TU(e)}):d("statusline.moreColors"),style:e&&!Ff(e)?{backgroundColor:pi(e)}:void 0,className:de("h-3.5 w-3.5 rounded-full border border-edge/25 text-[8px] leading-none disabled:opacity-30",e&&!Ff(e)?"ring-2 ring-edge/60":"opacity-50 text-neutral-400"),children:e&&!Ff(e)?"":"+"}),a&&t&&o.jsx("div",{className:"relative",children:o.jsxs("div",{className:"absolute z-20 left-0 top-5 w-64 rounded border border-edge/15 bg-neutral-950 p-2 shadow-xl",children:[o.jsx("div",{className:"grid grid-cols-[repeat(16,minmax(0,1fr))] gap-[2px]",children:MU.map((h,p)=>o.jsx("button",{type:"button",title:`ansi256:${p}`,onClick:()=>{n(`ansi256:${p}`),l(!1)},style:{backgroundColor:h},className:"h-3 w-3 rounded-sm hover:ring-1 hover:ring-edge/70"},p))}),o.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[o.jsx("input",{type:"color",value:FU(e),onChange:h=>n(h.target.value.toLowerCase()),className:"h-6 w-8 bg-transparent",title:d("statusline.pickTruecolor")}),o.jsx("input",{value:c,onChange:h=>u(h.target.value),onKeyDown:h=>{h.key==="Enter"&&f()},placeholder:d("statusline.colorPlaceholder"),className:"bg-neutral-900 rounded px-1.5 py-0.5 text-[11px] font-mono flex-1"}),o.jsx("button",{type:"button",onClick:f,className:"text-[11px] rounded bg-neutral-800 px-2 py-0.5 text-neutral-300 hover:bg-neutral-700",children:d("statusline.ok")})]})]})})]})}const Ff=e=>_M.includes(e);function FU(e){return e?/^#[0-9a-fA-F]{6}$/.test(e)?e:pi(e):"#000000"}function US(e,t,n,s,r){const i=e.map(l=>[...l]),a=i[t].indexOf(s);return a>=0&&i[t].splice(a,1),i[n].splice(Math.min(r,i[n].length),0,s),i}function BU({projectId:e,initialTab:t="project"}){const n=t==="global",s=We(),[r,i]=b.useState(null),[a,l]=b.useState(null),[c,u]=b.useState("idle"),[d,f]=b.useState(null),[h,p]=b.useState(!1),[m,k]=b.useState(null),[w,g]=b.useState(null),y=b.useRef(0),x=b.useRef(!1),[S,A]=b.useState(!0),E=Ov(ed(Gd,{activationConstraint:{distance:5}})),M=b.useCallback(()=>{f(null),i(null),u("idle"),Ce.getStatusline(e).then(_=>{x.current=!0,l(_.globalConfig),i(n?_.globalConfig?structuredClone(_.globalConfig):null:_.config)}).catch(_=>f(String(_)))},[e,n]);b.useEffect(()=>{M()},[M]),b.useEffect(()=>$r("statusline",M),[M]),b.useEffect(()=>{if(!h)return;const _=setTimeout(()=>p(!1),5e3);return()=>clearTimeout(_)},[h]),b.useEffect(()=>{if(!m)return;const _=setTimeout(()=>k(null),5e3);return()=>clearTimeout(_)},[m]);const j=b.useCallback(async()=>{if(!h){p(!0);return}p(!1),f(null);try{const _=await Ce.getFactoryStatusline();u("idle"),i(structuredClone(_))}catch(_){f(String(_))}},[h]),O=b.useCallback(async()=>{if(r){u("saving"),f(null);try{const _=n?await Ce.putGlobalStatusline(r):await Ce.putStatusline(e,r);_.ok?u("saved"):(u("error"),f(s("statusline.saveFailed",{error:`${_.status} ${await _.text()}`})))}catch(_){u("error"),f(String(_))}}},[e,r,n,s]);if(b.useEffect(()=>{if(!r)return;if(x.current){x.current=!1;return}const _=setTimeout(()=>void O(),700);return()=>clearTimeout(_)},[r,O]),!r)return o.jsx("p",{className:"text-xs text-neutral-500",children:d??s("common.loading")});const N=n||r.source==="custom";function F(){a&&i({...structuredClone(a),source:"custom"})}function G(_,K){i(T=>T&&{...T,segments:{...T.segments,[_]:{...T.segments[_],...K}}})}function H(_){i(K=>K&&{...K,..._})}function I(){i(_=>_&&{..._,lines:[..._.lines,[]]})}function L(_){i(K=>{if(!K||K.lines.length<=1)return K;const T=K.lines.map(J=>[...J]),X=T.splice(_,1)[0]??[],ne=_>0?_-1:0;return T[ne]=[...T[ne],...X],{...K,lines:T}})}function C(_,K){i(T=>{if(!T)return T;const X=T.lines.map(ne=>ne.filter(J=>J!==K));return X[_]=[...X[_],K],{...T,lines:X}})}function D(_,K,T){i(X=>{if(!X)return X;const ne=X.lines.map(q=>q.filter(Y=>Y!==K&&Y!==T)),J=X.lines[_].indexOf(K),pe=Math.min(Math.max(J,0),ne[_].length);return ne[_]=[...ne[_].slice(0,pe),T,...ne[_].slice(pe)],{...X,lines:ne}})}function U(_,K){i(T=>T&&{...T,lines:T.lines.map((X,ne)=>ne===_?X.filter(J=>J!==K):X)})}function B(_){y.current=Date.now();const{active:K,over:T}=_;if(!T)return;const X=K.id;i(ne=>{var ee,oe,ye;if(!ne)return ne;const J=((ee=K.data.current)==null?void 0:ee.line)??-1,pe=((oe=T.data.current)==null?void 0:oe.line)??-1,q=((ye=T.data.current)==null?void 0:ye.container)===!0;if(J<0||pe<0)return ne;if(q)return J===pe?ne:{...ne,lines:US(ne.lines,J,pe,X,ne.lines[pe].length)};if(K.id===T.id)return ne;const Y=ne.lines[J].indexOf(X);if(Y<0)return ne;if(J===pe){const Re=ne.lines[pe].indexOf(T.id);if(Re<0)return ne;const se=ne.lines.map(Q=>[...Q]);return se[J]=xm(se[J],Y,Re),{...ne,lines:se}}const V=ne.lines[pe].indexOf(T.id);return{...ne,lines:US(ne.lines,J,pe,X,V<0?ne.lines[pe].length:V)}})}const R={text:`${r.logoText} v${gS}`,fg:r.logoColor,bold:!0,bg:null,merge:!1};return o.jsxs(Da,{className:de("flex flex-col",S&&"h-[600px] overflow-hidden"),children:[o.jsxs(Ol,{className:"shrink-0 items-center",children:[o.jsxs("button",{type:"button",onClick:()=>A(_=>!_),className:"flex items-center gap-2 text-left",title:s(S?"common.collapse":"common.expand"),children:[S?o.jsx(_n,{className:"h-4 w-4 text-neutral-500"}):o.jsx(Yn,{className:"h-4 w-4 text-neutral-500"}),o.jsx(Dl,{children:s("statusline.title")}),o.jsx(xr,{agent:"claude"}),o.jsx("span",{className:"rounded-full bg-emerald-900/40 px-1.5 py-0.5 text-[10px] text-emerald-300",title:s("statusline.tuiHint"),children:s("statusline.tuiBadge")})]}),o.jsxs("div",{className:"ml-auto flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"rounded-full bg-neutral-800 px-2 py-0.5 text-neutral-400",children:s(n?"statusline.scopeGlobal":"statusline.scopeProject")}),n&&o.jsx("button",{onClick:()=>void j(),className:de("rounded px-2 py-1 transition-colors",h?"bg-red-900/60 text-red-200 ring-1 ring-red-500/60":"bg-neutral-800 text-neutral-400 hover:bg-neutral-700 hover:text-neutral-200"),title:s("statusline.resetHint"),children:s(h?"statusline.resetConfirm":"statusline.reset")}),o.jsx("button",{onClick:()=>void O(),disabled:c==="saving",className:de("rounded px-2 py-1 disabled:opacity-40",c==="saved"?"bg-emerald-900/40 text-emerald-300":c==="error"?"bg-red-900/40 text-red-300":"bg-blue-900/40 text-blue-300"),children:s(c==="saving"?"common.saving":c==="saved"?"statusline.saved":c==="error"?"statusline.retry":"common.save")})]})]}),S&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"shrink-0 border-b border-edge/[0.06] p-3",children:o.jsxs("div",{className:"nerd-font rounded-md bg-neutral-950 border border-edge/[0.06] px-3 py-2 text-xs text-neutral-300 whitespace-pre overflow-x-auto",children:[r.lines.map((_,K)=>{const T=cj(r,_);return K===0&&R&&T.unshift(R),o.jsxs("div",{children:[K>0&&o.jsx("div",{className:"text-neutral-600",children:"────────────────────────────"}),T.length?o.jsx(hj,{items:T,config:r}):o.jsx("span",{className:"text-neutral-600",children:s("statusline.emptyRow")})]},K)}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:s("statusline.preview")})]})}),o.jsxs(Il,{className:"min-h-0 flex-1 space-y-3 overflow-y-auto",children:[d&&o.jsx("p",{className:"text-red-400 text-xs",children:d}),!n&&o.jsx("div",{className:"flex items-center gap-2 rounded-md border border-edge/[0.06] bg-neutral-900/60 px-2 py-1.5 text-xs",children:r.source==="global"?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"rounded-full bg-blue-900/50 px-2 py-0.5 text-blue-300",children:s("statusline.followingGlobal")}),o.jsx("span",{className:"text-neutral-600",children:s("statusline.editsDisabled")}),o.jsx("button",{onClick:F,className:"ml-auto shrink-0 rounded bg-blue-900/40 px-2 py-0.5 text-blue-300 hover:bg-blue-900/60",children:s("statusline.customizeLocally")})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"rounded-full bg-amber-900/50 px-2 py-0.5 text-amber-300",children:s("statusline.localCustom")}),o.jsx("span",{className:"text-neutral-600",children:s("statusline.ownConfig")}),o.jsx("button",{onClick:()=>{if(m!=="follow"){k("follow");return}k(null),H({source:"global"})},className:de("ml-auto shrink-0 rounded px-2 py-0.5 transition-colors",m==="follow"?"bg-red-900/60 text-red-200 ring-1 ring-red-500/60":"bg-neutral-800 text-neutral-300 hover:bg-neutral-700"),title:s("statusline.followHint"),children:s(m==="follow"?"statusline.followConfirm":"statusline.follow")}),o.jsx("button",{onClick:()=>{if(m!=="sync"){k("sync");return}k(null),F()},className:de("shrink-0 rounded px-2 py-0.5 transition-colors",m==="sync"?"bg-red-900/60 text-red-200 ring-1 ring-red-500/60":"bg-neutral-800 text-neutral-300 hover:bg-neutral-700"),title:s("statusline.syncHint"),children:s(m==="sync"?"statusline.syncConfirm":"statusline.sync")})]})}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-400 flex-wrap",children:[o.jsx("span",{className:"w-12",children:s("statusline.alignLabel")}),OU.map(_=>o.jsx("button",{onClick:()=>H({align:_.key}),disabled:!N,className:de("rounded px-2 py-0.5 disabled:opacity-30",r.align===_.key?"bg-neutral-800 text-neutral-100":"text-neutral-400 hover:text-neutral-200"),children:s(_.labelKey)},_.key)),o.jsx("span",{className:"text-neutral-600",children:"|"}),o.jsxs("label",{className:"flex items-center gap-1.5",children:[s("statusline.refresh"),o.jsx(cd,{value:r.refreshInterval,min:1,disabled:!N,onChange:_=>H({refreshInterval:_}),title:s("statusline.refresh")}),o.jsx("span",{className:"text-neutral-600",children:"s"}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:s("statusline.refreshNote")})]})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[o.jsx("input",{type:"checkbox",checked:r.powerline.enabled,disabled:!N,onChange:_=>H({powerline:{...r.powerline,enabled:_.target.checked}})}),s("statusline.powerlineStyle"),o.jsx("span",{className:"text-neutral-600",children:s("statusline.powerlineHint")})]}),r.powerline.enabled&&o.jsxs("div",{className:"flex items-center gap-4 text-xs text-neutral-400 flex-wrap pl-6",children:[o.jsx(zg,{label:s("statusline.glyphSeparator"),value:r.powerline.separator,fallback:uj,presets:PU,editable:N,onChange:_=>H({powerline:{...r.powerline,separator:_}})}),o.jsx(zg,{label:s("statusline.glyphStartCap"),value:r.powerline.startCap,fallback:dj,presets:zU,editable:N,allowNone:!0,onChange:_=>H({powerline:{...r.powerline,startCap:_}})}),o.jsx(zg,{label:s("statusline.glyphEndCap"),value:r.powerline.endCap,fallback:fj,presets:UU,editable:N,allowNone:!0,onChange:_=>H({powerline:{...r.powerline,endCap:_}})}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:s("statusline.nerdFontHint")})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[s("statusline.logo"),o.jsxs("span",{className:"rounded bg-neutral-900 px-2 py-0.5 font-mono text-neutral-300",children:[r.logoText," v",gS]}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:s("statusline.logoHint")}),o.jsx("div",{className:"flex gap-1",children:o.jsx(Ax,{value:r.logoColor,editable:N,onChange:_=>H({logoColor:_})})})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[s("statusline.separator"),o.jsx("input",{value:r.separator,disabled:!N,onChange:_=>H({separator:_.target.value}),className:"nerd-font bg-neutral-900 rounded px-2 py-0.5 w-20 disabled:opacity-40"}),o.jsx("span",{className:"text-neutral-600",children:s("statusline.separatorHint")})]}),o.jsxs("div",{className:"flex items-center gap-3 text-xs text-neutral-400",children:[o.jsxs("label",{className:"flex items-center gap-2",children:[s("statusline.bar"),o.jsx(cd,{value:r.bar.cells,min:1,max:40,disabled:!N,onChange:_=>H({bar:{...r.bar,cells:_}}),title:s("statusline.barCellsHint")})]}),o.jsxs("label",{className:"flex items-center gap-2",children:[s("statusline.fill"),o.jsx("input",{value:r.bar.fill,disabled:!N,onChange:_=>H({bar:{...r.bar,fill:_.target.value}}),className:"bg-neutral-900 rounded px-2 py-0.5 font-mono w-10 text-center disabled:opacity-40"})]}),o.jsxs("label",{className:"flex items-center gap-2",children:[s("statusline.emptyChar"),o.jsx("input",{value:r.bar.empty,disabled:!N,onChange:_=>H({bar:{...r.bar,empty:_.target.value}}),className:"bg-neutral-900 rounded px-2 py-0.5 font-mono w-10 text-center disabled:opacity-40"})]}),o.jsxs("label",{className:"flex items-center gap-2",children:[s("statusline.labelSep"),o.jsx("input",{value:r.labelSeparator,disabled:!N,onChange:_=>H({labelSeparator:_.target.value}),className:"bg-neutral-900 rounded px-2 py-0.5 font-mono w-14 disabled:opacity-40",title:s("statusline.labelSepHint")})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-[11px] text-neutral-500 uppercase tracking-wide",children:s("statusline.lines")}),o.jsx("button",{onClick:I,disabled:!N,className:"text-[11px] rounded bg-neutral-800 px-2 py-0.5 text-neutral-300 hover:bg-neutral-700 disabled:opacity-30",children:s("statusline.addRow")})]}),o.jsx(zv,{sensors:E,collisionDetection:lP,onDragEnd:B,children:r.lines.map((_,K)=>o.jsx($U,{li:K,row:_,linesLen:r.lines.length,editable:N,config:r,lastDragEnd:y,onRemoveRow:L,onOpen:(T,X)=>g({line:T,key:X}),onAdd:T=>g({line:T,key:null})},K))}),w&&o.jsx(GU,{editing:w,config:r,placedIn:_=>r.lines.findIndex(K=>K.includes(_)),onPick:_=>{w.key===null?C(w.line,_):w.key!==_&&D(w.line,w.key,_),g({line:w.line,key:_})},onPatch:G,onUnplace:()=>{w.key&&U(w.line,w.key),g(null)},onClose:()=>g(null)})]})]})]})]})}function hj({items:e,config:t}){if(!t.powerline.enabled)return o.jsx("span",{className:"nerd-font",children:e.map(c=>o.jsx("span",{className:de(c.bold&&"font-bold"),style:{color:Lh(c.fg)},children:c.text},c.text+c.fg)).reduce((c,u,d)=>(d>0&&c.push(o.jsx("span",{children:t.separator},`sep-${d}`)),c.push(u),c),[])});const n=t.powerline,s=n.separator??uj,r=n.startCap??dj,i=n.endCap??fj,a=e[0],l=e[e.length-1];return o.jsxs("span",{className:"nerd-font inline-flex items-stretch",children:[r&&(a==null?void 0:a.bg)&&o.jsx("span",{className:"whitespace-pre",style:{color:pi(a.bg)},children:r}),e.map((c,u)=>{const d=e[u-1],f=u>0&&!d.joinsNext,h=f&&!!c.bg&&!!d.bg&&s!=="";return o.jsxs("span",{className:"inline-flex items-stretch",children:[f&&(h?o.jsx("span",{className:"whitespace-pre",style:{backgroundColor:pi(c.bg),color:d.bg===c.bg?Lh(d.fg):pi(d.bg)},children:s}):o.jsx("span",{className:"w-1"})),o.jsx("span",{className:de("px-1.5 whitespace-pre",c.bold&&"font-bold"),style:{...c.bg?{backgroundColor:pi(c.bg)}:{},color:Lh(c.fg)},children:c.text})]},u)}),i&&(l==null?void 0:l.bg)&&o.jsx("span",{className:"whitespace-pre",style:{color:pi(l.bg)},children:i})]})}function HU({segKey:e,line:t,segment:n,config:s,editable:r,lastDragEnd:i,onOpen:a}){const l=We(),{attributes:c,listeners:u,setNodeRef:d,transform:f,transition:h,isDragging:p}=PM({id:e,disabled:!r,data:{line:t}}),m={transform:f?`translate3d(${f.x}px, ${f.y}px, 0)`:void 0,transition:h},k=Tx.find(S=>S.key===e),w=n.enabled,g=oj(e,n,s,lj[e]??{})||l(k.labelKey),y=w&&n.backgroundColor?pi(n.backgroundColor):void 0,x=w?Lh(n.color):void 0;return o.jsx("div",{ref:d,style:m,className:de("shrink-0 max-w-[260px]",p&&"opacity-50 ring-1 ring-edge/30"),children:o.jsx("button",{...c,...u,onClick:()=>{Date.now()-i.current<250||a(t,e)},title:w?l("statusline.capsuleTitle",{name:l(k.labelKey)}):l("statusline.capsuleTitleOff",{name:l(k.labelKey)}),className:de("rounded-full px-2.5 py-1 text-xs whitespace-pre select-none transition",w?"shadow-mac-sm":"border border-dashed border-neutral-600 bg-neutral-800/60 text-neutral-500",r?"cursor-grab active:cursor-grabbing hover:brightness-110":"cursor-default"),style:y||x?{backgroundColor:y,color:x}:void 0,children:o.jsx("span",{className:"block truncate",children:g})})})}function $U({li:e,row:t,linesLen:n,editable:s,config:r,lastDragEnd:i,onRemoveRow:a,onOpen:l,onAdd:c}){const u=We(),{setNodeRef:d,isOver:f}=Uv({id:`line-${e}`,data:{line:e,container:!0},disabled:!s});return o.jsxs("div",{ref:d,className:de("rounded-lg border border-edge/[0.08] bg-neutral-900/30 px-2 py-1.5 transition-shadow",f&&"ring-2 ring-emerald-400/50"),children:[o.jsxs("div",{className:"flex items-center gap-2 pb-1",children:[o.jsx("span",{className:"text-[10px] text-neutral-600 font-mono",children:u("statusline.rowN",{n:e+1})}),o.jsx("span",{className:"text-[10px] text-neutral-600",children:u("statusline.blockCount",{n:t.length})}),n>1&&o.jsx("button",{onClick:()=>a(e),disabled:!s,className:"ml-auto text-neutral-500 hover:text-red-400 disabled:opacity-30",title:u("statusline.removeRow"),children:o.jsx("span",{className:"text-xs leading-none",children:"✕"})})]}),o.jsx(IM,{items:t,strategy:hz,children:o.jsxs("div",{className:"flex min-h-[34px] flex-wrap items-center gap-1.5",children:[t.length===0&&o.jsx("span",{className:"text-[11px] text-neutral-600",children:u("statusline.emptyRowHint")}),t.map(h=>o.jsx(HU,{segKey:h,line:e,segment:r.segments[h],config:r,editable:s,lastDragEnd:i,onOpen:l},h)),s&&o.jsx("button",{onClick:()=>c(e),className:"rounded-full border border-dashed border-neutral-600 px-2.5 py-1 text-xs text-neutral-400 transition-colors hover:border-neutral-400 hover:text-neutral-200",title:u("statusline.addBlockHint"),children:u("statusline.addBlock")})]})})]})}function GU({editing:e,config:t,placedIn:n,onPick:s,onPatch:r,onUnplace:i,onClose:a}){const l=e.key,c=l?t.segments[l]:null,u=We();return b.useEffect(()=>{const d=f=>{f.key==="Escape"&&a()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[a]),sn.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onMouseDown:d=>{d.target===d.currentTarget&&a()},children:o.jsxs("div",{className:"w-full max-w-md space-y-3 rounded-xl border border-edge/10 bg-neutral-900 p-4 shadow-mac",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-semibold text-neutral-100",children:l?`${t.segments[l].icon?t.segments[l].icon+" ":""}${u(Tx.find(d=>d.key===l).labelKey)}`:u("statusline.addBlockTitle")}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:u("statusline.rowN",{n:e.line+1})}),o.jsx("button",{onClick:a,className:"ml-auto text-neutral-500 hover:text-neutral-300",title:u("statusline.closeEsc"),children:"✕"})]}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:Tx.map(d=>{const f=n(d.key),h=d.key===l,p=f>=0&&f!==e.line;return o.jsxs("button",{type:"button",onClick:()=>{h||s(d.key)},title:p?u("statusline.tagOtherRow",{n:f+1}):d.key,className:de("rounded-full border px-2 py-0.5 text-[11px] transition-colors",h?"border-blue-500/50 bg-blue-900/50 text-blue-200":p?"border-transparent bg-neutral-800/70 text-amber-400/80 hover:bg-neutral-700 hover:text-amber-300":"border-transparent bg-neutral-800/70 text-neutral-400 hover:bg-neutral-700 hover:text-neutral-200"),children:[u(d.labelKey),p&&o.jsx("span",{className:"ml-1 text-[9px] opacity-70",children:u("statusline.rowShort",{n:f+1})})]},d.key)})}),l===null&&o.jsx("p",{className:"text-xs text-neutral-500",children:u("statusline.pickHint")}),l&&c&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[o.jsx("button",{onClick:()=>r(l,{enabled:!c.enabled}),className:de("rounded px-2 py-0.5",c.enabled?"bg-emerald-900/50 text-emerald-300":"bg-neutral-800 text-neutral-500"),children:c.enabled?u("statusline.enabled"):u("statusline.disabled")}),o.jsx("button",{onClick:()=>r(l,{bold:!c.bold}),className:de("rounded px-2 py-0.5",c.bold?"bg-neutral-800 text-neutral-100 font-bold":"text-neutral-500 hover:text-neutral-300"),title:u("statusline.bold"),children:"B"}),o.jsxs("label",{className:de("flex cursor-pointer items-center gap-1 rounded px-2 py-0.5",c.merge?"bg-neutral-800 text-neutral-200":"text-neutral-500 hover:text-neutral-300"),title:u("statusline.mergeHint"),children:[o.jsx("input",{type:"checkbox",checked:c.merge,onChange:d=>r(l,{merge:d.target.checked}),className:"hidden"}),u("statusline.merge")]}),o.jsx("input",{value:c.icon,onChange:d=>r(l,{icon:d.target.value}),placeholder:u("statusline.iconPlaceholder"),className:"ml-auto w-14 rounded bg-neutral-800 px-1.5 py-0.5 text-center font-mono text-xs",title:u("statusline.iconHint")})]}),l==="context"&&o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-neutral-400",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fieldStyle")}),DU.map(d=>o.jsx("button",{onClick:()=>r(l,{style:d.key}),className:de("rounded px-1.5 py-0.5",(c.style??"both")===d.key?"bg-neutral-800 text-neutral-100":"text-neutral-500 hover:text-neutral-300"),title:u(d.labelKey),children:u(d.labelKey)},d.key))]}),l==="tokens"&&o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-neutral-400",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fieldMetric")}),IU.map(d=>o.jsx("button",{onClick:()=>r(l,{metric:d.key}),className:de("rounded px-1.5 py-0.5",(c.metric??"session")===d.key?"bg-neutral-800 text-neutral-100":"text-neutral-500 hover:text-neutral-300"),title:u(d.titleKey),children:u(d.labelKey)},d.key))]}),l==="rate"&&o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-neutral-400",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fieldWindow")}),LU.map(d=>o.jsx("button",{onClick:()=>r(l,{window:d.key}),className:de("rounded px-1.5 py-0.5",(c.window??"five_hour")===d.key?"bg-neutral-800 text-neutral-100":"text-neutral-500 hover:text-neutral-300"),title:u(d.titleKey),children:u(d.labelKey)},d.key))]}),o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fgBg")}),o.jsx(Ax,{value:c.color,editable:!0,onChange:d=>r(l,{color:d})}),o.jsx(Ax,{value:c.backgroundColor,editable:!0,allowNone:!0,noneSelected:c.backgroundColor===null,onNone:()=>r(l,{backgroundColor:null}),onChange:d=>r(l,{backgroundColor:d})})]}),o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fieldLabel")}),o.jsx("input",{value:c.label??"",onChange:d=>r(l,{label:d.target.value}),placeholder:u("statusline.labelPlaceholder"),className:"w-24 rounded bg-neutral-800 px-1.5 py-0.5 font-mono",title:u("statusline.labelInputHint")}),o.jsx("span",{className:"text-neutral-600",children:u("statusline.fieldFormat")}),o.jsx("input",{value:c.format??"",onChange:d=>r(l,{format:d.target.value}),placeholder:CM[l],className:"min-w-0 flex-1 rounded bg-neutral-800 px-1.5 py-0.5 font-mono",title:u("statusline.tokensTitle",{tokens:X6[l].map(d=>"{"+d+"}").join(" ")})})]}),o.jsxs("div",{className:"flex items-center justify-between border-t border-edge/[0.06] pt-2",children:[o.jsx("button",{onClick:i,className:"rounded px-2 py-1 text-xs text-red-400/80 hover:bg-red-900/30 hover:text-red-300",title:u("statusline.unplaceHint"),children:u("statusline.unplace")}),o.jsx("button",{onClick:a,className:"rounded bg-blue-900/50 px-3 py-1 text-xs text-blue-200 hover:bg-blue-900/70",children:u("statusline.done")})]})]})]})}),document.body)}function xn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=xn(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var KU={value:()=>{}};function vm(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Ph(n)}function Ph(e){this._=e}function qU(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Ph.prototype=vm.prototype={constructor:Ph,on:function(e,t){var n=this._,s=qU(e+"",n),r,i=-1,a=s.length;if(arguments.length<2){for(;++i<a;)if((r=(e=s[i]).type)&&(r=YU(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<a;)if(r=(e=s[i]).type)n[r]=FS(n[r],e.name,t);else if(t==null)for(r in n)n[r]=FS(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ph(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function YU(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function FS(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=KU,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Mx="http://www.w3.org/1999/xhtml";const BS={svg:"http://www.w3.org/2000/svg",xhtml:Mx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function km(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),BS.hasOwnProperty(t)?{space:BS[t],local:e}:e}function VU(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Mx&&t.documentElement.namespaceURI===Mx?t.createElement(e):t.createElementNS(n,e)}}function XU(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pj(e){var t=km(e);return(t.local?XU:VU)(t)}function QU(){}function Wv(e){return e==null?QU:function(){return this.querySelector(e)}}function WU(e){typeof e!="function"&&(e=Wv(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],a=i.length,l=s[r]=new Array(a),c,u,d=0;d<a;++d)(c=i[d])&&(u=e.call(c,c.__data__,d,i))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new Is(s,this._parents)}function ZU(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function JU(){return[]}function mj(e){return e==null?JU:function(){return this.querySelectorAll(e)}}function e8(e){return function(){return ZU(e.apply(this,arguments))}}function t8(e){typeof e=="function"?e=e8(e):e=mj(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var a=t[i],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(s.push(e.call(c,c.__data__,u,a)),r.push(c));return new Is(s,r)}function gj(e){return function(){return this.matches(e)}}function bj(e){return function(t){return t.matches(e)}}var n8=Array.prototype.find;function s8(e){return function(){return n8.call(this.children,e)}}function r8(){return this.firstElementChild}function i8(e){return this.select(e==null?r8:s8(typeof e=="function"?e:bj(e)))}var a8=Array.prototype.filter;function l8(){return Array.from(this.children)}function o8(e){return function(){return a8.call(this.children,e)}}function c8(e){return this.selectAll(e==null?l8:o8(typeof e=="function"?e:bj(e)))}function u8(e){typeof e!="function"&&(e=gj(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],a=i.length,l=s[r]=[],c,u=0;u<a;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Is(s,this._parents)}function xj(e){return new Array(e.length)}function d8(){return new Is(this._enter||this._groups.map(xj),this._parents)}function Cp(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Cp.prototype={constructor:Cp,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function f8(e){return function(){return e}}function h8(e,t,n,s,r,i){for(var a=0,l,c=t.length,u=i.length;a<u;++a)(l=t[a])?(l.__data__=i[a],s[a]=l):n[a]=new Cp(e,i[a]);for(;a<c;++a)(l=t[a])&&(r[a]=l)}function p8(e,t,n,s,r,i,a){var l,c,u=new Map,d=t.length,f=i.length,h=new Array(d),p;for(l=0;l<d;++l)(c=t[l])&&(h[l]=p=a.call(c,c.__data__,l,t)+"",u.has(p)?r[l]=c:u.set(p,c));for(l=0;l<f;++l)p=a.call(e,i[l],l,i)+"",(c=u.get(p))?(s[l]=c,c.__data__=i[l],u.delete(p)):n[l]=new Cp(e,i[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(h[l])===c&&(r[l]=c)}function m8(e){return e.__data__}function g8(e,t){if(!arguments.length)return Array.from(this,m8);var n=t?p8:h8,s=this._parents,r=this._groups;typeof e!="function"&&(e=f8(e));for(var i=r.length,a=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=s[u],f=r[u],h=f.length,p=b8(e.call(d,d&&d.__data__,u,s)),m=p.length,k=l[u]=new Array(m),w=a[u]=new Array(m),g=c[u]=new Array(h);n(d,f,k,w,g,p,t);for(var y=0,x=0,S,A;y<m;++y)if(S=k[y]){for(y>=x&&(x=y+1);!(A=w[x])&&++x<m;);S._next=A||null}}return a=new Is(a,s),a._enter=l,a._exit=c,a}function b8(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function x8(){return new Is(this._exit||this._groups.map(xj),this._parents)}function y8(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function v8(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,a=Math.min(r,i),l=new Array(r),c=0;c<a;++c)for(var u=n[c],d=s[c],f=u.length,h=l[c]=new Array(f),p,m=0;m<f;++m)(p=u[m]||d[m])&&(h[m]=p);for(;c<r;++c)l[c]=n[c];return new Is(l,this._parents)}function k8(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],a;--r>=0;)(a=s[r])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function w8(e){e||(e=S8);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var a=n[i],l=a.length,c=r[i]=new Array(l),u,d=0;d<l;++d)(u=a[d])&&(c[d]=u);c.sort(t)}return new Is(r,this._parents).order()}function S8(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function N8(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function E8(){return Array.from(this)}function _8(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var a=s[r];if(a)return a}return null}function C8(){let e=0;for(const t of this)++e;return e}function T8(){return!this.node()}function A8(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,a=r.length,l;i<a;++i)(l=r[i])&&e.call(l,l.__data__,i,r);return this}function M8(e){return function(){this.removeAttribute(e)}}function j8(e){return function(){this.removeAttributeNS(e.space,e.local)}}function R8(e,t){return function(){this.setAttribute(e,t)}}function O8(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function D8(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function I8(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function L8(e,t){var n=km(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?j8:M8:typeof t=="function"?n.local?I8:D8:n.local?O8:R8)(n,t))}function yj(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function P8(e){return function(){this.style.removeProperty(e)}}function z8(e,t,n){return function(){this.style.setProperty(e,t,n)}}function U8(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function F8(e,t,n){return arguments.length>1?this.each((t==null?P8:typeof t=="function"?U8:z8)(e,t,n??"")):fc(this.node(),e)}function fc(e,t){return e.style.getPropertyValue(t)||yj(e).getComputedStyle(e,null).getPropertyValue(t)}function B8(e){return function(){delete this[e]}}function H8(e,t){return function(){this[e]=t}}function $8(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function G8(e,t){return arguments.length>1?this.each((t==null?B8:typeof t=="function"?$8:H8)(e,t)):this.node()[e]}function vj(e){return e.trim().split(/^|\s+/)}function Zv(e){return e.classList||new kj(e)}function kj(e){this._node=e,this._names=vj(e.getAttribute("class")||"")}kj.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function wj(e,t){for(var n=Zv(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function Sj(e,t){for(var n=Zv(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function K8(e){return function(){wj(this,e)}}function q8(e){return function(){Sj(this,e)}}function Y8(e,t){return function(){(t.apply(this,arguments)?wj:Sj)(this,e)}}function V8(e,t){var n=vj(e+"");if(arguments.length<2){for(var s=Zv(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Y8:t?K8:q8)(n,t))}function X8(){this.textContent=""}function Q8(e){return function(){this.textContent=e}}function W8(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Z8(e){return arguments.length?this.each(e==null?X8:(typeof e=="function"?W8:Q8)(e)):this.node().textContent}function J8(){this.innerHTML=""}function eF(e){return function(){this.innerHTML=e}}function tF(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function nF(e){return arguments.length?this.each(e==null?J8:(typeof e=="function"?tF:eF)(e)):this.node().innerHTML}function sF(){this.nextSibling&&this.parentNode.appendChild(this)}function rF(){return this.each(sF)}function iF(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function aF(){return this.each(iF)}function lF(e){var t=typeof e=="function"?e:pj(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function oF(){return null}function cF(e,t){var n=typeof e=="function"?e:pj(e),s=t==null?oF:typeof t=="function"?t:Wv(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function uF(){var e=this.parentNode;e&&e.removeChild(this)}function dF(){return this.each(uF)}function fF(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hF(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pF(e){return this.select(e?hF:fF)}function mF(e){return arguments.length?this.property("__data__",e):this.node().__data__}function gF(e){return function(t){e.call(this,t,this.__data__)}}function bF(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function xF(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function yF(e,t,n){return function(){var s=this.__on,r,i=gF(t);if(s){for(var a=0,l=s.length;a<l;++a)if((r=s[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function vF(e,t,n){var s=bF(e+""),r,i=s.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(r=0,d=l[c];r<i;++r)if((a=s[r]).type===d.type&&a.name===d.name)return d.value}return}for(l=t?yF:xF,r=0;r<i;++r)this.each(l(s[r],t,n));return this}function Nj(e,t,n){var s=yj(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function kF(e,t){return function(){return Nj(this,e,t)}}function wF(e,t){return function(){return Nj(this,e,t.apply(this,arguments))}}function SF(e,t){return this.each((typeof t=="function"?wF:kF)(e,t))}function*NF(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,a;r<i;++r)(a=s[r])&&(yield a)}var Ej=[null];function Is(e,t){this._groups=e,this._parents=t}function Zd(){return new Is([[document.documentElement]],Ej)}function EF(){return this}Is.prototype=Zd.prototype={constructor:Is,select:WU,selectAll:t8,selectChild:i8,selectChildren:c8,filter:u8,data:g8,enter:d8,exit:x8,join:y8,merge:v8,selection:EF,order:k8,sort:w8,call:N8,nodes:E8,node:_8,size:C8,empty:T8,each:A8,attr:L8,style:F8,property:G8,classed:V8,text:Z8,html:nF,raise:rF,lower:aF,append:lF,insert:cF,remove:dF,clone:pF,datum:mF,on:vF,dispatch:SF,[Symbol.iterator]:NF};function Cs(e){return typeof e=="string"?new Is([[document.querySelector(e)]],[document.documentElement]):new Is([[e]],Ej)}function _F(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ar(e,t){if(e=_F(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const CF={passive:!1},ud={capture:!0,passive:!1};function Ug(e){e.stopImmediatePropagation()}function Lo(e){e.preventDefault(),e.stopImmediatePropagation()}function _j(e){var t=e.document.documentElement,n=Cs(e).on("dragstart.drag",Lo,ud);"onselectstart"in t?n.on("selectstart.drag",Lo,ud):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Cj(e,t){var n=e.document.documentElement,s=Cs(e).on("dragstart.drag",null);t&&(s.on("click.drag",Lo,ud),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Bf=e=>()=>e;function jx(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}jx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function TF(e){return!e.ctrlKey&&!e.button}function AF(){return this.parentNode}function MF(e,t){return t??{x:e.x,y:e.y}}function jF(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tj(){var e=TF,t=AF,n=MF,s=jF,r={},i=vm("start","drag","end"),a=0,l,c,u,d,f=0;function h(S){S.on("mousedown.drag",p).filter(s).on("touchstart.drag",w).on("touchmove.drag",g,CF).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(S,A){if(!(d||!e.call(this,S,A))){var E=x(this,t.call(this,S,A),S,A,"mouse");E&&(Cs(S.view).on("mousemove.drag",m,ud).on("mouseup.drag",k,ud),_j(S.view),Ug(S),u=!1,l=S.clientX,c=S.clientY,E("start",S))}}function m(S){if(Lo(S),!u){var A=S.clientX-l,E=S.clientY-c;u=A*A+E*E>f}r.mouse("drag",S)}function k(S){Cs(S.view).on("mousemove.drag mouseup.drag",null),Cj(S.view,u),Lo(S),r.mouse("end",S)}function w(S,A){if(e.call(this,S,A)){var E=S.changedTouches,M=t.call(this,S,A),j=E.length,O,N;for(O=0;O<j;++O)(N=x(this,M,S,A,E[O].identifier,E[O]))&&(Ug(S),N("start",S,E[O]))}}function g(S){var A=S.changedTouches,E=A.length,M,j;for(M=0;M<E;++M)(j=r[A[M].identifier])&&(Lo(S),j("drag",S,A[M]))}function y(S){var A=S.changedTouches,E=A.length,M,j;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),M=0;M<E;++M)(j=r[A[M].identifier])&&(Ug(S),j("end",S,A[M]))}function x(S,A,E,M,j,O){var N=i.copy(),F=ar(O||E,A),G,H,I;if((I=n.call(S,new jx("beforestart",{sourceEvent:E,target:h,identifier:j,active:a,x:F[0],y:F[1],dx:0,dy:0,dispatch:N}),M))!=null)return G=I.x-F[0]||0,H=I.y-F[1]||0,function L(C,D,U){var B=F,R;switch(C){case"start":r[j]=L,R=a++;break;case"end":delete r[j],--a;case"drag":F=ar(U||D,A),R=a;break}N.call(C,S,new jx(C,{sourceEvent:D,subject:I,target:h,identifier:j,active:R,x:F[0]+G,y:F[1]+H,dx:F[0]-B[0],dy:F[1]-B[1],dispatch:N}),M)}}return h.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Bf(!!S),h):e},h.container=function(S){return arguments.length?(t=typeof S=="function"?S:Bf(S),h):t},h.subject=function(S){return arguments.length?(n=typeof S=="function"?S:Bf(S),h):n},h.touchable=function(S){return arguments.length?(s=typeof S=="function"?S:Bf(!!S),h):s},h.on=function(){var S=i.on.apply(i,arguments);return S===i?h:S},h.clickDistance=function(S){return arguments.length?(f=(S=+S)*S,h):Math.sqrt(f)},h}function Jv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Aj(e,t){var n=Object.create(e.prototype);for(var s in t)n[s]=t[s];return n}function Jd(){}var dd=.7,Tp=1/dd,Po="\\s*([+-]?\\d+)\\s*",fd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Br="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",RF=/^#([0-9a-f]{3,8})$/,OF=new RegExp(`^rgb\\(${Po},${Po},${Po}\\)$`),DF=new RegExp(`^rgb\\(${Br},${Br},${Br}\\)$`),IF=new RegExp(`^rgba\\(${Po},${Po},${Po},${fd}\\)$`),LF=new RegExp(`^rgba\\(${Br},${Br},${Br},${fd}\\)$`),PF=new RegExp(`^hsl\\(${fd},${Br},${Br}\\)$`),zF=new RegExp(`^hsla\\(${fd},${Br},${Br},${fd}\\)$`),HS={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Jv(Jd,Ll,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$S,formatHex:$S,formatHex8:UF,formatHsl:FF,formatRgb:GS,toString:GS});function $S(){return this.rgb().formatHex()}function UF(){return this.rgb().formatHex8()}function FF(){return Mj(this).formatHsl()}function GS(){return this.rgb().formatRgb()}function Ll(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=RF.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?KS(t):n===3?new ms(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Hf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Hf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=OF.exec(e))?new ms(t[1],t[2],t[3],1):(t=DF.exec(e))?new ms(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=IF.exec(e))?Hf(t[1],t[2],t[3],t[4]):(t=LF.exec(e))?Hf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=PF.exec(e))?VS(t[1],t[2]/100,t[3]/100,1):(t=zF.exec(e))?VS(t[1],t[2]/100,t[3]/100,t[4]):HS.hasOwnProperty(e)?KS(HS[e]):e==="transparent"?new ms(NaN,NaN,NaN,0):null}function KS(e){return new ms(e>>16&255,e>>8&255,e&255,1)}function Hf(e,t,n,s){return s<=0&&(e=t=n=NaN),new ms(e,t,n,s)}function BF(e){return e instanceof Jd||(e=Ll(e)),e?(e=e.rgb(),new ms(e.r,e.g,e.b,e.opacity)):new ms}function Rx(e,t,n,s){return arguments.length===1?BF(e):new ms(e,t,n,s??1)}function ms(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}Jv(ms,Rx,Aj(Jd,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new ms(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?dd:Math.pow(dd,e),new ms(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ms(kl(this.r),kl(this.g),kl(this.b),Ap(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qS,formatHex:qS,formatHex8:HF,formatRgb:YS,toString:YS}));function qS(){return`#${sl(this.r)}${sl(this.g)}${sl(this.b)}`}function HF(){return`#${sl(this.r)}${sl(this.g)}${sl(this.b)}${sl((isNaN(this.opacity)?1:this.opacity)*255)}`}function YS(){const e=Ap(this.opacity);return`${e===1?"rgb(":"rgba("}${kl(this.r)}, ${kl(this.g)}, ${kl(this.b)}${e===1?")":`, ${e})`}`}function Ap(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function kl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sl(e){return e=kl(e),(e<16?"0":"")+e.toString(16)}function VS(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new or(e,t,n,s)}function Mj(e){if(e instanceof or)return new or(e.h,e.s,e.l,e.opacity);if(e instanceof Jd||(e=Ll(e)),!e)return new or;if(e instanceof or)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,r=Math.min(t,n,s),i=Math.max(t,n,s),a=NaN,l=i-r,c=(i+r)/2;return l?(t===i?a=(n-s)/l+(n<s)*6:n===i?a=(s-t)/l+2:a=(t-n)/l+4,l/=c<.5?i+r:2-i-r,a*=60):l=c>0&&c<1?0:a,new or(a,l,c,e.opacity)}function $F(e,t,n,s){return arguments.length===1?Mj(e):new or(e,t,n,s??1)}function or(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}Jv(or,$F,Aj(Jd,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new or(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?dd:Math.pow(dd,e),new or(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*t,r=2*n-s;return new ms(Fg(e>=240?e-240:e+120,r,s),Fg(e,r,s),Fg(e<120?e+240:e-120,r,s),this.opacity)},clamp(){return new or(XS(this.h),$f(this.s),$f(this.l),Ap(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ap(this.opacity);return`${e===1?"hsl(":"hsla("}${XS(this.h)}, ${$f(this.s)*100}%, ${$f(this.l)*100}%${e===1?")":`, ${e})`}`}}));function XS(e){return e=(e||0)%360,e<0?e+360:e}function $f(e){return Math.max(0,Math.min(1,e||0))}function Fg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ek=e=>()=>e;function GF(e,t){return function(n){return e+n*t}}function KF(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function qF(e){return(e=+e)==1?jj:function(t,n){return n-t?KF(t,n,e):ek(isNaN(t)?n:t)}}function jj(e,t){var n=t-e;return n?GF(e,n):ek(isNaN(e)?t:e)}const Mp=function e(t){var n=qF(t);function s(r,i){var a=n((r=Rx(r)).r,(i=Rx(i)).r),l=n(r.g,i.g),c=n(r.b,i.b),u=jj(r.opacity,i.opacity);return function(d){return r.r=a(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return s.gamma=e,s}(1);function YF(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),r;return function(i){for(r=0;r<n;++r)s[r]=e[r]*(1-i)+t[r]*i;return s}}function VF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function XF(e,t){var n=t?t.length:0,s=e?Math.min(n,e.length):0,r=new Array(s),i=new Array(n),a;for(a=0;a<s;++a)r[a]=Ru(e[a],t[a]);for(;a<n;++a)i[a]=t[a];return function(l){for(a=0;a<s;++a)i[a]=r[a](l);return i}}function QF(e,t){var n=new Date;return e=+e,t=+t,function(s){return n.setTime(e*(1-s)+t*s),n}}function Dr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function WF(e,t){var n={},s={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Ru(e[r],t[r]):s[r]=t[r];return function(i){for(r in n)s[r]=n[r](i);return s}}var Ox=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Bg=new RegExp(Ox.source,"g");function ZF(e){return function(){return e}}function JF(e){return function(t){return e(t)+""}}function Rj(e,t){var n=Ox.lastIndex=Bg.lastIndex=0,s,r,i,a=-1,l=[],c=[];for(e=e+"",t=t+"";(s=Ox.exec(e))&&(r=Bg.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),l[a]?l[a]+=i:l[++a]=i),(s=s[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,c.push({i:a,x:Dr(s,r)})),n=Bg.lastIndex;return n<t.length&&(i=t.slice(n),l[a]?l[a]+=i:l[++a]=i),l.length<2?c[0]?JF(c[0].x):ZF(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function Ru(e,t){var n=typeof t,s;return t==null||n==="boolean"?ek(t):(n==="number"?Dr:n==="string"?(s=Ll(t))?(t=s,Mp):Rj:t instanceof Ll?Mp:t instanceof Date?QF:VF(t)?YF:Array.isArray(t)?XF:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?WF:Dr)(e,t)}var QS=180/Math.PI,Dx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Oj(e,t,n,s,r,i){var a,l,c;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(c=e*n+t*s)&&(n-=e*c,s-=t*c),(l=Math.sqrt(n*n+s*s))&&(n/=l,s/=l,c/=l),e*s<t*n&&(e=-e,t=-t,c=-c,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*QS,skewX:Math.atan(c)*QS,scaleX:a,scaleY:l}}var Gf;function eB(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Dx:Oj(t.a,t.b,t.c,t.d,t.e,t.f)}function tB(e){return e==null||(Gf||(Gf=document.createElementNS("http://www.w3.org/2000/svg","g")),Gf.setAttribute("transform",e),!(e=Gf.transform.baseVal.consolidate()))?Dx:(e=e.matrix,Oj(e.a,e.b,e.c,e.d,e.e,e.f))}function Dj(e,t,n,s){function r(u){return u.length?u.pop()+" ":""}function i(u,d,f,h,p,m){if(u!==f||d!==h){var k=p.push("translate(",null,t,null,n);m.push({i:k-4,x:Dr(u,f)},{i:k-2,x:Dr(d,h)})}else(f||h)&&p.push("translate("+f+t+h+n)}function a(u,d,f,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,s)-2,x:Dr(u,d)})):d&&f.push(r(f)+"rotate("+d+s)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,s)-2,x:Dr(u,d)}):d&&f.push(r(f)+"skewX("+d+s)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var k=p.push(r(p)+"scale(",null,",",null,")");m.push({i:k-4,x:Dr(u,f)},{i:k-2,x:Dr(d,h)})}else(f!==1||h!==1)&&p.push(r(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,k=h.length,w;++m<k;)f[(w=h[m]).i]=w.x(p);return f.join("")}}}var nB=Dj(eB,"px, ","px)","deg)"),sB=Dj(tB,", ",")",")"),rB=1e-12;function WS(e){return((e=Math.exp(e))+1/e)/2}function iB(e){return((e=Math.exp(e))-1/e)/2}function aB(e){return((e=Math.exp(2*e))-1)/(e+1)}const zh=function e(t,n,s){function r(i,a){var l=i[0],c=i[1],u=i[2],d=a[0],f=a[1],h=a[2],p=d-l,m=f-c,k=p*p+m*m,w,g;if(k<rB)g=Math.log(h/u)/t,w=function(M){return[l+M*p,c+M*m,u*Math.exp(t*M*g)]};else{var y=Math.sqrt(k),x=(h*h-u*u+s*k)/(2*u*n*y),S=(h*h-u*u-s*k)/(2*h*n*y),A=Math.log(Math.sqrt(x*x+1)-x),E=Math.log(Math.sqrt(S*S+1)-S);g=(E-A)/t,w=function(M){var j=M*g,O=WS(A),N=u/(n*y)*(O*aB(t*j+A)-iB(A));return[l+N*p,c+N*m,u*O/WS(t*j+A)]}}return w.duration=g*1e3*t/Math.SQRT2,w}return r.rho=function(i){var a=Math.max(.001,+i),l=a*a,c=l*l;return e(a,l,c)},r}(Math.SQRT2,2,4);var hc=0,ou=0,Xc=0,Ij=1e3,jp,cu,Rp=0,Pl=0,wm=0,hd=typeof performance=="object"&&performance.now?performance:Date,Lj=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function tk(){return Pl||(Lj(lB),Pl=hd.now()+wm)}function lB(){Pl=0}function Op(){this._call=this._time=this._next=null}Op.prototype=Pj.prototype={constructor:Op,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?tk():+n)+(t==null?0:+t),!this._next&&cu!==this&&(cu?cu._next=this:jp=this,cu=this),this._call=e,this._time=n,Ix()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ix())}};function Pj(e,t,n){var s=new Op;return s.restart(e,t,n),s}function oB(){tk(),++hc;for(var e=jp,t;e;)(t=Pl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--hc}function ZS(){Pl=(Rp=hd.now())+wm,hc=ou=0;try{oB()}finally{hc=0,uB(),Pl=0}}function cB(){var e=hd.now(),t=e-Rp;t>Ij&&(wm-=t,Rp=e)}function uB(){for(var e,t=jp,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:jp=n);cu=e,Ix(s)}function Ix(e){if(!hc){ou&&(ou=clearTimeout(ou));var t=e-Pl;t>24?(e<1/0&&(ou=setTimeout(ZS,e-hd.now()-wm)),Xc&&(Xc=clearInterval(Xc))):(Xc||(Rp=hd.now(),Xc=setInterval(cB,Ij)),hc=1,Lj(ZS))}}function JS(e,t,n){var s=new Op;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var dB=vm("start","end","cancel","interrupt"),fB=[],zj=0,eN=1,Lx=2,Uh=3,tN=4,Px=5,Fh=6;function Sm(e,t,n,s,r,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;hB(e,n,{name:t,index:s,group:r,on:dB,tween:fB,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:zj})}function nk(e,t){var n=yr(e,t);if(n.state>zj)throw new Error("too late; already scheduled");return n}function qr(e,t){var n=yr(e,t);if(n.state>Uh)throw new Error("too late; already running");return n}function yr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function hB(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=Pj(i,0,n.time);function i(u){n.state=eN,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,p;if(n.state!==eN)return c();for(d in s)if(p=s[d],p.name===n.name){if(p.state===Uh)return JS(a);p.state===tN?(p.state=Fh,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete s[d]):+d<t&&(p.state=Fh,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete s[d])}if(JS(function(){n.state===Uh&&(n.state=tN,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Lx,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Lx){for(n.state=Uh,r=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(r[++f]=p);r.length=f+1}}function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=Px,1),f=-1,h=r.length;++f<h;)r[f].call(e,d);n.state===Px&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Fh,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function Bh(e,t){var n=e.__transition,s,r,i=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((s=n[a]).name!==t){i=!1;continue}r=s.state>Lx&&s.state<Px,s.state=Fh,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[a]}i&&delete e.__transition}}function pB(e){return this.each(function(){Bh(this,e)})}function mB(e,t){var n,s;return function(){var r=qr(this,e),i=r.tween;if(i!==n){s=n=i;for(var a=0,l=s.length;a<l;++a)if(s[a].name===t){s=s.slice(),s.splice(a,1);break}}r.tween=s}}function gB(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=qr(this,e),a=i.tween;if(a!==s){r=(s=a).slice();for(var l={name:t,value:n},c=0,u=r.length;c<u;++c)if(r[c].name===t){r[c]=l;break}c===u&&r.push(l)}i.tween=r}}function bB(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=yr(this.node(),n).tween,r=0,i=s.length,a;r<i;++r)if((a=s[r]).name===e)return a.value;return null}return this.each((t==null?mB:gB)(n,e,t))}function sk(e,t,n){var s=e._id;return e.each(function(){var r=qr(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return yr(r,s).value[t]}}function Uj(e,t){var n;return(typeof t=="number"?Dr:t instanceof Ll?Mp:(n=Ll(t))?(t=n,Mp):Rj)(e,t)}function xB(e){return function(){this.removeAttribute(e)}}function yB(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vB(e,t,n){var s,r=n+"",i;return function(){var a=this.getAttribute(e);return a===r?null:a===s?i:i=t(s=a,n)}}function kB(e,t,n){var s,r=n+"",i;return function(){var a=this.getAttributeNS(e.space,e.local);return a===r?null:a===s?i:i=t(s=a,n)}}function wB(e,t,n){var s,r,i;return function(){var a,l=n(this),c;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=l+"",a===c?null:a===s&&c===r?i:(r=c,i=t(s=a,l)))}}function SB(e,t,n){var s,r,i;return function(){var a,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=l+"",a===c?null:a===s&&c===r?i:(r=c,i=t(s=a,l)))}}function NB(e,t){var n=km(e),s=n==="transform"?sB:Uj;return this.attrTween(e,typeof t=="function"?(n.local?SB:wB)(n,s,sk(this,"attr."+e,t)):t==null?(n.local?yB:xB)(n):(n.local?kB:vB)(n,s,t))}function EB(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function _B(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function CB(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&_B(e,i)),n}return r._value=t,r}function TB(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&EB(e,i)),n}return r._value=t,r}function AB(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=km(e);return this.tween(n,(s.local?CB:TB)(s,t))}function MB(e,t){return function(){nk(this,e).delay=+t.apply(this,arguments)}}function jB(e,t){return t=+t,function(){nk(this,e).delay=t}}function RB(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?MB:jB)(t,e)):yr(this.node(),t).delay}function OB(e,t){return function(){qr(this,e).duration=+t.apply(this,arguments)}}function DB(e,t){return t=+t,function(){qr(this,e).duration=t}}function IB(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?OB:DB)(t,e)):yr(this.node(),t).duration}function LB(e,t){if(typeof t!="function")throw new Error;return function(){qr(this,e).ease=t}}function PB(e){var t=this._id;return arguments.length?this.each(LB(t,e)):yr(this.node(),t).ease}function zB(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qr(this,e).ease=n}}function UB(e){if(typeof e!="function")throw new Error;return this.each(zB(this._id,e))}function FB(e){typeof e!="function"&&(e=gj(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],a=i.length,l=s[r]=[],c,u=0;u<a;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new ji(s,this._parents,this._name,this._id)}function BB(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),a=new Array(s),l=0;l<i;++l)for(var c=t[l],u=n[l],d=c.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=c[p]||u[p])&&(f[p]=h);for(;l<s;++l)a[l]=t[l];return new ji(a,this._parents,this._name,this._id)}function HB(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function $B(e,t,n){var s,r,i=HB(t)?nk:qr;return function(){var a=i(this,e),l=a.on;l!==s&&(r=(s=l).copy()).on(t,n),a.on=r}}function GB(e,t){var n=this._id;return arguments.length<2?yr(this.node(),n).on.on(e):this.each($B(n,e,t))}function KB(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function qB(){return this.on("end.remove",KB(this._id))}function YB(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wv(e));for(var s=this._groups,r=s.length,i=new Array(r),a=0;a<r;++a)for(var l=s[a],c=l.length,u=i[a]=new Array(c),d,f,h=0;h<c;++h)(d=l[h])&&(f=e.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,Sm(u[h],t,n,h,u,yr(d,n)));return new ji(i,this._parents,t,n)}function VB(e){var t=this._name,n=this._id;typeof e!="function"&&(e=mj(e));for(var s=this._groups,r=s.length,i=[],a=[],l=0;l<r;++l)for(var c=s[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var h=e.call(d,d.__data__,f,c),p,m=yr(d,n),k=0,w=h.length;k<w;++k)(p=h[k])&&Sm(p,t,n,k,h,m);i.push(h),a.push(d)}return new ji(i,a,t,n)}var XB=Zd.prototype.constructor;function QB(){return new XB(this._groups,this._parents)}function WB(e,t){var n,s,r;return function(){var i=fc(this,e),a=(this.style.removeProperty(e),fc(this,e));return i===a?null:i===n&&a===s?r:r=t(n=i,s=a)}}function Fj(e){return function(){this.style.removeProperty(e)}}function ZB(e,t,n){var s,r=n+"",i;return function(){var a=fc(this,e);return a===r?null:a===s?i:i=t(s=a,n)}}function JB(e,t,n){var s,r,i;return function(){var a=fc(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),fc(this,e))),a===c?null:a===s&&c===r?i:(r=c,i=t(s=a,l))}}function eH(e,t){var n,s,r,i="style."+t,a="end."+i,l;return function(){var c=qr(this,e),u=c.on,d=c.value[i]==null?l||(l=Fj(t)):void 0;(u!==n||r!==d)&&(s=(n=u).copy()).on(a,r=d),c.on=s}}function tH(e,t,n){var s=(e+="")=="transform"?nB:Uj;return t==null?this.styleTween(e,WB(e,s)).on("end.style."+e,Fj(e)):typeof t=="function"?this.styleTween(e,JB(e,s,sk(this,"style."+e,t))).each(eH(this._id,e)):this.styleTween(e,ZB(e,s,t),n).on("end.style."+e,null)}function nH(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function sH(e,t,n){var s,r;function i(){var a=t.apply(this,arguments);return a!==r&&(s=(r=a)&&nH(e,a,n)),s}return i._value=t,i}function rH(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,sH(e,t,n??""))}function iH(e){return function(){this.textContent=e}}function aH(e){return function(){var t=e(this);this.textContent=t??""}}function lH(e){return this.tween("text",typeof e=="function"?aH(sk(this,"text",e)):iH(e==null?"":e+""))}function oH(e){return function(t){this.textContent=e.call(this,t)}}function cH(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&oH(r)),t}return s._value=e,s}function uH(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,cH(e))}function dH(){for(var e=this._name,t=this._id,n=Bj(),s=this._groups,r=s.length,i=0;i<r;++i)for(var a=s[i],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var d=yr(c,t);Sm(c,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new ji(s,this._parents,e,n)}function fH(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,a){var l={value:a},c={value:function(){--r===0&&i()}};n.each(function(){var u=qr(this,s),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),r===0&&i()})}var hH=0;function ji(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Bj(){return++hH}var li=Zd.prototype;ji.prototype={constructor:ji,select:YB,selectAll:VB,selectChild:li.selectChild,selectChildren:li.selectChildren,filter:FB,merge:BB,selection:QB,transition:dH,call:li.call,nodes:li.nodes,node:li.node,size:li.size,empty:li.empty,each:li.each,on:GB,attr:NB,attrTween:AB,style:tH,styleTween:rH,text:lH,textTween:uH,remove:qB,tween:bB,delay:RB,duration:IB,ease:PB,easeVarying:UB,end:fH,[Symbol.iterator]:li[Symbol.iterator]};function pH(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var mH={time:null,delay:0,duration:250,ease:pH};function gH(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function bH(e){var t,n;e instanceof ji?(t=e._id,e=e._name):(t=Bj(),(n=mH).time=tk(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var a=s[i],l=a.length,c,u=0;u<l;++u)(c=a[u])&&Sm(c,e,t,u,a,n||gH(c,t));return new ji(s,this._parents,e,t)}Zd.prototype.interrupt=pB;Zd.prototype.transition=bH;const Kf=e=>()=>e;function xH(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function yi(e,t,n){this.k=e,this.x=t,this.y=n}yi.prototype={constructor:yi,scale:function(e){return e===1?this:new yi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new yi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Nm=new yi(1,0,0);Hj.prototype=yi.prototype;function Hj(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Nm;return e.__zoom}function Hg(e){e.stopImmediatePropagation()}function Qc(e){e.preventDefault(),e.stopImmediatePropagation()}function yH(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function vH(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function nN(){return this.__zoom||Nm}function kH(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function wH(){return navigator.maxTouchPoints||"ontouchstart"in this}function SH(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function $j(){var e=yH,t=vH,n=SH,s=kH,r=wH,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=zh,u=vm("start","zoom","end"),d,f,h,p=500,m=150,k=0,w=10;function g(I){I.property("__zoom",nN).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",N).filter(r).on("touchstart.zoom",F).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(I,L,C,D){var U=I.selection?I.selection():I;U.property("__zoom",nN),I!==U?A(I,L,C,D):U.interrupt().each(function(){E(this,arguments).event(D).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},g.scaleBy=function(I,L,C,D){g.scaleTo(I,function(){var U=this.__zoom.k,B=typeof L=="function"?L.apply(this,arguments):L;return U*B},C,D)},g.scaleTo=function(I,L,C,D){g.transform(I,function(){var U=t.apply(this,arguments),B=this.__zoom,R=C==null?S(U):typeof C=="function"?C.apply(this,arguments):C,_=B.invert(R),K=typeof L=="function"?L.apply(this,arguments):L;return n(x(y(B,K),R,_),U,a)},C,D)},g.translateBy=function(I,L,C,D){g.transform(I,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,D)},g.translateTo=function(I,L,C,D,U){g.transform(I,function(){var B=t.apply(this,arguments),R=this.__zoom,_=D==null?S(B):typeof D=="function"?D.apply(this,arguments):D;return n(Nm.translate(_[0],_[1]).scale(R.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof C=="function"?-C.apply(this,arguments):-C),B,a)},D,U)};function y(I,L){return L=Math.max(i[0],Math.min(i[1],L)),L===I.k?I:new yi(L,I.x,I.y)}function x(I,L,C){var D=L[0]-C[0]*I.k,U=L[1]-C[1]*I.k;return D===I.x&&U===I.y?I:new yi(I.k,D,U)}function S(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function A(I,L,C,D){I.on("start.zoom",function(){E(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(D).end()}).tween("zoom",function(){var U=this,B=arguments,R=E(U,B).event(D),_=t.apply(U,B),K=C==null?S(_):typeof C=="function"?C.apply(U,B):C,T=Math.max(_[1][0]-_[0][0],_[1][1]-_[0][1]),X=U.__zoom,ne=typeof L=="function"?L.apply(U,B):L,J=c(X.invert(K).concat(T/X.k),ne.invert(K).concat(T/ne.k));return function(pe){if(pe===1)pe=ne;else{var q=J(pe),Y=T/q[2];pe=new yi(Y,K[0]-q[0]*Y,K[1]-q[1]*Y)}R.zoom(null,pe)}})}function E(I,L,C){return!C&&I.__zooming||new M(I,L)}function M(I,L){this.that=I,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(I,L),this.taps=0}M.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,L){return this.mouse&&I!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var L=Cs(this.that).datum();u.call(I,this.that,new xH(I,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),L)}};function j(I,...L){if(!e.apply(this,arguments))return;var C=E(this,L).event(I),D=this.__zoom,U=Math.max(i[0],Math.min(i[1],D.k*Math.pow(2,s.apply(this,arguments)))),B=ar(I);if(C.wheel)(C.mouse[0][0]!==B[0]||C.mouse[0][1]!==B[1])&&(C.mouse[1]=D.invert(C.mouse[0]=B)),clearTimeout(C.wheel);else{if(D.k===U)return;C.mouse=[B,D.invert(B)],Bh(this),C.start()}Qc(I),C.wheel=setTimeout(R,m),C.zoom("mouse",n(x(y(D,U),C.mouse[0],C.mouse[1]),C.extent,a));function R(){C.wheel=null,C.end()}}function O(I,...L){if(h||!e.apply(this,arguments))return;var C=I.currentTarget,D=E(this,L,!0).event(I),U=Cs(I.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",T,!0),B=ar(I,C),R=I.clientX,_=I.clientY;_j(I.view),Hg(I),D.mouse=[B,this.__zoom.invert(B)],Bh(this),D.start();function K(X){if(Qc(X),!D.moved){var ne=X.clientX-R,J=X.clientY-_;D.moved=ne*ne+J*J>k}D.event(X).zoom("mouse",n(x(D.that.__zoom,D.mouse[0]=ar(X,C),D.mouse[1]),D.extent,a))}function T(X){U.on("mousemove.zoom mouseup.zoom",null),Cj(X.view,D.moved),Qc(X),D.event(X).end()}}function N(I,...L){if(e.apply(this,arguments)){var C=this.__zoom,D=ar(I.changedTouches?I.changedTouches[0]:I,this),U=C.invert(D),B=C.k*(I.shiftKey?.5:2),R=n(x(y(C,B),D,U),t.apply(this,L),a);Qc(I),l>0?Cs(this).transition().duration(l).call(A,R,D,I):Cs(this).call(g.transform,R,D,I)}}function F(I,...L){if(e.apply(this,arguments)){var C=I.touches,D=C.length,U=E(this,L,I.changedTouches.length===D).event(I),B,R,_,K;for(Hg(I),R=0;R<D;++R)_=C[R],K=ar(_,this),K=[K,this.__zoom.invert(K),_.identifier],U.touch0?!U.touch1&&U.touch0[2]!==K[2]&&(U.touch1=K,U.taps=0):(U.touch0=K,B=!0,U.taps=1+!!d);d&&(d=clearTimeout(d)),B&&(U.taps<2&&(f=K[0],d=setTimeout(function(){d=null},p)),Bh(this),U.start())}}function G(I,...L){if(this.__zooming){var C=E(this,L).event(I),D=I.changedTouches,U=D.length,B,R,_,K;for(Qc(I),B=0;B<U;++B)R=D[B],_=ar(R,this),C.touch0&&C.touch0[2]===R.identifier?C.touch0[0]=_:C.touch1&&C.touch1[2]===R.identifier&&(C.touch1[0]=_);if(R=C.that.__zoom,C.touch1){var T=C.touch0[0],X=C.touch0[1],ne=C.touch1[0],J=C.touch1[1],pe=(pe=ne[0]-T[0])*pe+(pe=ne[1]-T[1])*pe,q=(q=J[0]-X[0])*q+(q=J[1]-X[1])*q;R=y(R,Math.sqrt(pe/q)),_=[(T[0]+ne[0])/2,(T[1]+ne[1])/2],K=[(X[0]+J[0])/2,(X[1]+J[1])/2]}else if(C.touch0)_=C.touch0[0],K=C.touch0[1];else return;C.zoom("touch",n(x(R,_,K),C.extent,a))}}function H(I,...L){if(this.__zooming){var C=E(this,L).event(I),D=I.changedTouches,U=D.length,B,R;for(Hg(I),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),B=0;B<U;++B)R=D[B],C.touch0&&C.touch0[2]===R.identifier?delete C.touch0:C.touch1&&C.touch1[2]===R.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(R=ar(R,this),Math.hypot(f[0]-R[0],f[1]-R[1])<w)){var _=Cs(this).on("dblclick.zoom");_&&_.apply(this,arguments)}}}return g.wheelDelta=function(I){return arguments.length?(s=typeof I=="function"?I:Kf(+I),g):s},g.filter=function(I){return arguments.length?(e=typeof I=="function"?I:Kf(!!I),g):e},g.touchable=function(I){return arguments.length?(r=typeof I=="function"?I:Kf(!!I),g):r},g.extent=function(I){return arguments.length?(t=typeof I=="function"?I:Kf([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),g):t},g.scaleExtent=function(I){return arguments.length?(i[0]=+I[0],i[1]=+I[1],g):[i[0],i[1]]},g.translateExtent=function(I){return arguments.length?(a[0][0]=+I[0][0],a[1][0]=+I[1][0],a[0][1]=+I[0][1],a[1][1]=+I[1][1],g):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},g.constrain=function(I){return arguments.length?(n=I,g):n},g.duration=function(I){return arguments.length?(l=+I,g):l},g.interpolate=function(I){return arguments.length?(c=I,g):c},g.on=function(){var I=u.on.apply(u,arguments);return I===u?g:I},g.clickDistance=function(I){return arguments.length?(k=(I=+I)*I,g):Math.sqrt(k)},g.tapDistance=function(I){return arguments.length?(w=+I,g):w},g}const gr={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},pd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Gj=["Enter"," ","Escape"],Kj={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var pc;(function(e){e.Strict="strict",e.Loose="loose"})(pc||(pc={}));var wl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(wl||(wl={}));var md;(function(e){e.Partial="partial",e.Full="full"})(md||(md={}));const qj={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ra;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ra||(ra={}));var mc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(mc||(mc={}));var Xe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Xe||(Xe={}));const sN={[Xe.Left]:Xe.Right,[Xe.Right]:Xe.Left,[Xe.Top]:Xe.Bottom,[Xe.Bottom]:Xe.Top},Yj=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,NH=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rk=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ef=(e,t=[0,0])=>{const{width:n,height:s}=vr(e),r=e.origin??t,i=n*r[0],a=s*r[1];return{x:e.position.x-i,y:e.position.y-a}},EH=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const s=e.reduce((r,i)=>{const a=typeof i=="string";let l=!t.nodeLookup&&!a?i:void 0;return t.nodeLookup&&(l=a?t.nodeLookup.get(i):rk(i)?i:t.nodeLookup.get(i.id)),l?(n=!0,Em(r,Dp(l,t.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?_m(s):{x:0,y:0,width:0,height:0}},tf=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=Em(n,Dp(r)),s=!0)}),s?_m(n):{x:0,y:0,width:0,height:0}},ik=(e,t,[n,s,r]=[0,0,1],i=!1,a=!1)=>{const l=(t.x-n)/r,c=(t.y-s)/r,u=t.width/r,d=t.height/r,f=[];for(const h of e.values()){const{measured:p,selectable:m=!0,hidden:k=!1}=h;if(a&&!m||k)continue;const w=p.width??h.width??h.initialWidth??0,g=p.height??h.height??h.initialHeight??0,{x:y,y:x}=h.internals.positionAbsolute,S=Wj(l,c,u,d,y,x,w,g),A=w*g,E=i&&S>0;(!h.internals.handleBounds||E||S>=A||h.dragging)&&f.push(h)}return f},_H=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function CH(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let i;if(t!=null&&t.includeHiddenNodes){const{width:a,height:l}=vr(r);i=a>0&&l>0}else i=!!(r.measured.width&&r.measured.height&&!r.hidden);i&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function TH({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},a){if(e.size===0)return!0;const l=CH(e,a),c=tf(l),u=lk(c,t,n,(a==null?void 0:a.minZoom)??r,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await s.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function Vj({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??s;let f=a.extent||r;if(a.extent==="parent"&&!a.expandParent)if(!l)i==null||i("005",gr.error005());else{const{width:p,height:m}=vr(l);p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&Ul(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const h=Ul(f)?zl(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",gr.error015())),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function AH({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=i.has(h.id),m=!p&&h.parentId&&a.find(k=>k.id===h.parentId);(p||m)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=s.filter(h=>h.deletable!==!1),d=_H(a,c);for(const h of c)l.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:a};const f=await r({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const gc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),zl=(e={x:0,y:0},t,n)=>({x:gc(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:gc(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Xj(e,t,n){const{width:s,height:r}=vr(n),{x:i,y:a}=n.internals.positionAbsolute;return zl(e,[[i,a],[i+s,a+r]],t)}const rN=(e,t,n)=>e<t?gc(Math.abs(e-t),1,t)/t:e>n?-gc(Math.abs(e-n),1,t)/t:0,ak=(e,t,n=15,s=40)=>{const r=rN(e.x,s,t.width-s)*n,i=rN(e.y,s,t.height-s)*n;return[r,i]},Em=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),zx=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),_m=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),gd=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=rk(e)?e.internals.positionAbsolute:ef(e,t);return{x:n,y:s,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Dp=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=rk(e)?e.internals.positionAbsolute:ef(e,t);return{x:n,y:s,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:s+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Qj=(e,t)=>_m(Em(zx(e),zx(t))),Wj=(e,t,n,s,r,i,a,l)=>{const c=Math.max(0,Math.min(e+n,r+a)-Math.max(e,r)),u=Math.max(0,Math.min(t+s,i+l)-Math.max(t,i));return Math.ceil(c*u)},Ip=(e,t)=>Wj(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),iN=e=>ur(e.width)&&ur(e.height)&&ur(e.x)&&ur(e.y),ur=e=>!isNaN(e)&&isFinite(e),Zj=(e,t)=>(n,s)=>{},nf=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),sf=({x:e,y:t},[n,s,r],i=!1,a=[1,1])=>{const l={x:(e-n)/r,y:(t-s)/r};return i?nf(l,a):l},bc=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s});function Jl(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function MH(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=Jl(e,n),r=Jl(e,t);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof e=="object"){const s=Jl(e.top??e.y??0,n),r=Jl(e.bottom??e.y??0,n),i=Jl(e.left??e.x??0,t),a=Jl(e.right??e.x??0,t);return{top:s,right:a,bottom:r,left:i,x:i+a,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function jH(e,t,n,s,r,i){const{x:a,y:l}=bc(e,[t,n,s]),{x:c,y:u}=bc({x:e.x+e.width,y:e.y+e.height},[t,n,s]),d=r-c,f=i-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const lk=(e,t,n,s,r,i)=>{const a=MH(i,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=gc(u,s,r),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,k=jH(e,p,m,d,t,n),w={left:Math.min(k.left-a.left,0),top:Math.min(k.top-a.top,0),right:Math.min(k.right-a.right,0),bottom:Math.min(k.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},bd=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ul(e){return e!=null&&e!=="parent"}function vr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Jj(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function e5(e,t={width:0,height:0},n,s,r){const i={...e},a=s.get(n);if(a){const l=a.origin||r;i.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function aN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function RH(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function OH(e){return{...Kj,...e||{}}}function t5(e){return e===null?null:e?"valid":"invalid"}function Ou(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:a}=dr(e),l=sf({x:i-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},s),{x:c,y:u}=n?nf(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const ok=e=>({width:e.offsetWidth,height:e.offsetHeight}),n5=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},DH=["INPUT","SELECT","TEXTAREA"];function s5(e){var s,r;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:DH.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const r5=e=>"clientX"in e,dr=(e,t)=>{var i,a;const n=r5(e),s=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,r=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},lN=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:r,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/s,y:(l.top-n.top)/s,...ok(a)}})};function i5({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:l}){const c=e*.125+r*.375+a*.375+n*.125,u=t*.125+i*.375+l*.375+s*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function qf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function oN({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case Xe.Left:return[t-qf(t-s,i),n];case Xe.Right:return[t+qf(s-t,i),n];case Xe.Top:return[t,n-qf(n-r,i)];case Xe.Bottom:return[t,n+qf(r-n,i)]}}function a5({sourceX:e,sourceY:t,sourcePosition:n=Xe.Bottom,targetX:s,targetY:r,targetPosition:i=Xe.Top,curvature:a=.25}){const[l,c]=oN({pos:n,x1:e,y1:t,x2:s,y2:r,c:a}),[u,d]=oN({pos:i,x1:s,y1:r,x2:e,y2:t,c:a}),[f,h,p,m]=i5({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${s},${r}`,f,h,p,m]}function l5({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,a=Math.abs(s-t)/2,l=s<t?s+a:s-a;return[i,l,r,a]}function IH({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return s;const a=r&&n?s+1e3:s,l=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return a+l}function LH({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=Em(Dp(e),Dp(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const a={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return Ip(a,_m(i))>0}const PH=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,zH=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),UH=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",gr.error006()),t;const s=n.getEdgeId||PH;let r;return Yj(e)?r={...e}:r={...e,id:s(e)},zH(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function o5({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,a,l]=l5({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,a,l]}const cN={[Xe.Left]:{x:-1,y:0},[Xe.Right]:{x:1,y:0},[Xe.Top]:{x:0,y:-1},[Xe.Bottom]:{x:0,y:1}},FH=({source:e,sourcePosition:t=Xe.Bottom,target:n})=>t===Xe.Left||t===Xe.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},uN=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function BH({source:e,sourcePosition:t=Xe.Bottom,target:n,targetPosition:s=Xe.Top,center:r,offset:i,stepPosition:a}){const l=cN[t],c=cN[s],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=FH({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],k,w;const g={x:0,y:0},y={x:0,y:0},[,,x,S]=l5({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(k=r.x??u.x+(d.x-u.x)*a,w=r.y??(u.y+d.y)/2):(k=r.x??(u.x+d.x)/2,w=r.y??u.y+(d.y-u.y)*a);const j=[{x:k,y:u.y},{x:k,y:d.y}],O=[{x:u.x,y:w},{x:d.x,y:w}];l[h]===p?m=h==="x"?j:O:m=h==="x"?O:j}else{const j=[{x:u.x,y:d.y}],O=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?O:j:m=l.y===p?j:O,t===s){const I=Math.abs(e[h]-n[h]);if(I<=i){const L=Math.min(i-1,i-I);l[h]===p?g[h]=(u[h]>e[h]?-1:1)*L:y[h]=(d[h]>n[h]?-1:1)*L}}if(t!==s){const I=h==="x"?"y":"x",L=l[h]===c[I],C=u[I]>d[I],D=u[I]<d[I];(l[h]===1&&(!L&&C||L&&D)||l[h]!==1&&(!L&&D||L&&C))&&(m=h==="x"?j:O)}const N={x:u.x+g.x,y:u.y+g.y},F={x:d.x+y.x,y:d.y+y.y},G=Math.max(Math.abs(N.x-m[0].x),Math.abs(F.x-m[0].x)),H=Math.max(Math.abs(N.y-m[0].y),Math.abs(F.y-m[0].y));G>=H?(k=(N.x+F.x)/2,w=m[0].y):(k=m[0].x,w=(N.y+F.y)/2)}const A={x:u.x+g.x,y:u.y+g.y},E={x:d.x+y.x,y:d.y+y.y};return[[e,...A.x!==m[0].x||A.y!==m[0].y?[A]:[],...m,...E.x!==m[m.length-1].x||E.y!==m[m.length-1].y?[E]:[],n],k,w,x,S]}function HH(e,t,n,s){const r=Math.min(uN(e,t)/2,uN(t,n)/2,s),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+r*u},${a}Q ${i},${a} ${i},${a+r*d}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${a+r*c}Q ${i},${a} ${i+r*l},${a}`}function Ux({sourceX:e,sourceY:t,sourcePosition:n=Xe.Bottom,targetX:s,targetY:r,targetPosition:i=Xe.Top,borderRadius:a=5,centerX:l,centerY:c,offset:u=20,stepPosition:d=.5}){const[f,h,p,m,k]=BH({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:l,y:c},offset:u,stepPosition:d});let w=`M${f[0].x} ${f[0].y}`;for(let g=1;g<f.length-1;g++)w+=HH(f[g-1],f[g],f[g+1],a);return w+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[w,h,p,m,k]}function dN(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function $H(e){var f;const{sourceNode:t,targetNode:n}=e;if(!dN(t)||!dN(n))return null;const s=t.internals.handleBounds||fN(t.handles),r=n.internals.handleBounds||fN(n.handles),i=hN((s==null?void 0:s.source)??[],e.sourceHandle),a=hN(e.connectionMode===pc.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!i||!a)return(f=e.onError)==null||f.call(e,"008",gr.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Xe.Bottom,c=(a==null?void 0:a.position)||Xe.Top,u=Fl(t,i,l),d=Fl(n,a,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}function fN(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function Fl(e,t,n=Xe.Left,s=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??vr(e);if(s)return{x:r+a/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Xe.Top:return{x:r+a/2,y:i};case Xe.Right:return{x:r+a,y:i+l/2};case Xe.Bottom:return{x:r+a/2,y:i+l};case Xe.Left:return{x:r,y:i+l/2}}}function hN(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Fx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function GH(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((a,l)=>([l.markerStart||s,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=Fx(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const c5=1e3,KH=10,ck={nodeOrigin:[0,0],nodeExtent:pd,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},qH={...ck,checkEquality:!0};function uk(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function YH(e,t,n){const s=uk(ck,n);for(const r of e.values())if(r.parentId)fk(r,e,t,s);else{const i=ef(r,s.nodeOrigin),a=Ul(r.extent)?r.extent:s.nodeExtent,l=zl(i,a,vr(r));r.internals.positionAbsolute=l}}function VH(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],s=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&s.push(i)}return{source:n,target:s}}function dk(e){return e==="manual"}function Bx(e,t,n,s={}){var d,f;const r=uk(qH,s),i={i:0},a=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!dk(r.zIndexMode)?c5:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=a.get(h.id);if(r.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const m=ef(h,r.nodeOrigin),k=Ul(h.extent)?h.extent:r.nodeExtent,w=zl(m,k,vr(h));p={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:VH(h,p),z:u5(h,l,r.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(c=!1),h.parentId&&fk(p,t,n,s,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function XH(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function fk(e,t,n,s,r){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=uk(ck,s),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}XH(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*KH),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=i&&!dk(c)?c5:0,{x:h,y:p,z:m}=QH(e,d,a,l,f,c),{positionAbsolute:k}=e.internals,w=h!==k.x||p!==k.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:k,z:m}})}function u5(e,t,n){const s=ur(e.zIndex)?e.zIndex:0;return dk(n)?s:s+(e.selected?t:0)}function QH(e,t,n,s,r,i){const{x:a,y:l}=t.internals.positionAbsolute,c=vr(e),u=ef(e,n),d=Ul(e.extent)?zl(u,e.extent,c):u;let f=zl({x:a+d.x,y:l+d.y},s,c);e.extent==="parent"&&(f=Xj(f,c,t));const h=u5(e,r,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function hk(e,t,n,s=[0,0]){var a;const r=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=i.get(l.parentId))==null?void 0:a.expandedRect)??gd(c),d=Qj(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=vr(c),h=c.origin??s,p=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,m=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,k=Math.max(f.width,Math.round(l.width)),w=Math.max(f.height,Math.round(l.height)),g=(k-f.width)*h[0],y=(w-f.height)*h[1];(p>0||m>0||g||y)&&(r.push({id:u,type:"position",position:{x:c.position.x-p+g,y:c.position.y-m+y}}),(x=n.get(u))==null||x.forEach(S=>{e.some(A=>A.id===S.id)||r.push({id:S.id,type:"position",position:{x:S.position.x+p,y:S.position.y+m}})})),(f.width<l.width||f.height<l.height||p||m)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:k+(p?h[0]*p-g:0),height:w+(m?h[1]*m-y:0)}})}),r}function WH(e,t,n,s,r,i,a){const l=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const u=[],d=window.getComputedStyle(l),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=[];for(const p of e.values()){const m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}const k=ok(p.nodeElement),w=m.measured.width!==k.width||m.measured.height!==k.height;if(!!(k.width&&k.height&&(w||!m.internals.handleBounds||p.force))){const y=p.nodeElement.getBoundingClientRect(),x=Ul(m.extent)?m.extent:i;let{positionAbsolute:S}=m.internals;if(m.parentId&&m.extent==="parent"){const E=t.get(m.parentId);E&&(S=Xj(S,k,E))}else x&&(S=zl(S,x,k));const A={...m,measured:k,internals:{...m.internals,positionAbsolute:S,handleBounds:{source:lN("source",p.nodeElement,y,f,m.id),target:lN("target",p.nodeElement,y,f,m.id)}}};t.set(m.id,A),m.parentId&&fk(A,t,n,{nodeOrigin:r,zIndexMode:a}),c=!0,w&&(u.push({id:m.id,type:"dimensions",dimensions:k}),m.expandParent&&m.parentId&&h.push({id:m.id,parentId:m.parentId,rect:gd(A,r)}))}}if(h.length>0){const p=hk(h,t,n,r);u.push(...p)}return{changes:u,updatedInternals:c}}async function ZH({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],s);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function pN(e,t,n,s,r,i){let a=r;const l=s.get(a)||new Map;s.set(a,l.set(n,t)),a=`${r}-${e}`;const c=s.get(a)||new Map;if(s.set(a,c.set(n,t)),i){a=`${r}-${e}-${i}`;const u=s.get(a)||new Map;s.set(a,u.set(n,t))}}function d5(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:a=null,targetHandle:l=null}=s,c={edgeId:s.id,source:r,target:i,sourceHandle:a,targetHandle:l},u=`${r}-${a}--${i}-${l}`,d=`${i}-${l}--${r}-${a}`;pN("source",c,d,e,r,a),pN("target",c,u,e,i,l),t.set(s.id,s)}}function f5(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:f5(n,t):!1}function mN(e,t,n){var r;let s=e;do{if((r=s==null?void 0:s.matches)!=null&&r.call(s,t))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function JH(e,t,n,s){const r=new Map;for(const[i,a]of e)if((a.selected||a.id===s)&&(!a.parentId||!f5(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(i);l&&r.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function $g({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var a,l,c;const r=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&r.push({...f,position:d.position,dragging:s})}if(!e)return[r[0],r];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:s}:r[0],r]}function e$({dragItems:e,snapGrid:t,x:n,y:s}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:s-r.distance.y},a=nf(i,t);return{x:a.x-i.x,y:a.y-i.y}}function t$({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,k=null;function w({noDragClassName:y,handleSelector:x,domNode:S,isSelectable:A,nodeId:E,nodeClickDistance:M=0}){h=Cs(S);function j({x:G,y:H}){const{nodeLookup:I,nodeExtent:L,snapGrid:C,snapToGrid:D,nodeOrigin:U,onNodeDrag:B,onSelectionDrag:R,onError:_,updateNodePositions:K}=t();i={x:G,y:H};let T=!1;const X=l.size>1,ne=X&&L?zx(tf(l)):null,J=X&&D?e$({dragItems:l,snapGrid:C,x:G,y:H}):null;for(const[pe,q]of l){if(!I.has(pe))continue;let Y={x:G-q.distance.x,y:H-q.distance.y};D&&(Y=J?{x:Math.round(Y.x+J.x),y:Math.round(Y.y+J.y)}:nf(Y,C));let V=null;if(X&&L&&!q.extent&&ne){const{positionAbsolute:ye}=q.internals,Re=ye.x-ne.x+L[0][0],se=ye.x+q.measured.width-ne.x2+L[1][0],Q=ye.y-ne.y+L[0][1],Te=ye.y+q.measured.height-ne.y2+L[1][1];V=[[Re,Q],[se,Te]]}const{position:ee,positionAbsolute:oe}=Vj({nodeId:pe,nextPosition:Y,nodeLookup:I,nodeExtent:V||L,nodeOrigin:U,onError:_});T=T||q.position.x!==ee.x||q.position.y!==ee.y,q.position=ee,q.internals.positionAbsolute=oe}if(m=m||T,!!T&&(K(l,!0),k&&(s||B||!E&&R))){const[pe,q]=$g({nodeId:E,dragItems:l,nodeLookup:I});s==null||s(k,l,pe,q),B==null||B(k,pe,q),E||R==null||R(k,q)}}async function O(){if(!d)return;const{transform:G,panBy:H,autoPanSpeed:I,autoPanOnNodeDrag:L}=t();if(!L){c=!1,cancelAnimationFrame(a);return}const[C,D]=ak(u,d,I);(C!==0||D!==0)&&(i.x=(i.x??0)-C/G[2],i.y=(i.y??0)-D/G[2],await H({x:C,y:D})&&j(i)),a=requestAnimationFrame(O)}function N(G){var X;const{nodeLookup:H,multiSelectionActive:I,nodesDraggable:L,transform:C,snapGrid:D,snapToGrid:U,selectNodesOnDrag:B,onNodeDragStart:R,onSelectionDragStart:_,unselectNodesAndEdges:K}=t();f=!0,(!B||!A)&&!I&&E&&((X=H.get(E))!=null&&X.selected||K()),A&&B&&E&&(e==null||e(E));const T=Ou(G.sourceEvent,{transform:C,snapGrid:D,snapToGrid:U,containerBounds:d});if(i=T,l=JH(H,L,T,E),l.size>0&&(n||R||!E&&_)){const[ne,J]=$g({nodeId:E,dragItems:l,nodeLookup:H});n==null||n(G.sourceEvent,l,ne,J),R==null||R(G.sourceEvent,ne,J),E||_==null||_(G.sourceEvent,J)}}const F=Tj().clickDistance(M).on("start",G=>{const{domNode:H,nodeDragThreshold:I,transform:L,snapGrid:C,snapToGrid:D}=t();d=(H==null?void 0:H.getBoundingClientRect())||null,p=!1,m=!1,k=G.sourceEvent,I===0&&N(G),i=Ou(G.sourceEvent,{transform:L,snapGrid:C,snapToGrid:D,containerBounds:d}),u=dr(G.sourceEvent,d)}).on("drag",G=>{const{autoPanOnNodeDrag:H,transform:I,snapGrid:L,snapToGrid:C,nodeDragThreshold:D,nodeLookup:U}=t(),B=Ou(G.sourceEvent,{transform:I,snapGrid:L,snapToGrid:C,containerBounds:d});if(k=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||E&&!U.has(E))&&(p=!0),!p){if(!c&&H&&f&&(c=!0,O()),!f){const R=dr(G.sourceEvent,d),_=R.x-u.x,K=R.y-u.y;Math.sqrt(_*_+K*K)>D&&N(G)}(i.x!==B.xSnapped||i.y!==B.ySnapped)&&l&&f&&(u=dr(G.sourceEvent,d),j(B))}}).on("end",G=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:H,updateNodePositions:I,onNodeDragStop:L,onSelectionDragStop:C}=t();if(m&&(I(l,!1),m=!1),r||L||!E&&C){const[D,U]=$g({nodeId:E,dragItems:l,nodeLookup:H,dragging:!1});r==null||r(G.sourceEvent,l,D,U),L==null||L(G.sourceEvent,D,U),E||C==null||C(G.sourceEvent,U)}}}).filter(G=>{const H=G.target;return!G.button&&(!y||!mN(H,`.${y}`,S))&&(!x||mN(H,x,S))});h.call(F)}function g(){h==null||h.on(".drag",null)}return{update:w,destroy:g}}function n$(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Ip(r,gd(i))>0&&s.push(i);return s}const s$=250;function r$(e,t,n,s){var l,c;let r=[],i=1/0;const a=n$(e,n,t+s$);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(s.nodeId===f.nodeId&&s.type===f.type&&s.id===f.id)continue;const{x:h,y:p}=Fl(u,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m<i?(r=[{...f,x:h,y:p}],i=m):m===i&&r.push({...f,x:h,y:p}))}}if(!r.length)return null;if(r.length>1){const u=s.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function h5(e,t,n,s,r,i=!1){var u,d,f;const a=s.get(e);if(!a)return null;const l=r==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...Fl(a,c,c.position,!0)}:c}function p5(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function i$(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const m5=()=>!0;function a$(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:k,onConnectEnd:w,isValidConnection:g=m5,onReconnectEnd:y,updateConnection:x,getTransform:S,getFromHandle:A,autoPanSpeed:E,dragThreshold:M=1,handleDomNode:j}){const O=n5(e.target);let N=0,F;const{x:G,y:H}=dr(e),I=p5(i,j),L=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!L||!I)return;const D=h5(r,I,s,c,t);if(!D)return;let U=dr(e,L),B=!1,R=null,_=!1,K=null;function T(){if(!d||!L)return;const[ee,oe]=ak(U,L,E);h({x:ee,y:oe}),N=requestAnimationFrame(T)}const X={...D,nodeId:r,type:I,position:D.position},ne=c.get(r);let pe={inProgress:!0,isValid:null,from:Fl(ne,X,Xe.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:ne,to:U,toHandle:null,toPosition:sN[X.position],toNode:null,pointer:U};function q(){C=!0,x(pe),m==null||m(e,{nodeId:r,handleId:s,handleType:I})}M===0&&q();function Y(ee){if(!C){const{x:Te,y:xe}=dr(ee),ve=Te-G,ge=xe-H;if(!(ve*ve+ge*ge>M*M))return;q()}if(!A()||!X){V(ee);return}const oe=S();U=dr(ee,L),F=r$(sf(U,oe,!1,[1,1]),n,c,X),B||(T(),B=!0);const ye=g5(ee,{handle:F,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:a?"target":"source",isValidConnection:g,doc:O,lib:u,flowId:f,nodeLookup:c});K=ye.handleDomNode,R=ye.connection,_=i$(!!F,ye.isValid);const Re=c.get(r),se=Re?Fl(Re,X,Xe.Left,!0):pe.from,Q={...pe,from:se,isValid:_,to:ye.toHandle&&_?bc({x:ye.toHandle.x,y:ye.toHandle.y},oe):U,toHandle:ye.toHandle,toPosition:_&&ye.toHandle?ye.toHandle.position:sN[X.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:U};x(Q),pe=Q}function V(ee){if(!("touches"in ee&&ee.touches.length>0)){if(C){(F||K)&&R&&_&&(k==null||k(R));const{inProgress:oe,...ye}=pe,Re={...ye,toPosition:pe.toHandle?pe.toPosition:null};w==null||w(ee,Re),i&&(y==null||y(ee,Re))}p(),cancelAnimationFrame(N),B=!1,_=!1,R=null,K=null,O.removeEventListener("mousemove",Y),O.removeEventListener("mouseup",V),O.removeEventListener("touchmove",Y),O.removeEventListener("touchend",V)}}O.addEventListener("mousemove",Y),O.addEventListener("mouseup",V),O.addEventListener("touchmove",Y),O.addEventListener("touchend",V)}function g5(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:a,lib:l,flowId:c,isValidConnection:u=m5,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=dr(e),k=a.elementFromPoint(p,m),w=k!=null&&k.classList.contains(`${l}-flow__handle`)?k:h,g={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const y=p5(void 0,w),x=w.getAttribute("data-nodeid"),S=w.getAttribute("data-handleid"),A=w.classList.contains("connectable"),E=w.classList.contains("connectableend");if(!x||!y)return g;const M={source:f?x:s,sourceHandle:f?S:r,target:f?s:x,targetHandle:f?r:S};g.connection=M;const O=A&&E&&(n===pc.Strict?f&&y==="source"||!f&&y==="target":x!==s||S!==r);g.isValid=O&&u(M),g.toHandle=h5(x,y,S,d,n,!0)}return g}const Hx={onPointerDown:a$,isValid:g5};function l$({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=Cs(e);function i({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const S=n(),A=x.sourceEvent.ctrlKey&&bd()?10:1,E=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,M=S[2]*Math.pow(2,E*A);t.scaleTo(M)};let k=[0,0];const w=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},g=x=>{const S=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const A=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],E=[A[0]-k[0],A[1]-k[1]];k=A;const M=s()*Math.max(S[2],Math.log(S[2]))*(p?-1:1),j={x:S[0]-E[0]*M,y:S[1]-E[1]*M},O=[[0,0],[c,u]];t.setViewportConstrained({x:j.x,y:j.y,zoom:S[2]},O,l)},y=$j().on("start",w).on("zoom",f?g:null).on("zoom.wheel",h?m:null);r.call(y,{})}function a(){r.on("zoom",null)}return{update:i,destroy:a,pointer:ar}}const Cm=e=>({x:e.x,y:e.y,zoom:e.k}),Gg=({x:e,y:t,zoom:n})=>Nm.translate(e,t).scale(n),Ji=(e,t)=>e.target.closest(`.${t}`),b5=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),o$=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Kg=(e,t=0,n=o$,s=()=>{})=>{const r=typeof t=="number"&&t>0;return r||s(),r?e.transition().duration(t).ease(n).on("end",s):e},x5=e=>{const t=e.ctrlKey&&bd()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function c$({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Ji(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=ar(d),g=x5(d),y=f*Math.pow(2,g);s.scaleTo(n,y,w,d);return}const h=d.deltaMode===1?20:1;let p=r===wl.Vertical?0:d.deltaX*h,m=r===wl.Horizontal?0:d.deltaY*h;!bd()&&d.shiftKey&&r!==wl.Vertical&&(p=d.deltaY*h,m=0),s.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const k=Cm(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c==null||c(d,k):(e.isPanScrolling=!0,l==null||l(d,k)),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,k),e.isPanScrolling=!1},150)}}function u$({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){const i=s.type==="wheel",a=!t&&i&&!s.ctrlKey,l=Ji(s,e);if(s.ctrlKey&&i&&l&&s.preventDefault(),a||l)return null;s.preventDefault(),n.call(this,s,r)}}function d$({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,a,l;if((i=s.sourceEvent)!=null&&i.internal)return;const r=Cm(s.transform);e.mouseButton=((a=s.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=s.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,r))}}function f$({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var a,l;e.usedRightMouseButton=!!(n&&b5(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!((l=i.sourceEvent)!=null&&l.internal)&&(r==null||r(i.sourceEvent,Cm(i.transform)))}}function h$({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&b5(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,s(!1),r)){const c=Cm(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,c)},n?150:0)}}}function p$({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:u,lib:d,connectionInProgress:f}){return h=>{var g;const p=t||n,m=s&&h.ctrlKey,k=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Ji(h,`${d}-flow__node`)||Ji(h,`${d}-flow__edge`)||Ji(h,`${d}-flow__selection`)||Ji(h,`${d}-flow__nodesselection`)))return!0;if(!r&&!p&&!i&&!a&&!s||l||f&&!k||Ji(h,c)&&k||Ji(h,u)&&(!k||i&&k&&!t)||!s&&h.ctrlKey&&k)return!1;if(!s&&h.type==="touchstart"&&((g=h.touches)==null?void 0:g.length)>1)return h.preventDefault(),!1;if(!p&&!i&&!m&&k||!r&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(r)&&!r.includes(h.button)&&h.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||k||e)&&w}}function m$({domNode:e,minZoom:t,maxZoom:n,translateExtent:s,viewport:r,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect();let f=[[0,0],[d.width,d.height]];const h=typeof ResizeObserver<"u"?new ResizeObserver(H=>{const I=H[0];I&&(f=[[0,0],[I.contentRect.width,I.contentRect.height]])}):null;h==null||h.observe(e);const p=$j().extent(()=>f).scaleExtent([t,n]).translateExtent(s),m=Cs(e).call(p);S({x:r.x,y:r.y,zoom:gc(r.zoom,t,n)},[[0,0],[d.width,d.height]],s);const k=m.on("wheel.zoom"),w=m.on("dblclick.zoom");p.wheelDelta(x5);async function g(H,I){return m?new Promise(L=>{p==null||p.interpolate((I==null?void 0:I.interpolate)==="linear"?Ru:zh).transform(Kg(m,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>L(!0)),H)}):!1}function y({noWheelClassName:H,noPanClassName:I,onPaneContextMenu:L,userSelectionActive:C,panOnScroll:D,panOnDrag:U,panOnScrollMode:B,panOnScrollSpeed:R,preventScrolling:_,zoomOnPinch:K,zoomOnScroll:T,zoomOnDoubleClick:X,panActivationKeyPressed:ne=!1,zoomActivationKeyPressed:J,lib:pe,onTransformChange:q,connectionInProgress:Y,paneClickDistance:V,selectionOnDrag:ee}){C&&!u.isZoomingOrPanning&&x();const oe=D&&!J&&!C;p.clickDistance(ee?1/0:!ur(V)||V<0?0:V);const ye=oe?c$({zoomPanValues:u,noWheelClassName:H,d3Selection:m,d3Zoom:p,panOnScrollMode:B,panOnScrollSpeed:R,zoomOnPinch:K,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):u$({noWheelClassName:H,preventScrolling:_,d3ZoomHandler:k});m.on("wheel.zoom",ye,{passive:!1});const Re=d$({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});p.on("start",Re);const se=f$({zoomPanValues:u,panOnDrag:U,onPaneContextMenu:!!L,onPanZoom:i,onTransformChange:q});p.on("zoom",se);const Q=h$({zoomPanValues:u,panOnDrag:U,panOnScroll:D,onPaneContextMenu:L,onPanZoomEnd:l,onDraggingChange:c});p.on("end",Q);const Te=p$({panActivationKeyPressed:ne,zoomActivationKeyPressed:J,panOnDrag:U,zoomOnScroll:T,panOnScroll:D,zoomOnDoubleClick:X,zoomOnPinch:K,userSelectionActive:C,noPanClassName:I,noWheelClassName:H,lib:pe,connectionInProgress:Y});p.filter(Te),X?m.on("dblclick.zoom",w):m.on("dblclick.zoom",null)}function x(){p.on("zoom",null)}async function S(H,I,L){const C=Gg(H),D=p==null?void 0:p.constrain()(C,I,L);return D&&await g(D),D}async function A(H,I){const L=Gg(H);return await g(L,I),L}function E(H){if(m){const I=Gg(H),L=m.property("__zoom");(L.k!==H.zoom||L.x!==H.x||L.y!==H.y)&&(p==null||p.transform(m,I,null,{sync:!0}))}}function M(){const H=m?Hj(m.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function j(H,I){return m?new Promise(L=>{p==null||p.interpolate((I==null?void 0:I.interpolate)==="linear"?Ru:zh).scaleTo(Kg(m,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>L(!0)),H)}):!1}async function O(H,I){return m?new Promise(L=>{p==null||p.interpolate((I==null?void 0:I.interpolate)==="linear"?Ru:zh).scaleBy(Kg(m,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>L(!0)),H)}):!1}function N(H){p==null||p.scaleExtent(H)}function F(H){p==null||p.translateExtent(H)}function G(H){const I=!ur(H)||H<0?0:H;p==null||p.clickDistance(I)}return{update:y,destroy:x,setViewport:A,setViewportConstrained:S,getViewport:M,scaleTo:j,scaleBy:O,setScaleExtent:N,setTranslateExtent:F,syncViewport:E,setClickDistance:G}}var xc;(function(e){e.Line="line",e.Handle="handle"})(xc||(xc={}));function g$({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const a=e-t,l=n-s,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&r&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function gN(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function Bi(e,t){return Math.max(0,t-e)}function Hi(e,t){return Math.max(0,e-t)}function Yf(e,t,n){return Math.max(0,t-e,e-n)}function bN(e,t){return e?!t:t}function b$(e,t,n,s,r,i,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:k,maxWidth:w,minHeight:g,maxHeight:y}=s,{x,y:S,width:A,height:E,aspectRatio:M}=e;let j=Math.floor(d?p-e.pointerX:0),O=Math.floor(f?m-e.pointerY:0);const N=A+(c?-j:j),F=E+(u?-O:O),G=-i[0]*A,H=-i[1]*E;let I=Yf(N,k,w),L=Yf(F,g,y);if(a){let U=0,B=0;c&&j<0?U=Bi(x+j+G,a[0][0]):!c&&j>0&&(U=Hi(x+N+G,a[1][0])),u&&O<0?B=Bi(S+O+H,a[0][1]):!u&&O>0&&(B=Hi(S+F+H,a[1][1])),I=Math.max(I,U),L=Math.max(L,B)}if(l){let U=0,B=0;c&&j>0?U=Hi(x+j,l[0][0]):!c&&j<0&&(U=Bi(x+N,l[1][0])),u&&O>0?B=Hi(S+O,l[0][1]):!u&&O<0&&(B=Bi(S+F,l[1][1])),I=Math.max(I,U),L=Math.max(L,B)}if(r){if(d){const U=Yf(N/M,g,y)*M;if(I=Math.max(I,U),a){let B=0;!c&&!u||c&&!u&&h?B=Hi(S+H+N/M,a[1][1])*M:B=Bi(S+H+(c?j:-j)/M,a[0][1])*M,I=Math.max(I,B)}if(l){let B=0;!c&&!u||c&&!u&&h?B=Bi(S+N/M,l[1][1])*M:B=Hi(S+(c?j:-j)/M,l[0][1])*M,I=Math.max(I,B)}}if(f){const U=Yf(F*M,k,w)/M;if(L=Math.max(L,U),a){let B=0;!c&&!u||u&&!c&&h?B=Hi(x+F*M+G,a[1][0])/M:B=Bi(x+(u?O:-O)*M+G,a[0][0])/M,L=Math.max(L,B)}if(l){let B=0;!c&&!u||u&&!c&&h?B=Bi(x+F*M,l[1][0])/M:B=Hi(x+(u?O:-O)*M,l[0][0])/M,L=Math.max(L,B)}}}O=O+(O<0?L:-L),j=j+(j<0?I:-I),r&&(h?N>F*M?O=(bN(c,u)?-j:j)/M:j=(bN(c,u)?-O:O)*M:d?(O=j/M,u=c):(j=O*M,c=u));const C=c?x+j:x,D=u?S+O:S;return{width:A+(c?-j:j),height:E+(u?-O:O),x:i[0]*j*(c?-1:1)+C,y:i[1]*O*(u?-1:1)+D}}const y5={width:0,height:0,x:0,y:0},x$={...y5,pointerX:0,pointerY:0,aspectRatio:1};function y$(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,l=n[0]*i,c=n[1]*a;return[[s-l,r-c],[s+i-l,r+a-c]]}function v$({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=Cs(e);let a={controlDirection:gN("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:k,shouldResize:w}){let g={...y5},y={...x$};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:gN(u)};let x,S=null,A=[],E,M,j;const O=Tj().on("start",N=>{const{nodeLookup:F,transform:G,snapGrid:H,snapToGrid:I,nodeOrigin:L,paneDomNode:C}=n();if(x=F.get(t),!x)return;S=(C==null?void 0:C.getBoundingClientRect())??null;const{xSnapped:D,ySnapped:U}=Ou(N.sourceEvent,{transform:G,snapGrid:H,snapToGrid:I,containerBounds:S});g={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},y={...g,pointerX:D,pointerY:U,aspectRatio:g.width/g.height},E=void 0,M=Ul(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(E=F.get(x.parentId)),E&&x.extent==="parent"&&(M=[[0,0],[E.measured.width,E.measured.height]]),A=[],j=void 0;for(const[B,R]of F)if(R.parentId===t&&(A.push({id:B,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const _=y$(R,x,R.origin??L);j?j=[[Math.min(_[0][0],j[0][0]),Math.min(_[0][1],j[0][1])],[Math.max(_[1][0],j[1][0]),Math.max(_[1][1],j[1][1])]]:j=_}p==null||p(N,{...g})}).on("drag",N=>{const{transform:F,snapGrid:G,snapToGrid:H,nodeOrigin:I}=n(),L=Ou(N.sourceEvent,{transform:F,snapGrid:G,snapToGrid:H,containerBounds:S}),C=[];if(!x)return;const{x:D,y:U,width:B,height:R}=g,_={},K=x.origin??I,{width:T,height:X,x:ne,y:J}=b$(y,a.controlDirection,L,a.boundaries,a.keepAspectRatio,K,M,j),pe=T!==B,q=X!==R,Y=ne!==D&&pe,V=J!==U&&q;if(!Y&&!V&&!pe&&!q)return;const ee={prevValues:{...g},startX:y.x,startY:y.y,childNodes:A.map(se=>({...se,position:{...se.position}}))};if((Y||V||K[0]===1||K[1]===1)&&(_.x=Y?ne:g.x,_.y=V?J:g.y,g.x=_.x,g.y=_.y,A.length>0)){const se=ne-D,Q=J-U;for(const Te of A)Te.position={x:Te.position.x-se+K[0]*(T-B),y:Te.position.y-Q+K[1]*(X-R)},C.push(Te)}if((pe||q)&&(_.width=pe&&(!a.resizeDirection||a.resizeDirection==="horizontal")?T:g.width,_.height=q&&(!a.resizeDirection||a.resizeDirection==="vertical")?X:g.height,g.width=_.width,g.height=_.height),E&&x.expandParent){const se=K[0]*(_.width??0);_.x&&_.x<se&&(g.x=se,y.x=y.x-(_.x-se));const Q=K[1]*(_.height??0);_.y&&_.y<Q&&(g.y=Q,y.y=y.y-(_.y-Q))}const oe=g$({width:g.width,prevWidth:B,height:g.height,prevHeight:R,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),ye={...g,direction:oe};if((w==null?void 0:w(N,ye))===!1){g=ee.prevValues,y.x=ee.startX,y.y=ee.startY,A.forEach((se,Q)=>{se.position=ee.childNodes[Q].position});return}m==null||m(N,ye),s(_,C)}).on("end",N=>{k==null||k(N,{...g}),r==null||r({...g})});i.call(O)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var v5={exports:{}},k5={},w5={exports:{}},S5={};/**
490
+ * @license React
491
+ * use-sync-external-store-shim.production.min.js
492
+ *
493
+ * Copyright (c) Facebook, Inc. and its affiliates.
494
+ *
495
+ * This source code is licensed under the MIT license found in the
496
+ * LICENSE file in the root directory of this source tree.
497
+ */var yc=b;function k$(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var w$=typeof Object.is=="function"?Object.is:k$,S$=yc.useState,N$=yc.useEffect,E$=yc.useLayoutEffect,_$=yc.useDebugValue;function C$(e,t){var n=t(),s=S$({inst:{value:n,getSnapshot:t}}),r=s[0].inst,i=s[1];return E$(function(){r.value=n,r.getSnapshot=t,qg(r)&&i({inst:r})},[e,n,t]),N$(function(){return qg(r)&&i({inst:r}),e(function(){qg(r)&&i({inst:r})})},[e]),_$(n),n}function qg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!w$(e,n)}catch{return!0}}function T$(e,t){return t()}var A$=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?T$:C$;S5.useSyncExternalStore=yc.useSyncExternalStore!==void 0?yc.useSyncExternalStore:A$;w5.exports=S5;var M$=w5.exports;/**
498
+ * @license React
499
+ * use-sync-external-store-shim/with-selector.production.min.js
500
+ *
501
+ * Copyright (c) Facebook, Inc. and its affiliates.
502
+ *
503
+ * This source code is licensed under the MIT license found in the
504
+ * LICENSE file in the root directory of this source tree.
505
+ */var Tm=b,j$=M$;function R$(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var O$=typeof Object.is=="function"?Object.is:R$,D$=j$.useSyncExternalStore,I$=Tm.useRef,L$=Tm.useEffect,P$=Tm.useMemo,z$=Tm.useDebugValue;k5.useSyncExternalStoreWithSelector=function(e,t,n,s,r){var i=I$(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=P$(function(){function c(p){if(!u){if(u=!0,d=p,p=s(p),r!==void 0&&a.hasValue){var m=a.value;if(r(m,p))return f=m}return f=p}if(m=f,O$(d,p))return m;var k=s(p);return r!==void 0&&r(m,k)?m:(d=p,f=k)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,s,r]);var l=D$(e,i[0],i[1]);return L$(function(){a.hasValue=!0,a.value=l},[l]),z$(l),l};v5.exports=k5;var U$=v5.exports;const F$=Cd(U$),B$={},xN=e=>{let t;const n=new Set,s=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const f=t;t=u??typeof d!="object"?d:Object.assign({},t,d),n.forEach(h=>h(t,f))}},r=()=>t,l={setState:s,getState:r,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(B$?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(s,r,l),l},H$=e=>e?xN(e):xN,{useSyncExternalStoreWithSelector:$$}=F$;function N5(e,t=e.getState,n){const s=$$(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return b.useDebugValue(s),s}const yN=(e,t)=>{const n=H$(e),s=(r,i=t)=>N5(n,r,i);return Object.assign(s,n),s},G$=(e,t)=>e?yN(e,t):yN;function rn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Object.is(e[n[s]],t[n[s]]))return!1;return!0}const Am=b.createContext(null),K$=Am.Provider,E5=gr.error001("react");function wt(e,t){const n=b.useContext(Am);if(n===null)throw new Error(E5);return N5(n,e,t)}function Qt(){const e=b.useContext(Am);if(e===null)throw new Error(E5);return b.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const vN={display:"none"},q$={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_5="react-flow__node-desc",C5="react-flow__edge-desc",Y$="react-flow__aria-live",V$=e=>e.ariaLiveMessage,X$=e=>e.ariaLabelConfig;function Q$({rfId:e}){const t=wt(V$);return o.jsx("div",{id:`${Y$}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:q$,children:t})}function W$({rfId:e,disableKeyboardA11y:t}){const n=wt(X$);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${_5}-${e}`,style:vN,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${C5}-${e}`,style:vN,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(Q$,{rfId:e})]})}const rf=b.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const a=`${e}`.split("-");return o.jsx("div",{className:xn(["react-flow__panel",n,...a]),style:s,ref:i,...r,children:t})});rf.displayName="Panel";const kN="https://reactflow.dev?utm_source=attribution";function Z$({proOptions:e,position:t="bottom-right"}){return b.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:o.jsx(rf,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kN}`,children:o.jsx("a",{href:kN,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const J$=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},Vf=e=>e.id;function e7(e,t){return rn(e.selectedNodes.map(Vf),t.selectedNodes.map(Vf))&&rn(e.selectedEdges.map(Vf),t.selectedEdges.map(Vf))}function t7({onSelectionChange:e}){const t=Qt(),{selectedNodes:n,selectedEdges:s}=wt(J$,e7);return b.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const n7=e=>!!e.onSelectionChangeHandlers;function s7({onSelectionChange:e}){const t=wt(n7);return e||t?o.jsx(t7,{onSelectionChange:e}):null}const T5=[0,0],r7={x:0,y:0,zoom:1},i7=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],wN=[...i7,"rfId"],a7=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),SN={translateExtent:pd,nodeOrigin:T5,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function l7(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=wt(a7,rn),u=Qt();b.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=SN,l()}),[]);const d=b.useRef(SN);return b.useEffect(()=>{for(const f of wN){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?s(h):f==="maxZoom"?r(h):f==="translateExtent"?i(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:OH(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},wN.map(f=>e[f])),null}function NN(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function o7(e){var s;const[t,n]=b.useState(e==="system"?null:e);return b.useEffect(()=>{if(e!=="system"){n(e);return}const r=NN(),i=()=>n(r!=null&&r.matches?"dark":"light");return i(),r==null||r.addEventListener("change",i),()=>{r==null||r.removeEventListener("change",i)}},[e]),t!==null?t:(s=NN())!=null&&s.matches?"dark":"light"}const EN=typeof document<"u"?document:null;function xd(e=null,t={target:EN,actInsideInputWithModifier:!0}){const[n,s]=b.useState(!1),r=b.useRef(!1),i=b.useRef(new Set([])),[a,l]=b.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace(/\+/g,`
506
+ `).replace(`
507
+
508
+ `,`
509
+ +`).split(`
510
+ `)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return b.useEffect(()=>{const c=(t==null?void 0:t.target)??EN,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,g;if(r.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!r.current||r.current&&!u)&&s5(p))return!1;const k=CN(p.code,l);if(i.current.add(p[k]),_N(a,i.current,!1)){const y=((g=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:g[0])||p.target,x=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(r.current||!x)&&p.preventDefault(),s(!0)}},f=p=>{const m=CN(p.code,l);_N(a,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(p[m]),p.key==="Meta"&&i.current.clear(),r.current=!1},h=()=>{i.current.clear(),s(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,s]),n}function _N(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function CN(e,t){return t.includes(e)?"code":"key"}const c7=()=>{const e=Qt();return b.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:a,panZoom:l}=e.getState(),c=lk(t,s,r,i,a,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??i;return sf(u,s,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),a=bc(t,n);return{x:a.x+r,y:a.y+i}}}),[])};function A5(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const a=s.get(i.id);a?a.push(i):s.set(i.id,[i])}for(const i of t){const a=s.get(i.id);if(!a){n.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...i};for(const c of a)u7(c,l);n.push(l)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function u7(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function M5(e,t){return A5(e,t)}function d7(e,t){return A5(e,t)}function Ja(e,t){return{id:e,type:"select",selected:t}}function wo(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const a=t.has(r);!(i.selected===void 0&&!a)&&i.selected!==a&&(n&&(i.selected=a),s.push(Ja(i.id,a)))}return s}function TN({items:e=[],lookup:t}){var r;const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const l=t.get(a.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===void 0&&n.push({item:a,type:"add",index:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function AN(e){return{id:e.id,type:"remove"}}const f7=Zj();function h7(e,t,n={}){return UH(e,t,{...n,onError:n.onError??f7})}const MN=e=>NH(e),p7=e=>Yj(e);function j5(e){return b.forwardRef(e)}const R5=typeof window<"u"?b.useLayoutEffect:b.useEffect;function jN(e){const[t,n]=b.useState(BigInt(0)),[s]=b.useState(()=>m7(()=>n(r=>r+BigInt(1))));return R5(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function m7(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const O5=b.createContext(null);function g7({children:e}){const t=Qt(),n=b.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let k=c;for(const g of l)k=typeof g=="function"?g(k):g;let w=TN({items:k,lookup:h});for(const g of m.values())w=g(w);d&&u(k),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:y,setNodes:x}=t.getState();g&&x(y)})},[]),s=jN(n),r=b.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(TN({items:p,lookup:h}))},[]),i=jN(r),a=b.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsx(O5.Provider,{value:a,children:e})}function b7(){const e=b.useContext(O5);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const x7=e=>!!e.panZoom;function pk(){const e=c7(),t=Qt(),n=b7(),s=wt(x7),r=b.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var g,y;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=MN(f)?f:h.get(f.id),k=m.parentId?e5(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:k,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((y=m.measured)==null?void 0:y.height)??m.height};return gd(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(k=>{if(k.id===f){const w=typeof h=="function"?h(k):h;return p.replace&&MN(w)?w:{...k,...w}}return k}))},d=(f,h,p={replace:!1})=>{l(m=>m.map(k=>{if(k.id===f){const w=typeof h=="function"?h(k):h;return p.replace&&p7(w)?w:{...k,...w}}return k}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=i(f))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:p}=t.getState(),[m,k,w]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y:k,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:k,onEdgesDelete:w,triggerNodeChanges:g,triggerEdgeChanges:y,onDelete:x,onBeforeDelete:S}=t.getState(),{nodes:A,edges:E}=await AH({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:S}),M=E.length>0,j=A.length>0;if(M){const O=E.map(AN);w==null||w(E),y(O)}if(j){const O=A.map(AN);k==null||k(A),g(O)}return(j||M)&&(x==null||x({nodes:A,edges:E})),{deletedNodes:A,deletedEdges:E}},getIntersectingNodes:(f,h=!0,p)=>{const m=iN(f),k=m?f:c(f),w=p!==void 0;return k?(p||t.getState().nodes).filter(g=>{const y=t.getState().nodeLookup.get(g.id);if(y&&!m&&(g.id===f.id||!y.internals.positionAbsolute))return!1;const x=gd(w?g:y),S=Ip(x,k);return h&&S>0||S>=x.width*x.height||S>=k.width*k.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const k=iN(f)?f:c(f);if(!k)return!1;const w=Ip(k,h);return p&&w>0||w>=h.width*h.height||w>=k.width*k.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const k=typeof h=="function"?h(m):h;return p.replace?{...m,data:k}:{...m,data:{...m.data,...k}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const k=typeof h=="function"?h(m):h;return p.replace?{...m,data:k}:{...m,data:{...m.data,...k}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return EH(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:m.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??RH();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return b.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const RN=e=>e.selected,y7=typeof window<"u"?window:void 0;function v7({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Qt(),{deleteElements:s}=pk(),r=xd(e,{actInsideInputWithModifier:!1}),i=xd(t,{target:y7});b.useEffect(()=>{if(r){const{edges:a,nodes:l}=n.getState();s({nodes:l.filter(RN),edges:a.filter(RN)}),n.setState({nodesSelectionActive:!1})}},[r]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function k7(e){const t=Qt();b.useEffect(()=>{const n=()=>{var r,i,a,l;if(!e.current||!(((i=(r=e.current).checkVisibility)==null?void 0:i.call(r))??!0))return!1;const s=ok(e.current);(s.height===0||s.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",gr.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Mm={position:"absolute",width:"100%",height:"100%",top:0,left:0},w7=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function S7({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panActivationKeyPressed:r,panOnScrollSpeed:i=.5,panOnScrollMode:a=wl.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:d,minZoom:f,maxZoom:h,zoomActivationKeyCode:p,preventScrolling:m=!0,children:k,noWheelClassName:w,noPanClassName:g,onViewportChange:y,isControlledViewport:x,paneClickDistance:S,selectionOnDrag:A}){const E=Qt(),M=b.useRef(null),{userSelectionActive:j,lib:O,connectionInProgress:N}=wt(w7,rn),F=xd(p),G=b.useRef();k7(M);const H=b.useCallback(I=>{y==null||y({x:I[0],y:I[1],zoom:I[2]}),x||E.setState({transform:I})},[y,x]);return b.useEffect(()=>{if(M.current){G.current=m$({domNode:M.current,minZoom:f,maxZoom:h,translateExtent:d,viewport:u,onDraggingChange:D=>E.setState(U=>U.paneDragging===D?U:{paneDragging:D}),onPanZoomStart:(D,U)=>{const{onViewportChangeStart:B,onMoveStart:R}=E.getState();R==null||R(D,U),B==null||B(U)},onPanZoom:(D,U)=>{const{onViewportChange:B,onMove:R}=E.getState();R==null||R(D,U),B==null||B(U)},onPanZoomEnd:(D,U)=>{const{onViewportChangeEnd:B,onMoveEnd:R}=E.getState();R==null||R(D,U),B==null||B(U)}});const{x:I,y:L,zoom:C}=G.current.getViewport();return E.setState({panZoom:G.current,transform:[I,L,C],domNode:M.current.closest(".react-flow")}),()=>{var D;(D=G.current)==null||D.destroy()}}},[]),b.useEffect(()=>{var I;(I=G.current)==null||I.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panActivationKeyPressed:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:F,preventScrolling:m,noPanClassName:g,userSelectionActive:j,noWheelClassName:w,lib:O,onTransformChange:H,connectionInProgress:N,selectionOnDrag:A,paneClickDistance:S})},[e,t,n,s,r,i,a,l,c,F,m,g,j,w,O,H,N,A,S]),o.jsx("div",{className:"react-flow__renderer",ref:M,style:Mm,children:k})}const N7=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function E7(){const{userSelectionActive:e,userSelectionRect:t}=wt(N7,rn);return e&&t?o.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Yg=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},_7=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function C7({isSelecting:e,selectionKeyPressed:t,selectionMode:n=md.Full,panOnDrag:s,autoPanOnSelection:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:k}){const w=b.useRef(0),g=Qt(),{userSelectionActive:y,elementsSelectable:x,dragging:S,panBy:A,autoPanSpeed:E}=wt(_7,rn),M=x&&(e||y),j=b.useRef(null),O=b.useRef(),N=b.useRef(new Set),F=b.useRef(new Set),G=b.useRef(!1),H=b.useRef(!1),I=b.useRef({x:0,y:0}),L=b.useRef(!1),C=q=>{if(H.current||G.current||g.getState().connection.inProgress){H.current=!1,G.current=!1;return}u==null||u(q),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},D=q=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){q.preventDefault();return}d==null||d(q)},U=f?q=>f(q):void 0,B=q=>{H.current&&(q.stopPropagation(),H.current=!1)},R=q=>{var Te,xe;if(q.pointerType==="touch"&&s!==!1&&!t)return;const{domNode:Y,transform:V}=g.getState();if(O.current=Y==null?void 0:Y.getBoundingClientRect(),!O.current)return;const ee=q.target===j.current;if(!ee&&!!q.target.closest(".nokey")||!e||!(a&&ee||t)||q.button!==0||!q.isPrimary)return;(xe=(Te=q.target)==null?void 0:Te.setPointerCapture)==null||xe.call(Te,q.pointerId),H.current=!1;const{x:Re,y:se}=dr(q.nativeEvent,O.current),Q=sf({x:Re,y:se},V);g.setState({userSelectionRect:{width:0,height:0,startX:Q.x,startY:Q.y,x:Re,y:se}}),ee||(q.stopPropagation(),q.preventDefault())};function _(q,Y){const{userSelectionRect:V}=g.getState();if(!V)return;const{transform:ee,nodeLookup:oe,edgeLookup:ye,connectionLookup:Re,triggerNodeChanges:se,triggerEdgeChanges:Q,defaultEdgeOptions:Te}=g.getState(),xe={x:V.startX,y:V.startY},{x:ve,y:ge}=bc(xe,ee),$e={startX:xe.x,startY:xe.y,x:q<ve?q:ve,y:Y<ge?Y:ge,width:Math.abs(q-ve),height:Math.abs(Y-ge)},dt=N.current,mt=F.current;N.current=new Set(ik(oe,$e,ee,n===md.Partial,!0).map(ct=>ct.id)),F.current=new Set;const rt=(Te==null?void 0:Te.selectable)??!0;for(const ct of N.current){const te=Re.get(ct);if(te)for(const{edgeId:re}of te.values()){const Ae=ye.get(re);Ae&&(Ae.selectable??rt)&&F.current.add(re)}}if(!aN(dt,N.current)){const ct=wo(oe,N.current,!0);se(ct)}if(!aN(mt,F.current)){const ct=wo(ye,F.current);Q(ct)}g.setState({userSelectionRect:$e,userSelectionActive:!0,nodesSelectionActive:!1})}function K(){if(!r||!O.current)return;const[q,Y]=ak(I.current,O.current,E);A({x:q,y:Y}).then(V=>{if(!H.current||!V){w.current=requestAnimationFrame(K);return}const{x:ee,y:oe}=I.current;_(ee,oe),w.current=requestAnimationFrame(K)})}const T=()=>{cancelAnimationFrame(w.current),w.current=0,L.current=!1};b.useEffect(()=>()=>T(),[]);const X=q=>{const{userSelectionRect:Y,transform:V,resetSelectedElements:ee}=g.getState();if(!O.current||!Y)return;const{x:oe,y:ye}=dr(q.nativeEvent,O.current);I.current={x:oe,y:ye};const Re=bc({x:Y.startX,y:Y.startY},V);if(!H.current){const se=t?0:i;if(Math.hypot(oe-Re.x,ye-Re.y)<=se)return;ee(),l==null||l(q)}H.current=!0,L.current||(K(),L.current=!0),_(oe,ye)},ne=q=>{var Y,V;if(!M){q.target===j.current&&g.getState().connection.inProgress&&(G.current=!0);return}q.button===0&&((V=(Y=q.target)==null?void 0:Y.releasePointerCapture)==null||V.call(Y,q.pointerId),!y&&q.target===j.current&&g.getState().userSelectionRect&&(C==null||C(q)),g.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(c==null||c(q),g.setState({nodesSelectionActive:N.current.size>0})),T())},J=q=>{var Y,V;(V=(Y=q.target)==null?void 0:Y.releasePointerCapture)==null||V.call(Y,q.pointerId),T()},pe=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxs("div",{className:xn(["react-flow__pane",{draggable:pe,dragging:S,selection:e}]),onClick:M?void 0:Yg(C,j),onContextMenu:Yg(D,j),onWheel:Yg(U,j),onPointerEnter:M?void 0:h,onPointerMove:M?X:p,onPointerUp:ne,onPointerCancel:M?J:void 0,onPointerDownCapture:M?R:void 0,onClickCapture:M?B:void 0,onPointerLeave:m,ref:j,style:Mm,children:[k,o.jsx(E7,{})]})}function $x({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",gr.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):r([e])}function D5({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:a}){const l=Qt(),[c,u]=b.useState(!1),d=b.useRef();return b.useEffect(()=>{if(!t)return d.current=t$({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{$x({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var f;(f=d.current)==null||f.destroy(),d.current=void 0}},[t,l,e]),b.useEffect(()=>{t||!e.current||!d.current||d.current.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:a})},[n,s,t,i,e,r,a]),c}const T7=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function I5(){const e=Qt();return b.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=T7(a),p=r?i[0]:5,m=r?i[1]:5,k=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,g]of u){if(!h(g))continue;let y={x:g.internals.positionAbsolute.x+k,y:g.internals.positionAbsolute.y+w};r&&(y=nf(y,i));const{position:x,positionAbsolute:S}=Vj({nodeId:g.id,nextPosition:y,nodeLookup:u,nodeExtent:s,nodeOrigin:d,onError:l});g.position=x,g.internals.positionAbsolute=S,f.set(g.id,g)}c(f)},[])}const mk=b.createContext(null),A7=mk.Provider;mk.Consumer;const L5=()=>b.useContext(mk),M7=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),P5=b.createContext(null);function j7({children:e}){const t=wt(M7,rn);return o.jsx(P5.Provider,{value:t,children:e})}function R7(){const e=b.useContext(P5);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const O7={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},D7=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:a}=s,{fromHandle:l,toHandle:c,isValid:u}=a;if(!l&&!r)return O7;const d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===pc.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function I7({type:e="source",position:t=Xe.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var L,C;const m=a||null,k=e==="target",w=Qt(),g=L5(),{connectOnClick:y,noPanClassName:x,rfId:S}=R7(),{connectingFrom:A,connectingTo:E,clickConnecting:M,isPossibleEndHandle:j,connectionInProcess:O,clickConnectionInProcess:N,valid:F}=wt(D7(g,m,e),rn);g||(C=(L=w.getState()).onError)==null||C.call(L,"010",gr.error010());const G=D=>{const{defaultEdgeOptions:U,onConnect:B,hasDefaultEdges:R}=w.getState(),_={...U,...D};if(R){const{edges:K,setEdges:T,onError:X}=w.getState();T(h7(_,K,{onError:X}))}B==null||B(_),l==null||l(_)},H=D=>{if(!g)return;const U=r5(D.nativeEvent);if(r&&(U&&D.button===0||!U)){const B=w.getState();Hx.onPointerDown(D.nativeEvent,{handleDomNode:D.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:k,handleId:m,nodeId:g,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...R)=>{var _,K;return(K=(_=w.getState()).onConnectEnd)==null?void 0:K.call(_,...R)},updateConnection:B.updateConnection,onConnect:G,isValidConnection:n||((...R)=>{var _,K;return((K=(_=w.getState()).isValidConnection)==null?void 0:K.call(_,...R))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}U?d==null||d(D):f==null||f(D)},I=D=>{const{onClickConnectStart:U,onClickConnectEnd:B,connectionClickStartHandle:R,connectionMode:_,isValidConnection:K,lib:T,rfId:X,nodeLookup:ne,connection:J}=w.getState();if(!g||!R&&!r)return;if(!R){U==null||U(D.nativeEvent,{nodeId:g,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const pe=n5(D.target),q=n||K,{connection:Y,isValid:V}=Hx.isValid(D.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:_,fromNodeId:R.nodeId,fromHandleId:R.id||null,fromType:R.type,isValidConnection:q,flowId:X,doc:pe,lib:T,nodeLookup:ne});V&&Y&&G(Y);const ee=structuredClone(J);delete ee.inProgress,ee.toPosition=ee.toHandle?ee.toHandle.position:null,B==null||B(D,ee),w.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${S}-${g}-${m}-${e}`,className:xn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!k,target:k,connectable:s,connectablestart:r,connectableend:i,clickconnecting:M,connectingfrom:A,connectingto:E,valid:F,connectionindicator:s&&(!O||j)&&(O||N?i:r)}]),onMouseDown:H,onTouchStart:H,onClick:y?I:void 0,ref:p,...h,children:c})}const Pn=b.memo(j5(I7));function L7({data:e,isConnectable:t,sourcePosition:n=Xe.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(Pn,{type:"source",position:n,isConnectable:t})]})}function P7({data:e,isConnectable:t,targetPosition:n=Xe.Top,sourcePosition:s=Xe.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(Pn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(Pn,{type:"source",position:s,isConnectable:t})]})}function z7(){return null}function U7({data:e,isConnectable:t,targetPosition:n=Xe.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(Pn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Lp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ON={input:L7,default:P7,output:U7,group:z7};function F7(e){var t,n,s,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const B7=e=>{const{width:t,height:n,x:s,y:r}=tf(e.nodeLookup,{filter:i=>!!i.selected});return{width:ur(t)?t:null,height:ur(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function H7({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=Qt(),{width:r,height:i,transformString:a,userSelectionActive:l}=wt(B7,rn),c=I5(),u=b.useRef(null);b.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&i!==null;if(D5({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=s.getState().nodes.filter(k=>k.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Lp,p.key)&&(p.preventDefault(),c({direction:Lp[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:xn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:i}})})}const DN=typeof window<"u"?window:void 0,$7=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function z5({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:k,zoomActivationKeyCode:w,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:x,panOnScroll:S,panOnScrollSpeed:A,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:j,autoPanOnSelection:O,defaultViewport:N,translateExtent:F,minZoom:G,maxZoom:H,preventScrolling:I,onSelectionContextMenu:L,noWheelClassName:C,noPanClassName:D,disableKeyboardA11y:U,onViewportChange:B,isControlledViewport:R}){const{nodesSelectionActive:_,userSelectionActive:K}=wt($7,rn),T=xd(u,{target:DN}),X=xd(k,{target:DN}),ne=X||j,J=X||S,pe=d&&ne!==!0,q=T||K||pe;return v7({deleteKeyCode:c,multiSelectionKeyCode:m}),o.jsx(S7,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:x,panOnScroll:J,panActivationKeyPressed:X,panOnScrollSpeed:A,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:!T&&ne,defaultViewport:N,translateExtent:F,minZoom:G,maxZoom:H,zoomActivationKeyCode:w,preventScrolling:I,noWheelClassName:C,noPanClassName:D,onViewportChange:B,isControlledViewport:R,paneClickDistance:l,selectionOnDrag:pe,children:o.jsxs(C7,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ne,autoPanOnSelection:O,isSelecting:!!q,selectionMode:f,selectionKeyPressed:T,paneClickDistance:l,selectionOnDrag:pe,children:[e,_&&o.jsx(H7,{onSelectionContextMenu:L,noPanClassName:D,disableKeyboardA11y:U})]})})}z5.displayName="FlowRenderer";const G7=b.memo(z5),K7=e=>t=>e?ik(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function q7(e){return wt(b.useCallback(K7(e),[e]),rn)}const Y7=e=>e.updateNodeInternals;function V7(){const e=wt(Y7),[t]=b.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return b.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function X7({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=Qt(),i=b.useRef(null),a=b.useRef(null),l=b.useRef(e.sourcePosition),c=b.useRef(e.targetPosition),u=b.useRef(t),d=n&&!!e.internals.handleBounds;return b.useEffect(()=>{i.current&&!e.hidden&&(!d||a.current!==i.current)&&(a.current&&(s==null||s.unobserve(a.current)),s==null||s.observe(i.current),a.current=i.current)},[d,e.hidden]),b.useEffect(()=>()=>{a.current&&(s==null||s.unobserve(a.current),a.current=null)},[]),b.useEffect(()=>{if(i.current){const f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function Q7({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:k,nodeTypes:w,nodeClickDistance:g,onError:y}){const{node:x,internals:S,isParent:A}=wt(q=>{const Y=q.nodeLookup.get(e),V=q.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:V}},rn);let E=x.type||"default",M=(w==null?void 0:w[E])||ON[E];M===void 0&&(y==null||y("003",gr.error003(E)),E="default",M=(w==null?void 0:w.default)||ON.default);const j=!!(x.draggable||l&&typeof x.draggable>"u"),O=!!(x.selectable||c&&typeof x.selectable>"u"),N=!!(x.connectable||u&&typeof x.connectable>"u"),F=!!(x.focusable||d&&typeof x.focusable>"u"),G=Qt(),H=Jj(x),I=X7({node:x,nodeType:E,hasDimensions:H,resizeObserver:f}),L=D5({nodeRef:I,disabled:x.hidden||!j,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:O,nodeClickDistance:g}),C=I5();if(x.hidden)return null;const D=vr(x),U=F7(x),B=O||j||t||n||s||r,R=n?q=>n(q,{...S.userNode}):void 0,_=s?q=>s(q,{...S.userNode}):void 0,K=r?q=>r(q,{...S.userNode}):void 0,T=i?q=>i(q,{...S.userNode}):void 0,X=a?q=>a(q,{...S.userNode}):void 0,ne=q=>{const{selectNodesOnDrag:Y,nodeDragThreshold:V}=G.getState();O&&(!Y||!j||V>0)&&$x({id:e,store:G,nodeRef:I}),t&&t(q,{...S.userNode})},J=q=>{if(!(s5(q.nativeEvent)||m)){if(Gj.includes(q.key)&&O){const Y=q.key==="Escape";$x({id:e,store:G,unselect:Y,nodeRef:I})}else if(j&&x.selected&&Object.prototype.hasOwnProperty.call(Lp,q.key)){q.preventDefault();const{ariaLabelConfig:Y}=G.getState();G.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:q.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),C({direction:Lp[q.key],factor:q.shiftKey?4:1})}}},pe=()=>{var Re;if(m||!((Re=I.current)!=null&&Re.matches(":focus-visible")))return;const{transform:q,width:Y,height:V,autoPanOnNodeFocus:ee,setCenter:oe}=G.getState();if(!ee)return;ik(new Map([[e,x]]),{x:0,y:0,width:Y,height:V},q,!0).length>0||oe(x.position.x+D.width/2,x.position.y+D.height/2,{zoom:q[2]})};return o.jsx("div",{className:xn(["react-flow__node",`react-flow__node-${E}`,{[p]:j},x.className,{selected:x.selected,selectable:O,parent:A,draggable:j,dragging:L}]),ref:I,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:H?"visible":"hidden",...x.style,...U},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:_,onMouseLeave:K,onContextMenu:T,onClick:ne,onDoubleClick:X,onKeyDown:F?J:void 0,tabIndex:F?0:void 0,onFocus:F?pe:void 0,role:x.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${_5}-${k}`,"aria-label":x.ariaLabel,...x.domAttributes,children:o.jsx(A7,{value:e,children:o.jsx(M,{id:e,data:x.data,type:E,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:x.selected??!1,selectable:O,draggable:j,deletable:x.deletable??!0,isConnectable:N,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:L,dragHandle:x.dragHandle,zIndex:S.z,parentId:x.parentId,...D})})})}var W7=b.memo(Q7);const Z7=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function U5(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:s,onError:r}=wt(Z7,rn),i=q7(e.onlyRenderVisibleElements),a=V7();return o.jsx("div",{className:"react-flow__nodes",style:Mm,children:i.map(l=>o.jsx(W7,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:r},l))})}U5.displayName="NodeRenderer";const J7=b.memo(U5);function eG(e){return wt(b.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),a=n.nodeLookup.get(r.target);i&&a&&LH({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),rn)}const tG=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},nG=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},IN={[mc.Arrow]:tG,[mc.ArrowClosed]:nG};function sG(e){const t=Qt();return b.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(IN,e)?IN[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",gr.error009(e)),null)},[e])}const rG=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=sG(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},F5=({defaultColor:e,rfId:t})=>{const n=wt(i=>i.edges),s=wt(i=>i.defaultEdgeOptions),r=b.useMemo(()=>GH(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return r.length?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:r.map(i=>o.jsx(rG,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};F5.displayName="MarkerDefinitions";var iG=b.memo(F5);function B5({x:e,y:t,label:n,labelStyle:s,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=b.useState({x:1,y:0,width:0,height:0}),p=xn(["react-flow__edge-textwrapper",u]),m=b.useRef(null);return b.useEffect(()=>{if(m.current){const k=m.current.getBBox();h({x:k.x,y:k.y,width:k.width,height:k.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[r&&o.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:s,children:n}),c]}):null}B5.displayName="EdgeText";const aG=b.memo(B5);function af({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:xn(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,s&&ur(t)&&ur(n)?o.jsx(aG,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function LN({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Xe.Left||e===Xe.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function H5({sourceX:e,sourceY:t,sourcePosition:n=Xe.Bottom,targetX:s,targetY:r,targetPosition:i=Xe.Top}){const[a,l]=LN({pos:n,x1:e,y1:t,x2:s,y2:r}),[c,u]=LN({pos:i,x1:s,y1:r,x2:e,y2:t}),[d,f,h,p]=i5({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${s},${r}`,d,f,h,p]}function $5(e){return b.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:k,markerStart:w,interactionWidth:g})=>{const[y,x,S]=H5({sourceX:n,sourceY:s,sourcePosition:a,targetX:r,targetY:i,targetPosition:l}),A=e.isInternal?void 0:t;return o.jsx(af,{id:A,path:y,labelX:x,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:k,markerStart:w,interactionWidth:g})})}const lG=$5({isInternal:!1}),G5=$5({isInternal:!0});lG.displayName="SimpleBezierEdge";G5.displayName="SimpleBezierEdgeInternal";function K5(e){return b.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Xe.Bottom,targetPosition:m=Xe.Top,markerEnd:k,markerStart:w,pathOptions:g,interactionWidth:y})=>{const[x,S,A]=Ux({sourceX:n,sourceY:s,sourcePosition:p,targetX:r,targetY:i,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),E=e.isInternal?void 0:t;return o.jsx(af,{id:E,path:x,labelX:S,labelY:A,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:k,markerStart:w,interactionWidth:y})})}const q5=K5({isInternal:!1}),Y5=K5({isInternal:!0});q5.displayName="SmoothStepEdge";Y5.displayName="SmoothStepEdgeInternal";function V5(e){return b.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return o.jsx(q5,{...n,id:s,pathOptions:b.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const oG=V5({isInternal:!1}),X5=V5({isInternal:!0});oG.displayName="StepEdge";X5.displayName="StepEdgeInternal";function Q5(e){return b.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:k})=>{const[w,g,y]=o5({sourceX:n,sourceY:s,targetX:r,targetY:i}),x=e.isInternal?void 0:t;return o.jsx(af,{id:x,path:w,labelX:g,labelY:y,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:k})})}const cG=Q5({isInternal:!1}),W5=Q5({isInternal:!0});cG.displayName="StraightEdge";W5.displayName="StraightEdgeInternal";function Z5(e){return b.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:a=Xe.Bottom,targetPosition:l=Xe.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:k,markerStart:w,pathOptions:g,interactionWidth:y})=>{const[x,S,A]=a5({sourceX:n,sourceY:s,sourcePosition:a,targetX:r,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),E=e.isInternal?void 0:t;return o.jsx(af,{id:E,path:x,labelX:S,labelY:A,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:k,markerStart:w,interactionWidth:y})})}const uG=Z5({isInternal:!1}),J5=Z5({isInternal:!0});uG.displayName="BezierEdge";J5.displayName="BezierEdgeInternal";const PN={default:J5,straight:W5,step:X5,smoothstep:Y5,simplebezier:G5},zN={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},dG=(e,t,n)=>n===Xe.Left?e-t:n===Xe.Right?e+t:e,fG=(e,t,n)=>n===Xe.Top?e-t:n===Xe.Bottom?e+t:e,UN="react-flow__edgeupdater";function FN({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:a,className:xn([UN,`${UN}-${l}`]),cx:dG(t,s,e),cy:fG(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function hG({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Qt(),k=(S,A)=>{if(S.button!==0)return;const{autoPanOnConnect:E,domNode:M,connectionMode:j,connectionRadius:O,lib:N,onConnectStart:F,cancelConnection:G,nodeLookup:H,rfId:I,panBy:L,updateConnection:C}=m.getState(),D=A.type==="target",U=(_,K)=>{h(!1),f==null||f(_,n,A.type,K)},B=_=>u==null?void 0:u(n,_),R=(_,K)=>{h(!0),d==null||d(S,n,A.type),F==null||F(_,K)};Hx.onPointerDown(S.nativeEvent,{autoPanOnConnect:E,connectionMode:j,connectionRadius:O,domNode:M,handleId:A.id,nodeId:A.nodeId,nodeLookup:H,isTarget:D,edgeUpdaterType:A.type,lib:N,flowId:I,cancelConnection:G,panBy:L,isValidConnection:(..._)=>{var K,T;return((T=(K=m.getState()).isValidConnection)==null?void 0:T.call(K,..._))??!0},onConnect:B,onConnectStart:R,onConnectEnd:(..._)=>{var K,T;return(T=(K=m.getState()).onConnectEnd)==null?void 0:T.call(K,..._)},onReconnectEnd:U,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},w=S=>k(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=S=>k(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>p(!0),x=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(FN,{position:l,centerX:s,centerY:r,radius:t,onMouseDown:w,onMouseEnter:y,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&o.jsx(FN,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:g,onMouseEnter:y,onMouseOut:x,type:"target"})]})}function pG({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:k,noPanClassName:w,onError:g,disableKeyboardA11y:y}){let x=wt(oe=>oe.edgeLookup.get(e));const S=wt(oe=>oe.defaultEdgeOptions);x=S?{...S,...x}:x;let A=x.type||"default",E=(k==null?void 0:k[A])||PN[A];E===void 0&&(g==null||g("011",gr.error011(A)),A="default",E=(k==null?void 0:k.default)||PN.default);const M=!!(x.focusable||t&&typeof x.focusable>"u"),j=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),O=!!(x.selectable||s&&typeof x.selectable>"u"),N=b.useRef(null),[F,G]=b.useState(!1),[H,I]=b.useState(!1),L=Qt(),{zIndex:C=x.zIndex,sourceX:D,sourceY:U,targetX:B,targetY:R,sourcePosition:_,targetPosition:K}=wt(b.useCallback(oe=>{const ye=oe.nodeLookup.get(x.source),Re=oe.nodeLookup.get(x.target);if(!ye||!Re)return zN;const se=$H({id:e,sourceNode:ye,targetNode:Re,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:oe.connectionMode,onError:g}),Q=IH({selected:x.selected,zIndex:x.zIndex,sourceNode:ye,targetNode:Re,elevateOnSelect:oe.elevateEdgesOnSelect,zIndexMode:oe.zIndexMode});return{...se||zN,zIndex:Q}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex,g]),rn),T=b.useMemo(()=>x.markerStart?`url('#${Fx(x.markerStart,m)}')`:void 0,[x.markerStart,m]),X=b.useMemo(()=>x.markerEnd?`url('#${Fx(x.markerEnd,m)}')`:void 0,[x.markerEnd,m]);if(x.hidden||D===null||U===null||B===null||R===null)return null;const ne=oe=>{var Q;const{addSelectedEdges:ye,unselectNodesAndEdges:Re,multiSelectionActive:se}=L.getState();O&&(L.setState({nodesSelectionActive:!1}),x.selected&&se?(Re({nodes:[],edges:[x]}),(Q=N.current)==null||Q.blur()):ye([e])),r&&r(oe,x)},J=i?oe=>{i(oe,{...x})}:void 0,pe=a?oe=>{a(oe,{...x})}:void 0,q=l?oe=>{l(oe,{...x})}:void 0,Y=c?oe=>{c(oe,{...x})}:void 0,V=u?oe=>{u(oe,{...x})}:void 0,ee=oe=>{var ye;if(!y&&Gj.includes(oe.key)&&O){const{unselectNodesAndEdges:Re,addSelectedEdges:se}=L.getState();oe.key==="Escape"?((ye=N.current)==null||ye.blur(),Re({edges:[x]})):se([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:xn(["react-flow__edge",`react-flow__edge-${A}`,x.className,w,{selected:x.selected,animated:x.animated,inactive:!O&&!r,updating:F,selectable:O}]),onClick:ne,onDoubleClick:J,onContextMenu:pe,onMouseEnter:q,onMouseMove:Y,onMouseLeave:V,onKeyDown:M?ee:void 0,tabIndex:M?0:void 0,role:x.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":M?`${C5}-${m}`:void 0,ref:N,...x.domAttributes,children:[!H&&o.jsx(E,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:O,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:D,sourceY:U,targetX:B,targetY:R,sourcePosition:_,targetPosition:K,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:T,markerEnd:X,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),j&&o.jsx(hG,{edge:x,isReconnectable:j,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:D,sourceY:U,targetX:B,targetY:R,sourcePosition:_,targetPosition:K,setUpdateHover:G,setReconnecting:I})]})})}var mG=b.memo(pG);const gG=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function e3({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:k}){const{edgesFocusable:w,edgesReconnectable:g,elementsSelectable:y,onError:x}=wt(gG,rn),S=eG(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(iG,{defaultColor:e,rfId:n}),S.map(A=>o.jsx(mG,{id:A,edgesFocusable:w,edgesReconnectable:g,elementsSelectable:y,noPanClassName:r,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:x,edgeTypes:s,disableKeyboardA11y:k},A))]})}e3.displayName="EdgeRenderer";const bG=b.memo(e3),BN=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function xG({children:e}){const t=Qt(),n=b.useRef(null),[s]=b.useState(()=>t.getState().transform);return R5(()=>{let r=null;const i=()=>{const a=t.getState().transform;r&&a[0]===r[0]&&a[1]===r[1]&&a[2]===r[2]||(r=a,n.current&&(n.current.style.transform=BN(a)))};return i(),t.subscribe(i)},[t]),o.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:BN(s)},children:e})}function yG(e){const t=pk(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const vG=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function kG(e){const t=wt(vG),n=Qt();return b.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function wG(e){return e.connection.inProgress?{...e.connection,to:sf(e.connection.to,e.transform)}:{...e.connection}}function SG(e){return wG}function NG(e){const t=SG();return wt(t,rn)}const EG=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function _G({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:a,isValid:l,inProgress:c}=wt(EG,rn);return!(i&&r&&c)?null:o.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:xn(["react-flow__connection",t5(l)]),children:o.jsx(t3,{style:t,type:n,CustomComponent:s,isValid:l})})})}const t3=({style:e,type:t=ra.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=NG();if(!r)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:t5(s),toNode:d,toHandle:f,pointer:p});let m="";const k={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case ra.Bezier:[m]=a5(k);break;case ra.SimpleBezier:[m]=H5(k);break;case ra.Step:[m]=Ux({...k,borderRadius:0});break;case ra.SmoothStep:[m]=Ux(k);break;default:[m]=o5(k)}return o.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};t3.displayName="ConnectionLine";const CG={};function HN(e=CG){b.useRef(e),Qt(),b.useEffect(()=>{},[e])}function TG(){Qt(),b.useRef(!1),b.useEffect(()=>{},[])}function n3({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:k,connectionLineComponent:w,connectionLineContainerStyle:g,selectionKeyCode:y,selectionOnDrag:x,selectionMode:S,multiSelectionKeyCode:A,panActivationKeyCode:E,zoomActivationKeyCode:M,deleteKeyCode:j,onlyRenderVisibleElements:O,elementsSelectable:N,defaultViewport:F,translateExtent:G,minZoom:H,maxZoom:I,preventScrolling:L,defaultMarkerColor:C,zoomOnScroll:D,zoomOnPinch:U,panOnScroll:B,panOnScrollSpeed:R,panOnScrollMode:_,zoomOnDoubleClick:K,panOnDrag:T,autoPanOnSelection:X,onPaneClick:ne,onPaneMouseEnter:J,onPaneMouseMove:pe,onPaneMouseLeave:q,onPaneScroll:Y,onPaneContextMenu:V,paneClickDistance:ee,nodeClickDistance:oe,onEdgeContextMenu:ye,onEdgeMouseEnter:Re,onEdgeMouseMove:se,onEdgeMouseLeave:Q,reconnectRadius:Te,onReconnect:xe,onReconnectStart:ve,onReconnectEnd:ge,noDragClassName:$e,noWheelClassName:dt,noPanClassName:mt,disableKeyboardA11y:rt,nodeExtent:ct,rfId:te,viewport:re,onViewportChange:Ae,nodesDraggable:v}){return HN(e),HN(t),TG(),yG(n),kG(re),o.jsx(G7,{onPaneClick:ne,onPaneMouseEnter:J,onPaneMouseMove:pe,onPaneMouseLeave:q,onPaneContextMenu:V,onPaneScroll:Y,paneClickDistance:ee,deleteKeyCode:j,selectionKeyCode:y,selectionOnDrag:x,selectionMode:S,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:A,panActivationKeyCode:E,zoomActivationKeyCode:M,elementsSelectable:N,zoomOnScroll:D,zoomOnPinch:U,zoomOnDoubleClick:K,panOnScroll:B,panOnScrollSpeed:R,panOnScrollMode:_,panOnDrag:T,autoPanOnSelection:X,defaultViewport:F,translateExtent:G,minZoom:H,maxZoom:I,onSelectionContextMenu:f,preventScrolling:L,noDragClassName:$e,noWheelClassName:dt,noPanClassName:mt,disableKeyboardA11y:rt,onViewportChange:Ae,isControlledViewport:!!re,children:o.jsxs(xG,{children:[o.jsx(bG,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:a,onReconnect:xe,onReconnectStart:ve,onReconnectEnd:ge,onlyRenderVisibleElements:O,onEdgeContextMenu:ye,onEdgeMouseEnter:Re,onEdgeMouseMove:se,onEdgeMouseLeave:Q,reconnectRadius:Te,defaultMarkerColor:C,noPanClassName:mt,disableKeyboardA11y:rt,rfId:te}),o.jsx(_G,{style:k,type:m,component:w,containerStyle:g}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(J7,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:oe,onlyRenderVisibleElements:O,noPanClassName:mt,noDragClassName:$e,disableKeyboardA11y:rt,nodeExtent:ct,rfId:te,nodesDraggable:v}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}n3.displayName="GraphView";const AG=b.memo(n3),MG=Zj(),$N=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,k=new Map,w=new Map,g=s??t??[],y=n??e??[],x=d??[0,0],S=f??pd;d5(k,w,g);const{nodesInitialized:A}=Bx(y,p,m,{nodeOrigin:x,nodeExtent:S,zIndexMode:h});let E=[0,0,1];if(a&&r&&i){const M=tf(p,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:j,y:O,zoom:N}=lk(M,r,i,c,u,(l==null?void 0:l.padding)??.1);E=[j,O,N]}return{rfId:"1",width:r??0,height:i??0,transform:E,nodes:y,nodesInitialized:A,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:w,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:pd,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:pc.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...qj},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:MG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Kj,zIndexMode:h,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},jG=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>G$((p,m)=>{async function k(){const{nodeLookup:w,panZoom:g,fitViewOptions:y,fitViewResolver:x,width:S,height:A,minZoom:E,maxZoom:M}=m();g&&(await TH({nodes:w,width:S,height:A,panZoom:g,minZoom:E,maxZoom:M},y),x==null||x.resolve(!0),p({fitViewResolver:null}))}return{...$N({nodes:e,edges:t,width:r,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:s,zIndexMode:h}),setNodes:w=>{const{nodeLookup:g,parentLookup:y,nodeOrigin:x,nodeExtent:S,elevateNodesOnSelect:A,fitViewQueued:E,zIndexMode:M,nodesSelectionActive:j}=m(),{nodesInitialized:O,hasSelectedNodes:N}=Bx(w,g,y,{nodeOrigin:x,nodeExtent:S,elevateNodesOnSelect:A,checkEquality:!0,zIndexMode:M}),F=j&&N;E&&O?(k(),p({nodes:w,nodesInitialized:O,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:F})):p({nodes:w,nodesInitialized:O,nodesSelectionActive:F})},setEdges:w=>{const{connectionLookup:g,edgeLookup:y}=m();d5(g,y,w),p({edges:w})},setDefaultNodesAndEdges:(w,g)=>{if(w){const{setNodes:y}=m();y(w),p({hasDefaultNodes:!0})}if(g){const{setEdges:y}=m();y(g),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:g,nodeLookup:y,parentLookup:x,domNode:S,nodeOrigin:A,nodeExtent:E,debug:M,fitViewQueued:j,zIndexMode:O}=m(),{changes:N,updatedInternals:F}=WH(w,y,x,S,A,E,O);F&&(YH(y,x,{nodeOrigin:A,nodeExtent:E,zIndexMode:O}),j?(k(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(N==null?void 0:N.length)>0&&(M&&console.log("React Flow: trigger node changes",N),g==null||g(N)))},updateNodePositions:(w,g=!1)=>{const y=[];let x=[];const{nodeLookup:S,triggerNodeChanges:A,connection:E,updateConnection:M,onNodesChangeMiddlewareMap:j}=m();for(const[O,N]of w){const F=S.get(O),G=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(N!=null&&N.position)),H={id:O,type:"position",position:G?{x:Math.max(0,N.position.x),y:Math.max(0,N.position.y)}:N.position,dragging:g};if(F&&E.inProgress&&E.fromNode.id===F.id){const I=Fl(F,E.fromHandle,Xe.Left,!0);M({...E,from:I})}G&&F.parentId&&y.push({id:O,parentId:F.parentId,rect:{...N.internals.positionAbsolute,width:N.measured.width??0,height:N.measured.height??0}}),x.push(H)}if(y.length>0){const{parentLookup:O,nodeOrigin:N}=m(),F=hk(y,S,O,N);x.push(...F)}for(const O of j.values())x=O(x);A(x)},triggerNodeChanges:w=>{const{onNodesChange:g,setNodes:y,nodes:x,hasDefaultNodes:S,debug:A}=m();if(w!=null&&w.length){if(S){const E=M5(w,x);y(E)}A&&console.log("React Flow: trigger node changes",w),g==null||g(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:g,setEdges:y,edges:x,hasDefaultEdges:S,debug:A}=m();if(w!=null&&w.length){if(S){const E=d7(w,x);y(E)}A&&console.log("React Flow: trigger edge changes",w),g==null||g(w)}},addSelectedNodes:w=>{const{multiSelectionActive:g,edgeLookup:y,nodeLookup:x,triggerNodeChanges:S,triggerEdgeChanges:A}=m();if(g){const E=w.map(M=>Ja(M,!0));S(E);return}S(wo(x,new Set([...w]),!0)),A(wo(y))},addSelectedEdges:w=>{const{multiSelectionActive:g,edgeLookup:y,nodeLookup:x,triggerNodeChanges:S,triggerEdgeChanges:A}=m();if(g){const E=w.map(M=>Ja(M,!0));A(E);return}A(wo(y,new Set([...w]))),S(wo(x,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:g}={})=>{const{edges:y,nodes:x,nodeLookup:S,triggerNodeChanges:A,triggerEdgeChanges:E}=m(),M=w||x,j=g||y,O=[];for(const F of M){if(!F.selected)continue;const G=S.get(F.id);G&&(G.selected=!1),O.push(Ja(F.id,!1))}const N=[];for(const F of j)F.selected&&N.push(Ja(F.id,!1));A(O),E(N)},setMinZoom:w=>{const{panZoom:g,maxZoom:y}=m();g==null||g.setScaleExtent([w,y]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:g,minZoom:y}=m();g==null||g.setScaleExtent([y,w]),p({maxZoom:w})},setTranslateExtent:w=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:g,triggerNodeChanges:y,triggerEdgeChanges:x,elementsSelectable:S}=m();if(!S)return;const A=g.reduce((M,j)=>j.selected?[...M,Ja(j.id,!1)]:M,[]),E=w.reduce((M,j)=>j.selected?[...M,Ja(j.id,!1)]:M,[]);y(A),x(E)},setNodeExtent:w=>{const{nodes:g,nodeLookup:y,parentLookup:x,nodeOrigin:S,elevateNodesOnSelect:A,nodeExtent:E,zIndexMode:M}=m();w[0][0]===E[0][0]&&w[0][1]===E[0][1]&&w[1][0]===E[1][0]&&w[1][1]===E[1][1]||(Bx(g,y,x,{nodeOrigin:S,nodeExtent:w,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:M}),p({nodeExtent:w}))},panBy:w=>{const{transform:g,width:y,height:x,panZoom:S,translateExtent:A}=m();return ZH({delta:w,panZoom:S,transform:g,translateExtent:A,width:y,height:x})},setCenter:async(w,g,y)=>{const{width:x,height:S,maxZoom:A,panZoom:E}=m();if(!E)return!1;const M=typeof(y==null?void 0:y.zoom)<"u"?y.zoom:A;return await E.setViewport({x:x/2-w*M,y:S/2-g*M,zoom:M},{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),!0},cancelConnection:()=>{p({connection:{...qj}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...$N()})}},Object.is);function RG({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=b.useState(()=>jG({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(K$,{value:m,children:o.jsx(g7,{children:o.jsx(j7,{children:p})})})}function OG({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return b.useContext(Am)?o.jsx(o.Fragment,{children:e}):o.jsx(RG,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const DG={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function IG({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:k,onClickConnectStart:w,onClickConnectEnd:g,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:S,onNodeContextMenu:A,onNodeDoubleClick:E,onNodeDragStart:M,onNodeDrag:j,onNodeDragStop:O,onNodesDelete:N,onEdgesDelete:F,onDelete:G,onSelectionChange:H,onSelectionDragStart:I,onSelectionDrag:L,onSelectionDragStop:C,onSelectionContextMenu:D,onSelectionStart:U,onSelectionEnd:B,onBeforeDelete:R,connectionMode:_,connectionLineType:K=ra.Bezier,connectionLineStyle:T,connectionLineComponent:X,connectionLineContainerStyle:ne,deleteKeyCode:J="Backspace",selectionKeyCode:pe="Shift",selectionOnDrag:q=!1,selectionMode:Y=md.Full,panActivationKeyCode:V="Space",multiSelectionKeyCode:ee=bd()?"Meta":"Control",zoomActivationKeyCode:oe=bd()?"Meta":"Control",snapToGrid:ye,snapGrid:Re,onlyRenderVisibleElements:se=!1,selectNodesOnDrag:Q,nodesDraggable:Te,autoPanOnNodeFocus:xe,nodesConnectable:ve,nodesFocusable:ge,nodeOrigin:$e=T5,edgesFocusable:dt,edgesReconnectable:mt,elementsSelectable:rt=!0,defaultViewport:ct=r7,minZoom:te=.5,maxZoom:re=2,translateExtent:Ae=pd,preventScrolling:v=!0,nodeExtent:Z,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:be=!0,zoomOnPinch:he=!0,panOnScroll:P=!1,panOnScrollSpeed:ce=.5,panOnScrollMode:ue=wl.Free,zoomOnDoubleClick:_e=!0,panOnDrag:ke=!0,onPaneClick:we,onPaneMouseEnter:Ne,onPaneMouseMove:Oe,onPaneMouseLeave:Me,onPaneScroll:Fe,onPaneContextMenu:De,paneClickDistance:He=1,nodeClickDistance:Ge=0,children:ft,onReconnect:St,onReconnectStart:Nt,onReconnectEnd:_t,onEdgeContextMenu:jt,onEdgeDoubleClick:Rt,onEdgeMouseEnter:Wt,onEdgeMouseMove:ie,onEdgeMouseLeave:Pe,reconnectRadius:Ie=10,onNodesChange:Je,onEdgesChange:Ze,noDragClassName:Cn="nodrag",noWheelClassName:Ht="nowheel",noPanClassName:Vr="nopan",fitView:kr,fitViewOptions:ks,connectOnClick:Ii,attributionPosition:Xn,proOptions:Li,defaultEdgeOptions:Xr,elevateNodesOnSelect:Qr=!0,elevateEdgesOnSelect:Wr=!1,disableKeyboardA11y:Zr=!1,autoPanOnConnect:Qn,autoPanOnNodeDrag:wr,autoPanOnSelection:ws=!0,autoPanSpeed:Pi,connectionRadius:Sr,isValidConnection:Tn,onError:Jr,style:Nr,id:An,nodeDragThreshold:za,connectionDragThreshold:Ua,viewport:Ls,onViewportChange:tr,width:ei,height:Fa,colorMode:Ba="light",debug:Hn,onScroll:an,ariaLabelConfig:Dn,zIndexMode:Er="basic",..._r},Cr){const W=An||"1",z=o7(Ba),le=b.useCallback(Ee=>{Ee.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),an==null||an(Ee)},[an]);return o.jsx("div",{"data-testid":"rf__wrapper",..._r,onScroll:le,style:{...Nr,...DG},ref:Cr,className:xn(["react-flow",r,z]),id:An,role:"application",children:o.jsxs(OG,{nodes:e,edges:t,width:ei,height:Fa,fitView:kr,fitViewOptions:ks,minZoom:te,maxZoom:re,nodeOrigin:$e,nodeExtent:Z,zIndexMode:Er,children:[o.jsx(l7,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:p,onConnectStart:m,onConnectEnd:k,onClickConnectStart:w,onClickConnectEnd:g,nodesDraggable:Te,autoPanOnNodeFocus:xe,nodesConnectable:ve,nodesFocusable:ge,edgesFocusable:dt,edgesReconnectable:mt,elementsSelectable:rt,elevateNodesOnSelect:Qr,elevateEdgesOnSelect:Wr,minZoom:te,maxZoom:re,nodeExtent:Z,onNodesChange:Je,onEdgesChange:Ze,snapToGrid:ye,snapGrid:Re,connectionMode:_,translateExtent:Ae,connectOnClick:Ii,defaultEdgeOptions:Xr,fitView:kr,fitViewOptions:ks,onNodesDelete:N,onEdgesDelete:F,onDelete:G,onNodeDragStart:M,onNodeDrag:j,onNodeDragStop:O,onSelectionDrag:L,onSelectionDragStart:I,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:Vr,nodeOrigin:$e,rfId:W,autoPanOnConnect:Qn,autoPanOnNodeDrag:wr,autoPanSpeed:Pi,onError:Jr,connectionRadius:Sr,isValidConnection:Tn,selectNodesOnDrag:Q,nodeDragThreshold:za,connectionDragThreshold:Ua,onBeforeDelete:R,debug:Hn,ariaLabelConfig:Dn,zIndexMode:Er}),o.jsx(AG,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:S,onNodeContextMenu:A,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:a,connectionLineType:K,connectionLineStyle:T,connectionLineComponent:X,connectionLineContainerStyle:ne,selectionKeyCode:pe,selectionOnDrag:q,selectionMode:Y,deleteKeyCode:J,multiSelectionKeyCode:ee,panActivationKeyCode:V,zoomActivationKeyCode:oe,onlyRenderVisibleElements:se,defaultViewport:ct,translateExtent:Ae,minZoom:te,maxZoom:re,preventScrolling:v,zoomOnScroll:be,zoomOnPinch:he,zoomOnDoubleClick:_e,panOnScroll:P,panOnScrollSpeed:ce,panOnScrollMode:ue,panOnDrag:ke,autoPanOnSelection:ws,onPaneClick:we,onPaneMouseEnter:Ne,onPaneMouseMove:Oe,onPaneMouseLeave:Me,onPaneScroll:Fe,onPaneContextMenu:De,paneClickDistance:He,nodeClickDistance:Ge,onSelectionContextMenu:D,onSelectionStart:U,onSelectionEnd:B,onReconnect:St,onReconnectStart:Nt,onReconnectEnd:_t,onEdgeContextMenu:jt,onEdgeDoubleClick:Rt,onEdgeMouseEnter:Wt,onEdgeMouseMove:ie,onEdgeMouseLeave:Pe,reconnectRadius:Ie,defaultMarkerColor:fe,noDragClassName:Cn,noWheelClassName:Ht,noPanClassName:Vr,rfId:W,disableKeyboardA11y:Zr,nodeExtent:Z,viewport:Ls,onViewportChange:tr,nodesDraggable:Te}),o.jsx(s7,{onSelectionChange:H}),ft,o.jsx(Z$,{proOptions:Li,position:Xn}),o.jsx(W$,{rfId:W,disableKeyboardA11y:Zr})]})})}var gk=j5(IG);function LG(e){const[t,n]=b.useState(e),s=b.useCallback(r=>n(i=>M5(r,i)),[]);return[t,n,s]}function PG({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xn(["react-flow__background-pattern",n,s])})}function zG({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:xn(["react-flow__background-pattern","dots",t])})}var fr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(fr||(fr={}));const UG={[fr.Dots]:1,[fr.Lines]:1,[fr.Cross]:6},FG=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function s3({id:e,variant:t=fr.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=b.useRef(null),{transform:h,patternId:p}=wt(FG,rn),m=s||UG[t],k=t===fr.Dots,w=t===fr.Cross,g=Array.isArray(n)?n:[n,n],y=[g[0]*h[2]||1,g[1]*h[2]||1],x=m*h[2],S=Array.isArray(i)?i:[i,i],A=w?[x,x]:y,E=[S[0]*h[2]+A[0]/2,S[1]*h[2]+A[1]/2],M=`${p}${e||""}`;return o.jsxs("svg",{className:xn(["react-flow__background",u]),style:{...c,...Mm,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:M,x:h[0]%y[0],y:h[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:k?o.jsx(zG,{radius:x/2,className:d}):o.jsx(PG,{dimensions:A,lineWidth:r,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}s3.displayName="Background";const BG=b.memo(s3);function HG(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function $G(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function GG(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function KG(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function qG(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Xf({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:xn(["react-flow__controls-button",t]),...n,children:e})}const YG=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function r3({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Qt(),{isInteractive:k,minZoomReached:w,maxZoomReached:g,ariaLabelConfig:y}=wt(YG,rn),{zoomIn:x,zoomOut:S,fitView:A}=pk(),E=()=>{x(),i==null||i()},M=()=>{S(),a==null||a()},j=()=>{A(r),l==null||l()},O=()=>{m.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},N=h==="horizontal"?"horizontal":"vertical";return o.jsxs(rf,{className:xn(["react-flow__controls",N,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??y["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Xf,{onClick:E,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:g,children:o.jsx(HG,{})}),o.jsx(Xf,{onClick:M,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:w,children:o.jsx($G,{})})]}),n&&o.jsx(Xf,{className:"react-flow__controls-fitview",onClick:j,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:o.jsx(GG,{})}),s&&o.jsx(Xf,{className:"react-flow__controls-interactive",onClick:O,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:k?o.jsx(qG,{}):o.jsx(KG,{})}),d]})}r3.displayName="Controls";const bk=b.memo(r3);function VG({id:e,x:t,y:n,width:s,height:r,style:i,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:k}=i||{},w=a||m||k;return o.jsx("rect",{className:xn(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:s,height:r,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const XG=b.memo(VG),QG=e=>e.nodes.map(t=>t.id),Vg=e=>e instanceof Function?e:()=>e;function WG({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=XG,onClick:a}){const l=wt(QG,rn),c=Vg(t),u=Vg(e),d=Vg(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(JG,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function ZG({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=wt(m=>{const k=m.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const w=k.internals.userNode,{x:g,y}=k.internals.positionAbsolute,{width:x,height:S}=vr(w);return{node:w,x:g,y,width:x,height:S}},rn);return!u||u.hidden||!Jj(u)?null:o.jsx(l,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:i,shapeRendering:a,onClick:c,id:u.id})}const JG=b.memo(ZG);var eK=b.memo(WG);const tK=200,nK=150,sK=e=>!e.hidden,rK=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};let n=!1;for(const s of e.nodeLookup.values())if(!s.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Qj(tf(e.nodeLookup,{filter:sK}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},GN=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,iK=(e,t)=>GN(e.viewBB,t.viewBB)&&GN(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,aK="react-flow__minimap-desc";function i3({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:k=!1,zoomable:w=!1,ariaLabel:g,inversePan:y,zoomStep:x=1,offsetScale:S=5}){const A=Qt(),E=b.useRef(null),{boundingRect:M,panZoom:j,viewBB:O,rfId:N,translateExtent:F,flowWidth:G,flowHeight:H,ariaLabelConfig:I}=wt(rK,iK),L=(e==null?void 0:e.width)??tK,C=(e==null?void 0:e.height)??nK,D=M.width/L,U=M.height/C,B=Math.max(D,U),R=B*L,_=B*C,K=S*B,T=M.x-(R-M.width)/2-K,X=M.y-(_-M.height)/2-K,ne=R+K*2,J=_+K*2,pe=`${aK}-${N}`,q=b.useRef(0),Y=b.useRef();q.current=B,b.useEffect(()=>{const Re=A.getState().panZoom;if(E.current&&Re)return Y.current=l$({domNode:E.current,panZoom:Re,getTransform:()=>A.getState().transform,getViewScale:()=>q.current}),()=>{var se;(se=Y.current)==null||se.destroy()}},[j]),b.useEffect(()=>{var Re;(Re=Y.current)==null||Re.update({translateExtent:F,width:G,height:H,inversePan:y,pannable:k,zoomStep:x,zoomable:w})},[k,w,y,x,F,G,H]);const V=p?Re=>{var Te;const[se,Q]=((Te=Y.current)==null?void 0:Te.pointer(Re))||[0,0];p(Re,{x:se,y:Q})}:void 0,ee=b.useCallback((Re,se)=>{const Q=A.getState().nodeLookup.get(se).internals.userNode;m==null||m(Re,Q)},[m]),oe=m?ee:void 0,ye=g??I["minimap.ariaLabel"];return o.jsx(rf,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*B:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:xn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:L,height:C,viewBox:`${T} ${X} ${ne} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":pe,ref:E,onClick:V,children:[ye&&o.jsx("title",{id:pe,children:ye}),o.jsx(eK,{onClick:oe,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${T-K},${X-K}h${ne+K*2}v${J+K*2}h${-ne-K*2}z
511
+ M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}i3.displayName="MiniMap";b.memo(i3);const lK=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,oK={[xc.Line]:"right",[xc.Handle]:"bottom-right"};function cK({nodeId:e,position:t,variant:n=xc.Handle,className:s,style:r=void 0,children:i,color:a,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:k,onResize:w,onResizeEnd:g}){const y=L5(),x=typeof e=="string"?e:y,S=Qt(),A=b.useRef(null),E=n===xc.Handle,M=wt(b.useCallback(lK(E&&p),[E,p]),rn),j=b.useRef(null),O=t??oK[n];b.useEffect(()=>{if(!(!A.current||!x))return j.current||(j.current=v$({domNode:A.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:F,transform:G,snapGrid:H,snapToGrid:I,nodeOrigin:L,domNode:C}=S.getState();return{nodeLookup:F,transform:G,snapGrid:H,snapToGrid:I,nodeOrigin:L,paneDomNode:C}},onChange:(F,G)=>{const{triggerNodeChanges:H,nodeLookup:I,parentLookup:L,nodeOrigin:C}=S.getState(),D=[],U={x:F.x,y:F.y},B=I.get(x);if(B&&B.expandParent&&B.parentId){const R=B.origin??C,_=F.width??B.measured.width??0,K=F.height??B.measured.height??0,T={id:B.id,parentId:B.parentId,rect:{width:_,height:K,...e5({x:F.x??B.position.x,y:F.y??B.position.y},{width:_,height:K},B.parentId,I,R)}},X=hk([T],I,L,C);D.push(...X),U.x=F.x?Math.max(R[0]*_,F.x):void 0,U.y=F.y?Math.max(R[1]*K,F.y):void 0}if(U.x!==void 0&&U.y!==void 0){const R={id:x,type:"position",position:{...U}};D.push(R)}if(F.width!==void 0&&F.height!==void 0){const _={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};D.push(_)}for(const R of G){const _={...R,type:"position"};D.push(_)}H(D)},onEnd:({width:F,height:G})=>{const H={id:x,type:"dimensions",resizing:!1,dimensions:{width:F,height:G}};S.getState().triggerNodeChanges([H])}})),j.current.update({controlPosition:O,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:k,onResize:w,onResizeEnd:g,shouldResize:m}),()=>{var F;(F=j.current)==null||F.destroy()}},[O,l,c,u,d,f,k,w,g,m]);const N=O.split("-");return o.jsx("div",{className:xn(["react-flow__resize-control","nodrag",...N,n,s]),ref:A,style:{...r,scale:M,...a&&{[E?"backgroundColor":"borderColor"]:a}},children:i})}b.memo(cK);function Vs({className:e}){return o.jsx("div",{className:de("animate-pulse rounded bg-neutral-800/70",e)})}function jm({rows:e=5,className:t}){return o.jsx("div",{className:de("space-y-1.5 p-2",t),"aria-busy":"true",children:Array.from({length:e},(n,s)=>o.jsxs("div",{className:"flex items-center gap-2 rounded-lg px-2 py-1.5",children:[o.jsx(Vs,{className:"h-4 w-4 shrink-0 rounded"}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[o.jsx(Vs,{className:de("h-3",s%3===0?"w-2/3":"w-1/2")}),o.jsx(Vs,{className:"h-2.5 w-1/3"})]})]},s))})}function a3({count:e=6,className:t}){return o.jsx("div",{className:de("grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3",t),"aria-busy":"true",children:Array.from({length:e},(n,s)=>o.jsxs("div",{className:"space-y-2 rounded-xl border border-edge/[0.06] bg-neutral-900/40 p-3",children:[o.jsx(Vs,{className:"h-3.5 w-1/2"}),o.jsx(Vs,{className:"h-2.5 w-full"}),o.jsx(Vs,{className:"h-2.5 w-4/5"}),o.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[o.jsx(Vs,{className:"h-4 w-12 rounded-full"}),o.jsx(Vs,{className:"h-4 w-8 rounded-full"})]})]},s))})}function uK({lines:e=8,className:t}){return o.jsx("div",{className:de("space-y-2 p-3",t),"aria-busy":"true",children:Array.from({length:e},(n,s)=>o.jsx(Vs,{className:de("h-3",s%4===3?"w-1/2":s%5===0?"w-3/4":"w-full")},s))})}function dK(){return o.jsxs("div",{className:"flex-1 overflow-hidden p-3","aria-busy":"true",children:[o.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[o.jsx(Vs,{className:"h-6 w-24 rounded-lg"}),o.jsx(Vs,{className:"h-6 w-16 rounded-lg"}),o.jsx(Vs,{className:"h-6 w-20 rounded-lg"})]}),o.jsx(a3,{count:6})]})}function Sl({checked:e,onChange:t,title:n,disabled:s}){return o.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-disabled":s||void 0,title:n,disabled:s,onClick:r=>{r.stopPropagation(),!s&&t(!e)},className:de("nodrag relative h-4 w-7 shrink-0 rounded-full transition-colors duration-200",e?"bg-emerald-500/80":"bg-neutral-600",s&&"opacity-50"),children:o.jsx("span",{className:de("absolute top-0.5 h-3 w-3 rounded-full bg-white shadow transition-all duration-200",e?"left-3.5":"left-0.5")})})}const fK={builtin:"bg-amber-900/40 text-amber-300",user:"bg-blue-900/40 text-blue-300",project:"bg-emerald-900/40 text-emerald-300"};function Qf(){window.dispatchEvent(new Event("weave:rules-changed"))}function hK({projectId:e,renderRules:t}){const n=We(),[s,r]=b.useState(null),[i,a]=b.useState(null),[l,c]=b.useState(new Set),[u,d]=b.useState(null),{show:f}=tn(),h=dn(),p=b.useCallback(()=>{Promise.all([Ce.listHookPlugins(e),e===void 0?Promise.resolve(null):Ce.listHookPlugins()]).then(([y,x])=>{r(y),a(x)}).catch(()=>r(y=>y??[]))},[e]);b.useEffect(()=>(p(),Ai(()=>{p(),Qf()},["plugin.reloaded","plugin.toggled"])),[p]);const m=(y,x)=>{h.run(`toggle:${y.id}`,async()=>{await Ce.toggleHookPlugin(y.id,x,e),p(),Qf()},{fail:S=>n("hooks.plugins.toggleFail",{error:qe(S)})})},k=async y=>{await h.run(`uninstall:${y.id}`,async()=>{await Ce.uninstallHookPlugin(y.id),p(),Qf(),f("success",n("hooks.plugins.uninstallOk",{id:y.id}))},{fail:x=>n("hooks.plugins.uninstallFail",{error:qe(x)})})},w=()=>{h.run("rescan",async()=>{const y=await Ce.rescanHookPlugins();p(),Qf(),f("success",n("hooks.plugins.rescanOk",{n:y}))},{fail:y=>n("hooks.plugins.rescanFail",{error:qe(y)})})};if(s===null)return null;const g=new Map((i??[]).map(y=>[y.id,y.status]));return o.jsxs("div",{className:"space-y-2",children:[s.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:n("hooks.plugins.empty")}),s.map(y=>{const x=g.get(y.id),S=e!==void 0&&x!==void 0&&x!==y.status,A=l.has(y.id),E=!!t&&y.ruleCount>0;return o.jsxs("div",{className:"rounded-md border border-edge/[0.06] bg-edge/[0.015] overflow-hidden",children:[o.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[E&&o.jsx("button",{type:"button",onClick:()=>c(M=>vl(M,y.id)),title:n(A?"hooks.plugins.expand":"hooks.plugins.collapse"),className:"shrink-0 text-neutral-500 hover:text-neutral-300 [&_svg]:pointer-events-none",children:A?o.jsx(Yn,{className:"h-3.5 w-3.5"}):o.jsx(_n,{className:"h-3.5 w-3.5"})}),o.jsx(nd,{className:de("h-3.5 w-3.5 shrink-0",y.status==="active"?"text-emerald-400":y.status==="disabled"?"text-neutral-600":"text-red-400")}),o.jsx("span",{className:"shrink-0 text-xs font-medium text-neutral-200",children:y.name}),o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",children:y.id}),o.jsx(Qe,{className:de("shrink-0",fK[y.scope]),children:y.scope}),o.jsxs("span",{className:"shrink-0 text-[10px] text-neutral-600",children:["v",y.version]}),o.jsx("span",{className:"shrink-0 text-[11px] text-neutral-500",children:n("hooks.plugins.rules",{n:y.ruleCount})}),y.status==="rejected"&&y.error&&o.jsx("span",{className:"min-w-0 truncate text-[11px] text-red-400/90",title:y.error,children:y.error}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[e!==void 0&&y.status!=="rejected"&&x!==void 0&&o.jsx(Qe,{variant:S?"warning":"default",title:n("hooks.plugins.projectHint"),children:n(S?"hooks.plugins.projectOverride":"hooks.plugins.followGlobal")}),e===void 0&&o.jsx("button",{type:"button",onClick:()=>d(y),title:n("hooks.plugins.uninstallTip"),className:"rounded px-1 text-[11px] text-neutral-600 hover:text-red-400 [&_svg]:pointer-events-none",children:o.jsx(lt,{state:h.stateOf(`uninstall:${y.id}`),className:"h-3 w-3",icon:o.jsx("span",{className:"text-[11px]",children:"✕"})})}),o.jsx(Sl,{checked:y.status!=="disabled",onChange:M=>void m(y,M),title:y.status==="rejected"?n("hooks.plugins.rejectedTip"):n("hooks.plugins.toggleTip")})]})]}),E&&!A&&o.jsx("div",{className:"px-2 pb-2 pl-7",children:t(y)})]},y.id)}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[o.jsxs("p",{className:"flex items-center gap-1 text-[10px] text-neutral-600",children:[o.jsx(hS,{className:"h-3 w-3"}),n("hooks.plugins.hotReload")]}),o.jsxs("button",{type:"button",onClick:w,title:n("hooks.plugins.rescanTip"),className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-neutral-500 hover:bg-edge/[0.06] hover:text-neutral-200",children:[o.jsx(lt,{state:h.stateOf("rescan"),className:"h-3 w-3",icon:o.jsx(hS,{className:"h-3 w-3"})}),n("hooks.plugins.rescan")]})]}),o.jsx(Mi,{open:u!==null,title:n("hooks.plugins.uninstallTitle"),message:u?n("hooks.plugins.uninstallConfirm",{id:u.id}):"",confirmLabel:n("common.confirm"),onConfirm:()=>{u&&k(u)},onClose:()=>d(null)})]})}const l3="weave:canvas-bg",o3=[{id:"lines",icon:C6,label:"common.canvas.lines"},{id:"dots",icon:T6,label:"common.canvas.dots"},{id:"cross",icon:Vd,label:"common.canvas.cross"},{id:"none",icon:sM,label:"common.canvas.none"}],pK={none:"bg-neutral-950/40",sky:"bg-sky-950/55",violet:"bg-violet-950/55",emerald:"bg-emerald-950/55",amber:"bg-amber-950/55"},c3=[{id:"none",dot:"bg-neutral-500",label:"common.canvas.tintNone"},{id:"sky",dot:"bg-sky-500",label:"common.canvas.tintSky"},{id:"violet",dot:"bg-violet-500",label:"common.canvas.tintViolet"},{id:"emerald",dot:"bg-emerald-500",label:"common.canvas.tintEmerald"},{id:"amber",dot:"bg-amber-500",label:"common.canvas.tintAmber"}],mK={lines:{variant:fr.Lines,gap:16,size:1},dots:{variant:fr.Dots,gap:14,size:1},cross:{variant:fr.Cross,gap:24,size:6}},gK="rgb(var(--w-edge) / 0.12)";function bK(){const e={pattern:"lines",tint:"none"};try{const t=JSON.parse(localStorage.getItem(l3)??"null");return{pattern:o3.some(n=>n.id===(t==null?void 0:t.pattern))?t.pattern:e.pattern,tint:c3.some(n=>n.id===(t==null?void 0:t.tint))?t.tint:e.tint}}catch{return e}}let Rm=bK();const Gx=new Set;function u3(e){Rm=e;try{localStorage.setItem(l3,JSON.stringify(e))}catch{}for(const t of Gx)t()}function xK(e){u3({...Rm,pattern:e})}function yK(e){u3({...Rm,tint:e})}function vK(e){return Gx.add(e),()=>Gx.delete(e)}function kK(){return Rm}function d3(){return b.useSyncExternalStore(vK,kK)}function xk(){return pK[d3().tint]}function yk(){const{pattern:e,tint:t}=d3(),n=We(),s=e==="none"?null:mK[e];return o.jsxs(o.Fragment,{children:[s&&o.jsx(BG,{variant:s.variant,gap:s.gap,size:s.size,color:gK}),o.jsxs(rf,{position:"bottom-right",onClick:r=>r.stopPropagation(),className:"nopan flex items-center gap-0.5 rounded-md border border-edge/[0.08] bg-neutral-900/85 p-0.5 opacity-70 shadow-mac-sm backdrop-blur-sm transition-opacity hover:opacity-100 max-lg:opacity-100",children:[o3.map(({id:r,icon:i,label:a})=>o.jsx("button",{type:"button",title:n(a),"aria-label":n(a),"aria-pressed":e===r,onClick:()=>xK(r),className:de("flex h-5 w-5 items-center justify-center rounded",e===r?"bg-edge/[0.14] text-neutral-100":"text-neutral-500 hover:text-neutral-200"),children:o.jsx(i,{size:12})},r)),o.jsx("span",{className:"mx-0.5 h-3 w-px bg-edge/[0.12]"}),c3.map(({id:r,dot:i,label:a})=>o.jsx("button",{type:"button",title:n(a),"aria-label":n(a),"aria-pressed":t===r,onClick:()=>yK(r),className:de("flex h-5 w-5 items-center justify-center rounded-full border",t===r?"border-edge/50":"border-transparent hover:border-edge/25"),children:o.jsx("span",{className:de("h-2.5 w-2.5 rounded-full",i)})},r))]})]})}const f3=["log","webhook","inject","manual","plugin"],Pp={log:"hooks.handler.log",webhook:"hooks.handler.webhook",inject:"hooks.handler.inject",manual:"hooks.handler.manual",plugin:"hooks.handler.plugin"},wK={log:"hooks.handlerLogTip",webhook:"hooks.handlerWebhookTip",inject:"hooks.handlerInjectTip",manual:"hooks.handlerManualTip",plugin:"hooks.handlerPluginTip"},vk={log:pM,webhook:B6,inject:ux,manual:A6,plugin:px},SK=["hook-event","claude-event"],NK=[...en,"any"];function Xg(e){return e instanceof Error?e.message:String(e)}function KN(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function qN(){window.dispatchEvent(new Event("weave:rules-changed"))}function EK({data:e}){return o.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-neutral-900/90 px-2.5 py-1.5 shadow-mac-sm",children:[o.jsx(gm,{className:"h-3 w-3 shrink-0 text-amber-400"}),o.jsx("span",{className:"text-[11px] font-medium text-neutral-200",children:e.event}),o.jsx(Pn,{type:"source",position:Xe.Right,className:"!bg-amber-400/80"})]})}function _K({data:e}){const t=We(),n=e.rule,s=vk[n.handler.type],r=rd(n.source),i=r.kind==="webhook"?r.routeId:r.event;return o.jsxs("div",{className:de("w-[220px] rounded-lg border bg-neutral-900/90 px-3 py-2 shadow-mac-sm transition-opacity",n.enabled?"border-blue-500/40":"border-edge/[0.08] opacity-60"),children:[o.jsx(Pn,{type:"target",position:Xe.Left,className:"!bg-blue-400/80"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-100",children:n.name})}),o.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[o.jsxs(Qe,{variant:"command",className:"gap-1",children:[o.jsx(s,{className:"h-3 w-3"}),t(Pp[n.handler.type])]}),o.jsxs("span",{className:"truncate text-[10px] text-neutral-500",title:e.scopeLabel,children:[i," · ",e.scopeLabel]})]}),o.jsx(Pn,{type:"source",position:Xe.Right,className:"!bg-blue-400/80"})]})}function CK({data:e}){const t=We(),n=vk[e.handlerType];return o.jsxs("div",{className:"flex w-[170px] items-center gap-2 rounded-lg border border-edge/[0.08] bg-neutral-900/90 px-3 py-2 shadow-mac-sm",children:[o.jsx(Pn,{type:"target",position:Xe.Left,className:"!bg-blue-400/80"}),o.jsx(n,{className:"h-3.5 w-3.5 shrink-0 text-purple-300"}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-neutral-200",children:t(Pp[e.handlerType])}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:e.count}),o.jsx(Pn,{type:"source",position:Xe.Right,className:"!bg-blue-400/80"})]})}const TK={source:EK,rule:_K,handler:CK},AK=[],Qg={source:0,rule:320,handler:640},Wg=100;function MK(e,t,n){const s=[],r=[],i=new Set;for(const a of e){const l=rd(a.source);l.kind==="hook-event"&&i.add(l.event)}return NM.filter(a=>i.has(a)).forEach((a,l)=>{s.push({id:`src:${a}`,type:"source",position:{x:Qg.source,y:l*Wg},data:{event:a}})}),e.forEach((a,l)=>{const c=a.projectId===null?n("hooks.scopeGlobal"):t.get(a.projectId)??n("hooks.scopeProjectId",{id:a.projectId});s.push({id:`rule:${a.id}`,type:"rule",position:{x:Qg.rule,y:l*Wg},data:{rule:a,scopeLabel:c}});const u=rd(a.source);u.kind==="hook-event"&&r.push({id:`e:${u.event}->${a.id}`,source:`src:${u.event}`,target:`rule:${a.id}`,data:{ruleId:a.id}}),r.push({id:`e:${a.id}->${a.handler.type}`,source:`rule:${a.id}`,target:`h:${a.handler.type}`,data:{ruleId:a.id}})}),f3.filter(a=>e.some(l=>l.handler.type===a)).forEach((a,l)=>{s.push({id:`h:${a}`,type:"handler",position:{x:Qg.handler,y:l*Wg},data:{handlerType:a,count:e.filter(c=>c.handler.type===a).length}})}),{nodes:s,edges:r}}function jK(e){return{name:"",projectId:e,sourceKind:"hook-event",harness:"claude",event:"PostToolUse",toolNames:"",pathGlobs:"",crossProjectOnly:!1,handlerType:"manual",template:"",url:"",secret:"",pluginId:"",pluginHandlerType:"",record:!0,enabled:!0}}function RK(e){const t=e.handler,n=rd(e.source);return{name:e.name,projectId:e.projectId,sourceKind:e.source.kind==="claude-event"?"claude-event":"hook-event",harness:V6(e.source)??"claude",event:n.kind==="hook-event"?n.event:"PostToolUse",toolNames:(e.filter.toolNames??[]).join(", "),pathGlobs:(e.filter.pathGlobs??[]).join(", "),crossProjectOnly:e.filter.crossProjectOnly??!1,handlerType:t.type,template:t.type==="inject"||t.type==="manual"?t.template:"",url:t.type==="webhook"?t.url:"",secret:t.type==="webhook"?t.secret??"":"",pluginId:t.type==="plugin"?t.pluginId:"",pluginHandlerType:t.type==="plugin"?t.handlerType:"",record:e.record,enabled:e.enabled}}function OK(){const e=We(),{show:t}=tn(),n=dn(),[s,r]=b.useState(null),i=b.useCallback(()=>{Ce.getCapture().then(r).catch(()=>{})},[]);if(b.useEffect(()=>$r("capture",i),[i]),s===null||s.length===0)return null;const a=(l,c)=>{n.run(`capture:${l.harness}`,async()=>{const u=await Ce.putCapture(l.harness,c);r(d=>(d==null?void 0:d.map(f=>f.harness===u.harness?u:f))??d),t("success",e(c?"hooks.capture.onOk":"hooks.capture.offOk"))},{fail:u=>e("hooks.capture.fail",{error:qe(u)})})};return o.jsxs(Da,{children:[o.jsxs(Ol,{className:"flex-row items-center gap-2 space-y-0",children:[o.jsx(Dl,{className:"text-sm",children:e("hooks.capture.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:e("hooks.capture.hint")})]}),o.jsxs(Il,{className:"space-y-2",children:[s.map(l=>o.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-edge/[0.06] bg-edge/[0.015] px-2 py-1.5",children:[o.jsx(gm,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),o.jsx("span",{className:"shrink-0 text-xs font-medium text-neutral-200",children:Kn(l.harness).label}),l.installed&&!l.helperPresent&&o.jsx(Qe,{variant:"warning",title:e("hooks.capture.halfTip"),children:e("hooks.capture.half")}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-2",children:[o.jsx(lt,{state:n.stateOf(`capture:${l.harness}`),className:"h-3 w-3"}),o.jsx(Sl,{checked:l.installed,onChange:c=>a(l,c),title:e("hooks.capture.toggleTip")})]})]},l.harness)),o.jsx("p",{className:"text-[10px] text-neutral-600",children:e("hooks.capture.note")})]})]})}function DK({projectId:e,mode:t}){const n=We(),s=xk(),[r,i]=b.useState(null),[a,l]=b.useState(new Map),[c,u]=b.useState([]),[d,f]=b.useState(null),[h,p]=b.useState(null),[m,k]=b.useState(null),[w,g]=b.useState(null),y=b.useMemo(()=>new Map(c.map(_=>[_.id,_.name])),[c]),x=b.useCallback(async()=>{try{const _=t==="project",[K,T]=await Promise.all([Ce.listHooksRules(_?e:void 0),_?Ce.listHookPlugins(e):Promise.resolve(null)]);i(K),l(new Map((T==null?void 0:T.map(X=>[X.id,X.status]))??[]))}catch(_){f(Xg(_))}},[t,e]),S=b.useCallback(_=>t==="project"&&_.pluginId!=null?a.get(_.pluginId)==="active":_.enabled,[t,a]);b.useEffect(()=>{x(),Ce.listProjects().then(u).catch(()=>{})},[x]),b.useEffect(()=>{const _=()=>{x()};return window.addEventListener("weave:rules-changed",_),()=>window.removeEventListener("weave:rules-changed",_)},[x]);const A=b.useCallback(async _=>{if(w!==_){g(_);return}try{await Ce.deleteHookRule(_),g(null),(h==null?void 0:h.editingId)===_&&p(null),qN()}catch(K){f(Xg(K))}},[w,h]),[E,M,j]=LG([]),O=b.useMemo(()=>r?MK(r.filter(S),y,n):null,[r,S,y,n]),N=(O==null?void 0:O.edges)??AK;b.useEffect(()=>{O&&M(_=>{const K=new Map(_.map(T=>[T.id,T.position]));return O.nodes.map(T=>{const X=K.get(T.id);return X?{...T,position:X}:T})})},[O,M]);const F=()=>{k(null),p({editingId:null,state:jK(t==="project"?e:null)})},G=_=>{k(null),p({editingId:_.id,state:RK(_)})},H=()=>{p(null),k(null)},I=_=>p(K=>K&&{...K,state:{...K.state,..._}}),L=_=>p(K=>{if(!K)return K;let T=K.state.event;return _==="inject"&&!Ig.includes(T)&&(T="PostToolUse"),{...K,state:{...K.state,handlerType:_,event:T,record:_==="log"?!1:K.state.record}}}),C=()=>{h&&(k(null),p({...h,state:{...h.state,name:n("hooks.quickTemplateName"),event:"PostToolUse",toolNames:"",pathGlobs:"**/*.md",crossProjectOnly:!1,handlerType:"inject",template:n("hooks.quickTemplatePrompt"),url:"",secret:"",record:!0,enabled:!1}}))},D=async()=>{if(!h)return;const _=h.state,K=_.name.trim();if(!K){k(n("hooks.errNameRequired"));return}if((_.handlerType==="inject"||_.handlerType==="manual")&&!_.template.trim()){k(n("hooks.errTemplateRequired"));return}if(_.handlerType==="webhook")try{new URL(_.url.trim())}catch{k(n("hooks.errUrlRequired"));return}if(_.handlerType==="plugin"&&(!_.pluginId.trim()||!_.pluginHandlerType.trim())){k(n("hooks.errPluginRequired"));return}const T=_.handlerType==="log"?{type:"log"}:_.handlerType==="webhook"?{type:"webhook",url:_.url.trim(),..._.secret.trim()?{secret:_.secret.trim()}:{}}:_.handlerType==="plugin"?{type:"plugin",pluginId:_.pluginId.trim(),handlerType:_.pluginHandlerType.trim()}:{type:_.handlerType,template:_.template.trim()},X={},ne=KN(_.toolNames),J=KN(_.pathGlobs);ne.length&&(X.toolNames=ne),J.length&&(X.pathGlobs=J),_.crossProjectOnly&&(X.crossProjectOnly=!0);const pe=_.sourceKind==="claude-event"?{kind:"claude-event",event:_.event}:{kind:"hook-event",harness:_.harness,event:_.event},q={name:K,enabled:_.enabled,projectId:_.projectId,source:pe,filter:X,handler:T,record:_.record};try{h.editingId?await Ce.updateHookRule(h.editingId,q):await Ce.createHookRule(q),H(),f(null),qN()}catch(Y){k(Xg(Y))}},U=_=>{const K=_.filter.toolNames??[],T=_.filter.pathGlobs??[],X=rd(_.source),ne=X.kind==="webhook"?X.routeId:X.event,J=vk[_.handler.type];return o.jsxs("div",{className:de("rounded-lg border px-3 py-2 transition-colors",_.enabled?"border-edge/[0.08] bg-neutral-900/40":"border-edge/[0.05] bg-neutral-900/20 opacity-70"),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-100",children:_.name}),o.jsx(Qe,{variant:"helper",children:ne}),o.jsx("button",{type:"button",title:n("hooks.edit"),onClick:()=>G(_),className:"rounded p-1 text-neutral-500 transition-colors hover:text-neutral-200",children:o.jsx(Fv,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",title:w===_.id?n("hooks.confirmDelete"):n("hooks.delete"),onClick:()=>void A(_.id),className:de("rounded px-1.5 py-1 text-[11px] font-medium transition-colors",w===_.id?"bg-red-900/60 text-red-300":"text-neutral-500 hover:text-red-300"),children:w===_.id?n("hooks.confirmDelete"):o.jsx(er,{className:"h-3.5 w-3.5"})})]}),o.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[10px] text-neutral-500",children:[o.jsxs(Qe,{variant:"command",className:"gap-1",children:[o.jsx(J,{className:"h-3 w-3"}),n(Pp[_.handler.type])]}),o.jsx(Qe,{variant:"default",children:_.projectId===null?n("hooks.scopeGlobal"):y.has(_.projectId)?n("hooks.scopeProjectName",{name:y.get(_.projectId)}):n("hooks.scopeProjectId",{id:_.projectId})}),K.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-0.5",title:n("hooks.filterToolTip",{names:K.join(", ")}),children:[o.jsx(H6,{className:"h-3 w-3"}),K.length]}),T.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-0.5",title:n("hooks.filterPathTip",{paths:T.join(", ")}),children:[o.jsx(Yd,{className:"h-3 w-3"}),T.length]}),_.filter.crossProjectOnly&&o.jsx("span",{className:"inline-flex items-center gap-0.5",title:n("hooks.filterCrossTip"),children:o.jsx(dx,{className:"h-3 w-3"})}),K.length===0&&T.length===0&&!_.filter.crossProjectOnly&&o.jsx("span",{children:n("hooks.filterNone")})]})]},_.id)},B=(r??[]).filter(_=>!_.pluginId),R=new Map;for(const _ of r??[]){if(!_.pluginId)continue;const K=R.get(_.pluginId)??[];K.push(_),R.set(_.pluginId,K)}return o.jsxs("div",{className:"space-y-3",children:[d&&o.jsx("p",{className:"rounded-lg border border-red-500/30 bg-red-950/30 px-3 py-2 text-xs text-red-300",children:d}),t==="global"&&o.jsx(OK,{}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold tracking-tight",children:n("hooks.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:r===null?n("hooks.loading"):n("catbar.items",{n:r.length})}),t==="global"&&o.jsx("button",{type:"button",onClick:()=>h&&h.editingId===null?H():F(),className:"ml-auto inline-flex items-center gap-1 rounded-lg bg-blue-600/80 px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:h&&h.editingId===null?o.jsxs(o.Fragment,{children:[o.jsx(Vt,{className:"h-3.5 w-3.5"}),n("hooks.cancel")]}):o.jsxs(o.Fragment,{children:[o.jsx(Vd,{className:"h-3.5 w-3.5"}),n("hooks.newRule")]})})]}),o.jsxs(Da,{children:[o.jsxs(Ol,{className:"flex-row items-center gap-2 space-y-0",children:[o.jsx(Dl,{className:"text-sm",children:n("hooks.pluginsAndRules")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:n(t==="project"?"hooks.plugins.projectHint":"hooks.plugins.hint")})]}),o.jsxs(Il,{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-md border border-edge/[0.06] bg-edge/[0.015]",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[o.jsx(Oa,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("span",{className:"text-xs font-medium text-neutral-200",children:n("hooks.localRules")}),o.jsx(Qe,{variant:"skill",children:B.length})]}),o.jsx("div",{className:"space-y-2 px-3 pb-3",children:r===null?o.jsx(jm,{rows:6,className:"p-0"}):B.length===0?o.jsx("p",{className:"py-2 text-center text-xs text-neutral-500",children:n("hooks.rulesEmpty")}):B.map(U)})]}),o.jsx(hK,{projectId:t==="project"?e:void 0,renderRules:_=>(R.get(_.id)??[]).length===0?null:o.jsx("div",{className:"space-y-2",children:(R.get(_.id)??[]).map(U)})})]})]}),o.jsxs(Da,{children:[o.jsxs(Ol,{className:"flex-col gap-1.5",children:[o.jsxs("div",{className:"flex w-full items-center gap-2",children:[o.jsx(Dl,{children:n("hooks.flowTitle")}),r&&r.length===0&&o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.emptyFlow")}),r&&r.length>0&&!r.some(S)&&o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.emptyFlowDisabled")})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-neutral-500",children:[o.jsx(Zg,{icon:gm,tone:"text-amber-400",label:n("hooks.colSource")}),o.jsx(Zg,{icon:yM,tone:"text-blue-400",label:n("hooks.colRule")}),o.jsx(Zg,{icon:pM,tone:"text-purple-300",label:n("hooks.colHandler")})]})]}),o.jsx(Il,{className:"p-2",children:o.jsx("div",{className:de("h-80 rounded-lg border border-edge/[0.06]",s),children:E.length>0?o.jsxs(gk,{nodes:E,onNodesChange:j,edges:N,nodeTypes:TK,fitView:!0,minZoom:.15,maxZoom:1.5,nodesDraggable:!0,nodesConnectable:!1,deleteKeyCode:null,defaultEdgeOptions:{type:"smoothstep",style:{stroke:"rgb(var(--w-edge) / 0.25)",strokeWidth:1.5}},children:[o.jsx(yk,{}),o.jsx(bk,{showInteractive:!1})]}):o.jsx("div",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:r!==null&&!r.some(S)?n(r.length===0?"hooks.emptyFlow":"hooks.emptyFlowDisabled"):n("hooks.loading")})})})]}),h&&sn.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60"}),o.jsxs("div",{className:"relative flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-edge/[0.08] bg-neutral-900 shadow-mac",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-edge/[0.06] px-4 py-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx("h3",{className:"truncate text-sm font-semibold text-neutral-200",children:h.editingId?n("hooks.form.editTitle"):n("hooks.form.createTitle")}),!h.editingId&&o.jsx("button",{type:"button",onClick:C,title:n("hooks.quickTemplateTip"),className:"rounded-md border border-edge/[0.08] px-2 py-1 text-[11px] text-neutral-300 transition-colors hover:bg-neutral-800",children:n("hooks.quickTemplate")})]}),o.jsx("button",{type:"button",onClick:H,title:n("hooks.cancel"),className:"rounded-md p-1 text-neutral-500 transition-colors hover:text-neutral-200",children:o.jsx(Vt,{className:"h-3.5 w-3.5"})})]}),o.jsxs("div",{className:"space-y-3 overflow-y-auto px-4 py-3",children:[m&&o.jsx("p",{className:"text-xs text-red-400",children:m}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.name")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.name,onChange:_=>I({name:_.target.value}),placeholder:n("hooks.namePlaceholder")})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.project")}),o.jsxs("select",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.projectId===null?"":String(h.state.projectId),onChange:_=>I({projectId:_.target.value===""?null:Number(_.target.value)}),children:[o.jsx("option",{value:"",children:n("hooks.projectGlobal")}),c.map(_=>o.jsx("option",{value:String(_.id),children:_.name},_.id))]})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.sourceKind")}),o.jsx("select",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.sourceKind,onChange:_=>I({sourceKind:_.target.value}),children:SK.map(_=>o.jsx("option",{value:_,children:n(_==="hook-event"?"hooks.sourceKind.hookEvent":"hooks.sourceKind.legacy")},_))})]}),h.state.sourceKind==="hook-event"&&o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.harness")}),o.jsx("select",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.harness,onChange:_=>I({harness:_.target.value}),children:NK.map(_=>o.jsx("option",{value:_,children:_==="any"?n("hooks.harness.any"):Kn(_).label},_))})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.event")}),o.jsx("select",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.event,onChange:_=>I({event:_.target.value}),children:(h.state.handlerType==="inject"?Ig:NM).map(_=>o.jsx("option",{value:_,children:_},_))}),h.state.handlerType==="inject"&&o.jsx("span",{className:"block text-[10px] text-amber-400/80",children:n("hooks.eventInjectHint",{events:Ig.join(", ")})})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.handler")}),o.jsx("div",{className:"flex w-fit max-w-full flex-wrap rounded-lg border border-edge/[0.06] bg-neutral-900/60 p-0.5",children:f3.map(_=>o.jsx("button",{type:"button",title:n(wK[_]),onClick:()=>L(_),className:de("rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",h.state.handlerType===_?"bg-neutral-800 text-neutral-100 shadow-mac-sm":"text-neutral-500 hover:text-neutral-300"),children:n(Pp[_])},_))})]})]}),h.state.handlerType==="webhook"&&o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.url")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.url,onChange:_=>I({url:_.target.value}),placeholder:n("hooks.urlPlaceholder")})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.secret")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.secret,onChange:_=>I({secret:_.target.value})})]})]}),h.state.handlerType==="plugin"&&o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.pluginId")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.pluginId,onChange:_=>I({pluginId:_.target.value}),placeholder:n("hooks.pluginIdPlaceholder")})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.pluginHandlerType")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.pluginHandlerType,onChange:_=>I({pluginHandlerType:_.target.value}),placeholder:n("hooks.pluginHandlerPlaceholder")})]})]}),(h.state.handlerType==="inject"||h.state.handlerType==="manual")&&o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.template")}),o.jsx("textarea",{rows:3,className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.template,onChange:_=>I({template:_.target.value}),placeholder:n("hooks.templatePlaceholder")})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.toolNames")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.toolNames,onChange:_=>I({toolNames:_.target.value}),placeholder:n("hooks.toolNamesPlaceholder")})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.pathGlobs")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.pathGlobs,onChange:_=>I({pathGlobs:_.target.value}),placeholder:n("hooks.pathGlobsPlaceholder")})]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[o.jsx(Jg,{label:n("hooks.field.crossProjectOnly"),checked:h.state.crossProjectOnly,onChange:_=>I({crossProjectOnly:_})}),o.jsx(Jg,{label:n("hooks.field.record"),checked:h.state.record,onChange:_=>I({record:_})}),o.jsx(Jg,{label:n("hooks.field.enabled"),checked:h.state.enabled,onChange:_=>I({enabled:_})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:()=>void D(),className:"rounded-lg bg-blue-600/80 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:n("hooks.save")}),o.jsx("button",{type:"button",onClick:H,className:"rounded-lg border border-edge/[0.08] px-3 py-1.5 text-xs text-neutral-300 transition-colors hover:bg-neutral-800",children:n("hooks.cancel")})]})]})]})]}),document.body)]})}function Zg({icon:e,tone:t,label:n}){return o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(e,{className:de("h-3 w-3",t)}),n]})}function Jg({label:e,checked:t,onChange:n}){return o.jsxs("label",{className:"inline-flex cursor-pointer items-center gap-1.5 text-[11px] text-neutral-300",children:[o.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-blue-500",checked:t,onChange:s=>n(s.target.checked)}),e]})}const h3={skill:"toolkit.kind.skill",hook:"toolkit.kind.hook",mod:"toolkit.kind.mod",rule:"toolkit.kind.rule",surface:"toolkit.kind.surface"},p3={skill:"bg-emerald-900/40 text-emerald-300",hook:"bg-blue-900/40 text-blue-300",mod:"bg-purple-900/40 text-purple-300",rule:"bg-amber-900/40 text-amber-300",surface:"bg-neutral-800 text-neutral-300"},IK={builtin:"toolkit.prov.builtin",market:"toolkit.prov.market"},LK={inherit:"on",on:"off",off:"inherit"},YN={inherit:"toolkit.enableDefault",on:"toolkit.enableOn",off:"toolkit.enableOff"},Kx="__root__";function PK(e){const t=new Map;for(const n of e){const s=n.scope||Kx,r=t.get(s)??{key:s,scope:n.scope,packs:[]};r.packs.push(n),t.set(s,r)}return[...t.values()]}function zK({projectId:e,runtimeTab:t="all",scope:n="project"}){const s=We(),[r,i]=b.useState(null),[a,l]=b.useState([]),[c,u]=b.useState([]),[d,f]=b.useState(new Set),{show:h}=tn(),p=dn(),m=L=>`${L.provenance}:${L.sourceRoot}:${L.id}`,k=L=>p.stateOf(L)==="loading",w=b.useCallback(()=>{Ce.listToolkit(e).then(L=>{i(L.packs),u(L.legacyCopies??[])}).catch(L=>{i(C=>C??[]),h("error",s("toolkit.loadFailed",{error:qe(L)}))}),n==="user"&&Ce.listPluginState(e).then(l).catch(()=>{})},[e,n,s,h]);b.useEffect(()=>{w()},[w]),b.useEffect(()=>$r("toolkit",w),[w]);const g=async(L,C)=>{const D=m(L);k(D)||await p.run(D,async()=>{const U=await Ce.toggleToolkit(e,L.id,C,L.sourceRoot);U.warnings.length>0&&h("info",U.warnings.join(";")),w()},{fail:U=>s("toolkit.toggleFailed",{error:qe(U)})})},y=async L=>{const C=m(L);k(C)||await p.run(C,async()=>{const D=await Ce.install(e,{category:"plugin",name:L.name,sourceDir:L.dir,version:L.version,description:L.description,scope:"user",agent:"claude"});if(!D.ok)throw new Error(`${D.status} ${await D.text()}`);w(),h("success",s("toolkit.userInstalled",{key:L.key??L.name}))},{fail:D=>s("toolkit.installFailed",{error:qe(D)})})},x=async(L,C)=>{const D=m(L);k(D)||await p.run(D,async()=>{await Ce.putPluginState(e,"claude",L.key,"user",C),w()},{fail:U=>s("toolkit.toggleFailed",{error:qe(U)})})},S=async L=>{const C=m(L);k(C)||await p.run(C,async()=>{const D=await Ce.uninstallToolkit(e,L.id,L.sourceRoot);D.warnings.length>0&&h("info",D.warnings.join(";")),w(),h("success",s("toolkit.uninstalled",{name:L.name}))},{fail:D=>s("toolkit.uninstallFailed",{error:qe(D)})})},A=async()=>{await p.run("legacy-cleanup",async()=>{await Ce.cleanupToolkitLegacyCopies(e),w(),h("success",s("toolkit.legacyCleaned"))},{fail:L=>s("toolkit.toggleFailed",{error:qe(L)})})},E=b.useMemo(()=>r?r.filter(L=>!L.weavePack&&(t==="all"||L.targets.includes(t))):[],[r,t]),M=b.useMemo(()=>rj(E),[E]),j=L=>PK(L.groups),O=L=>{const C=j(L);return C.length===1&&C[0].key===Kx},N=M.flatMap(L=>[L.key,...O(L)?[]:j(L).map(C=>`${L.key}:${C.key}`)]),F=d.size===0,G=b.useRef(!1);b.useEffect(()=>{G.current||N.length===0||f(new Set(N))},[N.join("|")]);const H=L=>{G.current=!0,f(C=>vl(C,L))};if(r===null)return o.jsx("p",{className:"text-xs text-neutral-600",children:s("toolkit.loading")});const I=L=>{var _;const C=k(m(L)),D=n==="user"&&!!L.key,U=D?a.find(K=>K.harness==="claude"&&K.key===L.key&&K.scope==="user"):void 0,B=(U==null?void 0:U.enable)??"inherit",R=D?(U==null?void 0:U.effective)??!1:L.enabled;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-edge/[0.06] bg-edge/[0.015] px-2 py-1.5",children:[o.jsx(nd,{className:de("h-3.5 w-3.5 shrink-0",R?"text-emerald-400":"text-neutral-600")}),o.jsx("span",{className:"shrink-0 text-xs font-medium text-neutral-200",title:L.key?s("toolkit.keyTip",{scopes:((_=L.scopes)==null?void 0:_.join("+"))||s("toolkit.scopesNone")}):void 0,children:L.key??L.name}),L.id!==L.name&&o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",children:L.id}),o.jsx(Qe,{className:de("shrink-0",p3[L.kind]),children:s(h3[L.kind])}),o.jsx(Qe,{className:de("shrink-0",L.provenance==="builtin"?"bg-amber-900/40 text-amber-300":"bg-neutral-800 text-neutral-300"),children:s(IK[L.provenance])}),o.jsxs("span",{className:"shrink-0 text-[10px] text-neutral-600",children:["v",L.version]}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:s("toolkit.targets",{targets:L.targets.join("+")})}),L.weave&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:s("toolkit.weaveRules",{n:L.weave.ruleCount})}),L.description&&o.jsx("span",{className:"min-w-0 truncate text-[11px] text-neutral-500",title:L.description,children:L.description}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[o.jsx("button",{type:"button",title:s("toolkit.uninstallTip"),disabled:C,onClick:()=>void S(L),className:"rounded p-1 text-neutral-500 hover:bg-red-950/40 hover:text-red-300 disabled:opacity-40 [&_svg]:pointer-events-none",children:o.jsx(lt,{state:p.stateOf(m(L)),className:"h-3.5 w-3.5",icon:o.jsx(er,{className:"h-3.5 w-3.5"})})}),D?L.installed?o.jsxs("button",{type:"button",disabled:C,onClick:()=>void x(L,LK[B]),title:s("toolkit.enableTip",{state:s(YN[B])}),className:de("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium disabled:cursor-not-allowed [&_svg]:pointer-events-none",B==="on"?"bg-emerald-900/40 text-emerald-300 hover:bg-emerald-900/60":"bg-neutral-800 text-neutral-500 hover:bg-neutral-700"),children:[o.jsx(lt,{state:p.stateOf(m(L)),className:"h-3 w-3",icon:o.jsx(Yl,{className:"h-3 w-3"})}),s(YN[B])]}):o.jsx("button",{type:"button",disabled:C,onClick:()=>void y(L),title:s("toolkit.installTip"),className:"rounded bg-blue-900/50 px-2 py-0.5 text-[10px] text-blue-200 hover:bg-blue-800/60 disabled:opacity-40",children:s(C?"toolkit.installing":"toolkit.install")}):o.jsx(Sl,{checked:L.enabled,disabled:C,onChange:K=>void g(L,K),title:s("toolkit.toggleTip")})]})]},`${L.provenance}:${L.sourceRoot}:${L.id}`)};return o.jsxs("div",{className:"space-y-2",children:[c.length>0&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2 py-1.5",children:[o.jsx(yl,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-[11px] font-medium text-amber-300",children:s("toolkit.legacyTitle",{n:c.length})}),o.jsx("p",{className:"truncate text-[10px] text-amber-200/60",title:c.join(`
512
+ `),children:s("toolkit.legacyHint")})]}),o.jsx("button",{type:"button",className:"shrink-0 rounded border border-amber-500/40 px-2 py-0.5 text-[10px] text-amber-200 hover:bg-amber-500/20",onClick:()=>void A(),children:s("toolkit.legacyCleanup")})]}),E.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:s("toolkit.empty")}),E.length>0&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:s("toolkit.hint")}),o.jsxs("button",{type:"button",onClick:()=>{G.current=!0,f(F?new Set(N):new Set)},className:"ml-auto inline-flex shrink-0 items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-2 py-0.5 text-[11px] hover:bg-neutral-700",title:s(F?"toolkit.collapseAllGroups":"toolkit.expandAllGroups"),children:[F?o.jsx(Kd,{className:"h-3 w-3"}):o.jsx(qd,{className:"h-3 w-3"}),s(F?"toolkit.collapseAll":"toolkit.expandAll")]})]}),M.map(L=>{const C=L.namespace===void 0,D=d.has(L.key),U=L.groups.length,B=L.groups.every(R=>R.provenance==="builtin");return o.jsxs("div",{className:"rounded-2xl border border-edge/[0.08] bg-neutral-900/60 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>H(L.key),onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),f(_=>vl(_,L.key)))},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-edge/[0.03] cursor-pointer",children:[D?o.jsx(Yn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(_n,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(nd,{className:"h-3.5 w-3.5 shrink-0 text-violet-400"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-200 truncate",children:C?s("repo.local"):L.namespace}),B&&o.jsx(Qe,{className:"bg-amber-900/40 text-amber-300",children:s("toolkit.prov.builtin")}),o.jsx(od,{tone:ld(L.groups.filter(R=>R.enabled).length,L.groups.length),children:s("repo.enabledCount",{done:L.groups.filter(R=>R.enabled).length,total:L.groups.length})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",title:s("repo.namespaceTip"),children:s("repo.packCount",{n:U})})]}),!D&&o.jsx("div",{className:"px-3 pb-3 pt-1 space-y-2",children:O(L)?o.jsx("div",{className:"space-y-1.5",children:L.groups.map(I)}):j(L).map(R=>{const _=`${L.key}:${R.key}`,K=d.has(_);return o.jsxs("div",{className:"rounded-xl border border-edge/[0.06] bg-neutral-900/40 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>H(_),onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f(X=>vl(X,_)))},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-edge/[0.02] cursor-pointer",children:[K?o.jsx(Yn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(_n,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(oM,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-300 truncate",children:R.key===Kx?s("toolkit.scopeRoot"):R.scope}),o.jsx(Qe,{variant:"skill",children:R.packs.length}),[...new Set(R.packs.flatMap(T=>T.targets))].sort((T,X)=>en.indexOf(T)-en.indexOf(X)).map(T=>o.jsx(xr,{agent:T},T))]}),!K&&o.jsx("div",{className:"px-3 pb-3 pt-1 space-y-1.5",children:R.packs.map(I)})]},_)})})]},L.key)})]})}function UK({projectId:e,mode:t,runtimeTab:n}){return o.jsx("div",{className:"space-y-4",children:o.jsx(Da,{children:o.jsx(Il,{className:"space-y-1 pt-4",children:o.jsx(zK,{projectId:e,runtimeTab:n,scope:t==="global"?"user":"project"})})})},t)}const FK="application/x-weave-dispatch";function BK(e){const t=e.getData(FK);if(!t)return null;const n=Number(t);return Number.isInteger(n)&&n>0?n:null}async function lf(e){var t;if((t=navigator.clipboard)!=null&&t.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}return HK(e)}async function m3(e){const t=navigator.clipboard;if(!(t!=null&&t.write)||typeof ClipboardItem>"u")return!1;try{return await t.write([new ClipboardItem({[e.type||"image/png"]:e})]),!0}catch{return!1}}function HK(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.top="-1000px",document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length);let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return document.body.removeChild(t),n}const e0=["idle","turnEnd","messageFailed"],$K={idle:"tasks.watchKindIdle",turnEnd:"tasks.watchKindTurnEnd",messageFailed:"tasks.watchKindMessageFailed"},GK={idle:"tasks.watchKindIdleHint",turnEnd:"tasks.watchKindTurnEndHint",messageFailed:"tasks.watchKindMessageFailedHint"};function KK({label:e,current:t,busy:n,onSubscribe:s,onUnwatch:r,onClose:i}){const a=We(),[l,c]=b.useState(()=>new Set(t!=null&&t.onEvents.length?t.onEvents:e0)),[u,d]=b.useState(()=>(t==null?void 0:t.remaining)??1),[f,h]=b.useState(()=>t!=null&&t.remaining===null);b.useEffect(()=>{const m=k=>{k.key==="Escape"&&i()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i]);const p=m=>{c(k=>{const w=new Set(k);return w.has(m)?w.delete(m):w.add(m),w})};return sn.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:i,children:o.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-edge/[0.08] bg-neutral-900 p-3 shadow-mac",onClick:m=>m.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsxs("p",{className:"min-w-0 truncate text-xs font-medium text-neutral-200",children:[a("tasks.watchPickerTitle")," · ",e]}),o.jsx("button",{type:"button",title:a("tasks.messagesClose"),"aria-label":a("tasks.messagesClose"),onClick:i,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(Vt,{className:"h-3.5 w-3.5"})})]}),o.jsx("p",{className:"pb-2 text-[11px] leading-relaxed text-neutral-500",children:a("tasks.watchPickerHint")}),o.jsx("ul",{className:"space-y-1",children:e0.map(m=>{const k=l.has(m);return o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>p(m),className:de("flex w-full items-start gap-2 rounded-lg border px-2.5 py-2 text-left transition-colors",k?"border-amber-400/40 bg-amber-500/10":"border-edge/[0.06] bg-edge/[0.02] hover:border-edge/[0.16] hover:bg-edge/[0.06]"),children:[o.jsx("span",{className:de("mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border",k?"border-amber-400 bg-amber-500 text-black":"border-edge/20"),children:k&&o.jsx(mr,{className:"h-2.5 w-2.5"})}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-xs text-neutral-200",children:a($K[m])}),o.jsx("span",{className:"mt-0.5 block text-[10px] text-neutral-500",children:a(GK[m])})]})]})},m)})}),o.jsxs("div",{className:"mt-3 flex items-center gap-2 border-t border-edge/[0.06] pt-2.5",children:[o.jsx("span",{className:"text-[11px] text-neutral-400",children:a(t?"tasks.watchTimesLeft":"tasks.watchTimes")}),o.jsx(cd,{value:u,min:1,max:100,disabled:f,onChange:d,title:a(t?"tasks.watchTimesLeft":"tasks.watchTimes")}),o.jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-neutral-300",children:[o.jsx("input",{type:"checkbox",checked:f,onChange:m=>h(m.target.checked),className:"h-3 w-3 accent-blue-500"}),a("tasks.watchPersistent")]})]}),o.jsxs("div",{className:"mt-2 flex gap-1.5",children:[o.jsx("button",{type:"button",disabled:n||l.size===0,onClick:()=>s(e0.filter(m=>l.has(m)),f?null:u),className:"flex-1 rounded bg-blue-600/80 px-2.5 py-1 text-[11px] font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:a(t?"tasks.watchUpdate":"tasks.watchSubscribe")}),t&&o.jsx("button",{type:"button",disabled:n,onClick:r,className:"rounded border border-edge/[0.08] px-2.5 py-1 text-[11px] text-neutral-300 transition-colors hover:border-red-400/40 hover:text-red-300 disabled:opacity-40",children:a("tasks.watchUnwatch")})]})]})}),document.body)}const VN={plain:{w:448,h:0},preview:{w:880,h:560}},Wf={w:320,h:220},g3=(e,t)=>({w:Math.min(Math.max(Math.round(e),Wf.w),Math.max(Wf.w+40,innerWidth-32)),h:t>0?Math.min(Math.max(Math.round(t),Wf.h),Math.max(Wf.h+40,innerHeight-32)):0});function XN(e){try{const t=JSON.parse(localStorage.getItem(`weave:answer-size:${e}`)??"null");return!t||typeof t.w!="number"||typeof t.h!="number"?VN[e]:g3(t.w,t.h)}catch{return VN[e]}}function qK(e,t,n){const s=t.filter(a=>{var l;return!((l=e[a])!=null&&l.input)}),r=e.findIndex(a=>a.input),i=n.trim();return s.length===0?i&&r>=0?[r]:null:i&&r>=0?[...s,r]:s}function YK({label:e,entry:t,busy:n,onAnswer:s,onClose:r}){const i=We(),a=Si("(min-width: 1024px)"),[l,c]=b.useState({}),[u,d]=b.useState({}),[f,h]=b.useState({});b.useEffect(()=>{const D=U=>{U.key==="Escape"&&r()};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[r]);const p=t.questions.find(D=>D.submit)??null,m=t.questions.filter(D=>D!==p),k=m.some(D=>D.previewMode),w=m.length===1&&m[0].previewMode===!0,g=k?"preview":"plain",[y,x]=b.useState(()=>XN(g));b.useEffect(()=>x(XN(g)),[g]);const S=b.useRef(null),A=b.useRef(null),E=D=>{var B;const U=(B=S.current)==null?void 0:B.getBoundingClientRect();A.current={x:D.clientX,y:D.clientY,w:y.w,h:y.h||Math.round((U==null?void 0:U.height)??0)},D.currentTarget.setPointerCapture(D.pointerId)},M=D=>{const U=A.current;U&&x(g3(U.w+(D.clientX-U.x),U.h+(D.clientY-U.y)))},j=()=>{A.current&&(A.current=null,x(D=>(localStorage.setItem(`weave:answer-size:${g}`,JSON.stringify(D)),D)))},O=(D,U)=>{n||c(B=>{const R=B[D.key]??[];return D.multiSelect?{...B,[D.key]:R.includes(U)?R.filter(_=>_!==U):[...R,U]}:{...B,[D.key]:[U]}})},N=(D,U)=>{n||!p||(l[D.key]??[]).includes(U)||c(B=>({...B,[D.key]:D.multiSelect?[...B[D.key]??[],U]:[U]}))},F=D=>qK(D.options,l[D.key]??[],u[D.key]??""),G=D=>D.previewMode?F(D)??[]:l[D.key]??[],H=()=>m.filter(D=>D.previewMode?F(D)!==null:(l[D.key]??[]).length>0).map(D=>({questionKey:D.key,options:G(D),text:u[D.key]})),I=p?m.filter(D=>{if(D.options.length===0)return!1;if(D.previewMode)return F(D)===null;const U=l[D.key]??[];if(U.length===0)return!0;const B=D.options.findIndex(R=>R.input);return B>=0&&U.includes(B)&&!(u[D.key]??"").trim()}):[],L=(D,U,B)=>{n||s([...H(),{questionKey:D,options:U,text:B}])},C=(D,U)=>{const B=D.options[U];return B&&!B.input&&!B.chat?B:null};return sn.createPortal(o.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:r,children:o.jsxs("div",{ref:S,style:a?{width:y.w,height:y.h||void 0}:void 0,className:de("relative flex w-full flex-col overflow-hidden rounded-xl border border-edge/[0.08] bg-neutral-900 p-3 shadow-mac",a?"max-h-[calc(100dvh_-_2rem)]":"h-[90dvh]"),onClick:D=>D.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsxs("p",{className:"min-w-0 truncate text-xs font-medium text-neutral-200",children:[i("tasks.answerPickerTitle")," · ",e]}),o.jsx("button",{type:"button",title:i("tasks.messagesClose"),"aria-label":i("tasks.messagesClose"),onClick:r,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(Vt,{className:"h-3.5 w-3.5"})})]}),o.jsx("p",{className:"pb-2 text-[11px] leading-relaxed text-neutral-500",children:i(k?"tasks.answerPickerHintPreview":"tasks.answerPickerHint")}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto",children:m.map(D=>{var X;const U=l[D.key]??[],B=u[D.key]??"",R=D.previewMode?D.options.findIndex(ne=>ne.input):-1,_=D.previewMode?D.options.findIndex(ne=>ne.chat):-1,K=R>=0?D.options[R]:void 0,T=f[D.key]??U[0]??0;return o.jsxs("div",{className:de("rounded-lg border border-edge/[0.06] bg-edge/[0.02] p-2.5",w&&"flex min-h-0 flex-1 flex-col"),children:[D.header&&o.jsx("span",{className:"mb-1 inline-block rounded bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-medium text-blue-300",children:D.header}),o.jsx("p",{className:"whitespace-pre-wrap break-words text-xs leading-relaxed text-neutral-200",children:D.question}),D.previewMode&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:de("mt-2 flex flex-col gap-2 lg:flex-row",w&&"lg:min-h-0 lg:flex-1"),children:[o.jsx("ul",{className:"flex flex-col gap-1 lg:w-2/5 lg:shrink-0",children:D.options.map((ne,J)=>{if(!C(D,J))return null;const pe=T===J,q=U.includes(J);return o.jsx("li",{children:o.jsxs("button",{type:"button",disabled:n,onMouseEnter:()=>h(Y=>({...Y,[D.key]:J})),onFocus:()=>h(Y=>({...Y,[D.key]:J})),onClick:()=>O(D,J),className:de("flex w-full items-center gap-2 rounded-lg border px-2 py-1.5 text-left transition-colors disabled:opacity-50",q?"border-blue-400/50 bg-blue-500/10":pe?"border-edge/15 bg-edge/[0.04]":"border-edge/[0.06] bg-edge/[0.02] hover:bg-edge/[0.04]"),children:[o.jsx("span",{className:"w-2.5 shrink-0 text-neutral-500",children:pe?"›":""}),o.jsxs("span",{className:"shrink-0 text-[11px] text-neutral-500",children:[J+1,"."]}),o.jsx("span",{className:de("min-w-0 flex-1 truncate text-xs",q?"text-blue-200":"text-neutral-200"),children:ne.label}),q&&o.jsx(mr,{className:"h-3 w-3 shrink-0 text-blue-300"})]})},J)})}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5 lg:min-h-0",children:[o.jsx("pre",{className:de("overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-edge/[0.06] bg-neutral-950 px-2.5 py-2 font-mono text-[11px] leading-relaxed text-neutral-300",w?"h-40 lg:min-h-0 lg:flex-1":"h-40 lg:h-60"),children:((X=D.options[T])==null?void 0:X.preview)??""}),K&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"shrink-0 text-[11px] text-neutral-400",children:K.label}),o.jsx("input",{value:B,disabled:n,placeholder:K.description??K.label,onChange:ne=>{const J=ne.target.value;d(pe=>({...pe,[D.key]:J}))},onKeyDown:ne=>{if(ne.key!=="Enter"||n)return;ne.preventDefault();const J=F(D);!p&&J&&L(D.key,J,B)},className:"min-w-0 flex-1 rounded border border-edge/[0.08] bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-edge/20 focus:outline-none disabled:opacity-50"})]})]})]}),_>=0&&o.jsxs("button",{type:"button",disabled:n,onClick:()=>L(D.key,[_]),className:"mt-2 flex w-full items-center gap-2 rounded-lg px-2 py-1 text-left text-xs text-neutral-400 transition-colors hover:bg-edge/[0.06] hover:text-neutral-200 disabled:opacity-50",children:[o.jsx("span",{className:"w-2.5 shrink-0",children:"·"}),o.jsx("span",{children:D.options[_].label}),n&&o.jsx(gn,{className:"h-3 w-3 animate-spin text-blue-300"})]}),!p&&o.jsx("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-edge/[0.06] pt-2",children:o.jsxs("button",{type:"button",disabled:n||F(D)===null,onClick:()=>{const ne=F(D);ne&&L(D.key,ne,B)},className:"flex items-center gap-1 rounded bg-blue-700/80 px-2.5 py-1 text-[11px] font-medium text-white transition-colors hover:bg-blue-600 disabled:opacity-40",children:[i("tasks.answerSend"),n&&o.jsx(gn,{className:"h-3 w-3 animate-spin"})]})})]}),!D.previewMode&&D.options.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:D.options.map((ne,J)=>{const pe=U.includes(J),q=o.jsx("span",{className:de("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border text-[10px] font-semibold leading-none",pe?"border-blue-400/40 bg-blue-500/15 text-blue-200":"border-edge/15 bg-neutral-950 text-neutral-300"),children:J+1});return ne.input?o.jsx("li",{children:o.jsxs("div",{onClick:()=>N(D,J),className:de("flex items-center gap-2 rounded-lg border px-2.5 py-1.5",pe?"border-blue-400/50 bg-blue-500/10":"border-edge/[0.06] bg-edge/[0.02]"),children:[p?o.jsx("button",{type:"button",disabled:n,onClick:Y=>{Y.stopPropagation(),O(D,J)},"aria-label":ne.label,className:"shrink-0 disabled:opacity-50",children:q}):q,o.jsx("input",{value:B,disabled:n,placeholder:ne.description??ne.label,onChange:Y=>{const V=Y.target.value;d(ee=>({...ee,[D.key]:V})),p&&N(D,J)},onKeyDown:Y=>{Y.key!=="Enter"||n||(Y.preventDefault(),!p&&B.trim()&&L(D.key,[J],B))},className:"min-w-0 flex-1 rounded border border-edge/[0.08] bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-edge/20 focus:outline-none disabled:opacity-50"}),!p&&o.jsx("button",{type:"button",disabled:n||!B.trim(),onClick:()=>L(D.key,[J],B),className:"shrink-0 rounded bg-blue-700/80 px-2 py-0.5 text-[10px] font-medium text-white transition-colors hover:bg-blue-600 disabled:opacity-40",children:i("tasks.answerSend")}),n&&o.jsx(gn,{className:"h-3 w-3 shrink-0 animate-spin text-blue-300"})]})},J):o.jsx("li",{children:o.jsxs("button",{type:"button",disabled:n,onClick:()=>p&&!ne.chat?O(D,J):L(D.key,[J]),className:de("flex w-full items-start gap-2 rounded-lg border px-2.5 py-1.5 text-left transition-colors disabled:opacity-50",pe?"border-blue-400/50 bg-blue-500/10":"border-edge/[0.06] bg-edge/[0.02] hover:border-blue-400/40 hover:bg-blue-500/10"),children:[q,o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-xs text-neutral-200",children:ne.label}),ne.description&&o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-neutral-500",children:ne.description})]}),(pe||n)&&o.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-1",children:[pe&&!ne.chat&&o.jsx(mr,{className:"h-3 w-3 text-blue-300"}),n&&o.jsx(gn,{className:"h-3 w-3 animate-spin text-blue-300"})]})]})},J)})})]},D.key)})}),p&&o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 border-t border-edge/[0.06] pt-2",children:[I.length>0&&o.jsx("span",{className:"min-w-0 flex-1 text-[10px] leading-relaxed text-amber-300/80",children:i("tasks.answerIncomplete",{n:I.length})}),o.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:p.options.map((D,U)=>o.jsxs("button",{type:"button",disabled:n||U===0&&I.length>0,onClick:()=>L(p.key,[U]),className:de("flex items-center gap-1 rounded px-2.5 py-1 text-[11px] font-medium transition-colors disabled:opacity-40",U===0?"bg-blue-700/80 text-white hover:bg-blue-600":"border border-edge/[0.08] bg-edge/[0.02] text-neutral-300 hover:bg-edge/[0.08]"),children:[D.label,n&&U===0&&o.jsx(gn,{className:"h-3 w-3 animate-spin"})]},U))})]}),a&&o.jsx("div",{role:"separator",title:i("app.resizeDialog"),"aria-label":i("app.resizeDialog"),onPointerDown:E,onPointerMove:M,onPointerUp:j,onPointerCancel:j,onClick:D=>D.stopPropagation(),className:"absolute bottom-0 right-0 h-4 w-4 cursor-nwse-resize touch-none",children:o.jsx("span",{className:"pointer-events-none absolute bottom-1 right-1 h-2 w-2 rounded-br border-b border-r border-edge/20"})})]})}),document.body)}function kk({status:e,harness:t}){return e==="open"||Io(e)?o.jsx(Rl,{harness:t,running:Io(e)}):o.jsx("span",{className:de("h-2 w-2 shrink-0 rounded-full",aU[e])})}const qa="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-edge/[0.08] bg-edge/[0.02] text-neutral-500 transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08] hover:text-neutral-200",VK=6e4,XK=450;function QK(e,t){return e.autoDeleteAt==null?0:Date.parse(e.autoDeleteAt)-Math.max(t,Date.parse(e.lastSeenAt))}function qx(e,t,n){const s=new Date(t),r=new Date(n);if(s.toDateString()===r.toDateString())return s.toLocaleTimeString();const i=new Date(n);return i.setDate(i.getDate()-1),s.toDateString()===i.toDateString()?e("tasks.yesterday"):s.getFullYear()===r.getFullYear()?`${s.getMonth()+1}/${s.getDate()}`:`${s.getFullYear()}/${s.getMonth()+1}/${s.getDate()}`}function WK(e,t){const n=Math.max(0,t);if(n<6e4)return e("tasks.autoDeleteSoon");const s=Math.ceil(n/36e5);if(s>=24)return e("tasks.autoDeleteInDays",{n:Math.ceil(n/864e5)});const r=Math.ceil(n/6e4);return r>=60?e("tasks.autoDeleteInHours",{n:s}):e("tasks.autoDeleteInMinutes",{n:r})}function b3(e,t){return Date.parse(t.lastSeenAt)-Date.parse(e.lastSeenAt)||Date.parse(t.createdAt)-Date.parse(e.createdAt)}function ZK(e){const t=[],n=new Map;for(const s of e){const r=s.terminal;if(!r){t.push({kind:"row",row:s});continue}let i=n.get(r.id);i||(i={kind:"block",terminal:r,rows:[]},n.set(r.id,i),t.push(i)),i.rows.push(s)}return t.map(s=>s.kind==="block"&&s.rows.length===1?{kind:"row",row:s.rows[0]}:s)}function JK(e,t){const n=new Set(t),s=e.filter(a=>n.has(a)),r=new Set(s);return[...t.filter(a=>!r.has(a)),...s]}function QN(e,t){return e.length===t.length&&e.every((n,s)=>n===t[s])}function x3(e,t){const n=b.useRef(e);n.current=e;const[s,r]=b.useState(e),i=b.useRef(t);return b.useLayoutEffect(()=>{if(i.current!==t){i.current=t,r(e);return}r(a=>{const l=JK(a,e);return QN(a,l)?a:l})},[e,t]),b.useEffect(()=>{const a=window.setInterval(()=>{r(l=>QN(l,n.current)?l:n.current)},VK);return()=>window.clearInterval(a)},[]),s}function y3(e){const t=b.useRef(new Map);b.useLayoutEffect(()=>{const n=e.current;if(n.size===0){t.current=new Map;return}const s=t.current,r=new Map,i=[];for(const[a,l]of n){const c=l.offsetTop;r.set(a,c);const u=s.get(a);u!==void 0&&Math.abs(u-c)>=1&&i.push([l,u-c])}if(t.current=r,i.length!==0){for(const[a]of i)a.style.transition="none";for(const[a,l]of i)a.style.transform=`translateY(${l}px)`;i[0][0].offsetHeight;for(const[a]of i)a.style.transition=`transform ${XK}ms cubic-bezier(0.2, 0, 0, 1)`,a.style.transform=""}})}function eq({sessions:e,statuses:t,selectedId:n,highlightId:s,onSelect:r,onRename:i,onDropDispatch:a,onOpenTerminal:l,openTerminalStateOf:c,onClosePane:u,closePaneStateOf:d,capabilities:f,inflightOf:h,questionOf:p,onAnswer:m,answerStateOf:k,answerFor:w,onSetAnswerFor:g,watchOf:y,watchStateOf:x,onSubscribeWatch:S,onUnwatch:A,onDelete:E,deleteStateOf:M}){var se;const j=We(),{show:O}=tn(),N=Q=>Q.tabsInWindow>1?j("tasks.terminalBlockTab",{w:Q.windowId,t:Q.tabId}):j("tasks.terminalBlock",{w:Q.windowId}),[F,G]=b.useState(null),[H,I]=b.useState(null),[L,C]=b.useState(""),[D,U]=b.useState(null),[B,R]=b.useState(null),_=b.useRef(null),K=b.useMemo(()=>e.slice().sort(b3).map(Q=>Q.sessionId),[e]),T=x3(K),X=b.useMemo(()=>{const Q=new Map(e.map(ge=>[ge.sessionId,ge])),Te=[];for(const ge of T){const $e=Q.get(ge);$e&&Te.push($e)}const xe=new Set(Te.map(ge=>ge.sessionId));return[...e.filter(ge=>!xe.has(ge.sessionId)),...Te]},[e,T]),ne=b.useRef(new Map);y3(ne);const[J,pe]=b.useState(()=>Date.now()),q=e.some(Q=>Q.autoDeleteAt!=null);b.useEffect(()=>{if(!q)return;const Q=window.setInterval(()=>pe(Date.now()),3e4);return()=>window.clearInterval(Q)},[q]),b.useEffect(()=>{var Q;H&&((Q=_.current)==null||Q.focus())},[H]);const Y=Q=>{I(Q.sessionId),C(Q.title??"")},V=()=>{H&&L.trim()&&i(H,L.trim()),I(null)},ee=Q=>{lf(Q).then(Te=>{if(!Te){O("error",j("common.copyFailed"));return}U(Q),window.setTimeout(()=>U(null),1500)})},oe=Q=>Te=>{Te?ne.current.set(Q,Te):ne.current.delete(Q)},ye=Q=>{var te;const Te=t.get(Q.sessionId)??"open",xe=Q.sessionId===n,ve=Q.harness!=null?f==null?void 0:f.get(Q.harness):void 0,ge=y==null?void 0:y(Q.sessionId),$e=h(Q.sessionId),dt=(c==null?void 0:c(Q.sessionId))??"idle",mt=(d==null?void 0:d(Q.sessionId))??"idle",rt=(((te=p==null?void 0:p(Q.sessionId))==null?void 0:te.questions)??[]).filter(re=>!re.submit).length,ct=Q.transcriptPresent===!1;return o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>r(Q.sessionId),onKeyDown:re=>{(re.key==="Enter"||re.key===" ")&&(re.preventDefault(),r(Q.sessionId))},onDoubleClick:re=>{re.stopPropagation(),H!==Q.sessionId&&Y(Q)},onDragOver:re=>{re.preventDefault(),R(Q.sessionId)},onDragLeave:()=>R(re=>re===Q.sessionId?null:re),onDrop:re=>{re.preventDefault(),R(null);const Ae=BK(re.dataTransfer);Ae!==null&&a(Ae,Q.sessionId)},title:B===Q.sessionId?j("tasks.dropTip"):Sn(Q.title,Q.sessionId),className:de("group flex flex-wrap cursor-pointer items-center gap-x-2 gap-y-1 rounded-xl border p-2 transition-colors",xe?"border-blue-500/50 bg-blue-500/10":"border-edge/[0.06] bg-neutral-900/50 hover:border-edge/[0.10] hover:bg-edge/[0.04]",s===Q.sessionId&&"border-rose-400/70",B===Q.sessionId&&"border-dashed border-blue-400/70 bg-blue-500/10"),children:[o.jsx(kk,{status:Te,harness:Q.harness}),$e>0&&o.jsxs("span",{title:j("tasks.messageInflight",{n:$e}),className:"inline-flex shrink-0 items-center gap-0.5 rounded border border-amber-400/40 bg-amber-500/10 px-1 py-0.5 text-[10px] font-semibold leading-none text-amber-300",children:[o.jsx(fM,{className:"h-3 w-3"}),$e>9?"9+":$e]}),H===Q.sessionId?o.jsx("input",{ref:_,value:L,onChange:re=>C(re.target.value),onBlur:V,onKeyDown:re=>{re.key==="Enter"&&V(),re.key==="Escape"&&I(null)},onClick:re=>re.stopPropagation(),placeholder:j("tasks.renamePlaceholder"),className:"min-w-0 flex-1 rounded border border-blue-500/40 bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-100 focus:outline-none"}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-200",children:Sn(Q.title,Q.sessionId)}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 [&_svg]:pointer-events-none",children:[Q.canOpenTerminal&&o.jsx("button",{type:"button",disabled:ct||!!Q.pidAlive||dt==="loading",title:ct?j("tasks.transcriptMissingTip"):Q.pidAlive?j("tasks.sessionTerminalRunning"):j("tasks.openSessionTerminal"),onClick:re=>{re.stopPropagation(),l(Q.sessionId)},className:de(qa,(ct||Q.pidAlive||dt==="loading")&&"disabled:cursor-not-allowed hover:border-edge/[0.08] hover:bg-edge/[0.02] hover:text-neutral-500"),children:o.jsx(lt,{state:dt,className:"h-3 w-3",icon:o.jsx(pS,{className:de("h-3 w-3",Q.pidAlive&&"text-emerald-400")})})}),!!Q.pidAlive&&o.jsx("button",{type:"button",title:j("tasks.closePaneTooltip"),onClick:re=>{re.stopPropagation(),u(Q.sessionId)},className:de(qa,"text-red-400 hover:border-red-500/30 hover:bg-red-500/10 hover:text-red-300"),children:o.jsx(lt,{state:mt,className:"h-3 w-3",icon:o.jsx(Yl,{className:"h-3 w-3"})})}),(p==null?void 0:p(Q.sessionId))&&o.jsxs("button",{type:"button",title:j("tasks.answerActiveTooltip",{n:rt}),onClick:re=>{re.stopPropagation(),g(Q.sessionId)},className:de(qa,"relative","border-amber-400/40 bg-amber-500/10 text-amber-300 hover:border-amber-400/60 hover:text-amber-200"),children:[o.jsx(aM,{className:"h-3 w-3 text-amber-300"}),o.jsx("span",{"aria-hidden":!0,className:"absolute -right-1 -top-1 flex h-3 min-w-3 items-center justify-center rounded-full bg-amber-500 px-0.5 text-[8px] font-semibold leading-none text-black",children:rt})]}),(ve==null?void 0:ve.watch)&&o.jsxs("button",{type:"button",title:ge?j("tasks.watchActiveTooltip",{n:ge.remaining===null?"∞":String(ge.remaining)}):j("tasks.watchTooltip"),onClick:re=>{re.stopPropagation(),G(Q.sessionId)},className:de(qa,"relative"),children:[o.jsx(lt,{state:(x==null?void 0:x(Q.sessionId))??"idle",className:"h-3 w-3",icon:ge?o.jsx(m6,{className:"h-3 w-3 text-amber-300"}):o.jsx(rM,{className:"h-3 w-3"})}),ge&&o.jsx("span",{"aria-hidden":!0,className:"absolute -right-1.5 -top-1 flex h-3 min-w-3 items-center justify-center rounded-full bg-amber-500 px-0.5 text-[8px] font-semibold leading-none text-black",children:ge.remaining===null?"∞":ge.remaining})]}),o.jsx("button",{type:"button",title:j("tasks.renameTip"),onClick:re=>{re.stopPropagation(),Y(Q)},className:qa,children:o.jsx(Fv,{className:"h-3 w-3"})}),o.jsx("button",{type:"button",title:D===Q.sessionId?j("tasks.copied"):j("tasks.copySessionId"),onClick:re=>{re.stopPropagation(),ee(Q.sessionId)},className:qa,children:D===Q.sessionId?o.jsx(mr,{className:"h-3 w-3 text-emerald-400"}):o.jsx(Ta,{className:"h-3 w-3"})}),o.jsx("button",{type:"button",title:j("tasks.deleteTooltip"),"aria-label":j("tasks.deleteSession"),onClick:re=>{re.stopPropagation(),E(Q.sessionId)},className:de(qa,"hover:text-red-400"),children:o.jsx(lt,{state:(M==null?void 0:M(Q.sessionId))??"idle",className:"h-3 w-3",icon:o.jsx(er,{className:"h-3 w-3"})})})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 basis-full",children:[Q.pendingTitle&&o.jsx(Qe,{title:j("tasks.renamePendingTip"),className:"shrink-0 bg-amber-900/40 text-amber-300",children:j("tasks.pendingTitle")}),ct&&o.jsxs(Qe,{title:j("tasks.transcriptMissingTip"),className:"shrink-0 gap-1 bg-rose-900/40 text-rose-300",children:[o.jsx(E6,{className:"h-3 w-3"}),j("tasks.transcriptMissing")]}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:j("tasks.events",{n:Q.eventCount??0})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:qx(j,Q.lastSeenAt,J)}),Q.harness&&o.jsx(xr,{agent:Q.harness,className:"shrink-0 px-1 text-[10px]"}),o.jsx(Qe,{className:de("shrink-0",ej[Te]),children:j(JM[Te])}),Q.autoDeleteAt&&o.jsx(Qe,{className:"shrink-0 bg-neutral-800/80 text-neutral-400",children:WK(j,QK(Q,J))})]})]})]})},Re=b.useMemo(()=>ZK(X),[X]);return o.jsxs("ul",{className:"space-y-1.5",children:[Re.map(Q=>Q.kind==="row"?o.jsx("li",{ref:oe(Q.row.sessionId),children:ye(Q.row)},Q.row.sessionId):o.jsxs("li",{className:"rounded-xl border border-edge/[0.06] bg-edge/[0.02] p-2",children:[o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 text-[10px] text-neutral-400",children:[o.jsx(pS,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"font-medium",children:N(Q.terminal)}),o.jsx("span",{className:"text-neutral-500",children:j("tasks.terminalBlockSessions",{n:Q.rows.length})})]}),o.jsx("ul",{className:"space-y-1.5",children:Q.rows.map(Te=>o.jsx("li",{ref:oe(Te.sessionId),children:ye(Te)},Te.sessionId))})]},`terminal:${Q.terminal.id}`)),w&&(()=>{var Te;const Q=p==null?void 0:p(w);return!Q||Q.questions.length===0?null:o.jsx(YK,{label:Sn(((Te=e.find(xe=>xe.sessionId===w))==null?void 0:Te.title)??null,w),entry:Q,busy:(k==null?void 0:k(w))==="loading",onAnswer:xe=>m==null?void 0:m(w,xe),onClose:()=>g(null)})})(),F&&o.jsx(KK,{label:Sn(((se=e.find(Q=>Q.sessionId===F))==null?void 0:se.title)??null,F),current:(y==null?void 0:y(F))??null,busy:(x==null?void 0:x(F))==="loading",onSubscribe:(Q,Te)=>{G(null),S(F,Q,Te)},onUnwatch:()=>{G(null),A(F)},onClose:()=>G(null)})]})}function tq(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const nq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rq={};function WN(e,t){return(rq.jsx?sq:nq).test(e)}const iq=/[ \t\n\f\r]/g;function aq(e){return typeof e=="object"?e.type==="text"?ZN(e.value):!1:ZN(e)}function ZN(e){return e.replace(iq,"")===""}let of=class{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}};of.prototype.normal={};of.prototype.property={};of.prototype.space=void 0;function v3(e,t){const n={},s={};for(const r of e)Object.assign(n,r.property),Object.assign(s,r.normal);return new of(n,s,t)}function Yx(e){return e.toLowerCase()}class vs{constructor(t,n){this.attribute=n,this.property=t}}vs.prototype.attribute="";vs.prototype.booleanish=!1;vs.prototype.boolean=!1;vs.prototype.commaOrSpaceSeparated=!1;vs.prototype.commaSeparated=!1;vs.prototype.defined=!1;vs.prototype.mustUseProperty=!1;vs.prototype.number=!1;vs.prototype.overloadedBoolean=!1;vs.prototype.property="";vs.prototype.spaceSeparated=!1;vs.prototype.space=void 0;let lq=0;const it=Vl(),fn=Vl(),Vx=Vl(),Le=Vl(),zt=Vl(),Nl=Vl(),Ss=Vl();function Vl(){return 2**++lq}const Xx=Object.freeze(Object.defineProperty({__proto__:null,boolean:it,booleanish:fn,commaOrSpaceSeparated:Ss,commaSeparated:Nl,number:Le,overloadedBoolean:Vx,spaceSeparated:zt},Symbol.toStringTag,{value:"Module"})),t0=Object.keys(Xx);class wk extends vs{constructor(t,n,s,r){let i=-1;if(super(t,n),JN(this,"space",r),typeof s=="number")for(;++i<t0.length;){const a=t0[i];JN(this,t0[i],(s&Xx[a])===Xx[a])}}}wk.prototype.defined=!0;function JN(e,t,n){n&&(e[t]=n)}function Ic(e){const t={},n={};for(const[s,r]of Object.entries(e.properties)){const i=new wk(s,e.transform(e.attributes||{},s),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(i.mustUseProperty=!0),t[s]=i,n[Yx(s)]=s,n[Yx(i.attribute)]=s}return new of(t,n,e.space)}const k3=Ic({properties:{ariaActiveDescendant:null,ariaAtomic:fn,ariaAutoComplete:null,ariaBusy:fn,ariaChecked:fn,ariaColCount:Le,ariaColIndex:Le,ariaColSpan:Le,ariaControls:zt,ariaCurrent:null,ariaDescribedBy:zt,ariaDetails:null,ariaDisabled:fn,ariaDropEffect:zt,ariaErrorMessage:null,ariaExpanded:fn,ariaFlowTo:zt,ariaGrabbed:fn,ariaHasPopup:null,ariaHidden:fn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:zt,ariaLevel:Le,ariaLive:null,ariaModal:fn,ariaMultiLine:fn,ariaMultiSelectable:fn,ariaOrientation:null,ariaOwns:zt,ariaPlaceholder:null,ariaPosInSet:Le,ariaPressed:fn,ariaReadOnly:fn,ariaRelevant:null,ariaRequired:fn,ariaRoleDescription:zt,ariaRowCount:Le,ariaRowIndex:Le,ariaRowSpan:Le,ariaSelected:fn,ariaSetSize:Le,ariaSort:null,ariaValueMax:Le,ariaValueMin:Le,ariaValueNow:Le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function w3(e,t){return t in e?e[t]:t}function S3(e,t){return w3(e,t.toLowerCase())}const oq=Ic({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nl,acceptCharset:zt,accessKey:zt,action:null,allow:null,allowFullScreen:it,allowPaymentRequest:it,allowUserMedia:it,alpha:it,alt:null,as:null,async:it,autoCapitalize:null,autoComplete:zt,autoFocus:it,autoPlay:it,blocking:zt,capture:null,charSet:null,checked:it,cite:null,className:zt,closedBy:null,colorSpace:null,cols:Le,colSpan:Le,command:null,commandFor:null,content:null,contentEditable:fn,controls:it,controlsList:zt,coords:Le|Nl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:it,defer:it,dir:null,dirName:null,disabled:it,download:Vx,draggable:fn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:it,formTarget:null,headers:zt,height:Le,hidden:Vx,high:Le,href:null,hrefLang:null,htmlFor:zt,httpEquiv:zt,id:null,imageSizes:null,imageSrcSet:null,inert:it,inputMode:null,integrity:null,is:null,isMap:it,itemId:null,itemProp:zt,itemRef:zt,itemScope:it,itemType:zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:it,low:Le,manifest:null,max:null,maxLength:Le,media:null,method:null,min:null,minLength:Le,multiple:it,muted:it,name:null,nonce:null,noModule:it,noValidate:it,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:it,optimum:Le,pattern:null,ping:zt,placeholder:null,playsInline:it,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:it,referrerPolicy:null,rel:zt,required:it,reversed:it,rows:Le,rowSpan:Le,sandbox:zt,scope:null,scoped:it,seamless:it,selected:it,shadowRootClonable:it,shadowRootCustomElementRegistry:it,shadowRootDelegatesFocus:it,shadowRootMode:null,shadowRootSerializable:it,shape:null,size:Le,sizes:null,slot:null,span:Le,spellCheck:fn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Le,step:null,style:null,tabIndex:Le,target:null,title:null,translate:null,type:null,typeMustMatch:it,useMap:null,value:fn,width:Le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:zt,axis:null,background:null,bgColor:null,border:Le,borderColor:null,bottomMargin:Le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:it,declare:it,event:null,face:null,frame:null,frameBorder:null,hSpace:Le,leftMargin:Le,link:null,longDesc:null,lowSrc:null,marginHeight:Le,marginWidth:Le,noResize:it,noHref:it,noShade:it,noWrap:it,object:null,profile:null,prompt:null,rev:null,rightMargin:Le,rules:null,scheme:null,scrolling:fn,standby:null,summary:null,text:null,topMargin:Le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:it,disablePictureInPicture:it,disableRemotePlayback:it,exportParts:Nl,part:zt,prefix:null,property:null,results:Le,security:null,unselectable:null},space:"html",transform:S3}),cq=Ic({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",maskType:"mask-type",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:Ss,accentHeight:Le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Le,amplitude:Le,arabicForm:null,ascent:Le,attributeName:null,attributeType:null,azimuth:Le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Le,by:null,calcMode:null,capHeight:Le,className:zt,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:Le,diffuseConstant:Le,direction:null,display:null,dur:null,divisor:Le,dominantBaseline:null,download:it,dx:null,dy:null,edgeMode:null,editable:null,elevation:Le,enableBackground:null,end:null,event:null,exponent:Le,externalResourcesRequired:null,fill:null,fillOpacity:Le,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:Nl,g2:Nl,glyphName:Nl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Le,horizOriginX:Le,horizOriginY:Le,id:null,ideographic:Le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Le,k:Le,k1:Le,k2:Le,k3:Le,k4:Le,kernelMatrix:Ss,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Le,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:Le,overlineThickness:Le,paintOrder:null,panose1:null,path:null,pathLength:Le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Le,pointsAtY:Le,pointsAtZ:Le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ss,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ss,rev:Ss,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ss,requiredFeatures:Ss,requiredFonts:Ss,requiredFormats:Ss,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:Le,specularExponent:Le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Le,strikethroughThickness:Le,string:null,stroke:null,strokeDashArray:Ss,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Le,strokeOpacity:Le,strokeWidth:null,style:null,surfaceScale:Le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ss,tabIndex:Le,tableValues:null,target:null,targetX:Le,targetY:Le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ss,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Le,underlineThickness:Le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Le,values:null,vAlphabetic:Le,vMathematical:Le,vectorEffect:null,vHanging:Le,vIdeographic:Le,version:null,vertAdvY:Le,vertOriginX:Le,vertOriginY:Le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:w3}),N3=Ic({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()}}),E3=Ic({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:S3}),_3=Ic({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uq={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"},dq=/[A-Z]/g,eE=/-[a-z]/g,fq=/^data[-\w.:]+$/i;function hq(e,t){const n=Yx(t);let s=t,r=vs;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fq.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(eE,mq);s="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!eE.test(i)){let a=i.replace(dq,pq);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}r=wk}return new r(s,t)}function pq(e){return"-"+e.toLowerCase()}function mq(e){return e.charAt(1).toUpperCase()}const gq=v3([k3,oq,N3,E3,_3],"html"),Sk=v3([k3,cq,N3,E3,_3],"svg");function bq(e){return e.join(" ").trim()}var C3={},tE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,xq=/\n/g,yq=/^\s*/,vq=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,kq=/^:\s*/,wq=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Sq=/^[;\s]*/,Nq=/^\s+|\s+$/g,Eq=`
513
+ `,nE="/",sE="*",tl="",_q="comment",Cq="declaration",Tq=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,s=1;function r(m){var k=m.match(xq);k&&(n+=k.length);var w=m.lastIndexOf(Eq);s=~w?m.length-w:s+m.length}function i(){var m={line:n,column:s};return function(k){return k.position=new a(m),u(),k}}function a(m){this.start=m,this.end={line:n,column:s},this.source=t.source}a.prototype.content=e;function l(m){var k=new Error(t.source+":"+n+":"+s+": "+m);if(k.reason=m,k.filename=t.source,k.line=n,k.column=s,k.source=e,!t.silent)throw k}function c(m){var k=m.exec(e);if(k){var w=k[0];return r(w),e=e.slice(w.length),k}}function u(){c(yq)}function d(m){var k;for(m=m||[];k=f();)k!==!1&&m.push(k);return m}function f(){var m=i();if(!(nE!=e.charAt(0)||sE!=e.charAt(1))){for(var k=2;tl!=e.charAt(k)&&(sE!=e.charAt(k)||nE!=e.charAt(k+1));)++k;if(k+=2,tl===e.charAt(k-1))return l("End of comment missing");var w=e.slice(2,k-2);return s+=2,r(w),e=e.slice(k),s+=2,m({type:_q,comment:w})}}function h(){var m=i(),k=c(vq);if(k){if(f(),!c(kq))return l("property missing ':'");var w=c(wq),g=m({type:Cq,property:rE(k[0].replace(tE,tl)),value:w?rE(w[0].replace(tE,tl)):tl});return c(Sq),g}}function p(){var m=[];d(m);for(var k;k=h();)k!==!1&&(m.push(k),d(m));return m}return u(),p()};function rE(e){return e?e.replace(Nq,tl):tl}var Aq=Tq;function Mq(e,t){var n=null;if(!e||typeof e!="string")return n;for(var s,r=Aq(e),i=typeof t=="function",a,l,c=0,u=r.length;c<u;c++)s=r[c],a=s.property,l=s.value,i?t(a,l,s):l&&(n||(n={}),n[a]=l);return n}var jq=Mq,Om={};Om.__esModule=!0;Om.camelCase=void 0;var Rq=/^--[a-zA-Z0-9-]+$/,Oq=/-([a-z])/g,Dq=/^[^-]+$/,Iq=/^-(webkit|moz|ms|o)-/,Lq=function(e){return!e||Dq.test(e)||Rq.test(e)?e:e.toLowerCase().replace(Iq,function(t,n){return n+"-"}).replace(Oq,function(t,n){return n.toUpperCase()})};Om.camelCase=Lq;(function(e){var t=bw&&bw.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};e.__esModule=!0;var n=t(jq),s=Om;function r(i){if(!i||typeof i!="string")return{};var a={};return n.default(i,function(l,c){l&&c&&(a[s.camelCase(l)]=c)}),a}e.default=r})(C3);const Pq=Cd(C3),T3=A3("end"),Nk=A3("start");function A3(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function zq(e){const t=Nk(e),n=T3(e);if(t&&n)return{start:t,end:n}}function Du(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?iE(e.position):"start"in e||"end"in e?iE(e):"line"in e||"column"in e?Qx(e):""}function Qx(e){return aE(e&&e.line)+":"+aE(e&&e.column)}function iE(e){return Qx(e&&e.start)+"-"+Qx(e&&e.end)}function aE(e){return e&&typeof e=="number"?e:1}class Vn extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let r="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?r=t:!i.cause&&t&&(a=!0,r=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?i.ruleId=s:(i.source=s.slice(0,c),i.ruleId=s.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=Du(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}}Vn.prototype.file="";Vn.prototype.name="";Vn.prototype.reason="";Vn.prototype.message="";Vn.prototype.stack="";Vn.prototype.column=void 0;Vn.prototype.line=void 0;Vn.prototype.ancestors=void 0;Vn.prototype.cause=void 0;Vn.prototype.fatal=void 0;Vn.prototype.place=void 0;Vn.prototype.ruleId=void 0;Vn.prototype.source=void 0;const Ek={}.hasOwnProperty,Uq=new Map,Fq=/[A-Z]/g,Bq=new Set(["table","tbody","thead","tfoot","tr"]),Hq=new Set(["td","th"]),M3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $q(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=Wq(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=Qq(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,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"?Sk:gq,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=j3(r,e,void 0);return i&&typeof i!="string"?i:r.create(e,r.Fragment,{children:i||void 0},void 0)}function j3(e,t,n){if(t.type==="element")return Gq(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Kq(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Yq(e,t,n);if(t.type==="mdxjsEsm")return qq(e,t);if(t.type==="root")return Vq(e,t,n);if(t.type==="text")return Xq(e,t)}function Gq(e,t,n){const s=e.schema;let r=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(r=Sk,e.schema=r),e.ancestors.push(t);const i=O3(e,t.tagName,!1),a=Zq(e,t);let l=Ck(e,t);return Bq.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!aq(c):!0})),R3(e,a,i,t),_k(a,l),e.ancestors.pop(),e.schema=s,e.create(t,i,a,n)}function Kq(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}yd(e,t.position)}function qq(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);yd(e,t.position)}function Yq(e,t,n){const s=e.schema;let r=s;t.name==="svg"&&s.space==="html"&&(r=Sk,e.schema=r),e.ancestors.push(t);const i=t.name===null?e.Fragment:O3(e,t.name,!0),a=Jq(e,t),l=Ck(e,t);return R3(e,a,i,t),_k(a,l),e.ancestors.pop(),e.schema=s,e.create(t,i,a,n)}function Vq(e,t,n){const s={};return _k(s,Ck(e,t)),e.create(t,e.Fragment,s,n)}function Xq(e,t){return t.value}function R3(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function _k(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Qq(e,t,n){return s;function s(r,i,a,l){const u=Array.isArray(a.children)?n:t;return l?u(i,a,l):u(i,a)}}function Wq(e,t){return n;function n(s,r,i,a){const l=Array.isArray(i.children),c=Nk(s);return t(r,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Zq(e,t){const n={};let s,r;for(r in t.properties)if(r!=="children"&&Ek.call(t.properties,r)){const i=eY(e,r,t.properties[r]);if(i){const[a,l]=i;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Hq.has(t.tagName)?s=l:n[a]=l}}if(s){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function Jq(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const i=s.data.estree.body[0];i.type;const a=i.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else yd(e,t.position);else{const r=s.name;let i;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const l=s.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else yd(e,t.position);else i=s.value===null?!0:s.value;n[r]=i}return n}function Ck(e,t){const n=[];let s=-1;const r=e.passKeys?new Map:Uq;for(;++s<t.children.length;){const i=t.children[s];let a;if(e.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const u=r.get(c)||0;a=c+"-"+u,r.set(c,u+1)}}const l=j3(e,i,a);l!==void 0&&n.push(l)}return n}function eY(e,t,n){const s=hq(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?tq(n):bq(n)),s.property==="style"){let r=typeof n=="object"?n:tY(e,String(n));return e.stylePropertyNameCase==="css"&&(r=nY(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&s.space?uq[s.property]||s.property:s.attribute,n]}}function tY(e,t){try{return Pq(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,r=new Vn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=M3+"#cannot-parse-style-attribute",r}}function O3(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let i=-1,a;for(;++i<r.length;){const l=WN(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(i&&l.type==="Literal"),optional:!1}:l}s=a}else s=WN(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const r=s.value;return Ek.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(s);yd(e)}function yd(e,t){const n=new Vn("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=M3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function nY(e){const t={};let n;for(n in e)Ek.call(e,n)&&(t[sY(n)]=e[n]);return t}function sY(e){let t=e.replace(Fq,rY);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rY(e){return"-"+e.toLowerCase()}const n0={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"]},iY={};function Tk(e,t){const n=iY,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return D3(e,s,r)}function D3(e,t,n){if(aY(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 lE(e.children,t,n)}return Array.isArray(e)?lE(e,t,n):""}function lE(e,t,n){const s=[];let r=-1;for(;++r<e.length;)s[r]=D3(e[r],t,n);return s.join("")}function aY(e){return!!(e&&typeof e=="object")}const oE=document.createElement("i");function Ak(e){const t="&"+e+";";oE.innerHTML=t;const n=oE.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Zs(e,t,n,s){const r=e.length;let i=0,a;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,s.length<1e4)a=Array.from(s),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<s.length;)a=s.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function Gs(e,t){return e.length>0?(Zs(e,e.length,0,t),e):t}const cE={}.hasOwnProperty;function I3(e){const t={};let n=-1;for(;++n<e.length;)lY(t,e[n]);return t}function lY(e,t){let n;for(n in t){const r=(cE.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){cE.call(r,a)||(r[a]=[]);const l=i[a];oY(r[a],Array.isArray(l)?l:l?[l]:[])}}}function oY(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);Zs(e,0,0,s)}function L3(e,t){const 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.fromCharCode(n)}function hr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const rs=Pa(/[A-Za-z]/),qn=Pa(/[\dA-Za-z]/),cY=Pa(/[#-'*+\--9=?A-Z^-~]/);function zp(e){return e!==null&&(e<32||e===127)}const Wx=Pa(/\d/),uY=Pa(/[\dA-Fa-f]/),dY=Pa(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function Ft(e){return e!==null&&(e<0||e===32)}function ht(e){return e===-2||e===-1||e===32}const Dm=Pa(new RegExp("\\p{P}","u")),Bl=Pa(/\s/);function Pa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Lc(e){const t=[];let n=-1,s=0,r=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&qn(e.charCodeAt(n+1))&&qn(e.charCodeAt(n+2)))r=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),r=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(s,n),encodeURIComponent(a)),s=n+r+1,a=""),r&&(n+=r,r=0)}return t.join("")+e.slice(s)}function Et(e,t,n,s){const r=s?s-1:1/0;let i=0;return a;function a(c){return ht(c)?(e.enter(n),l(c)):t(c)}function l(c){return ht(c)&&i++<r?(e.consume(c),l):(e.exit(n),t(c))}}function P3(e,t,n,s,r,i){let a=0;return l;function l(d){return ht(d)?(e.enter(s),c(d)):u(d)}function c(d){return ht(d)&&a<i?(e.consume(d),a++,c):(e.exit(s),u(d))}function u(d){return a>=r?t(d):n(d)}}const fY={tokenize:hY};function hY(e){const t=e.attempt(this.parser.constructs.contentInitial,s,r);let n;return t;function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Et(e,t,"linePrefix")}function r(l){return e.enter("paragraph"),i(l)}function i(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return tt(l)?(e.consume(l),e.exit("chunkText"),i):(e.consume(l),a)}}let Up=class{constructor(){this.index=new Map,this.map=[]}add(t,n,s){uE(this,t,n,s,!1)}addBefore(t,n,s){uE(this,t,n,s,!0)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let r=s.pop();for(;r;){for(const i of r)t.push(i);r=s.pop()}this.map.length=0,this.index.clear()}};function uE(e,t,n,s,r){if(n===0&&s.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,r?(s.push(...i[2]),i[2]=s):i[2].push(...s);return}const a=[t,n,s];e.map.push(a),e.index.set(t,a)}const pY={tokenize:mY},dE={tokenize:gY};function mY(e){const t=this,n=[];let s=0,r,i,a;return l;function l(x){if(s<n.length){const S=n[s];return t.containerState=S[1],e.attempt(S[0].continuation,c,u)(x)}return u(x)}function c(x){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const S=t.events.length;let A=S,E;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){E=t.events[A][1].end;break}g(s);let M=S;for(;M<t.events.length;)t.events[M][1].end={...E},M++;const j=new Up;return j.add(A+1,0,t.events.slice(S)),j.add(S,M-S,[]),j.consume(t.events),u(x)}return l(x)}function u(x){if(s===n.length){if(!r)return h(x);if(r.currentConstruct&&r.currentConstruct.concrete)return m(x);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dE,d,f)(x)}function d(x){return r&&y(),g(s),h(x)}function f(x){return t.parser.lazy[t.now().line]=s!==n.length,a=t.now().offset,m(x)}function h(x){return t.containerState={},e.attempt(dE,p,m)(x)}function p(x){return s++,n.push([t.currentConstruct,t.containerState]),h(x)}function m(x){if(x===null){r&&y(),g(0),e.consume(x);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:i}),k(x)}function k(x){if(x===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(x);return}return tt(x)?(e.consume(x),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,l):(e.consume(x),k)}function w(x,S){const A=t.sliceStream(x);if(S&&A.push(null),x.previous=i,i&&(i.next=x),i=x,r.defineSkip(x.start),r.write(A),t.parser.lazy[x.start.line]){let E=r.events.length;for(;E--;)if(r.events[E][1].start.offset<a&&(!r.events[E][1].end||r.events[E][1].end.offset>a))return;const M=t.events.length;let j=M,O,N;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(O){N=t.events[j][1].end;break}O=!0}for(g(s),E=M;E<t.events.length;)t.events[E][1].end={...N},E++;const F=new Up;F.add(j+1,0,t.events.slice(M)),F.add(M,E-M,[]),F.consume(t.events)}}function g(x){let S=n.length;for(;S-- >x;){const A=n[S];t.containerState=A[1],A[0].exit.call(t,e)}n.length=x}function y(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}function gY(e,t,n){return Et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Fp(e){if(e===null||Ft(e)||Bl(e))return 1;if(Dm(e))return 2}function Im(e,t,n){const s=[];let r=-1;for(;++r<e.length;){const i=e[r].resolveAll;i&&!s.includes(i)&&(t=i(t,n),s.push(i))}return t}const Zx={name:"attention",resolveAll:bY,tokenize:xY};function bY(e,t){let n=-1,s;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let r=n;for(;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;const i=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,a={...e[r][1].end},l={...e[n][1].start};fE(a,-i),fE(l,i);const c={type:i>1?"strongSequence":"emphasisSequence",start:a,end:{...e[r][1].end}},u={type:i>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:l},d={type:i>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},f={type:i>1?"strong":"emphasis",start:{...c.start},end:{...u.end}};e[r][1].end={...c.start},e[n][1].start={...u.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=Gs(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=Gs(s,[["enter",f,t],["enter",c,t],["exit",c,t],["enter",d,t]]),s=Gs(s,Im(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=Gs(s,[["exit",d,t],["enter",u,t],["exit",u,t],["exit",f,t]]);let h=0;e[n][1].end.offset-e[n][1].start.offset&&(h=2,s=Gs(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),Zs(e,r-1,n-r+3,s),n=r+s.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function xY(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,r=Fp(s);let i;return a;function a(c){return i=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===i)return e.consume(c),l;const u=e.exit("attentionSequence"),d=Fp(c),f=!d||d===2&&r||n.includes(c)&&c!==42&&c!==95,h=!r||r===2&&d||n.includes(s)&&s!==42&&s!==95;return u._open=!!(i===42?f:f&&(r||!h)),u._close=!!(i===42?h:h&&(d||!f)),t(c)}}function fE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const yY={name:"autolink",tokenize:vY};function vY(e,t,n){let s=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return rs(p)?(e.consume(p),a):p===64?n(p):u(p)}function a(p){return p===43||p===45||p===46||qn(p)?(s=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),s=0,c):(p===43||p===45||p===46||qn(p))&&s++<32?(e.consume(p),l):(s=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||zp(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):cY(p)?(e.consume(p),u):n(p)}function d(p){return qn(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),s=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||qn(p))&&s++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const cf={partial:!0,tokenize:kY};function kY(e,t,n){return s;function s(i){return ht(i)?Et(e,r,"linePrefix")(i):r(i)}function r(i){return i===null||tt(i)?t(i):n(i)}}const z3={continuation:{tokenize:SY},exit:NY,name:"blockQuote",tokenize:wY};function wY(e,t,n){const s=this;return r;function r(a){if(a===62){const l=s.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return n(a)}function i(a){return ht(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function SY(e,t,n){const s=this;return r;function r(a){return ht(a)?Et(e,i,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(z3,t,n)(a)}}function NY(e){e.exit("blockQuote")}const U3={name:"characterEscape",tokenize:EY};function EY(e,t,n){return s;function s(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),r}function r(i){return dY(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const F3={name:"characterReference",tokenize:_Y};function _Y(e,t,n){const s=this;let r=0,i,a;return l;function l(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,a=qn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=uY,d):(e.enter("characterReferenceValue"),i=7,a=Wx,d(f))}function d(f){if(f===59&&r){const h=e.exit("characterReferenceValue");return a===qn&&!Ak(s.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(f)&&r++<i?(e.consume(f),d):n(f)}}const Jx={partial:!0,tokenize:CY};function CY(e,t,n){const s=this;return r;function r(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return s.parser.lazy[s.now().line]?n(a):t(a)}}const hE={concrete:!0,name:"codeFenced",tokenize:TY};function TY(e,t,n){const s=this,r={partial:!0,tokenize:A};let i=0,a=0,l;return c;function c(E){return u(E)}function u(E){const M=s.events[s.events.length-1];return i=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,l=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(E)}function d(E){return E===l?(a++,e.consume(E),d):a<3?n(E):(e.exit("codeFencedFenceSequence"),ht(E)?Et(e,f,"whitespace")(E):f(E))}function f(E){return E===null||tt(E)?(e.exit("codeFencedFence"),s.interrupt?t(E):e.check(Jx,k,S)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||tt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(E)):ht(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Et(e,p,"whitespace")(E)):E===96&&E===l?n(E):(e.consume(E),h)}function p(E){return E===null||tt(E)?f(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||tt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(E)):E===96&&E===l?n(E):(e.consume(E),m)}function k(E){return e.attempt(r,S,w)(E)}function w(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),g}function g(E){return i>0&&ht(E)?Et(e,y,"linePrefix",i+1)(E):y(E)}function y(E){return E===null||tt(E)?e.check(Jx,k,S)(E):(e.enter("codeFlowValue"),x(E))}function x(E){return E===null||tt(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),x)}function S(E){return e.exit("codeFenced"),t(E)}function A(E,M,j){let O=0;return N;function N(L){return E.enter("lineEnding"),E.consume(L),E.exit("lineEnding"),F}function F(L){return E.enter("codeFencedFence"),ht(L)?Et(E,G,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):G(L)}function G(L){return L===l?(E.enter("codeFencedFenceSequence"),H(L)):j(L)}function H(L){return L===l?(O++,E.consume(L),H):O>=a?(E.exit("codeFencedFenceSequence"),ht(L)?Et(E,I,"whitespace")(L):I(L)):j(L)}function I(L){return L===null||tt(L)?(E.exit("codeFencedFence"),M(L)):j(L)}}}const s0={name:"codeIndented",tokenize:MY},AY={partial:!0,tokenize:jY};function MY(e,t,n){return s;function s(l){return e.enter("codeIndented"),P3(e,r,n,"linePrefix",4,4)(l)}function r(l){return l===null?a(l):tt(l)?e.attempt(AY,r,a)(l):(e.enter("codeFlowValue"),i(l))}function i(l){return l===null||tt(l)?(e.exit("codeFlowValue"),r(l)):(e.consume(l),i)}function a(l){return e.exit("codeIndented"),t(l)}}function jY(e,t,n){const s=this;return r;function r(a){return s.parser.lazy[s.now().line]?n(a):tt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r):P3(e,t,i,"linePrefix",4,4)(a)}function i(a){return tt(a)?r(a):n(a)}}const RY={name:"codeText",previous:DY,resolve:OY,tokenize:IY};function OY(e){let t=e.length-4,n=3,s,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)r===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(r=s):(s===t||e[s][1].type==="lineEnding")&&(e[r][1].type="codeTextData",s!==r+2&&(e[r][1].end=e[s-1][1].end,e.splice(r+2,s-r-2),t-=s-r-2,s=r+2),r=void 0);return e}function DY(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function IY(e,t,n){let s=0,r,i;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),s++,l):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(i=e.enter("codeTextSequence"),r=0,d(f)):tt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||tt(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),r++,d):r===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",u(f))}}function B3(e){const t={};let n=-1,s,r,i,a,l,c,u;for(;++n<e.length;){for(;n in t;)n=t[n];if(s=e[n],n&&s[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(c=s[1]._tokenizer.events,i=0,i<c.length&&c[i][1].type==="lineEndingBlank"&&(i+=2),i<c.length&&c[i][1].type==="content"))for(;++i<c.length&&c[i][1].type!=="content";)c[i][1].type==="chunkText"&&(c[i][1]._isInFirstContentOfListItem=!0,i++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,LY(e,n)),n=t[n],u=!0);else if(s[1]._container){for(i=n,r=void 0;i--&&(a=e[i],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(r&&(e[r][1].type="lineEndingBlank"),a[1].type="lineEnding",r=i);r&&(s[1].end=Object.assign({},e[r][1].start),l=e.slice(r,n),l.unshift(s),Zs(e,r,n-r+1,l))}}return!u}function LY(e,t){const n=e[t][1],s=e[t][2];let r=t-1;const i=[],a=n._tokenizer||s.parser[n.contentType](n.start),l=a.events,c=[],u={};let d,f,h=-1,p=n,m=0,k=0;const w=[k];for(;p;){for(;e[++r][1]!==p;);i.push(r),p._tokenizer||(d=s.sliceStream(p),p.next||d.push(null),f&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(k=h+1,w.push(k),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):w.pop(),h=w.length;h--;){const g=l.slice(w[h],w[h+1]),y=i.pop();c.unshift([y,y+g.length-1]),Zs(e,y,2,g)}for(h=-1;++h<c.length;)u[m+c[h][0]]=m+c[h][1],m+=c[h][1]-c[h][0]-1;return u}const PY={resolve:UY,tokenize:FY},zY={partial:!0,tokenize:BY};function UY(e){return B3(e),e}function FY(e,t){let n;return s;function s(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(l)}function r(l){return l===null?i(l):tt(l)?e.check(zY,a,i)(l):(e.consume(l),r)}function i(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function a(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function BY(e,t,n){const s=this;return r;function r(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Et(e,i,"linePrefix")}function i(a){if(a===null||tt(a))return n(a);const l=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):e.interrupt(s.parser.constructs.flow,n,t)(a)}}function H3(e,t,n,s,r,i,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(s),e.enter(r),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||zp(g)?n(g):(e.enter(s),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),e.exit(s),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(l),h(g)):g===null||g===60||tt(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function k(g){return!d&&(g===null||g===41||Ft(g))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(s),t(g)):d<u&&g===40?(e.consume(g),d++,k):g===41?(e.consume(g),d--,k):g===null||g===32||g===40||zp(g)?n(g):(e.consume(g),g===92?w:k)}function w(g){return g===40||g===41||g===92?(e.consume(g),k):k(g)}}function $3(e,t,n,s,r,i){const a=this;let l=0,c;return u;function u(p){return e.enter(s),e.enter(r),e.consume(p),e.exit(r),e.enter(i),d}function d(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(r),e.consume(p),e.exit(r),e.exit(s),t):tt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||tt(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!ht(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function G3(e,t,n,s,r,i){let a;return l;function l(h){return h===34||h===39||h===40?(e.enter(s),e.enter(r),e.consume(h),e.exit(r),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(r),e.consume(h),e.exit(r),e.exit(s),t):(e.enter(i),u(h))}function u(h){return h===a?(e.exit(i),c(a)):h===null?n(h):tt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Et(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||tt(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Iu(e,t){let n;return s;function s(r){return tt(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,s):ht(r)?Et(e,s,n?"linePrefix":"lineSuffix")(r):t(r)}}const HY={name:"definition",tokenize:GY},$Y={partial:!0,tokenize:KY};function GY(e,t,n){const s=this;let r;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return $3.call(s,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=hr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return Ft(p)?Iu(e,u)(p):u(p)}function u(p){return H3(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt($Y,f,f)(p)}function f(p){return ht(p)?Et(e,h,"whitespace")(p):h(p)}function h(p){return p===null||tt(p)?(e.exit("definition"),s.parser.defined.push(r),t(p)):n(p)}}function KY(e,t,n){return s;function s(l){return Ft(l)?Iu(e,r)(l):n(l)}function r(l){return G3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return ht(l)?Et(e,a,"whitespace")(l):a(l)}function a(l){return l===null||tt(l)?t(l):n(l)}}const qY={name:"hardBreakEscape",tokenize:YY};function YY(e,t,n){return s;function s(i){return e.enter("hardBreakEscape"),e.consume(i),r}function r(i){return tt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const VY={name:"headingAtx",resolve:XY,tokenize:QY};function XY(e,t){let n=e.length-2,s=3;if(e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s){const r={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},i={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"};Zs(e,s,n-s+1,[["enter",r,t],["enter",i,t],["exit",i,t],["exit",r,t]])}return e}function QY(e,t,n){let s=0;return r;function r(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&s++<6?(e.consume(d),a):d===null||Ft(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||tt(d)?(e.exit("atxHeading"),t(d)):ht(d)?Et(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Ft(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const WY=["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"],pE=["pre","script","style","textarea"],ZY={concrete:!0,name:"htmlFlow",resolveTo:eV,tokenize:tV},JY={partial:!0,tokenize:nV};function eV(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 tV(e,t,n){const s=this;let r,i,a,l,c;return u;function u(T){return d(T)}function d(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),f}function f(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),i=!0,k):T===63?(e.consume(T),r=3,s.interrupt?t:R):rs(T)?(e.consume(T),a=String.fromCharCode(T),w):n(T)}function h(T){return T===45?(e.consume(T),r=2,p):T===91?(e.consume(T),r=5,l=0,m):rs(T)?(e.consume(T),r=4,s.interrupt?t:R):n(T)}function p(T){return T===45?(e.consume(T),s.interrupt?t:R):n(T)}function m(T){const X="CDATA[";return T===X.charCodeAt(l++)?(e.consume(T),l===X.length?s.interrupt?t:G:m):n(T)}function k(T){return rs(T)?(e.consume(T),a=String.fromCharCode(T),w):n(T)}function w(T){if(T===null||T===47||T===62||Ft(T)){const X=T===47,ne=a.toLowerCase();return!X&&!i&&pE.includes(ne)?(r=1,s.interrupt?t(T):G(T)):WY.includes(a.toLowerCase())?(r=6,X?(e.consume(T),g):s.interrupt?t(T):G(T)):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(T):i?y(T):x(T))}return T===45||qn(T)?(e.consume(T),a+=String.fromCharCode(T),w):n(T)}function g(T){return T===62?(e.consume(T),s.interrupt?t:G):n(T)}function y(T){return ht(T)?(e.consume(T),y):N(T)}function x(T){return T===47?(e.consume(T),N):T===58||T===95||rs(T)?(e.consume(T),S):ht(T)?(e.consume(T),x):N(T)}function S(T){return T===45||T===46||T===58||T===95||qn(T)?(e.consume(T),S):A(T)}function A(T){return T===61?(e.consume(T),E):ht(T)?(e.consume(T),A):x(T)}function E(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),c=T,M):ht(T)?(e.consume(T),E):j(T)}function M(T){return T===c?(e.consume(T),c=null,O):T===null||tt(T)?n(T):(e.consume(T),M)}function j(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||Ft(T)?A(T):(e.consume(T),j)}function O(T){return T===47||T===62||ht(T)?x(T):n(T)}function N(T){return T===62?(e.consume(T),F):n(T)}function F(T){return T===null||tt(T)?G(T):ht(T)?(e.consume(T),F):n(T)}function G(T){return T===45&&r===2?(e.consume(T),C):T===60&&r===1?(e.consume(T),D):T===62&&r===4?(e.consume(T),_):T===63&&r===3?(e.consume(T),R):T===93&&r===5?(e.consume(T),B):tt(T)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(JY,K,H)(T)):T===null||tt(T)?(e.exit("htmlFlowData"),H(T)):(e.consume(T),G)}function H(T){return e.check(Jx,I,K)(T)}function I(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),L}function L(T){return T===null||tt(T)?H(T):(e.enter("htmlFlowData"),G(T))}function C(T){return T===45?(e.consume(T),R):G(T)}function D(T){return T===47?(e.consume(T),a="",U):G(T)}function U(T){if(T===62){const X=a.toLowerCase();return pE.includes(X)?(e.consume(T),_):G(T)}return rs(T)&&a.length<8?(e.consume(T),a+=String.fromCharCode(T),U):G(T)}function B(T){return T===93?(e.consume(T),R):G(T)}function R(T){return T===62?(e.consume(T),_):T===45&&r===2?(e.consume(T),R):G(T)}function _(T){return T===null||tt(T)?(e.exit("htmlFlowData"),K(T)):(e.consume(T),_)}function K(T){return e.exit("htmlFlow"),t(T)}}function nV(e,t,n){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(cf,t,n)}}const sV={name:"htmlText",tokenize:rV};function rV(e,t,n){const s=this;let r,i,a;return l;function l(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),c}function c(R){return R===33?(e.consume(R),u):R===47?(e.consume(R),A):R===63?(e.consume(R),x):rs(R)?(e.consume(R),j):n(R)}function u(R){return R===45?(e.consume(R),d):R===91?(e.consume(R),i=0,m):rs(R)?(e.consume(R),y):n(R)}function d(R){return R===45?(e.consume(R),p):n(R)}function f(R){return R===null?n(R):R===45?(e.consume(R),h):tt(R)?(a=f,D(R)):(e.consume(R),f)}function h(R){return R===45?(e.consume(R),p):f(R)}function p(R){return R===62?C(R):R===45?h(R):f(R)}function m(R){const _="CDATA[";return R===_.charCodeAt(i++)?(e.consume(R),i===_.length?k:m):n(R)}function k(R){return R===null?n(R):R===93?(e.consume(R),w):tt(R)?(a=k,D(R)):(e.consume(R),k)}function w(R){return R===93?(e.consume(R),g):k(R)}function g(R){return R===62?C(R):R===93?(e.consume(R),g):k(R)}function y(R){return R===null||R===62?C(R):tt(R)?(a=y,D(R)):(e.consume(R),y)}function x(R){return R===null?n(R):R===63?(e.consume(R),S):tt(R)?(a=x,D(R)):(e.consume(R),x)}function S(R){return R===62?C(R):x(R)}function A(R){return rs(R)?(e.consume(R),E):n(R)}function E(R){return R===45||qn(R)?(e.consume(R),E):M(R)}function M(R){return tt(R)?(a=M,D(R)):ht(R)?(e.consume(R),M):C(R)}function j(R){return R===45||qn(R)?(e.consume(R),j):R===47||R===62||Ft(R)?O(R):n(R)}function O(R){return R===47?(e.consume(R),C):R===58||R===95||rs(R)?(e.consume(R),N):tt(R)?(a=O,D(R)):ht(R)?(e.consume(R),O):C(R)}function N(R){return R===45||R===46||R===58||R===95||qn(R)?(e.consume(R),N):F(R)}function F(R){return R===61?(e.consume(R),G):tt(R)?(a=F,D(R)):ht(R)?(e.consume(R),F):O(R)}function G(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),r=R,H):tt(R)?(a=G,D(R)):ht(R)?(e.consume(R),G):(e.consume(R),I)}function H(R){return R===r?(e.consume(R),r=void 0,L):R===null?n(R):tt(R)?(a=H,D(R)):(e.consume(R),H)}function I(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Ft(R)?O(R):(e.consume(R),I)}function L(R){return R===47||R===62||Ft(R)?O(R):n(R)}function C(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function D(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),U}function U(R){return ht(R)?Et(e,B,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):B(R)}function B(R){return e.enter("htmlTextData"),a(R)}}const Mk={name:"labelEnd",resolveAll:oV,resolveTo:cV,tokenize:uV},iV={tokenize:dV},aV={tokenize:fV},lV={tokenize:hV};function oV(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const r=s.type==="labelImage"?4:2;s.type="data",t+=r}}return e.length!==n.length&&Zs(e,0,e.length,n),e}function cV(e,t){let n=e.length,s=0,r,i,a;for(;n--;){const d=e[n][1];if(r){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;e[n][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(i){if(e[n][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(r=n,d.type!=="labelLink")){s=2;break}}else d.type==="labelEnd"&&(i=n)}const l={type:e[r][1].type==="labelLink"?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[i-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Gs(a,e.slice(r+1,r+s+3)),a=Gs(a,[["enter",u,t]]),a=Gs(a,Im(t.parser.constructs.insideSpan.null,e.slice(r+s+4,i-3),t)),a=Gs(a,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),a=Gs(a,e.slice(i+1)),a=Gs(a,[["exit",l,t]]),Zs(e,r,e.length,a),e}function uV(e,t,n){const s=this,r=s._labelStarts;let i,a;if(r){for(;r.length>0&&r[r.length-1]._balanced;)r.pop();i=r[r.length-1]}return l;function l(h){return i?i._inactive?f(h):(a=s.parser.defined.includes(hr(s.sliceSerialize({start:i.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(iV,d,a?d:f)(h):h===91?e.attempt(aV,d,a?u:f)(h):a?d(h):f(h)}function u(h){return e.attempt(lV,d,f)(h)}function d(h){return r.pop(),t(h)}function f(h){return i._balanced=!0,n(h)}}function dV(e,t,n){return s;function s(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),r}function r(f){return Ft(f)?Iu(e,i)(f):i(f)}function i(f){return f===41?d(f):H3(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return Ft(f)?Iu(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?G3(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return Ft(f)?Iu(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function fV(e,t,n){const s=this;return r;function r(l){return $3.call(s,e,i,a,"reference","referenceMarker","referenceString")(l)}function i(l){return s.parser.defined.includes(hr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function a(l){return n(l)}}function hV(e,t,n){return s;function s(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),r}function r(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const pV={name:"labelStartImage",resolveAll:Mk.resolveAll,tokenize:mV};function mV(e,t,n){const s=this;let r;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),r=e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(c):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(r),t(c))}}const gV={name:"labelStartLink",resolveAll:Mk.resolveAll,tokenize:bV};function bV(e,t,n){const s=this;let r;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),r=e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(l):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(r),t(l))}}const r0={name:"lineEnding",tokenize:xV};function xV(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Et(e,t,"linePrefix")}}const Hh={name:"thematicBreak",tokenize:yV};function yV(e,t,n){let s=0,r;return i;function i(u){return e.enter("thematicBreak"),a(u)}function a(u){return r=u,l(u)}function l(u){return u===r?(e.enter("thematicBreakSequence"),c(u)):s>=3&&(u===null||tt(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),s++,c):(e.exit("thematicBreakSequence"),ht(u)?Et(e,l,"whitespace")(u):l(u))}}const ds={continuation:{tokenize:SV},exit:EV,name:"list",tokenize:wV},vV={partial:!0,tokenize:_V},kV={partial:!0,tokenize:NV};function wV(e,t,n){const s=this,r=s.events[s.events.length-1];let i=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,a=0;return l;function l(p){const m=s.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!s.containerState.marker||p===s.containerState.marker:Wx(p)){if(s.containerState.type||(s.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Hh,n,u)(p):u(p);if(!s.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return Wx(p)&&++a<10?(e.consume(p),c):(!s.interrupt||a<2)&&(s.containerState.marker?p===s.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||p,e.check(cf,s.interrupt?n:d,e.attempt(vV,h,f))}function d(p){return s.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return ht(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return s.containerState.size=i+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function SV(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(cf,r,i);function r(l){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Et(e,t,"listItemIndent",s.containerState.size+1)(l)}function i(l){return s.containerState.furtherBlankLines||!ht(l)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,a(l)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(kV,t,a)(l))}function a(l){return s.containerState._closeFlow=!0,s.interrupt=void 0,Et(e,e.attempt(ds,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function NV(e,t,n){const s=this;return Et(e,r,"listItemIndent",s.containerState.size+1);function r(i){const a=s.events[s.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===s.containerState.size?t(i):n(i)}}function EV(e){e.exit(this.containerState.type)}function _V(e,t,n){const s=this;return Et(e,r,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(i){const a=s.events[s.events.length-1];return!ht(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const mE={name:"setextUnderline",resolveTo:CV,tokenize:TV};function CV(e,t){const n=new Up;let s=e.length,r,i,a;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){r=s;break}e[s][1].type==="paragraph"&&(i=s)}else e[s][1].type==="content"&&n.add(s,1,[]),!a&&e[s][1].type==="definition"&&(a=s);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(n.add(i,0,[["enter",l,t]]),n.add(a+1,0,[["exit",e[r][1],t]]),e[r][1].end={...e[a][1].end}):e[r][1]=l,n.add(e.length,0,[["exit",l,t]]),n.consume(e),e}function TV(e,t,n){const s=this;let r;return i;function i(u){let d=s.events.length,f;for(;d--;)if(s.events[d][1].type!=="lineEnding"&&s.events[d][1].type!=="linePrefix"&&s.events[d][1].type!=="content"){f=s.events[d][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||f)?(e.enter("setextHeadingLine"),r=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),ht(u)?Et(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||tt(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const AV={tokenize:MV};function MV(e){const t=this,n=e.attempt(cf,s,e.attempt(this.parser.constructs.flowInitial,r,Et(e,e.attempt(this.parser.constructs.flow,r,e.attempt(PY,r)),"linePrefix")));return n;function s(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const jV={resolveAll:q3()},RV=K3("string"),OV=K3("text");function K3(e){return{resolveAll:q3(e==="text"?DV:void 0),tokenize:t};function t(n){const s=this,r=this.parser.constructs[e],i=n.attempt(r,a,l);return a;function a(d){return u(d)?i(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(s,s.previous))return!0}return!1}}}function q3(e){return t;function t(n,s){let r=-1,i;for(;++r<=n.length;)i===void 0?n[r]&&n[r][1].type==="data"&&(i=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==i+2&&(n[i][1].end=n[r-1][1].end,n.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(n,s):n}}function DV(e,t){const n=new Up;let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const r=e[s-1][1],i=t.sliceStream(r);let a=i.length,l=-1,c=0,u;for(;a--;){const d=i[a];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)u=!0,c++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&s===e.length&&(c=0),c){const d={type:s===e.length||u||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):n.add(s,0,[["enter",d,t],["exit",d,t]])}s++}return n.consume(e),e}const IV={42:ds,43:ds,45:ds,48:ds,49:ds,50:ds,51:ds,52:ds,53:ds,54:ds,55:ds,56:ds,57:ds,62:z3},LV={91:HY},PV={[-2]:s0,[-1]:s0,32:s0},zV={35:VY,42:Hh,45:[mE,Hh],60:ZY,61:mE,95:Hh,96:hE,126:hE},UV={38:F3,92:U3},FV={[-5]:r0,[-4]:r0,[-3]:r0,33:pV,38:F3,42:Zx,60:[yY,sV],91:gV,92:[qY,U3],93:Mk,95:Zx,96:RY},BV={null:[Zx,jV]},HV={null:[42,95]},$V={null:[]},GV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:HV,contentInitial:LV,disable:$V,document:IV,flow:zV,flowInitial:PV,insideSpan:BV,string:UV,text:FV},Symbol.toStringTag,{value:"Module"}));function KV(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},i=[];let a=[],l=[];const c={attempt:M(A),check:M(E),consume:y,enter:x,exit:S,interrupt:M(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&i.push(t),u;function f(F){return a=Gs(a,F),w(),a[a.length-1]!==null?[]:(j(t,0),u.events=Im(i,u.events,u),u.events)}function h(F,G){return YV(p(F),G)}function p(F){return qV(a,F)}function m(){const{_bufferIndex:F,_index:G,line:H,column:I,offset:L}=s;return{_bufferIndex:F,_index:G,line:H,column:I,offset:L}}function k(F){r[F.line]=F.column,N()}function w(){for(;s._index<a.length;){const F=a[s._index];if(typeof F=="string"){const G=s._index;for(s._bufferIndex<0&&(s._bufferIndex=0);s._index===G&&s._bufferIndex<F.length;)g(F.charCodeAt(s._bufferIndex))}else g(F)}}function g(F){d=d(F)}function y(F){tt(F)?(s.line++,s.column=1,s.offset+=F===-3?2:1,N()):F!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===a[s._index].length&&(s._bufferIndex=-1,s._index++)),u.previous=F}function x(F,G){const H=G||{};return H.type=F,H.start=m(),u.events.push(["enter",H,u]),l.push(H),H}function S(F){const G=l.pop();return G.end=m(),u.events.push(["exit",G,u]),G}function A(F,G){j(F,G.from)}function E(F,G){G.restore()}function M(F,G){return H;function H(I,L,C){let D,U,B,R;return Array.isArray(I)?K(I):"tokenize"in I?K([I]):_(I);function _(J){return pe;function pe(q){const Y=q!==null&&J[q],V=q!==null&&J.null,ee=[...Array.isArray(Y)?Y:Y?[Y]:[],...Array.isArray(V)?V:V?[V]:[]];return K(ee)(q)}}function K(J){return D=J,U=0,J.length===0?C:T(J[U])}function T(J){return pe;function pe(q){return R=O(),B=J,J.partial||(u.currentConstruct=J),J.name&&u.parser.constructs.disable.null.includes(J.name)?ne():J.tokenize.call(G?Object.assign(Object.create(u),G):u,c,X,ne)(q)}}function X(J){return F(B,R),L}function ne(J){return R.restore(),++U<D.length?T(D[U]):C}}}function j(F,G){F.resolveAll&&!i.includes(F)&&i.push(F),F.resolve&&Zs(u.events,G,u.events.length-G,F.resolve(u.events.slice(G),u)),F.resolveTo&&(u.events=F.resolveTo(u.events,u))}function O(){const F=m(),G=u.previous,H=u.currentConstruct,I=u.events.length,L=Array.from(l);return{from:I,restore:C};function C(){s=F,u.previous=G,u.currentConstruct=H,u.events.length=I,l=L,N()}}function N(){s.line in r&&s.column<2&&(s.column=r[s.line],s.offset+=r[s.line]-1)}}function qV(e,t){const n=t.start._index,s=t.start._bufferIndex,r=t.end._index,i=t.end._bufferIndex;let a;if(n===r)a=[e[n].slice(s,i)];else{if(a=e.slice(n,r),s>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(s):a.shift()}i>0&&a.push(e[r].slice(0,i))}return a}function YV(e,t){let n=-1;const s=[];let r;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
514
+ `;break}case-3:{a=`\r
515
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&r)continue;a=" ";break}default:a=String.fromCharCode(i)}r=i===-2,s.push(a)}return s.join("")}function VV(e){const s={constructs:I3([GV,...(e||{}).extensions||[]]),content:r(fY),defined:[],document:r(pY),flow:r(AV),lazy:{},string:r(RV),text:r(OV)};return s;function r(i){return a;function a(l){return KV(s,i,l)}}}function XV(e){for(;!B3(e););return e}const gE=/[\0\t\n\r]/g;function QV(){let e=1,t="",n=!0,s;return r;function r(i,a,l){i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i));const c=[];let u=0;for(t="",n&&(i.charCodeAt(0)===65279&&u++,n=void 0);u<i.length;){gE.lastIndex=u;const d=gE.exec(i),f=d&&d.index!==void 0?d.index:i.length,h=i.charCodeAt(f);if(!d){t=i.slice(u);break}if(h===10&&u===f&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),u<f&&(c.push(i.slice(u,f)),e+=f-u),h){case 0:{c.push(65533),e++;break}case 9:{const p=Math.ceil(e/4)*4;for(c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}u=f+1}return l&&(s&&c.push(-5),t&&c.push(t),c.push(null)),c}}const WV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZV(e){return e.replace(WV,JV)}function JV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),i=r===120||r===88;return L3(n.slice(i?2:1),i?16:10)}return Ak(n)||e}const Y3={}.hasOwnProperty;function eX(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),tX(n)(XV(VV(n).document().write(QV()(e,t,!0))))}function tX(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ve),autolinkProtocol:O,autolinkEmail:O,atxHeading:i(se),blockQuote:i(V),characterEscape:O,characterReference:O,codeFenced:i(ee),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(ee,a),codeText:i(oe,a),codeTextData:O,data:O,codeFlowValue:O,definition:i(ye),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Re),hardBreakEscape:i(Q),hardBreakTrailing:i(Q),htmlFlow:i(Te,a),htmlFlowData:O,htmlText:i(Te,a),htmlTextData:O,image:i(xe),label:a,link:i(ve),listItem:i($e),listItemValue:h,listOrdered:i(ge,f),listUnordered:i(ge),paragraph:i(dt),reference:T,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(se),strong:i(mt),thematicBreak:i(ct)},exit:{atxHeading:c(),atxHeadingSequence:A,autolink:c(),autolinkEmail:Y,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:J,characterReference:pe,codeFenced:c(w),codeFencedFence:k,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:N,codeIndented:c(g),codeText:c(L),codeTextData:N,data:N,definition:c(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(G),hardBreakTrailing:c(G),htmlFlow:c(H),htmlFlowData:N,htmlText:c(I),htmlTextData:N,image:c(D),label:B,labelText:U,lineEnding:F,link:c(C),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:X,resourceDestinationString:R,resourceTitleString:_,resource:K,setextHeading:c(j),setextHeadingLineSequence:M,setextHeadingText:E,strong:c(),thematicBreak:c()}};V3(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(te){let re={type:"root",children:[]};const Ae={stack:[re],tokenStack:[],config:t,enter:l,exit:u,buffer:a,resume:d,data:n},v=[];let Z=-1;for(;++Z<te.length;)if(te[Z][1].type==="listOrdered"||te[Z][1].type==="listUnordered")if(te[Z][0]==="enter")v.push(Z);else{const fe=v.pop();Z=r(te,fe,Z)}for(Z=-1;++Z<te.length;){const fe=t[te[Z][0]];Y3.call(fe,te[Z][1].type)&&fe[te[Z][1].type].call(Object.assign({sliceSerialize:te[Z][2].sliceSerialize},Ae),te[Z][1])}if(Ae.tokenStack.length>0){const fe=Ae.tokenStack[Ae.tokenStack.length-1];(fe[1]||bE).call(Ae,void 0,fe[0])}for(re.position={start:$i(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:$i(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Z=-1;++Z<t.transforms.length;)re=t.transforms[Z](re)||re;return re}function r(te,re,Ae){let v=re-1,Z=-1,fe=!1,be,he,P,ce;for(;++v<=Ae;){const ue=te[v];switch(ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ue[0]==="enter"?Z++:Z--,ce=void 0;break}case"lineEndingBlank":{ue[0]==="enter"&&(be&&!ce&&!Z&&!P&&(P=v),ce=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ce=void 0}if(!Z&&ue[0]==="enter"&&ue[1].type==="listItemPrefix"||Z===-1&&ue[0]==="exit"&&(ue[1].type==="listUnordered"||ue[1].type==="listOrdered")){if(be){let _e=v;for(he=void 0;_e--;){const ke=te[_e];if(ke[1].type==="lineEnding"||ke[1].type==="lineEndingBlank"){if(ke[0]==="exit")continue;he&&(te[he][1].type="lineEndingBlank",fe=!0),ke[1].type="lineEnding",he=_e}else if(!(ke[1].type==="linePrefix"||ke[1].type==="blockQuotePrefix"||ke[1].type==="blockQuotePrefixWhitespace"||ke[1].type==="blockQuoteMarker"||ke[1].type==="listItemIndent"))break}P&&(!he||P<he)&&(be._spread=!0),be.end=Object.assign({},he?te[he][1].start:ue[1].end),te.splice(he||v,0,["exit",be,ue[2]]),v++,Ae++}if(ue[1].type==="listItemPrefix"){const _e={type:"listItem",_spread:!1,start:Object.assign({},ue[1].start),end:void 0};be=_e,te.splice(v,0,["enter",_e,ue[2]]),v++,Ae++,P=void 0,ce=!0}}}return te[re][1]._spread=fe,Ae}function i(te,re){return Ae;function Ae(v){l.call(this,te(v),v),re&&re.call(this,v)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(te,re,Ae){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([re,Ae||void 0]),te.position={start:$i(re.start),end:void 0}}function c(te){return re;function re(Ae){te&&te.call(this,Ae),u.call(this,Ae)}}function u(te,re){const Ae=this.stack.pop(),v=this.tokenStack.pop();if(v)v[0].type!==te.type&&(re?re.call(this,te,v[0]):(v[1]||bE).call(this,te,v[0]));else throw new Error("Cannot close `"+te.type+"` ("+Du({start:te.start,end:te.end})+"): it’s not open");Ae.position.end=$i(te.end)}function d(){return Tk(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(te){if(this.data.expectingFirstListItemValue){const re=this.stack[this.stack.length-2];re.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function p(){const te=this.resume(),re=this.stack[this.stack.length-1];re.lang=te}function m(){const te=this.resume(),re=this.stack[this.stack.length-1];re.meta=te}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const te=this.resume(),re=this.stack[this.stack.length-1];re.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const te=this.resume(),re=this.stack[this.stack.length-1];re.value=te.replace(/(\r?\n|\r)$/g,"")}function y(te){const re=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=re,Ae.identifier=hr(this.sliceSerialize(te)).toLowerCase()}function x(){const te=this.resume(),re=this.stack[this.stack.length-1];re.title=te}function S(){const te=this.resume(),re=this.stack[this.stack.length-1];re.url=te}function A(te){const re=this.stack[this.stack.length-1];if(!re.depth){const Ae=this.sliceSerialize(te).length;re.depth=Ae}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function M(te){const re=this.stack[this.stack.length-1];re.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function O(te){const Ae=this.stack[this.stack.length-1].children;let v=Ae[Ae.length-1];(!v||v.type!=="text")&&(v=rt(),v.position={start:$i(te.start),end:void 0},Ae.push(v)),this.stack.push(v)}function N(te){const re=this.stack.pop();re.value+=this.sliceSerialize(te),re.position.end=$i(te.end)}function F(te){const re=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=re.children[re.children.length-1];Ae.position.end=$i(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(re.type)&&(O.call(this,te),N.call(this,te))}function G(){this.data.atHardBreak=!0}function H(){const te=this.resume(),re=this.stack[this.stack.length-1];re.value=te}function I(){const te=this.resume(),re=this.stack[this.stack.length-1];re.value=te}function L(){const te=this.resume(),re=this.stack[this.stack.length-1];re.value=te}function C(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const re=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=re,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function D(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const re=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=re,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function U(te){const re=this.sliceSerialize(te),Ae=this.stack[this.stack.length-2];Ae.label=ZV(re),Ae.identifier=hr(re).toLowerCase()}function B(){const te=this.stack[this.stack.length-1],re=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const v=te.children;Ae.children=v}else Ae.alt=re}function R(){const te=this.resume(),re=this.stack[this.stack.length-1];re.url=te}function _(){const te=this.resume(),re=this.stack[this.stack.length-1];re.title=te}function K(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function X(te){const re=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=re,Ae.identifier=hr(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function ne(te){this.data.characterReferenceType=te.type}function J(te){const re=this.sliceSerialize(te),Ae=this.data.characterReferenceType;let v;Ae?(v=L3(re,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):v=Ak(re);const Z=this.stack[this.stack.length-1];Z.value+=v}function pe(te){const re=this.stack.pop();re.position.end=$i(te.end)}function q(te){N.call(this,te);const re=this.stack[this.stack.length-1];re.url=this.sliceSerialize(te)}function Y(te){N.call(this,te);const re=this.stack[this.stack.length-1];re.url="mailto:"+this.sliceSerialize(te)}function V(){return{type:"blockquote",children:[]}}function ee(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function se(){return{type:"heading",depth:0,children:[]}}function Q(){return{type:"break"}}function Te(){return{type:"html",value:""}}function xe(){return{type:"image",title:null,url:"",alt:null}}function ve(){return{type:"link",title:null,url:"",children:[]}}function ge(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function $e(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function dt(){return{type:"paragraph",children:[]}}function mt(){return{type:"strong",children:[]}}function rt(){return{type:"text",value:""}}function ct(){return{type:"thematicBreak"}}}function $i(e){return{line:e.line,column:e.column,offset:e.offset}}function V3(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?V3(e,s):nX(e,s)}}function nX(e,t){let n;for(n in t)if(Y3.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function bE(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Du({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Du({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Du({start:t.start,end:t.end})+") is still open")}function sX(e){const t=this;t.parser=n;function n(s){return eX(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function rX(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function iX(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
516
+ `}]}function aX(e,t){const n=t.value?t.value+`
517
+ `:"",s={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(s.className=["language-"+r[0]]);let i={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function lX(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oX(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cX(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),r=Lc(s.toLowerCase()),i=e.footnoteOrder.indexOf(s);let a,l=e.footnoteCounts.get(s);l===void 0?(l=0,e.footnoteOrder.push(s),a=e.footnoteOrder.length):a=i+1,l+=1,e.footnoteCounts.set(s,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function uX(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dX(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function X3(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const r=e.all(t),i=r[0];i&&i.type==="text"?i.value="["+i.value:r.unshift({type:"text",value:"["});const a=r[r.length-1];return a&&a.type==="text"?a.value+=s:r.push({type:"text",value:s}),r}function fX(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return X3(e,t);const r={src:Lc(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(r.title=s.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function hX(e,t){const n={src:Lc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function pX(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function mX(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return X3(e,t);const r={href:Lc(s.url||"")};s.title!==null&&s.title!==void 0&&(r.title=s.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function gX(e,t){const n={href:Lc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function bX(e,t,n){const s=e.all(t),r=n?xX(n):Q3(t),i={},a=[];if(typeof t.checked=="boolean"){const d=s[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},s.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<s.length;){const d=s[l];(r||l!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
518
+ `}),d.type==="element"&&d.tagName==="p"&&!r?a.push(...d.children):a.push(d)}const c=s[s.length-1];c&&(r||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
519
+ `});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,u),e.applyData(t,u)}function xX(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s<n.length;)t=Q3(n[s])}return t}function Q3(e){const t=e.spread;return t??e.children.length>1}function yX(e,t){const n={},s=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r<s.length;){const a=s[r];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function vX(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kX(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function wX(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SX(e,t){const n=e.all(t),s=n.shift(),r=[];if(s){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],a),r.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Nk(t.children[1]),c=T3(t.children[t.children.length-1]);l&&c&&(a.position={start:l,end:c}),r.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function NX(e,t,n){const s=n?n.children:void 0,i=(s?s.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const f=t.children[c],h={},p=a?a[c]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),u.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function EX(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const xE=9,yE=32;function _X(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),r=0;const i=[];for(;s;)i.push(vE(t.slice(r,s.index),r>0,!0),s[0]),r=s.index+s[0].length,s=n.exec(t);return i.push(vE(t.slice(r),r>0,!1)),i.join("")}function vE(e,t,n){let s=0,r=e.length;if(t){let i=e.codePointAt(s);for(;i===xE||i===yE;)s++,i=e.codePointAt(s)}if(n){let i=e.codePointAt(r-1);for(;i===xE||i===yE;)r--,i=e.codePointAt(r-1)}return r>s?e.slice(s,r):""}function CX(e,t){const n={type:"text",value:_X(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function TX(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const AX={blockquote:rX,break:iX,code:aX,delete:lX,emphasis:oX,footnoteReference:cX,heading:uX,html:dX,imageReference:fX,image:hX,inlineCode:pX,linkReference:mX,link:gX,listItem:bX,list:yX,paragraph:vX,root:kX,strong:wX,table:SX,tableCell:EX,tableRow:NX,text:CX,thematicBreak:TX,toml:Zf,yaml:Zf,definition:Zf,footnoteDefinition:Zf};function Zf(){}const W3=-1,Lm=0,Lu=1,Bp=2,jk=3,Rk=4,Ok=5,Dk=6,Z3=7,J3=8,eR=typeof self=="object"?self:globalThis,kE=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new eR[e](t)},MX=(e,t)=>{const n=(r,i)=>(e.set(i,r),r),s=r=>{if(e.has(r))return e.get(r);const[i,a]=t[r];switch(i){case Lm:case W3:return n(a,r);case Lu:{const l=n([],r);for(const c of a)l.push(s(c));return l}case Bp:{const l=n({},r);for(const[c,u]of a)l[s(c)]=s(u);return l}case jk:return n(new Date(a),r);case Rk:{const{source:l,flags:c}=a;return n(new RegExp(l,c),r)}case Ok:{const l=n(new Map,r);for(const[c,u]of a)l.set(s(c),s(u));return l}case Dk:{const l=n(new Set,r);for(const c of a)l.add(s(c));return l}case Z3:{const{name:l,message:c}=a;return n(typeof eR[l]=="function"?kE(l,c):new Error(c),r)}case J3:return n(BigInt(a),r);case"BigInt":return n(Object(BigInt(a)),r);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(kE(i,a),r)};return s},wE=e=>MX(new Map,e)(0),el="",{toString:jX}={},{keys:RX}=Object,Wc=e=>{const t=typeof e;if(t!=="object"||!e)return[Lm,t];const n=jX.call(e).slice(8,-1);switch(n){case"Array":return[Lu,el];case"Object":return[Bp,el];case"Date":return[jk,el];case"RegExp":return[Rk,el];case"Map":return[Ok,el];case"Set":return[Dk,el];case"DataView":return[Lu,n]}return n.includes("Array")?[Lu,n]:e instanceof Error?[Z3,e.name||"Error"]:[Bp,n]},Jf=([e,t])=>e===Lm&&(t==="function"||t==="symbol"),OX=(e,t,n,s)=>{const r=(a,l)=>{const c=s.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=Wc(a);switch(l){case Lm:{let d=a;switch(c){case"bigint":l=J3,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([W3],a)}return r([l,d],a)}case Lu:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),r([c,[...h]],a)}const d=[],f=r([l,d],a);for(const h of a)d.push(i(h));return f}case Bp:{if(c)switch(c){case"BigInt":return r([c,a.toString()],a);case"Boolean":case"Number":case"String":return r([c,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const d=[],f=r([l,d],a);for(const h of RX(a))(e||!Jf(Wc(a[h])))&&d.push([i(h),i(a[h])]);return f}case jk:return r([l,isNaN(a.getTime())?el:a.toISOString()],a);case Rk:{const{source:d,flags:f}=a;return r([l,{source:d,flags:f}],a)}case Ok:{const d=[],f=r([l,d],a);for(const[h,p]of a)(e||!(Jf(Wc(h))||Jf(Wc(p))))&&d.push([i(h),i(p)]);return f}case Dk:{const d=[],f=r([l,d],a);for(const h of a)(e||!Jf(Wc(h)))&&d.push(i(h));return f}}const{message:u}=a;return r([l,{name:c,message:u}],a)};return i},SE=(e,{json:t,lossy:n}={})=>{const s=[];return OX(!(t||n),!!t,new Map,s)(e),s},El=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?wE(SE(e,t)):structuredClone(e):(e,t)=>wE(SE(e,t));function DX(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function IX(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function LX(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||DX,s=e.options.footnoteBackLabel||IX,r=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=Lc(f.toLowerCase());let p=0;const m=[],k=e.footnoteCounts.get(f);for(;k!==void 0&&++p<=k;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(c,p);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(c,p),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const y=w.children[w.children.length-1];y&&y.type==="text"?y.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,g),l.push(g)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...El(a),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
520
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
521
+ `}]}}const uf=function(e){if(e==null)return FX;if(typeof e=="function")return Pm(e);if(typeof e=="object")return Array.isArray(e)?PX(e):zX(e);if(typeof e=="string")return UX(e);throw new Error("Expected function, string, or object as test")};function PX(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=uf(e[n]);return Pm(s);function s(...r){let i=-1;for(;++i<t.length;)if(t[i].apply(this,r))return!0;return!1}}function zX(e){const t=e;return Pm(n);function n(s){const r=s;let i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function UX(e){return Pm(t);function t(n){return n&&n.type===e}}function Pm(e){return t;function t(n,s,r){return!!(BX(n)&&e.call(this,n,typeof s=="number"?s:void 0,r||void 0))}}function FX(){return!0}function BX(e){return e!==null&&typeof e=="object"&&"type"in e}const tR=[],HX=!0,ey=!1,$X="skip";function nR(e,t,n,s){let r;typeof t=="function"&&typeof n!="function"?(s=n,n=t):r=t;const i=uf(r),a=s?-1:1;l(e,void 0,[])();function l(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=tR,m,k,w;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=GX(n(c,d)),p[0]===ey))return p;if("children"in c&&c.children){const g=c;if(g.children&&p[0]!==$X)for(k=(s?g.children.length:-1)+a,w=d.concat(g);k>-1&&k<g.children.length;){const y=g.children[k];if(m=l(y,k,w)(),m[0]===ey)return m;k=typeof m[1]=="number"?m[1]:k+a}}return p}}}function GX(e){return Array.isArray(e)?e:typeof e=="number"?[HX,e]:e==null?tR:[e]}function zm(e,t,n,s){let r,i,a;typeof t=="function"&&typeof n!="function"?(i=void 0,a=t,r=n):(i=t,a=n,r=s),nR(e,i,l,r);function l(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return a(c,f,d)}}const ty={}.hasOwnProperty,KX={};function qX(e,t){const n=t||KX,s=new Map,r=new Map,i=new Map,a={...AX,...n.handlers},l={all:u,applyData:VX,definitionById:s,footnoteById:r,footnoteCounts:i,footnoteOrder:[],handlers:a,one:c,options:n,patch:YX,wrap:QX};return zm(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?s:r,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),l;function c(d,f){const h=d.type,p=l.handlers[h];if(ty.call(l.handlers,h)&&p)return p(l,d,f);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in d){const{children:k,...w}=d,g=El(w);return g.children=l.all(d),g}return El(d)}return(l.options.unknownHandler||XX)(l,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const m=l.one(h[p],d);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=NE(m.value)),!Array.isArray(m)&&m.type==="element")){const k=m.children[0];k&&k.type==="text"&&(k.value=NE(k.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function YX(e,t){e.position&&(t.position=zq(e))}function VX(e,t){let n=t;if(e&&e.data){const s=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const a="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:a}}n.type==="element"&&i&&Object.assign(n.properties,El(i)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function XX(e,t){const n=t.data||{},s="value"in t&&!(ty.call(n,"hProperties")||ty.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function QX(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
522
+ `});++s<e.length;)s&&n.push({type:"text",value:`
523
+ `}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
524
+ `}),n}function NE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function EE(e,t){const n=qX(e,t),s=n.one(e,void 0),r=LX(n),i=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return r&&i.children.push({type:"text",value:`
525
+ `},r),i}function WX(e,t){return e&&"run"in e?async function(n,s){const r=EE(n,{file:s,...t});await e.run(r,s)}:function(n,s){return EE(n,{file:s,...e||t})}}function _E(e){if(e)throw e}function ny(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ZX(){const e=[],t={run:n,use:s};return t;function n(...r){let i=-1;const a=r.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...r);function l(c,...u){const d=e[++i];let f=-1;if(c){a(c);return}for(;++f<r.length;)(u[f]===null||u[f]===void 0)&&(u[f]=r[f]);r=u,d?JX(d,l)(...u):a(null,...u)}}function s(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function JX(e,t){let n;return s;function s(...a){const l=e.length>a.length;let c;l&&a.push(r);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,r):c instanceof Error?r(c):i(c))}function r(a,...l){n||(n=!0,t(a,...l))}function i(a){r(null,a)}}const Mr={basename:eQ,dirname:tQ,extname:nQ,join:sQ,sep:"/"};function eQ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');df(e);let n=0,s=-1,r=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(i){n=r+1;break}}else s<0&&(i=!0,s=r+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let a=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(i){n=r+1;break}}else a<0&&(i=!0,a=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(s=r):(l=-1,s=a));return n===s?s=a:s<0&&(s=e.length),e.slice(n,s)}function tQ(e){if(df(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function nQ(e){df(e);let t=e.length,n=-1,s=0,r=-1,i=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){s=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?r<0?r=t:i!==1&&(i=1):r>-1&&(i=-1)}return r<0||n<0||i===0||i===1&&r===n-1&&r===s+1?"":e.slice(r,n)}function sQ(...e){let t=-1,n;for(;++t<e.length;)df(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":rQ(n)}function rQ(e){df(e);const t=e.codePointAt(0)===47;let n=iQ(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function iQ(e,t){let n="",s=0,r=-1,i=0,a=-1,l,c;for(;++a<=e.length;){if(a<e.length)l=e.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(r===a-1||i===1))if(r!==a-1&&i===2){if(n.length<2||s!==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="",s=0):(n=n.slice(0,c),s=n.length-1-n.lastIndexOf("/")),r=a,i=0;continue}}else if(n.length>0){n="",s=0,r=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(r+1,a):n=e.slice(r+1,a),s=a-r-1;r=a,i=0}else l===46&&i>-1?i++:i=-1}return n}function df(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const aQ={cwd:lQ};function lQ(){return"/"}function sy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oQ(e){if(typeof e=="string")e=new URL(e);else if(!sy(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return cQ(e)}function cQ(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const i0=["history","path","basename","stem","extname","dirname"];class sR{constructor(t){let n;t?sy(t)?n={path:t}:typeof t=="string"||uQ(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":aQ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<i0.length;){const i=i0[s];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let r;for(r in n)i0.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?Mr.basename(this.path):void 0}set basename(t){l0(t,"basename"),a0(t,"basename"),this.path=Mr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mr.dirname(this.path):void 0}set dirname(t){CE(this.basename,"dirname"),this.path=Mr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mr.extname(this.path):void 0}set extname(t){if(a0(t,"extname"),CE(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sy(t)&&(t=oQ(t)),l0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mr.basename(this.path,this.extname):void 0}set stem(t){l0(t,"stem"),a0(t,"stem"),this.path=Mr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const r=this.message(t,n,s);throw r.fatal=!0,r}info(t,n,s){const r=this.message(t,n,s);return r.fatal=void 0,r}message(t,n,s){const r=new Vn(t,n,s);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function a0(e,t){if(e&&e.includes(Mr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mr.sep+"`")}function l0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function CE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function uQ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dQ=function(e){const s=this.constructor.prototype,r=s[e],i=function(){return r.apply(i,arguments)};Object.setPrototypeOf(i,s);const a=Object.getOwnPropertyNames(r);for(const l of a){const c=Object.getOwnPropertyDescriptor(r,l);c&&Object.defineProperty(i,l,c)}return i},fQ={}.hasOwnProperty;class Ik extends dQ{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=ZX()}copy(){const t=new Ik;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(El(this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(u0("data",this.frozen),this.namespace[t]=n,this):fQ.call(this.namespace,t)&&this.namespace[t]||void 0:t?(u0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const r=n.call(t,...s);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=eh(t),s=this.parser||this.Parser;return o0("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),o0("process",this.parser||this.Parser),c0("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(i,a){const l=eh(t),c=s.parse(l);s.run(c,l,function(d,f,h){if(d||!f||!h)return u(d);const p=f,m=s.stringify(p,h);mQ(m)?h.value=m:h.result=m,u(d,h)});function u(d,f){d||!f?a(d):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,s;return this.freeze(),o0("processSync",this.parser||this.Parser),c0("processSync",this.compiler||this.Compiler),this.process(t,r),AE("processSync","process",n),s;function r(i,a){n=!0,_E(i),s=a}}run(t,n,s){TE(t),this.freeze();const r=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?i(void 0,s):new Promise(i);function i(a,l){const c=eh(n);r.run(t,c,u);function u(d,f,h){const p=f||t;d?l(d):a?a(p):s(void 0,p,h)}}}runSync(t,n){let s=!1,r;return this.run(t,n,i),AE("runSync","run",s),r;function i(a,l){_E(a),r=l,s=!0}}stringify(t,n){this.freeze();const s=eh(n),r=this.compiler||this.Compiler;return c0("stringify",r),TE(t),r(t,s)}use(t,...n){const s=this.attachers,r=this.namespace;if(u0("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new 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");l(u.plugins),u.settings&&(r.settings={...r.settings,...El(u.settings)})}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];i(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<s.length;)if(s[f][0]===u){h=f;break}if(h===-1)s.push([u,...d]);else if(d.length>0){let[p,...m]=d;const k=s[h][1];ny(k)&&ny(p)&&(p=El({...k,...p})),s[h]=[u,p,...m]}}}}const hQ=new Ik().freeze();function o0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function c0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function u0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function TE(e){if(!ny(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function AE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function eh(e){return pQ(e)?e:new sR(e)}function pQ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function mQ(e){return typeof e=="string"||gQ(e)}function gQ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bQ="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ME=[],jE={allowDangerousHtml:!0},xQ=/^(https?|ircs?|mailto|xmpp)$/i,yQ=[{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 Lk(e){const t=vQ(e),n=kQ(e);return wQ(t.runSync(t.parse(n),n),e)}function vQ(e){const t=e.rehypePlugins||ME,n=e.remarkPlugins||ME,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...jE}:jE;return hQ().use(sX).use(n).use(WX,s).use(t)}function kQ(e){const t=e.children||"",n=new sR;return typeof t=="string"&&(n.value=t),n}function wQ(e,t){const n=t.allowedElements,s=t.allowElement,r=t.components,i=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||SQ;for(const d of yQ)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+bQ+d.id,void 0);return zm(e,u),$q(e,{Fragment:o.Fragment,components:r,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in n0)if(Object.hasOwn(n0,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],k=n0[p];(k===null||k.includes(d.tagName))&&(d.properties[p]=c(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!p&&s&&typeof f=="number"&&(p=!s(d,f,h)),p&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function SQ(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||s!==-1&&t>s||xQ.test(e.slice(0,t))?e:""}function RE(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,r=n.indexOf(t);for(;r!==-1;)s++,r=n.indexOf(t,r+t.length);return s}function NQ(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function EQ(e,t,n){const r=uf((n||{}).ignore||[]),i=_Q(t);let a=-1;for(;++a<i.length;)nR(e,"text",l);function l(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],m=h?h.children:void 0;if(r(p,m?m.indexOf(p):void 0,h))return;h=p}if(h)return c(u,d)}function c(u,d){const f=d[d.length-1],h=i[a][0],p=i[a][1];let m=0;const w=f.children.indexOf(u);let g=!1,y=[];h.lastIndex=0;let x=h.exec(u.value);for(;x;){const S=x.index,A={index:x.index,input:x.input,stack:[...d,u]};let E=p(...x,A);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=S+1:(m!==S&&y.push({type:"text",value:u.value.slice(m,S)}),Array.isArray(E)?y.push(...E):E&&y.push(E),m=S+x[0].length,g=!0),!h.global)break;x=h.exec(u.value)}return g?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),f.children.splice(w,1,...y)):y=[u],w+y.length}}function _Q(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<n.length;){const r=n[s];t.push([CQ(r[0]),TQ(r[1])])}return t}function CQ(e){return typeof e=="string"?new RegExp(NQ(e),"g"):e}function TQ(e){return typeof e=="function"?e:function(){return e}}const d0="phrasing",f0=["autolink","link","image","label"];function AQ(){return{transforms:[LQ],enter:{literalAutolink:jQ,literalAutolinkEmail:h0,literalAutolinkHttp:h0,literalAutolinkWww:h0},exit:{literalAutolink:IQ,literalAutolinkEmail:DQ,literalAutolinkHttp:RQ,literalAutolinkWww:OQ}}}function MQ(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:d0,notInConstruct:f0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:d0,notInConstruct:f0},{character:":",before:"[ps]",after:"\\/",inConstruct:d0,notInConstruct:f0}]}}function jQ(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function h0(e){this.config.enter.autolinkProtocol.call(this,e)}function RQ(e){this.config.exit.autolinkProtocol.call(this,e)}function OQ(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function DQ(e){this.config.exit.autolinkEmail.call(this,e)}function IQ(e){this.exit(e)}function LQ(e){EQ(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,PQ],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),zQ]],{ignore:["link","linkReference"]})}function PQ(e,t,n,s,r){let i="";if(!rR(r)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!UQ(n)))return!1;const a=FQ(n+s);if(!a[0])return!1;const l={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[l,{type:"text",value:a[1]}]:l}function zQ(e,t,n,s){return!rR(s,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function UQ(e){const 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 FQ(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],s=n.indexOf(")");const r=RE(e,"(");let i=RE(e,")");for(;s!==-1&&r>i;)e+=n.slice(0,s+1),n=n.slice(s+1),s=n.indexOf(")"),i++;return[e,n]}function rR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Bl(n)||Dm(n))&&(!t||n!==47)}iR.peek=XQ;function BQ(){this.buffer()}function HQ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function $Q(){this.buffer()}function GQ(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function KQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=hr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qQ(e){this.exit(e)}function YQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=hr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function VQ(e){this.exit(e)}function XQ(){return"["}function iR(e,t,n,s){const r=n.createTracker(s);let i=r.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=r.move(n.safe(n.associationId(e),{after:"]",before:i})),l(),a(),i+=r.move("]"),i}function QQ(){return{enter:{gfmFootnoteCallString:BQ,gfmFootnoteCall:HQ,gfmFootnoteDefinitionLabelString:$Q,gfmFootnoteDefinition:GQ},exit:{gfmFootnoteCallString:KQ,gfmFootnoteCall:qQ,gfmFootnoteDefinitionLabelString:YQ,gfmFootnoteDefinition:VQ}}}function WQ(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:iR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(s,r,i,a){const l=i.createTracker(a);let c=l.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=l.move(i.safe(i.associationId(s),{before:c,after:"]"})),d(),c+=l.move("]:"),s.children&&s.children.length>0&&(l.shift(4),c+=l.move((t?`
526
+ `:" ")+i.indentLines(i.containerFlow(s,l.current()),t?aR:ZQ))),u(),c}}function ZQ(e,t,n){return t===0?e:aR(e,t,n)}function aR(e,t,n){return(n?"":" ")+e}const JQ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Pk.attention=rW;Pk.peek=iW;function eW(){return{canContainEols:["delete"],enter:{strikethrough:nW},exit:{strikethrough:sW}}}function tW(){return{handlers:{delete:Pk},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:JQ}]}}function nW(e){this.enter({type:"delete",children:[],position:void 0},e)}function sW(e){this.exit(e)}function Pk(e,t,n,s){const r=n.createTracker(s),i=n.stack.includes("strikethrough")?"~":"~~",a=n.enter("strikethrough");let l=r.move(i);return l+=n.containerPhrasing(e,{...r.current(),before:l,after:"~"}),l+=r.move(i),a(),l}function rW(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function iW(){return"~"}function aW(e){return e.length}function lW(e,t){const n=t||{},s=(n.align||[]).concat(),r=n.stringLength||aW,i=[],a=[],l=[],c=[];let u=0,d=-1;for(;++d<e.length;){const k=[],w=[];let g=-1;for(e[d].length>u&&(u=e[d].length);++g<e[d].length;){const y=oW(e[d][g]);if(n.alignDelimiters!==!1){const x=r(y);w[g]=x,(c[g]===void 0||x>c[g])&&(c[g]=x)}k.push(y)}a[d]=k,l[d]=w}let f=-1;if(typeof s=="object"&&"length"in s)for(;++f<u;)i[f]=OE(s[f]);else{const k=OE(s);for(;++f<u;)i[f]=k}f=-1;const h=[],p=[];for(;++f<u;){const k=i[f];let w="",g="";k===99?(w=":",g=":"):k===108?w=":":k===114&&(g=":");let y=n.alignDelimiters===!1?1:Math.max(1,c[f]-w.length-g.length);const x=w+"-".repeat(y)+g;n.alignDelimiters!==!1&&(y=w.length+y+g.length,y>c[f]&&(c[f]=y),p[f]=y),h[f]=x}a.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d<a.length;){const k=a[d],w=l[d];f=-1;const g=[];for(;++f<u;){const y=k[f]||"";let x="",S="";if(n.alignDelimiters!==!1){const A=c[f]-(w[f]||0),E=i[f];E===114?x=" ".repeat(A):E===99?A%2?(x=" ".repeat(A/2+.5),S=" ".repeat(A/2-.5)):(x=" ".repeat(A/2),S=x):S=" ".repeat(A)}n.delimiterStart!==!1&&!f&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||f)&&g.push(" "),n.alignDelimiters!==!1&&g.push(x),g.push(y),n.alignDelimiters!==!1&&g.push(S),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&g.push("|")}m.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return m.join(`
527
+ `)}function oW(e){return e==null?"":String(e)}function OE(e){const 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}const cW=uf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function uW(e,t,n,s){const r=n.enter("blockquote"),i=n.createTracker(s);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),dW);return r(),a}function dW(e,t,n){return">"+(n?"":" ")+e}function fW(e,t){return DE(e,t.inConstruct,!0)&&!DE(e,t.notInConstruct,!1)}function DE(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function IE(e,t,n,s){let r=-1;for(;++r<n.unsafe.length;){const i=n.unsafe[r];if(i.character===`
528
+ `&&!i.before&&!i.after&&fW(n.stack,i))return/[\t ]/.test(s.before)?"":" "}return`\\
529
+ `}function hW(e,t){const n=String(e);let s=n.indexOf(t),r=s,i=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===r?++i>a&&(a=i):i=1,r=s+t.length,s=n.indexOf(t,r);return a}function pW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function mW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function gW(e,t,n,s){const r=mW(n),i=e.value||"";if(pW(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,bW);return f(),h}const a=n.createTracker(s),l=r.repeat(Math.max(hW(i,r)+1,3)),c=n.enter("codeFenced"),u=r==="`"?"GraveAccent":"Tilde";let d=a.move(l);if(e.lang){const f=n.enter(`codeFencedLang${u}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${u}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
530
+ `,encode:["`"],...a.current()})),f()}return d+=a.move(`
531
+ `),i&&(d+=a.move(i+`
532
+ `)),d+=a.move(l),c(),d}function bW(e,t,n){return(n?"":" ")+e}function zk(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function xW(e,t,n,s){const r=zk(n),i=r==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(s);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
533
+ `,...c.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),a(),u}function yW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Uk.attention=vW;Uk.peek=kW;function Uk(e,t,n,s){const r=n.enter("phrasing"),i=n.containerPhrasing({type:"root",children:[e]},s);return r(),i}function vW(e,t){return{construct:"emphasis",markers:yW(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function kW(e,t,n){return n.options.emphasis||"*"}function wW(e){return"&#x"+e.toString(16).toUpperCase()+";"}function SW(e,t){let n=!1;return zm(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return n=!0,ey}),!!((!e.depth||e.depth<3)&&Tk(e)&&(t.options.setext||n))}function NW(e,t,n,s){const r=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(s);if(SW(e,n)){const f=n.enter("headingSetext"),h=n.enter("phrasing"),p=n.containerPhrasing(e,{...i.current(),before:`
534
+ `,after:`
535
+ `});return h(),f(),p+`
536
+ `+(r===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
537
+ `))+1))}const a="#".repeat(r),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
538
+ `,...i.current()});const d=u.charCodeAt(0);return(d===9||d===32)&&(u=wW(d)+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}lR.peek=EW;function lR(e){return e.value||""}function EW(){return"<"}oR.peek=_W;function oR(e,t,n,s){const r=zk(n),i=r==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(s);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),a(),u}function _W(){return"!"}cR.peek=CW;function cR(e,t,n,s){const r=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(s);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=d.filter(function(h){return h!=="phrasing"}),a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function CW(){return"!"}uR.peek=TW;function uR(e,t,n){let s=e.value||"",r="`",i=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(s);)r+="`";for(/[^\n\r ]/.test(s)&&(/^[\n\r ]/.test(s)&&/[\n\r ]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++i<n.unsafe.length;){const a=n.unsafe[i],l=n.compilePattern(a);if(!a.atBreak)continue;let c;for(;c=l.exec(s);){let u=c.index;s.charCodeAt(u)===10&&s.charCodeAt(u-1)===13&&u--,s=s.slice(0,u)+" "+s.slice(c.index+1)}}return r+s+r}function TW(){return"`"}function dR(e,t){const n=Tk(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))}fR.peek=AW;function fR(e,t,n,s){const r=zk(n),i=r==='"'?"Quote":"Apostrophe",a=n.createTracker(s);if(dR(e,n)){const d=n.stack;n.stack=d.filter(function(p){return p!=="phrasing"});const f=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),f(),n.stack=d,h}const l=n.enter("link");let c=n.enter("label"),u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${i}`),u+=a.move(" "+r),u+=a.move(n.safe(e.title,{before:u,after:r,...a.current()})),u+=a.move(r),c()),u+=a.move(")"),l(),u}function AW(e,t,n){return dR(e,n)?"<":"["}hR.peek=MW;function hR(e,t,n,s){const r=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(s);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=d.filter(function(h){return h!=="phrasing"}),a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function MW(){return"["}function Fk(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function jW(e){const t=Fk(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function RW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function pR(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function OW(e,t,n,s){const r=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?RW(n):Fk(n);const l=e.ordered?a==="."?")":".":jW(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.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),pR(n)===a&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=l),n.bulletCurrent=a;const u=n.containerFlow(e,s);return n.bulletLastUsed=a,n.bulletCurrent=i,r(),u}function DW(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function IW(e,t,n,s){const r=DW(n);let i=n.bulletCurrent||Fk(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(s);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?i:i+" ".repeat(a-i.length))+f}}function LW(e,t,n,s){const r=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,s);return i(),r(),a}function PW(e,t,n,s){if(!e.children.some(function(l){return cW(l)}))return n.containerFlow(e,s);const i=n.enter("phrasing"),a=n.containerPhrasing(e,s);return i(),a}function zW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Bk.attention=UW;Bk.peek=FW;function Bk(e,t,n,s){const r=n.enter("phrasing"),i=n.containerPhrasing({type:"root",children:[e]},s);return r(),i}function UW(e,t){return{construct:"strong",markers:zW(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function FW(e,t,n){return n.options.strong||"*"}function BW(e,t,n,s){return n.safe(e.value,s)}function HW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function $W(e,t,n){const s=(pR(n)+(n.options.ruleSpaces?" ":"")).repeat(HW(n));return n.options.ruleSpaces?s.slice(0,-1):s}const mR={blockquote:uW,break:IE,code:gW,definition:xW,emphasis:Uk,hardBreak:IE,heading:NW,html:lR,image:oR,imageReference:cR,inlineCode:uR,link:fR,linkReference:hR,list:OW,listItem:IW,paragraph:LW,root:PW,strong:Bk,text:BW,thematicBreak:$W};function GW(){return{enter:{table:KW,tableData:LE,tableHeader:LE,tableRow:YW},exit:{codeText:VW,table:qW,tableData:p0,tableHeader:p0,tableRow:p0}}}function KW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function qW(e){this.exit(e),this.data.inTable=void 0}function YW(e){this.enter({type:"tableRow",children:[]},e)}function p0(e){this.exit(e)}function LE(e){this.enter({type:"tableCell",children:[]},e)}function VW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,XW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function XW(e,t){return t==="|"?t:e}function QW(e){const t=e||{},n=t.tableCellPadding,s=t.tablePipeAlign,r=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
539
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:c,tableRow:l}};function a(p,m,k,w){return u(d(p,k,w),p.align)}function l(p,m,k,w){const g=f(p,k,w),y=u([g]);return y.slice(0,y.indexOf(`
540
+ `))}function c(p,m,k,w){const g=k.enter("tableCell"),y=k.enter("phrasing"),x=k.containerPhrasing(p,{...w,before:i,after:i});return y(),g(),x}function u(p,m){return lW(p,{align:m,alignDelimiters:s,padding:n,stringLength:r})}function d(p,m,k){const w=p.children;let g=-1;const y=[],x=m.enter("table");for(;++g<w.length;)y[g]=f(w[g],m,k);return x(),y}function f(p,m,k){const w=p.children;let g=-1;const y=[],x=m.enter("tableRow");for(;++g<w.length;)y[g]=c(w[g],p,m,k);return x(),y}function h(p,m,k){let w=mR.inlineCode(p,m,k);return k.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function WW(){return{exit:{taskListCheckValueChecked:PE,taskListCheckValueUnchecked:PE,paragraph:JW}}}function ZW(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:eZ}}}function PE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function JW(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const s=n.children[0];if(s&&s.type==="text"){const r=t.children;let i=-1,a;for(;++i<r.length;){const l=r[i];if(l.type==="paragraph"){a=l;break}}a===n&&(s.value=s.value.slice(1),s.value.length===0?n.children.shift():n.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,n.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function eZ(e,t,n,s){const r=e.children[0],i=typeof e.checked=="boolean"&&r&&r.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",l=n.createTracker(s);i&&l.move(a);let c=mR.listItem(e,t,n,{...s,...l.current()});return i&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+a}}function tZ(){return[AQ(),QQ(),eW(),GW(),WW()]}function nZ(e){return{extensions:[MQ(),WQ(e),tW(),QW(e),ZW()]}}const sZ={tokenize:cZ,partial:!0},gR={tokenize:uZ,partial:!0},bR={tokenize:dZ,partial:!0},xR={tokenize:fZ,partial:!0},rZ={tokenize:hZ,partial:!0},yR={name:"wwwAutolink",tokenize:lZ,previous:kR},vR={name:"protocolAutolink",tokenize:oZ,previous:wR},Di={name:"emailAutolink",tokenize:aZ,previous:SR},Yr={};function iZ(){return{text:Yr}}let Ya=48;for(;Ya<123;)Yr[Ya]=Di,Ya++,Ya===58?Ya=65:Ya===91&&(Ya=97);Yr[43]=Di;Yr[45]=Di;Yr[46]=Di;Yr[95]=Di;Yr[72]=[Di,vR];Yr[104]=[Di,vR];Yr[87]=[Di,yR];Yr[119]=[Di,yR];function aZ(e,t,n){const s=this;let r,i;return a;function a(f){return!ry(f)||!SR.call(s,s.previous)||Hk(s.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return ry(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(rZ,d,u)(f):f===45||f===95||qn(f)?(i=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),r=!0,c}function d(f){return i&&r&&rs(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function lZ(e,t,n){const s=this;return r;function r(a){return a!==87&&a!==119||!kR.call(s,s.previous)||Hk(s.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(sZ,e.attempt(gR,e.attempt(bR,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function oZ(e,t,n){const s=this;let r="",i=!1;return a;function a(f){return(f===72||f===104)&&wR.call(s,s.previous)&&!Hk(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(rs(f)&&r.length<5)return r+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const h=r.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),i?u:(i=!0,c)):n(f)}function u(f){return f===null||zp(f)||Ft(f)||Bl(f)||Dm(f)?n(f):e.attempt(gR,e.attempt(bR,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function cZ(e,t,n){let s=0;return r;function r(a){return(a===87||a===119)&&s<3?(s++,e.consume(a),r):a===46&&s===3?(e.consume(a),i):n(a)}function i(a){return a===null?n(a):t(a)}}function uZ(e,t,n){let s,r,i;return a;function a(u){return u===46||u===95?e.check(xR,c,l)(u):u===null||Ft(u)||Bl(u)||u!==45&&Dm(u)?c(u):(i=!0,e.consume(u),a)}function l(u){return u===95?s=!0:(r=s,s=void 0),e.consume(u),a}function c(u){return r||s||!i?n(u):t(u)}}function dZ(e,t){let n=0,s=0;return r;function r(a){return a===40?(n++,e.consume(a),r):a===41&&s<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(xR,t,i)(a):a===null||Ft(a)||Bl(a)?t(a):(e.consume(a),r)}function i(a){return a===41&&s++,e.consume(a),r}}function fZ(e,t,n){return s;function s(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),s):l===38?(e.consume(l),i):l===93?(e.consume(l),r):l===60||l===null||Ft(l)||Bl(l)?t(l):n(l)}function r(l){return l===null||l===40||l===91||Ft(l)||Bl(l)?t(l):s(l)}function i(l){return rs(l)?a(l):n(l)}function a(l){return l===59?(e.consume(l),s):rs(l)?(e.consume(l),a):n(l)}}function hZ(e,t,n){return s;function s(i){return e.consume(i),r}function r(i){return qn(i)?n(i):t(i)}}function kR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ft(e)}function wR(e){return!rs(e)}function SR(e){return!(e===47||ry(e))}function ry(e){return e===43||e===45||e===46||e===95||qn(e)}function Hk(e){let t=e.length,n=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){n=!0;break}if(s._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const pZ={tokenize:wZ,partial:!0};function mZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yZ,continuation:{tokenize:vZ},exit:kZ}},text:{91:{name:"gfmFootnoteCall",tokenize:xZ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:gZ,resolveTo:bZ}}}}function gZ(e,t,n){const s=this;let r=s.events.length;const i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let a;for(;r--;){const c=s.events[r][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const u=hr(s.sliceSerialize({start:a.end,end:s.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function bZ(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";const s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...l),e}function xZ(e,t,n){const s=this,r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let i=0,a;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!a||f===null||f===91||Ft(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(hr(s.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Ft(f)||(a=!0),i++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function yZ(e,t,n){const s=this,r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let i,a=0,l;return c;function c(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(a>999||m===93&&!l||m===null||m===91||Ft(m))return n(m);if(m===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return i=hr(s.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ft(m)||(l=!0),a++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),r.includes(i)||r.push(i),Et(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function vZ(e,t,n){return e.check(cf,t,e.attempt(pZ,t,n))}function kZ(e){e.exit("gfmFootnoteDefinition")}function wZ(e,t,n){const s=this;return Et(e,r,"gfmFootnoteDefinitionIndent",5);function r(i){const a=s.events[s.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function SZ(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:i,resolveAll:r};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function r(a,l){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let u=c;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[c][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[c][1].start)},h=[["enter",d,l],["enter",a[u][1],l],["exit",a[u][1],l],["enter",f,l]],p=l.parser.constructs.insideSpan.null;p&&Zs(h,h.length,0,Im(p,a.slice(u+1,c),l)),Zs(h,h.length,0,[["exit",f,l],["enter",a[c][1],l],["exit",a[c][1],l],["exit",d,l]]),Zs(a,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function i(a,l,c){const u=this.previous,d=this.events;let f=0;return h;function h(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(m):(a.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const k=Fp(u);if(m===126)return f>1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const w=a.exit("strikethroughSequenceTemporary"),g=Fp(m);return w._open=!g||g===2&&!!k,w._close=!k||k===2&&!!g,l(m)}}}class NZ{constructor(){this.map=[],this.index=new Map}add(t,n,s){EZ(this,t,n,s)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let r=s.pop();for(;r;){for(const i of r)t.push(i);r=s.pop()}this.map.length=0,this.index.clear()}}function EZ(e,t,n,s){if(n===0&&s.length===0)return;const r=e.index.get(t);if(r){r[1]+=n,r[2].push(...s);return}const i=[t,n,s];e.map.push(i),e.index.set(t,i)}function _Z(e,t){let n=!1;const s=[];for(;t<e.length;){const r=e[t];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=s.length-1;s[i]=s[i]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return s}function CZ(){return{flow:{null:{name:"table",tokenize:TZ,resolveAll:AZ}}}}function TZ(e,t,n){const s=this;let r=0,i=0,a;return l;function l(N){let F=s.events.length-1;for(;F>-1;){const{type:I}=s.events[F][1];if(I==="lineEnding"||I==="linePrefix")F--;else break}const G=F>-1?s.events[F][1].type:null,H=G==="tableHead"||G==="tableRow"?E:c;return H===E&&s.parser.lazy[s.now().line]?n(N):H(N)}function c(N){return e.enter("tableHead"),e.enter("tableRow"),u(N)}function u(N){return N===124||(a=!0,i+=1),d(N)}function d(N){return N===null?n(N):tt(N)?i>1?(i=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),p):n(N):ht(N)?Et(e,d,"whitespace")(N):(i+=1,a&&(a=!1,r+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(N)))}function f(N){return N===null||N===124||Ft(N)?(e.exit("data"),d(N)):(e.consume(N),N===92?h:f)}function h(N){return N===92||N===124?(e.consume(N),f):f(N)}function p(N){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(N):(e.enter("tableDelimiterRow"),a=!1,ht(N)?Et(e,m,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):m(N))}function m(N){return N===45||N===58?w(N):N===124?(a=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),k):A(N)}function k(N){return ht(N)?Et(e,w,"whitespace")(N):w(N)}function w(N){return N===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),g):N===45?(i+=1,g(N)):N===null||tt(N)?S(N):A(N)}function g(N){return N===45?(e.enter("tableDelimiterFiller"),y(N)):A(N)}function y(N){return N===45?(e.consume(N),y):N===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(N))}function x(N){return ht(N)?Et(e,S,"whitespace")(N):S(N)}function S(N){return N===124?m(N):N===null||tt(N)?!a||r!==i?A(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):A(N)}function A(N){return n(N)}function E(N){return e.enter("tableRow"),M(N)}function M(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),M):N===null||tt(N)?(e.exit("tableRow"),t(N)):ht(N)?Et(e,M,"whitespace")(N):(e.enter("data"),j(N))}function j(N){return N===null||N===124||Ft(N)?(e.exit("data"),M(N)):(e.consume(N),N===92?O:j)}function O(N){return N===92||N===124?(e.consume(N),j):j(N)}}function AZ(e,t){let n=-1,s=!0,r=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new NZ;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,c!==0&&(zE(h,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(s=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",d,t]])),r=m.type==="tableDelimiterRow"?2:d?3:1):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(s=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=th(h,t,i,r,void 0,f),i=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(s?s=!1:(i[1]!==0&&(a[0]=a[1],f=th(h,t,i,r,void 0,f)),i=a,a=[i[1],n,0,0])):m.type==="tableHead"?(l=!0,c=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(c=n,i[1]!==0?(a[0]=a[1],f=th(h,t,i,r,n,f)):a[1]!==0&&(f=th(h,t,a,r,n,f)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&zE(h,t,c,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=_Z(t.events,n))}return e}function th(e,t,n,s,r,i){const a=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(i.end=Object.assign({},io(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const c=io(t.events,n[1]);if(i={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const u=io(t.events,n[2]),d=io(t.events,n[3]),f={type:l,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),s!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,k=n[3]-n[2]-1;e.add(m,k,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(i.end=Object.assign({},io(t.events,r)),e.add(r,0,[["exit",i,t]]),i=void 0),i}function zE(e,t,n,s,r){const i=[],a=io(t.events,n);r&&(r.end=Object.assign({},a),i.push(["exit",r,t])),s.end=Object.assign({},a),i.push(["exit",s,t]),e.add(n+1,0,i)}function io(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const MZ={name:"tasklistCheck",tokenize:RZ};function jZ(){return{text:{91:MZ}}}function RZ(e,t,n){const s=this;return r;function r(c){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Ft(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return tt(c)?t(c):ht(c)?e.check({tokenize:OZ},t,n)(c):n(c)}}function OZ(e,t,n){return Et(e,s,"whitespace");function s(r){return r===null?n(r):t(r)}}function DZ(e){return I3([iZ(),mZ(),SZ(e),CZ(),jZ()])}const IZ={};function $k(e){const t=this,n=e||IZ,s=t.data(),r=s.micromarkExtensions||(s.micromarkExtensions=[]),i=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),a=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);r.push(DZ(n)),i.push(tZ()),a.push(nZ(n))}async function LZ(){const e=await fetch(`${Fr}/ai/status`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return await e.json()}async function PZ(e){const t=await fetch(`${Fr}/ai/models`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})});if(!t.ok){const n=await t.text();let s=n;try{const r=JSON.parse(n);typeof r.error=="string"&&r.error&&(s=r.error)}catch{}throw new Error(s||`HTTP ${t.status}`)}return await t.json()}async function zZ(e,t){const n=await fetch(`${Fr}/ai/chat`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({messages:e}),...t.signal?{signal:t.signal}:{}});if(!n.ok||!n.body){const a=await n.text().catch(()=>"");throw new Error(a||`HTTP ${n.status}`)}const s=n.body.getReader(),r=new TextDecoder;let i="";for(;;){const{done:a,value:l}=await s.read();if(a)break;i+=r.decode(l,{stream:!0});let c;for(;(c=i.indexOf(`
541
+ `))>=0;){const u=i.slice(0,c).trim();if(i=i.slice(c+1),!u.startsWith("data:"))continue;const d=u.slice(5).trim();if(!d)continue;let f;try{f=JSON.parse(d)}catch{continue}if(typeof f.error=="string"&&f.error!=="")throw new Error(f.error);if(typeof f.delta=="string"&&t.onDelta(f.delta),f.done===!0)return}}}let iy=!1;const ay=new Set;function UE(e){if(iy!==e){iy=e;for(const t of ay)t()}}function UZ(){return iy}function FZ(e){return ay.add(e),()=>ay.delete(e)}function BZ(){return b.useSyncExternalStore(FZ,UZ)}function vc({text:e}){return o.jsx("div",{className:"text-xs leading-relaxed text-neutral-200 [&_p]:my-1 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0 [&_strong]:font-semibold [&_strong]:text-neutral-100 [&_em]:italic [&_ul]:my-1 [&_ul]:list-disc [&_ul]:pl-4 [&_ol]:my-1 [&_ol]:list-decimal [&_ol]:pl-4 [&_li]:my-0.5 [&_code]:rounded [&_code]:bg-neutral-950/60 [&_code]:px-1 [&_code]:py-px [&_code]:text-[11px] [&_code]:text-neutral-300 [&_pre]:my-1.5 [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_pre]:rounded [&_pre]:border [&_pre]:border-edge/[0.06] [&_pre]:bg-neutral-950/60 [&_pre]:p-2 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-[11px] [&_h1]:mt-2 [&_h1]:mb-1 [&_h1]:text-[13px] [&_h1]:font-semibold [&_h2]:mt-2 [&_h2]:mb-1 [&_h2]:text-xs [&_h2]:font-semibold [&_h3]:mt-1.5 [&_h3]:mb-1 [&_h3]:text-xs [&_h3]:font-medium [&_blockquote]:my-1.5 [&_blockquote]:border-l-2 [&_blockquote]:border-neutral-700 [&_blockquote]:pl-2 [&_blockquote]:text-neutral-400 [&_a]:text-blue-400 [&_a]:underline [&_table]:my-0 [&_table]:w-full [&_table]:border-collapse [&_table]:text-[11px] [&_th]:border [&_th]:border-edge/[0.08] [&_th]:bg-neutral-950/40 [&_th]:px-1.5 [&_th]:py-1 [&_th]:text-left [&_th]:font-medium [&_td]:border [&_td]:border-edge/[0.08] [&_td]:px-1.5 [&_td]:py-1 [&_td]:align-top [&_hr]:my-2 [&_hr]:border-edge/[0.08]",children:o.jsx(Lk,{remarkPlugins:[$k],components:{a:({node:t,...n})=>o.jsx("a",{...n,target:"_blank",rel:"noreferrer"}),table:({node:t,...n})=>o.jsx("div",{className:"my-1.5 max-w-full overflow-x-auto",children:o.jsx("table",{...n})})},children:e})})}function HZ(){const e=We(),{show:t}=tn(),n=BZ(),[s,r]=b.useState(null),[i,a]=b.useState(!1),[l,c]=b.useState([]),[u,d]=b.useState(""),[f,h]=b.useState(""),[p,m]=b.useState(!1),k=b.useRef(null),w=b.useRef(null),g=b.useCallback(()=>{LZ().then(r).catch(()=>{})},[]);b.useEffect(()=>{g()},[g]),b.useEffect(()=>$r("settings",g),[g]),b.useEffect(()=>{const x=w.current;x&&(x.scrollTop=x.scrollHeight)},[l,f,i]);const y=b.useCallback(async()=>{const x=u.trim();if(x===""||p)return;const S=[...l,{role:"user",content:x}];c(S),d(""),h(""),m(!0);const A=new AbortController;k.current=A;let E="";try{await zZ(S,{signal:A.signal,onDelta:M=>{E+=M,h(E)}}),c([...S,{role:"assistant",content:E!==""?E:e("ai.emptyAnswer")}]),h("")}catch(M){h(""),M.name==="AbortError"?E!==""&&c([...S,{role:"assistant",content:E}]):t("error",e("ai.failed",{error:qe(M)}))}finally{k.current=null,m(!1)}},[p,u,l,t,e]);return(s==null?void 0:s.configured)!==!0||n?null:o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:()=>a(x=>!x),title:e(i?"ai.close":"ai.open"),className:"fixed bottom-4 right-4 z-50 grid h-11 w-11 place-items-center rounded-full border border-edge/[0.08] bg-neutral-900/90 text-neutral-300 shadow-mac backdrop-blur transition-colors hover:bg-neutral-800 hover:text-neutral-100",children:o.jsx(ux,{className:"h-5 w-5"})}),i&&sn.createPortal(o.jsxs("div",{className:"fixed bottom-20 right-4 z-[55] flex h-[520px] max-h-[70dvh] w-[380px] max-w-[calc(100vw-2rem)] flex-col overflow-hidden rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 border-b border-edge/[0.06] px-4 frosted",children:[o.jsx(ux,{className:"h-4 w-4 text-violet-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:e("ai.title")}),o.jsx("button",{type:"button",onClick:()=>c([]),title:e("ai.clear"),className:"ml-auto rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",children:o.jsx(er,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",onClick:()=>a(!1),title:e("ai.close"),className:"rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",children:o.jsx(Vt,{className:"h-4 w-4"})})]}),o.jsxs("div",{ref:w,className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-3",children:[l.length===0&&f===""&&o.jsxs("div",{className:"text-[11px] leading-relaxed text-neutral-500",children:[e("ai.empty"),o.jsxs("div",{className:"mt-1 text-neutral-600",children:[e("ai.intro"),s.docsFound?"":e("ai.docsMissing")]})]}),l.map((x,S)=>o.jsx("div",{className:x.role==="user"?"flex justify-end":"flex justify-start",children:x.role==="user"?o.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-lg bg-blue-600/25 px-2.5 py-1.5 text-xs text-blue-50",children:x.content}):o.jsx("div",{className:"max-w-[92%] break-words rounded-lg bg-neutral-800/70 px-2.5 py-1.5 text-xs text-neutral-200",children:o.jsx(vc,{text:x.content})})},S)),p&&f===""&&o.jsx("div",{className:"flex justify-start",children:o.jsx("div",{className:"animate-pulse rounded-lg bg-neutral-800/70 px-2.5 py-1.5 text-xs text-neutral-400",children:e("ai.thinking")})}),f!==""&&o.jsx("div",{className:"flex justify-start",children:o.jsx("div",{className:"max-w-[92%] break-words rounded-lg bg-neutral-800/70 px-2.5 py-1.5 text-xs text-neutral-200",children:o.jsx(vc,{text:f})})})]}),o.jsxs("form",{className:"shrink-0 flex items-end gap-2 border-t border-edge/[0.06] p-2",onSubmit:x=>{x.preventDefault(),y()},children:[o.jsx("textarea",{value:u,rows:2,onChange:x=>d(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),y())},placeholder:e("ai.placeholder"),className:"min-h-0 flex-1 resize-none rounded-lg border border-neutral-800 bg-neutral-950 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-neutral-600 focus:outline-none"}),p?o.jsx("button",{type:"button",onClick:()=>{var x;return(x=k.current)==null?void 0:x.abort()},title:e("ai.stop"),className:"grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-neutral-800 text-neutral-300 hover:bg-neutral-700",children:o.jsx(xM,{className:"h-3.5 w-3.5"})}):o.jsx("button",{type:"submit",disabled:u.trim()==="",title:e("ai.send"),className:"grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-blue-600 text-white hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-40",children:o.jsx(mM,{className:"h-3.5 w-3.5"})})]})]}),document.body)]})}function eo(e,t){return e==="plain"?t:t==="plain"?e:e==="code"||t==="code"?"code":e==="link"||t==="link"?"link":e==="del"||t==="del"?"del":"strongEm"}const $Z=/(`+)([\s\S]*?)\1|~{2}([\s\S]+?)~{2}|\*{2}([\s\S]+?)\*{2}|_{2}([\s\S]+?)_{2}|\*([^*\n]+?)\*|_([^_\n]+?)_|\[([^\]\n]*)\]\(([^)\s]*)\)|(https?:\/\/[^\s<>()]+)|(\\(?:[\\`*_~{}[\]()#+\-.!>|]))/;function zr(e,t="plain"){var a;const n=[];let s="",r=e;const i=()=>{s!==""&&(n.push({text:s,style:t}),s="")};for(;r!=="";){const l=$Z.exec(r);if(!l||l.index===void 0)break;s+=r.slice(0,l.index);const c=l.slice(1);if(c[1]!==void 0)i(),n.push({text:c[1],style:eo(t,"code")});else if(c[2]!==void 0)i(),n.push(...zr(c[2],eo(t,"del")));else if(c[3]!==void 0||c[4]!==void 0)i(),n.push(...zr(c[3]??c[4],eo(t,"strong")));else if(c[5]!==void 0||c[6]!==void 0)i(),n.push(...zr(c[5]??c[6],eo(t,"em")));else if(c[7]!==void 0){const u=c[7],d=c[8]??"";i();const f=d!==""&&d!==u?`${u||d} (${d})`:u||d;f!==""&&n.push(...zr(f,eo(t,"link")))}else if(c[9]!==void 0){const u=((a=/[.,;:!?]+$/.exec(c[9]))==null?void 0:a[0])??"",d=c[9].slice(0,c[9].length-u.length);i(),n.push({text:d,style:eo(t,"link")}),s=u}else c[10]!==void 0&&(s+=c[10].slice(1));r=r.slice(l.index+l[0].length)}return s+=r,i(),n}const GZ=/^ {0,3}(`{3,}|~{3,})/,KZ=/^ {0,3}(`{3,}|~{3,})\s*$/,qZ=/^ {0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,YZ=/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/,FE=/^ {0,3}>\s?(.*)$/,NR=/^(\s*)([-*+])\s+(.*)$/,ER=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,VZ=/^\[([ xX])\]\s+(.*)$/,XZ=/^ {0,3}(#{1,6}\s|>|`{3,}|~{3,}|[-*+]\s|\d{1,9}[.)]\s)/;function _R(e){let t=e.trim();t.startsWith("|")&&(t=t.slice(1));const n=[];let s="";for(let i=0;i<t.length;i++){const a=t[i];if(a==="\\"&&t[i+1]==="|"){s+="|",i++;continue}if(a==="|"){n.push(s),s="";continue}s+=a}n.push(s);const r=n[n.length-1];return n.length>1&&r.trim()===""&&n.pop(),n.map(i=>i.trim())}function CR(e){if(!e.includes("-"))return!1;const t=_R(e);return t.length>=1&&t.every(n=>/^:?-+:?$/.test(n))}function QZ(e,t,n){const s=[];let r=t;for(;r<e.length;){const i=e[r];if(i.trim()===""||!i.includes("|"))break;r++,!CR(i)&&s.push(_R(i).map(a=>zr(a)))}return s.length>0&&n.push({kind:"table",rows:s}),r}function WZ(e,t,n){const s=[];let r=t;for(;r<e.length;){const i=e[r],a=NR.exec(i),l=a?null:ER.exec(i);if(!a&&!l){const f=s[s.length-1];if(f&&i.trim()!==""&&/^\s{2,}/.test(i)&&!XZ.test(i)){f.spans=[...f.spans,{text:" ",style:"plain"},...zr(i.trim())],r++;continue}break}const c=Math.min(3,Math.floor((a??l)[1].length/2));let u,d;if(a){const f=VZ.exec(a[3]);f?(u=f[1].toLowerCase()==="x"?"☑":"☐",d=f[2]):(u="•",d=a[3])}else u=`${l[2]}.`,d=l[3];s.push({marker:u,level:c,spans:zr(d)}),r++}return n.push({kind:"list",items:s}),r}function ZZ(e){const t=e.replace(/\r\n?/g,`
542
+ `).replace(/\t/g," ").split(`
543
+ `),n=[],s=[],r=()=>{s.length>0&&(n.push({kind:"p",spans:zr(s.join(" ").replace(/ {2,}/g," "))}),s.length=0)};let i=0;for(;i<t.length;){const a=t[i],l=GZ.exec(a);if(l){r();const u=[];for(i++;i<t.length;){const d=KZ.exec(t[i]);if(d&&d[1][0]===l[1][0]&&d[1].length>=l[1].length){i++;break}u.push(t[i]),i++}n.push({kind:"code",lines:u});continue}if(a.trim()===""){r(),i++;continue}const c=qZ.exec(a);if(c){r(),n.push({kind:"h",level:c[1].length,spans:zr(c[2])}),i++;continue}if(YZ.test(a)){r(),n.push({kind:"hr"}),i++;continue}if(a.includes("|")&&i+1<t.length&&CR(t[i+1])){r(),i=QZ(t,i,n);continue}if(FE.test(a)){r();const u=[];for(;i<t.length;){const d=FE.exec(t[i]);if(!d)break;u.push(d[1].trim()===""?[]:zr(d[1])),i++}n.push({kind:"quote",lines:u});continue}if(NR.test(a)||ER.test(a)){r(),i=WZ(t,i,n);continue}s.push(a.trim()),i++}return r(),n}const $h=880,uu=24,mi=10,BE=12,TR=Math.round(($h-uu*2)*.78),Gi=TR-mi*2,nh=19,du=16,JZ=21,eJ=4,tJ=8,HE=2,nJ=16,Zc=8,sh=6,ly=2,Pu=6,sJ=44,oy=14,rJ=2,m0=6,cy=oy+rJ,iJ=16e6,Ki='ui-sans-serif, system-ui, "Segoe UI", "Microsoft YaHei", sans-serif',aJ='ui-monospace, SFMono-Regular, Menlo, Consolas, "Microsoft YaHei", monospace',Gk={meta:`10px ${Ki}`,body:`12px ${Ki}`,small:`11px ${Ki}`,strong:`600 12px ${Ki}`,em:`italic 12px ${Ki}`,strongEm:`600 italic 12px ${Ki}`,h1:`600 13px ${Ki}`,h3:`500 12px ${Ki}`,mono:`11px ${aJ}`},lJ={dark:{assistant:{fill:"rgba(38,38,38,0.5)",stroke:"rgba(255,255,255,0.08)"},user:{fill:"rgba(59,130,246,0.12)",stroke:"rgba(59,130,246,0.3)"},userTyped:{fill:"rgba(59,130,246,0.05)",stroke:"rgba(59,130,246,0.15)"},failed:{fill:"rgba(69,10,10,0.2)",stroke:"rgba(239,68,68,0.3)"}},light:{assistant:{fill:"rgba(229,229,229,0.5)",stroke:"rgba(0,0,0,0.08)"},user:{fill:"rgba(59,130,246,0.12)",stroke:"rgba(59,130,246,0.3)"},userTyped:{fill:"rgba(59,130,246,0.05)",stroke:"rgba(59,130,246,0.15)"},failed:{fill:"rgba(254,242,242,0.2)",stroke:"rgba(239,68,68,0.3)"}}},oJ={dark:"#0f0f0f",light:"#f8f8f8"},AR={dark:{fg:"#e5e5e5",strong:"#f5f5f5",code:"#d4d4d4",codeBg:"rgba(10,10,10,0.6)",codeBorder:"rgba(255,255,255,0.06)",link:"#60a5fa",quote:"#a3a3a3",quoteBar:"#404040",tableBorder:"rgba(255,255,255,0.08)",tableHeadBg:"rgba(10,10,10,0.4)"},light:{fg:"#171717",strong:"#0a0a0a",code:"#262626",codeBg:"rgba(250,250,250,0.6)",codeBorder:"rgba(0,0,0,0.06)",link:"#1d4ed8",quote:"#404040",quoteBar:"#d4d4d4",tableBorder:"rgba(0,0,0,0.08)",tableHeadBg:"rgba(250,250,250,0.4)"}},cJ={dark:{time:"#525252",weaveFg:"#93c5fd",weaveBg:"rgba(59,130,246,0.15)",nameFg:"#a3a3a3",nameBorder:"rgba(255,255,255,0.12)",planFg:"#fcd34d",planBg:"rgba(245,158,11,0.15)",failed:"#fca5a5"},light:{time:"#666666",weaveFg:"#1e40af",weaveBg:"rgba(59,130,246,0.15)",nameFg:"#404040",nameBorder:"rgba(0,0,0,0.12)",planFg:"#92400e",planBg:"rgba(245,158,11,0.15)",failed:"#991b1b"}};function uJ(e,t,n){switch(e){case"strong":return{font:n??"strong",fg:t.strong};case"em":return{font:n||"em",fg:t.fg};case"strongEm":return{font:n??"strongEm",fg:t.strong};case"code":return{font:"mono",fg:t.code,bg:t.codeBg};case"link":return{font:n??"body",fg:t.link,underline:!0};case"del":return{font:n??"body",fg:t.fg,strike:!0};default:return{font:n??"body",fg:t.fg}}}const dJ=/[A-Za-z0-9@._/:%+~=?#&$'"-]+|\s+|[\s\S]/g;function fJ(e,t){return e.font===t.font&&e.fg===t.fg&&e.bg===t.bg&&e.border===t.border&&e.underline===t.underline&&e.strike===t.strike}function Va(e,t,n,s,r,i={}){const a=[];let l=[],c=0;const u=()=>{const f=l[l.length-1];if(f){const h=f.text.replace(/\s+$/,"");h===""?l.pop():h!==f.text&&(f.w-=e(f.font,f.text.slice(h.length)),f.text=h)}a.push({spans:l,indent:0,lh:r,gap:0}),l=[],c=0},d=(f,h,p)=>{const m=l[l.length-1];if(m&&fJ(m,h)){m.text+=f,m.w+=p;return}l.push({...h,text:f,w:p})};for(const f of t){const h=uJ(f.style,n,i.base);for(const p of f.text.match(dJ)??[]){const m=/^\s+$/.test(p);if(m&&l.length===0&&!i.keepSpace)continue;const k=e(h.font,p);if(!(l.length>0&&c+k>s&&(u(),m&&!i.keepSpace))){if(l.length===0&&k>s){for(const w of p){const g=e(h.font,w);l.length>0&&c+g>s&&u(),d(w,h,g),c+=g}continue}d(p,h,k),c+=k}}}return(l.length>0||a.length===0)&&u(),a}function $E(e){var t;return e.indent+(((t=e.marker)==null?void 0:t.w)??0)+e.spans.reduce((n,s)=>n+s.w,0)}function g0(e){return e.reduce((t,n)=>t+n.gap+n.lh,0)}function hJ(e){return e==="flow"?eJ:tJ}function pJ(e,t,n,s,r,i){const a=cJ[t],l={text:i.stamp(n),font:"meta",fg:a.time,w:e("meta",i.stamp(n))},c=[];for(const[p,m]of s.entries()){p>0&&c.push({text:"",font:"meta",fg:a.time,w:m0});const k=e("meta",m.text);c.push(m.kind==="weave"?{text:m.text,font:"meta",fg:a.weaveFg,bg:a.weaveBg,w:k}:m.kind==="plan"?{text:m.text,font:"meta",fg:a.planFg,bg:a.planBg,w:k}:{text:m.text,font:"meta",fg:a.nameFg,border:a.nameBorder,w:k})}const u={text:"",font:"meta",fg:a.time,w:m0},d=r==="user"?c:[l,...c.length>0?[u,...c]:[]],f=r==="user"?[l]:[],h=d.reduce((p,m)=>p+m.w,0)+(f.length?m0+f.reduce((p,m)=>p+m.w,0):0);return{left:d,right:f,w:h}}function mJ(e,t,n){const s=[];let r=0;const i=l=>{const c=s.length===0?0:hJ(l.kind);s.push({...l,y:r,gap:c}),r+=c+l.h},a=l=>({kind:"flow",h:g0(l),w:Math.max(0,...l.map($E)),lines:l});for(const l of ZZ(t))switch(l.kind){case"hr":i({kind:"rule",h:1,w:Gi});break;case"h":{const c=l.level===1?"h1":l.level===2?"strong":"h3";i(a(Va(e,l.spans,n,Gi,c==="h1"?JZ:nh,{base:c})));break}case"p":i(a(Va(e,l.spans,n,Gi,nh)));break;case"list":{const c=[];for(const u of l.items){const d=`${u.marker} `,f=e("body",d),h=u.level*nJ;Va(e,u.spans,n,Gi-h-f,nh).forEach((m,k)=>{m.indent=k===0?h:h+f,m.gap=k===0&&c.length>0?HE:0,k===0&&(m.marker={text:d,font:"body",fg:n.fg,w:f}),c.push(m)})}i(a(c));break}case"quote":{const c={...n,fg:n.quote,strong:n.quote},u=[];for(const[d,f]of l.lines.entries())Va(e,f,c,Gi-sh-ly,nh).forEach((p,m)=>{p.indent=sh+ly,p.gap=d>0&&m===0?HE:0,u.push(p)});i({kind:"box",h:g0(u)+sh,w:Math.max(0,...u.map($E)),leftBar:n.quoteBar,pad:sh/2,lines:u});break}case"code":{const c={...n,fg:n.code},u=[];for(const d of l.lines.length>0?l.lines:[""]){const f=Va(e,[{text:d,style:"plain"}],c,Gi-Zc*2,du,{base:"mono",keepSpace:!0});for(const h of f)h.indent=Zc,u.push(h)}i({kind:"box",h:g0(u)+Zc*2,w:Math.max(0,...u.map(d=>d.spans.reduce((f,h)=>f+h.w,0)))+Zc*2,fill:n.codeBg,border:n.codeBorder,pad:Zc,lines:u});break}case"table":{const c=l.rows;if(c.length===0)break;const u=Math.max(...c.map(k=>k.length)),d=Array.from({length:u},(k,w)=>{let g=0;for(const y of c){const x=y[w];if(!x)continue;const S=Va(e,x,n,Number.MAX_SAFE_INTEGER,du,{base:"small"})[0];g=Math.max(g,S?S.spans.reduce((A,E)=>A+E.w,0):0)}return g+Pu*2}),f=d.reduce((k,w)=>k+w,0),h=f>Gi?Gi/f:1,p=d.map(k=>Math.max(sJ,k*h)),m=c.map((k,w)=>{const g=p.map((x,S)=>Va(e,k[S]??[],n,Math.max(10,x-Pu*2),du,{base:"small"})),y=Math.max(...g.map(x=>x.length))*du+Pu*2;return{head:w===0,h:y,cells:g}});i({kind:"table",h:m.reduce((k,w)=>k+w.h,0),w:p.reduce((k,w)=>k+w,0),colW:p,rows:m});break}}return s}function gJ(e,t,n=2){for(const s of[n,1])if(e*s*t*s<=iJ)return s;return 1}function bJ(e){return e.failed===!0?"failed":e.role==="assistant"?"assistant":e.viaWeave===!0?"user":"userTyped"}function xJ(e,t,n){const s=AR[n.theme];let r=uu;const i=[];for(const l of t){const c=mJ(e,l.text,s),u=pJ(e,n.theme,l.at,l.tags??[],l.role,n),d=Math.max(u.w,0,...c.map(p=>p.w)),f=c.reduce((p,m)=>p+m.gap+m.h,0),h=Math.min(TR,d+mi*2);i.push({role:l.role,variant:bJ(l),meta:u,x:l.role==="user"?$h-uu-h:uu,y:r,w:h,h:cy+f+mi*2,blocks:c}),r+=cy+f+mi*2+BE}const a=Math.round(t.length>0?r-BE+uu:r);return{width:$h,height:a,scale:gJ($h,a,n.scale),theme:n.theme,bubbles:i}}function uy(e,t,n,s,r,i){e.beginPath(),e.moveTo(t+i,n),e.arcTo(t+s,n,t+s,n+r,i),e.arcTo(t+s,n+r,t,n+r,i),e.arcTo(t,n+r,t,n,i),e.arcTo(t,n+r,t,n,i),e.closePath()}function dy(e,t,n,s,r){if(e.font=Gk[t.font],(t.bg||t.border)&&(uy(e,n-2,s-1,t.w+4,r-4,3),t.bg&&(e.fillStyle=t.bg,e.fill()),t.border&&(e.save(),e.lineWidth=1,e.strokeStyle=t.border,e.stroke(),e.restore())),e.fillStyle=t.fg,e.fillText(t.text,n,s),t.underline||t.strike){e.strokeStyle=t.fg,e.beginPath();const i=t.underline?s+r-4:s+r/2+1;e.moveTo(n,i),e.lineTo(n+t.w,i),e.stroke()}}function b0(e,t,n,s){var i;let r=s;for(const a of t){r+=a.gap,a.marker&&(e.font=Gk[a.marker.font],e.fillStyle=a.marker.fg,e.fillText(a.marker.text,n+a.indent,r));let l=n+a.indent+(((i=a.marker)==null?void 0:i.w)??0);for(const c of a.spans)dy(e,c,l,r,a.lh),l+=c.w;r+=a.lh}}function yJ(e,t){const n=AR[t.theme];e.fillStyle=oJ[t.theme],e.fillRect(0,0,t.width,t.height),e.textBaseline="top",e.textAlign="left",e.lineWidth=1;for(const s of t.bubbles){const r=lJ[t.theme][s.variant];uy(e,s.x,s.y,s.w,s.h,8),e.fillStyle=r.fill,e.fill(),e.strokeStyle=r.stroke,e.stroke();const i=s.x+mi,a=s.w-mi*2;let l=i;for(const u of s.meta.left)dy(e,u,l,s.y+mi,oy),l+=u.w;l=i+a-s.meta.right.reduce((u,d)=>u+d.w,0);for(const u of s.meta.right)dy(e,u,l,s.y+mi,oy),l+=u.w;const c=s.y+mi+cy;for(const u of s.blocks){const d=c+u.y;if(u.kind==="rule"){e.strokeStyle=n.tableBorder,e.beginPath(),e.moveTo(i,d+.5),e.lineTo(i+a,d+.5),e.stroke();continue}if(u.kind==="flow"){b0(e,u.lines,i,d);continue}if(u.kind==="box"){(u.fill||u.border)&&(uy(e,i,d,u.w,u.h,4),u.fill&&(e.fillStyle=u.fill,e.fill()),u.border&&(e.strokeStyle=u.border,e.stroke())),u.leftBar&&(e.fillStyle=u.leftBar,e.fillRect(i,d,ly,u.h)),b0(e,u.lines,i,d+u.pad);continue}let f=d;for(const p of u.rows){p.head&&(e.fillStyle=n.tableHeadBg,e.fillRect(i,f,u.w,p.h));let m=i;p.cells.forEach((k,w)=>{k.forEach((g,y)=>b0(e,[{...g,indent:Pu,gap:0}],m,f+Pu+y*du)),m+=u.colW[w]??0}),e.strokeStyle=n.tableBorder,e.beginPath(),e.moveTo(i,f+.5),e.lineTo(i+u.w,f+.5),e.moveTo(i,f+p.h+.5),e.lineTo(i+u.w,f+p.h+.5),e.stroke(),f+=p.h}let h=i;e.strokeStyle=n.tableBorder;for(const p of u.colW)e.beginPath(),e.moveTo(h+.5,d),e.lineTo(h+.5,d+u.h),e.stroke(),h+=p;e.beginPath(),e.moveTo(h+.5,d),e.lineTo(h+.5,d+u.h),e.stroke()}}}async function MR(e,t){const n=document.createElement("canvas").getContext("2d");if(!n)throw new Error("canvas 2d context unavailable");const r=xJ((c,u)=>(n.font=Gk[c],n.measureText(u).width),e,t),i=document.createElement("canvas");i.width=Math.round(r.width*r.scale),i.height=Math.round(r.height*r.scale);const a=i.getContext("2d");if(!a)throw new Error("canvas 2d context unavailable");a.scale(r.scale,r.scale),yJ(a,r);const l=await new Promise(c=>i.toBlob(c,"image/png"));if(!l)throw new Error("image encoding failed");return l}function jR(e,t=new Date){const n=i=>String(i).padStart(2,"0"),s=e.replace(/[\\/:*?"<>|\s]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40),r=`${t.getFullYear()}${n(t.getMonth()+1)}${n(t.getDate())}-${n(t.getHours())}${n(t.getMinutes())}${n(t.getSeconds())}`;return`weave-${s||"conversation"}-${r}.png`}function RR(e,t){const n=URL.createObjectURL(e),s=document.createElement("a");s.href=n,s.download=t,s.click(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}const vJ=120,OR=40,kJ=500;function wJ(e,t,n){const s=t===1?e*16:e,r=n==="top"?-s:s;return Math.max(0,Math.min(OR,r))}function SJ(e,t){const n=t==="top"?e:-e;return Math.max(0,Math.min(OR,n))}function NJ(e=vJ){let t=0,n=!1,s=!1;return{setEdge(r){n=r,r||(t=0,s=!1)},add(r){return!n||r<=0?{value:t,fired:!1}:(t+=r,s||t<e?{value:t,fired:!1}:(s=!0,t=0,{value:0,fired:!0}))},reset(){t=0,s=!1}}}function Kk(e){const[t,n]=b.useState(0),s=b.useRef(NJ()),r=b.useRef(null),i=b.useRef(null),a=b.useRef(e);a.current=e;const l=b.useCallback(()=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),s.current.reset(),n(0)},[]),c=b.useCallback(d=>{if(!a.current.enabled||d<=0)return;const f=s.current;f.setEdge(a.current.getEdge());const h=f.add(d);if(h.fired){l(),a.current.onFire();return}n(h.value),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(l,kJ)},[l]),u=b.useCallback(d=>{const f=r.current;r.current=d,f!==null&&c(SJ(d-f,a.current.axis))},[c]);return b.useEffect(()=>{e.enabled||l()},[e.enabled,l]),{px:t,syncEdge:b.useCallback(()=>s.current.setEdge(a.current.getEdge()),[]),wheel:b.useCallback((d,f)=>c(wJ(d,f,a.current.axis)),[c]),touchStart:b.useCallback(d=>{r.current=d},[]),touchMove:u,touchEnd:b.useCallback(()=>{r.current=null,l()},[l])}}const DR="weave:theme",EJ={dark:"#0a0a0a",light:"#fafafa"};function _J(){try{const e=localStorage.getItem(DR);return e==="dark"||e==="light"?e:null}catch{return null}}function CJ(){var e;return(e=globalThis.matchMedia)!=null&&e.call(globalThis,"(prefers-color-scheme: light)").matches?"light":"dark"}let So=_J()??CJ();const fy=new Set;function IR(e){var t;document.documentElement.dataset.theme=e,(t=document.querySelector('meta[name="theme-color"]'))==null||t.setAttribute("content",EJ[e])}function TJ(){return So}function AJ(){So=So==="dark"?"light":"dark";try{localStorage.setItem(DR,So)}catch{}IR(So);for(const e of fy)e()}function MJ(e){return fy.add(e),()=>fy.delete(e)}function qk(){return b.useSyncExternalStore(MJ,TJ)}typeof document<"u"&&IR(So);const rh=10,GE=168,KE=72,jJ=300,qE=8,YE=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=s=>String(s).padStart(2,"0");return`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`},hy=e=>{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=s=>String(s).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`},RJ=(e,t)=>e.flatMap(n=>{const s=`[${hy(n.askedAt)}] ${t.ask}
544
+ ${n.question}`;if(n.status!=="answered")return[s];const r=hy(n.answeredAt??n.askedAt);return[s,`[${r}] ${t.answer}
545
+ ${n.answer??""}`]}).join(`
546
+
547
+ `),OJ=(e,t,n)=>e.flatMap(s=>{const r={role:"user",at:s.askedAt,text:s.question,tags:[{kind:"name",text:t}]};return s.status!=="answered"?[r]:[r,{role:"assistant",at:s.answeredAt??s.askedAt,text:s.answer??"",tags:[{kind:"name",text:n}]}]});function DJ({on:e}){return o.jsx("span",{className:de("inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border",e?"border-blue-400 bg-blue-500 text-white":"border-neutral-600 bg-neutral-900"),children:e&&o.jsx(mr,{className:"h-2.5 w-2.5",strokeWidth:3})})}function IJ({sessionId:e,label:t,onClose:n}){const s=We(),r=dn(),{show:i}=tn(),a=qk(),[l,c]=b.useState(null),[u,d]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(""),[k,w]=b.useState(()=>new Set),g=b.useRef(0),[y,x]=b.useState(!1),[S,A]=b.useState(()=>new Set),[E,M]=b.useState(null),j=b.useRef(null),O=b.useRef(null),N=b.useRef(null),F=Si("(pointer: coarse)"),G=b.useCallback(se=>{c(Q=>{const Te=new Map;for(const xe of Q??[])Te.set(xe.id,xe);for(const xe of se)Te.set(xe.id,xe);return[...Te.values()].sort((xe,ve)=>ve.id-xe.id)})},[]),H=b.useCallback(async()=>{const se=await Ce.listSideQuestions(e,{limit:rh});G(se),d(se.length<rh)},[e,G]);b.useEffect(()=>{let se=!0;return H().catch(()=>{se&&c([])}),()=>{se=!1}},[H]),b.useEffect(()=>Ai(se=>{se.sessionId===e&&H().catch(()=>{})},["sideQuestion.answered"]),[e,H]),b.useEffect(()=>{var Q;const se=(Q=l==null?void 0:l[0])==null?void 0:Q.id;se===void 0||se<=g.current||(g.current=se,w(Te=>new Set(Te).add(se)))},[l]),b.useEffect(()=>{const se=Q=>{Q.key==="Escape"&&(E?M(null):y?(x(!1),A(new Set)):n())};return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[E,y,n]),b.useEffect(()=>{if(!E)return;const se=Te=>{var xe,ve;(ve=(xe=Te.target)==null?void 0:xe.closest)!=null&&ve.call(xe,"[data-side-menu]")||(Te.stopPropagation(),M(null))},Q=()=>M(null);return window.addEventListener("pointerdown",se,!0),window.addEventListener("contextmenu",se,!0),window.addEventListener("wheel",Q,{capture:!0,passive:!0}),window.addEventListener("resize",Q),()=>{window.removeEventListener("pointerdown",se,!0),window.removeEventListener("contextmenu",se,!0),window.removeEventListener("wheel",Q,!0),window.removeEventListener("resize",Q)}},[E]);const I=async()=>{const se=l==null?void 0:l[l.length-1];if(!(!se||f)){h(!0);try{const Q=await Ce.listSideQuestions(e,{beforeId:se.id,limit:rh});G(Q),d(Q.length<rh)}catch{}finally{h(!1)}}},L=Kk({axis:"top",getEdge:()=>{var se;return(((se=j.current)==null?void 0:se.scrollTop)??1)<=1},onFire:()=>void I(),enabled:l!==null&&!u&&!f}),C=l===null?null:[...l].reverse(),D=C&&C.length>0?String(C[C.length-1].id):void 0,U=b.useRef(void 0);b.useLayoutEffect(()=>{if(D===void 0||D===U.current)return;U.current=D;const se=j.current;se&&(se.scrollTop=se.scrollHeight)},[D]);const B=r.stateOf("sideAsk")==="loading",R=()=>{const se=p.trim();!se||B||r.run("sideAsk",async()=>{const{sideQuestion:Q}=await Ce.askSideQuestion(e,se);G([Q]),m("")},{fail:Q=>s("tasks.sideFailed",{error:qe(Q)})})},_=se=>w(Q=>{const Te=new Set(Q);return Te.has(se)?Te.delete(se):Te.add(se),Te}),K=se=>A(Q=>{const Te=new Set(Q);return Te.has(se)?Te.delete(se):Te.add(se),Te}),T=se=>{M(null),x(!0),se!==void 0&&A(new Set([se]))},X=(C??[]).filter(se=>S.has(se.id)),ne=C!==null&&C.length>0&&C.every(se=>S.has(se.id)),J=()=>A(ne?new Set:new Set((C??[]).map(se=>se.id))),pe=se=>{if(se.length===0)return;const Q=RJ(se,{ask:s("tasks.sideRoleAsk"),answer:s("tasks.sideRoleAnswer")});lf(Q).then(Te=>i(Te?"success":"error",Te?s("tasks.convCopyOk",{n:se.length}):s("tasks.convCopyFailed")))},q=se=>{const Q=X;Q.length!==0&&(M(null),r.run("sideImg",async()=>{let Te;try{Te=await MR(OJ(Q,s("tasks.sideRoleAsk"),s("tasks.sideRoleAnswer")),{stamp:hy,theme:a})}catch(xe){throw new Error(s("tasks.convImgFailed",{error:qe(xe)}))}if(se==="download")RR(Te,jR(t)),i("success",s("tasks.convImgSaved"));else if(await m3(Te))i("success",s("tasks.convImgOk",{n:Q.length}));else throw new Error(s("tasks.convImgCopyFailed"))},{fail:qe}))},Y=se=>{const Q=se.currentTarget.getBoundingClientRect();M({kind:"share",x:Q.right-GE,y:Q.top-KE})},V=se=>Q=>{!F||y||Q.button!==0||(O.current={id:se,x:Q.clientX,y:Q.clientY})},ee=se=>{const Q=O.current;Q&&(Math.abs(se.clientX-Q.x)>qE||Math.abs(se.clientY-Q.y)>qE)&&(O.current=null)},oe=se=>Q=>{const Te=O.current;if(O.current=null,!Te||Te.id!==se)return;const xe=Date.now(),ve=N.current;N.current={id:se,at:xe},!(!ve||ve.id!==se||xe-ve.at>jJ)&&(N.current=null,M({kind:"row",x:Q.clientX,y:Q.clientY,id:se}))},ye=()=>{O.current=null},Re=se=>({onContextMenu:Q=>{y||F||(Q.preventDefault(),M({kind:"row",x:Q.clientX,y:Q.clientY,id:se}))},onPointerDown:V(se),onPointerMove:ee,onPointerUp:oe(se),onPointerCancel:ye,onClick:y?()=>K(se):void 0});return o.jsxs(o.Fragment,{children:[sn.createPortal(o.jsx("div",{className:"fixed inset-0 z-[50] flex items-center justify-center bg-black/50 p-4",onClick:n,children:o.jsxs("div",{className:de("relative flex w-full flex-col overflow-hidden rounded-xl border border-edge/[0.08] bg-neutral-900 p-3 shadow-mac","max-h-[calc(100dvh_-_2rem)] lg:h-[32rem] lg:w-[36rem] max-lg:h-[90dvh]"),onClick:se=>se.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsxs("p",{className:"flex min-w-0 items-center gap-1.5 truncate text-xs font-medium text-neutral-200",children:[o.jsx(dM,{className:"h-3.5 w-3.5 shrink-0 text-violet-400"}),s("tasks.sideTitle")," · ",t]}),o.jsx("button",{type:"button",title:s("tasks.messagesClose"),"aria-label":s("tasks.messagesClose"),onClick:n,className:"shrink-0 rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(Vt,{className:"h-3.5 w-3.5"})})]}),o.jsx("p",{className:"pb-2 text-[11px] leading-relaxed text-neutral-500",children:s("tasks.sideHint")}),o.jsxs("div",{ref:j,onScroll:L.syncEdge,onWheel:se=>L.wheel(se.deltaY,se.deltaMode),onTouchStart:se=>{var Q;return L.touchStart(((Q=se.touches[0])==null?void 0:Q.clientY)??0)},onTouchMove:se=>{var Q;return L.touchMove(((Q=se.touches[0])==null?void 0:Q.clientY)??0)},onTouchEnd:L.touchEnd,onTouchCancel:L.touchEnd,className:"relative min-h-0 flex-1 overflow-y-auto overscroll-contain rounded-lg border border-edge/[0.06] bg-edge/[0.02] p-2",children:[L.px>0&&o.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex justify-center text-[10px] text-neutral-500",style:{transform:`translateY(${L.px}px)`},children:s(f?"tasks.sideLoading":"tasks.sidePullOlder")}),C===null?o.jsx("p",{className:"py-6 text-center text-[11px] text-neutral-500",children:s("tasks.sideLoading")}):C.length===0?o.jsx("p",{className:"py-6 text-center text-[11px] text-neutral-500",children:s("tasks.sideEmpty")}):o.jsx("ul",{className:"flex flex-col gap-1.5",children:C.map(se=>{const Q=k.has(se.id);return o.jsxs("li",{...Re(se.id),className:de("rounded-lg border transition-colors",y&&S.has(se.id)?"border-blue-500/40 bg-blue-500/[0.06]":"border-edge/[0.06] bg-edge/[0.02]",y&&"select-none"),children:[o.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5",children:[y?o.jsxs(o.Fragment,{children:[o.jsx(DJ,{on:S.has(se.id)}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:YE(se.askedAt)}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",children:se.question})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button","aria-expanded":Q,onClick:()=>_(se.id),className:"flex min-w-0 flex-1 items-center gap-1.5 text-left",children:[Q?o.jsx(_n,{className:"h-3 w-3 shrink-0 text-neutral-500"}):o.jsx(Yn,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:YE(se.askedAt)}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",children:se.question})]}),o.jsx("button",{type:"button",title:s("tasks.convCopy"),"aria-label":s("tasks.convCopy"),onClick:()=>pe([se]),className:"shrink-0 rounded p-0.5 text-neutral-600 transition-colors hover:text-neutral-200",children:o.jsx(Ta,{className:"h-3 w-3"})})]}),se.status==="pending"&&o.jsx(gn,{title:s("tasks.sidePending"),className:"h-3 w-3 shrink-0 animate-spin text-neutral-500"}),se.status==="timeout"&&o.jsx(yl,{title:s("tasks.sideTimeout"),className:"h-3 w-3 shrink-0 text-amber-400/80"})]}),Q&&o.jsxs("div",{className:"flex flex-col gap-1 px-2 pb-2",children:[o.jsx("div",{className:"whitespace-pre-wrap break-words rounded-lg bg-edge/[0.04] px-2 py-1 text-xs text-neutral-200 [&_p]:whitespace-pre-wrap",children:o.jsx(vc,{text:se.question})}),se.status==="answered"?o.jsx("div",{className:"whitespace-pre-wrap break-words rounded-lg border border-violet-400/20 bg-violet-500/[0.06] px-2 py-1 text-xs leading-relaxed text-neutral-300 [&_p]:whitespace-pre-wrap",children:o.jsx(vc,{text:se.answer??""})}):o.jsxs("p",{className:de("flex items-center gap-1 px-2 text-[11px]",se.status==="pending"?"text-neutral-500":"text-amber-300/80"),children:[se.status==="pending"&&o.jsx(gn,{className:"h-3 w-3 animate-spin"}),se.status==="pending"?s("tasks.sidePending"):s("tasks.sideTimeout")]})]})]},se.id)})})]}),y?o.jsxs("div",{className:"mt-2 flex shrink-0 flex-wrap items-center gap-x-1.5 gap-y-1",children:[o.jsx("span",{className:"min-w-0 truncate text-[11px] text-neutral-400",children:s("tasks.convSelected",{n:S.size})}),o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[o.jsxs("button",{type:"button",disabled:C===null||C.length===0,onClick:J,className:de("inline-flex shrink-0 items-center gap-1 rounded border px-2 py-1 text-[11px] transition-colors disabled:opacity-40",ne?"border-blue-500/40 bg-blue-500/10 text-blue-300":"border-edge/[0.1] text-neutral-200 hover:border-edge/20"),children:[o.jsx(iM,{className:"h-3 w-3"}),s(ne?"tasks.convDeselectAll":"tasks.convSelectAll")]}),o.jsxs("button",{type:"button",disabled:S.size===0,onClick:()=>pe(X),className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-2 py-1 text-[11px] text-neutral-200 transition-colors hover:border-edge/20 disabled:opacity-40",children:[o.jsx(Ta,{className:"h-3 w-3"}),s("tasks.convCopy")]}),o.jsxs("button",{type:"button",disabled:S.size===0,onClick:Y,title:s("tasks.convShare"),className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-2 py-1 text-[11px] text-neutral-200 transition-colors hover:border-edge/20 disabled:opacity-40",children:[o.jsx(lt,{state:r.stateOf("sideImg"),className:"h-3 w-3",icon:o.jsx(au,{className:"h-3 w-3"})}),s("tasks.convShare")]}),o.jsx("button",{type:"button",onClick:()=>{x(!1),A(new Set)},className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-2 py-1 text-[11px] text-neutral-400 transition-colors hover:border-edge/20 hover:text-neutral-200",children:s("tasks.convCancel")})]})]}):o.jsxs("div",{className:"mt-2 flex shrink-0 items-center gap-2",children:[o.jsx("input",{value:p,disabled:B,placeholder:s("tasks.sidePlaceholder"),onChange:se=>m(se.target.value),onKeyDown:se=>{se.key!=="Enter"||se.nativeEvent.isComposing||(se.preventDefault(),R())},className:"min-w-0 flex-1 rounded border border-edge/[0.08] bg-neutral-950 px-2 py-1 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-edge/20 focus:outline-none disabled:opacity-50"}),o.jsxs("button",{type:"button",disabled:B||!p.trim(),onClick:R,className:"flex shrink-0 items-center gap-1 rounded bg-violet-700/80 px-2.5 py-1 text-[11px] font-medium text-white transition-colors hover:bg-violet-600 disabled:opacity-40",children:[s("tasks.answerSend"),B&&o.jsx(gn,{className:"h-3 w-3 animate-spin"})]})]})]})}),document.body),E&&sn.createPortal(o.jsx("div",{"data-side-menu":!0,className:"fixed z-[60] rounded-lg border border-edge/[0.1] bg-neutral-900 py-1 shadow-mac",style:{left:Math.max(8,Math.min(E.x,window.innerWidth-GE-8)),top:Math.max(8,Math.min(E.y,window.innerHeight-KE))},onClick:se=>se.stopPropagation(),children:E.kind==="row"?o.jsxs("button",{type:"button",onClick:()=>T(E.id),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(mr,{className:"h-3 w-3 text-neutral-500"}),s("tasks.convSelect")]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>q("clipboard"),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(Ta,{className:"h-3 w-3 text-neutral-500"}),s("tasks.convShareCopy")]}),o.jsxs("button",{type:"button",onClick:()=>q("download"),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(pm,{className:"h-3 w-3 text-neutral-500"}),s("tasks.convShareDownload")]})]})}),document.body)]})}const LJ=2;function PJ({projectId:e,sessionName:t,model:n,effort:s}){const r=We(),[i,a]=b.useState(null),[l,c]=b.useState(null),u=b.useCallback(()=>{Ce.getStatusline(e).then(k=>{a(k.config),c(k.facts??null)}).catch(()=>{a(null),c(null)})},[e]);b.useEffect(u,[u]),b.useEffect(()=>$r("statusline",u),[u]);const d=vp({queryKey:["projects"],queryFn:()=>Ce.listProjects(),staleTime:1/0,retry:!1}).data,f=d==null?void 0:d.find(k=>k.id===e);if(!i)return null;const h=new Date,p={...l??{},time:{time:`${VE(h.getHours())}:${VE(h.getMinutes())}`}};f!=null&&f.name&&(p.project={name:f.name,path:f.path??f.name}),t&&(p.session={name:t}),n&&(p.model={model:n}),s&&(p.thinking={level:s});const m=i.lines.map(k=>cj(i,k,p)).filter(k=>k.length>0).slice(0,LJ);return m.length===0?null:o.jsx("div",{title:r("statusline.barTitle"),className:"-mx-3 -mb-3 mt-1.5 shrink-0 overflow-x-auto overflow-y-hidden border-t border-edge/[0.06] bg-neutral-950/50 px-3 py-1",children:o.jsx("div",{className:"flex w-max flex-col gap-0.5 text-[10px] leading-4",children:m.map((k,w)=>o.jsx(hj,{items:k,config:i},w))})})}function VE(e){return String(e).padStart(2,"0")}const ih=10,XE=["image/png","image/jpeg","image/gif","image/webp"],zJ=10*1024*1024,QE=8,UJ=40,x0=2,WE=20,FJ=16,BJ=/\.(png|jpe?g|gif|webp)$/i,LR=e=>e.type.startsWith("image/")||!e.type&&BJ.test(e.name);function ZE(e){if(!e)return[];const t=Array.from(e.items??[]).filter(s=>s.kind==="file").map(s=>s.getAsFile()).filter(s=>!!s);return(t.length>0?t:Array.from(e.files??[])).filter(LR)}const HJ=10*6e4,$J=3,GJ=10*6e4,KJ=60;function qJ(e){var t;try{const n=sessionStorage.getItem(`weave:conv:${e}`);if(!n)return null;const s=JSON.parse(n);return typeof s.at!="number"||Date.now()-s.at>GJ?null:(t=s.entries)!=null&&t.length?s.entries:null}catch{return null}}function YJ(e,t){try{sessionStorage.setItem(`weave:conv:${e}`,JSON.stringify({at:Date.now(),entries:t.slice(-KJ).map(({pipe:n,...s})=>s)}))}catch{}}const y0={pending:"bg-amber-900/40 text-amber-300",delivering:"bg-sky-900/40 text-sky-300",running:"bg-sky-900/40 text-sky-300",injected:"bg-sky-900/40 text-sky-300",delivered:"bg-emerald-900/40 text-emerald-300",succeeded:"bg-emerald-900/40 text-emerald-300",failed:"bg-red-900/40 text-red-300",timeout:"bg-red-900/40 text-red-300"},PR={pending:"tasks.msgStatusQueued",delivering:"tasks.msgStatusDelivering",running:"tasks.msgStatusRunning",injected:"tasks.msgStatusInjected",delivered:"tasks.msgStatusDelivered",succeeded:"tasks.msgStatusSucceeded",failed:"tasks.msgStatusFailed",timeout:"tasks.msgStatusTimeout"},JE=e=>e==="delivered"?"tasks.msgStatusSent":PR[e];function VJ(e,t){const n=Math.ceil(Math.max(0,Date.parse(e)-t)/1e3);return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function e_(e,t,n){var r,i;const s=[];for(const a of e)if(Yv(n,a.eventType,Oi(a).source))s.push({key:`e${a.id}`,eventId:a.id,role:"compaction",at:a.createdAt,text:""});else if(a.eventType===t.open){if(bm(a))continue;const l=oz(a);if(!l)continue;const{text:c,fromWeave:u,fromName:d}=MM(l);s.push({key:`e${a.id}`,eventId:a.id,role:"user",at:a.createdAt,text:(r=a.images)!=null&&r.length?c.replace(zR,"").trim():c,fromWeave:u,fromName:d,...(i=a.images)!=null&&i.length?{images:a.images}:{}})}else if(t.close.includes(a.eventType)){const l=cz(a);l&&s.push({key:`e${a.id}`,eventId:a.id,role:"assistant",at:a.createdAt,text:l,...t.closeFailed.includes(a.eventType)?{failed:!0}:{}})}return s}function t_(e){return MM(e).text.replace(/\s+/g," ").trim()}const zR=/\[Image #\d+\]/gi;function XJ(e,t,n=!1){const s=t_(e),r=t_(t);if(s===r)return!0;if(!n)return!1;const i=a=>a.replace(zR,"").replace(/\s+/g,"");return i(s)===i(r)}function QJ(e,t){const n=new Set,s=a=>{var u;if(a.eventId!==void 0){const d=t.filter(f=>!n.has(f.id)&&f.ackedEventId===a.eventId);if(d.length>0){for(const f of d)n.add(f.id);return d[0]}}let l,c=HJ;for(const d of t){if(n.has(d.id)||!XJ(a.text,d.text,(((u=d.images)==null?void 0:u.length)??0)>0))continue;const f=Math.abs(Date.parse(d.at)-Date.parse(a.at));f<c&&(l=d,c=f)}return l&&n.add(l.id),l},r=e.map(a=>{if(a.role!=="user")return a;const l=s(a);return l?{...a,pipe:l}:a}),i=t.filter(a=>!n.has(a.id)).sort((a,l)=>a.at.localeCompare(l.at));return{thread:r,outbox:i}}function n_(e){return e.status==="delivering"||e.status==="running"?!1:e.status!=="delivered"||e.stalled===!0}const WJ=["all","user","assistant"],ZJ={all:"tasks.convFilterAll",user:"tasks.convFilterSent",assistant:"tasks.convFilterRecv"};function JJ(e,t){return e==="compacting"||e==="running"&&(t==="user"||t==="compaction")}function eee(e,t){const n=e[e.length-1];return!t&&(n==null?void 0:n.failed)===!0?n:null}function tee(e,t,n){return{text:e.slice(0,t)+`
548
+ `+e.slice(n),caret:t+1}}function nee(e,t){return t==="all"?[...e]:e.filter(n=>n.role===t)}function see(e,t){if(!t||!t.text.trim())return[...e];const n={key:`p${t.eventId}`,eventId:t.eventId,role:"assistant",at:t.at,text:t.text,plan:!0},s=e.findIndex(r=>(r.eventId??0)>t.eventId);return s<0?[...e,n]:[...e.slice(0,s),n,...e.slice(s)]}function UR(e){const t=new Date(e),n=s=>String(s).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function ree(e,t){const n=s=>{const r=s.role==="user"?t.user:t.assistant;return s.plan===!0?`${r} · ${t.plan}`:r};return e.filter(s=>s.role!=="compaction").map(s=>{var a;const r=((a=s.images)==null?void 0:a.map((l,c)=>`[Image #${c+1}] ${l.name}`).join(`
549
+ `))??"",i=[s.text,r].filter(Boolean).join(`
550
+ `);return`[${UR(s.at)}] ${n(s)}
551
+ ${i}`}).join(`
552
+
553
+ `)}const iee=300,s_=8,r_=168,i_=72,aee=(e,t)=>e.filter(n=>n.role!=="compaction").map(n=>{const s=[];return n.role==="user"&&n.fromWeave===!0&&s.push({kind:"weave",text:"weave"}),n.role==="user"&&n.fromWeave!==!0&&n.fromName!=null&&s.push({kind:"name",text:n.fromName}),n.plan===!0&&s.push({kind:"plan",text:t}),{role:n.role,at:n.at,text:n.text,...s.length>0?{tags:s}:{},...n.pipe!==void 0?{viaWeave:!0}:{},...n.failed===!0?{failed:!0}:{}}}),FR="weave:conv-size",py="weave:conv-pos",ah={w:320,h:220},Yk=(e,t)=>({w:Math.min(Math.max(Math.round(e),ah.w),Math.max(ah.w+40,innerWidth-32)),h:t>0?Math.min(Math.max(Math.round(t),ah.h),Math.max(ah.h+40,innerHeight-32)):0}),a_=()=>Yk(Math.min(1100,Math.round(innerWidth*.62)),0);function lee(){try{const e=JSON.parse(localStorage.getItem(FR)??"null");return!e||typeof e.w!="number"||typeof e.h!="number"?a_():Yk(e.w,e.h)}catch{return a_()}}function oee(){try{const e=JSON.parse(localStorage.getItem(py)??"null");if(typeof(e==null?void 0:e.x)=="number"&&typeof(e==null?void 0:e.y)=="number")return{x:e.x,y:e.y}}catch{}return{x:0,y:0}}function l_({on:e,className:t}){return o.jsx("span",{className:de("inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center self-start rounded border",e?"border-blue-400 bg-blue-500 text-white":"border-neutral-600 bg-neutral-900",t),children:e&&o.jsx(mr,{className:"h-2.5 w-2.5",strokeWidth:3})})}function cee({text:e}){return o.jsx("span",{className:"relative min-w-0 flex-1 overflow-hidden",children:o.jsx("span",{className:"weave-ticker-in block truncate whitespace-nowrap",children:e},e)})}const uee="3.75rem",dee=6*19.5,fee={WebkitMaskImage:"linear-gradient(to bottom, #000 55%, transparent 100%)",maskImage:"linear-gradient(to bottom, #000 55%, transparent 100%)"};function hee({text:e,open:t,onToggle:n,disabled:s,children:r}){const i=We(),a=b.useRef(null),[l,c]=b.useState(!1);return b.useLayoutEffect(()=>{const u=a.current;if(!u)return;const d=()=>{u.scrollHeight>dee&&c(!0)};d();const f=new ResizeObserver(d);return f.observe(u),()=>f.disconnect()},[e,t]),o.jsxs("div",{className:"relative",children:[o.jsx("div",{ref:a,style:!t&&l?{maxHeight:uee,overflow:"hidden",...fee}:void 0,children:r}),l&&!s&&o.jsx("button",{type:"button","aria-label":i(t?"tasks.convFold":"tasks.convUnfold"),onClick:n,className:de("mx-auto flex w-7 items-center justify-center rounded-full py-0.5","border border-edge/[0.08] bg-neutral-900/80 text-neutral-500 hover:text-neutral-300",t?"mt-1":"absolute inset-x-0 bottom-0"),children:o.jsx(_n,{className:de("h-3 w-3",t&&"rotate-180")})})]})}function BR({sessionId:e,projectId:t,label:n,projectLabel:s,capability:r,answerPending:i,onOpenAnswer:a,onInterrupt:l,interruptStateOf:c,minimized:u,onMinimize:d,onClose:f,embedded:h,onOpenChain:p}){var dw,fw,hw,pw,mw;const m=We(),{show:k}=tn(),w=dn(),g=qk(),[y,x]=b.useState(!1),{statuses:S,sessions:A,refresh:E,modelCatalog:M}=Wd(),j=Qd[r.harness],O=b.useMemo(()=>{var $;return[j.open,...j.close,(($=qv[r.harness])==null?void 0:$.end)??""].filter(Boolean)},[r.harness,j]),[N,F]=b.useState(()=>qJ(e)),[G,H]=b.useState(!1),[I,L]=b.useState(!1),[C,D]=b.useState(null),[U,B]=b.useState(""),[R,_]=b.useState([]),[K,T]=b.useState(0),[X,ne]=b.useState(null),J=b.useRef(null),pe=b.useRef(null),[q,Y]=b.useState(null),[V,ee]=b.useState("all"),[oe,ye]=b.useState(!1),[Re,se]=b.useState(!1),[Q,Te]=b.useState(!1),[xe,ve]=b.useState(0),[ge,$e]=b.useState([]),[dt,mt]=b.useState(null),[rt,ct]=b.useState(()=>new Map),[te,re]=b.useState(()=>new Set),[Ae,v]=b.useState(null),[Z,fe]=b.useState(null),[be,he]=b.useState(()=>lee()),[P,ce]=b.useState(oee),ue=b.useRef(null),_e=b.useRef(null),ke=b.useRef(null),we=b.useRef(null),Ne=b.useRef(null),Oe=b.useRef(null),Me=b.useRef(null),Fe=Si("(min-width: 1024px)"),De=Si("(pointer: coarse)"),He=Si("(pointer: fine)"),[Ge,ft]=b.useState(()=>{const $=Number(localStorage.getItem("weave:conv-input-rows"));return Number.isFinite($)&&$>0?Math.min(WE,Math.max(x0,$)):x0});b.useEffect(()=>localStorage.setItem("weave:conv-input-rows",String(Ge)),[Ge]);const St=b.useRef(null),Nt=b.useCallback($=>{Y($ instanceof Error?$.message:String($))},[]),_t=b.useCallback(async()=>{try{if(O.length===0){F([]),H(!0);return}const $=await Ce.listSessionHooks(t,e,ih,void 0,O),me=e_($,j,r.harness);H($.length<ih),F(Ke=>{var os;const Ve=Ke!=null&&Ke.length?Ke[Ke.length-1].eventId:void 0,pt=(os=me[0])==null?void 0:os.eventId;return Ve===void 0||pt===void 0||pt>Ve?me:[...Ke.filter(ti=>(ti.eventId??0)<pt),...me]}),Y(null)}catch($){Nt($)}},[r.harness,O,Nt,j,t,e]),jt=b.useCallback(async()=>{try{D(await Ce.listSessionMessages(e)),Y(null)}catch($){Nt($)}},[Nt,e]),Rt=b.useCallback(async()=>{try{$e(await Ce.listSessionHooks(t,e,UJ))}catch{}},[t,e]),Wt=b.useCallback(async()=>{try{mt(await Ce.sessionPlan(e))}catch{mt(null)}},[e]);b.useEffect(()=>{_t(),jt(),Wt()},[_t,Wt,jt]),b.useEffect(()=>{N&&N.length>0&&YJ(e,N)},[N,e]),b.useEffect(()=>{let $=null,me=!1,Ke=!1,Ve=!1,pt=!1;const ti=Ai(Tr=>{var zc;if(Tr.sessionId!==e)return;const Pc=Tr.kind==="event.ingested";!Pc&&!((zc=Tr.kind)!=null&&zc.startsWith("message."))&&Tr.kind!=="question.pending"||(Pc?(Ve=!0,(Tr.eventType===j.open||j.close.includes(Tr.eventType??""))&&(me=!0)):Tr.kind==="question.pending"?pt=!0:Ke=!0,$!==null&&window.clearTimeout($),$=window.setTimeout(()=>{$=null;const $m=me,iD=Ke,aD=Ve,lD=pt;me=Ke=Ve=pt=!1,$m&&_t(),iD&&jt(),aD&&Rt(),lD&&Wt()},500))});return()=>{ti(),$!==null&&window.clearTimeout($)}},[j,Rt,_t,Wt,jt,e]),b.useEffect(()=>{if(u)return;const $=me=>{me.key==="Escape"&&(Ae?v(null):oe?(ye(!1),re(new Set)):Q?Te(!1):Re?se(!1):d==null||d())};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[Ae,oe,Q,Re,u,d]),b.useEffect(()=>{if(xe<=0)return;const $=window.setTimeout(()=>ve(me=>me-1),1e3);return()=>window.clearTimeout($)},[xe]),b.useEffect(()=>{if(!Ae)return;const $=Ke=>{var Ve,pt;(pt=(Ve=Ke.target)==null?void 0:Ve.closest)!=null&&pt.call(Ve,"[data-conv-menu]")||(Ke.stopPropagation(),v(null))},me=()=>v(null);return window.addEventListener("pointerdown",$,!0),window.addEventListener("contextmenu",$,!0),window.addEventListener("wheel",me,{capture:!0,passive:!0}),window.addEventListener("resize",me),()=>{window.removeEventListener("pointerdown",$,!0),window.removeEventListener("contextmenu",$,!0),window.removeEventListener("wheel",me,!0),window.removeEventListener("resize",me)}},[Ae]);const ie=b.useCallback(async()=>{var me,Ke;const $=(me=N==null?void 0:N[0])==null?void 0:me.eventId;if(!($===void 0||I||G)){L(!0);try{const Ve=await Ce.listSessionHooks(t,e,ih,$,O);H(Ve.length<ih);const pt=e_(Ve,j,r.harness);pt.length>0&&(ke.current=((Ke=ue.current)==null?void 0:Ke.scrollHeight)??null,F(os=>[...pt,...os??[]]))}catch(Ve){Nt(Ve)}finally{L(!1)}}},[r.harness,O,N,Nt,G,j,I,t,e]);b.useLayoutEffect(()=>{const $=ue.current;!$||ke.current===null||($.scrollTop+=$.scrollHeight-ke.current,ke.current=null)},[N]);const Pe=b.useMemo(()=>(C??[]).filter($=>$.mode==="prompt"),[C]),{thread:Ie,outbox:Je}=b.useMemo(()=>QJ(see(N??[],dt),Pe),[N,Pe,dt]),Ze=b.useMemo(()=>{for(let $=Ie.length-1;$>=0;$--)if(Ie[$].role==="assistant")return Ie[$].key;return null},[Ie]),Cn=$=>rt.get($)??$===Ze,Ht=$=>ct(me=>new Map(me).set($,!Cn($))),Vr=(dw=[...Je].reverse().find($=>$.status!=="delivered"&&n_($)))==null?void 0:dw.id,[kr,ks]=b.useState(()=>Date.now()),Ii=Je.some($=>$.stalled===!0&&$.releaseAt!=null);b.useEffect(()=>{if(!Ii)return;ks(Date.now());const $=window.setInterval(()=>ks(Date.now()),1e3);return()=>window.clearInterval($)},[Ii]);const Xn=b.useRef(!0),Li=()=>{const $=ue.current;return!!$&&$.scrollHeight-$.scrollTop-$.clientHeight<=40},Xr=b.useRef({top:0,atBottom:!0});b.useEffect(()=>{const $=ue.current;if(!$)return;let me=$.clientHeight>0;const Ke=new ResizeObserver(()=>{const Ve=$.clientHeight>0;Ve&&!me&&($.scrollTop=Xr.current.atBottom?$.scrollHeight:Xr.current.top),me=Ve});return Ke.observe($),()=>Ke.disconnect()},[]);const Qr=(fw=Ie[Ie.length-1])==null?void 0:fw.key,Wr=S.get(e),Zr=Wr==="compacting",Qn=Wr==="interrupted",wr=JJ(Wr,(hw=Ie[Ie.length-1])==null?void 0:hw.role),ws=Qn?null:eee(Ie,Je.length>0),Pi=b.useMemo(()=>{var me;const $=((me=[...Ie].reverse().find(Ke=>Ke.role==="user"))==null?void 0:me.eventId)??0;for(let Ke=ge.length-1;Ke>=0;Ke--){const Ve=ge[Ke];if(Ve.id<=$)break;const pt=ju(Ve).trim();if(pt)return pt}return null},[ge,Ie]),Sr=Je.map($=>`${$.id}:${$.status}${$.stalled===!0?"!":""}`).join(","),Tn=`${Qr??""}|${Sr}|${wr?"g":""}${Qn?"i":""}${i?"a":""}`,Jr=b.useRef(void 0);b.useLayoutEffect(()=>{if(u||N===null||Tn===Jr.current||(Jr.current=Tn,!Xn.current))return;const $=ue.current;$&&($.scrollTop=$.scrollHeight)},[N,Tn,u]);const Nr=b.useMemo(()=>nee(Ie,V),[Ie,V]),An=Kk({axis:"top",getEdge:()=>{var $;return((($=ue.current)==null?void 0:$.scrollTop)??1)<=1},onFire:()=>void ie(),enabled:N!==null&&!G&&!I}),za=$=>re(me=>{const Ke=new Set(me);return Ke.delete($)||Ke.add($),Ke}),Ua=$=>{v(null),ye(!0),$!==void 0&&re(new Set([$]))},Ls=()=>Ie.filter($=>te.has($.key)),tr=Ie.filter($=>$.role!=="compaction"),ei=tr.length>0&&tr.every($=>te.has($.key)),Fa=()=>re(ei?new Set:new Set(tr.map($=>$.key))),Ba=()=>{const $=Ls();if($.length===0)return;const me=ree($,{user:m("tasks.convRoleUser"),assistant:m("tasks.convRoleAssistant"),plan:m("tasks.convPlan")});lf(me).then(Ke=>k(Ke?"success":"error",Ke?m("tasks.convCopyOk",{n:$.length}):m("tasks.convCopyFailed")))},Hn=$=>{const me=Ls();me.length!==0&&(v(null),w.run(`convImg:${e}`,async()=>{let Ke;try{Ke=await MR(aee(me,m("tasks.convPlan")),{stamp:UR,theme:g})}catch(Ve){throw new Error(m("tasks.convImgFailed",{error:qe(Ve)}))}if($==="download")RR(Ke,jR(n)),k("success",m("tasks.convImgSaved"));else if(await m3(Ke))k("success",m("tasks.convImgOk",{n:me.length}));else throw new Error(m("tasks.convImgCopyFailed"))},{fail:qe}))},an=$=>{const me=$.currentTarget.getBoundingClientRect();v({kind:"share",x:me.right-r_,y:me.top-i_})},Dn=$=>me=>{!De||oe||me.button!==0||(Oe.current={key:$,x:me.clientX,y:me.clientY})},Er=$=>{const me=Oe.current;me&&(Math.abs($.clientX-me.x)>s_||Math.abs($.clientY-me.y)>s_)&&(Oe.current=null)},_r=$=>me=>{const Ke=Oe.current;if(Oe.current=null,!Ke||Ke.key!==$)return;const Ve=Date.now(),pt=Me.current;Me.current={key:$,at:Ve},!(!pt||pt.key!==$||Ve-pt.at>iee)&&(Me.current=null,v({kind:"bubble",x:me.clientX,y:me.clientY,key:$}))},Cr=()=>{Oe.current=null},W=($,me,Ke)=>{var ti;const Ve=(ti=_e.current)==null?void 0:ti.getBoundingClientRect(),pt=Math.max(0,(innerWidth-((Ve==null?void 0:Ve.width)??Ke.w))/2-12),os=Math.max(0,(innerHeight-((Ve==null?void 0:Ve.height)??0))/2-12);return{x:Math.max(-pt,Math.min(pt,$)),y:Math.max(-os,Math.min(os,me))}};b.useLayoutEffect(()=>{h||!Fe||ce($=>W($.x,$.y,be))},[]);const z=$=>{var Ke;const me=(Ke=_e.current)==null?void 0:Ke.getBoundingClientRect();we.current={x:$.clientX,y:$.clientY,w:be.w,h:be.h||Math.round((me==null?void 0:me.height)??0)},$.currentTarget.setPointerCapture($.pointerId)},le=$=>{const me=we.current;if(!me)return;const Ke=Yk(me.w+($.clientX-me.x),me.h+($.clientY-me.y));he(Ke),ce(Ve=>W(Ve.x,Ve.y,Ke))},Ee=()=>{we.current&&(we.current=null,he($=>{try{localStorage.setItem(FR,JSON.stringify($)),localStorage.setItem(py,JSON.stringify(P))}catch{}return $}))},Se=$=>{!Fe||$.target.closest("button")||(Ne.current={x:$.clientX,y:$.clientY,px:P.x,py:P.y},$.currentTarget.setPointerCapture($.pointerId))},ze=$=>{const me=Ne.current;me&&ce(W(me.px+($.clientX-me.x),me.py+($.clientY-me.y),be))},st=()=>{if(Ne.current){Ne.current=null;try{localStorage.setItem(py,JSON.stringify(P))}catch{}}},Wn=$=>({onContextMenu:me=>{oe||De||(me.preventDefault(),v({kind:"bubble",x:me.clientX,y:me.clientY,key:$}))},onPointerDown:Dn($),onPointerMove:Er,onPointerUp:_r($),onPointerCancel:Cr,onClick:oe?()=>za($):void 0}),yn=$=>new Promise((me,Ke)=>{const Ve=new FileReader;Ve.onerror=()=>Ke(new Error($.name)),Ve.onload=()=>{const pt=String(Ve.result??""),os=pt.indexOf(",");Ce.uploadImage({name:$.name||"image",mediaType:$.type,data:os>=0?pt.slice(os+1):pt}).then(me,Ke)},Ve.readAsDataURL($)}),Ha=$=>{const me=Array.from($).filter(LR);me.length!==0&&(T(Ke=>Ke+me.length),(async()=>{for(const Ke of me)try{if(!XE.includes(Ke.type)){k("error",m("tasks.msgImageBadType"));continue}if(Ke.size>zJ){k("error",m("tasks.msgImageTooLarge"));continue}const Ve=await yn(Ke);_(pt=>pt.length>=QE?(k("error",m("tasks.msgImageTooMany")),pt):[...pt,Ve])}catch(Ve){k("error",m("tasks.msgImageUploadFailed",{error:qe(Ve)}))}finally{T(Ve=>Ve-1)}})())},pf=()=>{const $=pe.current,me=($==null?void 0:$.selectionStart)??U.length,Ke=($==null?void 0:$.selectionEnd)??me,Ve=tee(U,me,Ke);B(Ve.text),requestAnimationFrame(()=>{$&&($.focus({preventScroll:!0}),$.selectionStart=$.selectionEnd=Ve.caret,Ve.caret===Ve.text.length&&($.scrollTop=$.scrollHeight))})},Fm=$=>{St.current={y:$.clientY,rows:Ge},$.currentTarget.setPointerCapture($.pointerId)},ZO=$=>{const me=St.current;if(!me)return;const Ke=me.rows+Math.round((me.y-$.clientY)/FJ);ft(Math.min(WE,Math.max(x0,Ke)))},rw=$=>{St.current=null,$.currentTarget.releasePointerCapture($.pointerId)},iw=()=>{const $=U.trim(),me=R;!$&&me.length===0||(B(""),_([]),Xn.current=!0,w.run(`sendMsg:${e}`,async()=>{var Ve;((Ve=(await Ce.sendSessionMessage(e,{text:$,...me.length>0?{images:me.map(pt=>pt.id)}:{},forceTerminal:!0})).message)==null?void 0:Ve.reason)==="offline"&&k("error",m("tasks.msgOfflineToast")),await jt()},{fail:Ke=>m("tasks.msgSendFailed",{error:qe(Ke)})}))},JO=$=>{w.run(`dequeue:${$.id}`,async()=>{await Ce.dismissSessionMessage(e,$.id),B(me=>me.trim()?`${me}
554
+ ${$.text}`:$.text),_(me=>[...me,...$.images??[]].slice(0,QE)),await jt()},{fail:me=>m("tasks.msgDequeueFailed",{error:qe(me)})})},eD=$=>o.jsxs(o.Fragment,{children:[($.status==="failed"||$.stalled===!0)&&o.jsx("button",{type:"button",title:m("tasks.msgResend"),"aria-label":m("tasks.msgResend"),disabled:w.stateOf(`resend:${$.id}`)==="loading",onClick:()=>void w.run(`resend:${$.id}`,async()=>{await Ce.resendSessionMessage(e,$.id),await jt()},{fail:me=>m("tasks.msgResendFailed",{error:qe(me)})}),className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-amber-500/30 bg-amber-950/30 text-amber-300 transition-colors hover:border-amber-500/50 disabled:opacity-40",children:o.jsx(lt,{state:w.stateOf(`resend:${$.id}`),className:"h-3 w-3",icon:o.jsx(Og,{className:"h-3 w-3"})})}),$.id===Vr&&o.jsx("button",{type:"button",title:m("tasks.outboxDequeueHint"),"aria-label":m("tasks.outboxDequeue"),disabled:w.stateOf(`dequeue:${$.id}`)==="loading",onClick:()=>JO($),className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-blue-500/30 bg-blue-500/10 text-blue-300 transition-colors hover:border-blue-500/50 disabled:opacity-40",children:o.jsx(lt,{state:w.stateOf(`dequeue:${$.id}`),className:"h-3 w-3",icon:o.jsx(Fv,{className:"h-3 w-3"})})}),n_($)&&o.jsx("button",{type:"button",title:m($.status==="pending"?"tasks.msgDismissQueuedHint":"tasks.msgDismissHint"),"aria-label":m("tasks.msgDismiss"),disabled:w.stateOf(`dismiss:${$.id}`)==="loading",onClick:()=>void w.run(`dismiss:${$.id}`,async()=>{await Ce.dismissSessionMessage(e,$.id),await jt()},{fail:me=>m("tasks.msgDismissFailed",{error:qe(me)})}),className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-edge/[0.12] text-neutral-400 transition-colors hover:border-edge/20 hover:text-neutral-200 disabled:opacity-40",children:o.jsx(lt,{state:w.stateOf(`dismiss:${$.id}`),className:"h-3 w-3",icon:o.jsx(er,{className:"h-3 w-3"})})})]}),Zn=A==null?void 0:A.find($=>$.sessionId===e),aw=ZM(r.harness),Bm=W9(r.harness),lw=M[r.harness]??[],Hm=(Zn==null?void 0:Zn.mode)??null,tD=(Zn==null?void 0:Zn.model)??null,ow=Z9(r.harness,Hm),nD=()=>{w.run(`cycleMode:${e}`,async()=>{await Ce.cycleSessionMode(e),await E(),k("success",m("tasks.modeCycled"))},{fail:$=>m("tasks.modeCycleFailed",{error:qe($)})})},sD=$=>{w.run(`setModel:${e}`,async()=>{await Ce.setSessionModel(e,$),await E(),k("success",m("tasks.modelSet"))},{fail:me=>m("tasks.modelSetFailed",{error:qe(me)})})},cw=lw.length>0?lw.map($=>({value:$.alias,label:$.actual===$.alias?$.alias:`${$.alias} — ${$.actual}`})):Bm.map($=>({value:$,label:$})),$a=(Zn==null?void 0:Zn.modelAlias)??tD??"",rD=()=>{U.trim()||R.length>0?se(!0):f==null||f()},uw=o.jsxs("div",{ref:_e,style:!h&&Fe?{width:be.w,height:be.h||void 0,transform:P.x||P.y?`translate(${P.x}px, ${P.y}px)`:void 0}:void 0,className:de("relative min-h-0 w-full flex-col overflow-hidden p-3",h?de("flex-1",u?"hidden":"flex"):"flex h-[70dvh] max-lg:h-[88dvh] rounded-xl border border-edge/[0.08] bg-neutral-900 shadow-mac"),onClick:$=>$.stopPropagation(),onDragOver:$=>$.preventDefault(),onDrop:$=>{$.preventDefault();const me=ZE($.dataTransfer);me.length>0&&Ha(me)},children:[o.jsxs("div",{...h?{}:{onPointerDown:Se,onPointerMove:ze,onPointerUp:st,onPointerCancel:st},className:de("flex items-center justify-between gap-2 pb-2",!h&&Fe&&"cursor-grab active:cursor-grabbing"),children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("p",{className:"truncate text-xs font-medium text-neutral-200",children:[m("tasks.messagesTitle")," · ",n]}),o.jsx("p",{className:"truncate text-[10px] text-neutral-500",children:s})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[h&&o.jsxs(o.Fragment,{children:[r.sideQuestion&&o.jsxs("button",{type:"button",title:m("tasks.sideTitle"),onClick:()=>x(!0),className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.08] px-1.5 py-0.5 text-[10px] text-neutral-400 transition-colors hover:border-edge/[0.16] hover:text-neutral-200 max-lg:py-1.5",children:[o.jsx(dM,{className:"h-3 w-3 text-violet-400"}),m("tasks.sideTitle")]}),o.jsxs("button",{type:"button",title:m("tasks.chainTitle"),onClick:p,className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.08] px-1.5 py-0.5 text-[10px] text-neutral-400 transition-colors hover:border-edge/[0.16] hover:text-neutral-200 max-lg:py-1.5",children:[o.jsx(nM,{className:"h-3 w-3 text-rose-400"}),m("tasks.chainTitle")]})]}),!h&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",title:m("tasks.messagesMinimize"),"aria-label":m("tasks.messagesMinimize"),onClick:d,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(hM,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",title:m("tasks.messagesClose"),"aria-label":m("tasks.messagesClose"),onClick:rD,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(Vt,{className:"h-3.5 w-3.5"})})]})]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1 pb-2",children:[WJ.map($=>o.jsx("button",{type:"button",onClick:()=>ee($),className:de("rounded border px-1.5 py-0.5 text-[10px] transition-colors",V===$?"border-blue-500/40 bg-blue-500/10 text-blue-300":"border-edge/[0.08] text-neutral-500 hover:text-neutral-300"),children:m(ZJ[$])},$)),o.jsx("span",{className:"ml-auto text-[10px] text-neutral-600",children:m("tasks.convCount",{n:Ie.length})})]}),o.jsxs("div",{ref:ue,onScroll:()=>{const $=ue.current;if($&&$.clientHeight>0){const me=Li();Xr.current={top:$.scrollTop,atBottom:me},Xn.current=me}Cr(),An.syncEdge()},onWheel:$=>An.wheel($.deltaY,$.deltaMode),onTouchStart:$=>{var me;return An.touchStart(((me=$.touches[0])==null?void 0:me.clientY)??0)},onTouchMove:$=>{var me;return An.touchMove(((me=$.touches[0])==null?void 0:me.clientY)??0)},onTouchEnd:An.touchEnd,onTouchCancel:An.touchEnd,className:"relative min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain pr-1",children:[An.px>0&&o.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 right-0 top-1 flex justify-center",style:{transform:`translateY(${An.px}px)`},children:o.jsx("span",{className:"text-[10px] text-neutral-600",children:m("tasks.pullMore")})}),o.jsx("div",{className:"space-y-2",style:An.px>0?{transform:`translateY(${An.px}px)`}:void 0,children:N===null?o.jsxs("p",{className:"flex items-center justify-center gap-1.5 pt-6 text-xs text-neutral-600",children:[o.jsx(gn,{className:"h-3.5 w-3.5 animate-spin"}),m("hooks.loading")]}):Ie.length===0&&Je.length===0?o.jsx("p",{className:"pt-6 text-center text-xs text-neutral-600",children:m("tasks.messagesEmpty")}):o.jsxs(o.Fragment,{children:[I&&o.jsxs("p",{className:"flex items-center justify-center gap-1.5 pt-1 text-[10px] text-neutral-600",children:[o.jsx(gn,{className:"h-3 w-3 animate-spin"}),m("tasks.msgEarlier")]}),Nr.length===0&&o.jsx("p",{className:"pt-6 text-center text-xs text-neutral-600",children:m("tasks.convFilterEmpty")}),Nr.map($=>{var Ke;if($.role==="compaction")return o.jsxs("div",{className:"flex items-center gap-2 py-1 text-[10px] text-neutral-600",children:[o.jsx("span",{className:"h-px flex-1 bg-edge/[0.08]"}),o.jsxs("span",{className:"shrink-0",children:[m("hooks.mindmap.compactTag")," · ",qc($.at)]}),o.jsx("span",{className:"h-px flex-1 bg-edge/[0.08]"})]},$.key);if($.role==="assistant")return o.jsxs("div",{...Wn($.key),className:de("flex touch-manipulation justify-start",oe&&"select-none"),children:[o.jsxs("div",{className:de("min-w-0 max-w-[92%] overflow-x-auto rounded-lg border px-2 py-1.5",$.failed?"border-red-500/30 bg-red-950/20":"border-edge/[0.08] bg-neutral-800/50"),children:[o.jsxs("span",{className:"mb-0.5 flex items-center gap-1.5 text-[10px] text-neutral-600",children:[qc($.at),$.plan===!0&&o.jsx("span",{className:"shrink-0 rounded bg-amber-500/15 px-1 py-px text-[10px] font-medium text-amber-300",children:m("tasks.convPlan")})]}),$.failed?o.jsxs("p",{className:"flex items-start gap-1 whitespace-pre-wrap break-words text-xs leading-relaxed text-red-300",children:[o.jsx(yl,{className:"mt-0.5 h-3 w-3 shrink-0"}),$.text]}):o.jsx(hee,{text:$.text,open:Cn($.key),onToggle:()=>Ht($.key),disabled:oe,children:o.jsx(vc,{text:$.text})})]}),oe&&o.jsx(l_,{on:te.has($.key),className:"ml-1.5 mt-1"})]},$.key);const me=$.pipe;return o.jsxs("div",{...Wn($.key),className:de("flex touch-manipulation items-end justify-end gap-1",oe&&"select-none"),children:[oe&&o.jsx(l_,{on:te.has($.key),className:"mr-1.5 mt-1"}),o.jsxs("div",{className:de("min-w-0 max-w-[85%] overflow-x-auto rounded-lg border px-2 py-1.5",me?"border-blue-500/30 bg-blue-500/[0.12]":"border-blue-500/15 bg-blue-500/[0.05]"),children:[o.jsxs("div",{className:"mb-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5",children:[$.fromWeave&&o.jsx("span",{className:"shrink-0 rounded bg-blue-500/15 px-1 py-px text-[10px] font-medium text-blue-300",children:"weave"}),$.fromWeave!==!0&&$.fromName!=null&&o.jsx("span",{className:"shrink-0 rounded border border-edge/[0.12] px-1 py-px text-[10px] text-neutral-400",children:$.fromName}),me!==void 0&&me.status!=="delivered"&&o.jsx(Qe,{className:de("shrink-0",y0[me.status]),children:m(PR[me.status])}),(me==null?void 0:me.stalled)===!0&&o.jsx("span",{className:"shrink-0 text-[10px] text-amber-400",children:m("tasks.msgStalled")}),o.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-neutral-600",children:qc($.at)})]}),(Ke=$.images)!=null&&Ke.length?o.jsx("div",{className:"mb-1 flex flex-wrap gap-1.5",children:$.images.map(Ve=>o.jsx("button",{type:"button",title:Ve.name,onClick:pt=>{oe||(pt.stopPropagation(),ne(Ve))},className:"block h-14 w-14 overflow-hidden rounded border border-edge/[0.12] bg-neutral-950",children:o.jsx("img",{src:`${Fr}/images/${Ve.id}`,alt:Ve.name,className:"h-full w-full object-cover",loading:"lazy"})},Ve.id))}):null,o.jsx("div",{className:"[&_p]:whitespace-pre-wrap",children:o.jsx(vc,{text:$.text})}),(me==null?void 0:me.reason)==="offline"?o.jsx("p",{className:"mt-1 break-words text-[11px] text-amber-400",children:m("tasks.msgOffline")}):(me==null?void 0:me.error)&&o.jsx("p",{className:"mt-1 break-words text-[11px] text-red-400",children:me.error}),!oe&&me&&(me.status==="failed"||me.status==="pending"||me.stalled===!0)&&o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(me.status==="failed"||me.stalled===!0)&&o.jsxs("button",{type:"button",disabled:w.stateOf(`resend:${me.id}`)==="loading",onClick:()=>void w.run(`resend:${me.id}`,async()=>{await Ce.resendSessionMessage(e,me.id),await jt()},{fail:Ve=>m("tasks.msgResendFailed",{error:qe(Ve)})}),className:"inline-flex items-center gap-1 rounded border border-amber-500/30 bg-amber-950/30 px-1.5 py-0.5 text-[10px] text-amber-300 transition-colors hover:border-amber-500/50 disabled:opacity-40",children:[o.jsx(lt,{state:w.stateOf(`resend:${me.id}`),className:"h-3 w-3",icon:o.jsx(Og,{className:"h-3 w-3"})}),m("tasks.msgResend")]}),o.jsxs("button",{type:"button",title:m(me.status==="pending"?"tasks.msgDismissQueuedHint":"tasks.msgDismissHint"),disabled:w.stateOf(`dismiss:${me.id}`)==="loading",onClick:()=>void w.run(`dismiss:${me.id}`,async()=>{await Ce.dismissSessionMessage(e,me.id),await jt()},{fail:Ve=>m("tasks.msgDismissFailed",{error:qe(Ve)})}),className:"inline-flex items-center gap-1 rounded border border-edge/[0.1] px-1.5 py-0.5 text-[10px] text-neutral-400 transition-colors hover:border-edge/20 hover:text-neutral-200 disabled:opacity-40",children:[o.jsx(lt,{state:w.stateOf(`dismiss:${me.id}`),className:"h-3 w-3",icon:o.jsx(er,{className:"h-3 w-3"})}),m("tasks.msgDismiss")]})]})]})]},$.key)}),!oe&&Je.length>0&&o.jsx("div",{className:"flex justify-end",children:o.jsx("div",{className:"min-w-0 max-w-[95%] overflow-x-auto rounded-lg border border-dashed border-blue-500/30 bg-blue-500/[0.07] px-2 py-1.5",children:Je.map(($,me)=>{var pt,os,ti,Tr,Pc,zc;const Ke=Je.length===1||Z===$.id,Ve=()=>{Je.length>1&&fe($m=>$m===$.id?null:$.id)};return o.jsxs("div",{className:de("flex gap-1.5",Ke?"items-start":"items-center",me>0&&"mt-1 border-t border-blue-500/10 pt-1"),children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[Ke?o.jsxs("div",{onClick:Ve,className:de("mb-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5",Je.length>1&&"cursor-pointer"),children:[o.jsx(Qe,{className:de("shrink-0",y0[$.status]),children:m(JE($.status))}),$.stalled===!0&&o.jsx("span",{className:"shrink-0 text-[10px] text-amber-400",children:m("tasks.msgStalled")}),$.stalled===!0&&$.releaseAt!=null&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:m("tasks.msgClearIn",{left:VJ($.releaseAt,kr)})}),(pt=$.images)!=null&&pt.length?o.jsx(au,{className:"h-3 w-3 shrink-0 text-neutral-500"}):null,o.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-neutral-600",children:qc($.at)})]}):o.jsxs("button",{type:"button",title:$.text,onClick:Ve,className:"flex w-full min-w-0 items-center gap-1.5 text-left",children:[o.jsx(Qe,{className:de("shrink-0",y0[$.status]),children:m(JE($.status))}),$.stalled===!0&&o.jsx(yl,{className:"h-3 w-3 shrink-0 text-amber-400"}),(os=$.images)!=null&&os.length?o.jsx(au,{className:"h-3 w-3 shrink-0 text-neutral-500"}):null,o.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-neutral-200",children:$.text||((Tr=(ti=$.images)==null?void 0:ti[0])==null?void 0:Tr.name)}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:qc($.at)})]}),Ke&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"whitespace-pre-wrap break-words text-[12px] text-neutral-200",children:$.text||((zc=(Pc=$.images)==null?void 0:Pc[0])==null?void 0:zc.name)}),$.reason==="offline"?o.jsx("p",{className:"mt-1 break-words text-[11px] text-amber-400",children:m("tasks.msgOffline")}):$.error?o.jsx("p",{className:"mt-1 break-words text-[11px] text-red-400",children:$.error}):null]})]}),o.jsx("div",{className:de("flex shrink-0 items-center gap-1",Ke&&"pt-0.5"),children:eD($)})]},`q:${$.id}`)})})}),(i||wr||Qn)&&o.jsxs("div",{className:"flex flex-wrap items-center justify-start gap-1.5",children:[i&&o.jsxs("button",{type:"button",title:m("tasks.answerTooltip"),onClick:()=>a==null?void 0:a(),className:"flex items-center gap-1.5 rounded-lg border border-amber-400/40 bg-amber-500/10 px-2 py-1.5 text-[10px] font-medium text-amber-300 transition-colors hover:border-amber-400/60 hover:text-amber-200",children:[o.jsx(aM,{className:"h-3 w-3"}),m("tasks.convAnswer")]}),(wr||Qn||ws)&&o.jsxs("div",{className:de("flex min-w-0 grow basis-48 items-center gap-1.5 rounded-lg border px-2 py-1.5 text-[10px]",ws?"border-red-500/30 bg-red-950/30 text-red-300":"border-edge/[0.08] bg-neutral-800/50 text-neutral-500"),children:[Qn?o.jsx(sM,{className:"h-3 w-3 shrink-0"}):ws?o.jsx(yl,{className:"h-3 w-3 shrink-0"}):o.jsx(gn,{className:"h-3 w-3 shrink-0 animate-spin"}),Qn?m("tasks.msgInterrupted"):ws?o.jsx("span",{className:"min-w-0 truncate",title:ws.text,children:ws.text}):Zr?m("tasks.msgCompacting"):Pi?o.jsx(cee,{text:Pi}):m("tasks.msgGenerating")]})]})]})})]}),q&&o.jsx("p",{className:"mt-1 shrink-0 rounded border border-red-500/30 bg-red-950/30 px-2 py-1 text-[11px] text-red-300",children:q}),oe?o.jsxs("div",{className:"mt-2 flex shrink-0 flex-wrap items-center gap-x-1.5 gap-y-1",children:[o.jsx("span",{className:"min-w-0 truncate text-[11px] text-neutral-400",children:m("tasks.convSelected",{n:te.size})}),o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[o.jsxs("button",{type:"button",disabled:Ie.length===0,onClick:Fa,className:de("inline-flex shrink-0 items-center gap-1 rounded border px-2 py-1 text-[11px] transition-colors disabled:opacity-40",ei?"border-blue-500/40 bg-blue-500/10 text-blue-300":"border-edge/[0.1] text-neutral-200 hover:border-edge/20"),children:[o.jsx(iM,{className:"h-3 w-3"}),m(ei?"tasks.convDeselectAll":"tasks.convSelectAll")]}),o.jsxs("button",{type:"button",disabled:te.size===0,onClick:Ba,className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-2 py-1 text-[11px] text-neutral-200 transition-colors hover:border-edge/20 disabled:opacity-40",children:[o.jsx(Ta,{className:"h-3 w-3"}),m("tasks.convCopy")]}),o.jsxs("button",{type:"button",disabled:te.size===0,onClick:an,title:m("tasks.convShare"),className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-2 py-1 text-[11px] text-neutral-200 transition-colors hover:border-edge/20 disabled:opacity-40",children:[o.jsx(lt,{state:w.stateOf(`convImg:${e}`),className:"h-3 w-3",icon:o.jsx(au,{className:"h-3 w-3"})}),m("tasks.convShare")]}),o.jsx("button",{type:"button",onClick:()=>{ye(!1),re(new Set)},className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-2 py-1 text-[11px] text-neutral-400 transition-colors hover:border-edge/20 hover:text-neutral-200",children:m("tasks.convCancel")})]})]}):o.jsxs("div",{className:"mt-2 flex shrink-0 flex-col gap-1.5",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("input",{ref:J,type:"file",accept:XE.join(","),multiple:!0,className:"hidden",onChange:$=>{var me;(me=$.target.files)!=null&&me.length&&Ha($.target.files),$.target.value=""}}),o.jsxs("button",{type:"button",disabled:!r.imageAttach||K>0,title:r.imageAttach?m("tasks.msgImageAttach"):((pw=r.unsupportedReasons)==null?void 0:pw.prompt)??m("tasks.msgImageUnsupported"),"aria-label":m("tasks.msgImageAttach"),onClick:()=>{var $;return($=J.current)==null?void 0:$.click()},className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-1.5 py-0.5 text-[11px] text-neutral-300 transition-colors hover:border-blue-500/40 hover:text-blue-300 disabled:opacity-40 max-lg:px-2.5 max-lg:py-1.5",children:[K>0?o.jsx(gn,{className:"h-3 w-3 animate-spin"}):o.jsx(au,{className:"h-3 w-3"}),m("tasks.msgImageAttach")]}),R.map($=>o.jsxs("span",{className:"relative inline-flex shrink-0",children:[o.jsx("button",{type:"button",title:$.name,onClick:()=>ne($),className:"block h-10 w-10 overflow-hidden rounded border border-edge/[0.12] bg-neutral-950",children:o.jsx("img",{src:`${Fr}/images/${$.id}`,alt:$.name,className:"h-full w-full object-cover",loading:"lazy"})}),o.jsx("button",{type:"button",title:m("tasks.msgImageRemove"),"aria-label":m("tasks.msgImageRemove"),onClick:()=>_(me=>me.filter(Ke=>Ke.id!==$.id)),className:"absolute -right-1 -top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full border border-edge/[0.15] bg-neutral-800 text-neutral-300 hover:border-red-500/50 hover:text-red-300 max-lg:h-5 max-lg:w-5",children:o.jsx(Vt,{className:"h-2.5 w-2.5"})})]},$.id))]}),(aw.length>0||Bm.length>0)&&o.jsxs("div",{className:"ml-auto flex max-w-full shrink-0 flex-wrap items-center gap-x-2 gap-y-1 max-lg:ml-0 max-lg:basis-full max-lg:justify-between",children:[aw.length>0&&o.jsxs("button",{type:"button",title:m("tasks.modeCycle"),"aria-label":m("tasks.modeCycle"),onClick:()=>Te(!0),className:"inline-flex min-w-0 shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-1.5 py-0.5 transition-colors hover:border-blue-500/40",children:[o.jsx(lt,{state:w.stateOf(`cycleMode:${e}`),className:"h-3 w-3 text-neutral-500",icon:o.jsx(Og,{className:"h-3 w-3"})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:m("tasks.modeLabel")}),o.jsx("span",{title:Hm??m("tasks.modeLastKnown"),style:{color:ow??void 0},className:de("truncate font-mono text-[11px] max-lg:max-w-[7rem]",!ow&&"text-neutral-400"),children:Hm??m("tasks.modeUnknown")})]}),Bm.length>0&&o.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:m("tasks.modelLabel")}),o.jsxs("div",{className:"relative min-w-0",children:[o.jsxs("select",{value:$a,onChange:$=>{const me=$.target.value;me&&sD(me)},title:m("tasks.modelLastKnown"),"aria-label":m("tasks.modelLabel"),className:"max-w-[12rem] appearance-none rounded border border-edge/[0.1] bg-neutral-950 py-0.5 pl-1.5 pr-6 font-mono text-[11px] text-neutral-200 focus:border-blue-500/40 focus:outline-none max-lg:max-w-[8rem]",children:[!$a&&o.jsx("option",{value:"",children:m("tasks.modelUnknown")}),cw.map($=>o.jsx("option",{value:$.value,children:$.label},$.value)),$a&&!cw.some($=>$.value===$a)&&o.jsx("option",{value:$a,children:$a})]}),o.jsx(_n,{className:"pointer-events-none absolute right-1 top-1/2 h-3 w-3 -translate-y-1/2 text-neutral-500"})]})]})]})]}),He&&o.jsx("div",{role:"separator",title:m("tasks.msgResizeInput"),"aria-label":m("tasks.msgResizeInput"),onPointerDown:Fm,onPointerMove:ZO,onPointerUp:rw,onPointerCancel:rw,className:"group -mb-1 flex h-2 cursor-ns-resize touch-none items-center justify-center",children:o.jsx("span",{className:"h-0.5 w-8 rounded-full bg-edge/[0.12] transition-colors group-hover:bg-blue-500/50"})}),o.jsxs("div",{className:"flex flex-wrap items-end gap-1.5",children:[o.jsx("textarea",{ref:pe,value:U,onChange:$=>B($.target.value),onKeyDown:$=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),iw())},onPaste:$=>{const me=ZE($.clipboardData);me.length!==0&&($.preventDefault(),Ha(me))},placeholder:m("tasks.messagesPlaceholder"),rows:Ge,className:"min-w-0 flex-1 resize-none rounded border border-edge/[0.1] bg-neutral-950 px-2 py-1.5 text-xs text-neutral-100 focus:outline-none focus:border-blue-500/40 max-lg:basis-full"}),o.jsx("button",{type:"button",title:m("tasks.msgNewline"),"aria-label":m("tasks.msgNewline"),onPointerDown:$=>$.preventDefault(),onClick:pf,className:"hidden shrink-0 items-center justify-center rounded border border-edge/[0.1] text-neutral-400 transition-colors hover:border-blue-500/40 hover:text-blue-300 max-lg:inline-flex max-lg:h-8 max-lg:w-8",children:o.jsx(v6,{className:"h-3.5 w-3.5"})}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1 max-lg:ml-auto",children:[o.jsx("button",{type:"button",title:m("tasks.stopTooltip"),"aria-label":m("tasks.stopTooltip"),disabled:xe>0,onClick:()=>{l(e),ve($J)},className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded border border-edge/[0.1] text-neutral-400 transition-colors hover:border-red-500/40 hover:text-red-300 disabled:opacity-30 disabled:hover:border-edge/[0.1] disabled:hover:text-neutral-400 max-lg:h-8 max-lg:w-8",children:o.jsx(lt,{state:c(e),className:"h-3 w-3",icon:o.jsx("span",{className:"text-[9px] font-medium tracking-tight max-lg:text-[10px]",children:xe>0?xe:"ESC"})})}),o.jsx("button",{type:"button",disabled:!r.prompt||!U.trim()&&R.length===0||w.stateOf(`sendMsg:${e}`)==="loading",title:r.prompt?void 0:((mw=r.unsupportedReasons)==null?void 0:mw.prompt)??m("tasks.msgUnsupported"),"aria-label":m("tasks.messagesSend"),onClick:iw,className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded bg-blue-600/80 text-white transition-colors hover:bg-blue-500 disabled:opacity-40 max-lg:h-8 max-lg:w-8",children:o.jsx(lt,{state:w.stateOf(`sendMsg:${e}`),className:"h-3 w-3",icon:o.jsx(mM,{className:"h-3 w-3"})})})]})]})]}),o.jsx(PJ,{projectId:t,sessionName:(Zn==null?void 0:Zn.title)??n,model:$a||null,effort:(Zn==null?void 0:Zn.effort)??null}),!h&&Fe&&o.jsx("div",{role:"separator",title:m("app.resizeDialog"),"aria-label":m("app.resizeDialog"),onPointerDown:z,onPointerMove:le,onPointerUp:Ee,onPointerCancel:Ee,onClick:$=>$.stopPropagation(),className:"absolute bottom-0 right-0 h-4 w-4 cursor-nwse-resize touch-none",children:o.jsx("span",{className:"pointer-events-none absolute bottom-1 right-1 h-2 w-2 rounded-br border-b border-r border-edge/20"})}),Ae&&sn.createPortal(o.jsx("div",{"data-conv-menu":!0,className:"fixed z-[60] rounded-lg border border-edge/[0.1] bg-neutral-900 py-1 shadow-mac",style:{left:Math.max(8,Math.min(Ae.x,window.innerWidth-r_-8)),top:Math.max(8,Math.min(Ae.y,window.innerHeight-i_))},onClick:$=>$.stopPropagation(),children:Ae.kind==="bubble"?o.jsxs("button",{type:"button",onClick:()=>Ua(Ae.key),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(mr,{className:"h-3 w-3 text-neutral-500"}),m("tasks.convSelect")]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>Hn("clipboard"),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(Ta,{className:"h-3 w-3 text-neutral-500"}),m("tasks.convShareCopy")]}),o.jsxs("button",{type:"button",onClick:()=>Hn("download"),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(pm,{className:"h-3 w-3 text-neutral-500"}),m("tasks.convShareDownload")]})]})}),document.body),X&&sn.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/70 p-6",onClick:()=>ne(null),children:[o.jsx("button",{type:"button",title:m("tasks.msgImagePreview"),"aria-label":m("tasks.msgImagePreview"),onClick:()=>ne(null),className:"absolute right-4 top-4 inline-flex h-8 w-8 items-center justify-center rounded-full border border-edge/[0.15] bg-neutral-900 text-neutral-300 hover:text-neutral-100",children:o.jsx(Vt,{className:"h-4 w-4"})}),o.jsx("img",{src:`${Fr}/images/${X.id}`,alt:X.name,onClick:$=>$.stopPropagation(),className:"max-h-full max-w-full rounded-lg border border-edge/[0.12] object-contain"})]}),document.body),o.jsx(Mi,{open:Re,title:m("tasks.msgCloseConfirmTitle"),message:m("tasks.msgCloseConfirm"),confirmLabel:m("tasks.messagesClose"),onConfirm:()=>f==null?void 0:f(),onClose:()=>se(!1)}),o.jsx(Mi,{open:Q,title:m("tasks.modeConfirmTitle"),message:m("tasks.modeConfirm"),confirmLabel:m("tasks.modeConfirmAction"),onConfirm:nD,onClose:()=>Te(!1)}),y&&o.jsx(IJ,{sessionId:e,label:n,onClose:()=>x(!1)})]});return h?uw:sn.createPortal(o.jsx("div",{className:de("fixed inset-0 z-50 items-center justify-center bg-black/50 p-4",u?"hidden":"flex"),onClick:d,children:uw}),document.body)}function pee({harnesses:e,onPick:t,onClose:n}){const s=We();return b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[n]),sn.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:n,children:o.jsxs("div",{className:"w-full max-w-xs rounded-xl border border-edge/[0.08] bg-neutral-900 p-3 shadow-mac",onClick:r=>r.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsx("p",{className:"text-xs font-medium text-neutral-200",children:s("tasks.harnessPickTitle")}),o.jsx("button",{type:"button",title:s("tasks.terminalPickCancel"),"aria-label":s("tasks.terminalPickCancel"),onClick:n,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(Vt,{className:"h-3.5 w-3.5"})})]}),o.jsx("ul",{className:"max-h-72 space-y-1 overflow-y-auto",children:e.map(r=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>t(r),className:"flex w-full items-center gap-2 rounded-lg border border-edge/[0.06] bg-edge/[0.02] px-2.5 py-2 text-left transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.06]",children:[o.jsx(Rl,{harness:r}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",children:Kn(r).label})]})},r))})]})}),document.body)}const mee="pre-session",Vk="orphan";function HR(e,t,n){const s=[],r=w=>(s.push(w),w),i=new Set;let a=null,l=null,c=null;const u=new Map,d=new Map,f=new Map,h=(w,g)=>{i.has(w)||(i.add(w),g&&(w.open=!0),c=w,l===w&&(l=null))},p=(w,g)=>{let S=(g?u.get(g):void 0)??l??c??a;S||(S=a=r({id:mee,events:[],dispatches:[],preSession:!0,subagentStops:0,agentsDispatched:0,questions:0}),i.add(S)),S.events.push(w),w.eventType===n.subagentStop&&S.subagentStops++,w.eventType==="PreToolUse"&&n.questionTools.includes(id(w.payload).toolName??"")&&S.questions++;const A=kx(w);A&&(S.agentsDispatched++,d.set(A.agentId,S),A.toolUseId&&f.set(A.toolUseId,S))};for(const w of e){const g=w.eventType,y=bee(w.payload);if(g===n.open){const x=bm(w);if(x){const E=(x.toolUseId?f.get(x.toolUseId):void 0)??(x.taskId?d.get(x.taskId):void 0);E?E.events.push(w):p(w,y);continue}if(y){const E=u.get(y);if(E){l=E,E.events.push(w);continue}}const S=r({id:`turn:${w.id}`,events:[],dispatches:[],subagentStops:0,agentsDispatched:0,questions:0});y&&(S.promptId=y,u.set(y,S)),l=S;const A=gee(w.payload);A!==void 0&&(S.prompt=A),S.events.push(w);continue}if(n.close.includes(g)){const S=(y?u.get(y):void 0)??l;S?(S.events.push(w),h(S,n.closeFailed.includes(g))):p(w,y);continue}if(n.sessionMarkers.includes(g)){const x=y?u.get(y):void 0,S=x!==void 0&&x===l,A=x??l;A?A.events.push(w):p(w,y),!S&&l&&!i.has(l)&&h(l,!0);continue}p(w,y)}for(const w of s)i.has(w)||(w.open=!0,i.add(w));const m=new Map;for(const w of s)for(const g of w.events)m.set(g.id,w);let k=null;for(const w of t){const g=w.eventId!=null?m.get(w.eventId):void 0;if(g){g.dispatches.push(w);continue}k??(k=r({id:Vk,events:[],dispatches:[],subagentStops:0,agentsDispatched:0,questions:0})),i.add(k),k.dispatches.push(w)}return s}function gee(e){try{const t=JSON.parse(e).raw;if(t&&typeof t=="object"){const n=t.prompt;if(typeof n=="string"&&n.length>0)return n}}catch{}}function bee(e){try{const t=JSON.parse(e).raw;if(t&&typeof t=="object"){const n=t.prompt_id;if(typeof n=="string"&&n.length>0)return n}}catch{}}const No=400,fu=280,hu=56,xee=128;function yee(e){const t=new Set;let n=0;for(const s of e){const r=Oi(s).tool_use_id;if(typeof r!="string"||!r){n+=s.eventType==="PreToolUse"?1:-1;continue}s.eventType==="PostToolUse"?t.delete(r):t.add(r)}return t.size>0||n>0}function $R(e){if(e.eventType!=="SessionStart")return;const t=Oi(e).model;return typeof t=="string"&&t?t:void 0}function vee(e,t,n=new Map,s,r=Qd[en[0]??"claude"]){var w;const i=g=>g.map(y=>{const x=y.status==="pending";return{key:`d:${y.id}`,kind:"dispatch",dispatch:y,children:[],hasPotential:!1,highlight:x}}),a=(g,y)=>{const x=new Map;for(const A of y){const E=x.get(A.ruleId)??[];E.push(A),x.set(A.ruleId,E)}const S=[];for(const[A,E]of x){const M=`e:${g}:r:${A}`,j=n.get(A),O=E.some(G=>G.status==="pending"),N=i(E);let F;j!=null&&j.handlerType?F=[{key:`${M}:h`,kind:"handler",handlerType:j.handlerType,children:N,hasPotential:N.length>0,highlight:O}]:F=N,S.push({key:M,kind:"rule",ruleId:A,ruleName:j?j.name:null,children:F,hasPotential:F.length>0,highlight:O})}return S},l=[],c=[];for(const g of e){const y=`g:${g.id}`,x=[];if(t.has(y))if(g.events.length>0){const A=[],E=new Map,M=new Map,j=new Map;let O=null;const N=H=>{const I=`e:${H.id}`,L=g.dispatches.filter(_=>_.eventId===H.id),C=t.has(I)?a(H.id,L):[],D=H.eventType===r.subagentStop,U=kx(H),B=bm(H);if(B||D){const _=Oi(H),K=(B==null?void 0:B.taskId)??(typeof _.agent_id=="string"?_.agent_id:null),T=(B!=null&&B.toolUseId?M.get(B.toolUseId):void 0)??(K?M.get(K):void 0);if(T){const X={key:I,kind:B?"notification":"subagent",event:H,children:C,hasPotential:C.length>0,highlight:C.some(J=>J.highlight),model:T.model,agentId:T.agentId},ne=j.get(T)??[];ne.push(X),j.set(T,ne),E.set(H.id,X),B&&(T.agentRunning=!1);return}}const R={key:I,kind:B?"notification":D?"subagent":"event",event:H,children:C,hasPotential:L.length>0,highlight:C.some(_=>_.highlight),agentId:(U==null?void 0:U.agentId)??(B==null?void 0:B.taskId)??void 0,model:(U==null?void 0:U.model)??$R(H),agentRunning:U?!0:void 0};if(U&&(M.set(U.agentId,R),U.toolUseId&&M.set(U.toolUseId,R),j.set(R,[])),D){const _=O?E.get(O.id):void 0;if(_){_.children.unshift(R),_.highlight=_.highlight||R.highlight,O=H,E.set(H.id,R);return}}A.push(R),E.set(H.id,R),O=H};let F=[];const G=()=>{if(F.length!==0){if(F.length>=2){const H=`c:${F[0].id}`;A.push({key:H,kind:"cluster",children:t.has(H)?F.map(I=>({key:`e:${I.id}`,kind:"event",event:I,children:[],hasPotential:!1,highlight:!1})):[],hasPotential:!0,highlight:!1,clusterEvents:F}),O=null}else N(F[0]);F=[]}};for(const H of g.events){if((H.eventType==="PreToolUse"||H.eventType==="PostToolUse")&&!kx(H)&&!g.dispatches.some(L=>L.eventId===H.id)){F.push(H);continue}G(),N(H)}G();for(const[H,I]of j)I.length===0&&H.agentRunning&&I.push({key:`${H.key}:agent`,kind:"subagent",children:[],hasPotential:!1,highlight:!1,agentId:H.agentId,model:H.model,agentRunning:!0}),I.length>0&&(H.children=[...I,...H.children],H.highlight=H.highlight||I.some(L=>L.highlight),c.push({anchor:H,members:I,closed:!H.agentRunning}));x.push(...A)}else x.push(...i(g.dispatches));const S=x.some(A=>A.highlight)||g.dispatches.some(A=>A.status==="pending");l.push({key:y,kind:"group",group:g,children:x,hasPotential:g.events.length>0||g.dispatches.length>0,highlight:S,model:s})}const u=[],d=[];let f=0;const h=(g,y,x)=>{x&&d.push({id:`${x}->${g.key}`,source:x,target:g.key});let S;if(g.children.length===0)S=f*xee,f+=1;else{const A=h(g.children[0],y+1,g.key);let E=A;for(let M=1;M<g.children.length;M++)E=h(g.children[M],y+1,g.key);S=(A+E)/2}return u.push({key:g.key,kind:g.kind,depth:y,y:S,group:g.group,event:g.event,dispatch:g.dispatch,ruleId:g.ruleId,ruleName:g.ruleName,handlerType:g.handlerType,clusterEvents:g.clusterEvents,agentId:g.agentId,model:g.model,agentRunning:g.agentRunning,expandable:g.hasPotential,expanded:t.has(g.key),highlight:g.highlight}),S};for(const g of l)h(g,0,null);for(const g of l){if(g.kind!=="group")continue;const y=g.children.filter(S=>S.kind==="event"||S.kind==="cluster"||S.kind==="subagent"||S.kind==="notification");if(y.length===0)continue;const x=new Set(y.map(S=>S.key));for(let S=d.length-1;S>=0;S--){const A=d[S];A.source===g.key&&x.has(A.target)&&d.splice(S,1)}d.push({id:`${g.key}->${y[0].key}`,source:g.key,target:y[0].key});for(let S=0;S+1<y.length;S++)d.push({id:`${y[S].key}->${y[S+1].key}`,source:y[S].key,target:y[S+1].key,vertical:!0});(w=g.group)!=null&&w.open||d.push({id:`${y[y.length-1].key}->${g.key}`,source:y[y.length-1].key,target:g.key,closure:!0})}const p=g=>[...g.kind==="cluster"?[g]:[],...g.children.flatMap(p)],m=new Map(u.map(g=>[g.key,g.y])),k=new Map(u.map(g=>[g.key,g.depth]));for(const g of l.flatMap(p)){if(g.children.length===0)continue;const y=new Set(g.children.map(j=>j.key));for(let j=d.length-1;j>=0;j--){const O=d[j];O.source===g.key&&y.has(O.target)&&d.splice(j,1)}d.push({id:`${g.key}->${g.children[0].key}`,source:g.key,target:g.children[0].key,dashed:!0});for(let j=0;j+1<g.children.length;j++)d.push({id:`${g.children[j].key}->${g.children[j+1].key}`,source:g.children[j].key,target:g.children[j+1].key,vertical:!0});if(yee(g.clusterEvents??[]))continue;const x=g.children[g.children.length-1],S=(m.get(x.key)??0)+hu/2,A=(m.get(g.key)??0)+hu*.78,M=(k.get(g.key)??0)*No+fu+(No-fu)/2;d.push({id:`${x.key}->${g.key}`,source:x.key,target:g.key,clusterLoop:!0,waypoints:[{x:M,y:S},{x:M,y:A}]})}for(const{anchor:g,members:y,closed:x}of c){const S=new Set(y.map(E=>E.key));for(let E=d.length-1;E>=0;E--){const M=d[E];M.source===g.key&&S.has(M.target)&&d.splice(E,1)}let A=g.key;for(const E of y)d.push({id:`${A}->${E.key}`,source:A,target:E.key,vertical:A!==g.key}),A=E.key;if(x){const E=k.get(g.key)??0,M=(m.get(A)??0)+hu/2,j=(m.get(g.key)??0)+hu*.78,O=E*No+fu+(No-fu)/2;d.push({id:`${A}->${g.key}`,source:A,target:g.key,ringLoop:!0,waypoints:[{x:O,y:M},{x:O,y:j}]})}}return{nodes:u,edges:d}}const GR=b.createContext(new Set);function Kt(e){return`${e} rounded px-1 py-px text-[10px] leading-tight`}function zo({model:e}){const t=e.replace(/\[.*$/,"");return o.jsx("span",{className:"rounded border border-indigo-500/40 bg-indigo-500/15 px-1 py-px text-[10px] font-medium leading-tight text-indigo-200",title:e,children:t})}function kee({data:e}){var f;const t=We(),n=b.useContext(GR),{node:s,flash:r,onToggle:i,onOpenDetail:a,answerable:l,onOpenAnswer:c}=e,u=s.expandable?o.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),i(s.key)},className:"shrink-0 rounded p-0.5 text-neutral-500 transition-colors hover:bg-edge/[0.08] hover:text-neutral-200","aria-expanded":s.expanded,children:s.expanded?o.jsx(_n,{className:"h-3.5 w-3.5"}):o.jsx(Yn,{className:"h-3.5 w-3.5"})}):o.jsx("span",{className:"w-4 shrink-0"});let d=null;if(s.kind==="group"&&s.group){const h=s.group,p=h.preSession?t("hooks.mindmap.preSession"):h.prompt??"",m=(f=h.events[0])==null?void 0:f.createdAt;d=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block truncate text-xs text-neutral-100",title:h.prompt??p,children:p}),o.jsxs("span",{className:"mt-1 flex flex-wrap items-center gap-1",children:[h.preSession?o.jsx("span",{className:Kt("bg-neutral-800 text-neutral-300"),children:p}):o.jsx("span",{className:Kt("bg-cyan-900/40 text-cyan-300"),children:"prompt"}),h.open&&(n.has(h.id)?o.jsx("span",{className:Kt("bg-emerald-900/40 text-emerald-300"),children:t("hooks.mindmap.runningTag")}):o.jsx("span",{className:Kt("bg-red-900/40 text-red-300"),children:t("hooks.mindmap.openTag")})),l&&o.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),c==null||c()},className:Kt("bg-amber-900/50 font-medium text-amber-300 transition-colors hover:bg-amber-800/60 hover:text-amber-200"),children:t("tasks.answerPendingTag")}),h.subagentStops>0&&o.jsx("span",{className:Kt("bg-orange-900/40 text-orange-300"),children:t("hooks.mindmap.subagentCount",{n:h.subagentStops})}),h.agentsDispatched>0&&o.jsx("span",{className:Kt("bg-fuchsia-900/40 text-fuchsia-300"),children:t("hooks.mindmap.agentDispatched",{n:h.agentsDispatched})}),h.dispatches.length>0&&o.jsx("span",{className:Kt("bg-emerald-900/40 text-emerald-300"),children:t("hooks.mindmap.dispatchCount",{n:h.dispatches.length})}),s.model&&o.jsx(zo,{model:s.model}),o.jsxs("span",{className:"text-[10px] text-neutral-500",children:[t("catbar.items",{n:h.events.length}),m?` · ${lr(m)}`:""]})]})]})}else if((s.kind==="event"||s.kind==="subagent"||s.kind==="notification")&&s.event){const h=s.event,p=s.kind==="subagent",m=ju(h),k=Yv(h.source,h.eventType,Oi(h).source);d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("span",{className:Kt(AM[h.eventType]??"bg-neutral-800 text-neutral-300"),children:h.eventType}),k&&o.jsx("span",{className:Kt("bg-amber-900/40 text-amber-300"),children:t("hooks.mindmap.compactTag")}),p&&o.jsx("span",{className:Kt("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:"subagent"}),s.kind==="notification"&&o.jsx("span",{className:Kt("border border-teal-700/50 bg-teal-950/60 text-teal-300"),children:t("hooks.mindmap.notifyTag")}),s.agentId&&o.jsxs("span",{className:"text-[10px] text-neutral-500",children:["agent …",s.agentId.slice(-8)]}),s.model&&o.jsx(zo,{model:s.model}),s.agentRunning&&o.jsx("span",{className:Kt("bg-amber-900/50 text-amber-300"),children:t("hooks.mindmap.agentRunning")}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:lr(h.createdAt)})]}),m&&o.jsx("span",{className:de("mt-0.5 block text-[11px] text-neutral-400",p?"line-clamp-2 text-orange-100/70":"truncate"),title:m,children:m})]})}else if(s.kind==="cluster"&&s.clusterEvents){const h=s.clusterEvents,p=new Map;for(const g of h){const y=id(g.payload).toolName??g.eventType;p.set(y,(p.get(y)??0)+1)}const m=[...p.entries()].sort((g,y)=>y[1]-g[1]),k=m.map(([g,y])=>`${g} ×${y}`).join(" · "),w=m.slice(0,3).map(([g,y])=>y>1?`${g} ×${y}`:g).join(" · ");d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("span",{className:Kt("bg-amber-900/40 text-amber-300"),children:t("hooks.mindmap.toolCluster")}),o.jsxs("span",{className:"text-[10px] text-neutral-400",children:["×",h.length]}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:lr(h[0].createdAt)})]}),o.jsxs("span",{className:"mt-0.5 block truncate text-[11px] text-neutral-400",title:k,children:[w,m.length>3?` · +${m.length-3}`:""]})]})}else if(s.kind==="subagent"&&!s.event)d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("span",{className:Kt("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:"subagent"}),s.agentId&&o.jsxs("span",{className:"text-[10px] text-neutral-500",children:["agent …",s.agentId.slice(-8)]}),s.model&&o.jsx(zo,{model:s.model}),s.agentRunning&&o.jsx("span",{className:Kt("bg-amber-900/50 text-amber-300"),children:t("hooks.mindmap.agentRunning")})]}),o.jsx("span",{className:"mt-0.5 block text-[11px] text-neutral-400",children:t("hooks.mindmap.agentPending")})]});else if(s.kind==="rule")d=o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Kt("bg-blue-900/40 text-blue-300"),children:"rule"}),o.jsx("span",{className:"truncate text-xs text-blue-200",title:s.ruleName??s.ruleId??"",children:s.ruleName??(s.ruleId?`#${s.ruleId.slice(0,12)}`:"")})]});else if(s.kind==="handler")d=o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Kt("bg-purple-900/40 text-purple-300"),children:"handler"}),o.jsx("span",{className:"truncate text-xs text-purple-200",children:s.handlerType})]});else if(s.kind==="dispatch"&&s.dispatch){const h=s.dispatch;d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Kt("bg-emerald-900/40 text-emerald-300"),children:t("hooks.mindmap.dispatchTag")}),o.jsx("span",{className:"truncate text-[10px] text-neutral-400",title:e.ruleName??h.ruleId,children:e.ruleName??h.ruleId}),o.jsx(KR,{status:h.status})]}),o.jsx("span",{className:"mt-0.5 block truncate text-[11px] text-neutral-400",title:h.prompt,children:h.prompt})]})}return o.jsxs("div",{className:de("flex w-[280px] cursor-pointer items-start gap-1 rounded-lg border border-edge/[0.08] bg-neutral-900/95 px-2 py-1.5 shadow-mac transition-colors hover:border-edge/[0.18]",s.highlight&&"ring-1 ring-amber-400/70",r&&"weave-node-flash"),title:s.highlight?t("hooks.mindmap.pendingTip"):void 0,onClick:h=>{h.stopPropagation(),a(s)},children:[o.jsx(Pn,{type:"target",id:"l",position:Xe.Left,style:{visibility:"hidden"}}),o.jsx(Pn,{type:"target",id:"t",position:Xe.Top,style:{visibility:"hidden"}}),o.jsx(Pn,{type:"target",id:"rt",position:Xe.Right,style:{visibility:"hidden",top:"78%"}}),o.jsx(Pn,{type:"source",id:"r",position:Xe.Right,style:{visibility:"hidden"}}),o.jsx(Pn,{type:"source",id:"b",position:Xe.Bottom,style:{visibility:"hidden"}}),o.jsx(Pn,{type:"source",id:"c",position:Xe.Left,style:{visibility:"hidden"}}),u,o.jsx("div",{className:"min-w-0 flex-1",children:d})]})}const wee={pending:"hooks.status.pending",injected:"hooks.status.injected",running:"hooks.status.running",succeeded:"hooks.status.succeeded",failed:"hooks.status.failed",timeout:"hooks.status.timeout"};function KR({status:e}){const t=We(),n=e==="succeeded"?"bg-emerald-500":e==="failed"||e==="timeout"?"bg-red-400":e==="running"?"bg-blue-400 animate-pulse":e==="injected"?"bg-cyan-400":"bg-amber-400",s=wee[e];return o.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-neutral-500",children:[o.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${n}`}),s?t(s):e]})}const See={mindmap:kee};function Nee(e,t=14){let n=`M${e[0].x} ${e[0].y}`;for(let r=1;r<e.length-1;r++){const i=e[r-1],a=e[r],l=e[r+1],c=(h,p)=>Math.hypot(p.x-h.x,p.y-h.y),u=Math.min(t,c(i,a)/2,c(a,l)/2),d={x:a.x+(i.x-a.x)*(u/c(i,a)),y:a.y+(i.y-a.y)*(u/c(i,a))},f={x:a.x+(l.x-a.x)*(u/c(a,l)),y:a.y+(l.y-a.y)*(u/c(a,l))};n+=` L${d.x} ${d.y} Q${a.x} ${a.y} ${f.x} ${f.y}`}const s=e[e.length-1];return`${n} L${s.x} ${s.y}`}function Eee({id:e,sourceX:t,sourceY:n,targetX:s,targetY:r,markerEnd:i,style:a,data:l}){const c=(l==null?void 0:l.waypoints)??[],u=[{x:t,y:n},...c,{x:s,y:r}];return o.jsx(af,{id:e,path:Nee(u),markerEnd:i,style:a})}const _ee={waypoint:Eee};function Cee({projectId:e,sessionId:t,sessions:n,harness:s,onSelect:r,focusGroupId:i,focusGroup:a,running:l,answerable:c,onOpenAnswer:u}){const d=We(),f=xk(),h=Qd[s??en[0]??"claude"],[p,m]=b.useState(null),[k,w]=b.useState(null),[g,y]=b.useState(new Map),[x,S]=b.useState(new Set),[A,E]=b.useState(null),[M,j]=b.useState(null),O=b.useRef(null),N=b.useRef(null),F=b.useCallback(async()=>{try{const[T,X,ne]=await Promise.all([Ce.listSessionHooks(e,t,300),Ce.listHookDispatches({limit:200}),Ce.listHooksRules(e)]);m(T),w(X),y(new Map(ne.map(J=>[J.id,{name:J.name,handlerType:J.handler.type}])))}catch{}},[e,t]);b.useEffect(()=>{m(null),w(null),S(i?new Set([`g:${i}`]):new Set),j(null),F()},[F,i]),b.useEffect(()=>{const X=Ai(ne=>{ne.kind==="dispatch.created"&&ne.dispatchId!=null&&(E(`d:${ne.dispatchId}`),O.current&&window.clearTimeout(O.current),O.current=window.setTimeout(()=>E(null),900)),N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>void F(),500)});return()=>{X(),O.current&&window.clearTimeout(O.current),N.current&&window.clearTimeout(N.current)}},[F]);const G=b.useMemo(()=>{if(i&&a)return[a];if(!p||!k)return[];const T=new Set(p.map(pe=>pe.id)),X=k.filter(pe=>pe.sessionId===t||pe.eventId!=null&&T.has(pe.eventId)).sort((pe,q)=>pe.id-q.id),ne=p.length>=300,J=HR(p,X,h).filter(pe=>pe.id!==Vk&&!(pe.preSession&&ne));return i?J.filter(pe=>pe.id===i):J},[p,k,t,i,a,h]),H=b.useMemo(()=>{const T=G[G.length-1];return l&&T?new Set([T.id]):new Set},[G,l]),I=b.useMemo(()=>{if(p)for(let T=p.length-1;T>=0;T--){const X=$R(p[T]);if(X)return X}},[p]),L=b.useMemo(()=>vee(G,x,g,I,h),[G,x,g,I,h]),C=b.useRef(null),D=b.useRef(null),U=b.useCallback(T=>{D.current=T,S(X=>{const ne=new Set(X);return ne.delete(T)||ne.add(T),ne})},[]),B=b.useCallback(T=>j(T),[]);b.useEffect(()=>{const T=D.current;if(!T)return;D.current=null;const X=L.nodes.find(J=>J.key===T),ne=C.current;!X||!ne||ne.setCenter(X.depth*No+fu/2,X.y+hu/2,{zoom:ne.getZoom(),duration:250})},[L]);const R=b.useMemo(()=>L.nodes.map(T=>{var X;return{id:T.key,type:"mindmap",position:{x:T.depth*No,y:T.y},data:{node:T,flash:A===T.key,ruleName:T.dispatch?((X=g.get(T.dispatch.ruleId))==null?void 0:X.name)??void 0:void 0,onToggle:U,onOpenDetail:B,answerable:T.kind==="group"&&(c??!1),onOpenAnswer:u},draggable:!0}}),[L.nodes,A,g,U,B,c,u]),_=b.useMemo(()=>L.edges.map(T=>({id:T.id,...T.waypoints?{data:{waypoints:T.waypoints}}:{},source:T.source,target:T.target,sourceHandle:T.closure||T.clusterLoop||T.ringLoop?"c":T.vertical?"b":"r",targetHandle:T.closure?"l":T.clusterLoop||T.ringLoop?"rt":T.vertical?"t":"l",type:T.waypoints?"waypoint":"smoothstep",markerEnd:{type:mc.ArrowClosed,width:16,height:16},style:T.dashed||T.clusterLoop?{stroke:"rgba(96,165,250,0.55)",strokeWidth:1.5,strokeDasharray:"7 5"}:{stroke:"rgba(96,165,250,0.8)",strokeWidth:2}})),[L.edges]),K=T=>{const X=(J,pe)=>o.jsxs("p",{className:"flex gap-2",children:[o.jsx("span",{className:"shrink-0 text-neutral-500",children:J}),o.jsx("span",{className:"min-w-0 break-all text-neutral-300",children:pe})]}),ne=J=>J==null?"—":typeof J=="string"?J:JSON.stringify(J,null,2);if(T.kind==="group"&&T.group){const J=T.group;return o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"whitespace-pre-wrap break-all text-neutral-100",children:J.prompt??d("hooks.mindmap.preSession")}),o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[J.open&&(H.has(J.id)?o.jsx("span",{className:"rounded bg-emerald-900/40 px-1 text-[10px] text-emerald-300",children:d("hooks.mindmap.runningTag")}):o.jsx("span",{className:"rounded bg-red-900/40 px-1 text-[10px] text-red-300",children:d("hooks.mindmap.openTag")})),J.subagentStops>0&&o.jsx("span",{className:"rounded bg-orange-900/40 px-1 text-[10px] text-orange-300",children:d("hooks.mindmap.subagentCount",{n:J.subagentStops})}),J.agentsDispatched>0&&o.jsx("span",{className:"rounded bg-fuchsia-900/40 px-1 text-[10px] text-fuchsia-300",children:d("hooks.mindmap.agentDispatched",{n:J.agentsDispatched})}),T.model&&o.jsx(zo,{model:T.model})]}),X(d("tasks.events",{n:J.events.length}),""),X(d("tasks.groupDispatches",{n:J.dispatches.length}),"")]})}if(T.kind==="subagent"&&!T.event)return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:Kt("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:"subagent"}),T.agentId&&o.jsxs("span",{className:"text-neutral-500",children:["agent …",T.agentId.slice(-8)]}),T.model&&o.jsx(zo,{model:T.model}),T.agentRunning&&o.jsx("span",{className:Kt("bg-amber-900/50 text-amber-300"),children:d("hooks.mindmap.agentRunning")})]}),o.jsx("p",{className:"text-neutral-400",children:d("hooks.mindmap.agentPending")})]});if((T.kind==="event"||T.kind==="subagent"||T.kind==="notification")&&T.event){const J=T.event,pe=id(J.payload);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:Kt(AM[J.eventType]??"bg-neutral-800 text-neutral-300"),children:J.eventType}),Yv(J.source,J.eventType,Oi(J).source)&&o.jsx("span",{className:Kt("bg-amber-900/40 text-amber-300"),children:d("hooks.mindmap.compactTag")}),T.agentId&&o.jsxs("span",{className:Kt("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:["agent …",T.agentId.slice(-8)]}),T.model&&o.jsx(zo,{model:T.model}),T.agentRunning&&o.jsx("span",{className:Kt("bg-amber-900/50 text-amber-300"),children:d("hooks.mindmap.agentRunning")}),o.jsx("span",{className:"text-neutral-500",children:lr(J.createdAt)})]}),o.jsx("p",{className:"whitespace-pre-wrap break-all text-neutral-100",children:ju(J)}),pe.toolInput!=null&&o.jsxs("div",{children:[o.jsx("p",{className:"text-[9px] uppercase tracking-wide text-neutral-600",children:"input"}),o.jsx("pre",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap break-all text-neutral-400",children:ne(pe.toolInput)})]}),pe.toolResponse!=null&&o.jsxs("div",{children:[o.jsx("p",{className:"text-[9px] uppercase tracking-wide text-neutral-600",children:"response"}),o.jsx("pre",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap break-all text-neutral-400",children:ne(pe.toolResponse)})]})]})}if(T.kind==="cluster"&&T.clusterEvents){const J=T.clusterEvents,pe=new Map;for(const q of J){const Y=id(q.payload).toolName??q.eventType;pe.set(Y,(pe.get(Y)??0)+1)}return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex flex-wrap gap-1.5",children:[...pe.entries()].map(([q,Y])=>o.jsxs("span",{className:"rounded bg-amber-900/40 px-1 text-[10px] text-amber-300",children:[q," ×",Y]},q))}),o.jsxs("p",{className:"text-neutral-500",children:[lr(J[0].createdAt)," → ",lr(J[J.length-1].createdAt)]}),o.jsx("ul",{className:"space-y-1",children:J.map(q=>o.jsxs("li",{className:"truncate text-neutral-300",title:ju(q),children:[o.jsx("span",{className:"text-neutral-600",children:lr(q.createdAt)})," ",ju(q)||q.eventType]},q.id))})]})}if(T.kind==="dispatch"&&T.dispatch){const J=T.dispatch;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(KR,{status:J.status}),o.jsx("span",{className:"text-neutral-500",children:lr(J.startedAt)}),J.finishedAt&&o.jsxs("span",{className:"text-neutral-600",children:["→ ",lr(J.finishedAt)]})]}),X("rule",T.ruleName??J.ruleId),o.jsx("p",{className:"whitespace-pre-wrap break-all text-neutral-100",children:J.prompt}),J.output&&o.jsxs("div",{children:[o.jsx("p",{className:"text-[9px] uppercase tracking-wide text-neutral-600",children:"output"}),o.jsx("pre",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap break-all text-neutral-500",children:J.output})]}),J.error&&o.jsx("p",{className:"whitespace-pre-wrap break-all text-red-400/80",children:J.error})]})}return T.kind==="rule"?X("rule",T.ruleName??T.ruleId??"—"):T.kind==="handler"?X("handler",T.handlerType??"—"):null};return o.jsx(GR.Provider,{value:H,children:o.jsxs("div",{className:de("space-y-2",i&&"h-full"),children:[!i&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("label",{className:"text-[11px] text-neutral-500",children:d("hooks.mindmap.pickSession")}),o.jsx("select",{value:t,onChange:T=>r==null?void 0:r(T.target.value),className:"rounded-md border border-edge/[0.08] bg-neutral-900 px-2 py-1 text-xs text-neutral-200",children:(n??[]).map(T=>o.jsx("option",{value:T.sessionId,children:Sn(T.title,T.sessionId)},T.sessionId))}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:p===null?d("hooks.loading"):d("catbar.items",{n:G.length})}),o.jsx("span",{className:"ml-auto text-[11px] text-neutral-600",children:d("hooks.mindmap.hint")})]}),o.jsxs("div",{className:de("relative rounded-lg",f,i?"h-full border-0":"h-96 border border-edge/[0.06]"),onClick:()=>j(null),children:[p===null&&!a?o.jsx("div",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:d("hooks.loading")}):R.length===0?o.jsx("div",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:d("hooks.mindmap.empty")}):o.jsxs(gk,{onInit:T=>{C.current=T},nodes:R,edges:_,nodeTypes:See,edgeTypes:_ee,fitView:!i,fitViewOptions:{maxZoom:1,padding:.12},...i?{defaultViewport:{x:24,y:12,zoom:.75}}:{},minZoom:.15,maxZoom:1.5,nodesDraggable:!0,nodesConnectable:!1,deleteKeyCode:null,defaultEdgeOptions:{type:"smoothstep",markerEnd:{type:mc.ArrowClosed,width:16,height:16},style:{stroke:"rgba(96,165,250,0.8)",strokeWidth:2}},children:[o.jsx(yk,{}),o.jsx(bk,{showInteractive:!1})]}),M&&o.jsxs("div",{className:"absolute right-2 top-2 z-20 flex max-h-[78%] w-80 flex-col overflow-hidden rounded-lg border border-edge/[0.14] bg-neutral-900/95 shadow-mac",onClick:T=>T.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center gap-2 border-b border-edge/[0.08] px-3 py-2",children:[o.jsx("span",{className:"text-xs font-semibold text-neutral-200",children:d("hooks.mindmap.detailTitle")}),o.jsx("button",{type:"button",onClick:()=>j(null),title:d("hooks.mindmap.closeDetail"),"aria-label":d("hooks.mindmap.closeDetail"),className:"ml-auto rounded p-0.5 text-neutral-500 transition-colors hover:text-neutral-100",children:o.jsx(Vt,{className:"h-3.5 w-3.5"})})]}),o.jsx("div",{className:"space-y-2 overflow-y-auto px-3 py-2 text-[11px]",children:K(M)})]})]})]})})}const Tee=300;function Xk({onClick:e,title:t,className:n}){const[s,r]=b.useState(!1);return o.jsx("button",{type:"button",title:t,"aria-label":t,disabled:s,onClick:()=>{const i=e();i instanceof Promise&&(r(!0),Promise.all([i.then(()=>{},()=>{}),new Promise(a=>setTimeout(a,Tee))]).then(()=>r(!1)))},className:de("pointer-events-auto inline-flex items-center text-neutral-500 transition-colors hover:text-neutral-200","disabled:pointer-events-none [&_svg]:pointer-events-none",n),children:o.jsx(uc,{className:de("h-3.5 w-3.5",s&&"animate-spin")})})}function my({onResize:e,orientation:t="horizontal",className:n,title:s}){const r=t==="vertical",i=b.useRef(null),a=b.useRef(0),l=b.useCallback(d=>{i.current=r?d.clientY:d.clientX,a.current=0,d.currentTarget.setPointerCapture(d.pointerId)},[r]),c=b.useCallback(d=>{if(i.current==null)return;const h=(r?d.clientY:d.clientX)-i.current;e(h-a.current),a.current=h},[e,r]),u=b.useCallback(()=>{i.current=null},[]);return o.jsx("div",{role:"separator","aria-orientation":r?"horizontal":"vertical",title:s,onPointerDown:l,onPointerMove:c,onPointerUp:u,onPointerCancel:u,className:de("shrink-0 touch-none bg-transparent transition-colors","hover:bg-blue-500/40 active:bg-blue-500/60",r?"h-1.5 w-full cursor-row-resize":"w-1.5 cursor-col-resize",n)})}const Aee=8e3,Mee=10*6e4;let o_=0;function jee(e){const t="=".repeat((4-e.length%4)%4),n=atob((e+t).replace(/-/g,"+").replace(/_/g,"/")),s=new Uint8Array(n.length);for(let r=0;r<n.length;r++)s[r]=n.charCodeAt(r);return s}function Ree(e){if(e==null)return null;const t=new Uint8Array(e);let n="";for(const s of t)n+=String.fromCharCode(s);return btoa(n)}async function Qk(){if(typeof navigator>"u"||!("serviceWorker"in navigator)||globalThis.isSecureContext===!1)return null;try{const e=await navigator.serviceWorker.getRegistration()??await navigator.serviceWorker.register("/sw.js");return e.pushManager?e:null}catch{return null}}function qR(e){return Promise.race([e,new Promise(t=>setTimeout(()=>t(null),Aee))])}async function YR(e){if(!(e!=null&&e.force)&&Date.now()<o_)return"unavailable";try{const t=await qR(Oee());return t===null?(o_=Date.now()+Mee,"unavailable"):t}catch{return"failed"}}async function Oee(){var i,a;const e=await Qk();if(!e||typeof Notification>"u"||Notification.permission!=="granted")return"unavailable";const{publicKey:t}=await Ce.pushPublicKey(),n=await e.pushManager.getSubscription();let s=n;n&&Ree(n.options.applicationServerKey)!==t&&(await n.unsubscribe(),s=null),s??(s=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:jee(t)}));const r=s.toJSON();return!r.endpoint||!((i=r.keys)!=null&&i.p256dh)||!((a=r.keys)!=null&&a.auth)?"failed":(await Ce.pushSubscribe({endpoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}}),"ok")}async function Dee(){try{const e=await Qk();if(!e)return;const t=await e.pushManager.getSubscription();if(!t)return;await Ce.pushUnsubscribe(t.endpoint),await qR(t.unsubscribe())}catch{}}async function lh(){if(globalThis.isSecureContext===!1)return"insecure";if(typeof navigator>"u"||!("serviceWorker"in navigator))return"unsupported";try{const e=await Qk();return e?await e.pushManager.getSubscription()?"on":"off":"unsupported"}catch{return"unsupported"}}function VR(e){const t=new Map;return{wait(n,s){return s()?Promise.resolve():new Promise(r=>{const i=setTimeout(()=>{t.delete(n),r()},e);t.set(n,{hit:s,release:()=>{clearTimeout(i),r()}})})},poke(){for(const[n,s]of t)s.hit()&&(t.delete(n),s.release())},releaseAll(){for(const n of t.values())n.release();t.clear()}}}const c_=200,u_=420,Iee={denied:"tasks.notifyDenied",unsupported:"tasks.notifyUnsupported",insecure:"tasks.notifyInsecure"},Lee=3e4;function Pee({projectId:e,initialSessionId:t,onSelectSession:n,projectLabel:s,harnesses:r}){var Cr;const i=We(),{show:a}=tn(),l=dn(),{sessions:c,dispatches:u,statuses:d,inflight:f,questions:h,refresh:p}=Wd(),m=Si("(min-width: 1024px)"),[k,w]=b.useState(()=>{const W=Number(localStorage.getItem("weave:tasks-list"));return Number.isFinite(W)&&W>0?Math.min(u_,Math.max(c_,W)):288});b.useEffect(()=>localStorage.setItem("weave:tasks-list",String(k)),[k]);const[g,y]=b.useState(!1),[x,S]=b.useState(!1),[A,E]=b.useState([]),[M,j]=b.useState([]),[O,N]=b.useState(null),F=b.useRef({project:e,sessionId:t??null}),[G,H]=b.useState(null),[I,L]=b.useState(null),[C,D]=b.useState(""),[U,B]=b.useState(null),[R,_]=b.useState(10),[K,T]=b.useState(""),[X,ne]=b.useState(null),[J,pe]=b.useState(!1),[q,Y]=b.useState(!1),V=b.useRef(null),ee=b.useMemo(()=>c===null?null:c.filter(W=>W.projectId===e),[c,e]),oe=b.useRef(ee);oe.current=ee;const ye=b.useRef(VR(Lee));b.useEffect(()=>{ye.current.poke()},[ee]),b.useEffect(()=>()=>ye.current.releaseAll(),[]);const Re=b.useCallback(W=>ye.current.wait(`alive:${W}`,()=>{var z;return((z=oe.current)==null?void 0:z.some(le=>le.sessionId===W&&le.pidAlive))===!0}),[]),se=b.useCallback(W=>ye.current.wait(`closed:${W}`,()=>{var z;return((z=oe.current)==null?void 0:z.some(le=>le.sessionId===W&&!le.pidAlive))===!0}),[]),Q=b.useCallback(W=>ye.current.wait(`new:${e}`,()=>{var z;return((z=oe.current)==null?void 0:z.some(le=>!W.has(le.sessionId)))===!0}),[e]),Te=b.useCallback(async W=>{Y(!0);try{const z=await Ce.listSessionHooks(e,W);j(le=>{var Se;if(le.length===0)return z;const Ee=((Se=z[0])==null?void 0:Se.id)??Number.POSITIVE_INFINITY;return[...le.filter(ze=>ze.id<Ee),...z]}),pe(le=>le||z.length<300)}catch(z){H(z instanceof Error?z.message:String(z))}finally{Y(!1)}},[e]);b.useEffect(()=>{const W=t??null,z=F.current;z.project===e&&z.sessionId===W||(F.current={project:e,sessionId:W},N(W),W&&(ne(W),window.setTimeout(()=>ne(le=>le===W?null:le),3e3)))},[e,t]),b.useEffect(()=>{Ce.listHooksRules(e).then(E).catch(()=>{})},[e]);const[xe,ve]=b.useState(null),ge=b.useCallback(()=>{Ce.messagingCapabilities().then(ve).catch(()=>{})},[]);b.useEffect(()=>{ge()},[ge]),b.useEffect(()=>$r("settings",ge),[ge]);const $e=b.useMemo(()=>{const W=new Map;for(const z of xe??[])W.set(z.harness,z);return W},[xe]),[dt,mt]=b.useState(null),rt=b.useCallback(()=>{Ce.listSessionWatches().then(mt).catch(()=>{})},[]);b.useEffect(()=>{rt()},[rt]);const ct=b.useMemo(()=>{const W=new Map;for(const z of dt??[])z.watcherSessionId===null&&W.set(z.targetSessionId,z);return W},[dt]),te=b.useCallback(W=>ct.get(W),[ct]),re=b.useCallback(W=>l.stateOf(`watch:${W}`),[l]),Ae=b.useCallback(W=>f.get(W)??0,[f]),v=b.useCallback(W=>h.get(W),[h]),Z=b.useCallback((W,z)=>{l.run(`answer:${W}`,async()=>{await Ce.answerQuestion(W,z),await p()},{fail:le=>i("tasks.answerFailed",{error:qe(le)})})},[l,i,p]),fe=b.useCallback(W=>l.stateOf(`answer:${W}`),[l]),be=b.useCallback(W=>{l.run(`interrupt:${W}`,async()=>{await Ce.interruptSession(W),a("success",i("tasks.stopOk"))},{fail:z=>i("tasks.stopFail",{error:qe(z)})})},[l,i,a]),he=b.useCallback(W=>l.stateOf(`interrupt:${W}`),[l]),P=b.useCallback((W,z,le)=>{l.run(`watch:${W}`,async()=>{const Ee=await jM();Ee!=="granted"&&a("info",i(Iee[Ee])),await YR(),await Ce.createSessionWatch(W,{on:z,times:le}),rt()},{fail:Ee=>i("tasks.watchFailed",{error:qe(Ee)})})},[l,i,a,rt]),ce=b.useCallback(W=>{const z=ct.get(W);z&&l.run(`watch:${W}`,async()=>{await Ce.deleteSessionWatch(W,z.id),rt()},{fail:le=>i("tasks.unwatchFailed",{error:qe(le)})})},[l,i,ct,rt]);b.useEffect(()=>Ai(()=>rt(),["watch.fired"]),[rt]),b.useEffect(()=>{var W;U&&!((W=v(U))!=null&&W.questions.length)&&B(null)},[U,v]),b.useEffect(()=>{N(W=>{var z;return W??((z=ee==null?void 0:ee[0])==null?void 0:z.sessionId)??null})},[ee]),b.useEffect(()=>{j([]),pe(!1),D(""),_(10),T(""),O&&Te(O)},[O,Te]),b.useEffect(()=>{let W=null;const le=Ai(Ee=>{!O||Ee.sessionId!==O||(W!==null&&window.clearTimeout(W),W=window.setTimeout(()=>{W=null,Te(O)},500))});return()=>{le(),W!==null&&window.clearTimeout(W)}},[Te,O]);const ue=b.useMemo(()=>{const W=new Map;for(const z of u){if(!z.sessionId)continue;const le=W.get(z.sessionId)??[];le.push(z),W.set(z.sessionId,le)}return W},[u]),_e=((Cr=ee==null?void 0:ee.find(W=>W.sessionId===O))==null?void 0:Cr.harness)??null,ke=Qd[_e??en[0]??"claude"],we=b.useMemo(()=>O?HR(M,ue.get(O)??[],ke).filter(W=>W.id!==Vk).filter(W=>!(W.preSession&&!J)):[],[O,M,ue,J,ke]),Ne=b.useMemo(()=>C&&we.some(W=>W.id===C)?C:null,[we,C]),Oe=K.trim().toLowerCase(),Me=b.useMemo(()=>Oe?we.filter(W=>{var z;return(W.prompt??(W.preSession?"":((z=W.events[0])==null?void 0:z.eventType)??"")).toLowerCase().includes(Oe)}):null,[we,Oe]),Fe=async(W,z)=>{try{const le=await Ce.renameSession(W,z);if(le.pendingTitle!==z&&le.title!==z){H(i("tasks.renameVerifyFail"));return}await p()}catch(le){H(le instanceof Error?le.message:String(le))}},De=b.useCallback((W,z)=>{l.run(`openTerm:${W}`,async()=>{await Ce.openSessionTerminal(W,z),await p(),await Re(W)},{fail:le=>i("errors.openFailed",{error:qe(le)})})},[l,i,p,Re]),He=b.useCallback(W=>{l.run(`newSession:${e}`,async()=>{const z=new Set((oe.current??[]).map(le=>le.sessionId));await Ce.startProjectSession(e,W),await Q(z)},{fail:z=>i("tasks.newSessionFailed",{error:qe(z)})})},[l,e,i,Q]),Ge=b.useMemo(()=>r.filter(W=>W.canStartSession).map(W=>W.id),[r]),[ft,St]=b.useState(!1),Nt=Ge.length>0,_t=l.stateOf(`newSession:${e}`)==="loading",jt=b.useCallback(()=>{if(Ge.length>1){St(!0);return}He(Ge[0])},[Ge,He]),[Rt,Wt]=b.useState(null),ie=b.useCallback(W=>{var le;const z=((le=ee==null?void 0:ee.find(Ee=>Ee.sessionId===W))==null?void 0:le.projectId)??null;if(z==null){De(W);return}Ce.listProjectTerminals(z).then(Ee=>{Ee.filter(Se=>!Se.full).length>1?Wt({sessionId:W,targets:Ee}):De(W)}).catch(()=>De(W))},[ee,De]),Pe=b.useCallback(W=>l.stateOf(`openTerm:${W}`),[l]),[Ie,Je]=b.useState(null),Ze=b.useCallback(W=>{const z=ee==null?void 0:ee.find(Ee=>Ee.sessionId===W),le=z?Sn(z.title,z.sessionId):W.slice(0,8);Je({sessionId:W,label:le})},[ee]),Cn=b.useCallback(W=>{l.run(`closePane:${W}`,async()=>{await Ce.closeSessionPane(W),await p(),await se(W),a("success",i("toast.sessionPaneClosed"))},{fail:z=>i("tasks.closePaneFailed",{error:qe(z)})})},[l,i,p,se]),Ht=b.useCallback(W=>l.stateOf(`closePane:${W}`),[l]),[Vr,kr]=b.useState(new Map),ks=b.useCallback(W=>{var Ee;const z=(Ee=oe.current)==null?void 0:Ee.find(Se=>Se.sessionId===W),le=z!=null&&z.harness?$e.get(z.harness):void 0;le&&kr(Se=>{if(Se.has(W))return Se;const ze=new Map(Se);return ze.set(W,{sessionId:W,projectId:(z==null?void 0:z.projectId)??e,label:Sn((z==null?void 0:z.title)??null,W),capability:le}),ze})},[$e,e]);b.useEffect(()=>{O&&ks(O)},[O,ks]);const Ii=b.useCallback(W=>{N(W),F.current={project:e,sessionId:W},n==null||n(W),ks(W),m||y(!0)},[ks,m,n,e]),Xn=O!==null&&Vr.has(O);b.useEffect(()=>{UE(!m&&g&&Xn)},[m,g,Xn]),b.useEffect(()=>()=>UE(!1),[]),b.useEffect(()=>{Xn||S(!1)},[Xn]);const[Li,Xr]=b.useState({}),Qr=b.useMemo(()=>u.filter(W=>W.status==="pending"&&W.sessionId===null&&A.some(z=>z.id===W.ruleId)),[u,A]),Wr=b.useCallback((W,z)=>{l.run(`dispatch:${W}`,async()=>{await Ce.runHookDispatch(W,z),await p()},{fail:le=>i("tasks.dispatchRunFailed",{error:qe(le)})})},[l,p,i]),Zr=Me?Me.slice().reverse():we.slice(-R).reverse(),Qn=we.length-Zr.length,wr=!J&&M.length>0,ws=Qn>0||wr,Pi=W=>!!W&&W.scrollHeight-W.scrollTop-W.clientHeight<=1,Sr=async()=>{var W;if(Qn>0){_(z=>z+10);return}if(!(!wr||!O))try{const z=await Ce.listSessionHooks(e,O,300,(W=M[0])==null?void 0:W.id);if(z.length===0){pe(!0);return}const le=new Set(M.map(Se=>Se.id));if(z.filter(Se=>!le.has(Se.id)).length===0){pe(!0);return}z.length<300&&pe(!0),j(Se=>{const ze=new Set(Se.map(st=>st.id));return[...z.filter(st=>!ze.has(st.id)),...Se]}),_(Se=>Se+10)}catch(z){H(z instanceof Error?z.message:String(z))}},Tn=Kk({axis:"bottom",getEdge:()=>Pi(V.current),onFire:()=>void Sr(),enabled:ws});b.useEffect(()=>{!O||J||M.length===0||we.length>=10||Sr()},[O,we.length,J,M.length]),b.useEffect(()=>{if(!Oe||!O||J||M.length===0)return;if(we.length>R){_(we.length);return}const W=window.setTimeout(()=>{Sr()},250);return()=>window.clearTimeout(W)},[Oe,O,J,M.length,we.length,R]);const Jr=(W,z)=>{const le=(ee??[]).find(Ee=>Ee.sessionId===z);L({dispatchId:W,sessionId:z,sessionLabel:Sn((le==null?void 0:le.title)??null,z)})},[Nr,An]=b.useState(null),za=W=>{W.prompt&&lf(W.prompt).then(z=>{if(!z){a("error",i("common.copyFailed"));return}An(W.id),window.setTimeout(()=>An(null),1500)})},Ua=()=>{if(!I)return;const{dispatchId:W,sessionId:z}=I;L(null),l.run(`dispatch:${W}`,async()=>{await Ce.runHookDispatch(W,z),await p()},{fail:le=>i("tasks.dispatchRunFailed",{error:qe(le)})})},[Ls,tr]=b.useState(null),ei=b.useCallback(W=>{const z=ee==null?void 0:ee.find(Ee=>Ee.sessionId===W),le=z?Sn(z.title,z.sessionId):W.slice(0,8);tr({sessionId:W,label:le})},[ee]),Fa=()=>{if(!Ls)return;const{sessionId:W}=Ls;tr(null),l.run(`del:${W}`,async()=>{const z=await Ce.deleteSession(W);O===W&&(N(null),F.current={project:e,sessionId:null},n==null||n(null)),await p(),a("success",i("toast.sessionDeleted",{n:z.events}))},{fail:z=>i("tasks.deleteFailed",{error:qe(z)})})},Ba=b.useCallback(W=>l.stateOf(`del:${W}`),[l]),Hn=d.get(O??"")??"open",an=ee==null?void 0:ee.find(W=>W.sessionId===O),Dn=iU(Hn,rU(an==null?void 0:an.harness)?an==null?void 0:an.turnOpen:void 0),Er=o.jsxs("section",{className:"flex min-w-0 min-h-0 flex-1 flex-col",children:[o.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[o.jsx(nM,{className:"h-3.5 w-3.5 shrink-0 text-rose-400"}),o.jsx("h3",{className:"shrink-0 text-sm font-semibold text-neutral-200",children:i("tasks.chainTitle")}),o.jsxs("div",{className:"relative w-36 shrink-0 lg:w-44",children:[o.jsx(U6,{className:"pointer-events-none absolute left-1.5 top-1/2 h-3 w-3 -translate-y-1/2 text-neutral-600"}),o.jsx("input",{value:K,onChange:W=>T(W.target.value),placeholder:i("tasks.searchPlaceholder"),className:"h-6 w-full rounded border border-edge/[0.08] bg-neutral-900 pl-6 pr-5 text-[11px] text-neutral-200 placeholder:text-neutral-600 focus:border-edge/20 focus:outline-none"}),K&&o.jsx("button",{type:"button",onClick:()=>T(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-0.5 text-neutral-600 transition-colors hover:text-neutral-200",children:o.jsx(Vt,{className:"h-3 w-3"})})]}),Me&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:i("tasks.searchMatches",{n:Me.length})}),o.jsx("span",{className:"ml-auto text-[10px] text-neutral-600",children:i("tasks.legendNote")})]}),Qr.length>0&&o.jsxs("div",{className:"mb-2 shrink-0 rounded-lg border border-amber-500/20 bg-amber-500/[0.04] px-2 py-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-[11px] font-medium text-amber-300",children:i("tasks.dispatchQueue",{n:Qr.length})}),o.jsx("span",{className:"text-[10px] text-amber-200/50",children:i("tasks.dispatchHint")})]}),o.jsx("ul",{className:"mt-1 space-y-1",children:Qr.map(W=>{var le;const z=Li[W.id]??((le=ee==null?void 0:ee[0])==null?void 0:le.sessionId)??"";return o.jsxs("li",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-neutral-300",title:W.prompt,children:W.prompt}),o.jsx("select",{value:z,onChange:Ee=>Xr(Se=>({...Se,[W.id]:Ee.target.value})),className:"shrink-0 rounded border border-edge/[0.08] bg-neutral-900 px-1.5 py-0.5 text-[11px] text-neutral-200",children:(ee??[]).map(Ee=>o.jsx("option",{value:Ee.sessionId,children:Sn(Ee.title,Ee.sessionId)},Ee.sessionId))}),o.jsxs("button",{type:"button",disabled:!z||l.stateOf(`dispatch:${W.id}`)==="loading",onClick:()=>Wr(W.id,z),className:"inline-flex shrink-0 items-center gap-1 rounded bg-emerald-700/80 px-2 py-0.5 text-[11px] font-medium text-white transition-colors hover:bg-emerald-600 disabled:opacity-40",children:[o.jsx(lt,{state:l.stateOf(`dispatch:${W.id}`),className:"h-3 w-3"}),i("tasks.dispatchRun")]})]},W.id)})})]}),O?q&&M.length===0?o.jsxs("p",{className:"flex min-h-0 flex-1 items-center justify-center gap-1.5 text-xs text-neutral-600",children:[o.jsx(gn,{className:"h-3.5 w-3.5 animate-spin"}),i("hooks.loading")]}):M.length===0?o.jsx("p",{className:"flex min-h-0 flex-1 items-center justify-center text-xs text-neutral-600",children:i("tasks.chainEmpty")}):we.length===0?o.jsxs("p",{className:"flex min-h-0 flex-1 items-center justify-center gap-1.5 text-xs text-neutral-600",children:[o.jsx(gn,{className:"h-3.5 w-3.5 animate-spin"}),i("tasks.chainCatchUp")]}):Me&&Me.length===0?o.jsx("p",{className:"flex min-h-0 flex-1 items-center justify-center gap-1.5 text-xs text-neutral-600",children:J?i("tasks.searchNoMatch"):o.jsxs(o.Fragment,{children:[o.jsx(gn,{className:"h-3.5 w-3.5 animate-spin"}),i("tasks.chainCatchUp")]})}):o.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[o.jsx("div",{ref:V,className:"flex min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain pr-1",onScroll:Tn.syncEdge,onWheel:W=>Tn.wheel(W.deltaY,W.deltaMode),onTouchStart:W=>{var z;return Tn.touchStart(((z=W.touches[0])==null?void 0:z.clientY)??0)},onTouchMove:W=>{var z;return Tn.touchMove(((z=W.touches[0])==null?void 0:z.clientY)??0)},onTouchEnd:Tn.touchEnd,onTouchCancel:Tn.touchEnd,children:o.jsx("div",{className:"flex shrink-0 flex-col gap-1",style:Tn.px>0?{transform:`translateY(-${Tn.px}px)`}:void 0,children:Zr.map(W=>{var st,Wn;const z=W.prompt??(W.preSession?null:((st=W.events[0])==null?void 0:st.eventType)??W.id),le=W.events[W.events.length-1],Ee=(le==null?void 0:le.createdAt)??((Wn=W.dispatches[0])==null?void 0:Wn.startedAt),Se=Ne===W.id,ze=we.length>0&&W.id===we[we.length-1].id;return o.jsxs("div",{className:"shrink-0 rounded-lg border border-edge/[0.06] bg-edge/[0.015]",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>D(Se?"":W.id),onKeyDown:yn=>{(yn.key==="Enter"||yn.key===" ")&&(yn.preventDefault(),D(Se?"":W.id))},className:"flex w-full flex-wrap cursor-pointer items-center gap-2 px-2 py-1.5 text-left hover:bg-edge/[0.03]",children:[Se?o.jsx(_n,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Yn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-200",title:z??void 0,children:z??""}),W.preSession&&o.jsx(Qe,{className:"shrink-0 bg-sky-900/40 text-sky-300",children:i("tasks.groupPreSession")}),W.open&&(ze&&Io(Hn)?o.jsx(Qe,{className:"shrink-0 bg-emerald-900/40 text-emerald-300",children:i("tasks.groupRunning")}):o.jsx(Qe,{className:"shrink-0 bg-amber-900/40 text-amber-300",children:i("tasks.groupOpen")})),ze&&v(O)&&o.jsx("button",{type:"button",title:i("tasks.answerActiveTooltip",{n:v(O).questions.filter(yn=>!yn.submit).length}),onClick:yn=>{yn.stopPropagation(),B(O)},className:"shrink-0 rounded bg-amber-900/50 px-1 py-px text-[10px] font-medium leading-tight text-amber-300 transition-colors hover:bg-amber-900/70 hover:text-amber-200",children:i("tasks.answerPendingTag")}),W.questions>0&&o.jsx(Qe,{className:"shrink-0 bg-teal-900/40 text-teal-300",children:i("tasks.groupQuestions",{n:W.questions})}),W.subagentStops>0&&o.jsx(Qe,{className:"shrink-0 bg-purple-900/40 text-purple-300",children:i("tasks.groupSubagent",{n:W.subagentStops})}),W.agentsDispatched>0&&o.jsx(Qe,{className:"shrink-0 bg-fuchsia-900/40 text-fuchsia-300",children:i("tasks.groupAgents",{n:W.agentsDispatched})}),Ee&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:lr(Ee)}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:i("tasks.events",{n:W.events.length})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:i("tasks.groupDispatches",{n:W.dispatches.length})}),W.prompt&&o.jsx("button",{type:"button",title:Nr===W.id?i("tasks.copied"):i("tasks.copyPrompt"),onClick:yn=>{yn.stopPropagation(),za(W)},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-edge/[0.08] bg-edge/[0.02] text-neutral-500 transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08] hover:text-neutral-200",children:Nr===W.id?o.jsx(mr,{className:"h-3 w-3 text-emerald-400"}):o.jsx(Ta,{className:"h-3 w-3"})}),ze&&W.open&&Io(Hn)&&o.jsx("span",{className:"shrink-0",children:o.jsx(Rl,{harness:_e,running:!0})}),ze&&Dn&&o.jsx("button",{type:"button",title:i("tasks.stopTooltip"),onClick:yn=>{yn.stopPropagation(),be(O)},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-edge/[0.08] bg-edge/[0.02] text-neutral-500 transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08] hover:text-red-300",children:o.jsx(lt,{state:l.stateOf(`interrupt:${O}`),className:"h-3 w-3",icon:o.jsx(xM,{className:"h-3 w-3"})})})]}),Se&&o.jsx("div",{className:"h-[52dvh] min-h-[280px] lg:h-[calc(100dvh-330px)] lg:min-h-[420px] max-h-[760px] shrink-0 border-t border-edge/[0.06] p-1.5",children:o.jsxs("div",{className:"relative h-full rounded-md border border-edge/[0.04] bg-neutral-950/40",children:[o.jsx(Cee,{projectId:e,sessionId:O,harness:_e,focusGroupId:W.id,focusGroup:W,running:ze&&Io(Hn),answerable:ze&&!!v(O),onOpenAnswer:()=>B(O)},`${O}:${W.id}`),o.jsx("p",{className:"pointer-events-none absolute bottom-1 left-2 text-[10px] text-neutral-600",children:i("tasks.legendNote")})]})})]},W.id)})})}),ws&&o.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-neutral-950/95 via-neutral-950/70 to-transparent px-1 pb-1 pt-6 text-center",children:[o.jsx("p",{className:"text-[10px] text-neutral-500",children:Tn.px>0?i("tasks.pullMoreEvents"):i("tasks.olderHint")}),o.jsxs("span",{className:"pointer-events-auto mt-1 inline-flex gap-2",children:[o.jsx("button",{type:"button",onClick:()=>void Sr(),className:"rounded-md border border-edge/[0.1] bg-neutral-900/90 px-2 py-0.5 text-[11px] text-neutral-200 transition-colors hover:bg-neutral-800",children:Qn>0?i("tasks.loadOlder",{n:Math.min(10,Qn)}):i("tasks.loadOlderEvents")}),o.jsx("button",{type:"button",onClick:()=>_(W=>W+we.length),className:"rounded-md border border-edge/[0.1] bg-neutral-900/90 px-2 py-0.5 text-[11px] text-neutral-400 transition-colors hover:bg-neutral-800 hover:text-neutral-200",children:i("tasks.loadAll")})]})]})]}):o.jsx("p",{className:"flex min-h-0 flex-1 items-center justify-center text-xs text-neutral-600",children:i("tasks.selectHint")})]}),_r=o.jsxs("div",{className:"flex min-w-0 min-h-0 flex-1 flex-col",children:[[...Vr.values()].map(W=>o.jsx(BR,{embedded:!0,sessionId:W.sessionId,projectId:W.projectId,label:W.label,projectLabel:s,capability:W.capability,minimized:W.sessionId!==O,answerPending:!!v(W.sessionId),onOpenAnswer:()=>B(W.sessionId),onInterrupt:be,interruptStateOf:he,onOpenChain:()=>S(!0)},W.sessionId)),!Xn&&Er]});return o.jsxs("div",{className:"flex flex-col lg:flex-row h-full min-h-0 gap-3 lg:gap-0",children:[o.jsxs("aside",{style:m?{width:k}:void 0,className:"flex w-full max-lg:min-h-0 max-lg:flex-1 lg:shrink-0 flex-col gap-2 overflow-y-auto border-r-0 lg:border-r border-edge/[0.06] pr-0 lg:pr-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold text-neutral-200",children:i("tasks.listTitle")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:ee===null?i("hooks.loading"):String(ee.length)}),o.jsxs("button",{type:"button",disabled:!Nt||_t,title:_t?i("tasks.newSessionStarting"):Ge.length===0?i("tasks.newSessionNoHarness"):i("tasks.newSessionTip"),onClick:jt,className:de("inline-flex items-center gap-1 rounded-md border border-edge/[0.1] bg-neutral-900/90 px-2 py-0.5 text-[11px] transition-colors",Nt?"text-neutral-200 hover:bg-neutral-800":"cursor-not-allowed text-neutral-600",_t&&"cursor-progress opacity-70 hover:bg-neutral-900/90"),children:[o.jsx(lt,{state:l.stateOf(`newSession:${e}`),className:"h-3 w-3",icon:o.jsx(Vd,{className:"h-3 w-3"})}),i("tasks.newSession")]}),o.jsx(Xk,{className:"ml-auto",title:i("tasks.refresh"),onClick:async()=>{const W=await p();a(W?"error":"success",W??i("tasks.refreshed"))}})]}),G&&o.jsx("p",{className:"rounded border border-red-500/30 bg-red-950/30 px-2 py-1 text-[11px] text-red-300",children:G}),ee===null?o.jsx(jm,{rows:8,className:"p-0"}):ee.length===0?o.jsx("p",{className:"text-xs text-neutral-600",children:i("tasks.emptySessions")}):o.jsx(eq,{sessions:ee,statuses:d,selectedId:O,highlightId:X,onSelect:Ii,onRename:(W,z)=>void Fe(W,z),onDropDispatch:Jr,onOpenTerminal:ie,openTerminalStateOf:Pe,onClosePane:Ze,closePaneStateOf:Ht,capabilities:xe===null?null:$e,inflightOf:Ae,questionOf:v,onAnswer:Z,answerStateOf:fe,answerFor:U,onSetAnswerFor:B,watchOf:te,watchStateOf:re,onSubscribeWatch:P,onUnwatch:ce,onDelete:ei,deleteStateOf:Ba})]}),m&&o.jsxs(o.Fragment,{children:[o.jsx(my,{onResize:W=>w(z=>Math.min(u_,Math.max(c_,z+W))),title:i("tasks.resizeList")}),_r]}),!m&&O&&o.jsx("div",{className:g?"fixed inset-0 z-40":"hidden",children:o.jsxs("div",{className:"absolute inset-0 flex flex-col bg-neutral-950 drawer-right",children:[o.jsxs("div",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx("span",{className:"truncate text-sm font-semibold text-neutral-200",children:Sn((an==null?void 0:an.title)??null,O)}),(an==null?void 0:an.harness)&&o.jsx("span",{className:"shrink-0",children:o.jsx(Rl,{harness:an.harness})}),o.jsx("button",{onClick:()=>y(!1),className:"ml-auto rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:i("app.mobileDrawerClose"),children:o.jsx(Vt,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col p-3",children:_r})]})}),I&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:o.jsxs("div",{className:"w-80 rounded-lg border border-edge/[0.1] bg-neutral-900 p-4 shadow-xl",children:[o.jsx("p",{className:"text-sm text-neutral-200",children:i("hooks.runConfirm",{id:I.dispatchId,session:I.sessionLabel})}),o.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[o.jsx("button",{type:"button",onClick:()=>L(null),className:"rounded-md px-3 py-1.5 text-xs text-neutral-400 hover:bg-edge/[0.06]",children:i("hooks.cancel")}),o.jsx("button",{type:"button",onClick:Ua,className:"rounded-md bg-blue-600/80 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-500",children:i("hooks.runConfirmYes")})]})]})}),o.jsx(Mi,{open:Ls!==null,title:i("tasks.deleteSession"),message:Ls?i("tasks.deleteConfirm",{id:Ls.label}):"",confirmLabel:i("common.confirm"),onConfirm:Fa,onClose:()=>tr(null)}),o.jsx(Mi,{open:Ie!==null,title:i("tasks.closePaneTitle"),message:Ie?i("tasks.closePaneConfirm",{id:Ie.label}):"",confirmLabel:i("common.confirm"),onConfirm:()=>{Ie&&Cn(Ie.sessionId)},onClose:()=>Je(null)}),Rt&&o.jsx(I9,{targets:Rt.targets,busy:l.stateOf(`openTerm:${Rt.sessionId}`)==="loading",onPick:W=>{const{sessionId:z}=Rt;Wt(null),De(z,W)},onClose:()=>Wt(null)}),ft&&o.jsx(pee,{harnesses:Ge,onPick:W=>{St(!1),He(W)},onClose:()=>St(!1)}),x&&Xn&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:()=>S(!1),children:o.jsxs("div",{className:"flex h-[86dvh] w-full max-w-6xl flex-col overflow-hidden rounded-xl border border-edge/[0.08] bg-neutral-950 p-3 shadow-mac",onClick:W=>W.stopPropagation(),children:[o.jsx("div",{className:"flex shrink-0 items-center justify-end",children:o.jsx("button",{type:"button",title:i("app.mobileDrawerClose"),"aria-label":i("app.mobileDrawerClose"),onClick:()=>S(!1),className:"rounded-lg p-1.5 text-neutral-500 transition-colors hover:bg-neutral-800/60 hover:text-neutral-200",children:o.jsx(Vt,{className:"h-4 w-4"})})}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:Er})]})})]})}const zee=["all","today","1d","3d","7d","30d","over30","custom"],Uee={all:"tasks.rangeAll",today:"tasks.rangeToday","1d":"tasks.range1d","3d":"tasks.range3d","7d":"tasks.range7d","30d":"tasks.range30d",over30:"tasks.rangeOver30",custom:"tasks.rangeCustom"};function Fee(e,t){const n=new Map(e.map(i=>[i.sessionId,i])),s=[];for(const i of t){const a=n.get(i);a&&s.push(a)}const r=new Set(s.map(i=>i.sessionId));return[...e.filter(i=>!r.has(i.sessionId)),...s]}function Bee({projects:e,onOpenSession:t}){const n=We(),{show:s}=tn(),{sessions:r,statuses:i,error:a,refresh:l}=Wd(),[c,u]=b.useState("all"),[d,f]=b.useState("all"),[h,p]=b.useState(""),[m,k]=b.useState(""),w=b.useMemo(()=>{const E=r??[],M=Date.now(),j=new Date;return j.setHours(0,0,0,0),E.filter(O=>{if(c!=="all"&&O.projectId!==c)return!1;const N=Date.parse(O.lastSeenAt);switch(d){case"today":return N>=j.getTime();case"1d":return N>=M-864e5;case"3d":return N>=M-3*864e5;case"7d":return N>=M-7*864e5;case"30d":return N>=M-30*864e5;case"over30":return N<M-30*864e5;case"custom":{if(h){const F=Date.parse(`${h}T00:00:00`);if(Number.isFinite(F)&&N<F)return!1}if(m){const F=Date.parse(`${m}T23:59:59.999`);if(Number.isFinite(F)&&N>F)return!1}return!0}default:return!0}})},[r,c,d,h,m]),g=`${c}|${d}|${h}|${m}`,y=b.useMemo(()=>w.slice().sort(b3).map(E=>E.sessionId),[w]),x=x3(y,g),S=b.useMemo(()=>{const E=new Map(e.map(M=>[M.id,M.name]));return Fee(w,x).map(M=>({session:M,projectName:M.projectId==null?n("tasks.overviewUnknownProject"):E.get(M.projectId)??n("tasks.overviewUnknownProject")}))},[w,x,e,n]),A=b.useRef(new Map);return y3(A),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(xl,{className:"h-3.5 w-3.5 text-sky-400"}),o.jsx("h3",{className:"text-sm font-semibold text-neutral-200",children:n("tasks.overviewTitle")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:r===null?n("hooks.loading"):w.length===((r==null?void 0:r.length)??0)?String(w.length):`${w.length} / ${(r==null?void 0:r.length)??0}`}),o.jsx(Xk,{className:"ml-auto",title:n("tasks.refresh"),onClick:async()=>{const E=await l();s(E?"error":"success",E??n("tasks.refreshed"))}})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 px-2",children:[o.jsxs("select",{value:c==="all"?"":String(c),onChange:E=>u(E.target.value===""?"all":Number(E.target.value)),className:"rounded-md border border-edge/[0.08] bg-neutral-900 px-2 py-1 text-xs text-neutral-200",children:[o.jsx("option",{value:"",children:n("tasks.overviewAllProjects")}),e.map(E=>o.jsx("option",{value:String(E.id),children:E.name},E.id))]}),o.jsx("span",{className:"flex overflow-hidden rounded-md border border-edge/[0.08]",children:zee.map(E=>o.jsx("button",{type:"button",onClick:()=>f(E),className:de("px-2 py-1 text-[11px] transition-colors",d===E?"bg-neutral-800 text-neutral-100":"text-neutral-500 hover:bg-neutral-800/50"),children:n(Uee[E])},E))}),d==="custom"&&o.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-neutral-500",children:[o.jsx("input",{type:"date",value:h,onChange:E=>p(E.target.value),"aria-label":n("tasks.rangeFrom"),className:"rounded-md border border-edge/[0.08] bg-neutral-900 px-1.5 py-0.5 text-[11px] text-neutral-200"}),"—",o.jsx("input",{type:"date",value:m,onChange:E=>k(E.target.value),"aria-label":n("tasks.rangeTo"),className:"rounded-md border border-edge/[0.08] bg-neutral-900 px-1.5 py-0.5 text-[11px] text-neutral-200"})]})]}),a&&o.jsx("p",{className:"rounded border border-red-500/30 bg-red-950/30 px-2 py-1 text-[11px] text-red-300",children:a}),r===null?o.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-neutral-600",children:[o.jsx(gn,{className:"h-3 w-3 animate-spin"}),n("hooks.loading")]}):S.length===0?o.jsx("p",{className:"text-xs text-neutral-600",children:n("tasks.overviewEmpty")}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-3 px-2 text-[10px] text-neutral-600",children:[o.jsx("span",{className:"w-32 max-lg:w-24 shrink-0",children:n("tasks.overviewProject")}),o.jsx("span",{className:"min-w-0 flex-1",children:n("tasks.overviewSession")}),o.jsx("span",{className:"w-20 max-lg:w-auto shrink-0",children:n("tasks.overviewStatus")}),o.jsx("span",{className:"w-16 shrink-0 text-right hidden lg:block",children:n("tasks.overviewEvents")}),o.jsx("span",{className:"w-16 shrink-0 text-right hidden lg:block",children:n("tasks.overviewTime")})]}),o.jsx("ul",{className:"space-y-1",children:S.map(({session:E,projectName:M})=>{const j=i.get(E.sessionId)??"open",O=E.projectId!=null;return o.jsx("li",{ref:N=>{N?A.current.set(E.sessionId,N):A.current.delete(E.sessionId)},children:o.jsxs("div",{role:O?"button":void 0,tabIndex:O?0:void 0,onClick:O?()=>t(E.projectId,E.sessionId):void 0,onKeyDown:O?N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),t(E.projectId,E.sessionId))}:void 0,title:O?Sn(E.title,E.sessionId):void 0,className:de("flex flex-wrap lg:flex-nowrap items-center gap-3 rounded-md border px-2 py-1.5",O?"cursor-pointer border-edge/[0.06] bg-edge/[0.015] hover:bg-edge/[0.04]":"border-edge/[0.04] opacity-60"),children:[o.jsx("span",{className:"w-32 max-lg:w-24 shrink-0 truncate rounded bg-neutral-800/80 px-1.5 py-0.5 text-[10px] text-neutral-300",title:M,children:M}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-200",children:Sn(E.title,E.sessionId)}),E.harness&&o.jsx(xr,{agent:E.harness,className:"shrink-0 px-1 text-[10px]"}),o.jsxs("span",{className:"flex w-20 max-lg:w-auto shrink-0 items-center gap-1.5",children:[o.jsx(kk,{status:j,harness:E.harness}),o.jsx("span",{className:de("text-[10px]",ej[j].split(" ")[1]),children:n(JM[j])})]}),o.jsx("span",{className:"hidden lg:block w-16 shrink-0 text-right text-[10px] text-neutral-500",children:n("tasks.events",{n:E.eventCount??0})}),o.jsx("span",{className:"hidden lg:block w-16 shrink-0 text-right text-[10px] text-neutral-500",children:qx(n,E.lastSeenAt,Date.now())}),o.jsxs("span",{className:"lg:hidden flex basis-full gap-3 text-[10px] text-neutral-500",children:[o.jsx("span",{children:n("tasks.events",{n:E.eventCount??0})}),o.jsx("span",{children:qx(n,E.lastSeenAt,Date.now())})]})]})},E.sessionId)})})]})]})}const Hee=92,d_=380,$ee=56;function f_(e){return e!=null&&en.includes(e)?en.indexOf(e):en.length}function Gee(e){const t=new Map;for(const l of e){const c=f_(l.harness),u=t.get(c)??{harness:l.harness??null,count:0};u.count+=1,t.set(c,u)}const n=[...t.keys()].sort((l,c)=>l-c),s=new Map(n.map((l,c)=>[l,c])),r=n.map((l,c)=>({harness:t.get(l).harness,x:c*d_,count:t.get(l).count})),i=r.map(()=>0),a=[];for(const l of e){const c=s.get(f_(l.harness))??0,u=i[c];i[c]=u+1;const d={key:`s:${l.sessionId}`,session:l,lane:c,row:u,x:c*d_,y:$ee+u*Hee};a.push(d)}return{nodes:a,lanes:r}}const Kee={running:"tasks.statusRunning",failed:"tasks.statusFailed",done:"orch.seqDone",cancelled:"orch.seqCancelled"},qee={running:"bg-orange-900/50 text-orange-300",failed:"bg-red-900/50 text-red-300",done:"bg-emerald-900/40 text-emerald-300",cancelled:"bg-neutral-800 text-neutral-400"},Yee={prompt:"tasks.msgModePrompt",auto:"tasks.msgModeAuto",inject:"tasks.msgModeInject",headless:"tasks.msgModeHeadless"},Vee={pending:"tasks.msgStatusQueued",delivering:"tasks.msgStatusDelivering",injected:"tasks.msgStatusInjected",delivered:"tasks.msgStatusDelivered",running:"tasks.msgStatusRunning",succeeded:"tasks.msgStatusSucceeded",failed:"tasks.msgStatusFailed",timeout:"tasks.msgStatusTimeout"};function Xee({data:e}){const t=We(),{session:n,status:s,capable:r,received:i,onOpenMessages:a}=e;return o.jsxs("div",{className:de("flex w-[260px] items-center gap-2 rounded-lg border border-edge/[0.08] bg-neutral-900/95 px-2 py-1.5 shadow-mac transition-colors",r?"cursor-pointer hover:border-blue-500/40":"cursor-default"),onClick:()=>r&&a(n.sessionId),title:r?t("tasks.messageTooltip"):n.sessionId,children:[o.jsx(Pn,{type:"target",id:"l",position:Xe.Left,style:{visibility:"hidden"}}),o.jsx(Pn,{type:"source",id:"r",position:Xe.Right,style:{visibility:"hidden"}}),o.jsx(kk,{status:s,harness:n.harness}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-xs font-medium text-neutral-100",children:Sn(n.title,n.sessionId)}),o.jsx("span",{className:"block truncate text-[10px] text-neutral-500",children:t("orch.received",{n:i})})]}),r&&o.jsx(fM,{className:"h-3 w-3 shrink-0 text-teal-400/70"})]})}function Qee({data:e}){const t=We(),{lane:n}=e;return o.jsxs("div",{className:"flex w-[260px] items-center gap-2 border-b border-dashed border-edge/[0.1] pb-1.5",children:[o.jsx(Rl,{harness:n.harness}),o.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-neutral-400",children:n.harness==null?t("orch.unknownLane"):Kn(n.harness).label}),o.jsx("span",{className:"text-[10px] text-neutral-600",children:t("catbar.items",{n:n.count})})]})}const Wee={seqSession:Xee,seqLane:Qee};function Zee({projectId:e,projectLabel:t}){const n=We(),s=xk(),r=dn(),{show:i}=tn(),{sessions:a,statuses:l}=Wd(),c=b.useMemo(()=>a===null?null:a.filter(Y=>Y.projectId===e),[a,e]),u=b.useMemo(()=>(c??[]).map(Y=>Y.sessionId).sort().join(","),[c]),d=b.useRef(null);d.current=c;const[f,h]=b.useState(null);b.useEffect(()=>{Ce.messagingCapabilities().then(h).catch(()=>{})},[]);const p=b.useMemo(()=>{const Y=new Map;for(const V of f??[])Y.set(V.harness,V);return Y},[f]),m=b.useCallback(Y=>{var ee;const V=(ee=d.current)==null?void 0:ee.find(oe=>oe.sessionId===Y);return(V==null?void 0:V.harness)!=null?p.get(V.harness):void 0},[p]),k=b.useCallback(Y=>{r.run(`interrupt:${Y}`,async()=>{await Ce.interruptSession(Y),i("success",n("tasks.stopOk"))},{fail:V=>n("tasks.stopFail",{error:qe(V)})})},[r,n,i]),w=b.useCallback(Y=>r.stateOf(`interrupt:${Y}`),[r]),[g,y]=b.useState(null),x=b.useCallback(async()=>{const Y=d.current;if(Y)try{const V=new Map;await Promise.all(Y.map(async ee=>{V.set(ee.sessionId,await Ce.listSessionMessages(ee.sessionId))})),y(V)}catch{}},[]);b.useEffect(()=>{y(null),x()},[x,u]);const[S,A]=b.useState(null),E=b.useCallback(()=>{Ce.listSessionSequences().then(A).catch(()=>{})},[]);b.useEffect(()=>{E()},[E,u]);const M=b.useMemo(()=>{if(!S)return null;const Y=new Set((c??[]).map(V=>V.sessionId));return S.filter(V=>V.steps.some(ee=>Y.has(ee.to)))},[S,c]),j=b.useMemo(()=>{const Y=new Map;for(const V of(g==null?void 0:g.values())??[])for(const ee of V)Y.set(ee.id,ee);return Y},[g]);b.useEffect(()=>{let Y=null,V=null;const oe=Ai(ye=>{var Re,se;if((Re=ye.kind)!=null&&Re.startsWith("message.")){if(!(!ye.sessionId||(d.current??[]).some(Te=>Te.sessionId===ye.sessionId)))return;Y!==null&&window.clearTimeout(Y),Y=window.setTimeout(()=>{Y=null,x()},500)}else(se=ye.kind)!=null&&se.startsWith("sequence.")&&(V!==null&&window.clearTimeout(V),V=window.setTimeout(()=>{V=null,E()},500))},["message.","sequence."]);return()=>{oe(),Y!==null&&window.clearTimeout(Y),V!==null&&window.clearTimeout(V)}},[x,E]);const O=b.useMemo(()=>Gee(c??[]),[c]),N=b.useMemo(()=>{let Y=0;for(const V of(g==null?void 0:g.values())??[])Y+=V.length;return Y},[g]),F=b.useCallback(Y=>{var oe;const V=(oe=d.current)==null?void 0:oe.find(ye=>ye.sessionId===Y),ee=(V==null?void 0:V.harness)!=null?p.get(V.harness):void 0;!V||!ee||pe({sessionId:Y,projectId:V.projectId??e,label:Sn(V.title,Y),capability:ee,minimized:!1})},[p,e]),G=b.useMemo(()=>{const Y=O.lanes.map((ee,oe)=>({id:`lane:${oe}`,type:"seqLane",position:{x:ee.x,y:0},data:{lane:ee},draggable:!1,selectable:!1})),V=O.nodes.map(ee=>{const oe=ee.session,ye=oe.harness!=null?p.get(oe.harness):void 0,Re=g==null?void 0:g.get(oe.sessionId);return{id:ee.key,type:"seqSession",position:{x:ee.x,y:ee.y},data:{session:oe,status:l.get(oe.sessionId)??"open",capable:!!ye&&(ye.inject||ye.headless),received:(Re==null?void 0:Re.length)??0,onOpenMessages:F},draggable:!0}});return[...Y,...V]},[O,p,l,g,F]),[H,I]=b.useState(""),[L,C]=b.useState([{to:"",text:"",mode:"auto"}]),D=b.useMemo(()=>(c??[]).filter(Y=>{if(Y.harness==null)return!1;const V=p.get(Y.harness);return!!V&&(V.prompt||V.inject||V.headless)}),[c,p]),U=D.map(Y=>Y.sessionId).join(",");b.useEffect(()=>{const Y=new Set(U?U.split(","):[]);C(V=>V.some(ee=>ee.to!==""&&!Y.has(ee.to))?V.map(ee=>ee.to!==""&&!Y.has(ee.to)?{to:"",text:ee.text,mode:"auto"}:ee):V)},[U]);const B=(Y,V)=>{C(ee=>ee.map((oe,ye)=>ye===Y?{...oe,...V}:oe))},R=(Y,V)=>{const ee=V?m(V):void 0;C(oe=>oe.map((ye,Re)=>Re!==Y?ye:ye.mode==="auto"||ye.mode==="prompt"&&!!(ee!=null&&ee.prompt)||ye.mode==="inject"&&!!(ee!=null&&ee.inject)||ye.mode==="headless"&&!!(ee!=null&&ee.headless)?{...ye,to:V}:{...ye,to:V,mode:"auto"}))},_=L.length>0&&L.every(Y=>Y.to!==""&&Y.text.trim()!==""),K=()=>{_&&r.run("seq:create",async()=>{await Ce.createSequence({name:H.trim()||void 0,steps:L.map(Y=>({to:Y.to,text:Y.text.trim(),mode:Y.mode}))}),I(""),C([{to:"",text:"",mode:"auto"}]),await Promise.all([E(),x()])},{fail:Y=>n("orch.triggerFailed",{error:qe(Y)})})},T=Y=>{r.run(`seqCancel:${Y}`,async()=>{await Ce.cancelSequence(Y),await E()},{fail:V=>n("orch.seqCancelFailed",{error:qe(V)})})},[X,ne]=b.useState(null),[J,pe]=b.useState(null),q=Y=>{const V=(c??[]).find(ee=>ee.sessionId===Y);return Sn((V==null?void 0:V.title)??null,Y)};return o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(mx,{className:"h-3.5 w-3.5 text-teal-400"}),o.jsx("h3",{className:"text-sm font-semibold text-neutral-200",children:n("orch.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:g===null?n("hooks.loading"):n("orch.messages",{n:N})}),o.jsx(Xk,{className:"ml-auto",title:n("tasks.refresh"),onClick:()=>{x(),E()}})]}),o.jsxs("div",{className:de("relative h-[420px] rounded-lg border border-edge/[0.06]",s),children:[c===null?o.jsx("p",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:n("hooks.loading")}):c.length===0?o.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-neutral-600",children:n("orch.canvasEmpty")}):o.jsxs(gk,{nodes:G,nodeTypes:Wee,fitView:!0,fitViewOptions:{maxZoom:1,padding:.12},minZoom:.15,maxZoom:1.5,nodesDraggable:!0,nodesConnectable:!1,deleteKeyCode:null,children:[o.jsx(yk,{}),o.jsx(bk,{showInteractive:!1})]}),o.jsx("p",{className:"pointer-events-none absolute bottom-1 left-2 text-[10px] text-neutral-600",children:n("orch.hint")})]}),o.jsxs("div",{className:"rounded-lg border border-edge/[0.06] bg-edge/[0.015] p-2",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 pb-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-neutral-200",children:n("orch.builderTitle")}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:n("orch.builderHint")})]}),D.length===0?o.jsx("p",{className:"py-1 text-[11px] text-neutral-600",children:n("orch.noCapableSessions")}):o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("input",{value:H,onChange:Y=>I(Y.target.value),placeholder:n("orch.namePlaceholder"),className:"w-56 rounded border border-edge/[0.1] bg-neutral-950 px-2 py-1 text-[11px] text-neutral-100 placeholder:text-neutral-600 focus:outline-none focus:border-blue-500/40"}),L.map((Y,V)=>{const ee=Y.to?m(Y.to):void 0;return o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:"shrink-0 rounded bg-teal-900/40 px-1.5 py-0.5 text-[10px] font-medium text-teal-300",children:V+1}),o.jsxs("select",{value:Y.to,onChange:oe=>R(V,oe.target.value),title:n("orch.stepTarget"),className:"shrink-0 rounded border border-edge/[0.08] bg-neutral-900 px-1.5 py-1 text-[11px] text-neutral-200",children:[o.jsxs("option",{value:"",children:[n("orch.stepTarget"),"…"]}),D.map(oe=>o.jsx("option",{value:oe.sessionId,children:Sn(oe.title,oe.sessionId)},oe.sessionId))]}),o.jsxs("select",{value:Y.mode,onChange:oe=>B(V,{mode:oe.target.value}),title:n("orch.stepMode"),className:"shrink-0 rounded border border-edge/[0.08] bg-neutral-900 px-1.5 py-1 text-[11px] text-neutral-200",children:[o.jsx("option",{value:"auto",children:n("tasks.msgModeAutoHint")}),(ee==null?void 0:ee.prompt)&&o.jsx("option",{value:"prompt",children:n("tasks.msgModePromptHint")}),(ee==null?void 0:ee.inject)&&o.jsx("option",{value:"inject",children:n("tasks.msgModeInjectHint")}),(ee==null?void 0:ee.headless)&&o.jsx("option",{value:"headless",children:n("tasks.msgModeHeadlessHint")})]}),o.jsx("input",{value:Y.text,onChange:oe=>B(V,{text:oe.target.value}),onKeyDown:oe=>{oe.key==="Enter"&&(oe.preventDefault(),K())},placeholder:n("orch.stepText"),className:"min-w-[12rem] flex-1 rounded border border-edge/[0.1] bg-neutral-950 px-2 py-1 text-[11px] text-neutral-100 placeholder:text-neutral-600 focus:outline-none focus:border-blue-500/40"}),L.length>1&&o.jsx("button",{type:"button",title:n("orch.removeStep"),onClick:()=>C(oe=>oe.filter((ye,Re)=>Re!==V)),className:"shrink-0 rounded p-1 text-neutral-500 transition-colors hover:bg-edge/[0.08] hover:text-neutral-200",children:o.jsx(Vt,{className:"h-3 w-3"})})]},V)}),o.jsxs("div",{className:"flex items-center gap-2 pt-0.5",children:[o.jsxs("button",{type:"button",disabled:L.length>=3,onClick:()=>C(Y=>Y.length>=3?Y:[...Y,{to:"",text:"",mode:"auto"}]),className:"inline-flex items-center gap-1 rounded-md border border-edge/[0.1] bg-neutral-900/90 px-2 py-1 text-[11px] text-neutral-300 transition-colors hover:bg-neutral-800 disabled:opacity-40",children:[o.jsx(Vd,{className:"h-3 w-3"}),n("orch.addStep")]}),o.jsxs("button",{type:"button",disabled:!_||r.stateOf("seq:create")==="loading",onClick:K,className:"inline-flex items-center gap-1 rounded bg-teal-700/80 px-2.5 py-1 text-[11px] font-medium text-white transition-colors hover:bg-teal-600 disabled:opacity-40",children:[o.jsx(lt,{state:r.stateOf("seq:create"),className:"h-3 w-3",icon:o.jsx(mx,{className:"h-3 w-3"})}),n("orch.trigger")]})]})]})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 pb-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-neutral-200",children:n("orch.sequencesTitle")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:M===null?"":String(M.length)})]}),M===null?o.jsx("p",{className:"text-xs text-neutral-600",children:n("hooks.loading")}):M.length===0?o.jsx("p",{className:"text-xs text-neutral-600",children:n("orch.seqEmpty")}):o.jsx("ul",{className:"space-y-1.5",children:M.map(Y=>{const V=X===Y.id,ee=Y.steps.length,oe=Y.status==="done"?ee:Math.min(Y.cursor+1,ee);return o.jsxs("li",{className:"rounded-lg border border-edge/[0.06] bg-edge/[0.015]",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>ne(V?null:Y.id),onKeyDown:ye=>{(ye.key==="Enter"||ye.key===" ")&&(ye.preventDefault(),ne(V?null:Y.id))},className:"flex w-full cursor-pointer flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1.5 text-left hover:bg-edge/[0.03]",children:[o.jsx(Qe,{className:de("shrink-0",qee[Y.status]),children:n(Kee[Y.status])}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",title:Y.name||`#${Y.id}`,children:Y.name||n("orch.seqNameFallback",{id:Y.id})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:n("orch.seqProgress",{cur:oe,n:ee})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:lr(Y.createdAt)}),Y.status==="running"&&o.jsx("button",{type:"button",onClick:ye=>{ye.stopPropagation(),T(Y.id)},disabled:r.stateOf(`seqCancel:${Y.id}`)==="loading",className:"inline-flex shrink-0 items-center gap-1 rounded border border-red-500/30 px-1.5 py-0.5 text-[10px] text-red-300 transition-colors hover:bg-red-950/40 disabled:opacity-40",children:n("orch.seqCancel")})]}),Y.error&&o.jsx("p",{className:"break-words border-t border-edge/[0.04] px-2 py-1 text-[11px] text-red-400/80",children:Y.error}),V&&o.jsx("ul",{className:"space-y-1 border-t border-edge/[0.04] px-2 py-1.5",children:Y.steps.map((ye,Re)=>{const se=ye.messageId!=null?j.get(ye.messageId):void 0;return o.jsxs("li",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[o.jsx("span",{className:"shrink-0 rounded bg-teal-900/40 px-1.5 py-px text-[10px] font-medium text-teal-300",children:Re+1}),o.jsx("span",{className:"shrink-0 truncate text-[11px] text-neutral-300",children:q(ye.to)}),o.jsx(Qe,{className:"shrink-0 bg-neutral-800 text-neutral-400",children:n(Yee[ye.mode])}),o.jsx(Qe,{className:de("shrink-0",se?se.status==="succeeded"?"bg-emerald-900/40 text-emerald-300":se.status==="failed"||se.status==="timeout"?"bg-red-900/40 text-red-300":"bg-sky-900/40 text-sky-300":"bg-neutral-900 text-neutral-500"),children:n(se?Vee[se.status]:"orch.seqStepPending")}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-neutral-500",title:ye.text,children:ye.text})]},Re)})})]},Y.id)})})]}),J&&o.jsx(BR,{sessionId:J.sessionId,projectId:J.projectId,label:J.label,projectLabel:t,capability:J.capability,minimized:J.minimized,onInterrupt:k,interruptStateOf:w,onMinimize:()=>pe(Y=>Y&&{...Y,minimized:!0}),onClose:()=>pe(null)},J.sessionId)]})}const Jee=[{key:"packs",label:"assetView.packs"},{key:"files",label:"assetView.files"}];function gy(e){return e.filter(t=>!t.pluginKey)}function ete(e,t,n){return(n?ad(gy(n)).effective:e.length)+t.filter(r=>r.effective!==!1).length}function tte({title:e,note:t,tag:n,children:s}){const r=We(),[i,a]=b.useState(!1);return o.jsxs("section",{className:"rounded-xl border border-edge/[0.06] bg-neutral-900/40",children:[o.jsxs("button",{type:"button",onClick:()=>a(l=>!l),title:r(i?"common.collapse":"common.expand"),className:"flex w-full items-center gap-1.5 px-3 py-2 text-left [&_svg]:pointer-events-none",children:[i?o.jsx(_n,{className:"h-3 w-3 text-neutral-500"}):o.jsx(Yn,{className:"h-3 w-3 text-neutral-500"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-300",children:e}),n,o.jsx("span",{className:"text-[11px] text-neutral-500",children:t})]}),i&&o.jsx("div",{className:"space-y-2 px-3 pb-3",children:s})]})}const nte=[...en,"all"],ste={global:["user"],project:["project","local"]};function rte({projectId:e,mode:t,category:n,resourceView:s,onResourceViewChange:r,statuslineNonce:i,assets:a,globalAssets:l,mcpRows:c,updates:u,globalSkillGroups:d,pluginRows:f,statuslineSource:h,onUninstallSkill:p,onUninstallMcp:m,onCycleMcpEnable:k,onCyclePluginState:w,onUninstallPlugin:g,onOpenFile:y,onOpenSkillDetail:x,projects:S,onOpenSession:A,onSelectSession:E,initialSessionId:M,dragPayload:j}){var pe,q,Y;const{setNodeRef:O,isOver:N}=Uv({id:"project-assets"}),F=t==="global",G=F?"user":"project",H=We(),I=j?Oo(j.attrs,{scope:G,agent:j.targetAgent}):null,L=j!==null&&I!==null&&!I.ok,[C,D]=b.useState(en[0]??"claude"),U=n==="files"||n==="personalization",B=b.useMemo(()=>F?[]:gU(a).filter(V=>C==="all"||V.agent===C),[F,C,a]),R=b.useMemo(()=>(C==="all"?d:d.filter(ee=>ee.source.startsWith(C))).map(ee=>{const oe=Xd(ee.source),ye=xe=>xe.harness===oe&&xe.key===ee.pluginKey,Re=ee.pluginKey&&oe?f.filter(ye):[],se=ee.pluginKey&&oe?Re.some(xe=>xe.effective):void 0,Q=ste[t],Te=Re.filter(xe=>Q.includes(xe.scope)&&xe.enable!==null).map(xe=>({scope:xe.scope,enable:xe.enable,installScopes:xe.installScopes}));return{label:ee.label,source:ee.source,pluginKey:ee.pluginKey,namespace:ee.namespace,enabled:se,installSurface:ee.pluginKey&&oe?Re.some(xe=>xe.installScopes.length>0):void 0,...Te.length>0?{scopeStates:Te}:{},skills:ee.skills.map(xe=>({name:xe.name,scope:"user",files:[],source:ee.source,pluginKey:ee.pluginKey,form:xe.form,...oe?{agent:oe}:{}}))}}),[t,d,f,C]),_=b.useMemo(()=>{const V=ee=>{const oe=c.filter(Re=>Re.harness===ee);if(oe.length===0)return[];const ye=oe[0].installScopes.includes(G)?G:oe[0].installScopes[0];return oe.filter(Re=>Re.scope===ye)};return C==="all"?en.flatMap(V):V(C)},[c,G,C]),K=u==null?void 0:u.skills.filter(V=>V.scope===G),T=u==null?void 0:u.mcp.filter(V=>{const ee=V.agent&&V.agent!=="claude"?V.agent:null;return ee?C==="all"||C===ee:V.scope===G&&(C==="all"||C==="claude")}),X=u==null?void 0:u.files.filter(V=>V.scope===G),ne=b.useMemo(()=>a.filter(V=>C==="all"||V.agent===C),[a,C]),J=b.useMemo(()=>l.filter(V=>C==="all"||V.agent===C),[l,C]);return o.jsxs("div",{ref:O,className:de("space-y-4 h-full px-2 pt-2",L?"ring-1 ring-red-500/60 rounded-md -m-2 bg-red-950/20 cursor-not-allowed":N&&"ring-1 ring-blue-500/60 rounded-md -m-2 bg-blue-950/20"),children:[U&&o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/60 border border-edge/[0.06] p-0.5 w-fit",children:nte.map(V=>o.jsx("button",{onClick:()=>D(V),className:de("rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",C===V?"bg-neutral-800 text-neutral-100 shadow-mac-sm":"text-neutral-500 hover:text-neutral-300"),title:V==="all"?H("category.tabAllTip"):H("category.tabToolTip",{tool:Kn(V).tooltip}),children:V==="all"?H("category.tabAll"):Kn(V).label},V))}),n==="files"&&o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/60 border border-edge/[0.06] p-0.5 w-fit",children:Jee.map(V=>o.jsx("button",{onClick:()=>r(V.key),className:de("rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",s===V.key?"bg-neutral-800 text-neutral-100 shadow-mac-sm":"text-neutral-500 hover:text-neutral-300"),children:H(V.label)},V.key))}),n==="files"&&s==="files"&&!F&&(ne.length===0?C!=="claude"&&C!=="all"?o.jsx(h_,{harness:C,text:C==="codex"?H("category.codexFilesPlaceholder"):H("category.emptyFilesOtherHarness",{harness:Kn(C).label})}):o.jsxs("div",{className:"rounded-xl border border-dashed border-edge/[0.1] bg-neutral-900/40 p-8 flex flex-col items-center justify-center text-center gap-3",children:[o.jsx(hx,{className:"h-8 w-8 text-neutral-600"}),o.jsx("p",{className:"text-xs text-neutral-500",children:H("category.emptyFilesProject")})]}):o.jsx(zS,{scope:G,assets:ne,updates:X,onOpenFile:y})),n==="files"&&s==="files"&&F&&(J.length===0?o.jsxs("div",{className:"rounded-xl border border-dashed border-edge/[0.1] bg-neutral-900/40 p-8 flex flex-col items-center justify-center text-center gap-3",children:[o.jsx(hx,{className:"h-8 w-8 text-neutral-600"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-neutral-300",children:H("category.globalFilesTitle")}),o.jsx("p",{className:"text-xs text-neutral-500 mt-1 max-w-xs",children:H("category.emptyFilesGlobalDesc")})]})]}):o.jsx(zS,{scope:G,assets:J,updates:X,onOpenFile:y})),n==="files"&&s==="packs"&&o.jsxs(o.Fragment,{children:[o.jsx(UK,{projectId:e,mode:t,runtimeTab:C}),o.jsxs(tte,{title:H("category.externalAssets"),note:H("category.externalAssetsNote"),tag:o.jsx(od,{tone:ld(ete(B,_,F?R:void 0),B.length+_.length),children:H("category.externalAssetsSummary",{skills:B.length,mcp:_.length})}),children:[o.jsx(pU,{skills:B,groups:F?gy(R):void 0,globalGroupsReadOnly:F?void 0:gy(R),updates:K,empty:H(C==="codex"?F?"category.emptySkillsGlobalCodex":"category.emptySkillsProjectCodex":F?"category.emptySkillsGlobal":"category.emptySkillsProject"),onUninstallSkill:p,onOpenDetail:x,onCyclePluginState:w,onUninstallPlugin:g}),o.jsx(yU,{rows:_,scope:G,updates:T,empty:H(C==="codex"?"category.emptyMcpCodex":F?"category.emptyMcpGlobal":"category.emptyMcpProject"),onUninstallMcp:m,onCycleMcpEnable:k})]})]}),n==="weave"&&o.jsx(DK,{projectId:e,mode:t}),n==="tasks"&&(F?o.jsx(Bee,{projects:S,onOpenSession:A}):o.jsx(Pee,{projectId:e,initialSessionId:M,onSelectSession:E,projectLabel:((pe=S.find(V=>V.id===e))==null?void 0:pe.name)??"",harnesses:((q=S.find(V=>V.id===e))==null?void 0:q.harnesses)??[]})),n==="orchestrate"&&(F?o.jsx("p",{className:"pt-6 text-center text-xs text-neutral-600",children:H("orch.globalHint")}):o.jsx(Zee,{projectId:e,projectLabel:((Y=S.find(V=>V.id===e))==null?void 0:Y.name)??""})),n==="personalization"&&(C==="claude"||C==="all")&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("p",{className:"text-[11px] text-neutral-500",children:[H(F?"category.personalizationGlobal":"category.personalizationProject"),h&&o.jsx("span",{className:"ml-2",children:H("category.statuslineSource",{source:H(h==="custom"?"category.statuslineCustom":"category.statuslineFollowGlobal")})})]}),o.jsx(BU,{projectId:e,initialTab:F?"global":"project"},`${e}-${F?"global":"project"}-${i}`)]}),n==="personalization"&&C!=="claude"&&o.jsx(h_,{harness:C==="all"?"codex":C,text:C==="all"||C==="codex"?H("category.codexPersonalizationPlaceholder"):H("category.personalizationUnsupported",{harness:Kn(C).label})}),L&&(I==null?void 0:I.reasonKey)&&o.jsx("p",{className:"text-xs text-red-300",children:H(I.reasonKey)}),!L&&N&&o.jsx("p",{className:"text-xs text-blue-300",children:H("category.dropToInstall")})]})}function h_({harness:e,text:t}){return o.jsxs("div",{className:"rounded-xl border border-dashed border-edge/[0.1] bg-neutral-900/40 p-8 flex flex-col items-center justify-center text-center gap-3",children:[o.jsx(y6,{className:"h-8 w-8 text-neutral-600"}),o.jsx(xr,{agent:e}),o.jsx("p",{className:"text-xs text-neutral-500 max-w-xs",children:t})]})}const p_=function(e,t,n){const s=uf(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(s(e.children[t],t,e))return e.children[t]},Xl=function(e){if(e==null)return lte;if(typeof e=="string")return ate(e);if(typeof e=="object")return ite(e);if(typeof e=="function")return Wk(e);throw new Error("Expected function, string, or array as `test`")};function ite(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xl(e[n]);return Wk(s);function s(...r){let i=-1;for(;++i<t.length;)if(t[i].apply(this,r))return!0;return!1}}function ate(e){return Wk(t);function t(n){return n.tagName===e}}function Wk(e){return t;function t(n,s,r){return!!(ote(n)&&e.call(this,n,typeof s=="number"?s:void 0,r||void 0))}}function lte(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function ote(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const m_=/\n/g,g_=/[\t ]+/g,by=Xl("br"),b_=Xl(gte),cte=Xl("p"),x_=Xl("tr"),ute=Xl(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",mte,bte]),XR=Xl(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function dte(e,t){const n=t||{},s="children"in e?e.children:[],r=XR(e),i=ZR(e,{whitespace:n.whitespace||"normal"}),a=[];(e.type==="text"||e.type==="comment")&&a.push(...WR(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<s.length;)a.push(...QR(s[l],e,{whitespace:i,breakBefore:l?void 0:r,breakAfter:l<s.length-1?by(s[l+1]):r}));const c=[];let u;for(l=-1;++l<a.length;){const d=a[l];typeof d=="number"?u!==void 0&&d>u&&(u=d):d&&(u!==void 0&&u>-1&&c.push(`
555
+ `.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function QR(e,t,n){return e.type==="element"?fte(e,t,n):e.type==="text"?n.whitespace==="normal"?WR(e,n):hte(e):[]}function fte(e,t,n){const s=ZR(e,n),r=e.children||[];let i=-1,a=[];if(ute(e))return a;let l,c;for(by(e)||x_(e)&&p_(t,e,x_)?c=`
556
+ `:cte(e)?(l=2,c=2):XR(e)&&(l=1,c=1);++i<r.length;)a=a.concat(QR(r[i],e,{whitespace:s,breakBefore:i?void 0:l,breakAfter:i<r.length-1?by(r[i+1]):c}));return b_(e)&&p_(t,e,b_)&&a.push(" "),l&&a.unshift(l),c&&a.push(c),a}function WR(e,t){const n=String(e.value),s=[],r=[];let i=0;for(;i<=n.length;){m_.lastIndex=i;const c=m_.exec(n),u=c&&"index"in c?c.index:n.length;s.push(pte(n.slice(i,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),i=u+1}let a=-1,l;for(;++a<s.length;)s[a].charCodeAt(s[a].length-1)===8203||a<s.length-1&&s[a+1].charCodeAt(0)===8203?(r.push(s[a]),l=void 0):s[a]?(typeof l=="number"&&r.push(l),r.push(s[a]),l=0):(a===0||a===s.length-1)&&r.push(0);return r}function hte(e){return[String(e.value)]}function pte(e,t,n){const s=[];let r=0,i;for(;r<e.length;){g_.lastIndex=r;const a=g_.exec(e);i=a?a.index:e.length,!r&&!i&&a&&!t&&s.push(""),r!==i&&s.push(e.slice(r,i)),r=a?i+a[0].length:i}return r!==i&&!n&&s.push(""),s.join(" ")}function ZR(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function mte(e){return!!(e.properties||{}).hidden}function gte(e){return e.tagName==="td"||e.tagName==="th"}function bte(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function xte(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+s+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],k=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],S={type:k,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},A={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,`(?!${m.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},E=[A,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:E.concat([{begin:/\(/,end:/\)/,keywords:S,contains:E.concat(["self"]),relevance:0}]),relevance:0},j={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:S,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:S,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,j,A,E,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:S,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function yte(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=xte(e),s=n.keywords;return s.type=[...s.type,...t.type],s.literal=[...s.literal,...t.literal],s.built_in=[...s.built_in,...t.built_in],s._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function vte(e){const t=e.regex,n={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},k=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],g={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],S=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],A=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:k,literal:w,built_in:[...y,...x,"set","shopt",...S,...A]},contains:[p,e.SHEBANG(),m,f,i,a,g,l,c,u,d,n]}}function kte(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="("+s+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},g=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:g.concat([{begin:/\(/,end:/\)/,keywords:w,contains:g.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"</",contains:[].concat(y,x,g,[f,{begin:e.IDENT_RE+"::",keywords:w},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function wte(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+s+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],k=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],S={type:k,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},A={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,`(?!${m.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},E=[A,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:E.concat([{begin:/\(/,end:/\)/,keywords:S,contains:E.concat(["self"]),relevance:0}]),relevance:0},j={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:S,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:S,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,j,A,E,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:S,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Ste(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:r.concat(i),built_in:t,literal:s},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=e.inherit(h,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},k={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(k,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[k,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[u,k,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",S={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,y],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},S]}}const Nte=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ete=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_te=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Cte=[...Ete,..._te],Tte=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ate=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Mte=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),jte=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Rte(e){const t=e.regex,n=Nte(e),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,s,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ate.join("|")+")"},{begin:":(:)?("+Mte.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+jte.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Tte.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Cte.join("|")+")\\b"}]}}function Ote(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Dte(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}function Ite(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Lte(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},s=e.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[s,i,r,a,n,"self"],relevance:0},c=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,d=/'[^']*'/,f=t.either(c,u,d),h=t.concat(f,"(\\s*\\.\\s*",f,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:h,className:"attr",starts:{end:/$/,contains:[s,l,i,r,a,n]}}]}}var ao="[0-9](_*[0-9])*",oh=`\\.(${ao})`,ch="[0-9a-fA-F](_*[0-9a-fA-F])*",y_={className:"number",variants:[{begin:`(\\b(${ao})((${oh})|\\.)?|(${oh}))[eE][+-]?(${ao})[fFdD]?\\b`},{begin:`\\b(${ao})((${oh})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${oh})[fFdD]?\\b`},{begin:`\\b(${ao})[fFdD]\\b`},{begin:`\\b0[xX]((${ch})\\.?|(${ch})?\\.(${ch}))[pP][+-]?(${ao})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ch})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function JR(e,t,n){return n===-1?"":e.replace(t,s=>JR(e,t,n-1))}function Pte(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",s=n+JR("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+s+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y_,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},y_,u]}}const v_="[A-Za-z$_][0-9A-Za-z$_]*",zte=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ute=["true","false","null","undefined","NaN","Infinity"],eO=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],tO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nO=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Fte=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Bte=[].concat(nO,eO,tO);function Hte(e){const t=e.regex,n=(U,{after:B})=>{const R="</"+U[0].slice(1);return U.input.indexOf(R,B)!==-1},s=v_,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,B)=>{const R=U[0].length+U.index,_=U.input[R];if(_==="<"||_===","){B.ignoreMatch();return}_===">"&&(n(U,{after:R})||B.ignoreMatch());let K;const T=U.input.substring(R);if(K=T.match(/^\s*=/)){B.ignoreMatch();return}if((K=T.match(/^\s+extends\s+/))&&K.index===0){B.ignoreMatch();return}}},l={$pattern:v_,keyword:zte,literal:Ute,built_in:Bte,"variable.language":Fte},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,k,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const S=[].concat(y,h.contains),A=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),E={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:A},M={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...eO,...tO]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(U){return t.concat("(?!",U.join("|"),")")}const H={match:t.concat(/\b/,G([...nO,"super","import","await"].map(U=>`${U}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},L={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:j},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,k,w,y,{match:/\$\d+/},f,j,{scope:"attr",match:s+t.lookahead(":"),relevance:0},D,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},N,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},H,F,M,L,{match:/\$[(.]/}]}}const $te="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",Gte={scope:"number",match:$te,relevance:0};function Kte(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],r={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:s},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,Gte,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var lo="[0-9](_*[0-9])*",uh=`\\.(${lo})`,dh="[0-9a-fA-F](_*[0-9a-fA-F])*",qte={className:"number",variants:[{begin:`(\\b(${lo})((${uh})|\\.)?|(${uh}))[eE][+-]?(${lo})[fFdD]?\\b`},{begin:`\\b(${lo})((${uh})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${uh})[fFdD]?\\b`},{begin:`\\b(${lo})[fFdD]\\b`},{begin:`\\b0[xX]((${dh})\\.?|(${dh})?\\.(${dh}))[pP][+-]?(${lo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${dh})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Yte(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},s={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(a);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=qte,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,s,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
557
+ `},u]}}const Vte=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Xte=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Qte=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Wte=[...Xte,...Qte],Zte=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),sO=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),rO=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Jte=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),ene=sO.concat(rO).sort().reverse();function tne(e){const t=Vte(e),n=ene,s="and or not only",r="[\\w-]+",i="("+r+"|@\\{"+r+"\\})",a=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,S,A){return{className:x,begin:S,relevance:A}},d={$pattern:/[a-z-]+/,keyword:s,attribute:Zte.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.UNICODE_RANGE,t.HEXCOLOR,f,u("variable","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Jte.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},k={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+r+"\\}"),{begin:"\\b("+Wte.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",i,0),u("selector-id","#"+i),u("selector-class","\\."+i,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+sO.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+rO.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},y={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,k,w,y,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function nne(e){const t="\\[=*\\[",n="\\]=*\\]",s={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[s],relevance:5}])}}function sne(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},r={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},a={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,s,r,i,a]}}function rne(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,c];return[u,d,f,h].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,i,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},r,s,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ine(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function ane(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},a={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,i,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(k,w,g="\\1")=>{const y=g==="\\1"?g:t.concat(g,w);return t.concat(t.concat("(?:",k,")"),w,/(?:\\.|[^\\\/])*?/,y,/(?:\\.|[^\\\/])*?/,g,s)},p=(k,w,g)=>t.concat(t.concat("(?:",k,")"),w,/(?:\\.|[^\\\/])*?/,g,s),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:m}}function lne(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,s=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+s},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(I,L)=>{L.data._beginMatch=I[1]||I[2]},"on:end":(I,L)=>{L.data._beginMatch!==I[1]&&L.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
558
+ ]`,m={scope:"string",variants:[d,u,f,h]},k={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],S={keyword:g,literal:(I=>{const L=[];return I.forEach(C=>{L.push(C),C.toLowerCase()===C?L.push(C.toUpperCase()):L.push(C.toLowerCase())}),L})(w),built_in:y},A=I=>I.map(L=>L.replace(/\|\d+$/,"")),E={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",A(y).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},M=t.concat(s,"\\b(?!\\()"),j={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),M],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),M],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},O={scope:"attr",match:t.concat(s,t.lookahead(":"),t.lookahead(/(?!::)/))},N={relevance:0,begin:/\(/,end:/\)/,keywords:S,contains:[O,a,j,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,k,E]},F={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",A(g).join("\\b|"),"|",A(y).join("\\b|"),"\\b)"),s,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[N]};N.contains.push(F);const G=[O,j,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,k,E],H={begin:t.concat(/#\[\s*\\?/,t.either(r,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...G]},...G,{scope:"meta",variants:[{match:r},{match:i}]}]};return{case_insensitive:!1,keywords:S,contains:[H,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,F,j,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},E,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:S,contains:["self",H,a,j,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,k]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,k]}}function one(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function cne(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function une(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${s.join("|")}`,k={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,k,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,k,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,k,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[k,g,f]}]}}function dne(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function fne(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[i,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function hne(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(s,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},k={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},E=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:a},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[k]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=E,k.contains=E;const N=[{begin:/^\s*=>/,starts:{end:"$",contains:E}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:E}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(N).concat(u).concat(E)}}function pne(e){const t=e.regex,n=/(r#)?/,s=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:d}},{className:"punctuation",begin:"->"},i]}}const mne=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),gne=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],bne=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],xne=[...gne,...bne],yne=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),vne=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),kne=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wne=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Sne(e){const t=mne(e),n=kne,s=vne,r="@[a-z-]+",i="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+xne.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+s.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wne.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,t.UNICODE_RANGE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:yne.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Nne(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Ene(e){const t=e.regex,n=e.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...c].filter(A=>!d.includes(A)),k={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function y(A){return t.concat(/\b/,t.either(...A.map(E=>E.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:y(h),relevance:0};function S(A,{exceptions:E,when:M}={}){const j=M;return E=E||[],A.map(O=>O.match(/\|\d+$/)||E.includes(O)?O:j(O)?`${O}|0`:O)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:S(m,{when:A=>A.length<3}),literal:i,type:l,built_in:f},contains:[{scope:"type",match:y(a)},x,g,k,s,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function iO(e){return e?typeof e=="string"?e:e.source:null}function Jc(e){return It("(?=",e,")")}function It(...e){return e.map(n=>iO(n)).join("")}function _ne(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ns(...e){return"("+(_ne(e).capture?"":"?:")+e.map(s=>iO(s)).join("|")+")"}const Zk=e=>It(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Cne=["Protocol","Type"].map(Zk),k_=["init","self"].map(Zk),Tne=["Any","Self"],v0=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],w_=["false","nil","true"],Ane=["assignment","associativity","higherThan","left","lowerThan","none","right"],Mne=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],S_=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],aO=ns(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),lO=ns(aO,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),k0=It(aO,lO,"*"),oO=ns(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Hp=ns(oO,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ar=It(oO,Hp,"*"),fh=It(/[A-Z]/,Hp,"*"),jne=["attached","autoclosure",It(/convention\(/,ns("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",It(/objc\(/,Ar,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Rne=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function One(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,ns(...Cne,...k_)],className:{2:"keyword"}},i={match:It(/\./,ns(...v0)),relevance:0},a=v0.filter(Q=>typeof Q=="string").concat(["_|0"]),l=v0.filter(Q=>typeof Q!="string").concat(Tne).map(Zk),c={variants:[{className:"keyword",match:ns(...l,...k_)}]},u={$pattern:ns(/\b\w+/,/#\w+/),keyword:a.concat(Mne),literal:w_},d=[r,i,c],f={match:It(/\./,ns(...S_)),relevance:0},h={className:"built_in",match:It(/\b/,ns(...S_),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},k={className:"operator",relevance:0,variants:[{match:k0},{match:`\\.(\\.|${lO})+`}]},w=[m,k],g="([0-9]_*)+",y="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${y})(\\.(${y}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(Q="")=>({className:"subst",variants:[{match:It(/\\/,Q,/[0\\tnr"']/)},{match:It(/\\/,Q,/u\{[0-9a-fA-F]{1,8}\}/)}]}),A=(Q="")=>({className:"subst",match:It(/\\/,Q,/[\t ]*(?:[\r\n]|\r\n)/)}),E=(Q="")=>({className:"subst",label:"interpol",begin:It(/\\/,Q,/\(/),end:/\)/}),M=(Q="")=>({begin:It(Q,/"""/),end:It(/"""/,Q),contains:[S(Q),A(Q),E(Q)]}),j=(Q="")=>({begin:It(Q,/"/),end:It(/"/,Q),contains:[S(Q),E(Q)]}),O={className:"string",variants:[M(),M("#"),M("##"),M("###"),j(),j("#"),j("##"),j("###")]},N=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],F={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:N},G=Q=>{const Te=It(Q,/\//),xe=It(/\//,Q);return{begin:Te,end:xe,contains:[...N,{scope:"comment",begin:`#(?!.*${xe})`,end:/$/}]}},H={scope:"regexp",variants:[G("###"),G("##"),G("#"),F]},I={match:It(/`/,Ar,/`/)},L={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${Hp}+`},D=[I,L,C],U={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Rne,contains:[...w,x,O]}]}},B={scope:"keyword",match:It(/@/,ns(...jne),Jc(ns(/\(/,/\s+/)))},R={scope:"meta",match:It(/@/,Ar)},_=[U,B,R],K={match:Jc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:It(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Hp,"+")},{className:"type",match:fh,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:It(/\s+&\s+/,Jc(fh)),relevance:0}]},T={begin:/</,end:/>/,keywords:u,contains:[...s,...d,..._,m,K]};K.contains.push(T);const X={match:It(Ar,/\s*:/),keywords:"_|0",relevance:0},ne={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",X,...s,H,...d,...p,...w,x,O,...D,..._,K]},J={begin:/</,end:/>/,keywords:"repeat each",contains:[...s,K]},pe={begin:ns(Jc(It(Ar,/\s*:/)),Jc(It(Ar,/\s+/,Ar,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ar}]},q={begin:/\(/,end:/\)/,keywords:u,contains:[pe,...s,...d,...w,x,O,..._,K,ne],endsParent:!0,illegal:/["']/},Y={match:[/(func|macro)/,/\s+/,ns(I.match,Ar,k0)],className:{1:"keyword",3:"title.function"},contains:[J,q,t],illegal:[/\[/,/%/]},V={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[J,q,t],illegal:/\[|%/},ee={match:[/operator/,/\s+/,k0],className:{1:"keyword",3:"title"}},oe={begin:[/precedencegroup/,/\s+/,fh],className:{1:"keyword",3:"title"},contains:[K],keywords:[...Ane,...w_],end:/}/},ye={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Re={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},se={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ar,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[J,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:fh},...d],relevance:0}]};for(const Q of O.variants){const Te=Q.contains.find(ve=>ve.label==="interpol");Te.keywords=u;const xe=[...d,...p,...w,x,O,...D];Te.contains=[...xe,{begin:/\(/,end:/\)/,contains:["self",...xe]}]}return{name:"Swift",keywords:u,contains:[...s,Y,V,ye,Re,se,ee,oe,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},H,...d,...p,...w,x,O,...D,..._,K,ne]}}const $p="[A-Za-z$_][0-9A-Za-z$_]*",cO=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],uO=["true","false","null","undefined","NaN","Infinity"],dO=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],fO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hO=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],mO=[].concat(hO,dO,fO);function Dne(e){const t=e.regex,n=(U,{after:B})=>{const R="</"+U[0].slice(1);return U.input.indexOf(R,B)!==-1},s=$p,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,B)=>{const R=U[0].length+U.index,_=U.input[R];if(_==="<"||_===","){B.ignoreMatch();return}_===">"&&(n(U,{after:R})||B.ignoreMatch());let K;const T=U.input.substring(R);if(K=T.match(/^\s*=/)){B.ignoreMatch();return}if((K=T.match(/^\s+extends\s+/))&&K.index===0){B.ignoreMatch();return}}},l={$pattern:$p,keyword:cO,literal:uO,built_in:mO,"variable.language":pO},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,k,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const S=[].concat(y,h.contains),A=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),E={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:A},M={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...dO,...fO]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(U){return t.concat("(?!",U.join("|"),")")}const H={match:t.concat(/\b/,G([...hO,"super","import","await"].map(U=>`${U}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},L={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:j},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,k,w,y,{match:/\$\d+/},f,j,{scope:"attr",match:s+t.lookahead(":"),relevance:0},D,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},N,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},H,F,M,L,{match:/\$[(.]/}]}}function Ine(e){const t=e.regex,n=Dne(e),s=$p,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:$p,keyword:cO.concat(c),literal:uO,built_in:mO.concat(r),"variable.language":pO},d={className:"meta",begin:"@"+s},f=(k,w,g)=>{const y=k.contains.findIndex(x=>x.label===w);if(y===-1)throw new Error("can not find mode to replace");k.contains.splice(y,1,g)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(k=>k.scope==="attr"),p=Object.assign({},h,{match:t.concat(s,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,i,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const m=n.contains.find(k=>k.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Lne(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,r),/ +/,t.either(a,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,s,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function Pne(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,a,r,e.QUOTE_STRING_MODE,c,u,l]}}function zne(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Une(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},k={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,k,i,a],g=[...w];return g.pop(),g.push(l),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const Fne={arduino:yte,bash:vte,c:kte,cpp:wte,csharp:Ste,css:Rte,diff:Ote,go:Dte,graphql:Ite,ini:Lte,java:Pte,javascript:Hte,json:Kte,kotlin:Yte,less:tne,lua:nne,makefile:sne,markdown:rne,objectivec:ine,perl:ane,php:lne,"php-template":one,plaintext:cne,python:une,"python-repl":dne,r:fne,ruby:hne,rust:pne,scss:Sne,shell:Nne,sql:Ene,swift:One,typescript:Ine,vbnet:Lne,wasm:Pne,xml:zne,yaml:Une};function gO(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],s=typeof n;(s==="object"||s==="function")&&!Object.isFrozen(n)&&gO(n)}),e}class N_{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function bO(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function xa(e,...t){const n=Object.create(null);for(const s in e)n[s]=e[s];return t.forEach(function(s){for(const r in s)n[r]=s[r]}),n}const Bne="</span>",E_=e=>!!e.scope,Hne=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((s,r)=>`${s}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class $ne{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=bO(t)}openNode(t){if(!E_(t))return;const n=Hne(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){E_(t)&&(this.buffer+=Bne)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const __=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Jk{constructor(){this.rootNode=__(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=__({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(s=>this._walk(t,s)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Jk._collapse(n)}))}}class Gne extends Jk{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const s=t.root;n&&(s.scope=`language:${n}`),this.add(s)}toHTML(){return new $ne(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function vd(e){return e?typeof e=="string"?e:e.source:null}function xO(e){return Ql("(?=",e,")")}function Kne(e){return Ql("(?:",e,")*")}function qne(e){return Ql("(?:",e,")?")}function Ql(...e){return e.map(n=>vd(n)).join("")}function Yne(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ew(...e){return"("+(Yne(e).capture?"":"?:")+e.map(s=>vd(s)).join("|")+")"}function yO(e){return new RegExp(e.toString()+"|").exec("").length-1}function Vne(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Xne=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function tw(e,{joinWith:t}){let n=0;return e.map(s=>{n+=1;const r=n;let i=vd(s),a="";for(;i.length>0;){const l=Xne.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+r):(a+=l[0],l[0]==="("&&n++)}return a}).map(s=>`(${s})`).join(t)}const Qne=/\b\B/,vO="[a-zA-Z]\\w*",nw="[a-zA-Z_]\\w*",kO="\\b\\d+(\\.\\d+)?",wO="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",SO="\\b(0b[01]+)",Wne="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Zne=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Ql(t,/.*\b/,e.binary,/\b.*/)),xa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,s)=>{n.index!==0&&s.ignoreMatch()}},e)},kd={begin:"\\\\[\\s\\S]",relevance:0},Jne={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[kd]},ese={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[kd]},tse={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Um=function(e,t,n={}){const s=xa({scope:"comment",begin:e,end:t,contains:[]},n);s.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=ew("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return s.contains.push({begin:Ql(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s},nse=Um("//","$"),sse=Um("/\\*","\\*/"),rse=Um("#","$"),ise={scope:"number",begin:kO,relevance:0},ase={scope:"number",begin:wO,relevance:0},lse={scope:"number",begin:SO,relevance:0},ose={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[kd,{begin:/\[/,end:/\]/,relevance:0,contains:[kd]}]},cse={scope:"title",begin:vO,relevance:0},use={scope:"title",begin:nw,relevance:0},dse={begin:"\\.\\s*"+nw,relevance:0},fse=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var hh=Object.freeze({__proto__:null,APOS_STRING_MODE:Jne,BACKSLASH_ESCAPE:kd,BINARY_NUMBER_MODE:lse,BINARY_NUMBER_RE:SO,COMMENT:Um,C_BLOCK_COMMENT_MODE:sse,C_LINE_COMMENT_MODE:nse,C_NUMBER_MODE:ase,C_NUMBER_RE:wO,END_SAME_AS_BEGIN:fse,HASH_COMMENT_MODE:rse,IDENT_RE:vO,MATCH_NOTHING_RE:Qne,METHOD_GUARD:dse,NUMBER_MODE:ise,NUMBER_RE:kO,PHRASAL_WORDS_MODE:tse,QUOTE_STRING_MODE:ese,REGEXP_MODE:ose,RE_STARTERS_RE:Wne,SHEBANG:Zne,TITLE_MODE:cse,UNDERSCORE_IDENT_RE:nw,UNDERSCORE_TITLE_MODE:use});function hse(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function pse(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function mse(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=hse,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function gse(e,t){Array.isArray(e.illegal)&&(e.illegal=ew(...e.illegal))}function bse(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function xse(e,t){e.relevance===void 0&&(e.relevance=1)}const yse=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(s=>{delete e[s]}),e.keywords=n.keywords,e.begin=Ql(n.beforeMatch,xO(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},vse=["of","and","for","in","not","or","if","then","parent","list","value"],kse="keyword";function NO(e,t,n=kse){const s=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(i){Object.assign(s,NO(e[i],t,i))}),s;function r(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");s[c[0]]=[i,wse(c[0],c[1])]})}}function wse(e,t){return t?Number(t):Sse(e)?0:1}function Sse(e){return vse.includes(e.toLowerCase())}const C_={},_l=e=>{console.error(e)},T_=(e,...t)=>{console.log(`WARN: ${e}`,...t)},to=(e,t)=>{C_[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),C_[`${e}/${t}`]=!0)},Gp=new Error;function EO(e,t,{key:n}){let s=0;const r=e[n],i={},a={};for(let l=1;l<=t.length;l++)a[l+s]=r[l],i[l+s]=!0,s+=yO(t[l-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function Nse(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw _l("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Gp;if(typeof e.beginScope!="object"||e.beginScope===null)throw _l("beginScope must be object"),Gp;EO(e,e.begin,{key:"beginScope"}),e.begin=tw(e.begin,{joinWith:""})}}function Ese(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw _l("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Gp;if(typeof e.endScope!="object"||e.endScope===null)throw _l("endScope must be object"),Gp;EO(e,e.end,{key:"endScope"}),e.end=tw(e.end,{joinWith:""})}}function _se(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Cse(e){_se(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Nse(e),Ese(e)}function Tse(e){function t(a,l){return new RegExp(vd(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=yO(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(tw(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(a){const l=new s;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[pse,bse,Cse,yse].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[mse,gse,xse].forEach(d=>d(a,l)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=NO(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=vd(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Ase(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=xa(e.classNameAliases||{}),i(e)}function _O(e){return e?e.endsWithParent||_O(e.starts):!1}function Ase(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return xa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:_O(e)?xa(e,{starts:e.starts?xa(e.starts):null}):Object.isFrozen(e)?xa(e):e}var Mse="11.11.2";class jse extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const w0=bO,A_=xa,M_=Symbol("nomatch"),Rse=7,CO=function(e){const t=Object.create(null),n=Object.create(null),s=[];let r=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Gne};function c(C){return l.noHighlightRe.test(C)}function u(C){let D=C.className+" ";D+=C.parentNode?C.parentNode.className:"";const U=l.languageDetectRe.exec(D);if(U){const B=j(U[1]);return B||(T_(i.replace("{}",U[1])),T_("Falling back to no-highlight mode for this block.",C)),B?U[1]:"no-highlight"}return D.split(/\s+/).find(B=>c(B)||j(B))}function d(C,D,U){let B="",R="";typeof D=="object"?(B=C,U=D.ignoreIllegals,R=D.language):(to("10.7.0","highlight(lang, code, ...args) has been deprecated."),to("10.7.0",`Please use highlight(code, options) instead.
559
+ https://github.com/highlightjs/highlight.js/issues/2277`),R=C,B=D),U===void 0&&(U=!0);const _={code:B,language:R};I("before:highlight",_);const K=_.result?_.result:f(_.language,_.code,U);return K.code=_.code,I("after:highlight",K),K}function f(C,D,U,B){const R=Object.create(null);function _(te,re){return te.keywords[re]}function K(){if(!xe.keywords){ge.addText($e);return}let te=0;xe.keywordPatternRe.lastIndex=0;let re=xe.keywordPatternRe.exec($e),Ae="";for(;re;){Ae+=$e.substring(te,re.index);const v=se.case_insensitive?re[0].toLowerCase():re[0],Z=_(xe,v);if(Z){const[fe,be]=Z;if(ge.addText(Ae),Ae="",R[v]=(R[v]||0)+1,R[v]<=Rse&&(dt+=be),fe.startsWith("_"))Ae+=re[0];else{const he=se.classNameAliases[fe]||fe;ne(re[0],he)}}else Ae+=re[0];te=xe.keywordPatternRe.lastIndex,re=xe.keywordPatternRe.exec($e)}Ae+=$e.substring(te),ge.addText(Ae)}function T(){if($e==="")return;let te=null;if(typeof xe.subLanguage=="string"){if(!t[xe.subLanguage]){ge.addText($e);return}te=f(xe.subLanguage,$e,!0,ve[xe.subLanguage]),ve[xe.subLanguage]=te._top}else te=p($e,xe.subLanguage.length?xe.subLanguage:null);xe.relevance>0&&(dt+=te.relevance),ge.__addSublanguage(te._emitter,te.language)}function X(){xe.subLanguage!=null?T():K(),$e=""}function ne(te,re){te!==""&&(ge.startScope(re),ge.addText(te),ge.endScope())}function J(te,re){let Ae=1;const v=re.length-1;for(;Ae<=v;){if(!te._emit[Ae]){Ae++;continue}const Z=se.classNameAliases[te[Ae]]||te[Ae],fe=re[Ae];Z?ne(fe,Z):($e=fe,K(),$e=""),Ae++}}function pe(te,re){return te.scope&&typeof te.scope=="string"&&ge.openNode(se.classNameAliases[te.scope]||te.scope),te.beginScope&&(te.beginScope._wrap?(ne($e,se.classNameAliases[te.beginScope._wrap]||te.beginScope._wrap),$e=""):te.beginScope._multi&&(J(te.beginScope,re),$e="")),xe=Object.create(te,{parent:{value:xe}}),xe}function q(te,re,Ae){let v=Vne(te.endRe,Ae);if(v){if(te["on:end"]){const Z=new N_(te);te["on:end"](re,Z),Z.isMatchIgnored&&(v=!1)}if(v){for(;te.endsParent&&te.parent;)te=te.parent;return te}}if(te.endsWithParent)return q(te.parent,re,Ae)}function Y(te){return xe.matcher.regexIndex===0?($e+=te[0],1):(ct=!0,0)}function V(te){const re=te[0],Ae=te.rule,v=new N_(Ae),Z=[Ae.__beforeBegin,Ae["on:begin"]];for(const fe of Z)if(fe&&(fe(te,v),v.isMatchIgnored))return Y(re);return Ae.skip?$e+=re:(Ae.excludeBegin&&($e+=re),X(),!Ae.returnBegin&&!Ae.excludeBegin&&($e=re)),pe(Ae,te),Ae.returnBegin?0:re.length}function ee(te){const re=te[0],Ae=D.substring(te.index),v=q(xe,te,Ae);if(!v)return M_;const Z=xe;xe.endScope&&xe.endScope._wrap?(X(),ne(re,xe.endScope._wrap)):xe.endScope&&xe.endScope._multi?(X(),J(xe.endScope,te)):Z.skip?$e+=re:(Z.returnEnd||Z.excludeEnd||($e+=re),X(),Z.excludeEnd&&($e=re));do xe.scope&&ge.closeNode(),!xe.skip&&!xe.subLanguage&&(dt+=xe.relevance),xe=xe.parent;while(xe!==v.parent);return v.starts&&pe(v.starts,te),Z.returnEnd?0:re.length}function oe(){const te=[];for(let re=xe;re!==se;re=re.parent)re.scope&&te.unshift(re.scope);te.forEach(re=>ge.openNode(re))}let ye={};function Re(te,re){const Ae=re&&re[0];if($e+=te,Ae==null)return X(),0;if(ye.type==="begin"&&re.type==="end"&&ye.index===re.index&&Ae===""){if($e+=D.slice(re.index,re.index+1),!r){const v=new Error(`0 width match regex (${C})`);throw v.languageName=C,v.badRule=ye.rule,v}return 1}if(ye=re,re.type==="begin")return V(re);if(re.type==="illegal"&&!U){const v=new Error('Illegal lexeme "'+Ae+'" for mode "'+(xe.scope||"<unnamed>")+'"');throw v.mode=xe,v}else if(re.type==="end"){const v=ee(re);if(v!==M_)return v}if(re.type==="illegal"&&Ae==="")return re.index===D.length||($e+=`
560
+ `),1;if(rt>1e5&&rt>re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return $e+=Ae,Ae.length}const se=j(C);if(!se)throw _l(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Q=Tse(se);let Te="",xe=B||Q;const ve={},ge=new l.__emitter(l);oe();let $e="",dt=0,mt=0,rt=0,ct=!1;try{if(se.__emitTokens)se.__emitTokens(D,ge);else{for(xe.matcher.considerAll();;){rt++,ct?ct=!1:xe.matcher.considerAll(),xe.matcher.lastIndex=mt;const te=xe.matcher.exec(D);if(!te)break;const re=D.substring(mt,te.index),Ae=Re(re,te);mt=te.index+Ae}Re(D.substring(mt))}return ge.finalize(),Te=ge.toHTML(),{language:C,value:Te,relevance:dt,illegal:!1,_emitter:ge,_top:xe}}catch(te){if(te.message&&te.message.includes("Illegal"))return{language:C,value:w0(D),illegal:!0,relevance:0,_illegalBy:{message:te.message,index:mt,context:D.slice(mt-100,mt+100),mode:te.mode,resultSoFar:Te},_emitter:ge};if(r)return{language:C,value:w0(D),illegal:!1,relevance:0,errorRaised:te,_emitter:ge,_top:xe};throw te}}function h(C){const D={value:w0(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return D._emitter.addText(C),D}function p(C,D){D=D||l.languages||Object.keys(t);const U=h(C),B=D.filter(j).filter(N).map(X=>f(X,C,!1));B.unshift(U);const R=B.sort((X,ne)=>{if(X.relevance!==ne.relevance)return ne.relevance-X.relevance;if(X.language&&ne.language){if(j(X.language).supersetOf===ne.language)return 1;if(j(ne.language).supersetOf===X.language)return-1}return 0}),[_,K]=R,T=_;return T.secondBest=K,T}function m(C,D,U){const B=D&&n[D]||U;C.classList.add("hljs"),C.classList.add(`language-${B}`)}function k(C){let D=null;const U=u(C);if(c(U))return;if(I("before:highlightElement",{el:C,language:U}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new jse("One of your code blocks includes unescaped HTML.",C.innerHTML);D=C;const B=D.textContent,R=U?d(B,{language:U,ignoreIllegals:!0}):p(B);C.innerHTML=R.value,C.dataset.highlighted="yes",m(C,U,R.language),C.result={language:R.language,re:R.relevance,relevance:R.relevance},R.secondBest&&(C.secondBest={language:R.secondBest.language,relevance:R.secondBest.relevance}),I("after:highlightElement",{el:C,result:R,text:B})}function w(C){l=A_(l,C)}const g=()=>{S(),to("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){S(),to("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function S(){function C(){S()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",C,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(k)}function A(C,D){let U=null;try{U=D(e)}catch(B){if(_l("Language definition for '{}' could not be registered.".replace("{}",C)),r)_l(B);else throw B;U=a}U.name||(U.name=C),t[C]=U,U.rawDefinition=D.bind(null,e),U.aliases&&O(U.aliases,{languageName:C})}function E(C){delete t[C];for(const D of Object.keys(n))n[D]===C&&delete n[D]}function M(){return Object.keys(t)}function j(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function O(C,{languageName:D}){typeof C=="string"&&(C=[C]),C.forEach(U=>{n[U.toLowerCase()]=D})}function N(C){const D=j(C);return D&&!D.disableAutodetect}function F(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=D=>{C["before:highlightBlock"](Object.assign({block:D.el},D))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=D=>{C["after:highlightBlock"](Object.assign({block:D.el},D))})}function G(C){F(C),s.push(C)}function H(C){const D=s.indexOf(C);D!==-1&&s.splice(D,1)}function I(C,D){const U=C;s.forEach(function(B){B[U]&&B[U](D)})}function L(C){return to("10.7.0","highlightBlock will be removed entirely in v12.0"),to("10.7.0","Please use highlightElement now."),k(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:S,highlightElement:k,highlightBlock:L,configure:w,initHighlighting:g,initHighlightingOnLoad:y,registerLanguage:A,unregisterLanguage:E,listLanguages:M,getLanguage:j,registerAliases:O,autoDetection:N,inherit:A_,addPlugin:G,removePlugin:H}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=Mse,e.regex={concat:Ql,lookahead:xO,either:ew,optional:qne,anyNumberOfTimes:Kne};for(const C in hh)typeof hh[C]=="object"&&gO(hh[C]);return Object.assign(e,hh),e},kc=CO({});kc.newInstance=()=>CO({});var Ose=kc;kc.HighlightJS=kc;kc.default=kc;const Dse=Cd(Ose),j_={},Ise="hljs-";function Lse(e){const t=Dse.newInstance();return e&&i(e),{highlight:n,highlightAuto:s,listLanguages:r,register:i,registerAlias:a,registered:l};function n(c,u,d){const f=d||j_,h=typeof f.prefix=="string"?f.prefix:Ise;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Pse,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:c});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,k=m.data;return k.language=p.language,k.relevance=p.relevance,m}function s(c,u){const f=(u||j_).subset||r();let h=-1,p=0,m;for(;++h<f.length;){const k=f[h];if(!t.getLanguage(k))continue;const w=n(k,c,u);w.data&&w.data.relevance!==void 0&&w.data.relevance>p&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function r(){return t.listLanguages()}function i(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function a(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class Pse{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],s=n.children[n.children.length-1];s&&s.type==="text"?s.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const s=this.stack[this.stack.length-1],r=t.root.children;n?s.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):s.children.push(...r)}openNode(t){const n=this,s=t.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:s},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const zse={};function TO(e){const t=e||zse,n=t.aliases,s=t.detect||!1,r=t.languages||Fne,i=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=Lse(r);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){zm(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const k=Use(h);if(k===!1||!k&&!s||k&&i&&i.includes(k))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const w=dte(h,{whitespace:"pre"});let g;try{g=k?u.highlight(k,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:l})}catch(y){const x=y;if(k&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+k+"`, it’s not registered",{ancestors:[m,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!k&&g.data&&g.data.language&&h.properties.className.push("language-"+g.data.language),g.children.length>0&&(h.children=g.children)})}}function Use(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let s;for(;++n<t.length;){const r=String(t[n]);if(r==="no-highlight"||r==="nohighlight")return!1;!s&&r.slice(0,5)==="lang-"&&(s=r.slice(5)),!s&&r.slice(0,9)==="language-"&&(s=r.slice(9))}return s}function Fse(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $n={},ph={},qi={},R_;function ff(){if(R_)return qi;R_=1;function e(a){return typeof a>"u"||a===null}function t(a){return typeof a=="object"&&a!==null}function n(a){return Array.isArray(a)?a:e(a)?[]:[a]}function s(a,l){if(l){const c=Object.keys(l);for(let u=0,d=c.length;u<d;u+=1){const f=c[u];a[f]=l[f]}}return a}function r(a,l){let c="";for(let u=0;u<l;u+=1)c+=a;return c}function i(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return qi.isNothing=e,qi.isObject=t,qi.toArray=n,qi.repeat=r,qi.isNegativeZero=i,qi.extend=s,qi}var S0,O_;function hf(){if(O_)return S0;O_=1;function e(n,s){let r="";const i=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(r+='in "'+n.mark.name+'" '),r+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!s&&n.mark.snippet&&(r+=`
561
+
562
+ `+n.mark.snippet),i+" "+r):i}function t(n,s){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=s,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(s){return this.name+": "+e(this,s)},S0=t,S0}var N0,D_;function Bse(){if(D_)return N0;D_=1;const e=ff();function t(r,i,a,l,c){let u="",d="";const f=Math.floor(c/2)-1;return l-i>f&&(u=" ... ",i=l-f+u.length),a-l>f&&(d=" ...",a=l+f-d.length),{str:u+r.slice(i,a).replace(/\t/g,"→")+d,pos:l-i+u.length}}function n(r,i){return e.repeat(" ",i-r.length)+r}function s(r,i){if(i=Object.create(i||null),!r.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!="number"&&(i.indent=1),typeof i.linesBefore!="number"&&(i.linesBefore=3),typeof i.linesAfter!="number"&&(i.linesAfter=2);const a=/\r?\n|\r|\0/g,l=[0],c=[];let u,d=-1;for(;u=a.exec(r.buffer);)c.push(u.index),l.push(u.index+u[0].length),r.position<=u.index&&d<0&&(d=l.length-2);d<0&&(d=l.length-1);let f="";const h=Math.min(r.line+i.linesAfter,c.length).toString().length,p=i.maxLength-(i.indent+h+3);for(let k=1;k<=i.linesBefore&&!(d-k<0);k++){const w=t(r.buffer,l[d-k],c[d-k],r.position-(l[d]-l[d-k]),p);f=e.repeat(" ",i.indent)+n((r.line-k+1).toString(),h)+" | "+w.str+`
563
+ `+f}const m=t(r.buffer,l[d],c[d],r.position,p);f+=e.repeat(" ",i.indent)+n((r.line+1).toString(),h)+" | "+m.str+`
564
+ `,f+=e.repeat("-",i.indent+h+3+m.pos)+`^
565
+ `;for(let k=1;k<=i.linesAfter&&!(d+k>=c.length);k++){const w=t(r.buffer,l[d+k],c[d+k],r.position-(l[d]-l[d+k]),p);f+=e.repeat(" ",i.indent)+n((r.line+k+1).toString(),h)+" | "+w.str+`
566
+ `}return f.replace(/\n$/,"")}return N0=s,N0}var E0,I_;function ls(){if(I_)return E0;I_=1;const e=hf(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],n=["scalar","sequence","mapping"];function s(i){const a={};return i!==null&&Object.keys(i).forEach(function(l){i[l].forEach(function(c){a[String(c)]=l})}),a}function r(i,a){if(a=a||{},Object.keys(a).forEach(function(l){if(t.indexOf(l)===-1)throw new e('Unknown option "'+l+'" is met in definition of "'+i+'" YAML type.')}),this.options=a,this.tag=i,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(l){return l},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=s(a.styleAliases||null),n.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+i+'" YAML type.')}return E0=r,E0}var _0,L_;function AO(){if(L_)return _0;L_=1;const e=hf(),t=ls();function n(i,a){const l=[];return i[a].forEach(function(c){let u=l.length;l.forEach(function(d,f){d.tag===c.tag&&d.kind===c.kind&&d.multi===c.multi&&(u=f)}),l[u]=c}),l}function s(){const i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(l){l.multi?(i.multi[l.kind].push(l),i.multi.fallback.push(l)):i[l.kind][l.tag]=i.fallback[l.tag]=l}for(let l=0,c=arguments.length;l<c;l+=1)arguments[l].forEach(a);return i}function r(i){return this.extend(i)}return r.prototype.extend=function(a){let l=[],c=[];if(a instanceof t)c.push(a);else if(Array.isArray(a))c=c.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(l=l.concat(a.implicit)),a.explicit&&(c=c.concat(a.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");l.forEach(function(d){if(!(d instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(d.loadKind&&d.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(d.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),c.forEach(function(d){if(!(d instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const u=Object.create(r.prototype);return u.implicit=(this.implicit||[]).concat(l),u.explicit=(this.explicit||[]).concat(c),u.compiledImplicit=n(u,"implicit"),u.compiledExplicit=n(u,"explicit"),u.compiledTypeMap=s(u.compiledImplicit,u.compiledExplicit),u},_0=r,_0}var C0,P_;function MO(){if(P_)return C0;P_=1;const e=ls();return C0=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),C0}var T0,z_;function jO(){if(z_)return T0;z_=1;const e=ls();return T0=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),T0}var A0,U_;function RO(){if(U_)return A0;U_=1;const e=ls();return A0=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),A0}var M0,F_;function OO(){if(F_)return M0;F_=1;const e=AO();return M0=new e({explicit:[MO(),jO(),RO()]}),M0}var j0,B_;function DO(){if(B_)return j0;B_=1;const e=ls();function t(r){if(r===null)return!0;const i=r.length;return i===1&&r==="~"||i===4&&(r==="null"||r==="Null"||r==="NULL")}function n(){return null}function s(r){return r===null}return j0=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:n,predicate:s,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),j0}var R0,H_;function IO(){if(H_)return R0;H_=1;const e=ls();function t(r){if(r===null)return!1;const i=r.length;return i===4&&(r==="true"||r==="True"||r==="TRUE")||i===5&&(r==="false"||r==="False"||r==="FALSE")}function n(r){return r==="true"||r==="True"||r==="TRUE"}function s(r){return Object.prototype.toString.call(r)==="[object Boolean]"}return R0=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:n,predicate:s,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE":"FALSE"},camelcase:function(r){return r?"True":"False"}},defaultStyle:"lowercase"}),R0}var O0,$_;function LO(){if($_)return O0;$_=1;const e=ff(),t=ls();function n(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}function s(u){return u>=48&&u<=55}function r(u){return u>=48&&u<=57}function i(u){if(u===null)return!1;const d=u.length;let f=0,h=!1;if(!d)return!1;let p=u[f];if((p==="-"||p==="+")&&(p=u[++f]),p==="0"){if(f+1===d)return!0;if(p=u[++f],p==="b"){for(f++;f<d;f++){if(p=u[f],p!=="0"&&p!=="1")return!1;h=!0}return h&&isFinite(a(u))}if(p==="x"){for(f++;f<d;f++){if(!n(u.charCodeAt(f)))return!1;h=!0}return h&&isFinite(a(u))}if(p==="o"){for(f++;f<d;f++){if(!s(u.charCodeAt(f)))return!1;h=!0}return h&&isFinite(a(u))}}for(;f<d;f++){if(!r(u.charCodeAt(f)))return!1;h=!0}return h?isFinite(a(u)):!1}function a(u){let d=u,f=1,h=d[0];if((h==="-"||h==="+")&&(h==="-"&&(f=-1),d=d.slice(1),h=d[0]),d==="0")return 0;if(h==="0"){if(d[1]==="b")return f*parseInt(d.slice(2),2);if(d[1]==="x")return f*parseInt(d.slice(2),16);if(d[1]==="o")return f*parseInt(d.slice(2),8)}return f*parseInt(d,10)}function l(u){return a(u)}function c(u){return Object.prototype.toString.call(u)==="[object Number]"&&u%1===0&&!e.isNegativeZero(u)}return O0=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:i,construct:l,predicate:c,represent:{binary:function(u){return u>=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},octal:function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},decimal:function(u){return u.toString(10)},hexadecimal:function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),O0}var D0,G_;function PO(){if(G_)return D0;G_=1;const e=ff(),t=ls(),n=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function r(u){return u===null||!n.test(u)?!1:isFinite(parseFloat(u,10))?!0:s.test(u)}function i(u){let d=u.toLowerCase();const f=d[0]==="-"?-1:1;return"+-".indexOf(d[0])>=0&&(d=d.slice(1)),d===".inf"?f===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:d===".nan"?NaN:f*parseFloat(d,10)}const a=/^[-+]?[0-9]+e/;function l(u,d){if(isNaN(u))switch(d){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(d){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(d){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(u))return"-0.0";const f=u.toString(10);return a.test(f)?f.replace("e",".e"):f}function c(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||e.isNegativeZero(u))}return D0=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:r,construct:i,predicate:c,represent:l,defaultStyle:"lowercase"}),D0}var I0,K_;function zO(){return K_||(K_=1,I0=OO().extend({implicit:[DO(),IO(),LO(),PO()]})),I0}var L0,q_;function UO(){return q_||(q_=1,L0=zO()),L0}var P0,Y_;function FO(){if(Y_)return P0;Y_=1;const e=ls(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function s(a){return a===null?!1:t.exec(a)!==null||n.exec(a)!==null}function r(a){let l=0,c=null,u=t.exec(a);if(u===null&&(u=n.exec(a)),u===null)throw new Error("Date resolve error");const d=+u[1],f=+u[2]-1,h=+u[3];if(!u[4])return new Date(Date.UTC(d,f,h));const p=+u[4],m=+u[5],k=+u[6];if(u[7]){for(l=u[7].slice(0,3);l.length<3;)l+="0";l=+l}if(u[9]){const g=+u[10],y=+(u[11]||0);c=(g*60+y)*6e4,u[9]==="-"&&(c=-c)}const w=new Date(Date.UTC(d,f,h,p,m,k,l));return c&&w.setTime(w.getTime()-c),w}function i(a){return a.toISOString()}return P0=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:s,construct:r,instanceOf:Date,represent:i}),P0}var z0,V_;function BO(){if(V_)return z0;V_=1;const e=ls();function t(n){return n==="<<"||n===null}return z0=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),z0}var U0,X_;function HO(){if(X_)return U0;X_=1;const e=ls(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
567
+ \r`;function n(a){if(a===null)return!1;let l=0;const c=a.length,u=t;for(let d=0;d<c;d++){const f=u.indexOf(a.charAt(d));if(!(f>64)){if(f<0)return!1;l+=6}}return l%8===0}function s(a){const l=a.replace(/[\r\n=]/g,""),c=l.length,u=t;let d=0;const f=[];for(let p=0;p<c;p++)p%4===0&&p&&(f.push(d>>16&255),f.push(d>>8&255),f.push(d&255)),d=d<<6|u.indexOf(l.charAt(p));const h=c%4*6;return h===0?(f.push(d>>16&255),f.push(d>>8&255),f.push(d&255)):h===18?(f.push(d>>10&255),f.push(d>>2&255)):h===12&&f.push(d>>4&255),new Uint8Array(f)}function r(a){let l="",c=0;const u=a.length,d=t;for(let h=0;h<u;h++)h%3===0&&h&&(l+=d[c>>18&63],l+=d[c>>12&63],l+=d[c>>6&63],l+=d[c&63]),c=(c<<8)+a[h];const f=u%3;return f===0?(l+=d[c>>18&63],l+=d[c>>12&63],l+=d[c>>6&63],l+=d[c&63]):f===2?(l+=d[c>>10&63],l+=d[c>>4&63],l+=d[c<<2&63],l+=d[64]):f===1&&(l+=d[c>>2&63],l+=d[c<<4&63],l+=d[64],l+=d[64]),l}function i(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return U0=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:s,predicate:i,represent:r}),U0}var F0,Q_;function $O(){if(Q_)return F0;Q_=1;const e=ls(),t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function s(i){if(i===null)return!0;const a={},l=i;for(let c=0,u=l.length;c<u;c+=1){const d=l[c];let f=!1;if(n.call(d)!=="[object Object]")return!1;let h;for(h in d)if(t.call(d,h))if(!f)f=!0;else return!1;if(!f||t.call(a,h))return!1;Object.defineProperty(a,h,{value:!0})}return!0}function r(i){return i!==null?i:[]}return F0=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:s,construct:r}),F0}var B0,W_;function GO(){if(W_)return B0;W_=1;const e=ls(),t=Object.prototype.toString;function n(r){if(r===null)return!0;const i=r,a=new Array(i.length);for(let l=0,c=i.length;l<c;l+=1){const u=i[l];if(t.call(u)!=="[object Object]")return!1;const d=Object.keys(u);if(d.length!==1)return!1;a[l]=[d[0],u[d[0]]]}return!0}function s(r){if(r===null)return[];const i=r,a=new Array(i.length);for(let l=0,c=i.length;l<c;l+=1){const u=i[l],d=Object.keys(u);a[l]=[d[0],u[d[0]]]}return a}return B0=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:s}),B0}var H0,Z_;function KO(){if(Z_)return H0;Z_=1;const e=ls(),t=Object.prototype.hasOwnProperty;function n(r){if(r===null)return!0;const i=r;for(const a in i)if(t.call(i,a)&&i[a]!==null)return!1;return!0}function s(r){return r!==null?r:{}}return H0=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:n,construct:s}),H0}var $0,J_;function sw(){return J_||(J_=1,$0=UO().extend({implicit:[FO(),BO()],explicit:[HO(),$O(),GO(),KO()]})),$0}var eC;function Hse(){if(eC)return ph;eC=1;const e=ff(),t=hf(),n=Bse(),s=sw(),r=Object.prototype.hasOwnProperty,i=1,a=2,l=3,c=4,u=1,d=2,f=3,h=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,p=/[\x85\u2028\u2029]/,m=/[,\[\]{}]/,k=/^(?:!|!!|![0-9A-Za-z-]+!)$/,w=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function g(v){return Object.prototype.toString.call(v)}function y(v){return v===10||v===13}function x(v){return v===9||v===32}function S(v){return v===9||v===32||v===10||v===13}function A(v){return v===44||v===91||v===93||v===123||v===125}function E(v){if(v>=48&&v<=57)return v-48;const Z=v|32;return Z>=97&&Z<=102?Z-97+10:-1}function M(v){return v===120?2:v===117?4:v===85?8:0}function j(v){return v>=48&&v<=57?v-48:-1}function O(v){switch(v){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
568
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function N(v){return v<=65535?String.fromCharCode(v):String.fromCharCode((v-65536>>10)+55296,(v-65536&1023)+56320)}function F(v,Z,fe){Z==="__proto__"?Object.defineProperty(v,Z,{configurable:!0,enumerable:!0,writable:!0,value:fe}):v[Z]=fe}const G=new Array(256),H=new Array(256);for(let v=0;v<256;v++)G[v]=O(v)?1:0,H[v]=O(v);function I(v,Z){this.input=v,this.filename=Z.filename||null,this.schema=Z.schema||s,this.onWarning=Z.onWarning||null,this.legacy=Z.legacy||!1,this.json=Z.json||!1,this.listener=Z.listener||null,this.maxDepth=typeof Z.maxDepth=="number"?Z.maxDepth:100,this.maxTotalMergeKeys=typeof Z.maxTotalMergeKeys=="number"?Z.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=v.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function L(v,Z){const fe={name:v.filename,buffer:v.input.slice(0,-1),position:v.position,line:v.line,column:v.position-v.lineStart};return fe.snippet=n(fe),new t(Z,fe)}function C(v,Z){throw L(v,Z)}function D(v,Z){v.onWarning&&v.onWarning.call(null,L(v,Z))}function U(v,Z,fe){const be=v.anchorMapTransactions;if(be.length!==0){const he=be[be.length-1];r.call(he,Z)||(he[Z]={existed:r.call(v.anchorMap,Z),value:v.anchorMap[Z]})}v.anchorMap[Z]=fe}function B(v){v.anchorMapTransactions.push(Object.create(null))}function R(v){const Z=v.anchorMapTransactions.pop(),fe=v.anchorMapTransactions;if(fe.length===0)return;const be=fe[fe.length-1],he=Object.keys(Z);for(let P=0,ce=he.length;P<ce;P+=1){const ue=he[P];r.call(be,ue)||(be[ue]=Z[ue])}}function _(v){const Z=v.anchorMapTransactions.pop(),fe=Object.keys(Z);for(let be=fe.length-1;be>=0;be-=1){const he=Z[fe[be]];he.existed?v.anchorMap[fe[be]]=he.value:delete v.anchorMap[fe[be]]}}function K(v){return{position:v.position,line:v.line,lineStart:v.lineStart,lineIndent:v.lineIndent,firstTabInLine:v.firstTabInLine,tag:v.tag,anchor:v.anchor,kind:v.kind,result:v.result}}function T(v,Z){v.position=Z.position,v.line=Z.line,v.lineStart=Z.lineStart,v.lineIndent=Z.lineIndent,v.firstTabInLine=Z.firstTabInLine,v.tag=Z.tag,v.anchor=Z.anchor,v.kind=Z.kind,v.result=Z.result}const X={YAML:function(Z,fe,be){Z.version!==null&&C(Z,"duplication of %YAML directive"),be.length!==1&&C(Z,"YAML directive accepts exactly one argument");const he=/^([0-9]+)\.([0-9]+)$/.exec(be[0]);he===null&&C(Z,"ill-formed argument of the YAML directive");const P=parseInt(he[1],10),ce=parseInt(he[2],10);P!==1&&C(Z,"unacceptable YAML version of the document"),Z.version=be[0],Z.checkLineBreaks=ce<2,ce!==1&&ce!==2&&D(Z,"unsupported YAML version of the document")},TAG:function(Z,fe,be){let he;be.length!==2&&C(Z,"TAG directive accepts exactly two arguments");const P=be[0];he=be[1],k.test(P)||C(Z,"ill-formed tag handle (first argument) of the TAG directive"),r.call(Z.tagMap,P)&&C(Z,'there is a previously declared suffix for "'+P+'" tag handle'),w.test(he)||C(Z,"ill-formed tag prefix (second argument) of the TAG directive");try{he=decodeURIComponent(he)}catch{C(Z,"tag prefix is malformed: "+he)}Z.tagMap[P]=he}};function ne(v,Z,fe,be){if(Z<fe){const he=v.input.slice(Z,fe);if(be)for(let P=0,ce=he.length;P<ce;P+=1){const ue=he.charCodeAt(P);ue===9||ue>=32&&ue<=1114111||C(v,"expected valid JSON character")}else h.test(he)&&C(v,"the stream contains non-printable characters");v.result+=he}}function J(v){v.totalMergeKeys++,v.maxTotalMergeKeys!==-1&&v.totalMergeKeys>v.maxTotalMergeKeys&&C(v,"merge keys exceeded maxTotalMergeKeys ("+v.maxTotalMergeKeys+")")}function pe(v,Z,fe,be){e.isObject(fe)||C(v,"cannot merge mappings; the provided source object is unacceptable"),J(v);const he=Object.keys(fe);for(let P=0,ce=he.length;P<ce;P+=1){const ue=he[P];J(v),r.call(Z,ue)||(F(Z,ue,fe[ue]),be[ue]=!0)}}function q(v,Z,fe,be,he,P,ce,ue,_e){if(Array.isArray(he)){he=Array.prototype.slice.call(he);for(let ke=0,we=he.length;ke<we;ke+=1)Array.isArray(he[ke])&&C(v,"nested arrays are not supported inside keys"),typeof he=="object"&&g(he[ke])==="[object Object]"&&(he[ke]="[object Object]")}if(typeof he=="object"&&g(he)==="[object Object]"&&(he="[object Object]"),he=String(he),Z===null&&(Z={}),be==="tag:yaml.org,2002:merge")if(Array.isArray(P)){P.length>100&&C(v,"abnormal merge sequence size");for(let ke=0,we=P.length;ke<we;ke+=1)pe(v,Z,P[ke],fe)}else pe(v,Z,P,fe);else!v.json&&!r.call(fe,he)&&r.call(Z,he)&&(v.line=ce||v.line,v.lineStart=ue||v.lineStart,v.position=_e||v.position,C(v,"duplicated mapping key")),F(Z,he,P),delete fe[he];return Z}function Y(v){const Z=v.input.charCodeAt(v.position);Z===10?v.position++:Z===13?(v.position++,v.input.charCodeAt(v.position)===10&&v.position++):C(v,"a line break is expected"),v.line+=1,v.lineStart=v.position,v.firstTabInLine=-1}function V(v,Z,fe){let be=0,he=v.input.charCodeAt(v.position);for(;he!==0;){for(;x(he);)he===9&&v.firstTabInLine===-1&&(v.firstTabInLine=v.position),he=v.input.charCodeAt(++v.position);if(Z&&he===35)do he=v.input.charCodeAt(++v.position);while(he!==10&&he!==13&&he!==0);if(y(he))for(Y(v),he=v.input.charCodeAt(v.position),be++,v.lineIndent=0;he===32;)v.lineIndent++,he=v.input.charCodeAt(++v.position);else break}return fe!==-1&&be!==0&&v.lineIndent<fe&&D(v,"deficient indentation"),be}function ee(v){let Z=v.position,fe=v.input.charCodeAt(Z);return!!((fe===45||fe===46)&&fe===v.input.charCodeAt(Z+1)&&fe===v.input.charCodeAt(Z+2)&&(Z+=3,fe=v.input.charCodeAt(Z),fe===0||S(fe)))}function oe(v,Z){Z===1?v.result+=" ":Z>1&&(v.result+=e.repeat(`
569
+ `,Z-1))}function ye(v,Z,fe){let be,he,P,ce,ue,_e;const ke=v.kind,we=v.result;let Ne=v.input.charCodeAt(v.position);if(S(Ne)||A(Ne)||Ne===35||Ne===38||Ne===42||Ne===33||Ne===124||Ne===62||Ne===39||Ne===34||Ne===37||Ne===64||Ne===96)return!1;if(Ne===63||Ne===45){const Oe=v.input.charCodeAt(v.position+1);if(S(Oe)||fe&&A(Oe))return!1}for(v.kind="scalar",v.result="",be=he=v.position,P=!1;Ne!==0;){if(Ne===58){const Oe=v.input.charCodeAt(v.position+1);if(S(Oe)||fe&&A(Oe))break}else if(Ne===35){const Oe=v.input.charCodeAt(v.position-1);if(S(Oe))break}else{if(v.position===v.lineStart&&ee(v)||fe&&A(Ne))break;if(y(Ne))if(ce=v.line,ue=v.lineStart,_e=v.lineIndent,V(v,!1,-1),v.lineIndent>=Z){P=!0,Ne=v.input.charCodeAt(v.position);continue}else{v.position=he,v.line=ce,v.lineStart=ue,v.lineIndent=_e;break}}P&&(ne(v,be,he,!1),oe(v,v.line-ce),be=he=v.position,P=!1),x(Ne)||(he=v.position+1),Ne=v.input.charCodeAt(++v.position)}return ne(v,be,he,!1),v.result?!0:(v.kind=ke,v.result=we,!1)}function Re(v,Z){let fe,be,he=v.input.charCodeAt(v.position);if(he!==39)return!1;for(v.kind="scalar",v.result="",v.position++,fe=be=v.position;(he=v.input.charCodeAt(v.position))!==0;)if(he===39)if(ne(v,fe,v.position,!0),he=v.input.charCodeAt(++v.position),he===39)fe=v.position,v.position++,be=v.position;else return!0;else y(he)?(ne(v,fe,be,!0),oe(v,V(v,!1,Z)),fe=be=v.position):v.position===v.lineStart&&ee(v)?C(v,"unexpected end of the document within a single quoted scalar"):(v.position++,x(he)||(be=v.position));C(v,"unexpected end of the stream within a single quoted scalar")}function se(v,Z){let fe,be,he,P=v.input.charCodeAt(v.position);if(P!==34)return!1;for(v.kind="scalar",v.result="",v.position++,fe=be=v.position;(P=v.input.charCodeAt(v.position))!==0;){if(P===34)return ne(v,fe,v.position,!0),v.position++,!0;if(P===92){if(ne(v,fe,v.position,!0),P=v.input.charCodeAt(++v.position),y(P))V(v,!1,Z);else if(P<256&&G[P])v.result+=H[P],v.position++;else if((he=M(P))>0){let ce=he,ue=0;for(;ce>0;ce--)P=v.input.charCodeAt(++v.position),(he=E(P))>=0?ue=(ue<<4)+he:C(v,"expected hexadecimal character");v.result+=N(ue),v.position++}else C(v,"unknown escape sequence");fe=be=v.position}else y(P)?(ne(v,fe,be,!0),oe(v,V(v,!1,Z)),fe=be=v.position):v.position===v.lineStart&&ee(v)?C(v,"unexpected end of the document within a double quoted scalar"):(v.position++,x(P)||(be=v.position))}C(v,"unexpected end of the stream within a double quoted scalar")}function Q(v,Z){let fe=!0,be,he,P;const ce=v.tag;let ue;const _e=v.anchor;let ke,we,Ne,Oe;const Me=Object.create(null);let Fe,De,He,Ge=v.input.charCodeAt(v.position);if(Ge===91)ke=93,Oe=!1,ue=[];else if(Ge===123)ke=125,Oe=!0,ue={};else return!1;for(v.anchor!==null&&U(v,v.anchor,ue),Ge=v.input.charCodeAt(++v.position);Ge!==0;){if(V(v,!0,Z),Ge=v.input.charCodeAt(v.position),Ge===ke)return v.position++,v.tag=ce,v.anchor=_e,v.kind=Oe?"mapping":"sequence",v.result=ue,!0;if(fe?Ge===44&&C(v,"expected the node content, but found ','"):C(v,"missed comma between flow collection entries"),De=Fe=He=null,we=Ne=!1,Ge===63){const ft=v.input.charCodeAt(v.position+1);S(ft)&&(we=Ne=!0,v.position++,V(v,!0,Z))}be=v.line,he=v.lineStart,P=v.position,rt(v,Z,i,!1,!0),De=v.tag,Fe=v.result,V(v,!0,Z),Ge=v.input.charCodeAt(v.position),(Ne||v.line===be)&&Ge===58&&(we=!0,Ge=v.input.charCodeAt(++v.position),V(v,!0,Z),rt(v,Z,i,!1,!0),He=v.result),Oe?q(v,ue,Me,De,Fe,He,be,he,P):we?ue.push(q(v,null,Me,De,Fe,He,be,he,P)):ue.push(Fe),V(v,!0,Z),Ge=v.input.charCodeAt(v.position),Ge===44?(fe=!0,Ge=v.input.charCodeAt(++v.position)):fe=!1}C(v,"unexpected end of the stream within a flow collection")}function Te(v,Z){let fe,be=u,he=!1,P=!1,ce=Z,ue=0,_e=!1,ke,we=v.input.charCodeAt(v.position);if(we===124)fe=!1;else if(we===62)fe=!0;else return!1;for(v.kind="scalar",v.result="";we!==0;)if(we=v.input.charCodeAt(++v.position),we===43||we===45)u===be?be=we===43?f:d:C(v,"repeat of a chomping mode identifier");else if((ke=j(we))>=0)ke===0?C(v,"bad explicit indentation width of a block scalar; it cannot be less than one"):P?C(v,"repeat of an indentation width identifier"):(ce=Z+ke-1,P=!0);else break;if(x(we)){do we=v.input.charCodeAt(++v.position);while(x(we));if(we===35)do we=v.input.charCodeAt(++v.position);while(!y(we)&&we!==0)}for(;we!==0;){for(Y(v),v.lineIndent=0,we=v.input.charCodeAt(v.position);(!P||v.lineIndent<ce)&&we===32;)v.lineIndent++,we=v.input.charCodeAt(++v.position);if(!P&&v.lineIndent>ce&&(ce=v.lineIndent),y(we)){ue++;continue}if(!P&&ce===0&&C(v,"missing indentation for block scalar"),v.lineIndent<ce){be===f?v.result+=e.repeat(`
570
+ `,he?1+ue:ue):be===u&&he&&(v.result+=`
571
+ `);break}fe?x(we)?(_e=!0,v.result+=e.repeat(`
572
+ `,he?1+ue:ue)):_e?(_e=!1,v.result+=e.repeat(`
573
+ `,ue+1)):ue===0?he&&(v.result+=" "):v.result+=e.repeat(`
574
+ `,ue):v.result+=e.repeat(`
575
+ `,he?1+ue:ue),he=!0,P=!0,ue=0;const Ne=v.position;for(;!y(we)&&we!==0;)we=v.input.charCodeAt(++v.position);ne(v,Ne,v.position,!1)}return!0}function xe(v,Z){const fe=v.tag,be=v.anchor,he=[];let P=!1;if(v.firstTabInLine!==-1)return!1;v.anchor!==null&&U(v,v.anchor,he);let ce=v.input.charCodeAt(v.position);for(;ce!==0&&(v.firstTabInLine!==-1&&(v.position=v.firstTabInLine,C(v,"tab characters must not be used in indentation")),ce===45);){const ue=v.input.charCodeAt(v.position+1);if(!S(ue))break;if(P=!0,v.position++,V(v,!0,-1)&&v.lineIndent<=Z){he.push(null),ce=v.input.charCodeAt(v.position);continue}const _e=v.line;if(rt(v,Z,l,!1,!0),he.push(v.result),V(v,!0,-1),ce=v.input.charCodeAt(v.position),(v.line===_e||v.lineIndent>Z)&&ce!==0)C(v,"bad indentation of a sequence entry");else if(v.lineIndent<Z)break}return P?(v.tag=fe,v.anchor=be,v.kind="sequence",v.result=he,!0):!1}function ve(v,Z,fe){let be,he,P,ce;const ue=v.tag,_e=v.anchor,ke={},we=Object.create(null);let Ne=null,Oe=null,Me=null,Fe=!1,De=!1;if(v.firstTabInLine!==-1)return!1;v.anchor!==null&&U(v,v.anchor,ke);let He=v.input.charCodeAt(v.position);for(;He!==0;){!Fe&&v.firstTabInLine!==-1&&(v.position=v.firstTabInLine,C(v,"tab characters must not be used in indentation"));const Ge=v.input.charCodeAt(v.position+1),ft=v.line;if((He===63||He===58)&&S(Ge))He===63?(Fe&&(q(v,ke,we,Ne,Oe,null,he,P,ce),Ne=Oe=Me=null),De=!0,Fe=!0,be=!0):Fe?(Fe=!1,be=!0):C(v,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),v.position+=1,He=Ge;else{if(he=v.line,P=v.lineStart,ce=v.position,!rt(v,fe,a,!1,!0))break;if(v.line===ft){for(He=v.input.charCodeAt(v.position);x(He);)He=v.input.charCodeAt(++v.position);if(He===58)He=v.input.charCodeAt(++v.position),S(He)||C(v,"a whitespace character is expected after the key-value separator within a block mapping"),Fe&&(q(v,ke,we,Ne,Oe,null,he,P,ce),Ne=Oe=Me=null),De=!0,Fe=!1,be=!1,Ne=v.tag,Oe=v.result;else if(De)C(v,"can not read an implicit mapping pair; a colon is missed");else return v.tag=ue,v.anchor=_e,!0}else if(De)C(v,"can not read a block mapping entry; a multiline key may not be an implicit key");else return v.tag=ue,v.anchor=_e,!0}if((v.line===ft||v.lineIndent>Z)&&(Fe&&(he=v.line,P=v.lineStart,ce=v.position),rt(v,Z,c,!0,be)&&(Fe?Oe=v.result:Me=v.result),Fe||(q(v,ke,we,Ne,Oe,Me,he,P,ce),Ne=Oe=Me=null),V(v,!0,-1),He=v.input.charCodeAt(v.position)),(v.line===ft||v.lineIndent>Z)&&He!==0)C(v,"bad indentation of a mapping entry");else if(v.lineIndent<Z)break}return Fe&&q(v,ke,we,Ne,Oe,null,he,P,ce),De&&(v.tag=ue,v.anchor=_e,v.kind="mapping",v.result=ke),De}function ge(v){let Z=!1,fe=!1,be,he,P=v.input.charCodeAt(v.position);if(P!==33)return!1;v.tag!==null&&C(v,"duplication of a tag property"),P=v.input.charCodeAt(++v.position),P===60?(Z=!0,P=v.input.charCodeAt(++v.position)):P===33?(fe=!0,be="!!",P=v.input.charCodeAt(++v.position)):be="!";let ce=v.position;if(Z){do P=v.input.charCodeAt(++v.position);while(P!==0&&P!==62);v.position<v.length?(he=v.input.slice(ce,v.position),P=v.input.charCodeAt(++v.position)):C(v,"unexpected end of the stream within a verbatim tag")}else{for(;P!==0&&!S(P);)P===33&&(fe?C(v,"tag suffix cannot contain exclamation marks"):(be=v.input.slice(ce-1,v.position+1),k.test(be)||C(v,"named tag handle cannot contain such characters"),fe=!0,ce=v.position+1)),P=v.input.charCodeAt(++v.position);he=v.input.slice(ce,v.position),m.test(he)&&C(v,"tag suffix cannot contain flow indicator characters")}he&&!w.test(he)&&C(v,"tag name cannot contain such characters: "+he);try{he=decodeURIComponent(he)}catch{C(v,"tag name is malformed: "+he)}return Z?v.tag=he:r.call(v.tagMap,be)?v.tag=v.tagMap[be]+he:be==="!"?v.tag="!"+he:be==="!!"?v.tag="tag:yaml.org,2002:"+he:C(v,'undeclared tag handle "'+be+'"'),!0}function $e(v){let Z=v.input.charCodeAt(v.position);if(Z!==38)return!1;v.anchor!==null&&C(v,"duplication of an anchor property"),Z=v.input.charCodeAt(++v.position);const fe=v.position;for(;Z!==0&&!S(Z)&&!A(Z);)Z=v.input.charCodeAt(++v.position);return v.position===fe&&C(v,"name of an anchor node must contain at least one character"),v.anchor=v.input.slice(fe,v.position),!0}function dt(v){let Z=v.input.charCodeAt(v.position);if(Z!==42)return!1;Z=v.input.charCodeAt(++v.position);const fe=v.position;for(;Z!==0&&!S(Z)&&!A(Z);)Z=v.input.charCodeAt(++v.position);v.position===fe&&C(v,"name of an alias node must contain at least one character");const be=v.input.slice(fe,v.position);return r.call(v.anchorMap,be)||C(v,'unidentified alias "'+be+'"'),v.result=v.anchorMap[be],V(v,!0,-1),!0}function mt(v,Z,fe,be){const he=K(v);return B(v),T(v,Z),v.tag=null,v.anchor=null,v.kind=null,v.result=null,ve(v,fe,be)&&v.kind==="mapping"?(R(v),!0):(_(v),T(v,he),!1)}function rt(v,Z,fe,be,he){let P,ce,ue=1,_e=!1,ke=!1,we=null,Ne,Oe,Me;v.depth>=v.maxDepth&&C(v,"nesting exceeded maxDepth ("+v.maxDepth+")"),v.depth+=1,v.listener!==null&&v.listener("open",v),v.tag=null,v.anchor=null,v.kind=null,v.result=null;const Fe=P=ce=c===fe||l===fe;if(be&&V(v,!0,-1)&&(_e=!0,v.lineIndent>Z?ue=1:v.lineIndent===Z?ue=0:v.lineIndent<Z&&(ue=-1)),ue===1)for(;;){const De=v.input.charCodeAt(v.position),He=K(v);if(_e&&(De===33&&v.tag!==null||De===38&&v.anchor!==null)||!ge(v)&&!$e(v))break;we===null&&(we=He),V(v,!0,-1)?(_e=!0,ce=Fe,v.lineIndent>Z?ue=1:v.lineIndent===Z?ue=0:v.lineIndent<Z&&(ue=-1)):ce=!1}if(ce&&(ce=_e||he),ue===1||c===fe)if(i===fe||a===fe?Oe=Z:Oe=Z+1,Me=v.position-v.lineStart,ue===1)if(ce&&(xe(v,Me)||ve(v,Me,Oe))||Q(v,Oe))ke=!0;else{const De=v.input.charCodeAt(v.position);we!==null&&Fe&&!ce&&De!==124&&De!==62&&mt(v,we,we.position-we.lineStart,Oe)||P&&Te(v,Oe)||Re(v,Oe)||se(v,Oe)?ke=!0:dt(v)?(ke=!0,(v.tag!==null||v.anchor!==null)&&C(v,"alias node should not have any properties")):ye(v,Oe,i===fe)&&(ke=!0,v.tag===null&&(v.tag="?")),v.anchor!==null&&U(v,v.anchor,v.result)}else ue===0&&(ke=ce&&xe(v,Me));if(v.tag===null)v.anchor!==null&&U(v,v.anchor,v.result);else if(v.tag==="?"){v.result!==null&&v.kind!=="scalar"&&C(v,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+v.kind+'"');for(let De=0,He=v.implicitTypes.length;De<He;De+=1)if(Ne=v.implicitTypes[De],Ne.resolve(v.result)){v.result=Ne.construct(v.result),v.tag=Ne.tag,v.anchor!==null&&U(v,v.anchor,v.result);break}}else if(v.tag!=="!"){if(r.call(v.typeMap[v.kind||"fallback"],v.tag))Ne=v.typeMap[v.kind||"fallback"][v.tag];else{Ne=null;const De=v.typeMap.multi[v.kind||"fallback"];for(let He=0,Ge=De.length;He<Ge;He+=1)if(v.tag.slice(0,De[He].tag.length)===De[He].tag){Ne=De[He];break}}Ne||C(v,"unknown tag !<"+v.tag+">"),v.result!==null&&Ne.kind!==v.kind&&C(v,"unacceptable node kind for !<"+v.tag+'> tag; it should be "'+Ne.kind+'", not "'+v.kind+'"'),Ne.resolve(v.result,v.tag)?(v.result=Ne.construct(v.result,v.tag),v.anchor!==null&&U(v,v.anchor,v.result)):C(v,"cannot resolve a node with !<"+v.tag+"> explicit tag")}return v.listener!==null&&v.listener("close",v),v.depth-=1,v.tag!==null||v.anchor!==null||ke}function ct(v){const Z=v.position;let fe=!1,be;for(v.version=null,v.checkLineBreaks=v.legacy,v.tagMap=Object.create(null),v.anchorMap=Object.create(null);(be=v.input.charCodeAt(v.position))!==0&&(V(v,!0,-1),be=v.input.charCodeAt(v.position),!(v.lineIndent>0||be!==37));){fe=!0,be=v.input.charCodeAt(++v.position);let he=v.position;for(;be!==0&&!S(be);)be=v.input.charCodeAt(++v.position);const P=v.input.slice(he,v.position),ce=[];for(P.length<1&&C(v,"directive name must not be less than one character in length");be!==0;){for(;x(be);)be=v.input.charCodeAt(++v.position);if(be===35){do be=v.input.charCodeAt(++v.position);while(be!==0&&!y(be));break}if(y(be))break;for(he=v.position;be!==0&&!S(be);)be=v.input.charCodeAt(++v.position);ce.push(v.input.slice(he,v.position))}be!==0&&Y(v),r.call(X,P)?X[P](v,P,ce):D(v,'unknown document directive "'+P+'"')}if(V(v,!0,-1),v.lineIndent===0&&v.input.charCodeAt(v.position)===45&&v.input.charCodeAt(v.position+1)===45&&v.input.charCodeAt(v.position+2)===45?(v.position+=3,V(v,!0,-1)):fe&&C(v,"directives end mark is expected"),rt(v,v.lineIndent-1,c,!1,!0),V(v,!0,-1),v.checkLineBreaks&&p.test(v.input.slice(Z,v.position))&&D(v,"non-ASCII line breaks are interpreted as content"),v.documents.push(v.result),v.position===v.lineStart&&ee(v)){v.input.charCodeAt(v.position)===46&&(v.position+=3,V(v,!0,-1));return}v.position<v.length-1&&C(v,"end of the stream or a document separator is expected")}function te(v,Z){v=String(v),Z=Z||{},v.length!==0&&(v.charCodeAt(v.length-1)!==10&&v.charCodeAt(v.length-1)!==13&&(v+=`
576
+ `),v.charCodeAt(0)===65279&&(v=v.slice(1)));const fe=new I(v,Z),be=v.indexOf("\0");for(be!==-1&&(fe.position=be,C(fe,"null byte is not allowed in input")),fe.input+="\0";fe.input.charCodeAt(fe.position)===32;)fe.lineIndent+=1,fe.position+=1;for(;fe.position<fe.length-1;)ct(fe);return fe.documents}function re(v,Z,fe){Z!==null&&typeof Z=="object"&&typeof fe>"u"&&(fe=Z,Z=null);const be=te(v,fe);if(typeof Z!="function")return be;for(let he=0,P=be.length;he<P;he+=1)Z(be[he])}function Ae(v,Z){const fe=te(v,Z);if(fe.length!==0){if(fe.length===1)return fe[0];throw new t("expected a single document in the stream, but found more")}}return ph.loadAll=re,ph.load=Ae,ph}var G0={},tC;function $se(){if(tC)return G0;tC=1;const e=ff(),t=hf(),n=sw(),s=Object.prototype.toString,r=Object.prototype.hasOwnProperty,i=65279,a=9,l=10,c=13,u=32,d=33,f=34,h=35,p=37,m=38,k=39,w=42,g=44,y=45,x=58,S=61,A=62,E=63,M=64,j=91,O=93,N=96,F=123,G=124,H=125,I={};I[0]="\\0",I[7]="\\a",I[8]="\\b",I[9]="\\t",I[10]="\\n",I[11]="\\v",I[12]="\\f",I[13]="\\r",I[27]="\\e",I[34]='\\"',I[92]="\\\\",I[133]="\\N",I[160]="\\_",I[8232]="\\L",I[8233]="\\P";const L=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],C=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function D(P,ce){if(ce===null)return{};const ue={},_e=Object.keys(ce);for(let ke=0,we=_e.length;ke<we;ke+=1){let Ne=_e[ke],Oe=String(ce[Ne]);Ne.slice(0,2)==="!!"&&(Ne="tag:yaml.org,2002:"+Ne.slice(2));const Me=P.compiledTypeMap.fallback[Ne];Me&&r.call(Me.styleAliases,Oe)&&(Oe=Me.styleAliases[Oe]),ue[Ne]=Oe}return ue}function U(P){let ce,ue;const _e=P.toString(16).toUpperCase();if(P<=255)ce="x",ue=2;else if(P<=65535)ce="u",ue=4;else if(P<=4294967295)ce="U",ue=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+ce+e.repeat("0",ue-_e.length)+_e}const B=1,R=2;function _(P){this.schema=P.schema||n,this.indent=Math.max(1,P.indent||2),this.noArrayIndent=P.noArrayIndent||!1,this.skipInvalid=P.skipInvalid||!1,this.flowLevel=e.isNothing(P.flowLevel)?-1:P.flowLevel,this.styleMap=D(this.schema,P.styles||null),this.sortKeys=P.sortKeys||!1,this.lineWidth=P.lineWidth||80,this.noRefs=P.noRefs||!1,this.noCompatMode=P.noCompatMode||!1,this.condenseFlow=P.condenseFlow||!1,this.quotingType=P.quotingType==='"'?R:B,this.forceQuotes=P.forceQuotes||!1,this.replacer=typeof P.replacer=="function"?P.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function K(P,ce){const ue=e.repeat(" ",ce);let _e=0,ke="";const we=P.length;for(;_e<we;){let Ne;const Oe=P.indexOf(`
577
+ `,_e);Oe===-1?(Ne=P.slice(_e),_e=we):(Ne=P.slice(_e,Oe+1),_e=Oe+1),Ne.length&&Ne!==`
578
+ `&&(ke+=ue),ke+=Ne}return ke}function T(P,ce){return`
579
+ `+e.repeat(" ",P.indent*ce)}function X(P,ce){for(let ue=0,_e=P.implicitTypes.length;ue<_e;ue+=1)if(P.implicitTypes[ue].resolve(ce))return!0;return!1}function ne(P){return P===u||P===a}function J(P){return P>=32&&P<=126||P>=161&&P<=55295&&P!==8232&&P!==8233||P>=57344&&P<=65533&&P!==i||P>=65536&&P<=1114111}function pe(P){return J(P)&&P!==i&&P!==c&&P!==l}function q(P,ce,ue){const _e=pe(P),ke=_e&&!ne(P);return(ue?_e:_e&&P!==g&&P!==j&&P!==O&&P!==F&&P!==H)&&P!==h&&!(ce===x&&!ke)||pe(ce)&&!ne(ce)&&P===h||ce===x&&ke}function Y(P){return J(P)&&P!==i&&!ne(P)&&P!==y&&P!==E&&P!==x&&P!==g&&P!==j&&P!==O&&P!==F&&P!==H&&P!==h&&P!==m&&P!==w&&P!==d&&P!==G&&P!==S&&P!==A&&P!==k&&P!==f&&P!==p&&P!==M&&P!==N}function V(P){return!ne(P)&&P!==x}function ee(P,ce){const ue=P.charCodeAt(ce);let _e;return ue>=55296&&ue<=56319&&ce+1<P.length&&(_e=P.charCodeAt(ce+1),_e>=56320&&_e<=57343)?(ue-55296)*1024+_e-56320+65536:ue}function oe(P){return/^\n* /.test(P)}const ye=1,Re=2,se=3,Q=4,Te=5;function xe(P,ce,ue,_e,ke,we,Ne,Oe){let Me,Fe=0,De=null,He=!1,Ge=!1;const ft=_e!==-1;let St=-1,Nt=Y(ee(P,0))&&V(ee(P,P.length-1));if(ce||Ne)for(Me=0;Me<P.length;Fe>=65536?Me+=2:Me++){if(Fe=ee(P,Me),!J(Fe))return Te;Nt=Nt&&q(Fe,De,Oe),De=Fe}else{for(Me=0;Me<P.length;Fe>=65536?Me+=2:Me++){if(Fe=ee(P,Me),Fe===l)He=!0,ft&&(Ge=Ge||Me-St-1>_e&&P[St+1]!==" ",St=Me);else if(!J(Fe))return Te;Nt=Nt&&q(Fe,De,Oe),De=Fe}Ge=Ge||ft&&Me-St-1>_e&&P[St+1]!==" "}return!He&&!Ge?Nt&&!Ne&&!ke(P)?ye:we===R?Te:Re:ue>9&&oe(P)?Te:Ne?we===R?Te:Re:Ge?Q:se}function ve(P,ce,ue,_e,ke){P.dump=function(){if(ce.length===0)return P.quotingType===R?'""':"''";if(!P.noCompatMode&&(L.indexOf(ce)!==-1||C.test(ce)))return P.quotingType===R?'"'+ce+'"':"'"+ce+"'";const we=P.indent*Math.max(1,ue),Ne=P.lineWidth===-1?-1:Math.max(Math.min(P.lineWidth,40),P.lineWidth-we),Oe=_e||P.flowLevel>-1&&ue>=P.flowLevel;function Me(Fe){return X(P,Fe)}switch(xe(ce,Oe,P.indent,Ne,Me,P.quotingType,P.forceQuotes&&!_e,ke)){case ye:return ce;case Re:return"'"+ce.replace(/'/g,"''")+"'";case se:return"|"+ge(ce,P.indent)+$e(K(ce,we));case Q:return">"+ge(ce,P.indent)+$e(K(dt(ce,Ne),we));case Te:return'"'+rt(ce)+'"';default:throw new t("impossible error: invalid scalar style")}}()}function ge(P,ce){const ue=oe(P)?String(ce):"",_e=P[P.length-1]===`
580
+ `,we=_e&&(P[P.length-2]===`
581
+ `||P===`
582
+ `)?"+":_e?"":"-";return ue+we+`
583
+ `}function $e(P){return P[P.length-1]===`
584
+ `?P.slice(0,-1):P}function dt(P,ce){const ue=/(\n+)([^\n]*)/g;let _e=function(){let Oe=P.indexOf(`
585
+ `);return Oe=Oe!==-1?Oe:P.length,ue.lastIndex=Oe,mt(P.slice(0,Oe),ce)}(),ke=P[0]===`
586
+ `||P[0]===" ",we,Ne;for(;Ne=ue.exec(P);){const Oe=Ne[1],Me=Ne[2];we=Me[0]===" ",_e+=Oe+(!ke&&!we&&Me!==""?`
587
+ `:"")+mt(Me,ce),ke=we}return _e}function mt(P,ce){if(P===""||P[0]===" ")return P;const ue=/ [^ ]/g;let _e,ke=0,we,Ne=0,Oe=0,Me="";for(;_e=ue.exec(P);)Oe=_e.index,Oe-ke>ce&&(we=Ne>ke?Ne:Oe,Me+=`
588
+ `+P.slice(ke,we),ke=we+1),Ne=Oe;return Me+=`
589
+ `,P.length-ke>ce&&Ne>ke?Me+=P.slice(ke,Ne)+`
590
+ `+P.slice(Ne+1):Me+=P.slice(ke),Me.slice(1)}function rt(P){let ce="",ue=0;for(let _e=0;_e<P.length;ue>=65536?_e+=2:_e++){ue=ee(P,_e);const ke=I[ue];!ke&&J(ue)?(ce+=P[_e],ue>=65536&&(ce+=P[_e+1])):ce+=ke||U(ue)}return ce}function ct(P,ce,ue){let _e="";const ke=P.tag;for(let we=0,Ne=ue.length;we<Ne;we+=1){let Oe=ue[we];P.replacer&&(Oe=P.replacer.call(ue,String(we),Oe)),(Z(P,ce,Oe,!1,!1)||typeof Oe>"u"&&Z(P,ce,null,!1,!1))&&(_e!==""&&(_e+=","+(P.condenseFlow?"":" ")),_e+=P.dump)}P.tag=ke,P.dump="["+_e+"]"}function te(P,ce,ue,_e){let ke="";const we=P.tag;for(let Ne=0,Oe=ue.length;Ne<Oe;Ne+=1){let Me=ue[Ne];P.replacer&&(Me=P.replacer.call(ue,String(Ne),Me)),(Z(P,ce+1,Me,!0,!0,!1,!0)||typeof Me>"u"&&Z(P,ce+1,null,!0,!0,!1,!0))&&((!_e||ke!=="")&&(ke+=T(P,ce)),P.dump&&l===P.dump.charCodeAt(0)?ke+="-":ke+="- ",ke+=P.dump)}P.tag=we,P.dump=ke||"[]"}function re(P,ce,ue){let _e="";const ke=P.tag,we=Object.keys(ue);for(let Ne=0,Oe=we.length;Ne<Oe;Ne+=1){let Me="";_e!==""&&(Me+=", "),P.condenseFlow&&(Me+='"');const Fe=we[Ne];let De=ue[Fe];P.replacer&&(De=P.replacer.call(ue,Fe,De)),Z(P,ce,Fe,!1,!1)&&(P.dump.length>1024&&(Me+="? "),Me+=P.dump+(P.condenseFlow?'"':"")+":"+(P.condenseFlow?"":" "),Z(P,ce,De,!1,!1)&&(Me+=P.dump,_e+=Me))}P.tag=ke,P.dump="{"+_e+"}"}function Ae(P,ce,ue,_e){let ke="";const we=P.tag,Ne=Object.keys(ue);if(P.sortKeys===!0)Ne.sort();else if(typeof P.sortKeys=="function")Ne.sort(P.sortKeys);else if(P.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let Oe=0,Me=Ne.length;Oe<Me;Oe+=1){let Fe="";(!_e||ke!=="")&&(Fe+=T(P,ce));const De=Ne[Oe];let He=ue[De];if(P.replacer&&(He=P.replacer.call(ue,De,He)),!Z(P,ce+1,De,!0,!0,!0))continue;const Ge=P.tag!==null&&P.tag!=="?"||P.dump&&P.dump.length>1024;Ge&&(P.dump&&l===P.dump.charCodeAt(0)?Fe+="?":Fe+="? "),Fe+=P.dump,Ge&&(Fe+=T(P,ce)),Z(P,ce+1,He,!0,Ge)&&(P.dump&&l===P.dump.charCodeAt(0)?Fe+=":":Fe+=": ",Fe+=P.dump,ke+=Fe)}P.tag=we,P.dump=ke||"{}"}function v(P,ce,ue){const _e=ue?P.explicitTypes:P.implicitTypes;for(let ke=0,we=_e.length;ke<we;ke+=1){const Ne=_e[ke];if((Ne.instanceOf||Ne.predicate)&&(!Ne.instanceOf||typeof ce=="object"&&ce instanceof Ne.instanceOf)&&(!Ne.predicate||Ne.predicate(ce))){if(ue?Ne.multi&&Ne.representName?P.tag=Ne.representName(ce):P.tag=Ne.tag:P.tag="?",Ne.represent){const Oe=P.styleMap[Ne.tag]||Ne.defaultStyle;let Me;if(s.call(Ne.represent)==="[object Function]")Me=Ne.represent(ce,Oe);else if(r.call(Ne.represent,Oe))Me=Ne.represent[Oe](ce,Oe);else throw new t("!<"+Ne.tag+'> tag resolver accepts not "'+Oe+'" style');P.dump=Me}return!0}}return!1}function Z(P,ce,ue,_e,ke,we,Ne){P.tag=null,P.dump=ue,v(P,ue,!1)||v(P,ue,!0);const Oe=s.call(P.dump),Me=_e;_e&&(_e=P.flowLevel<0||P.flowLevel>ce);const Fe=Oe==="[object Object]"||Oe==="[object Array]";let De,He;if(Fe&&(De=P.duplicates.indexOf(ue),He=De!==-1),(P.tag!==null&&P.tag!=="?"||He||P.indent!==2&&ce>0)&&(ke=!1),He&&P.usedDuplicates[De])P.dump="*ref_"+De;else{if(Fe&&He&&!P.usedDuplicates[De]&&(P.usedDuplicates[De]=!0),Oe==="[object Object]")_e&&Object.keys(P.dump).length!==0?(Ae(P,ce,P.dump,ke),He&&(P.dump="&ref_"+De+P.dump)):(re(P,ce,P.dump),He&&(P.dump="&ref_"+De+" "+P.dump));else if(Oe==="[object Array]")_e&&P.dump.length!==0?(P.noArrayIndent&&!Ne&&ce>0?te(P,ce-1,P.dump,ke):te(P,ce,P.dump,ke),He&&(P.dump="&ref_"+De+P.dump)):(ct(P,ce,P.dump),He&&(P.dump="&ref_"+De+" "+P.dump));else if(Oe==="[object String]")P.tag!=="?"&&ve(P,P.dump,ce,we,Me);else{if(Oe==="[object Undefined]")return!1;if(P.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+Oe)}if(P.tag!==null&&P.tag!=="?"){let Ge=encodeURI(P.tag[0]==="!"?P.tag.slice(1):P.tag).replace(/!/g,"%21");P.tag[0]==="!"?Ge="!"+Ge:Ge.slice(0,18)==="tag:yaml.org,2002:"?Ge="!!"+Ge.slice(18):Ge="!<"+Ge+">",P.dump=Ge+" "+P.dump}}return!0}function fe(P,ce){const ue=[],_e=[];be(P,ue,_e);const ke=_e.length;for(let we=0;we<ke;we+=1)ce.duplicates.push(ue[_e[we]]);ce.usedDuplicates=new Array(ke)}function be(P,ce,ue){if(P!==null&&typeof P=="object"){const _e=ce.indexOf(P);if(_e!==-1)ue.indexOf(_e)===-1&&ue.push(_e);else if(ce.push(P),Array.isArray(P))for(let ke=0,we=P.length;ke<we;ke+=1)be(P[ke],ce,ue);else{const ke=Object.keys(P);for(let we=0,Ne=ke.length;we<Ne;we+=1)be(P[ke[we]],ce,ue)}}}function he(P,ce){ce=ce||{};const ue=new _(ce);ue.noRefs||fe(P,ue);let _e=P;return ue.replacer&&(_e=ue.replacer.call({"":_e},"",_e)),Z(ue,0,_e,!0,!0)?ue.dump+`
591
+ `:""}return G0.dump=he,G0}var nC;function Gse(){if(nC)return $n;nC=1;const e=Hse(),t=$se();function n(s,r){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}return $n.Type=ls(),$n.Schema=AO(),$n.FAILSAFE_SCHEMA=OO(),$n.JSON_SCHEMA=zO(),$n.CORE_SCHEMA=UO(),$n.DEFAULT_SCHEMA=sw(),$n.load=e.load,$n.loadAll=e.loadAll,$n.dump=t.dump,$n.YAMLException=hf(),$n.types={binary:HO(),float:PO(),map:RO(),null:DO(),pairs:GO(),set:KO(),timestamp:FO(),bool:IO(),int:LO(),merge:BO(),omap:$O(),seq:jO(),str:MO()},$n.safeLoad=n("safeLoad","load"),$n.safeLoadAll=n("safeLoadAll","loadAll"),$n.safeDump=n("safeDump","dump"),$n}var Kse=Gse();const qO=Fse(Kse),{Type:Ire,Schema:Lre,FAILSAFE_SCHEMA:Pre,JSON_SCHEMA:zre,CORE_SCHEMA:Ure,DEFAULT_SCHEMA:Fre,load:Bre,loadAll:Hre,dump:$re,YAMLException:Gre,types:Kre,safeLoad:qre,safeLoadAll:Yre,safeDump:Vre}=qO;function YO(e){const t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!t)return{frontmatter:null,body:e};const n=e.slice(t[0].length);try{const s=qO.load(t[1]);if(s&&typeof s=="object"&&!Array.isArray(s))return{frontmatter:s,body:n}}catch{}return{frontmatter:null,body:e}}function VO({data:e}){const t=We(),n=Object.entries(e);return n.length?o.jsxs("div",{className:"mb-4 rounded-md border border-edge/[0.06] bg-neutral-900/60 p-3",children:[o.jsx("div",{className:"text-xs font-semibold text-neutral-400 uppercase mb-2",children:t("fm.title")}),o.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs",children:n.map(([s,r])=>o.jsxs("div",{className:"contents",children:[o.jsx("dt",{className:"font-mono text-neutral-500",children:s}),o.jsx("dd",{className:"font-mono text-neutral-200 break-all",children:qse(r)})]},s))})]}):null}function qse(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e)}const Yse=/^[^/]+\/skills\/[^/]+\//;function xy(e){const t=e.lastIndexOf("/");return t<0?e:e.slice(t+1)}function Vse(e){const t={children:[]};for(const s of e){const i=s.relPath.replace(Yse,"").split("/");let a=t,l="";for(let c=0;c<i.length;c++){const u=i[c];if(l=l?`${l}/${u}`:u,c===i.length-1)a.children.push({type:"file",file:s});else{let d=a.children.find(f=>f.type==="dir"&&f.name===u);d||(d={type:"dir",name:u,path:l,children:[]},a.children.push(d)),a=d}}}const n=s=>{s.children.sort((r,i)=>{const a=r.type==="dir",l=i.type==="dir";if(a!==l)return a?-1:1;if(r.type==="file"&&i.type==="file"){const d=r.file.relPath.endsWith("/SKILL.md")?0:1,f=i.file.relPath.endsWith("/SKILL.md")?0:1;if(d!==f)return d-f}const c=r.type==="file"?xy(r.file.relPath):r.name,u=i.type==="file"?xy(i.file.relPath):i.name;return c.localeCompare(u)}),s.children.forEach(r=>{r.type==="dir"&&n(r)})};return n(t),t.children}function XO({node:e,depth:t,selectedRel:n,onSelect:s,collapsed:r,onToggle:i}){const a=8+t*12;if(e.type==="file"){const c=n===e.file.relPath,u=e.file.relPath.endsWith("/SKILL.md");return o.jsxs("button",{onClick:()=>s(e.file),style:{paddingLeft:a},className:de("w-full flex items-center gap-1.5 rounded-md py-1 pr-1.5 text-left text-xs font-mono truncate [&_svg]:pointer-events-none",c?"bg-neutral-800 text-neutral-100":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800/50"),title:e.file.absPath,children:[u?o.jsx(Yd,{className:"h-3 w-3 shrink-0 text-blue-400"}):o.jsx(Oa,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:xy(e.file.relPath)})]})}const l=r.has(e.path);return o.jsxs("div",{children:[o.jsxs("button",{onClick:()=>i(e.path),style:{paddingLeft:a},className:"w-full flex items-center gap-1.5 rounded-md py-1 pr-1.5 text-left text-xs text-neutral-300 hover:bg-neutral-800/50",children:[l?o.jsx(Yn,{className:"h-3 w-3 shrink-0"}):o.jsx(_n,{className:"h-3 w-3 shrink-0"}),o.jsx(cr,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:e.name})]}),!l&&e.children.map(c=>o.jsx(XO,{node:c,depth:t+1,selectedRel:n,onSelect:s,collapsed:r,onToggle:i},c.type==="dir"?c.path:c.file.relPath))]})}function Xse({projectId:e,name:t,scope:n,source:s,pluginKey:r,agent:i,files:a,readOnly:l,outdated:c,custom:u,onUninstall:d,onClose:f}){var _;const h=We(),p=n==="user"&&!!s,[m,k]=b.useState(a),[w,g]=b.useState(()=>a.find(T=>T.relPath.endsWith("/SKILL.md"))??a[0]??null),[y,x]=b.useState(null),[S,A]=b.useState(null),[E,M]=b.useState(0),j=b.useRef(w);j.current=w;const O=b.useMemo(()=>Vse(m),[m]),[N,F]=b.useState(new Set),G=K=>F(T=>{const X=new Set(T);return X.has(K)?X.delete(K):X.add(K),X}),H=b.useMemo(()=>{const K=[],T=X=>{for(const ne of X)ne.type==="dir"&&(K.push(ne.path),T(ne.children))};return T(O),K},[O]),I=N.size>0,L=()=>F(I?new Set:new Set(H));b.useEffect(()=>{if(!p)return;let K=!1;return Ce.listGlobalSkillFiles(e,{source:s,name:t,pluginKey:r}).then(T=>{if(K)return;k(T);const X=T.find(ne=>ne.relPath.endsWith("/SKILL.md"));g(ne=>ne??X??T[0]??null)}).catch(T=>{K||A(String(T))}),()=>{K=!0}},[e,p,s,t,r]),b.useEffect(()=>{if(!w){x(null),A(null);return}let K=!1;return x(null),A(null),(p?Ce.readGlobalSkillFile(e,{source:s,name:t,pluginKey:r,path:w.relPath}):Ce.readFile(e,w.relPath)).then(X=>{K||x(X.content)}).catch(X=>{K||A(String(X))}),()=>{K=!0}},[e,p,s,t,r,w,E]),b.useEffect(()=>{if(p)return vx("asset",K=>{const T=j.current;T&&K.absPath===T.absPath&&M(X=>X+1)})},[p]);const C=(w==null?void 0:w.relPath.toLowerCase().endsWith(".md"))??!1,D=y!=null&&C?YO(y):null,U=(s==null?void 0:s.endsWith("-plugin"))??!1,B=s?Kn(Xd(s)).label:"",R=((_=a[0])==null?void 0:_.relPath.split("/")[0])??"";return o.jsxs("div",{className:"absolute right-0 top-0 h-full w-full lg:w-[min(720px,88%)] z-30 flex flex-col frosted-strong border-l border-edge/[0.08] shadow-mac",children:[o.jsxs("div",{className:"flex items-center gap-2 p-3 border-b border-edge/[0.06]",children:[o.jsx(Oa,{className:"h-4 w-4 shrink-0 text-blue-400"}),o.jsx("span",{className:"text-sm font-semibold truncate",children:t}),r&&o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",title:h("skillGrid.keyTip"),children:r}),n==="project"?o.jsx(Qe,{variant:"default",children:"project"}):o.jsxs(o.Fragment,{children:[o.jsx(Qe,{variant:"skill",children:"global"}),l&&o.jsx(Qe,{variant:"settings",children:h("skillDetail.readOnly")})]}),p&&o.jsxs(o.Fragment,{children:[o.jsx(Qe,{variant:U?"mcp":"skill",children:h(U?"skillDetail.plugin":"skillDetail.local")}),o.jsx(Qe,{variant:"other",children:B})]}),o.jsx(Qe,{children:h("skillDetail.fileCount",{n:m.length})}),c&&o.jsx(Qe,{variant:"warning",children:h("skillDetail.update")}),u&&o.jsx(Qe,{variant:"other",children:h("skillDetail.custom")}),o.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[!l&&o.jsx("button",{onClick:d,className:"text-neutral-500 hover:text-red-400 [&_svg]:pointer-events-none",title:h("skillDetail.uninstallTitle"),children:o.jsx(er,{className:"h-4 w-4"})}),o.jsx("button",{onClick:f,className:"text-neutral-500 hover:text-neutral-300",children:o.jsx(Vt,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[o.jsxs("aside",{className:"w-56 shrink-0 border-r border-edge/[0.06] overflow-y-auto p-2 space-y-0.5",children:[O.length>0&&o.jsx("div",{className:"flex items-center gap-1 pb-1.5 mb-1 border-b border-edge/[0.06]",children:o.jsxs("button",{onClick:L,className:"inline-flex items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-1.5 py-0.5 text-[10px] hover:bg-neutral-700 [&_svg]:pointer-events-none",title:h(I?"skillDetail.expandAllDirs":"skillDetail.collapseAllDirs"),children:[I?o.jsx(qd,{className:"h-2.5 w-2.5"}):o.jsx(Kd,{className:"h-2.5 w-2.5"}),h(I?"skillDetail.expandAll":"skillDetail.collapseAll")]})}),O.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:h(p?"common.loading":"skillDetail.noFiles")}),O.map(K=>o.jsx(XO,{node:K,depth:0,selectedRel:w==null?void 0:w.relPath,onSelect:g,collapsed:N,onToggle:G},K.type==="dir"?K.path:K.file.relPath))]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[S&&o.jsx("p",{className:"text-red-400 text-xs",children:S}),y==null&&!S&&o.jsx("p",{className:"text-xs text-neutral-500",children:h("common.loading")}),D&&o.jsxs(o.Fragment,{children:[D.frontmatter&&o.jsx(VO,{data:D.frontmatter}),o.jsx("div",{className:"prose prose-invert prose-sm max-w-none",children:o.jsx(Lk,{remarkPlugins:[$k],rehypePlugins:[TO],children:D.body})})]}),y!=null&&!C&&o.jsx("pre",{className:"text-xs font-mono text-neutral-300 whitespace-pre-wrap break-all bg-neutral-900 rounded-md p-3 border border-edge/[0.06]",children:y}),(w==null?void 0:w.relPath.endsWith("/SKILL.md"))&&y===""&&o.jsx("p",{className:"text-xs text-neutral-600",children:h("skillDetail.emptySkillMd")})]})]}),o.jsx("div",{className:"flex items-center gap-2 p-2 border-t border-edge/[0.06] text-[11px] text-neutral-500",children:n==="project"?o.jsxs(o.Fragment,{children:[o.jsx(cr,{className:"h-3 w-3"}),h("skillDetail.projectScopeHint",{root:R||(i?Kn(i).label:"")})]}):l?o.jsxs(o.Fragment,{children:[o.jsx(xl,{className:"h-3 w-3"}),h("skillDetail.globalReadOnlyHint")]}):U?o.jsxs(o.Fragment,{children:[o.jsx(xl,{className:"h-3 w-3"}),h("skillDetail.globalPluginHint",{runtime:B})]}):o.jsxs(o.Fragment,{children:[o.jsx(xl,{className:"h-3 w-3"}),h("skillDetail.globalLocalHint",{runtime:B})]})})]})}const sC={home:{labelKey:"picker.home",icon:j6},desktop:{labelKey:"picker.desktop",icon:L6},downloads:{labelKey:"picker.downloads",icon:pm},documents:{labelKey:"picker.documents",icon:Yd},"library-parent":{labelKey:"picker.libraryParent",icon:uM},drive:{labelKey:"picker.drive",icon:fx},root:{labelKey:"picker.root",icon:fx}},Qse=["home","desktop","downloads","documents","library-parent","drive","root"];function Wse(e){const t=e.trim().replace(/^"(.*)"$/s,"$1");return/^[a-zA-Z]:[\\/]$/.test(t)?t:t.replace(/[\\/]+$/,"").trim()}function Zse({open:e,onClose:t,onConfirm:n,existingPaths:s=[]}){const[r,i]=b.useState([]),[a,l]=b.useState(new Map),[c,u]=b.useState(new Set),[d,f]=b.useState(new Set),[h,p]=b.useState([]),[m,k]=b.useState(""),[w,g]=b.useState(null),y=We();b.useEffect(()=>{!e||r.length>0||Ce.listFsRoots().then(N=>{const F=new Map(Qse.map((G,H)=>[G,H]));i([...N].sort((G,H)=>(F.get(G.kind)??99)-(F.get(H.kind)??99)))}).catch(N=>g(String(N)))},[e,r.length]);const x=b.useCallback(async N=>{u(F=>new Set(F).add(N)),g(null);try{const F=await Ce.listFsChildren(N);l(G=>new Map(G).set(N,F))}catch(F){g(String(F))}finally{u(F=>{const G=new Set(F);return G.delete(N),G})}},[]),S=b.useCallback(N=>{f(F=>{const G=new Set(F);return G.has(N)?G.delete(N):(G.add(N),!a.has(N)&&!c.has(N)&&x(N)),G})},[a,c,x]),A=b.useCallback(N=>{const G=!h.includes(N)?[...h,N]:h.filter(H=>H!==N);p(G),k(G.length>0?G[G.length-1]:"")},[h]),E=b.useMemo(()=>new Set(s),[s]),M=b.useCallback(()=>{const N=Wse(m);k(N),!(!N||h.includes(N)||E.has(N))&&p([...h,N])},[m,h,E]);function j(N,F){const G=[];for(const H of N){const I=d.has(H.path),L=h.includes(H.path),C=E.has(H.path),D=H.rootKind==="library-parent",U=!C&&!D,B=H.rootKind?sC[H.rootKind]:null,R=a.get(H.path),_=c.has(H.path);G.push(o.jsxs("div",{className:"group flex items-center gap-1 pr-2 rounded hover:bg-edge/[0.04]",style:{paddingLeft:F*14+6},children:[o.jsx("button",{onClick:()=>S(H.path),className:"shrink-0 p-0.5 text-neutral-500 hover:text-neutral-200",title:y(I?"common.collapse":"common.expand"),children:I?o.jsx(_n,{className:"h-3.5 w-3.5"}):o.jsx(Yn,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{onClick:()=>S(H.path),className:de("flex-1 min-w-0 flex items-center gap-1.5 text-left py-1 truncate",U?"text-neutral-200":"text-neutral-500"),title:H.path,children:[B?o.jsx(B.icon,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}):o.jsx(cr,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("span",{className:"truncate text-xs",children:H.rootKind==="drive"?H.name:B?y(B.labelKey):H.name}),C&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:y("picker.alreadyAdded")})]}),o.jsx("button",{onClick:()=>A(H.path),disabled:!U,className:de("shrink-0 w-4 h-4 rounded border flex items-center justify-center transition-colors",L?"bg-blue-500 border-blue-500 text-white":"border-neutral-600 text-transparent group-hover:border-neutral-400",!U&&"opacity-30 cursor-not-allowed"),title:y(D?"picker.anchorTip":L?"picker.unselect":"picker.selectFolder"),children:o.jsx(mr,{className:"h-3 w-3"})})]},H.path)),I&&(_||!R?G.push(o.jsxs("div",{className:"flex items-center gap-1.5 text-neutral-500 py-1",style:{paddingLeft:(F+1)*14+24},children:[o.jsx(gn,{className:"h-3 w-3 animate-spin"}),o.jsx("span",{className:"text-[11px]",children:y("common.loading")})]},`${H.path}__loading`)):R.length>0?G.push(...j(R,F+1)):G.push(o.jsx("div",{className:"text-neutral-600 py-1",style:{paddingLeft:(F+1)*14+24},children:o.jsx("span",{className:"text-[11px]",children:y("common.empty")})},`${H.path}__empty`)))}return G}const O=r.map(N=>({path:N.path,name:N.path,rootKind:N.kind}));return e?sn.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:t}),o.jsxs("div",{className:"relative w-[720px] max-w-full h-[560px] max-h-full rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac overflow-hidden flex flex-col",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx(cr,{className:"h-4 w-4 text-blue-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:y("picker.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:y("picker.subtitle")}),o.jsx("button",{onClick:t,className:"ml-auto p-1 rounded text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",title:y("common.close"),children:o.jsx(Vt,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 px-4 py-2 border-b border-edge/[0.06]",children:[o.jsx(cr,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("input",{value:m,onChange:N=>k(N.target.value),onKeyDown:N=>{N.key==="Enter"&&M()},placeholder:y("picker.pathPlaceholder"),spellCheck:!1,className:"flex-1 min-w-0 bg-neutral-900 rounded px-2 py-1 text-xs font-mono text-neutral-200"}),o.jsx("button",{onClick:M,disabled:!m.trim(),title:y("picker.addPathTip"),className:"shrink-0 rounded bg-neutral-800 px-2 py-1 text-xs text-neutral-300 hover:bg-neutral-700 disabled:opacity-40",children:y("picker.add")})]}),o.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[o.jsxs("aside",{className:"w-44 shrink-0 border-r border-edge/[0.06] overflow-y-auto p-2 space-y-0.5 frosted",children:[o.jsx("p",{className:"px-2 pb-1 text-[10px] font-medium uppercase tracking-wide text-neutral-500",children:y("picker.quickAccess")}),r.map(N=>{const F=sC[N.kind];return o.jsxs("button",{onClick:()=>S(N.path),className:"w-full flex items-center gap-1.5 px-2 py-1 rounded text-left hover:bg-edge/[0.06]",title:N.path,children:[N.kind==="drive"||N.kind==="root"?o.jsx(fx,{className:"h-3.5 w-3.5 shrink-0 text-neutral-400"}):o.jsx(F.icon,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsxs("span",{className:"text-xs text-neutral-300 truncate",children:[y(F.labelKey),N.kind==="home"||N.kind==="drive"?o.jsx("span",{className:"ml-1 text-neutral-500",children:N.path}):null]})]},N.path)}),r.length===0&&o.jsx(jm,{rows:8,className:"p-0"})]}),o.jsx("main",{className:"flex-1 overflow-y-auto p-1.5",children:O.length>0?j(O,0):o.jsx("div",{className:"flex items-center justify-center h-full text-neutral-500 text-xs",children:w??y("common.loading")})})]}),o.jsxs("footer",{className:"shrink-0 border-t border-edge/[0.06] px-4 py-2.5 flex items-center gap-3 frosted",children:[o.jsxs("div",{className:"flex-1 min-w-0 flex flex-wrap gap-1 max-h-12 overflow-y-auto",children:[h.length===0&&o.jsx("span",{className:"text-[11px] text-neutral-500",children:y("picker.noneSelected")}),h.map(N=>o.jsxs("button",{onClick:()=>A(N),className:"inline-flex items-center gap-1 rounded-full bg-blue-900/40 text-blue-200 pl-2 pr-1 py-0.5 text-[11px] hover:bg-blue-900/60",title:y("picker.clickRemove"),children:[o.jsx(cr,{className:"h-3 w-3"}),o.jsx("span",{className:"max-w-[220px] truncate",children:N}),o.jsx(Vt,{className:"h-3 w-3"})]},N))]}),w&&o.jsx("span",{className:"text-[11px] text-red-400 max-w-[200px] truncate",children:w}),o.jsx("span",{className:"text-[11px] text-neutral-500 shrink-0",children:y("picker.selectedCount",{count:h.length})}),o.jsx("button",{onClick:t,className:"shrink-0 rounded-lg bg-neutral-800 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-700",children:y("common.cancel")}),o.jsx("button",{onClick:()=>{n(h),p([]),k("")},disabled:h.length===0,className:"shrink-0 rounded-lg bg-blue-600 px-3 py-1.5 text-xs text-white hover:bg-blue-500 disabled:opacity-40 disabled:cursor-not-allowed",children:h.length>0?y("picker.addCount",{count:h.length}):y("picker.add")})]})]})]}),document.body):null}const mh=e=>e.replace(/\\/g,"/"),rC=e=>`${e.provenance}:${e.sourceRoot}:${e.id}`;function Jse({installedSkillNames:e,onInstallSkill:t,onInstallFileAsset:n,onInstallMcp:s,updates:r,onUpdateAsset:i,category:a,scope:l,capabilities:c,projectId:u,onSyncAll:d}){const[f,h]=b.useState([]),[p,m]=b.useState(null),[k,w]=b.useState([]),[g,y]=b.useState([]),[x,S]=b.useState([]),[A,E]=b.useState([]),[M,j]=b.useState(!1),[O,N]=b.useState(!1),[F,G]=b.useState(""),[H,I]=b.useState(en[0]??"claude"),[L,C]=b.useState(0),[D,U]=b.useState(new Map),[B,R]=b.useState(null),_=We(),{show:K}=tn(),T=dn(),X=ie=>{ie&&K("error",ie)},ne=T.stateOf("lib-git-import")==="loading",J=T.stateOf("lib-check-updates")==="loading",pe=T.stateOf("lib-refresh-all")==="loading",q=Oo(ba("skill",c),{scope:l,agent:H}),Y=Oo(ba("mcp",c),{scope:l,agent:H}),V=ie=>ie.ok||!ie.reasonKey?void 0:_(ie.reasonKey),ee=b.useCallback(()=>Ce.listMarket().then(h).catch(ie=>X(String(ie))),[]);b.useEffect(()=>{ee()},[ee]),b.useEffect(()=>$r("market",()=>void ee()),[ee]),b.useEffect(()=>{if(p===null){w([]),y([]),S([]),E([]);return}j(!0),X(null),Ce.listLibraryAssets(p).then(ie=>{const Pe=(ie.plugins??[]).map(Je=>Je.relPath),Ie=Je=>Pe.some(Ze=>Ze===""||Je===Ze||Je.startsWith(`${Ze}/`));w(ie.skills.filter(Je=>!Ie(Je.relPath))),y(ie.files??[]),S(ie.mcp??[]),E(ie.plugins??[])}).catch(ie=>X(String(ie))).finally(()=>j(!1))},[p,L]),b.useEffect(()=>{Ce.listToolkit(u).then(ie=>R(ie.packs)).catch(()=>R([]))},[u,L,p]);async function oe(){J||await T.run("lib-check-updates",async()=>{const ie=await Ce.checkMarketUpdates();U(new Map(ie.map(Pe=>[Pe.id,Pe.status]))),K("success",_("library.checkDone",{n:ie.filter(Pe=>Pe.status==="update-available").length}))},{fail:ie=>_("library.checkFailed",{error:qe(ie)})})}async function ye(){const ie=[...D.entries()].filter(([,Pe])=>Pe==="update-available").map(([Pe])=>Pe);!ie.length||pe||await T.run("lib-refresh-all",async()=>{await Ce.refreshMarketCache(ie),await d(),await ee(),C(Ie=>Ie+1);const Pe=await Ce.checkMarketUpdates(ie);U(Ie=>{const Je=new Map(Ie);for(const Ze of Pe)Je.set(Ze.id,Ze.status);return Je}),K("success",_("library.refreshDone",{n:ie.length}))},{fail:Pe=>_("library.refreshFailed",{error:qe(Pe)})})}async function Re(ie,Pe,Ie){const Je=rC(ie);T.stateOf(Je)!=="loading"&&await T.run(Je,async()=>{const Ze=await Ce.toggleToolkit(u,ie.id,Pe,ie.sourceRoot);Ze.warnings.length>0&&K("info",Ze.warnings.join(";"));const Cn=await Ce.listToolkit(u);R(Cn.packs),Ie==null||Ie()},{fail:Ze=>_("toolkit.toggleFailed",{error:qe(Ze)})})}async function se(ie){await T.run("lib-import-dirs",async()=>{let Pe=null,Ie=0;for(const Je of ie)try{Pe=(await Ce.importMarketDir(Je)).id,Ie++}catch(Ze){K("error",_("library.importDirFail",{path:Je,error:qe(Ze)}))}Ie>0&&K("success",_("library.importDirOk",{n:Ie})),await ee(),C(Je=>Je+1),Pe!==null&&m(Pe)},{fail:Pe=>_("library.importFailed",{error:qe(Pe)})})}async function Q(){const ie=F.trim();!ie||ne||await T.run("lib-git-import",async()=>{const Pe=await Ce.importMarketGit(ie);G(""),await ee(),C(Ie=>Ie+1),m(Pe.id),K("success",_("library.importGitOk",{name:Pe.resourceId??Pe.path}))},{fail:Pe=>_("library.importFailed",{error:qe(Pe)})})}async function Te(ie){const Pe=`lib-migrate:${ie.id}`;T.stateOf(Pe)!=="loading"&&await T.run(Pe,async()=>{const Ie=await Ce.migrateLibrary(ie.id);await ee(),m(Ie.id),K("success",_("library.migratedOk",{name:ie.resourceId??ie.path}))},{fail:Ie=>_("library.migrateFailed",{error:qe(Ie)})})}const[xe,ve]=b.useState(null);async function ge(ie){const Pe=`lib-remove:${ie.id}`;T.stateOf(Pe)!=="loading"&&await T.run(Pe,async()=>{let Ie;ie.managed?Ie=(await Ce.removeMarket(ie.id)).warning:await Ce.removeLibrary(ie.id),p===ie.id&&m(null),await ee(),K("success",_("library.removedOk",{name:ie.resourceId??ie.path})),Ie&&K("info",_("library.removeDeregWarn",{error:Ie}))},{fail:Ie=>_("library.removeFailed",{error:qe(Ie)})})}const[$e,dt]=b.useState(new Set),mt=ie=>dt(Pe=>{const Ie=new Set(Pe);return Ie.has(ie)?Ie.delete(ie):Ie.add(ie),Ie}),[rt,ct]=b.useState(new Set),te=ie=>ct(Pe=>{const Ie=new Set(Pe);return Ie.has(ie)?Ie.delete(ie):Ie.add(ie),Ie}),[re,Ae]=b.useState(new Set),v=ie=>re.has(ie),Z=ie=>Ae(Pe=>{const Ie=new Set(Pe);return Ie.has(ie)?Ie.delete(ie):Ie.add(ie),Ie}),fe=f.filter(ie=>ie.source==="builtin"),be=f.filter(ie=>ie.source==="dir"||ie.source==="legacy"),he=f.filter(ie=>ie.source==="git"),P=ie=>o.jsx(sre,{item:ie,selected:p===ie.id,status:D.get(ie.id),onSelect:m,onMigrate:Pe=>void Te(Pe),onRemove:Pe=>Pe.managed?ve(Pe):void ge(Pe)},ie.id),ce=((r==null?void 0:r.skills)??[]).filter(ie=>ie.outdated),ue=((r==null?void 0:r.mcp)??[]).filter(ie=>ie.outdated),_e=((r==null?void 0:r.files)??[]).filter(ie=>ie.outdated),ke=[...D.values()].filter(ie=>ie==="update-available").length,we=a==="files",Ne=we,Oe=we,Me=we,Fe=we,De=!Ne&&!Me&&!Oe&&!Fe,He=[...Ne?[K0]:[],...Oe?[q0]:[],...Me?[Y0]:[],...Fe?[V0]:[],...ce.length>0||ue.length>0||_e.length>0?[X0]:[]],Ge=iC(k).map(([ie])=>ie||"__root__"),ft=A.map(ie=>`plugin:${ie.relPath||ie.name}`),St=k.filter(ie=>e.has(ie.name)).length,Nt=A.filter(ie=>{const Pe=(B==null?void 0:B.find(Ie=>mh(Ie.dir)===mh(ie.dirPath)))??null;return(Pe==null?void 0:Pe.installed)===!0}).length,jt=[...[...fe.length>0?["builtin"]:[],...be.length>0?["local"]:[],...he.length>0?["git"]:[]],...He],Rt=jt.some(ie=>!re.has(ie))||Ge.some(ie=>$e.has(ie))||ft.some(ie=>!rt.has(ie));function Wt(){Rt?(Ae(new Set(jt)),dt(new Set),ct(new Set(ft))):(Ae(new Set),dt(new Set(Ge)),ct(new Set))}return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"p-3 border-b border-edge/[0.06] space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:_("library.heading")}),!De&&o.jsxs("button",{onClick:Wt,className:"ml-auto inline-flex items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-1.5 py-0.5 text-[10px] hover:bg-neutral-700 [&_svg]:pointer-events-none",title:_(Rt?"library.expandAllTip":"library.collapseAllTip"),children:[Rt?o.jsx(qd,{className:"h-2.5 w-2.5"}):o.jsx(Kd,{className:"h-2.5 w-2.5"}),_(Rt?"library.expandAll":"library.collapseAll")]})]}),o.jsxs("div",{className:"rounded-md border border-edge/[0.06] bg-neutral-900/60 p-2 flex items-center gap-2",children:[l==="user"?o.jsx(xl,{className:"h-3.5 w-3.5 shrink-0 text-emerald-400"}):o.jsx(cr,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsxs("span",{className:"text-[11px] text-neutral-400",children:[_("library.installTo")," ",o.jsx("span",{className:de("font-semibold",l==="user"?"text-emerald-300":"text-blue-300"),children:_(l==="user"?"library.scopeGlobal":"library.scopeProject")})]}),o.jsx("span",{className:"ml-auto text-[11px] text-neutral-600",children:_("library.followsSelection")})]}),o.jsxs("button",{onClick:()=>N(!0),className:"w-full flex items-center justify-center gap-1.5 rounded bg-neutral-800 px-2 py-1.5 text-xs hover:bg-neutral-700 [&_svg]:pointer-events-none",title:_("library.addFoldersTip"),children:[o.jsx(lt,{state:T.stateOf("lib-import-dirs"),className:"h-3.5 w-3.5",icon:o.jsx(lM,{className:"h-3.5 w-3.5"})}),_("library.addFolders")]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{value:F,onChange:ie=>G(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&Q()},placeholder:_("library.gitPlaceholder"),className:"flex-1 min-w-0 bg-neutral-900 rounded px-2 py-1.5 text-xs font-mono"}),o.jsxs("button",{onClick:()=>void Q(),disabled:!F.trim()||ne,className:"shrink-0 inline-flex items-center gap-1 rounded bg-neutral-800 px-2 py-1.5 text-xs hover:bg-neutral-700 disabled:opacity-40 [&_svg]:pointer-events-none",title:_("library.importGitTip"),children:[o.jsx(lt,{state:T.stateOf("lib-git-import"),className:"h-3.5 w-3.5",icon:o.jsx(dx,{className:"h-3.5 w-3.5"})}),_(ne?"library.scanning":"library.importGit")]})]}),o.jsx(Zse,{open:O,onClose:()=>N(!1),onConfirm:ie=>{N(!1),se(ie)},existingPaths:f.map(ie=>ie.path)}),o.jsx(Mi,{open:xe!==null,title:_("library.removeMarketTitle"),message:_("library.removeMarketConfirm",{name:(xe==null?void 0:xe.resourceId)??(xe==null?void 0:xe.path)??""}),confirmLabel:_("common.confirm"),onConfirm:()=>{xe&&ge(xe)},onClose:()=>ve(null)}),f.length>0&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs("button",{onClick:()=>void oe(),disabled:J,title:_("library.checkUpdatesTip"),className:"flex-1 inline-flex items-center justify-center gap-1 rounded bg-neutral-800 px-2 py-1.5 text-xs hover:bg-neutral-700 disabled:opacity-40 [&_svg]:pointer-events-none",children:[o.jsx(lt,{state:T.stateOf("lib-check-updates"),className:"h-3.5 w-3.5",icon:o.jsx(uc,{className:"h-3.5 w-3.5"})}),_(J?"library.checking":"library.checkUpdates")]}),o.jsxs("button",{onClick:()=>void ye(),disabled:ke===0||pe,title:_("library.refreshUpdatesTip"),className:"flex-1 inline-flex items-center justify-center gap-1 rounded bg-blue-900/40 text-blue-300 px-2 py-1.5 text-xs hover:bg-blue-900/60 disabled:opacity-40 [&_svg]:pointer-events-none",children:[o.jsx(lt,{state:T.stateOf("lib-refresh-all"),className:"h-3.5 w-3.5",icon:o.jsx(pm,{className:"h-3.5 w-3.5"})}),_(pe?"library.scanning":"library.refreshUpdates"),ke>0&&o.jsx(Qe,{variant:"other",className:"px-1",children:ke})]})]})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-4",children:[M&&f.length===0&&o.jsx(a3,{count:3}),fe.length>0&&o.jsx(Yi,{icon:o.jsx(nd,{className:"h-3.5 w-3.5 text-emerald-400"}),title:_("library.marketSectionBuiltin"),count:fe.length,open:v("builtin"),onToggle:()=>Z("builtin"),children:fe.map(P)}),be.length>0&&o.jsx(Yi,{icon:o.jsx(cr,{className:"h-3.5 w-3.5 text-blue-400"}),title:_("library.marketSectionLocal"),count:be.length,open:v("local"),onToggle:()=>Z("local"),children:be.map(P)}),he.length>0&&o.jsx(Yi,{icon:o.jsx(dx,{className:"h-3.5 w-3.5 text-violet-400"}),title:_("library.marketSectionGit"),count:he.length,open:v("git"),onToggle:()=>Z("git"),children:he.map(P)}),De&&o.jsxs("div",{className:"rounded-md border border-dashed border-edge/[0.08] bg-neutral-900/40 p-4 text-center",children:[o.jsx(hx,{className:"h-5 w-5 mx-auto text-neutral-600 mb-1"}),o.jsx("p",{className:"text-xs text-neutral-500",children:_("library.noTemplates",{name:ere(a,_)})}),o.jsx("p",{className:"text-[11px] text-neutral-600 mt-0.5",children:_("library.noTemplatesHint")})]}),Ne&&o.jsxs(Yi,{icon:o.jsx(Oa,{className:"h-3.5 w-3.5 text-emerald-400"}),title:_("library.sectionSkills"),hint:_("library.hintDragInstall"),count:k.length,tag:o.jsx(od,{tone:ld(St,k.length),children:_("library.tagInstalled",{done:St,total:k.length})}),open:v(K0),onToggle:()=>Z(K0),children:[M&&o.jsx("p",{className:"text-xs text-neutral-500",children:_("library.scanning")}),!M&&p===null&&o.jsx("p",{className:"text-xs text-neutral-600",children:_("library.addLibrarySkills")}),!M&&p!==null&&k.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:_("library.noSkillsFound")}),o.jsx(aC,{agent:H,onChange:I,kind:"skills",scope:l,capabilities:c}),iC(k).map(([ie,Pe])=>{const Ie=ie||"__root__",Je=$e.has(Ie);return o.jsxs("div",{className:"mb-1",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>mt(Ie),onKeyDown:Ze=>{(Ze.key==="Enter"||Ze.key===" ")&&(Ze.preventDefault(),mt(Ie))},className:"flex items-center gap-1 text-[11px] text-neutral-600 font-mono mb-0.5 cursor-pointer select-none hover:text-neutral-400 rounded focus:outline-none focus-visible:ring-1 focus-visible:ring-edge/20 [&_svg]:pointer-events-none",title:ie||_("library.rootName"),children:[Je?o.jsx(Yn,{className:"h-3 w-3 shrink-0"}):o.jsx(_n,{className:"h-3 w-3 shrink-0"}),o.jsx(cr,{className:"h-3 w-3 shrink-0 text-emerald-500/60"}),o.jsx("span",{className:"truncate",children:ie||_("library.rootName")}),o.jsx(Qe,{variant:"skill",className:"shrink-0",children:_("library.localBadge")}),o.jsx(Qe,{className:"shrink-0",children:Pe.length})]}),!Je&&o.jsx("div",{className:"space-y-0.5",children:Pe.map(Ze=>o.jsx(rre,{skill:Ze,payload:Lg({installKind:"skill",category:"skill",name:Ze.name,sourceDir:Ze.dirPath,targetAgent:H},c),installed:e.has(Ze.name),onInstall:()=>t(Ze,l,H),installDisabled:!q.ok,installReason:V(q)},Ze.name))})]},Ie)})]}),Oe&&o.jsxs(Yi,{icon:o.jsx(Oa,{className:"h-3.5 w-3.5 text-blue-400"}),title:_("library.sectionFiles"),hint:_("library.hintClickInstall"),count:g.length,open:v(q0),onToggle:()=>Z(q0),children:[M&&o.jsx("p",{className:"text-xs text-neutral-500",children:_("library.scanning")}),!M&&p===null&&o.jsx("p",{className:"text-xs text-neutral-600",children:_("library.addLibraryTemplates")}),!M&&p!==null&&g.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:_("library.noFileTemplates")}),EM.map(ie=>{var Je;const Pe=g.filter(Ze=>Ze.category===ie);if(!Pe.length)return null;const Ie=((Je=ba(ie,c).surfaces[0])==null?void 0:Je.harness)??"claude";return o.jsxs("div",{className:"mb-1",children:[o.jsxs("div",{className:"flex items-center gap-1 text-[11px] text-neutral-600 font-mono mb-0.5",children:[o.jsx(cr,{className:"h-3 w-3 shrink-0 text-emerald-500/60"}),o.jsx("span",{className:"truncate",children:ie}),o.jsx(Qe,{className:"shrink-0",children:Pe.length})]}),o.jsx("div",{className:"space-y-0.5",children:Pe.map(Ze=>{const Cn=Oo(ba(Ze.category,c),{scope:l,agent:Ie});return o.jsx(ire,{file:Ze,payload:Lg({installKind:"file",category:Ze.category,name:Ze.name,sourceFile:Ze.filePath,targetAgent:Ie},c),verdict:Cn,reason:V(Cn),onInstall:()=>n(Ze,l)},Ze.filePath)})})]},ie)})]}),Me&&o.jsxs(Yi,{icon:o.jsx(mm,{className:"h-3.5 w-3.5 text-blue-400"}),title:_("library.sectionMcp"),hint:_("library.hintClickAdd"),count:x.length,open:v(Y0),onToggle:()=>Z(Y0),children:[x.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:_("library.noMcpTemplates")}),o.jsx(aC,{agent:H,onChange:I,kind:"mcp",scope:l,capabilities:c}),x.map(ie=>o.jsx(are,{srv:ie,payload:Lg({installKind:"mcp",category:"mcp",name:ie.name,mcpConfig:{command:ie.command,...ie.args&&{args:ie.args},...ie.env&&{env:ie.env}},targetAgent:H},c),verdict:Y,reason:V(Y),onInstall:()=>s(ie.name,{command:ie.command,...ie.args&&{args:ie.args},...ie.env&&{env:ie.env}},l,H)},ie.name))]}),Fe&&o.jsxs(Yi,{icon:o.jsx(px,{className:"h-3.5 w-3.5 text-violet-400"}),title:_("library.sectionPlugins"),hint:_("library.pluginsSectionHint"),count:A.length,tag:o.jsx(od,{tone:ld(Nt,A.length),children:_("library.tagInstalled",{done:Nt,total:A.length})}),open:v(V0),onToggle:()=>Z(V0),children:[M&&o.jsx("p",{className:"text-xs text-neutral-500",children:_("library.scanning")}),!M&&p===null&&o.jsx("p",{className:"text-xs text-neutral-600",children:_("library.addLibraryPlugins")}),!M&&p!==null&&A.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:_("library.noPlugins")}),A.map(ie=>{var Cn;const Pe=(B==null?void 0:B.find(Ht=>mh(Ht.dir)===mh(ie.dirPath)))??null,Ie=`plugin:${ie.relPath||ie.name}`,Je=rt.has(Ie),Ze=Pe!==null&&T.stateOf(rC(Pe))==="loading";return o.jsxs("div",{className:"rounded-md border border-edge/[0.06] bg-edge/[0.015] px-2 py-1.5 space-y-1",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>te(Ie),onKeyDown:Ht=>{(Ht.key==="Enter"||Ht.key===" ")&&(Ht.preventDefault(),te(Ie))},className:"flex flex-wrap items-center gap-1.5 cursor-pointer select-none rounded focus:outline-none focus-visible:ring-1 focus-visible:ring-edge/20",children:[Je?o.jsx(_n,{className:"h-3 w-3 shrink-0 text-neutral-600"}):o.jsx(Yn,{className:"h-3 w-3 shrink-0 text-neutral-600"}),o.jsx(px,{className:de("h-3.5 w-3.5 shrink-0",Pe!=null&&Pe.enabled?"text-violet-400":"text-neutral-600")}),o.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-neutral-200",title:ie.key?_("toolkit.keyTip",{scopes:((Cn=Pe==null?void 0:Pe.scopes)==null?void 0:Cn.join("+"))||_("toolkit.scopesNone")}):void 0,children:ie.key??ie.name}),o.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",children:["v",ie.version]}),(ie.ccPack||ie.kind==="mod")&&o.jsx("span",{className:"shrink-0",title:_("library.ccPluginTip"),children:o.jsx(Qe,{className:"bg-blue-900/40 text-blue-300",children:_("library.badgeCcPlugin")})}),ie.weavePack&&o.jsx("span",{className:"shrink-0",title:_("library.weavePluginTip"),children:o.jsx(Qe,{className:"bg-violet-900/40 text-violet-300",children:_("library.badgeWeavePlugin")})}),o.jsx(Qe,{className:de("shrink-0",p3[ie.kind]),children:_(h3[ie.kind])}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:_("toolkit.targets",{targets:ie.targets.join("+")})}),o.jsx("span",{className:"ml-auto shrink-0",onClick:Ht=>Ht.stopPropagation(),onKeyDown:Ht=>Ht.stopPropagation(),children:Pe?ie.weavePack&&!(ie.ccPack||ie.kind==="mod")?o.jsx(Sl,{checked:Pe.enabled,disabled:Ze,onChange:Ht=>void Re(Pe,Ht),title:_("library.weavePluginTip")}):Pe.installed?o.jsxs(Qe,{className:"bg-emerald-900/40 text-emerald-300",title:_("library.installedManageTip"),children:[_("library.installed")," ✓"]}):o.jsx("button",{type:"button",disabled:Ze,title:_("library.installPackTip"),onClick:()=>void Re(Pe,!0,()=>K("success",_("library.packInstalled",{name:Pe.name}))),className:"rounded bg-blue-900/50 px-2 py-0.5 text-[10px] text-blue-200 hover:bg-blue-800/60 disabled:opacity-40",children:_(Ze?"library.installing":"library.install")}):o.jsx("span",{className:"text-[10px] text-neutral-600",title:_("library.pluginNotInToolkit"),children:"—"})})]}),Je&&o.jsxs("div",{className:"pl-4 space-y-1",children:[ie.description?o.jsx("p",{className:"text-[11px] text-neutral-500",title:ie.description,children:ie.description}):null,o.jsx("div",{className:"flex flex-wrap items-center gap-1",children:ie.components.map(Ht=>o.jsx(Qe,{variant:"other",className:"px-1 text-[10px]",children:Ht},Ht))}),ie.skills.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"mb-0.5 text-[10px] text-neutral-600",title:_("library.pluginSkillsFollowTip"),children:_("library.pluginSkillsLabel")}),o.jsx("div",{className:"flex flex-wrap gap-1",children:ie.skills.map(Ht=>o.jsx(Qe,{variant:"skill",className:"px-1.5 text-[10px]",title:_("library.pluginSkillsFollowTip"),children:Ht},Ht))})]}),o.jsxs("p",{className:"text-[10px] text-neutral-600",children:[o.jsx("span",{className:"text-neutral-500",children:_("library.pluginSourceDir")})," ",o.jsx("span",{className:"font-mono",title:ie.dirPath,children:ie.relPath||"."})]})]})]},Ie)})]}),(ce.length>0||ue.length>0||_e.length>0)&&o.jsxs(Yi,{icon:o.jsx(uc,{className:"h-3.5 w-3.5 text-orange-400"}),title:_("library.sectionUpdates"),hint:_("library.hintOverwrite"),count:ce.length+ue.length+_e.length,open:v(X0),onToggle:()=>Z(X0),children:[ce.map(ie=>o.jsx(Q0,{label:ie.name,scope:ie.scope,agent:ie.agent,onUpdate:()=>i("skill",ie.name,ie.scope,ie.agent)},`skill-${ie.agent??"claude"}-${ie.scope}-${ie.name}`)),_e.map(ie=>o.jsx(Q0,{label:`${ie.category}/${ie.name}`,scope:ie.scope,onUpdate:()=>i(ie.category,ie.name,ie.scope)},`file-${ie.category}-${ie.name}`)),ue.map(ie=>o.jsx(Q0,{label:ie.name,scope:ie.scope,agent:ie.agent,onUpdate:()=>i("mcp",ie.name,ie.scope,ie.agent)},`mcp-${ie.agent??"claude"}-${ie.scope}-${ie.name}`))]})]}),Me&&o.jsx(lre,{onInstall:(ie,Pe)=>s(ie,Pe,l,H),blockedTitle:V(Y)})]})}function ere(e,t){switch(e){case"files":return t("catbar.files");case"personalization":return t("library.catPersonalization");case"weave":return t("catbar.hooks");case"tasks":return t("catbar.tasks");case"orchestrate":return t("catbar.orchestrate")}}function tre({source:e}){const t=We(),n={git:{label:t("library.badgeGit"),variant:"command"},dir:{label:t("library.badgeDir"),variant:"skill"},legacy:{label:t("library.badgeExternal"),variant:"other"},builtin:{label:t("toolkit.prov.builtin"),variant:"helper"}}[e];return o.jsx(Qe,{variant:n.variant,className:"shrink-0 px-1.5 text-[10px]",children:n.label})}const K0="skill-templates",q0="file-templates",Y0="mcp-templates",V0="plugin-packs",X0="update-hints";function nre({status:e}){const t=We();if(!e)return null;const n={uptodate:{label:t("library.statusUptodate"),cls:"text-emerald-300 bg-emerald-900/30"},"update-available":{label:t("library.statusUpdateAvailable"),cls:"text-orange-300 bg-orange-900/30"},"origin-missing":{label:t("library.statusOriginMissing"),cls:"text-amber-300 bg-amber-900/30"},unknown:{label:t("library.statusUnknown"),cls:"text-neutral-400 bg-neutral-800"}}[e];return o.jsx(Qe,{className:de("shrink-0 px-1.5 text-[10px]",n.cls),children:n.label})}function sre({item:e,selected:t,status:n,onSelect:s,onMigrate:r,onRemove:i}){const a=We(),l=dn(),c=l.stateOf(`lib-migrate:${e.id}`)==="loading",u=l.stateOf(`lib-remove:${e.id}`);return o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(e.id),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),s(e.id))},className:de("rounded-md border px-2 py-1.5 space-y-1 cursor-pointer select-none","focus:outline-none focus-visible:ring-1 focus-visible:ring-edge/20 [&_svg]:pointer-events-none",t?"border-neutral-700 bg-neutral-800/80":"border-edge/[0.06] bg-edge/[0.015] hover:bg-edge/[0.04]"),title:e.path,children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-neutral-200",title:a("repo.namespaceTip"),children:e.managed&&e.resourceId?e.resourceId:e.path}),o.jsxs("span",{className:"ml-auto shrink-0 flex items-center gap-1",children:[o.jsx(nre,{status:n}),e.legacy&&o.jsx("button",{onClick:d=>{d.stopPropagation(),r(e)},disabled:c,title:a("library.migrateTip"),className:"rounded px-1.5 py-0.5 text-[10px] text-amber-300 bg-amber-900/30 hover:bg-amber-900/50 disabled:opacity-40",children:a(c?"library.migrating":"library.migrate")}),!e.builtin&&o.jsx("button",{onClick:d=>{d.stopPropagation(),i(e)},disabled:u==="loading",title:e.managed?a("library.removeMarketTip"):a("library.removeLegacyTip"),className:"text-neutral-500 hover:text-red-400 disabled:cursor-not-allowed",children:o.jsx(lt,{state:u,className:"h-3 w-3",icon:o.jsx(er,{className:"h-3 w-3"})})})]})]}),o.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-wrap",children:[o.jsx(tre,{source:e.source}),e.tags&&Ex.filter(d=>e.tags[d]!==void 0).map(d=>o.jsxs("span",{className:de(Cx,Xv(d).on),children:[d,e.tags[d]>1&&o.jsxs("span",{className:"ml-1 tabular-nums text-[10px] opacity-70",children:["×",e.tags[d]]})]},d)),e.source==="git"&&(e.origin||e.importedAt)&&o.jsxs("span",{className:"ml-auto text-[10px] text-neutral-600 truncate",children:[e.origin,e.origin&&e.importedAt?" · ":"",e.importedAt?a("library.importedAt",{date:e.importedAt.slice(0,10)}):""]})]})]})}function iC(e){const t=new Map;for(const n of e){const s=t.get(n.group)??[];s.push(n),t.set(n.group,s)}return[...t.entries()].sort((n,s)=>n[0]?s[0]?n[0].localeCompare(s[0]):-1:1)}function aC({agent:e,onChange:t,kind:n,scope:s,capabilities:r}){var c,u;const i=We(),a=n==="skills"?{claude:i("library.tipSkillsClaude"),codex:i("library.tipSkillsCodex")}:{claude:i("library.tipMcpClaude"),codex:i("library.tipMcpCodex")},l=(u=(c=ba(n==="skills"?"skill":"mcp",r).surfaces.find(d=>d.harness===e))==null?void 0:c.dest)==null?void 0:u[s];return o.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500 shrink-0",children:i("library.installTarget")}),en.map(d=>o.jsx("button",{onClick:()=>t(d),className:de("rounded px-1.5 py-0.5 text-[11px]",e===d?"bg-neutral-700 text-neutral-100":"text-neutral-500 hover:text-neutral-300"),title:a[d],children:Kn(d).label},d)),l&&o.jsxs("span",{className:"text-[10px] text-neutral-600",children:["→ ",l]})]})}function Yi({icon:e,title:t,hint:n,count:s,tag:r,open:i,onToggle:a,children:l}){const c=We();return o.jsxs("section",{children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a())},className:"flex items-center gap-1.5 mb-1.5 cursor-pointer select-none rounded focus:outline-none focus-visible:ring-1 focus-visible:ring-edge/20 [&_svg]:pointer-events-none",title:c(i?"common.collapse":"common.expand"),children:[i?o.jsx(_n,{className:"h-3 w-3 text-neutral-500"}):o.jsx(Yn,{className:"h-3 w-3 text-neutral-500"}),e,o.jsx("span",{className:"text-xs font-semibold text-neutral-300",children:t}),r??(s!==void 0&&o.jsx(Qe,{variant:"other",children:s})),n&&o.jsx("span",{className:"text-[11px] text-neutral-500 ml-auto",children:n})]}),i&&o.jsx("div",{className:"space-y-0.5",children:l})]})}function Q0({label:e,scope:t,agent:n,onUpdate:s}){const r=We(),{show:i}=tn(),a=dn(),l=a.stateOf("update");return o.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-neutral-900",children:[o.jsx(uc,{className:"h-3 w-3 shrink-0 text-orange-400"}),o.jsx("span",{className:"truncate",children:e}),n&&n!==en[0]&&o.jsx(Qe,{variant:"other",className:"shrink-0",children:Kn(n).label}),o.jsx(Qe,{variant:"skill",className:"shrink-0",children:t}),o.jsx("button",{onClick:()=>void a.run("update",async()=>{await s(),i("success",r("library.updatedOk",{name:e}))},{fail:c=>r("errors.updateFailed",{error:qe(c)})}),disabled:l==="loading",className:"ml-auto text-xs text-blue-400 hover:text-blue-300 shrink-0 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-blue-400",children:r("library.update")})]})}function rre({skill:e,payload:t,installed:n,onInstall:s,installDisabled:r,installReason:i}){const{attributes:a,listeners:l,setNodeRef:c,transform:u,isDragging:d}=hm({id:`lib-skill-${e.name}`,data:t}),f=We(),{show:h}=tn(),p=dn(),m=p.stateOf("install"),k=u?{transform:`translate3d(${u.x}px, ${u.y}px, 0)`}:void 0;return o.jsxs("div",{ref:c,style:k,...a,...l,className:de("flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm cursor-grab transition-colors duration-200",d&&"opacity-40","hover:bg-neutral-800/50"),title:e.dirPath,children:[o.jsx(cM,{className:"h-3 w-3 shrink-0 text-neutral-600"}),o.jsx("span",{className:"truncate",children:e.name}),n?o.jsx(Qe,{variant:"skill",className:"ml-auto",children:f("library.installed")}):o.jsx("button",{onPointerDown:w=>w.stopPropagation(),onClick:w=>{w.stopPropagation(),p.run("install",async()=>{await s(),h("success",f("library.installedOk",{name:e.name}))},{fail:g=>f("errors.installFailed",{error:qe(g)})})},disabled:r||m==="loading",title:i,className:"ml-auto text-xs text-blue-400 hover:text-blue-300 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-blue-400",children:f("library.install")})]})}function ire({file:e,payload:t,verdict:n,reason:s,onInstall:r}){const i=We(),{attributes:a,listeners:l,setNodeRef:c,transform:u,isDragging:d}=hm({id:`lib-file-${e.filePath}`,data:t}),{show:f}=tn(),h=dn(),p=h.stateOf("install"),m=u?{transform:`translate3d(${u.x}px, ${u.y}px, 0)`}:void 0;return o.jsxs("div",{ref:c,style:m,...a,...l,className:de("flex items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-neutral-900 cursor-grab transition-colors duration-200",d&&"opacity-40"),title:e.filePath,children:[o.jsx(Oa,{className:"h-3 w-3 shrink-0 text-blue-400"}),o.jsx("span",{className:"truncate",children:e.name}),o.jsx("button",{onPointerDown:k=>k.stopPropagation(),onClick:k=>{k.stopPropagation(),h.run("install",async()=>{await r(),f("success",i("library.installedOk",{name:e.name}))},{fail:w=>i("errors.installFailed",{error:qe(w)})})},disabled:!n.ok||p==="loading",title:s,className:"ml-auto text-xs text-blue-400 hover:text-blue-300 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-blue-400",children:i("library.install")})]})}function are({srv:e,payload:t,verdict:n,reason:s,onInstall:r}){const i=We(),{attributes:a,listeners:l,setNodeRef:c,transform:u,isDragging:d}=hm({id:`lib-mcp-${e.name}`,data:t}),{show:f}=tn(),h=dn(),p=h.stateOf("install"),m=u?{transform:`translate3d(${u.x}px, ${u.y}px, 0)`}:void 0;return o.jsxs("div",{ref:c,style:m,...a,...l,className:de("flex items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-neutral-900 cursor-grab transition-colors duration-200",d&&"opacity-40"),title:e.sourcePath,children:[o.jsx(mm,{className:"h-3 w-3 shrink-0 text-blue-400"}),o.jsx("span",{className:"truncate",children:e.name}),o.jsx("button",{onPointerDown:k=>k.stopPropagation(),onClick:k=>{k.stopPropagation(),h.run("install",async()=>{await r(),f("success",i("library.installedOk",{name:e.name}))},{fail:w=>i("errors.mcpInstallFailed",{error:qe(w)})})},disabled:!n.ok||p==="loading",title:s,className:"ml-auto text-xs text-blue-400 hover:text-blue-300 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-blue-400",children:i("library.install")})]})}function lre({onInstall:e,blockedTitle:t}){const[n,s]=b.useState(""),[r,i]=b.useState(""),[a,l]=b.useState(""),[c,u]=b.useState(""),d=We(),{show:f}=tn(),h=dn(),p=h.stateOf("submit");function m(){if(t)return;const k=n.trim(),w=r.trim();if(!k||!w||p==="loading")return;const g=a.trim()?a.trim().split(/\s+/):void 0,y=ore(c);h.run("submit",async()=>{await e(k,{command:w,...g&&{args:g},...y&&{env:y}}),f("success",d("library.installedOk",{name:k}))},{fail:x=>d("errors.mcpInstallFailed",{error:qe(x)})}),s(""),i(""),l(""),u("")}return o.jsxs("div",{className:"border-t border-edge/[0.06] p-3 space-y-1.5",children:[o.jsxs("h3",{className:"text-xs font-semibold text-neutral-400 uppercase flex items-center gap-1",children:[o.jsx(mm,{className:"h-3 w-3"})," ",d("library.addMcpServer")]}),o.jsx("input",{value:n,onChange:k=>s(k.target.value),placeholder:d("library.mcpNamePlaceholder"),className:"w-full bg-neutral-900 rounded px-2 py-1 text-xs font-mono"}),o.jsx("input",{value:r,onChange:k=>i(k.target.value),placeholder:d("library.mcpCommandPlaceholder"),className:"w-full bg-neutral-900 rounded px-2 py-1 text-xs font-mono"}),o.jsx("input",{value:a,onChange:k=>l(k.target.value),placeholder:d("library.mcpArgsPlaceholder"),className:"w-full bg-neutral-900 rounded px-2 py-1 text-xs font-mono"}),o.jsx("textarea",{value:c,onChange:k=>u(k.target.value),placeholder:d("library.mcpEnvPlaceholder"),rows:2,className:"w-full bg-neutral-900 rounded px-2 py-1 text-xs font-mono"}),o.jsx("button",{onClick:m,disabled:!n.trim()||!r.trim()||!!t||p==="loading",title:t,className:"w-full rounded bg-blue-900/40 text-blue-300 py-1 text-xs disabled:opacity-40 disabled:cursor-not-allowed",children:d("library.addMcpServer")})]})}function ore(e){const t=e.split(`
592
+ `).map(s=>s.trim()).filter(Boolean);if(!t.length)return;const n={};for(const s of t){const r=s.indexOf("=");r>0&&(n[s.slice(0,r)]=s.slice(r+1))}return Object.keys(n).length?n:void 0}function cre({projectId:e,relPath:t,global:n,agent:s,onClose:r}){const[i,a]=b.useState(null),[l,c]=b.useState(null);b.useEffect(()=>{a(null),c(null),(n?Ce.readGlobalFile(t):Ce.readFile(e,t)).then(h=>a(h.content)).catch(h=>c(String(h)))},[e,t,n]);const u=t.endsWith(".md")||t.endsWith(".markdown"),d=i!=null&&u?YO(i):null;return o.jsxs("div",{className:"absolute right-0 top-0 h-full w-full lg:w-[min(720px,88%)] z-30 flex flex-col frosted-strong border-l border-edge/[0.08] shadow-mac",children:[o.jsxs("div",{className:"flex items-center gap-2 p-3 border-b border-edge/[0.06]",children:[o.jsx(Yd,{className:"h-4 w-4 shrink-0 text-neutral-500"}),o.jsx("span",{className:"text-xs font-mono text-neutral-300 truncate",children:t}),s&&o.jsx(xr,{agent:s,className:"shrink-0"}),o.jsx("button",{onClick:r,className:"ml-auto text-neutral-500 hover:text-neutral-300",children:o.jsx(Vt,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[l&&o.jsx("p",{className:"text-red-400 text-xs",children:l}),i==null&&!l&&o.jsx(uK,{lines:14,className:"p-0"}),d&&o.jsxs(o.Fragment,{children:[d.frontmatter&&o.jsx(VO,{data:d.frontmatter}),o.jsx("div",{className:"prose prose-invert prose-sm max-w-none",children:o.jsx(Lk,{remarkPlugins:[$k],rehypePlugins:[TO],children:d.body})})]}),i!=null&&!u&&o.jsx("pre",{className:"text-xs font-mono text-neutral-300 whitespace-pre-wrap break-all bg-neutral-900 rounded-md p-3 border border-edge/[0.06]",children:i})]})]})}const ure=90,lC=90,dre={denied:"tasks.notifyDenied",unsupported:"tasks.notifyUnsupported",insecure:"tasks.notifyInsecure"};function fre({open:e,onClose:t}){var X,ne,J,pe,q,Y,V,ee,oe,ye,Re,se,Q,Te,xe;const{locale:n,t:s,setLocale:r}=VM(),[i,a]=b.useState(null),[l,c]=b.useState([]),[u,d]=b.useState([]),[f,h]=b.useState(null),[p,m]=b.useState(!1),[k,w]=b.useState(""),[g,y]=b.useState(!1),[x,S]=b.useState(!1),[A,E]=b.useState([]),[M,j]=b.useState(null),[O,N]=b.useState(null),F=dn(),{show:G}=tn();b.useEffect(()=>{e&&lh().then(N)},[e]);const H=b.useCallback(ve=>{(async()=>{if(ve){const ge=await jM();if(ge!=="granted"){G("info",s(dre[ge])),N(await lh());return}if(await YR({force:!0})!=="ok"){G("info",s("settings.pushFailed")),N(await lh());return}}else await Dee();N(await lh())})()},[s,G]),I=b.useCallback(async ve=>{try{const ge=await PZ(ve&&(ve.baseUrl!==void 0||ve.apiKey!==void 0)?{...ve.baseUrl?{baseUrl:ve.baseUrl}:{},...ve.apiKey?{apiKey:ve.apiKey}:{}}:void 0);E(ge.models)}catch(ge){if(ve!=null&&ve.silent)return;throw ge}},[]),[L,C]=b.useState(!1),D=b.useCallback(()=>{h(null),w(""),y(!1),S(!1),Ce.getDaemonSettings().then(ve=>{a(ve.settings),c(ve.presets),d(ve.urls??[])}).catch(ve=>h(String(ve)))},[]);b.useEffect(()=>{e&&D()},[e,D]),b.useEffect(()=>{if(e)return $r("settings",D)},[e,D]);const U=!!((X=i==null?void 0:i.ai)!=null&&X.baseUrl&&((ne=i==null?void 0:i.ai)!=null&&ne.apiKeySet)),B=((pe=(J=i==null?void 0:i.ai)==null?void 0:J.baseUrl)==null?void 0:pe.trim())??"",R=k.trim();if(b.useEffect(()=>{if(!e||U||B===""||R==="")return;const ve=setTimeout(()=>{I({baseUrl:B,apiKey:R,silent:!0})},700);return()=>clearTimeout(ve)},[e,U,B,R,I]),!e)return null;const _=(i==null?void 0:i.terminal.preset)??"auto",K=(i==null?void 0:i.terminal.customCommand)??"";async function T(){if(i){m(!0),h(null);try{const ve={...i,...i.ai?{ai:{baseUrl:i.ai.baseUrl,model:i.ai.model,...k!==""?{apiKey:k}:g?{apiKey:null}:{}}}:{}},ge=await Ce.putDaemonSettings(ve);a(ge),w(""),y(!1),r(ge.locale),t()}catch(ve){h(String(ve))}finally{m(!1)}}}return sn.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:t}),o.jsxs("div",{className:"relative w-[440px] max-w-full max-h-[calc(100dvh-1.5rem)] lg:max-h-[calc(100dvh-3rem)] rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac overflow-hidden flex flex-col",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx(gM,{className:"h-4 w-4 text-blue-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:s("settings.title")}),o.jsx("button",{onClick:t,className:"ml-auto p-1 rounded text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",title:s("common.close"),children:o.jsx(Vt,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 space-y-4",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(O6,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.language")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.languageHint")}),o.jsx("select",{value:(i==null?void 0:i.locale)??n,onChange:ve=>a(ge=>ge&&{...ge,locale:ve.target.value}),className:"w-full rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",children:GM.map(ve=>o.jsx("option",{value:ve,children:s9[ve]},ve))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(Bv,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.defaultTerminal")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.defaultTerminalHint")}),o.jsx("select",{value:_,onChange:ve=>a(ge=>ge&&{...ge,terminal:{...ge.terminal,preset:ve.target.value}}),className:"w-full rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(ve=>{const ge=`preset.${ve.id}`;return o.jsx("option",{value:ve.id,children:ge in qM?s(ge):ve.label},ve.id)})})]}),_==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:s("settings.customCommand")}),o.jsxs("p",{className:"text-[11px] text-neutral-500",children:[o.jsx("code",{className:"text-neutral-400",children:"{path}"})," ",s("settings.pathHint"),o.jsxs("code",{className:"text-neutral-400",children:[" alacritty -e cd ","{path}"]})]}),o.jsx("input",{type:"text",value:K,onChange:ve=>a(ge=>ge&&{...ge,terminal:{...ge.terminal,customCommand:ve.target.value}}),placeholder:"my-terminal --dir {path}",className:"w-full rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(gm,{className:"h-3.5 w-3.5 text-neutral-500"}),o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:s("settings.hooks")}),o.jsx("span",{className:"ml-auto",children:o.jsx(Sl,{checked:(i==null?void 0:i.hooks.enabled)??!0,onChange:ve=>a(ge=>ge&&{...ge,hooks:{...ge.hooks,enabled:ve}}),title:s("settings.hooks")})})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.hooksHint")})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Yl,{className:"h-3.5 w-3.5 text-neutral-500"}),o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:s("settings.launchOnLogin")}),o.jsx("span",{className:"ml-auto",children:o.jsx(Sl,{checked:((q=i==null?void 0:i.startup)==null?void 0:q.launchOnLogin)??!1,onChange:ve=>a(ge=>ge&&{...ge,startup:{launchOnLogin:ve}}),title:s("settings.launchOnLogin")})})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.launchOnLoginHint")})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(k6,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.retentionDays")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.retentionDaysHint")}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(cd,{value:((Y=i==null?void 0:i.events)==null?void 0:Y.retentionDays)??ure,min:1,max:3650,onChange:ve=>a(ge=>ge&&{...ge,events:{retentionDays:ve}}),title:s("settings.retentionDays")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:s("settings.daysUnit")})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(x6,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.sessionIdleDays")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.sessionIdleDaysHint",{n:((V=i==null?void 0:i.sessions)==null?void 0:V.idleDays)??lC})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(cd,{value:((ee=i==null?void 0:i.sessions)==null?void 0:ee.idleDays)??lC,min:1,max:3650,onChange:ve=>a(ge=>ge&&{...ge,sessions:{idleDays:ve}}),title:s("settings.sessionIdleDays")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:s("settings.daysUnit")})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(rM,{className:"h-3.5 w-3.5 text-neutral-500"}),o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:s("settings.push")}),o.jsx("span",{className:"ml-auto",children:o.jsx(Sl,{checked:O==="on",disabled:O==null||O==="insecure"||O==="unsupported",onChange:H,title:s("settings.push")})})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s(O==="insecure"?"settings.pushInsecure":O==="unsupported"?"settings.pushUnsupported":"settings.pushHint")})]}),u.length>0&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(xl,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.accessUrls")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.accessUrlsHint")}),o.jsx("ul",{className:"space-y-1",children:u.map(ve=>o.jsxs("li",{className:"flex items-center gap-1.5",children:[o.jsxs("span",{className:ve.protocol==="https"?"rounded bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-400":"rounded bg-edge/[0.06] px-1.5 py-0.5 text-[10px] font-medium text-neutral-400",children:[ve.scope==="lan"?s("settings.urlLan"):s("settings.urlLocal")," ·"," ",ve.protocol.toUpperCase()]}),o.jsx("code",{className:"min-w-0 flex-1 truncate rounded bg-neutral-950 border border-edge/[0.06] px-2 py-1 text-[11px] text-neutral-300",children:ve.url}),o.jsx("button",{type:"button",onClick:()=>{lf(ve.url).then(ge=>{if(!ge){G("error",s("common.copyFailed"));return}j(ve.url),window.setTimeout(()=>j(null),1500)})},title:s("common.copy"),className:"shrink-0 rounded p-1 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",children:M===ve.url?o.jsx("span",{className:"text-[10px] text-emerald-400",children:"✓"}):o.jsx(Ta,{className:"h-3 w-3"})})]},ve.url))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(bM,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.ai")]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx("input",{value:((oe=i==null?void 0:i.ai)==null?void 0:oe.baseUrl)??"",onChange:ve=>a(ge=>ge===null?ge:{...ge,ai:{...ge.ai??{model:""},baseUrl:ve.target.value}}),placeholder:s("settings.aiBaseUrlPlaceholder"),className:"min-w-0 rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500"}),o.jsxs("div",{className:"flex items-center gap-1",children:[A.length>0?o.jsxs("select",{value:((ye=i==null?void 0:i.ai)==null?void 0:ye.model)??"",onChange:ve=>a(ge=>ge===null?ge:{...ge,ai:{...ge.ai??{baseUrl:""},model:ve.target.value}}),className:"min-w-0 flex-1 rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[(((Re=i==null?void 0:i.ai)==null?void 0:Re.model)??"")===""&&o.jsx("option",{value:"",children:s("settings.aiModelPlaceholder")}),((se=i==null?void 0:i.ai)==null?void 0:se.model)&&!A.includes(i.ai.model)&&o.jsx("option",{value:i.ai.model,children:i.ai.model}),A.map(ve=>o.jsx("option",{value:ve,children:ve},ve))]}):o.jsx("input",{value:((Q=i==null?void 0:i.ai)==null?void 0:Q.model)??"",onChange:ve=>a(ge=>ge===null?ge:{...ge,ai:{...ge.ai??{baseUrl:""},model:ve.target.value}}),placeholder:s("settings.aiModelPlaceholder"),className:"min-w-0 flex-1 rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500"}),o.jsxs("button",{type:"button",onClick:()=>void F.run("ai-models",()=>{var ve;return I({baseUrl:((ve=i==null?void 0:i.ai)==null?void 0:ve.baseUrl)??"",...k!==""?{apiKey:k}:{}})},{fail:ve=>qe(ve)}),disabled:F.stateOf("ai-models")==="loading",title:s("settings.aiModelFetchTip"),className:"shrink-0 inline-flex items-center gap-1 rounded-lg bg-neutral-800 px-2 py-1.5 text-[11px] text-neutral-300 hover:bg-neutral-700 disabled:opacity-40",children:[o.jsx(lt,{state:F.stateOf("ai-models"),className:"h-3 w-3",icon:o.jsx(uc,{className:"h-3 w-3"})}),s("settings.aiModelFetch")]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("input",{type:x?"text":"password",value:k,readOnly:!L,onFocus:()=>C(!0),onBlur:()=>C(!1),onChange:ve=>{w(ve.target.value),ve.target.value!==""&&y(!1)},name:"weaveAiApiKey",autoComplete:"one-time-code",spellCheck:!1,autoCorrect:"off",autoCapitalize:"off","data-1p-ignore":!0,"data-lpignore":"true","data-bwignore":!0,placeholder:(Te=i==null?void 0:i.ai)!=null&&Te.apiKeySet?s("settings.aiApiKeySet"):s("settings.aiApiKeyUnset"),className:"min-w-0 flex-1 cursor-text rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500"}),o.jsx("button",{type:"button",onClick:()=>S(ve=>!ve),title:s(x?"settings.aiApiKeyHide":"settings.aiApiKeyShow"),className:"shrink-0 rounded-lg bg-neutral-800 px-2 py-1.5 text-neutral-300 hover:bg-neutral-700",children:x?o.jsx(w6,{className:"h-3.5 w-3.5"}):o.jsx(S6,{className:"h-3.5 w-3.5"})}),((xe=i==null?void 0:i.ai)==null?void 0:xe.apiKeySet)===!0&&o.jsx("button",{type:"button",onClick:()=>{w(""),y(!0)},className:"shrink-0 rounded-lg bg-neutral-800 px-2 py-1.5 text-[11px] text-neutral-300 hover:bg-neutral-700",children:s("settings.aiApiKeyClear")})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.aiHint")})]}),f&&o.jsx("p",{className:"text-[11px] text-red-400 break-all",children:f})]}),o.jsxs("footer",{className:"shrink-0 border-t border-edge/[0.06] px-4 py-2.5 flex items-center gap-2 frosted",children:[o.jsx("span",{className:"flex-1 text-[11px] text-neutral-500",children:i===null&&!f?s("common.loading"):""}),o.jsx("button",{onClick:t,className:"rounded-lg bg-neutral-800 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-700",children:s("common.cancel")}),o.jsx("button",{onClick:()=>void T(),disabled:i===null||p,className:"rounded-lg bg-blue-600 px-3 py-1.5 text-xs text-white hover:bg-blue-500 disabled:opacity-40 disabled:cursor-not-allowed",children:s(p?"common.saving":"common.save")})]})]})]}),document.body)}const hre="tasks",pre=nj.map(e=>e.key);function oC(e){return e!==void 0&&pre.includes(e)?e:hre}function cC(e){const t=e.split("/").filter(Boolean);if(t[0]==="g")return{kind:"global",category:oC(t[1])};if(t[0]==="p"){const n=Number(t[1]);return!Number.isInteger(n)||n<=0?{kind:"none"}:{kind:"project",projectId:n,category:oC(t[2]),sessionId:t[3]?decodeURIComponent(t[3]):null}}return{kind:"none"}}function mre(e){if(e.kind==="none")return"/";if(e.kind==="global")return`/g/${e.category}`;const t=`/p/${e.projectId}/${e.category}`;return e.sessionId===null?t:`${t}/${encodeURIComponent(e.sessionId)}`}let yy=typeof window>"u"?"/":window.location.pathname;const vy=new Set;function ky(e){if(yy!==e){yy=e;for(const t of vy)t()}}typeof window<"u"&&window.addEventListener("popstate",()=>ky(window.location.pathname));function gre(){return yy}function bre(e){return vy.add(e),()=>vy.delete(e)}function xre(){return b.useSyncExternalStore(bre,gre)}function Vi(e,t){const n=mre(e);if(typeof window>"u"||n===window.location.pathname){ky(n);return}t!=null&&t.replace?window.history.replaceState(null,"",n):window.history.pushState(null,"",n),ky(n)}const QO="zijing66/weave",yre=`https://github.com/${QO}`,WO="weave.github.stars",vre=6*60*60*1e3;function kre(e){if(e<1e3)return String(e);const t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1).replace(/\.0$/,"")}k`}function uC(){try{const e=localStorage.getItem(WO);if(!e)return null;const t=JSON.parse(e);return typeof t.count!="number"||typeof t.at!="number"||Date.now()-t.at>vre?null:t.count}catch{return null}}function wre(e){try{localStorage.setItem(WO,JSON.stringify({count:e,at:Date.now()}))}catch{}}function Sre(){const[e,t]=b.useState(()=>uC());return b.useEffect(()=>{if(uC()!==null)return;let n=!1;return(async()=>{try{const s=await fetch(`https://api.github.com/repos/${QO}`,{headers:{accept:"application/vnd.github+json"}});if(!s.ok)return;const r=await s.json();if(n||typeof r.stargazers_count!="number")return;wre(r.stargazers_count),t(r.stargazers_count)}catch{}})(),()=>{n=!0}},[]),e}function Nre(){const e=We(),t=dn(),[n,s]=b.useState(""),r=t.stateOf("login"),i=()=>{n&&t.run("login",async()=>{await G6(n)},{fail:a=>a instanceof vM&&a.status===401?e("auth.wrongPassword"):qe(a)})};return o.jsx("div",{className:"grid min-h-dvh place-items-center bg-neutral-950 px-4",children:o.jsxs("form",{className:"w-full max-w-xs rounded-2xl border border-neutral-800 bg-neutral-900/60 p-6",onSubmit:a=>{a.preventDefault(),i()},children:[o.jsxs("div",{className:"mb-5 flex items-center gap-2 text-neutral-200",children:[o.jsx("img",{src:"/weave-logo.svg",alt:"",className:"h-[18px] w-[18px] shrink-0"}),o.jsx("span",{className:"text-sm font-medium",children:e("auth.title")})]}),o.jsx("input",{type:"password",value:n,autoFocus:!0,autoComplete:"current-password",name:"weaveDashboardPassword",spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",onChange:a=>s(a.target.value),placeholder:e("auth.passwordPlaceholder"),className:"w-full rounded-lg border border-neutral-800 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 placeholder:text-neutral-600 focus:border-neutral-600 focus:outline-none"}),o.jsxs("button",{type:"submit",disabled:r==="loading"||n==="",className:"mt-3 flex w-full items-center justify-center gap-2 rounded-lg bg-neutral-200 px-3 py-2 text-sm font-medium text-neutral-900 transition-colors hover:bg-neutral-100 disabled:opacity-50",children:[o.jsx(lt,{state:r}),e("auth.login")]}),o.jsx("p",{className:"mt-4 text-[11px] leading-relaxed text-neutral-600",children:e("auth.hint")})]})})}const dC=176,fC=320,hC=260,pC=440,Ere=8e3,gh=(e,t,n)=>Math.min(n,Math.max(t,e)),_re={project:"skillGrid.scopeProject",user:"skillGrid.scopeUser"},Cre=(e,t,n)=>e.some(s=>s.harness===t&&s.key===n&&s.effective);function Tre(){const e=wM();return b.useEffect(()=>{SM()},[]),e==="unknown"?o.jsx("div",{className:"grid min-h-dvh place-items-center bg-neutral-950 text-xs text-neutral-600",children:"weave"}):e==="anonymous"?o.jsx(Nre,{}):o.jsx(Are,{})}function Are(){const e=We(),t=TA(),n=vp({queryKey:["projects"],queryFn:()=>Ce.listProjects(),staleTime:1/0,refetchOnWindowFocus:"always",retry:!1}),s=vp({queryKey:["projects","archived"],queryFn:()=>Ce.listArchivedProjects(),staleTime:1/0,refetchOnWindowFocus:"always",retry:!1}),r=n.data??[],i=s.data??[],a=b.useCallback(()=>{t.invalidateQueries({queryKey:["projects"]})},[t]),l=!n.isPending,c=xre(),u=Sre(),[d,f]=b.useState(null),[h,p]=b.useState(!1),[m,k]=b.useState([]),[w,g]=b.useState([]),{sessions:y,projectStats:x}=Wd(),[S,A]=b.useState(null),[E,M]=b.useState([]),[j,O]=b.useState([]),[N,F]=b.useState(null),[G,H]=b.useState(!1),[I,L]=b.useState([]),[C,D]=b.useState([]),[U,B]=b.useState({}),[R,_]=b.useState(null),{show:K}=tn(),T=b.useCallback(z=>{z&&K("error",z)},[K]),X=dn(),[ne,J]=b.useState(!1),pe=qk(),q=Si("(min-width: 1024px)"),Y=Si("(pointer: fine)"),[V,ee]=b.useState(null),[oe,ye]=b.useState("tasks"),[Re,se]=b.useState("packs"),[Q,Te]=b.useState(0),[xe,ve]=b.useState(null),[ge,$e]=b.useState(null),[dt,mt]=b.useState(()=>{const z=Number(localStorage.getItem("weave:col-left"));return Number.isFinite(z)&&z>0?gh(z,dC,fC):224}),[rt,ct]=b.useState(()=>{const z=Number(localStorage.getItem("weave:col-right"));return Number.isFinite(z)&&z>0?gh(z,hC,pC):288});b.useEffect(()=>localStorage.setItem("weave:col-left",String(dt)),[dt]),b.useEffect(()=>localStorage.setItem("weave:col-right",String(rt)),[rt]);const te=ed(Gd,{activationConstraint:{distance:5}}),re=ed(Pv,{activationConstraint:{delay:200,tolerance:8}}),Ae=Ov(Y?te:re);b.useEffect(()=>{n.isError&&n.data===void 0&&T(String(n.error))},[n.isError,n.data,n.error,T]);const[v,Z]=b.useState(null);b.useEffect(()=>{Ce.capabilities().then(Z).catch(()=>{})},[]);const[fe,be]=b.useState(null),he=b.useCallback(z=>{t.setQueryData(["projects"],le=>{if(!le)return le;const Ee=new Map(le.map(ze=>[ze.id,ze])),Se=z.map(ze=>Ee.get(ze)).filter(ze=>!!ze);for(const ze of le)z.includes(ze.id)||Se.push(ze);return Se}),Ce.reorderProjects(z).catch(le=>{T(e("errors.projectReorderFailed",{error:String(le)})),a()})},[t,T,e,a]),[P,ce]=b.useState({}),ue=b.useRef(P);ue.current=P;const _e=b.useRef(VR(Ere));b.useEffect(()=>{_e.current.poke()},[P]),b.useEffect(()=>()=>_e.current.releaseAll(),[]);const ke=b.useCallback(z=>{Ce.listAssets(z.path).then(k).catch(()=>{})},[]),we=b.useCallback(z=>{Ce.listMcp(z).then(O).catch(()=>{})},[]),Ne=b.useRef(new Map),Oe=b.useCallback(z=>{const le=Ne.current.get(z);if(le)return le;const Ee=Ce.listUpdates(z).finally(()=>Ne.current.delete(z));return Ne.current.set(z,Ee),Ee},[]),Me=b.useCallback(z=>{Oe(z).then(F).catch(()=>{})},[Oe]);b.useEffect(()=>{d&&N&&B(z=>({...z,[d.id]:{available:N.available,needsInit:N.needsInit}}))},[N,d]),b.useEffect(()=>H(!1),[d==null?void 0:d.id,N==null?void 0:N.available]);const Fe=b.useMemo(()=>N?[...N.skills.filter(z=>!z.custom&&z.outdated).map(z=>({kind:"app.updateKindSkill",name:z.name,scope:z.scope,note:null})),...N.mcp.filter(z=>!z.custom&&z.outdated).map(z=>({kind:"app.updateKindMcp",name:z.name,scope:z.scope,note:null})),...N.files.filter(z=>!z.custom&&z.outdated).map(z=>({kind:"app.updateKindFile",name:z.name,scope:z.scope,note:null})),...(N.pluginTemplates??[]).filter(z=>z.outdated).map(z=>({kind:"app.updateKindTemplate",name:z.name,scope:null,note:z.pluginId})),...(N.initFiles??[]).filter(z=>z.outdated&&z.syncClass==="auto").map(z=>({kind:"app.updateKindInit",name:z.relPath,scope:null,note:null}))]:[],[N]),De=b.useCallback(z=>{Ce.listGlobalSkills(z).then(L).catch(()=>{})},[]),He=b.useCallback(z=>{Ce.listPluginState(z).then(D).catch(()=>{})},[]),Ge=b.useCallback((z,le=!1)=>{!le&&U[z]!==void 0||Oe(z).then(Ee=>{B(Se=>({...Se,[z]:{available:Ee.available,needsInit:Ee.needsInit}}))}).catch(()=>{})},[U,Oe]),ft=b.useCallback(()=>{Ce.listHooksRules().then(M).catch(()=>{})},[]);b.useEffect(()=>{ft()},[ft]),b.useEffect(()=>(window.addEventListener("weave:rules-changed",ft),()=>window.removeEventListener("weave:rules-changed",ft)),[ft]);const St=b.useCallback(z=>{f(z),p(!1),k([]),O([]),F(null),L([]),D([]),_(null),$e(null),ye("tasks"),A(null),ve(null),T(null),Ce.listAssets(z.path).then(k).catch(le=>T(String(le))),we(z.id),Me(z.id),De(z.id),He(z.id),Ce.getStatusline(z.id).then(le=>ve(le.config.source)).catch(()=>{})},[we,Me,De,He]),Nt=b.useCallback(()=>{const z=d??r[0];p(!0),_(null),$e(null),ye("tasks"),A(null),ve(null),T(null),Ce.listGlobalFileAssets().then(g).catch(Ee=>T(String(Ee)));const le=(z==null?void 0:z.id)??0;De(le),He(le),we(le),Me(le)},[d,r,De,He,we,Me]);b.useEffect(()=>{h||d||!l||cC(c).kind==="none"&&(Nt(),Vi({kind:"global",category:oe},{replace:!0}))},[h,d,l,Nt,c,oe]),b.useEffect(()=>{if(!l)return;const z=cC(c);if(z.kind==="none")return;if(z.kind==="global"){h||Nt(),ye(z.category),A(null);return}const le=r.find(Ee=>Ee.id===z.projectId);if(!le){Vi({kind:"global",category:"tasks"},{replace:!0});return}(h||(d==null?void 0:d.id)!==le.id)&&St(le),ye(z.category),A(z.sessionId)},[c,l,r,h,d,St,Nt]);const _t=b.useMemo(()=>{var le;const z=new Set;for(const Ee of I)for(const Se of Ee.skills)z.add(Se.name);for(const Ee of m)if(Ee.category==="skill"){const Se=(le=Ee.relPath.match(/^[^/]+\/skills\/([^/]+)\//))==null?void 0:le[1];Se&&z.add(Se)}return z},[I,m]),jt=b.useMemo(()=>{var Ee;const z=new Set;for(const Se of m)if(Se.category==="skill"){const ze=(Ee=Se.relPath.match(/^[^/]+\/skills\/([^/]+)\//))==null?void 0:Ee[1];ze&&z.add(ze)}const le=j.filter(Se=>Se.harness==="claude").length;return{skill:z.size,mcp:le}},[m,j]),Rt=b.useMemo(()=>ad(I.map(z=>{const le=Xd(z.source);return{enabled:z.pluginKey&&le?Cre(C,le,z.pluginKey):void 0,skills:z.skills}})).effective,[I,C]),Wt=b.useMemo(()=>{const z=j.filter(Se=>!Se.installScopes.includes("project")).length,le=Se=>j.filter(ze=>ze.installScopes.includes("project")&&ze.scope===Se).length;if(h){const Se=((N==null?void 0:N.skills)??[]).filter(st=>st.scope==="user"&&st.outdated).length,ze=((N==null?void 0:N.mcp)??[]).filter(st=>st.scope==="user"&&st.outdated).length;return{files:Rt+le("user")+z+w.length,outdated:Se+ze,statuslineSource:null,hooksRules:E.length,sessions:(y==null?void 0:y.length)??0}}const Ee=m.filter(Se=>Se.category!=="skill"&&Se.category!=="mcp").length;return{files:jt.skill+Rt+le("project")+z+Ee,outdated:((N==null?void 0:N.skills)??[]).filter(Se=>Se.outdated).length+((N==null?void 0:N.mcp)??[]).filter(Se=>Se.outdated).length,statuslineSource:xe,hooksRules:E.filter(Se=>Se.projectId===null||Se.projectId===(d==null?void 0:d.id)).length,sessions:(y??[]).filter(Se=>Se.projectId===(d==null?void 0:d.id)).length}},[h,I,j,N,m,w,jt,C,Rt,xe,E,d,y]),ie=b.useMemo(()=>R?(h?w:m).find(le=>le.relPath===R)??null:null,[h,w,m,R]),Pe=b.useRef(d);b.useEffect(()=>{Pe.current=d},[d]),b.useEffect(()=>$r("projects",a),[a]),b.useEffect(()=>$r("toolkit",()=>{const z=d??r[0];z&&He(z.id)}),[d,r,He]),b.useEffect(()=>vx("project",a),[a]),b.useEffect(()=>Ai(z=>{if(z.kind==="watch.fired"){if(z.watcherSessionId!=null||typeof z.targetSessionId!="string")return;const ze=y==null?void 0:y.find(yn=>yn.sessionId===z.targetSessionId),st=Sn((ze==null?void 0:ze.title)??null,z.targetSessionId),Wn=e(z.reason==="turnEnd"?"tasks.watchTurnEnd":z.reason==="messageFailed"?"tasks.watchMsgFailed":"tasks.watchOn",{label:st});K("info",Wn),kS(e("tasks.watchNotifyTitle"),Wn,`weave-watch-${z.targetSessionId}`);return}if(typeof z.sessionId!="string")return;const le=y==null?void 0:y.find(ze=>ze.sessionId===z.sessionId),Ee=Sn((le==null?void 0:le.title)??null,z.sessionId),Se=e("tasks.questionPending",{label:Ee});K("info",Se),kS(e("tasks.questionPendingTitle"),Se,`weave-question-${z.sessionId}`)},["watch.fired","question.pending"]),[y,K,e]),b.useEffect(()=>ko("terminalTopology",z=>ce(z.counts)),[]),b.useEffect(()=>ko("updates",z=>B(z.counts??{})),[]),b.useEffect(()=>vx("asset",z=>{const le=Pe.current;!le||z.projectPath!==le.path||(k(Ee=>{if(z.kind==="unlink")return Ee.filter(st=>st.relPath!==z.relPath);const Se={absPath:z.absPath,relPath:z.relPath,category:z.category,mtimeMs:Date.now(),agent:z.agent,...z.isSymlink?{isSymlink:!0}:{}},ze=Ee.findIndex(st=>st.relPath===z.relPath);if(ze>=0){const st=[...Ee];return st[ze]=Se,st}return[...Ee,Se]}),z.category==="mcp"&&we(le.id),z.category==="skill"&&De(le.id),Me(le.id))}),[we,Me,De]);const Ie=b.useCallback(async(z,le="project",Ee=en[0]??"claude")=>{if(!d&&!h)return;const Se=d??r[0];if(!Se&&!(h&&le==="user"))return;const ze=(Se==null?void 0:Se.id)??0,st=await Ce.install(ze,{category:"skill",name:z.name,sourceDir:z.dirPath,scope:le,agent:Ee});if(!st.ok)throw new Error(`${st.status} ${await st.text()}`);Se&&ke(Se),De(ze),Me(ze)},[d,r,h,ke,De,Me]),Je=b.useCallback(async(z,le="project")=>{if(!d&&!h)return;const Ee=d??r[0];if(!Ee&&!(h&&le==="user"))return;const Se=(Ee==null?void 0:Ee.id)??0,ze=await Ce.install(Se,{category:z.category,name:z.name,sourceFile:z.filePath,scope:le});if(!ze.ok)throw new Error(`${ze.status} ${await ze.text()}`);Ee&&ke(Ee),Me(Se)},[d,r,h,ke,Me]),Ze=b.useCallback(async(z,le,Ee="project",Se=en[0]??"claude")=>{var pf;if(!d&&!h)return;const ze=d??r[0],st=((pf=ba("mcp",v).surfaces.find(Fm=>Fm.harness===Se))==null?void 0:pf.scopes)??[],Wn=st.includes(Ee)?Ee:st[0]??"user";if(!ze&&!(h&&Wn==="user"))return;const yn=(ze==null?void 0:ze.id)??0,Ha=await Ce.install(yn,{category:"mcp",name:z,mcpConfig:le,scope:Wn,agent:Se});if(!Ha.ok)throw new Error(`${Ha.status} ${await Ha.text()}`);ze&&ke(ze),we(yn),Me(yn)},[d,r,h,v,ke,we,Me]),Cn=b.useCallback(async(z,le="project",Ee)=>{const Se=d??r[0];if(!Se&&!(h&&le==="user"))return;const ze=(Se==null?void 0:Se.id)??0,st=await Ce.uninstall(ze,{category:"skill",name:z,scope:le,...Ee?{agent:Ee}:{}});if(!st.ok)throw new Error(`${st.status} ${await st.text()}`);Se&&ke(Se),De(ze),Me(ze)},[d,r,h,ke,De,Me]),Ht=b.useCallback(async(z,le="project",Ee)=>{const Se=d??r[0],ze=(Ee??en[0])==="claude"?le:"user";if(!Se&&!(h&&ze==="user"))return;const st=(Se==null?void 0:Se.id)??0,Wn=await Ce.uninstall(st,{category:"mcp",name:z,scope:ze,...Ee?{agent:Ee}:{}});if(!Wn.ok)throw new Error(`${Wn.status} ${await Wn.text()}`);Se&&ke(Se),we(st),Me(st)},[d,r,h,ke,we,Me]),Vr=b.useCallback(async(z,le)=>{const Ee=d??r[0];Ee&&(await Ce.putMcpEnable(Ee.id,z,le),we(Ee.id))},[d,r,we]),kr=b.useCallback(async z=>{const le=z??d??r[0];if(!le)return{updated:0};const Ee=await Ce.syncAll(le.id);if(!Ee.ok)throw new Error(`${Ee.status} ${await Ee.text()}`);const Se=await Ee.json().catch(()=>null);return!h&&d&&le.id===d.id?(Me(le.id),ke(le)):Ge(le.id,!0),{updated:Array.isArray(Se==null?void 0:Se.updated)?Se.updated.length:0}},[d,r,h,Me,ke,Ge]),ks=b.useCallback(async(z,le,Ee,Se)=>{const ze=d??r[0];if(!ze)return;const st=await Ce.updateAsset(ze.id,{category:z,name:le,scope:Ee,...(z==="skill"||z==="mcp")&&Se?{agent:Se}:{}});if(!st.ok)throw new Error(`${st.status} ${await st.text()}`);Me(ze.id),ke(ze),z==="mcp"&&we(ze.id),z==="skill"&&De(ze.id)},[d,r,Me,ke,we,De]),Ii=b.useCallback(z=>X.stateOf(`sync:${z}`),[X]),Xn=b.useCallback(z=>X.run(`sync:${z.id}`,async()=>{const{updated:le}=await kr(z);le>0?K("success",e("toast.synced",{n:le})):K("info",e("toast.nothingToSync"))},{fail:le=>e("errors.syncFailed",{error:qe(le)})}),[X,kr,K,e]),Li=b.useCallback((z,le)=>void X.run(`open-${le}:${z.id}`,async()=>{const Ee=ue.current[z.id]??0;await Ce.openProject(z.id,le),le==="terminal"&&await _e.current.wait(`count:${z.id}`,()=>(ue.current[z.id]??0)>Ee)},{fail:Ee=>e("errors.openFailed",{error:qe(Ee)})}),[X,e]),Xr=b.useCallback(z=>X.stateOf(`open-explorer:${z}`),[X]),Qr=b.useCallback(z=>X.stateOf(`open-terminal:${z}`),[X]),Wr=b.useCallback((z,le)=>void X.run(`close-terminal:${z.id}`,async()=>{const Ee=ue.current[z.id]??0,Se=await Ce.closeProjectTerminal(z.id,le);await _e.current.wait(`close:${z.id}`,()=>(ue.current[z.id]??0)<Ee),K("success",e("toast.terminalsClosed",{n:Se.closed}))},{fail:Ee=>e("errors.closeTerminalFailed",{error:qe(Ee)})}),[X,K,e]),Zr=b.useCallback(z=>X.stateOf(`close-terminal:${z}`),[X]),Qn=b.useCallback(z=>void X.run(`archive:${z.id}`,async()=>{const{purged:le}=await Ce.archiveProject(z.id);if(K("success",e("toast.projectArchived",{name:z.name,sessions:le.sessions,events:le.events})),(d==null?void 0:d.id)===z.id){const Ee=r.find(Se=>Se.id!==z.id);Vi(Ee?{kind:"project",projectId:Ee.id,category:"tasks",sessionId:null}:{kind:"global",category:"tasks"},{replace:!0})}a()},{fail:le=>e("errors.archiveFailed",{error:qe(le)})}),[X,d,r,K,e,a]),wr=b.useCallback(z=>void X.run(`restore:${z.id}`,async()=>{await Ce.restoreProject(z.id),K("success",e("toast.projectRestored",{name:z.name})),a()},{fail:le=>e("errors.restoreFailed",{error:qe(le)})}),[X,K,e,a]),ws=b.useCallback(z=>X.stateOf(`restore:${z}`),[X]),Pi=b.useCallback(async(z,le,Ee,Se)=>{const ze=d??r[0];ze&&(await Ce.putPluginState(ze.id,z,le,Ee,Se),He(ze.id),De(ze.id))},[d,r,He,De]),Sr=b.useCallback(async(z,le)=>{const Ee=d??r[0];Ee&&(await Ce.uninstallPluginPack(Ee.id,{runtime:z,key:le}),De(Ee.id),He(Ee.id))},[d,r,De,He]),Tn=b.useCallback((z,le,Ee)=>{Ie(z,le,Ee).catch(Se=>K("error",e("errors.installFailed",{error:qe(Se)})))},[Ie,K,e]),Jr=b.useCallback((z,le)=>{Je(z,le).catch(Ee=>K("error",e("errors.installFailed",{error:qe(Ee)})))},[Je,K,e]),Nr=b.useCallback((z,le,Ee,Se)=>{Ze(z,le,Ee,Se).catch(ze=>K("error",e("errors.mcpInstallFailed",{error:qe(ze)})))},[Ze,K,e]),An=b.useCallback((z,le,Ee,Se)=>{ks(z,le,Ee,Se).catch(ze=>K("error",e("errors.updateFailed",{error:qe(ze)})))},[ks,K,e]),za=b.useCallback((z,le,Ee)=>{Cn(z,le,Ee).catch(Se=>K("error",e("errors.uninstallFailed",{error:qe(Se)})))},[Cn,K,e]),Ua=b.useCallback(z=>{Vi(h||!d?{kind:"global",category:z}:{kind:"project",projectId:d.id,category:z,sessionId:null}),z==="personalization"&&Te(le=>le+1),z==="weave"&&ft()},[h,d,ft]),Ls=b.useCallback((z,le)=>{r.some(Ee=>Ee.id===z)&&Vi({kind:"project",projectId:z,category:"tasks",sessionId:le})},[r]),tr=b.useCallback(z=>{var Ee;const le=(d==null?void 0:d.id)??((Ee=r[0])==null?void 0:Ee.id);le!==void 0&&Vi({kind:"project",projectId:le,category:"tasks",sessionId:z})},[d,r]);function ei(z){be(z.active.data.current??null)}function Fa(z){const{active:le,over:Ee}=z,Se=le.data.current;if(be(null),!Ee||Ee.id!=="project-assets"||!Se)return;const ze=h?"user":"project",st=Oo(Se.attrs,{scope:ze,agent:Se.targetAgent});if(!st.ok){st.reasonKey&&T(e(st.reasonKey));return}Se.installKind==="skill"&&Se.sourceDir&&Se.name?Tn({name:Se.name,dirPath:Se.sourceDir},ze,Se.targetAgent):Se.installKind==="file"&&Se.sourceFile&&Se.name?Jr({name:Se.name,filePath:Se.sourceFile,category:Se.category},ze):Se.installKind==="mcp"&&Se.mcpConfig&&Se.name&&Nr(Se.name,Se.mcpConfig,ze,Se.targetAgent)}const Ba=b.useMemo(()=>{if(!ge||ge.scope==="user")return[];const{name:z,agent:le}=ge;return m.filter(Ee=>{var ze;return((ze=Ee.relPath.match(/^[^/]+\/skills\/([^/]+)\//))==null?void 0:ze[1])===z&&(!le||Ee.agent===le)})},[ge,m]),Hn=b.useMemo(()=>ge?N==null?void 0:N.skills.find(z=>z.name===ge.name&&z.scope===ge.scope):void 0,[ge,N]),an=h?"global":"project",Dn=d??r[0],Er=(Dn==null?void 0:Dn.id)??0,_r=!!Dn||h,Cr=l?o.jsx(K9,{projects:r,selectedId:d==null?void 0:d.id,globalActive:h,onSelect:z=>{Vi({kind:"project",projectId:z.id,category:"tasks",sessionId:null}),ee(null)},onSelectGlobal:()=>{Vi({kind:"global",category:"tasks"}),ee(null)},onOpenExplorer:z=>Li(z,"explorer"),onOpenTerminal:z=>Li(z,"terminal"),openExplorerStateOf:Xr,openTerminalStateOf:Qr,onCloseTerminal:Wr,closeTerminalStateOf:Zr,onHoverProject:Ge,updatesOf:z=>{var le;return(le=U[z])==null?void 0:le.available},needsInitOf:z=>{var le;return(le=U[z])==null?void 0:le.needsInit},syncStateOf:Ii,onSyncNow:z=>void Xn(z),sessionStatsOf:z=>x.get(z),terminalsOf:z=>P[z]??0,onReorder:he,archivedProjects:i,onArchive:Qn,onRestore:wr,restoreStateOf:ws}):o.jsx(jm,{rows:7}),W=_r?o.jsx(Jse,{installedSkillNames:_t,onInstallSkill:Tn,onInstallFileAsset:Jr,onInstallMcp:Nr,updates:N,onUpdateAsset:An,category:oe,scope:h?"user":"project",capabilities:v,projectId:Er,onSyncAll:Dn?()=>void Xn(Dn):()=>{}}):o.jsx("div",{className:"p-3 text-xs text-neutral-500",children:e("app.selectProjectForAssets")});return o.jsxs(zv,{sensors:Ae,onDragStart:ei,onDragEnd:Fa,onDragCancel:()=>be(null),children:[o.jsx("div",{className:"h-dvh p-0 lg:p-4 bg-neutral-950",children:o.jsxs("div",{className:"h-full flex flex-col rounded-none lg:rounded-2xl border border-edge/[0.08] bg-neutral-900/40 shadow-mac overflow-hidden",children:[o.jsxs("div",{className:"h-11 shrink-0 flex items-center gap-2 lg:gap-3 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx("button",{onClick:()=>ee("projects"),className:de("rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",q&&"hidden"),title:e("app.mobileProjects"),children:o.jsx(z6,{className:"h-4 w-4"})}),o.jsx(Mre,{}),o.jsx("img",{src:"/weave-logo.svg",alt:"",className:"h-[18px] w-[18px] shrink-0"}),o.jsx("span",{className:"text-sm font-semibold tracking-tight text-neutral-200",children:"Weave"}),o.jsx("span",{className:"text-xs text-neutral-500",children:e("app.projectCount",{n:r.length})}),o.jsx("button",{onClick:()=>ee("library"),className:de("rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",(q||!_r)&&"hidden"),title:e("app.mobileLibrary"),children:o.jsx(uM,{className:"h-4 w-4"})}),o.jsxs("a",{href:yre,target:"_blank",rel:"noreferrer","aria-label":"GitHub",className:"ml-auto inline-flex items-center gap-1 rounded-lg px-1.5 py-1 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",children:[o.jsx(_6,{className:"h-4 w-4"}),u!==null&&o.jsx("span",{className:"text-[11px] tabular-nums",children:kre(u)})]}),o.jsx("button",{onClick:AJ,className:"p-1.5 rounded-lg text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:e(pe==="dark"?"app.themeToLight":"app.themeToDark"),"aria-label":e(pe==="dark"?"app.themeToLight":"app.themeToDark"),children:pe==="dark"?o.jsx(F6,{className:"h-4 w-4"}):o.jsx(P6,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>J(!0),className:"p-1.5 rounded-lg text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:e("app.settingsTooltip"),children:o.jsx(gM,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>void K6(),className:"p-1.5 rounded-lg text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:e("auth.logout"),children:o.jsx(I6,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[q&&o.jsxs(o.Fragment,{children:[o.jsx("aside",{style:{width:dt},className:"shrink-0 border-r border-edge/[0.06] frosted overflow-y-auto",children:Cr}),o.jsx(my,{onResize:z=>mt(le=>gh(le+z,dC,fC)),title:e("app.resizeLeft")})]}),o.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden relative",children:[_r?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative px-4 py-2 border-b border-edge/[0.06] flex flex-wrap items-center gap-x-3 gap-y-1",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h2",{className:"text-sm font-semibold truncate",children:h?e("app.globalTitle"):(d==null?void 0:d.name)??""}),o.jsx("p",{className:"text-[11px] text-neutral-500 truncate",children:h?e("app.globalSubtitle"):(d==null?void 0:d.path)??""})]}),!h&&N&&N.available>0&&o.jsxs("span",{className:"contents lg:relative lg:inline-block lg:shrink-0",children:[o.jsxs("button",{onClick:()=>H(z=>!z),"aria-expanded":G,title:e("app.updateListTip"),className:de("shrink-0 inline-flex items-center gap-1 rounded-full bg-orange-900/40 text-orange-300 px-2.5 py-1 text-xs font-medium hover:bg-orange-900/60",G&&"ring-1 ring-orange-500/50"),children:[N.available===1?e("app.updateCountOne"):e("app.updateCount",{n:N.available}),o.jsx(_n,{className:de("h-3 w-3 transition-transform",G&&"rotate-180")})]}),G&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-20",onClick:()=>H(!1)}),o.jsxs("div",{className:"absolute left-4 right-4 top-full z-30 mt-1 overflow-hidden rounded-xl border border-edge/[0.08] bg-neutral-900 shadow-mac lg:left-auto lg:right-0 lg:w-[320px]",children:[o.jsx("p",{className:"border-b border-edge/[0.06] px-3 py-2 text-[11px] text-neutral-500",children:e("app.updateListTitle",{n:Fe.length})}),o.jsx("ul",{className:"max-h-[min(45dvh,320px)] overflow-y-auto py-1",children:Fe.map(z=>o.jsxs("li",{className:"flex items-baseline gap-2 px-3 py-1",children:[o.jsx("span",{className:"shrink-0 rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] text-neutral-400",children:e(z.kind)}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",title:z.name,children:z.name}),z.scope&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:e(_re[z.scope])}),z.note&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:z.note})]},`${z.kind}:${z.name}`))})]})]})]}),!h&&N&&N.available>0&&o.jsxs("button",{onClick:()=>void X.run("sync:all",async()=>{const{updated:z}=await kr();z>0?K("success",e("toast.synced",{n:z})):K("info",e("toast.nothingToSync"))},{fail:z=>e("errors.syncFailed",{error:qe(z)})}),title:`${e("app.syncAllTooltip",{n:N.available})}
593
+
594
+ ${e("app.scopeCoverageTooltip")}`,className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-blue-900/40 text-blue-300 px-2.5 py-1 text-xs font-medium hover:bg-blue-900/60",children:[o.jsx(lt,{state:X.stateOf("sync:all"),className:"h-3 w-3"}),e("app.syncAll")]}),!h&&(N==null?void 0:N.needsInit)&&o.jsx("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-amber-900/40 text-amber-300 px-2.5 py-1 text-xs font-medium",title:e("project.needsInitTip"),children:e("project.needsInit")}),!h&&d&&o.jsx("span",{className:"shrink-0 hidden lg:inline-flex rounded-full bg-neutral-800/60 text-neutral-500 px-2.5 py-1 text-[11px]",title:e("app.scopeCoverageTooltip"),children:e("app.scopeCoverageChip")})]}),o.jsx(cU,{category:oe,onSelect:Ua,data:Wt}),o.jsx("div",{className:de("flex-1 relative",oe==="tasks"&&!h?"overflow-hidden !p-0":"overflow-y-auto p-3"),children:l?o.jsx(rte,{projectId:Er,mode:an,category:oe,resourceView:Re,onResourceViewChange:se,statuslineNonce:Q,assets:m,globalAssets:w,mcpRows:j,updates:N,globalSkillGroups:I,pluginRows:C,statuslineSource:xe,onUninstallSkill:Cn,onUninstallMcp:Ht,onCycleMcpEnable:Vr,onCyclePluginState:Pi,onUninstallPlugin:Sr,onOpenFile:z=>{_(z),$e(null)},onOpenSkillDetail:(z,le,Ee,Se,ze)=>{_(null),$e({name:z,scope:le,source:Ee,pluginKey:Se,agent:ze})},projects:r,onOpenSession:Ls,onSelectSession:tr,initialSessionId:S??void 0,dragPayload:fe}):o.jsx(dK,{})})]}):o.jsx("div",{className:"flex-1 flex items-center justify-center text-neutral-500 text-sm",children:e("app.selectProject")}),R&&Dn&&o.jsx(cre,{projectId:Dn.id,relPath:R,global:h,agent:ie==null?void 0:ie.agent,onClose:()=>_(null)}),ge&&o.jsx(Xse,{projectId:(Dn==null?void 0:Dn.id)??0,name:ge.name,scope:ge.scope,source:ge.source,pluginKey:ge.pluginKey,agent:ge.agent,files:Ba,readOnly:!h&&ge.scope==="user",outdated:(Hn==null?void 0:Hn.outdated)??!1,custom:(Hn==null?void 0:Hn.custom)??!1,onUninstall:()=>{za(ge.name,ge.scope,ge.agent),$e(null)},onClose:()=>$e(null)},`${ge.scope}-${ge.name}`)]}),q&&o.jsxs(o.Fragment,{children:[o.jsx(my,{onResize:z=>ct(le=>gh(le-z,hC,pC)),title:e("app.resizeRight")}),o.jsx("aside",{style:{width:rt},className:"shrink-0 border-l border-edge/[0.06] frosted overflow-hidden",children:W})]})]})]})}),!q&&V!==null&&o.jsxs("div",{className:"fixed inset-0 z-40",children:[o.jsx("button",{"aria-label":e("app.mobileDrawerClose"),onClick:()=>ee(null),className:"absolute inset-0 bg-black/60 drawer-fade"}),o.jsxs("aside",{className:de("absolute top-0 bottom-0 w-[min(88vw,360px)] bg-neutral-900 border-edge/[0.08] shadow-mac flex flex-col",V==="projects"?"left-0 border-r drawer-left":"right-0 border-l drawer-right"),children:[o.jsxs("div",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx("span",{className:"text-sm font-semibold tracking-tight text-neutral-200",children:e(V==="projects"?"app.mobileProjects":"app.mobileLibrary")}),o.jsx("button",{onClick:()=>ee(null),className:"ml-auto rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:e("app.mobileDrawerClose"),children:o.jsx(Vt,{className:"h-4 w-4"})})]}),V==="projects"?o.jsx("div",{className:"flex-1 overflow-y-auto",children:Cr}):o.jsx("div",{className:"flex-1 overflow-hidden",children:W})]})]}),o.jsx(fre,{open:ne,onClose:()=>J(!1)}),o.jsx(HZ,{})]})}function Mre(){return o.jsxs("div",{className:"hidden sm:flex gap-1.5 shrink-0",children:[o.jsx("span",{className:"h-3 w-3 rounded-full bg-mac-red"}),o.jsx("span",{className:"h-3 w-3 rounded-full bg-mac-yellow"}),o.jsx("span",{className:"h-3 w-3 rounded-full bg-mac-green"})]})}const jre=new jL({defaultOptions:{queries:{staleTime:1/0,refetchOnWindowFocus:!1,retry:!1}}});"serviceWorker"in navigator&&window.isSecureContext&&navigator.serviceWorker.register("/sw.js").catch(()=>{});rL.createRoot(document.getElementById("root")).render(o.jsx(ss.StrictMode,{children:o.jsx(iL,{client:jre,children:o.jsx(D9,{children:o.jsx($9,{children:o.jsx(oU,{children:o.jsx(Tre,{})})})})})}));