agent-nuvira 3.3.8 → 3.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -50
- package/dist/agents/agents/planner.d.ts.map +1 -1
- package/dist/agents/agents/planner.js +41 -0
- package/dist/agents/agents/planner.js.map +1 -1
- package/dist/agents/agents/reasoner.d.ts.map +1 -1
- package/dist/agents/agents/reasoner.js +6 -0
- package/dist/agents/agents/reasoner.js.map +1 -1
- package/dist/agents/agents/runner.d.ts +6 -0
- package/dist/agents/agents/runner.d.ts.map +1 -1
- package/dist/agents/agents/runner.js +82 -5
- package/dist/agents/agents/runner.js.map +1 -1
- package/dist/agents/agents/writer-tool-calling.d.ts.map +1 -1
- package/dist/agents/agents/writer-tool-calling.js +5 -2
- package/dist/agents/agents/writer-tool-calling.js.map +1 -1
- package/dist/agents/agents/writer.d.ts.map +1 -1
- package/dist/agents/agents/writer.js +8 -4
- package/dist/agents/agents/writer.js.map +1 -1
- package/dist/agents/fanout-scheduler.d.ts +72 -0
- package/dist/agents/fanout-scheduler.d.ts.map +1 -0
- package/dist/agents/fanout-scheduler.js +100 -0
- package/dist/agents/fanout-scheduler.js.map +1 -0
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +30 -1
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/agents/plan-quality.d.ts +58 -0
- package/dist/agents/plan-quality.d.ts.map +1 -0
- package/dist/agents/plan-quality.js +152 -0
- package/dist/agents/plan-quality.js.map +1 -0
- package/dist/agents/prompt-assembly.d.ts +8 -0
- package/dist/agents/prompt-assembly.d.ts.map +1 -1
- package/dist/agents/prompt-assembly.js +18 -0
- package/dist/agents/prompt-assembly.js.map +1 -1
- package/dist/agents/step-handoff.d.ts +12 -2
- package/dist/agents/step-handoff.d.ts.map +1 -1
- package/dist/agents/step-handoff.js +65 -8
- package/dist/agents/step-handoff.js.map +1 -1
- package/dist/agents/tool-calling-agent.d.ts.map +1 -1
- package/dist/agents/tool-calling-agent.js +18 -0
- package/dist/agents/tool-calling-agent.js.map +1 -1
- package/dist/cli/cache.d.ts.map +1 -1
- package/dist/cli/cache.js +34 -4
- package/dist/cli/cache.js.map +1 -1
- package/dist/cli/chat.d.ts +6 -0
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +79 -18
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/cli-program.d.ts.map +1 -1
- package/dist/cli/cli-program.js +6 -0
- package/dist/cli/cli-program.js.map +1 -1
- package/dist/cli/config.d.ts +10 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +179 -1
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/continuity.d.ts +61 -0
- package/dist/cli/continuity.d.ts.map +1 -0
- package/dist/cli/continuity.js +112 -0
- package/dist/cli/continuity.js.map +1 -0
- package/dist/cli/dashboard.d.ts +3 -1
- package/dist/cli/dashboard.d.ts.map +1 -1
- package/dist/cli/dashboard.js +5 -16
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +48 -1
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/execute.d.ts +8 -0
- package/dist/cli/execute.d.ts.map +1 -1
- package/dist/cli/execute.js +34 -1
- package/dist/cli/execute.js.map +1 -1
- package/dist/cli/loop-executor.d.ts +24 -0
- package/dist/cli/loop-executor.d.ts.map +1 -1
- package/dist/cli/loop-executor.js +134 -13
- package/dist/cli/loop-executor.js.map +1 -1
- package/dist/cli/website.d.ts +25 -0
- package/dist/cli/website.d.ts.map +1 -0
- package/dist/cli/website.js +58 -0
- package/dist/cli/website.js.map +1 -0
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/config/manager.js +35 -0
- package/dist/config/manager.js.map +1 -1
- package/dist/config/process-env.d.ts.map +1 -1
- package/dist/config/process-env.js +20 -0
- package/dist/config/process-env.js.map +1 -1
- package/dist/config/provider-env.d.ts +2 -1
- package/dist/config/provider-env.d.ts.map +1 -1
- package/dist/config/provider-env.js +19 -2
- package/dist/config/provider-env.js.map +1 -1
- package/dist/config/service-catalog.d.ts +81 -0
- package/dist/config/service-catalog.d.ts.map +1 -0
- package/dist/config/service-catalog.js +286 -0
- package/dist/config/service-catalog.js.map +1 -0
- package/dist/config/service-probe.d.ts +27 -0
- package/dist/config/service-probe.d.ts.map +1 -0
- package/dist/config/service-probe.js +104 -0
- package/dist/config/service-probe.js.map +1 -0
- package/dist/config/types.d.ts +63 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/context/cache.d.ts +46 -2
- package/dist/context/cache.d.ts.map +1 -1
- package/dist/context/cache.js +85 -7
- package/dist/context/cache.js.map +1 -1
- package/dist/findings/verdicts.d.ts +59 -0
- package/dist/findings/verdicts.d.ts.map +1 -1
- package/dist/findings/verdicts.js +117 -0
- package/dist/findings/verdicts.js.map +1 -1
- package/dist/forwarded.d.ts +2 -0
- package/dist/forwarded.d.ts.map +1 -0
- package/dist/forwarded.js +2 -0
- package/dist/forwarded.js.map +1 -0
- package/dist/gateway/registry.d.ts.map +1 -1
- package/dist/gateway/registry.js +9 -0
- package/dist/gateway/registry.js.map +1 -1
- package/dist/learning/auto-router.d.ts +30 -0
- package/dist/learning/auto-router.d.ts.map +1 -1
- package/dist/learning/auto-router.js +69 -12
- package/dist/learning/auto-router.js.map +1 -1
- package/dist/learning/context-assembly.d.ts +37 -0
- package/dist/learning/context-assembly.d.ts.map +1 -0
- package/dist/learning/context-assembly.js +63 -0
- package/dist/learning/context-assembly.js.map +1 -0
- package/dist/learning/reasoning-trace.d.ts +26 -5
- package/dist/learning/reasoning-trace.d.ts.map +1 -1
- package/dist/learning/reasoning-trace.js +21 -1
- package/dist/learning/reasoning-trace.js.map +1 -1
- package/dist/learning/session-digest.d.ts +78 -0
- package/dist/learning/session-digest.d.ts.map +1 -0
- package/dist/learning/session-digest.js +185 -0
- package/dist/learning/session-digest.js.map +1 -0
- package/dist/learning/session-recall.d.ts +135 -0
- package/dist/learning/session-recall.d.ts.map +1 -0
- package/dist/learning/session-recall.js +305 -0
- package/dist/learning/session-recall.js.map +1 -0
- package/dist/learning/session-store.d.ts +172 -0
- package/dist/learning/session-store.d.ts.map +1 -0
- package/dist/learning/session-store.js +424 -0
- package/dist/learning/session-store.js.map +1 -0
- package/dist/learning/step-checkpoint.d.ts +28 -0
- package/dist/learning/step-checkpoint.d.ts.map +1 -1
- package/dist/learning/step-checkpoint.js +90 -6
- package/dist/learning/step-checkpoint.js.map +1 -1
- package/dist/learning/working-state.d.ts +19 -0
- package/dist/learning/working-state.d.ts.map +1 -1
- package/dist/learning/working-state.js +34 -1
- package/dist/learning/working-state.js.map +1 -1
- package/dist/parity/drivers.d.ts.map +1 -1
- package/dist/parity/drivers.js +29 -0
- package/dist/parity/drivers.js.map +1 -1
- package/dist/parity/wire-fixtures.d.ts +88 -0
- package/dist/parity/wire-fixtures.d.ts.map +1 -0
- package/dist/parity/wire-fixtures.js +405 -0
- package/dist/parity/wire-fixtures.js.map +1 -0
- package/dist/tools/artifact-append.d.ts +23 -0
- package/dist/tools/artifact-append.d.ts.map +1 -1
- package/dist/tools/artifact-append.js +28 -0
- package/dist/tools/artifact-append.js.map +1 -1
- package/dist/tools/ask-user.d.ts +5 -0
- package/dist/tools/ask-user.d.ts.map +1 -1
- package/dist/tools/ask-user.js +51 -5
- package/dist/tools/ask-user.js.map +1 -1
- package/dist/tools/child-agent-entry.js +1 -0
- package/dist/tools/child-agent-entry.js.map +1 -1
- package/dist/tools/child-agent-runtime.d.ts +7 -0
- package/dist/tools/child-agent-runtime.d.ts.map +1 -1
- package/dist/tools/child-agent-runtime.js +116 -6
- package/dist/tools/child-agent-runtime.js.map +1 -1
- package/dist/tools/child-agent-worker.d.ts +15 -0
- package/dist/tools/child-agent-worker.d.ts.map +1 -0
- package/dist/tools/child-agent-worker.js.map +1 -0
- package/dist/tools/coding-tools.d.ts.map +1 -1
- package/dist/tools/coding-tools.js +11 -0
- package/dist/tools/coding-tools.js.map +1 -1
- package/dist/tools/finding-tool.d.ts +6 -1
- package/dist/tools/finding-tool.d.ts.map +1 -1
- package/dist/tools/finding-tool.js +15 -2
- package/dist/tools/finding-tool.js.map +1 -1
- package/dist/tools/followup-utils.d.ts +35 -0
- package/dist/tools/followup-utils.d.ts.map +1 -1
- package/dist/tools/followup-utils.js +36 -0
- package/dist/tools/followup-utils.js.map +1 -1
- package/dist/tools/loop-project-context.d.ts +4 -1
- package/dist/tools/loop-project-context.d.ts.map +1 -1
- package/dist/tools/loop-project-context.js +48 -1
- package/dist/tools/loop-project-context.js.map +1 -1
- package/dist/tools/loop-skill-hint.d.ts.map +1 -1
- package/dist/tools/loop-skill-hint.js +7 -0
- package/dist/tools/loop-skill-hint.js.map +1 -1
- package/dist/tools/modality/image-gen.d.ts +25 -6
- package/dist/tools/modality/image-gen.d.ts.map +1 -1
- package/dist/tools/modality/image-gen.js +46 -27
- package/dist/tools/modality/image-gen.js.map +1 -1
- package/dist/tools/modality/image-providers.d.ts +71 -0
- package/dist/tools/modality/image-providers.d.ts.map +1 -0
- package/dist/tools/modality/image-providers.js +277 -0
- package/dist/tools/modality/image-providers.js.map +1 -0
- package/dist/tools/registry.d.ts +10 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +35 -8
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/run-cli.d.ts.map +1 -1
- package/dist/tools/run-cli.js +39 -1
- package/dist/tools/run-cli.js.map +1 -1
- package/dist/tools/run-terminal.d.ts.map +1 -1
- package/dist/tools/run-terminal.js +50 -6
- package/dist/tools/run-terminal.js.map +1 -1
- package/dist/tools/subagent-spawner.d.ts +8 -0
- package/dist/tools/subagent-spawner.d.ts.map +1 -1
- package/dist/tools/subagent-spawner.js +3 -0
- package/dist/tools/subagent-spawner.js.map +1 -1
- package/dist/tools/tool-loop.d.ts +55 -0
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +136 -0
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/tools/untrusted-content.d.ts +29 -0
- package/dist/tools/untrusted-content.d.ts.map +1 -0
- package/dist/tools/untrusted-content.js +53 -0
- package/dist/tools/untrusted-content.js.map +1 -0
- package/dist/tools/web-research.d.ts +76 -14
- package/dist/tools/web-research.d.ts.map +1 -1
- package/dist/tools/web-research.js +280 -35
- package/dist/tools/web-research.js.map +1 -1
- package/dist/utils/effect-verification.d.ts +115 -0
- package/dist/utils/effect-verification.d.ts.map +1 -0
- package/dist/utils/effect-verification.js +337 -0
- package/dist/utils/effect-verification.js.map +1 -0
- package/dist/utils/open-url.d.ts +16 -0
- package/dist/utils/open-url.d.ts.map +1 -0
- package/dist/utils/open-url.js +32 -0
- package/dist/utils/open-url.js.map +1 -0
- package/dist/utils/project-env.d.ts +146 -0
- package/dist/utils/project-env.d.ts.map +1 -0
- package/dist/utils/project-env.js +584 -0
- package/dist/utils/project-env.js.map +1 -0
- package/dist/utils/shell.d.ts +7 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +2 -0
- package/dist/utils/shell.js.map +1 -1
- package/dist/web-dashboard/chat-console.d.ts +2 -0
- package/dist/web-dashboard/chat-console.d.ts.map +1 -1
- package/dist/web-dashboard/chat-console.js +7 -0
- package/dist/web-dashboard/chat-console.js.map +1 -1
- package/dist/web-dashboard/server.d.ts +3 -1
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +534 -8
- package/dist/web-dashboard/server.js.map +1 -1
- package/dist/web-dashboard/src/types.d.ts +150 -1
- package/dist/web-dashboard/src/types.d.ts.map +1 -1
- package/dist/web-dashboard/workspace-guard.d.ts +40 -0
- package/dist/web-dashboard/workspace-guard.d.ts.map +1 -0
- package/dist/web-dashboard/workspace-guard.js +92 -0
- package/dist/web-dashboard/workspace-guard.js.map +1 -0
- package/package.json +3 -1
- package/src/web-dashboard/public/assets/index-Beportyl.js +207 -0
- package/src/web-dashboard/public/assets/index-Beportyl.js.map +1 -0
- package/src/web-dashboard/public/assets/index-gtQyg9nm.css +1 -0
- package/src/web-dashboard/public/index.html +2 -2
- package/src/web-dashboard/public/assets/index-J3sGSCLr.js +0 -207
- package/src/web-dashboard/public/assets/index-J3sGSCLr.js.map +0 -1
- package/src/web-dashboard/public/assets/index-u7mu-fxK.css +0 -1
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
var i$=Object.defineProperty;var s$=(e,t,n)=>t in e?i$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xr=(e,t,n)=>s$(e,typeof t!="symbol"?t+"":t,n);function o$(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q_={exports:{}},rp={},K_={exports:{}},Be={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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 zu=Symbol.for("react.element"),l$=Symbol.for("react.portal"),c$=Symbol.for("react.fragment"),u$=Symbol.for("react.strict_mode"),d$=Symbol.for("react.profiler"),f$=Symbol.for("react.provider"),h$=Symbol.for("react.context"),p$=Symbol.for("react.forward_ref"),m$=Symbol.for("react.suspense"),g$=Symbol.for("react.memo"),v$=Symbol.for("react.lazy"),_0=Symbol.iterator;function y$(e){return e===null||typeof e!="object"?null:(e=_0&&e[_0]||e["@@iterator"],typeof e=="function"?e:null)}var V_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y_=Object.assign,X_={};function ll(e,t,n){this.props=e,this.context=t,this.refs=X_,this.updater=n||V_}ll.prototype.isReactComponent={};ll.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ll.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Q_(){}Q_.prototype=ll.prototype;function zb(e,t,n){this.props=e,this.context=t,this.refs=X_,this.updater=n||V_}var Fb=zb.prototype=new Q_;Fb.constructor=zb;Y_(Fb,ll.prototype);Fb.isPureReactComponent=!0;var A0=Array.isArray,Z_=Object.prototype.hasOwnProperty,Ub={current:null},J_={key:!0,ref:!0,__self:!0,__source:!0};function eA(e,t,n){var r,a={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Z_.call(t,r)&&!J_.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:zu,type:e,key:s,ref:o,props:a,_owner:Ub.current}}function b$(e,t){return{$$typeof:zu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Wb(e){return typeof e=="object"&&e!==null&&e.$$typeof===zu}function x$(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var C0=/\/+/g;function km(e,t){return typeof e=="object"&&e!==null&&e.key!=null?x$(""+e.key):t.toString(36)}function sf(e,t,n,r,a){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case zu:case l$:o=!0}}if(o)return o=e,a=a(o),e=r===""?"."+km(o,0):r,A0(a)?(n="",e!=null&&(n=e.replace(C0,"$&/")+"/"),sf(a,t,n,"",function(u){return u})):a!=null&&(Wb(a)&&(a=b$(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(C0,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",A0(e))for(var l=0;l<e.length;l++){s=e[l];var c=r+km(s,l);o+=sf(s,t,n,c,a)}else if(c=y$(e),typeof c=="function")for(e=c.call(e),l=0;!(s=e.next()).done;)s=s.value,c=r+km(s,l++),o+=sf(s,t,n,c,a);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function hd(e,t,n){if(e==null)return e;var r=[],a=0;return sf(e,r,"","",function(s){return t.call(n,s,a++)}),r}function w$(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 $n={current:null},of={transition:null},S$={ReactCurrentDispatcher:$n,ReactCurrentBatchConfig:of,ReactCurrentOwner:Ub};function tA(){throw Error("act(...) is not supported in production builds of React.")}Be.Children={map:hd,forEach:function(e,t,n){hd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return hd(e,function(){t++}),t},toArray:function(e){return hd(e,function(t){return t})||[]},only:function(e){if(!Wb(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Be.Component=ll;Be.Fragment=c$;Be.Profiler=d$;Be.PureComponent=zb;Be.StrictMode=u$;Be.Suspense=m$;Be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S$;Be.act=tA;Be.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Y_({},e.props),a=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Ub.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Z_.call(t,c)&&!J_.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:zu,type:e.type,key:a,ref:s,props:r,_owner:o}};Be.createContext=function(e){return e={$$typeof:h$,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:f$,_context:e},e.Consumer=e};Be.createElement=eA;Be.createFactory=function(e){var t=eA.bind(null,e);return t.type=e,t};Be.createRef=function(){return{current:null}};Be.forwardRef=function(e){return{$$typeof:p$,render:e}};Be.isValidElement=Wb;Be.lazy=function(e){return{$$typeof:v$,_payload:{_status:-1,_result:e},_init:w$}};Be.memo=function(e,t){return{$$typeof:g$,type:e,compare:t===void 0?null:t}};Be.startTransition=function(e){var t=of.transition;of.transition={};try{e()}finally{of.transition=t}};Be.unstable_act=tA;Be.useCallback=function(e,t){return $n.current.useCallback(e,t)};Be.useContext=function(e){return $n.current.useContext(e)};Be.useDebugValue=function(){};Be.useDeferredValue=function(e){return $n.current.useDeferredValue(e)};Be.useEffect=function(e,t){return $n.current.useEffect(e,t)};Be.useId=function(){return $n.current.useId()};Be.useImperativeHandle=function(e,t,n){return $n.current.useImperativeHandle(e,t,n)};Be.useInsertionEffect=function(e,t){return $n.current.useInsertionEffect(e,t)};Be.useLayoutEffect=function(e,t){return $n.current.useLayoutEffect(e,t)};Be.useMemo=function(e,t){return $n.current.useMemo(e,t)};Be.useReducer=function(e,t,n){return $n.current.useReducer(e,t,n)};Be.useRef=function(e){return $n.current.useRef(e)};Be.useState=function(e){return $n.current.useState(e)};Be.useSyncExternalStore=function(e,t,n){return $n.current.useSyncExternalStore(e,t,n)};Be.useTransition=function(){return $n.current.useTransition()};Be.version="18.3.1";K_.exports=Be;var k=K_.exports;const G=Qe(k),k$=o$({__proto__:null,default:G},[k]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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 j$=k,N$=Symbol.for("react.element"),E$=Symbol.for("react.fragment"),_$=Object.prototype.hasOwnProperty,A$=j$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,C$={key:!0,ref:!0,__self:!0,__source:!0};function nA(e,t,n){var r,a={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)_$.call(t,r)&&!C$.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:N$,type:e,key:s,ref:o,props:a,_owner:A$.current}}rp.Fragment=E$;rp.jsx=nA;rp.jsxs=nA;q_.exports=rp;var i=q_.exports,rA={exports:{}},or={},aA={exports:{}},iA={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its 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(O,U){var C=O.length;O.push(U);e:for(;0<C;){var Z=C-1>>>1,D=O[Z];if(0<a(D,U))O[Z]=U,O[C]=D,C=Z;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var U=O[0],C=O.pop();if(C!==U){O[0]=C;e:for(var Z=0,D=O.length,P=D>>>1;Z<P;){var ie=2*(Z+1)-1,ve=O[ie],pe=ie+1,Te=O[pe];if(0>a(ve,C))pe<D&&0>a(Te,ve)?(O[Z]=Te,O[pe]=C,Z=pe):(O[Z]=ve,O[ie]=C,Z=ie);else if(pe<D&&0>a(Te,C))O[Z]=Te,O[pe]=C,Z=pe;else break e}}return U}function a(O,U){var C=O.sortIndex-U.sortIndex;return C!==0?C:O.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(O){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=O)r(u),U.sortIndex=U.expirationTime,t(c,U);else break;U=n(u)}}function j(O){if(m=!1,S(O),!g)if(n(c)!==null)g=!0,z(w);else{var U=n(u);U!==null&&$(j,U.startTime-O)}}function w(O,U){g=!1,m&&(m=!1,v(E),E=-1),p=!0;var C=h;try{for(S(U),f=n(c);f!==null&&(!(f.expirationTime>U)||O&&!M());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var D=Z(f.expirationTime<=U);U=e.unstable_now(),typeof D=="function"?f.callback=D:f===n(c)&&r(c),S(U)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var ie=n(u);ie!==null&&$(j,ie.startTime-U),P=!1}return P}finally{f=null,h=C,p=!1}}var b=!1,N=null,E=-1,T=5,A=-1;function M(){return!(e.unstable_now()-A<T)}function R(){if(N!==null){var O=e.unstable_now();A=O;var U=!0;try{U=N(!0,O)}finally{U?B():(b=!1,N=null)}}else b=!1}var B;if(typeof x=="function")B=function(){x(R)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,F=L.port2;L.port1.onmessage=R,B=function(){F.postMessage(null)}}else B=function(){y(R,0)};function z(O){N=O,b||(b=!0,B())}function $(O,U){E=y(function(){O(e.unstable_now())},U)}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(O){O.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,z(w))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(O){switch(h){case 1:case 2:case 3:var U=3;break;default:U=h}var C=h;h=U;try{return O()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,U){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var C=h;h=O;try{return U()}finally{h=C}},e.unstable_scheduleCallback=function(O,U,C){var Z=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?Z+C:Z):C=Z,O){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=C+D,O={id:d++,callback:U,priorityLevel:O,startTime:C,expirationTime:D,sortIndex:-1},C>Z?(O.sortIndex=C,t(u,O),n(c)===null&&O===n(u)&&(m?(v(E),E=-1):m=!0,$(j,C-Z))):(O.sortIndex=D,t(c,O),g||p||(g=!0,z(w))),O},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(O){var U=h;return function(){var C=h;h=U;try{return O.apply(this,arguments)}finally{h=C}}}})(iA);aA.exports=iA;var T$=aA.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its 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 O$=k,ir=T$;function le(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var sA=new Set,Mc={};function _s(e,t){Oo(e,t),Oo(e+"Capture",t)}function Oo(e,t){for(Mc[e]=t,e=0;e<t.length;e++)sA.add(t[e])}var Ra=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rv=Object.prototype.hasOwnProperty,P$=/^[: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]*$/,T0={},O0={};function R$(e){return rv.call(O0,e)?!0:rv.call(T0,e)?!1:P$.test(e)?O0[e]=!0:(T0[e]=!0,!1)}function M$(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function I$(e,t,n,r){if(t===null||typeof t>"u"||M$(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ln(e,t,n,r,a,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var mn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mn[e]=new Ln(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mn[t]=new Ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mn[e]=new Ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mn[e]=new Ln(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){mn[e]=new Ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mn[e]=new Ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mn[e]=new Ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mn[e]=new Ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mn[e]=new Ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var Hb=/[\-:]([a-z])/g;function Gb(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Hb,Gb);mn[t]=new Ln(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Hb,Gb);mn[t]=new Ln(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Hb,Gb);mn[t]=new Ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!1,!1)});mn.xlinkHref=new Ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function qb(e,t,n,r){var a=mn.hasOwnProperty(t)?mn[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(I$(t,n,a,r)&&(n=null),r||a===null?R$(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var za=O$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,pd=Symbol.for("react.element"),no=Symbol.for("react.portal"),ro=Symbol.for("react.fragment"),Kb=Symbol.for("react.strict_mode"),av=Symbol.for("react.profiler"),oA=Symbol.for("react.provider"),lA=Symbol.for("react.context"),Vb=Symbol.for("react.forward_ref"),iv=Symbol.for("react.suspense"),sv=Symbol.for("react.suspense_list"),Yb=Symbol.for("react.memo"),ti=Symbol.for("react.lazy"),cA=Symbol.for("react.offscreen"),P0=Symbol.iterator;function Fl(e){return e===null||typeof e!="object"?null:(e=P0&&e[P0]||e["@@iterator"],typeof e=="function"?e:null)}var _t=Object.assign,jm;function uc(e){if(jm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);jm=t&&t[1]||""}return`
|
|
34
|
+
`+jm+e}var Nm=!1;function Em(e,t){if(!e||Nm)return"";Nm=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var a=u.stack.split(`
|
|
35
|
+
`),s=r.stack.split(`
|
|
36
|
+
`),o=a.length-1,l=s.length-1;1<=o&&0<=l&&a[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==s[l]){var c=`
|
|
37
|
+
`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Nm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?uc(e):""}function $$(e){switch(e.tag){case 5:return uc(e.type);case 16:return uc("Lazy");case 13:return uc("Suspense");case 19:return uc("SuspenseList");case 0:case 2:case 15:return e=Em(e.type,!1),e;case 11:return e=Em(e.type.render,!1),e;case 1:return e=Em(e.type,!0),e;default:return""}}function ov(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ro:return"Fragment";case no:return"Portal";case av:return"Profiler";case Kb:return"StrictMode";case iv:return"Suspense";case sv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case lA:return(e.displayName||"Context")+".Consumer";case oA:return(e._context.displayName||"Context")+".Provider";case Vb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Yb:return t=e.displayName||null,t!==null?t:ov(e.type)||"Memo";case ti:t=e._payload,e=e._init;try{return ov(e(t))}catch{}}return null}function L$(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ov(t);case 8:return t===Kb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ni(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function D$(e){var t=uA(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function md(e){e._valueTracker||(e._valueTracker=D$(e))}function dA(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=uA(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lv(e,t){var n=t.checked;return _t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function R0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ni(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function fA(e,t){t=t.checked,t!=null&&qb(e,"checked",t,!1)}function cv(e,t){fA(e,t);var n=Ni(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uv(e,t.type,n):t.hasOwnProperty("defaultValue")&&uv(e,t.type,Ni(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function M0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function uv(e,t,n){(t!=="number"||wf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var dc=Array.isArray;function xo(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Ni(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function dv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(le(91));return _t({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function I0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(le(92));if(dc(n)){if(1<n.length)throw Error(le(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ni(n)}}function hA(e,t){var n=Ni(t.value),r=Ni(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function $0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function pA(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fv(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?pA(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gd,mA=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(gd=gd||document.createElement("div"),gd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=gd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ic(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var vc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},B$=["Webkit","ms","Moz","O"];Object.keys(vc).forEach(function(e){B$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),vc[t]=vc[e]})});function gA(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||vc.hasOwnProperty(e)&&vc[e]?(""+t).trim():t+"px"}function vA(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=gA(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var z$=_t({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function hv(e,t){if(t){if(z$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(le(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(le(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(le(61))}if(t.style!=null&&typeof t.style!="object")throw Error(le(62))}}function pv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mv=null;function Xb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gv=null,wo=null,So=null;function L0(e){if(e=Wu(e)){if(typeof gv!="function")throw Error(le(280));var t=e.stateNode;t&&(t=lp(t),gv(e.stateNode,e.type,t))}}function yA(e){wo?So?So.push(e):So=[e]:wo=e}function bA(){if(wo){var e=wo,t=So;if(So=wo=null,L0(e),t)for(e=0;e<t.length;e++)L0(t[e])}}function xA(e,t){return e(t)}function wA(){}var _m=!1;function SA(e,t,n){if(_m)return e(t,n);_m=!0;try{return xA(e,t,n)}finally{_m=!1,(wo!==null||So!==null)&&(wA(),bA())}}function $c(e,t){var n=e.stateNode;if(n===null)return null;var r=lp(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(le(231,t,typeof n));return n}var vv=!1;if(Ra)try{var Ul={};Object.defineProperty(Ul,"passive",{get:function(){vv=!0}}),window.addEventListener("test",Ul,Ul),window.removeEventListener("test",Ul,Ul)}catch{vv=!1}function F$(e,t,n,r,a,s,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var yc=!1,Sf=null,kf=!1,yv=null,U$={onError:function(e){yc=!0,Sf=e}};function W$(e,t,n,r,a,s,o,l,c){yc=!1,Sf=null,F$.apply(U$,arguments)}function H$(e,t,n,r,a,s,o,l,c){if(W$.apply(this,arguments),yc){if(yc){var u=Sf;yc=!1,Sf=null}else throw Error(le(198));kf||(kf=!0,yv=u)}}function As(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 kA(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 D0(e){if(As(e)!==e)throw Error(le(188))}function G$(e){var t=e.alternate;if(!t){if(t=As(e),t===null)throw Error(le(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return D0(a),e;if(s===r)return D0(a),t;s=s.sibling}throw Error(le(188))}if(n.return!==r.return)n=a,r=s;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=s;break}if(l===r){o=!0,r=a,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=a;break}if(l===r){o=!0,r=s,n=a;break}l=l.sibling}if(!o)throw Error(le(189))}}if(n.alternate!==r)throw Error(le(190))}if(n.tag!==3)throw Error(le(188));return n.stateNode.current===n?e:t}function jA(e){return e=G$(e),e!==null?NA(e):null}function NA(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=NA(e);if(t!==null)return t;e=e.sibling}return null}var EA=ir.unstable_scheduleCallback,B0=ir.unstable_cancelCallback,q$=ir.unstable_shouldYield,K$=ir.unstable_requestPaint,It=ir.unstable_now,V$=ir.unstable_getCurrentPriorityLevel,Qb=ir.unstable_ImmediatePriority,_A=ir.unstable_UserBlockingPriority,jf=ir.unstable_NormalPriority,Y$=ir.unstable_LowPriority,AA=ir.unstable_IdlePriority,ap=null,ia=null;function X$(e){if(ia&&typeof ia.onCommitFiberRoot=="function")try{ia.onCommitFiberRoot(ap,e,void 0,(e.current.flags&128)===128)}catch{}}var Fr=Math.clz32?Math.clz32:J$,Q$=Math.log,Z$=Math.LN2;function J$(e){return e>>>=0,e===0?32:31-(Q$(e)/Z$|0)|0}var vd=64,yd=4194304;function fc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Nf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?r=fc(l):(s&=o,s!==0&&(r=fc(s)))}else o=n&~a,o!==0?r=fc(o):s!==0&&(r=fc(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,s=t&-t,a>=s||a===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Fr(t),a=1<<n,r|=e[n],t&=~a;return r}function eL(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tL(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Fr(s),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=eL(l,t)):c<=t&&(e.expiredLanes|=l),s&=~l}}function bv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function CA(){var e=vd;return vd<<=1,!(vd&4194240)&&(vd=64),e}function Am(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Fu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fr(t),e[t]=n}function nL(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-Fr(n),s=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~s}}function Zb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fr(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var et=0;function TA(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var OA,Jb,PA,RA,MA,xv=!1,bd=[],pi=null,mi=null,gi=null,Lc=new Map,Dc=new Map,ai=[],rL="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function z0(e,t){switch(e){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":mi=null;break;case"mouseover":case"mouseout":gi=null;break;case"pointerover":case"pointerout":Lc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dc.delete(t.pointerId)}}function Wl(e,t,n,r,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[a]},t!==null&&(t=Wu(t),t!==null&&Jb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function aL(e,t,n,r,a){switch(t){case"focusin":return pi=Wl(pi,e,t,n,r,a),!0;case"dragenter":return mi=Wl(mi,e,t,n,r,a),!0;case"mouseover":return gi=Wl(gi,e,t,n,r,a),!0;case"pointerover":var s=a.pointerId;return Lc.set(s,Wl(Lc.get(s)||null,e,t,n,r,a)),!0;case"gotpointercapture":return s=a.pointerId,Dc.set(s,Wl(Dc.get(s)||null,e,t,n,r,a)),!0}return!1}function IA(e){var t=es(e.target);if(t!==null){var n=As(t);if(n!==null){if(t=n.tag,t===13){if(t=kA(n),t!==null){e.blockedOn=t,MA(e.priority,function(){PA(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 lf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mv=r,n.target.dispatchEvent(r),mv=null}else return t=Wu(n),t!==null&&Jb(t),e.blockedOn=n,!1;t.shift()}return!0}function F0(e,t,n){lf(e)&&n.delete(t)}function iL(){xv=!1,pi!==null&&lf(pi)&&(pi=null),mi!==null&&lf(mi)&&(mi=null),gi!==null&&lf(gi)&&(gi=null),Lc.forEach(F0),Dc.forEach(F0)}function Hl(e,t){e.blockedOn===t&&(e.blockedOn=null,xv||(xv=!0,ir.unstable_scheduleCallback(ir.unstable_NormalPriority,iL)))}function Bc(e){function t(a){return Hl(a,e)}if(0<bd.length){Hl(bd[0],e);for(var n=1;n<bd.length;n++){var r=bd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(pi!==null&&Hl(pi,e),mi!==null&&Hl(mi,e),gi!==null&&Hl(gi,e),Lc.forEach(t),Dc.forEach(t),n=0;n<ai.length;n++)r=ai[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ai.length&&(n=ai[0],n.blockedOn===null);)IA(n),n.blockedOn===null&&ai.shift()}var ko=za.ReactCurrentBatchConfig,Ef=!0;function sL(e,t,n,r){var a=et,s=ko.transition;ko.transition=null;try{et=1,ex(e,t,n,r)}finally{et=a,ko.transition=s}}function oL(e,t,n,r){var a=et,s=ko.transition;ko.transition=null;try{et=4,ex(e,t,n,r)}finally{et=a,ko.transition=s}}function ex(e,t,n,r){if(Ef){var a=wv(e,t,n,r);if(a===null)Dm(e,t,r,_f,n),z0(e,r);else if(aL(a,e,t,n,r))r.stopPropagation();else if(z0(e,r),t&4&&-1<rL.indexOf(e)){for(;a!==null;){var s=Wu(a);if(s!==null&&OA(s),s=wv(e,t,n,r),s===null&&Dm(e,t,r,_f,n),s===a)break;a=s}a!==null&&r.stopPropagation()}else Dm(e,t,r,null,n)}}var _f=null;function wv(e,t,n,r){if(_f=null,e=Xb(r),e=es(e),e!==null)if(t=As(e),t===null)e=null;else if(n=t.tag,n===13){if(e=kA(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 _f=e,null}function $A(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(V$()){case Qb:return 1;case _A:return 4;case jf:case Y$:return 16;case AA:return 536870912;default:return 16}default:return 16}}var ci=null,tx=null,cf=null;function LA(){if(cf)return cf;var e,t=tx,n=t.length,r,a="value"in ci?ci.value:ci.textContent,s=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[s-r];r++);return cf=a.slice(e,1<r?1-r:void 0)}function uf(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 xd(){return!0}function U0(){return!1}function lr(e){function t(n,r,a,s,o){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?xd:U0,this.isPropagationStopped=U0,this}return _t(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=xd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=xd)},persist:function(){},isPersistent:xd}),t}var cl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nx=lr(cl),Uu=_t({},cl,{view:0,detail:0}),lL=lr(Uu),Cm,Tm,Gl,ip=_t({},Uu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rx,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!==Gl&&(Gl&&e.type==="mousemove"?(Cm=e.screenX-Gl.screenX,Tm=e.screenY-Gl.screenY):Tm=Cm=0,Gl=e),Cm)},movementY:function(e){return"movementY"in e?e.movementY:Tm}}),W0=lr(ip),cL=_t({},ip,{dataTransfer:0}),uL=lr(cL),dL=_t({},Uu,{relatedTarget:0}),Om=lr(dL),fL=_t({},cl,{animationName:0,elapsedTime:0,pseudoElement:0}),hL=lr(fL),pL=_t({},cl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mL=lr(pL),gL=_t({},cl,{data:0}),H0=lr(gL),vL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yL={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"},bL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xL(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bL[e])?!!t[e]:!1}function rx(){return xL}var wL=_t({},Uu,{key:function(e){if(e.key){var t=vL[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=uf(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yL[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rx,charCode:function(e){return e.type==="keypress"?uf(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?uf(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),SL=lr(wL),kL=_t({},ip,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),G0=lr(kL),jL=_t({},Uu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rx}),NL=lr(jL),EL=_t({},cl,{propertyName:0,elapsedTime:0,pseudoElement:0}),_L=lr(EL),AL=_t({},ip,{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}),CL=lr(AL),TL=[9,13,27,32],ax=Ra&&"CompositionEvent"in window,bc=null;Ra&&"documentMode"in document&&(bc=document.documentMode);var OL=Ra&&"TextEvent"in window&&!bc,DA=Ra&&(!ax||bc&&8<bc&&11>=bc),q0=" ",K0=!1;function BA(e,t){switch(e){case"keyup":return TL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ao=!1;function PL(e,t){switch(e){case"compositionend":return zA(t);case"keypress":return t.which!==32?null:(K0=!0,q0);case"textInput":return e=t.data,e===q0&&K0?null:e;default:return null}}function RL(e,t){if(ao)return e==="compositionend"||!ax&&BA(e,t)?(e=LA(),cf=tx=ci=null,ao=!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 DA&&t.locale!=="ko"?null:t.data;default:return null}}var ML={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 V0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ML[e.type]:t==="textarea"}function FA(e,t,n,r){yA(r),t=Af(t,"onChange"),0<t.length&&(n=new nx("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xc=null,zc=null;function IL(e){ZA(e,0)}function sp(e){var t=oo(e);if(dA(t))return e}function $L(e,t){if(e==="change")return t}var UA=!1;if(Ra){var Pm;if(Ra){var Rm="oninput"in document;if(!Rm){var Y0=document.createElement("div");Y0.setAttribute("oninput","return;"),Rm=typeof Y0.oninput=="function"}Pm=Rm}else Pm=!1;UA=Pm&&(!document.documentMode||9<document.documentMode)}function X0(){xc&&(xc.detachEvent("onpropertychange",WA),zc=xc=null)}function WA(e){if(e.propertyName==="value"&&sp(zc)){var t=[];FA(t,zc,e,Xb(e)),SA(IL,t)}}function LL(e,t,n){e==="focusin"?(X0(),xc=t,zc=n,xc.attachEvent("onpropertychange",WA)):e==="focusout"&&X0()}function DL(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sp(zc)}function BL(e,t){if(e==="click")return sp(t)}function zL(e,t){if(e==="input"||e==="change")return sp(t)}function FL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qr=typeof Object.is=="function"?Object.is:FL;function Fc(e,t){if(qr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!rv.call(t,a)||!qr(e[a],t[a]))return!1}return!0}function Q0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Z0(e,t){var n=Q0(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Q0(n)}}function HA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?HA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function GA(){for(var e=window,t=wf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wf(e.document)}return t}function ix(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function UL(e){var t=GA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&HA(n.ownerDocument.documentElement,n)){if(r!==null&&ix(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,s=Math.min(r.start,a);r=r.end===void 0?s:Math.min(r.end,a),!e.extend&&s>r&&(a=r,r=s,s=a),a=Z0(n,s);var o=Z0(n,r);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var WL=Ra&&"documentMode"in document&&11>=document.documentMode,io=null,Sv=null,wc=null,kv=!1;function J0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kv||io==null||io!==wf(r)||(r=io,"selectionStart"in r&&ix(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wc&&Fc(wc,r)||(wc=r,r=Af(Sv,"onSelect"),0<r.length&&(t=new nx("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=io)))}function wd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var so={animationend:wd("Animation","AnimationEnd"),animationiteration:wd("Animation","AnimationIteration"),animationstart:wd("Animation","AnimationStart"),transitionend:wd("Transition","TransitionEnd")},Mm={},qA={};Ra&&(qA=document.createElement("div").style,"AnimationEvent"in window||(delete so.animationend.animation,delete so.animationiteration.animation,delete so.animationstart.animation),"TransitionEvent"in window||delete so.transitionend.transition);function op(e){if(Mm[e])return Mm[e];if(!so[e])return e;var t=so[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qA)return Mm[e]=t[n];return e}var KA=op("animationend"),VA=op("animationiteration"),YA=op("animationstart"),XA=op("transitionend"),QA=new Map,eS="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ai(e,t){QA.set(e,t),_s(t,[e])}for(var Im=0;Im<eS.length;Im++){var $m=eS[Im],HL=$m.toLowerCase(),GL=$m[0].toUpperCase()+$m.slice(1);Ai(HL,"on"+GL)}Ai(KA,"onAnimationEnd");Ai(VA,"onAnimationIteration");Ai(YA,"onAnimationStart");Ai("dblclick","onDoubleClick");Ai("focusin","onFocus");Ai("focusout","onBlur");Ai(XA,"onTransitionEnd");Oo("onMouseEnter",["mouseout","mouseover"]);Oo("onMouseLeave",["mouseout","mouseover"]);Oo("onPointerEnter",["pointerout","pointerover"]);Oo("onPointerLeave",["pointerout","pointerover"]);_s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));_s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));_s("onBeforeInput",["compositionend","keypress","textInput","paste"]);_s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));_s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));_s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hc="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(" "),qL=new Set("cancel close invalid load scroll toggle".split(" ").concat(hc));function tS(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,H$(r,t,void 0,e),e.currentTarget=null}function ZA(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==s&&a.isPropagationStopped())break e;tS(a,l,u),s=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==s&&a.isPropagationStopped())break e;tS(a,l,u),s=c}}}if(kf)throw e=yv,kf=!1,yv=null,e}function ht(e,t){var n=t[Av];n===void 0&&(n=t[Av]=new Set);var r=e+"__bubble";n.has(r)||(JA(t,e,2,!1),n.add(r))}function Lm(e,t,n){var r=0;t&&(r|=4),JA(n,e,r,t)}var Sd="_reactListening"+Math.random().toString(36).slice(2);function Uc(e){if(!e[Sd]){e[Sd]=!0,sA.forEach(function(n){n!=="selectionchange"&&(qL.has(n)||Lm(n,!1,e),Lm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sd]||(t[Sd]=!0,Lm("selectionchange",!1,t))}}function JA(e,t,n,r){switch($A(t)){case 1:var a=sL;break;case 4:a=oL;break;default:a=ex}n=a.bind(null,t,n,e),a=void 0,!vv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Dm(e,t,n,r,a){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=es(l),o===null)return;if(c=o.tag,c===5||c===6){r=s=o;continue e}l=l.parentNode}}r=r.return}SA(function(){var u=s,d=Xb(n),f=[];e:{var h=QA.get(e);if(h!==void 0){var p=nx,g=e;switch(e){case"keypress":if(uf(n)===0)break e;case"keydown":case"keyup":p=SL;break;case"focusin":g="focus",p=Om;break;case"focusout":g="blur",p=Om;break;case"beforeblur":case"afterblur":p=Om;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=W0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=uL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=NL;break;case KA:case VA:case YA:p=hL;break;case XA:p=_L;break;case"scroll":p=lL;break;case"wheel":p=CL;break;case"copy":case"cut":case"paste":p=mL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=G0}var m=(t&4)!==0,y=!m&&e==="scroll",v=m?h!==null?h+"Capture":null:h;m=[];for(var x=u,S;x!==null;){S=x;var j=S.stateNode;if(S.tag===5&&j!==null&&(S=j,v!==null&&(j=$c(x,v),j!=null&&m.push(Wc(x,j,S)))),y)break;x=x.return}0<m.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==mv&&(g=n.relatedTarget||n.fromElement)&&(es(g)||g[Ma]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?es(g):null,g!==null&&(y=As(g),g!==y||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(m=W0,j="onMouseLeave",v="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(m=G0,j="onPointerLeave",v="onPointerEnter",x="pointer"),y=p==null?h:oo(p),S=g==null?h:oo(g),h=new m(j,x+"leave",p,n,d),h.target=y,h.relatedTarget=S,j=null,es(d)===u&&(m=new m(v,x+"enter",g,n,d),m.target=S,m.relatedTarget=y,j=m),y=j,p&&g)t:{for(m=p,v=g,x=0,S=m;S;S=Hs(S))x++;for(S=0,j=v;j;j=Hs(j))S++;for(;0<x-S;)m=Hs(m),x--;for(;0<S-x;)v=Hs(v),S--;for(;x--;){if(m===v||v!==null&&m===v.alternate)break t;m=Hs(m),v=Hs(v)}m=null}else m=null;p!==null&&nS(f,h,p,m,!1),g!==null&&y!==null&&nS(f,y,g,m,!0)}}e:{if(h=u?oo(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var w=$L;else if(V0(h))if(UA)w=zL;else{w=DL;var b=LL}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(w=BL);if(w&&(w=w(e,u))){FA(f,w,n,d);break e}b&&b(e,h,u),e==="focusout"&&(b=h._wrapperState)&&b.controlled&&h.type==="number"&&uv(h,"number",h.value)}switch(b=u?oo(u):window,e){case"focusin":(V0(b)||b.contentEditable==="true")&&(io=b,Sv=u,wc=null);break;case"focusout":wc=Sv=io=null;break;case"mousedown":kv=!0;break;case"contextmenu":case"mouseup":case"dragend":kv=!1,J0(f,n,d);break;case"selectionchange":if(WL)break;case"keydown":case"keyup":J0(f,n,d)}var N;if(ax)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else ao?BA(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(DA&&n.locale!=="ko"&&(ao||E!=="onCompositionStart"?E==="onCompositionEnd"&&ao&&(N=LA()):(ci=d,tx="value"in ci?ci.value:ci.textContent,ao=!0)),b=Af(u,E),0<b.length&&(E=new H0(E,e,null,n,d),f.push({event:E,listeners:b}),N?E.data=N:(N=zA(n),N!==null&&(E.data=N)))),(N=OL?PL(e,n):RL(e,n))&&(u=Af(u,"onBeforeInput"),0<u.length&&(d=new H0("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=N))}ZA(f,t)})}function Wc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Af(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,s=a.stateNode;a.tag===5&&s!==null&&(a=s,s=$c(e,n),s!=null&&r.unshift(Wc(e,s,a)),s=$c(e,t),s!=null&&r.push(Wc(e,s,a))),e=e.return}return r}function Hs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function nS(e,t,n,r,a){for(var s=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,a?(c=$c(n,s),c!=null&&o.unshift(Wc(n,c,l))):a||(c=$c(n,s),c!=null&&o.push(Wc(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var KL=/\r\n?/g,VL=/\u0000|\uFFFD/g;function rS(e){return(typeof e=="string"?e:""+e).replace(KL,`
|
|
38
|
+
`).replace(VL,"")}function kd(e,t,n){if(t=rS(t),rS(e)!==t&&n)throw Error(le(425))}function Cf(){}var jv=null,Nv=null;function Ev(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var _v=typeof setTimeout=="function"?setTimeout:void 0,YL=typeof clearTimeout=="function"?clearTimeout:void 0,aS=typeof Promise=="function"?Promise:void 0,XL=typeof queueMicrotask=="function"?queueMicrotask:typeof aS<"u"?function(e){return aS.resolve(null).then(e).catch(QL)}:_v;function QL(e){setTimeout(function(){throw e})}function Bm(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Bc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Bc(t)}function vi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function iS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ul=Math.random().toString(36).slice(2),ta="__reactFiber$"+ul,Hc="__reactProps$"+ul,Ma="__reactContainer$"+ul,Av="__reactEvents$"+ul,ZL="__reactListeners$"+ul,JL="__reactHandles$"+ul;function es(e){var t=e[ta];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ma]||n[ta]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=iS(e);e!==null;){if(n=e[ta])return n;e=iS(e)}return t}e=n,n=e.parentNode}return null}function Wu(e){return e=e[ta]||e[Ma],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function oo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(le(33))}function lp(e){return e[Hc]||null}var Cv=[],lo=-1;function Ci(e){return{current:e}}function vt(e){0>lo||(e.current=Cv[lo],Cv[lo]=null,lo--)}function dt(e,t){lo++,Cv[lo]=e.current,e.current=t}var Ei={},En=Ci(Ei),Wn=Ci(!1),gs=Ei;function Po(e,t){var n=e.type.contextTypes;if(!n)return Ei;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},s;for(s in n)a[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Hn(e){return e=e.childContextTypes,e!=null}function Tf(){vt(Wn),vt(En)}function sS(e,t,n){if(En.current!==Ei)throw Error(le(168));dt(En,t),dt(Wn,n)}function eC(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(le(108,L$(e)||"Unknown",a));return _t({},n,r)}function Of(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ei,gs=En.current,dt(En,e),dt(Wn,Wn.current),!0}function oS(e,t,n){var r=e.stateNode;if(!r)throw Error(le(169));n?(e=eC(e,t,gs),r.__reactInternalMemoizedMergedChildContext=e,vt(Wn),vt(En),dt(En,e)):vt(Wn),dt(Wn,n)}var ka=null,cp=!1,zm=!1;function tC(e){ka===null?ka=[e]:ka.push(e)}function eD(e){cp=!0,tC(e)}function Ti(){if(!zm&&ka!==null){zm=!0;var e=0,t=et;try{var n=ka;for(et=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ka=null,cp=!1}catch(a){throw ka!==null&&(ka=ka.slice(e+1)),EA(Qb,Ti),a}finally{et=t,zm=!1}}return null}var co=[],uo=0,Pf=null,Rf=0,vr=[],yr=0,vs=null,ja=1,Na="";function Gi(e,t){co[uo++]=Rf,co[uo++]=Pf,Pf=e,Rf=t}function nC(e,t,n){vr[yr++]=ja,vr[yr++]=Na,vr[yr++]=vs,vs=e;var r=ja;e=Na;var a=32-Fr(r)-1;r&=~(1<<a),n+=1;var s=32-Fr(t)+a;if(30<s){var o=a-a%5;s=(r&(1<<o)-1).toString(32),r>>=o,a-=o,ja=1<<32-Fr(t)+a|n<<a|r,Na=s+e}else ja=1<<s|n<<a|r,Na=e}function sx(e){e.return!==null&&(Gi(e,1),nC(e,1,0))}function ox(e){for(;e===Pf;)Pf=co[--uo],co[uo]=null,Rf=co[--uo],co[uo]=null;for(;e===vs;)vs=vr[--yr],vr[yr]=null,Na=vr[--yr],vr[yr]=null,ja=vr[--yr],vr[yr]=null}var rr=null,nr=null,wt=!1,Dr=null;function rC(e,t){var n=xr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function lS(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,rr=e,nr=vi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,rr=e,nr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=vs!==null?{id:ja,overflow:Na}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=xr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,rr=e,nr=null,!0):!1;default:return!1}}function Tv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ov(e){if(wt){var t=nr;if(t){var n=t;if(!lS(e,t)){if(Tv(e))throw Error(le(418));t=vi(n.nextSibling);var r=rr;t&&lS(e,t)?rC(r,n):(e.flags=e.flags&-4097|2,wt=!1,rr=e)}}else{if(Tv(e))throw Error(le(418));e.flags=e.flags&-4097|2,wt=!1,rr=e}}}function cS(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rr=e}function jd(e){if(e!==rr)return!1;if(!wt)return cS(e),wt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ev(e.type,e.memoizedProps)),t&&(t=nr)){if(Tv(e))throw aC(),Error(le(418));for(;t;)rC(e,t),t=vi(t.nextSibling)}if(cS(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(le(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){nr=vi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}nr=null}}else nr=rr?vi(e.stateNode.nextSibling):null;return!0}function aC(){for(var e=nr;e;)e=vi(e.nextSibling)}function Ro(){nr=rr=null,wt=!1}function lx(e){Dr===null?Dr=[e]:Dr.push(e)}var tD=za.ReactCurrentBatchConfig;function ql(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(le(309));var r=n.stateNode}if(!r)throw Error(le(147,e));var a=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var l=a.refs;o===null?delete l[s]:l[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(le(284));if(!n._owner)throw Error(le(290,e))}return e}function Nd(e,t){throw e=Object.prototype.toString.call(t),Error(le(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function uS(e){var t=e._init;return t(e._payload)}function iC(e){function t(v,x){if(e){var S=v.deletions;S===null?(v.deletions=[x],v.flags|=16):S.push(x)}}function n(v,x){if(!e)return null;for(;x!==null;)t(v,x),x=x.sibling;return null}function r(v,x){for(v=new Map;x!==null;)x.key!==null?v.set(x.key,x):v.set(x.index,x),x=x.sibling;return v}function a(v,x){return v=wi(v,x),v.index=0,v.sibling=null,v}function s(v,x,S){return v.index=S,e?(S=v.alternate,S!==null?(S=S.index,S<x?(v.flags|=2,x):S):(v.flags|=2,x)):(v.flags|=1048576,x)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,x,S,j){return x===null||x.tag!==6?(x=Km(S,v.mode,j),x.return=v,x):(x=a(x,S),x.return=v,x)}function c(v,x,S,j){var w=S.type;return w===ro?d(v,x,S.props.children,j,S.key):x!==null&&(x.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ti&&uS(w)===x.type)?(j=a(x,S.props),j.ref=ql(v,x,S),j.return=v,j):(j=vf(S.type,S.key,S.props,null,v.mode,j),j.ref=ql(v,x,S),j.return=v,j)}function u(v,x,S,j){return x===null||x.tag!==4||x.stateNode.containerInfo!==S.containerInfo||x.stateNode.implementation!==S.implementation?(x=Vm(S,v.mode,j),x.return=v,x):(x=a(x,S.children||[]),x.return=v,x)}function d(v,x,S,j,w){return x===null||x.tag!==7?(x=cs(S,v.mode,j,w),x.return=v,x):(x=a(x,S),x.return=v,x)}function f(v,x,S){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Km(""+x,v.mode,S),x.return=v,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case pd:return S=vf(x.type,x.key,x.props,null,v.mode,S),S.ref=ql(v,null,x),S.return=v,S;case no:return x=Vm(x,v.mode,S),x.return=v,x;case ti:var j=x._init;return f(v,j(x._payload),S)}if(dc(x)||Fl(x))return x=cs(x,v.mode,S,null),x.return=v,x;Nd(v,x)}return null}function h(v,x,S,j){var w=x!==null?x.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return w!==null?null:l(v,x,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case pd:return S.key===w?c(v,x,S,j):null;case no:return S.key===w?u(v,x,S,j):null;case ti:return w=S._init,h(v,x,w(S._payload),j)}if(dc(S)||Fl(S))return w!==null?null:d(v,x,S,j,null);Nd(v,S)}return null}function p(v,x,S,j,w){if(typeof j=="string"&&j!==""||typeof j=="number")return v=v.get(S)||null,l(x,v,""+j,w);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case pd:return v=v.get(j.key===null?S:j.key)||null,c(x,v,j,w);case no:return v=v.get(j.key===null?S:j.key)||null,u(x,v,j,w);case ti:var b=j._init;return p(v,x,S,b(j._payload),w)}if(dc(j)||Fl(j))return v=v.get(S)||null,d(x,v,j,w,null);Nd(x,j)}return null}function g(v,x,S,j){for(var w=null,b=null,N=x,E=x=0,T=null;N!==null&&E<S.length;E++){N.index>E?(T=N,N=null):T=N.sibling;var A=h(v,N,S[E],j);if(A===null){N===null&&(N=T);break}e&&N&&A.alternate===null&&t(v,N),x=s(A,x,E),b===null?w=A:b.sibling=A,b=A,N=T}if(E===S.length)return n(v,N),wt&&Gi(v,E),w;if(N===null){for(;E<S.length;E++)N=f(v,S[E],j),N!==null&&(x=s(N,x,E),b===null?w=N:b.sibling=N,b=N);return wt&&Gi(v,E),w}for(N=r(v,N);E<S.length;E++)T=p(N,v,E,S[E],j),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?E:T.key),x=s(T,x,E),b===null?w=T:b.sibling=T,b=T);return e&&N.forEach(function(M){return t(v,M)}),wt&&Gi(v,E),w}function m(v,x,S,j){var w=Fl(S);if(typeof w!="function")throw Error(le(150));if(S=w.call(S),S==null)throw Error(le(151));for(var b=w=null,N=x,E=x=0,T=null,A=S.next();N!==null&&!A.done;E++,A=S.next()){N.index>E?(T=N,N=null):T=N.sibling;var M=h(v,N,A.value,j);if(M===null){N===null&&(N=T);break}e&&N&&M.alternate===null&&t(v,N),x=s(M,x,E),b===null?w=M:b.sibling=M,b=M,N=T}if(A.done)return n(v,N),wt&&Gi(v,E),w;if(N===null){for(;!A.done;E++,A=S.next())A=f(v,A.value,j),A!==null&&(x=s(A,x,E),b===null?w=A:b.sibling=A,b=A);return wt&&Gi(v,E),w}for(N=r(v,N);!A.done;E++,A=S.next())A=p(N,v,E,A.value,j),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?E:A.key),x=s(A,x,E),b===null?w=A:b.sibling=A,b=A);return e&&N.forEach(function(R){return t(v,R)}),wt&&Gi(v,E),w}function y(v,x,S,j){if(typeof S=="object"&&S!==null&&S.type===ro&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case pd:e:{for(var w=S.key,b=x;b!==null;){if(b.key===w){if(w=S.type,w===ro){if(b.tag===7){n(v,b.sibling),x=a(b,S.props.children),x.return=v,v=x;break e}}else if(b.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ti&&uS(w)===b.type){n(v,b.sibling),x=a(b,S.props),x.ref=ql(v,b,S),x.return=v,v=x;break e}n(v,b);break}else t(v,b);b=b.sibling}S.type===ro?(x=cs(S.props.children,v.mode,j,S.key),x.return=v,v=x):(j=vf(S.type,S.key,S.props,null,v.mode,j),j.ref=ql(v,x,S),j.return=v,v=j)}return o(v);case no:e:{for(b=S.key;x!==null;){if(x.key===b)if(x.tag===4&&x.stateNode.containerInfo===S.containerInfo&&x.stateNode.implementation===S.implementation){n(v,x.sibling),x=a(x,S.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else t(v,x);x=x.sibling}x=Vm(S,v.mode,j),x.return=v,v=x}return o(v);case ti:return b=S._init,y(v,x,b(S._payload),j)}if(dc(S))return g(v,x,S,j);if(Fl(S))return m(v,x,S,j);Nd(v,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,x!==null&&x.tag===6?(n(v,x.sibling),x=a(x,S),x.return=v,v=x):(n(v,x),x=Km(S,v.mode,j),x.return=v,v=x),o(v)):n(v,x)}return y}var Mo=iC(!0),sC=iC(!1),Mf=Ci(null),If=null,fo=null,cx=null;function ux(){cx=fo=If=null}function dx(e){var t=Mf.current;vt(Mf),e._currentValue=t}function Pv(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function jo(e,t){If=e,cx=fo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fn=!0),e.firstContext=null)}function jr(e){var t=e._currentValue;if(cx!==e)if(e={context:e,memoizedValue:t,next:null},fo===null){if(If===null)throw Error(le(308));fo=e,If.dependencies={lanes:0,firstContext:e}}else fo=fo.next=e;return t}var ts=null;function fx(e){ts===null?ts=[e]:ts.push(e)}function oC(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,fx(t)):(n.next=a.next,a.next=n),t.interleaved=n,Ia(e,r)}function Ia(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ni=!1;function hx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lC(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ca(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,He&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Ia(e,n)}return a=r.interleaved,a===null?(t.next=t,fx(r)):(t.next=a.next,a.next=t),r.interleaved=t,Ia(e,n)}function df(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zb(e,n)}}function dS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?a=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?a=s=t:s=s.next=t}else a=s=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function $f(e,t,n,r){var a=e.updateQueue;ni=!1;var s=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=a.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,m=l;switch(h=t,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=_t({},f,h);break e;case 2:ni=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else p={eventTime: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,o|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else s===null&&(a.shared.lanes=0);bs|=o,e.lanes=o,e.memoizedState=f}}function fS(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(le(191,a));a.call(r)}}}var Hu={},sa=Ci(Hu),Gc=Ci(Hu),qc=Ci(Hu);function ns(e){if(e===Hu)throw Error(le(174));return e}function px(e,t){switch(dt(qc,t),dt(Gc,e),dt(sa,Hu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fv(t,e)}vt(sa),dt(sa,t)}function Io(){vt(sa),vt(Gc),vt(qc)}function cC(e){ns(qc.current);var t=ns(sa.current),n=fv(t,e.type);t!==n&&(dt(Gc,e),dt(sa,n))}function mx(e){Gc.current===e&&(vt(sa),vt(Gc))}var jt=Ci(0);function Lf(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fm=[];function gx(){for(var e=0;e<Fm.length;e++)Fm[e]._workInProgressVersionPrimary=null;Fm.length=0}var ff=za.ReactCurrentDispatcher,Um=za.ReactCurrentBatchConfig,ys=0,Nt=null,Kt=null,Zt=null,Df=!1,Sc=!1,Kc=0,nD=0;function vn(){throw Error(le(321))}function vx(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qr(e[n],t[n]))return!1;return!0}function yx(e,t,n,r,a,s){if(ys=s,Nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ff.current=e===null||e.memoizedState===null?sD:oD,e=n(r,a),Sc){s=0;do{if(Sc=!1,Kc=0,25<=s)throw Error(le(301));s+=1,Zt=Kt=null,t.updateQueue=null,ff.current=lD,e=n(r,a)}while(Sc)}if(ff.current=Bf,t=Kt!==null&&Kt.next!==null,ys=0,Zt=Kt=Nt=null,Df=!1,t)throw Error(le(300));return e}function bx(){var e=Kc!==0;return Kc=0,e}function Jr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?Nt.memoizedState=Zt=e:Zt=Zt.next=e,Zt}function Nr(){if(Kt===null){var e=Nt.alternate;e=e!==null?e.memoizedState:null}else e=Kt.next;var t=Zt===null?Nt.memoizedState:Zt.next;if(t!==null)Zt=t,Kt=e;else{if(e===null)throw Error(le(310));Kt=e,e={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},Zt===null?Nt.memoizedState=Zt=e:Zt=Zt.next=e}return Zt}function Vc(e,t){return typeof t=="function"?t(e):t}function Wm(e){var t=Nr(),n=t.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=e;var r=Kt,a=r.baseQueue,s=n.pending;if(s!==null){if(a!==null){var o=a.next;a.next=s.next,s.next=o}r.baseQueue=a=s,n.pending=null}if(a!==null){s=a.next,r=r.baseState;var l=o=null,c=null,u=s;do{var d=u.lane;if((ys&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=r):c=c.next=f,Nt.lanes|=d,bs|=d}u=u.next}while(u!==null&&u!==s);c===null?o=r:c.next=l,qr(r,t.memoizedState)||(Fn=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do s=a.lane,Nt.lanes|=s,bs|=s,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Hm(e){var t=Nr(),n=t.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,s=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do s=e(s,o.action),o=o.next;while(o!==a);qr(s,t.memoizedState)||(Fn=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function uC(){}function dC(e,t){var n=Nt,r=Nr(),a=t(),s=!qr(r.memoizedState,a);if(s&&(r.memoizedState=a,Fn=!0),r=r.queue,xx(pC.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Zt!==null&&Zt.memoizedState.tag&1){if(n.flags|=2048,Yc(9,hC.bind(null,n,r,a,t),void 0,null),tn===null)throw Error(le(349));ys&30||fC(n,t,a)}return a}function fC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Nt.updateQueue,t===null?(t={lastEffect:null,stores:null},Nt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hC(e,t,n,r){t.value=n,t.getSnapshot=r,mC(t)&&gC(e)}function pC(e,t,n){return n(function(){mC(t)&&gC(e)})}function mC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qr(e,n)}catch{return!0}}function gC(e){var t=Ia(e,1);t!==null&&Ur(t,e,1,-1)}function hS(e){var t=Jr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vc,lastRenderedState:e},t.queue=e,e=e.dispatch=iD.bind(null,Nt,e),[t.memoizedState,e]}function Yc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Nt.updateQueue,t===null?(t={lastEffect:null,stores:null},Nt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function vC(){return Nr().memoizedState}function hf(e,t,n,r){var a=Jr();Nt.flags|=e,a.memoizedState=Yc(1|t,n,void 0,r===void 0?null:r)}function up(e,t,n,r){var a=Nr();r=r===void 0?null:r;var s=void 0;if(Kt!==null){var o=Kt.memoizedState;if(s=o.destroy,r!==null&&vx(r,o.deps)){a.memoizedState=Yc(t,n,s,r);return}}Nt.flags|=e,a.memoizedState=Yc(1|t,n,s,r)}function pS(e,t){return hf(8390656,8,e,t)}function xx(e,t){return up(2048,8,e,t)}function yC(e,t){return up(4,2,e,t)}function bC(e,t){return up(4,4,e,t)}function xC(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function wC(e,t,n){return n=n!=null?n.concat([e]):null,up(4,4,xC.bind(null,t,e),n)}function wx(){}function SC(e,t){var n=Nr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vx(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function kC(e,t){var n=Nr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vx(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function jC(e,t,n){return ys&21?(qr(n,t)||(n=CA(),Nt.lanes|=n,bs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fn=!0),e.memoizedState=n)}function rD(e,t){var n=et;et=n!==0&&4>n?n:4,e(!0);var r=Um.transition;Um.transition={};try{e(!1),t()}finally{et=n,Um.transition=r}}function NC(){return Nr().memoizedState}function aD(e,t,n){var r=xi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},EC(e))_C(t,n);else if(n=oC(e,t,n,r),n!==null){var a=In();Ur(n,e,r,a),AC(n,t,r)}}function iD(e,t,n){var r=xi(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(EC(e))_C(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(a.hasEagerState=!0,a.eagerState=l,qr(l,o)){var c=t.interleaved;c===null?(a.next=a,fx(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=oC(e,t,a,r),n!==null&&(a=In(),Ur(n,e,r,a),AC(n,t,r))}}function EC(e){var t=e.alternate;return e===Nt||t!==null&&t===Nt}function _C(e,t){Sc=Df=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function AC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zb(e,n)}}var Bf={readContext:jr,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},sD={readContext:jr,useCallback:function(e,t){return Jr().memoizedState=[e,t===void 0?null:t],e},useContext:jr,useEffect:pS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,hf(4194308,4,xC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hf(4194308,4,e,t)},useInsertionEffect:function(e,t){return hf(4,2,e,t)},useMemo:function(e,t){var n=Jr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=aD.bind(null,Nt,e),[r.memoizedState,e]},useRef:function(e){var t=Jr();return e={current:e},t.memoizedState=e},useState:hS,useDebugValue:wx,useDeferredValue:function(e){return Jr().memoizedState=e},useTransition:function(){var e=hS(!1),t=e[0];return e=rD.bind(null,e[1]),Jr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Nt,a=Jr();if(wt){if(n===void 0)throw Error(le(407));n=n()}else{if(n=t(),tn===null)throw Error(le(349));ys&30||fC(r,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,pS(pC.bind(null,r,s,e),[e]),r.flags|=2048,Yc(9,hC.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Jr(),t=tn.identifierPrefix;if(wt){var n=Na,r=ja;n=(r&~(1<<32-Fr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Kc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=nD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},oD={readContext:jr,useCallback:SC,useContext:jr,useEffect:xx,useImperativeHandle:wC,useInsertionEffect:yC,useLayoutEffect:bC,useMemo:kC,useReducer:Wm,useRef:vC,useState:function(){return Wm(Vc)},useDebugValue:wx,useDeferredValue:function(e){var t=Nr();return jC(t,Kt.memoizedState,e)},useTransition:function(){var e=Wm(Vc)[0],t=Nr().memoizedState;return[e,t]},useMutableSource:uC,useSyncExternalStore:dC,useId:NC,unstable_isNewReconciler:!1},lD={readContext:jr,useCallback:SC,useContext:jr,useEffect:xx,useImperativeHandle:wC,useInsertionEffect:yC,useLayoutEffect:bC,useMemo:kC,useReducer:Hm,useRef:vC,useState:function(){return Hm(Vc)},useDebugValue:wx,useDeferredValue:function(e){var t=Nr();return Kt===null?t.memoizedState=e:jC(t,Kt.memoizedState,e)},useTransition:function(){var e=Hm(Vc)[0],t=Nr().memoizedState;return[e,t]},useMutableSource:uC,useSyncExternalStore:dC,useId:NC,unstable_isNewReconciler:!1};function Ir(e,t){if(e&&e.defaultProps){t=_t({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Rv(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:_t({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var dp={isMounted:function(e){return(e=e._reactInternals)?As(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=In(),a=xi(e),s=Ca(r,a);s.payload=t,n!=null&&(s.callback=n),t=yi(e,s,a),t!==null&&(Ur(t,e,a,r),df(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=In(),a=xi(e),s=Ca(r,a);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=yi(e,s,a),t!==null&&(Ur(t,e,a,r),df(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=In(),r=xi(e),a=Ca(n,r);a.tag=2,t!=null&&(a.callback=t),t=yi(e,a,r),t!==null&&(Ur(t,e,r,n),df(t,e,r))}};function mS(e,t,n,r,a,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Fc(n,r)||!Fc(a,s):!0}function CC(e,t,n){var r=!1,a=Ei,s=t.contextType;return typeof s=="object"&&s!==null?s=jr(s):(a=Hn(t)?gs:En.current,r=t.contextTypes,s=(r=r!=null)?Po(e,a):Ei),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=dp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=s),t}function gS(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&dp.enqueueReplaceState(t,t.state,null)}function Mv(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},hx(e);var s=t.contextType;typeof s=="object"&&s!==null?a.context=jr(s):(s=Hn(t)?gs:En.current,a.context=Po(e,s)),a.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Rv(e,t,s,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&dp.enqueueReplaceState(a,a.state,null),$f(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function $o(e,t){try{var n="",r=t;do n+=$$(r),r=r.return;while(r);var a=n}catch(s){a=`
|
|
39
|
+
Error generating stack: `+s.message+`
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:a,digest:null}}function Gm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Iv(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var cD=typeof WeakMap=="function"?WeakMap:Map;function TC(e,t,n){n=Ca(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ff||(Ff=!0,Gv=r),Iv(e,t)},n}function OC(e,t,n){n=Ca(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){Iv(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Iv(e,t),typeof r!="function"&&(bi===null?bi=new Set([this]):bi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function vS(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new cD;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=kD.bind(null,e,t,n),t.then(e,e))}function yS(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function bS(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ca(-1,1),t.tag=2,yi(n,t,1))),n.lanes|=1),e)}var uD=za.ReactCurrentOwner,Fn=!1;function Pn(e,t,n,r){t.child=e===null?sC(t,null,n,r):Mo(t,e.child,n,r)}function xS(e,t,n,r,a){n=n.render;var s=t.ref;return jo(t,a),r=yx(e,t,n,r,s,a),n=bx(),e!==null&&!Fn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,$a(e,t,a)):(wt&&n&&sx(t),t.flags|=1,Pn(e,t,r,a),t.child)}function wS(e,t,n,r,a){if(e===null){var s=n.type;return typeof s=="function"&&!Cx(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,PC(e,t,s,r,a)):(e=vf(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&a)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Fc,n(o,r)&&e.ref===t.ref)return $a(e,t,a)}return t.flags|=1,e=wi(s,r),e.ref=t.ref,e.return=t,t.child=e}function PC(e,t,n,r,a){if(e!==null){var s=e.memoizedProps;if(Fc(s,r)&&e.ref===t.ref)if(Fn=!1,t.pendingProps=r=s,(e.lanes&a)!==0)e.flags&131072&&(Fn=!0);else return t.lanes=e.lanes,$a(e,t,a)}return $v(e,t,n,r,a)}function RC(e,t,n){var r=t.pendingProps,a=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},dt(po,Jn),Jn|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,dt(po,Jn),Jn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,dt(po,Jn),Jn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,dt(po,Jn),Jn|=r;return Pn(e,t,a,n),t.child}function MC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $v(e,t,n,r,a){var s=Hn(n)?gs:En.current;return s=Po(t,s),jo(t,a),n=yx(e,t,n,r,s,a),r=bx(),e!==null&&!Fn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,$a(e,t,a)):(wt&&r&&sx(t),t.flags|=1,Pn(e,t,n,a),t.child)}function SS(e,t,n,r,a){if(Hn(n)){var s=!0;Of(t)}else s=!1;if(jo(t,a),t.stateNode===null)pf(e,t),CC(t,n,r),Mv(t,n,r,a),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=jr(u):(u=Hn(n)?gs:En.current,u=Po(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&gS(t,o,r,u),ni=!1;var h=t.memoizedState;o.state=h,$f(t,r,o,a),c=t.memoizedState,l!==r||h!==c||Wn.current||ni?(typeof d=="function"&&(Rv(t,n,d,r),c=t.memoizedState),(l=ni||mS(t,n,l,r,h,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,lC(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Ir(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=jr(c):(c=Hn(n)?gs:En.current,c=Po(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||h!==c)&&gS(t,o,r,c),ni=!1,h=t.memoizedState,o.state=h,$f(t,r,o,a);var g=t.memoizedState;l!==f||h!==g||Wn.current||ni?(typeof p=="function"&&(Rv(t,n,p,r),g=t.memoizedState),(u=ni||mS(t,n,u,r,h,g,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Lv(e,t,n,r,s,a)}function Lv(e,t,n,r,a,s){MC(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&oS(t,n,!1),$a(e,t,s);r=t.stateNode,uD.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Mo(t,e.child,null,s),t.child=Mo(t,null,l,s)):Pn(e,t,l,s),t.memoizedState=r.state,a&&oS(t,n,!0),t.child}function IC(e){var t=e.stateNode;t.pendingContext?sS(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sS(e,t.context,!1),px(e,t.containerInfo)}function kS(e,t,n,r,a){return Ro(),lx(a),t.flags|=256,Pn(e,t,n,r),t.child}var Dv={dehydrated:null,treeContext:null,retryLane:0};function Bv(e){return{baseLanes:e,cachePool:null,transitions:null}}function $C(e,t,n){var r=t.pendingProps,a=jt.current,s=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),dt(jt,a&1),e===null)return Ov(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=pp(o,r,0,null),e=cs(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Bv(n),t.memoizedState=Dv,e):Sx(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return dD(e,t,o,r,l,a,n);if(s){s=r.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=wi(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?s=wi(l,s):(s=cs(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Bv(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Dv,r}return s=e.child,e=s.sibling,r=wi(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Sx(e,t){return t=pp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ed(e,t,n,r){return r!==null&&lx(r),Mo(t,e.child,null,n),e=Sx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dD(e,t,n,r,a,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Gm(Error(le(422))),Ed(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,a=t.mode,r=pp({mode:"visible",children:r.children},a,0,null),s=cs(s,a,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Mo(t,e.child,null,o),t.child.memoizedState=Bv(o),t.memoizedState=Dv,s);if(!(t.mode&1))return Ed(e,t,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(le(419)),r=Gm(s,r,void 0),Ed(e,t,o,r)}if(l=(o&e.childLanes)!==0,Fn||l){if(r=tn,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==s.retryLane&&(s.retryLane=a,Ia(e,a),Ur(r,e,a,-1))}return Ax(),r=Gm(Error(le(421))),Ed(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=jD.bind(null,e),a._reactRetry=t,null):(e=s.treeContext,nr=vi(a.nextSibling),rr=t,wt=!0,Dr=null,e!==null&&(vr[yr++]=ja,vr[yr++]=Na,vr[yr++]=vs,ja=e.id,Na=e.overflow,vs=t),t=Sx(t,r.children),t.flags|=4096,t)}function jS(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Pv(e.return,t,n)}function qm(e,t,n,r,a){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a)}function LC(e,t,n){var r=t.pendingProps,a=r.revealOrder,s=r.tail;if(Pn(e,t,r.children,n),r=jt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jS(e,n,t);else if(e.tag===19)jS(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(dt(jt,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Lf(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),qm(t,!1,a,n,s);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Lf(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}qm(t,!0,n,null,s);break;case"together":qm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function pf(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function $a(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(le(153));if(t.child!==null){for(e=t.child,n=wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fD(e,t,n){switch(t.tag){case 3:IC(t),Ro();break;case 5:cC(t);break;case 1:Hn(t.type)&&Of(t);break;case 4:px(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;dt(Mf,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(dt(jt,jt.current&1),t.flags|=128,null):n&t.child.childLanes?$C(e,t,n):(dt(jt,jt.current&1),e=$a(e,t,n),e!==null?e.sibling:null);dt(jt,jt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return LC(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),dt(jt,jt.current),r)break;return null;case 22:case 23:return t.lanes=0,RC(e,t,n)}return $a(e,t,n)}var DC,zv,BC,zC;DC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};zv=function(){};BC=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,ns(sa.current);var s=null;switch(n){case"input":a=lv(e,a),r=lv(e,r),s=[];break;case"select":a=_t({},a,{value:void 0}),r=_t({},r,{value:void 0}),s=[];break;case"textarea":a=dv(e,a),r=dv(e,r),s=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Cf)}hv(n,r);var o;n=null;for(u in a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Mc.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=a!=null?a[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(s=s||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Mc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ht("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};zC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Kl(e,t){if(!wt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function yn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hD(e,t,n){var r=t.pendingProps;switch(ox(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yn(t),null;case 1:return Hn(t.type)&&Tf(),yn(t),null;case 3:return r=t.stateNode,Io(),vt(Wn),vt(En),gx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(jd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dr!==null&&(Vv(Dr),Dr=null))),zv(e,t),yn(t),null;case 5:mx(t);var a=ns(qc.current);if(n=t.type,e!==null&&t.stateNode!=null)BC(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(le(166));return yn(t),null}if(e=ns(sa.current),jd(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ta]=t,r[Hc]=s,e=(t.mode&1)!==0,n){case"dialog":ht("cancel",r),ht("close",r);break;case"iframe":case"object":case"embed":ht("load",r);break;case"video":case"audio":for(a=0;a<hc.length;a++)ht(hc[a],r);break;case"source":ht("error",r);break;case"img":case"image":case"link":ht("error",r),ht("load",r);break;case"details":ht("toggle",r);break;case"input":R0(r,s),ht("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ht("invalid",r);break;case"textarea":I0(r,s),ht("invalid",r)}hv(n,s),a=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&kd(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&kd(r.textContent,l,e),a=["children",""+l]):Mc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ht("scroll",r)}switch(n){case"input":md(r),M0(r,s,!0);break;case"textarea":md(r),$0(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Cf)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=pA(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ta]=t,e[Hc]=r,DC(e,t,!1,!1),t.stateNode=e;e:{switch(o=pv(n,r),n){case"dialog":ht("cancel",e),ht("close",e),a=r;break;case"iframe":case"object":case"embed":ht("load",e),a=r;break;case"video":case"audio":for(a=0;a<hc.length;a++)ht(hc[a],e);a=r;break;case"source":ht("error",e),a=r;break;case"img":case"image":case"link":ht("error",e),ht("load",e),a=r;break;case"details":ht("toggle",e),a=r;break;case"input":R0(e,r),a=lv(e,r),ht("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=_t({},r,{value:void 0}),ht("invalid",e);break;case"textarea":I0(e,r),a=dv(e,r),ht("invalid",e);break;default:a=r}hv(n,a),l=a;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];s==="style"?vA(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&mA(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ic(e,c):typeof c=="number"&&Ic(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Mc.hasOwnProperty(s)?c!=null&&s==="onScroll"&&ht("scroll",e):c!=null&&qb(e,s,c,o))}switch(n){case"input":md(e),M0(e,r,!1);break;case"textarea":md(e),$0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ni(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?xo(e,!!r.multiple,s,!1):r.defaultValue!=null&&xo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Cf)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return yn(t),null;case 6:if(e&&t.stateNode!=null)zC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(le(166));if(n=ns(qc.current),ns(sa.current),jd(t)){if(r=t.stateNode,n=t.memoizedProps,r[ta]=t,(s=r.nodeValue!==n)&&(e=rr,e!==null))switch(e.tag){case 3:kd(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&kd(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ta]=t,t.stateNode=r}return yn(t),null;case 13:if(vt(jt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(wt&&nr!==null&&t.mode&1&&!(t.flags&128))aC(),Ro(),t.flags|=98560,s=!1;else if(s=jd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(le(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(le(317));s[ta]=t}else Ro(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yn(t),s=!1}else Dr!==null&&(Vv(Dr),Dr=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||jt.current&1?Vt===0&&(Vt=3):Ax())),t.updateQueue!==null&&(t.flags|=4),yn(t),null);case 4:return Io(),zv(e,t),e===null&&Uc(t.stateNode.containerInfo),yn(t),null;case 10:return dx(t.type._context),yn(t),null;case 17:return Hn(t.type)&&Tf(),yn(t),null;case 19:if(vt(jt),s=t.memoizedState,s===null)return yn(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Kl(s,!1);else{if(Vt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Lf(e),o!==null){for(t.flags|=128,Kl(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return dt(jt,jt.current&1|2),t.child}e=e.sibling}s.tail!==null&&It()>Lo&&(t.flags|=128,r=!0,Kl(s,!1),t.lanes=4194304)}else{if(!r)if(e=Lf(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Kl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!wt)return yn(t),null}else 2*It()-s.renderingStartTime>Lo&&n!==1073741824&&(t.flags|=128,r=!0,Kl(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=It(),t.sibling=null,n=jt.current,dt(jt,r?n&1|2:n&1),t):(yn(t),null);case 22:case 23:return _x(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jn&1073741824&&(yn(t),t.subtreeFlags&6&&(t.flags|=8192)):yn(t),null;case 24:return null;case 25:return null}throw Error(le(156,t.tag))}function pD(e,t){switch(ox(t),t.tag){case 1:return Hn(t.type)&&Tf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Io(),vt(Wn),vt(En),gx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return mx(t),null;case 13:if(vt(jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(le(340));Ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return vt(jt),null;case 4:return Io(),null;case 10:return dx(t.type._context),null;case 22:case 23:return _x(),null;case 24:return null;default:return null}}var _d=!1,Sn=!1,mD=typeof WeakSet=="function"?WeakSet:Set,ye=null;function ho(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ot(e,t,r)}else n.current=null}function Fv(e,t,n){try{n()}catch(r){Ot(e,t,r)}}var NS=!1;function gD(e,t){if(jv=Ef,e=GA(),ix(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||a!==0&&f.nodeType!==3||(l=o+a),f!==s||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===a&&(l=o),h===s&&++d===r&&(c=o),(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(Nv={focusedElem:e,selectionRange:n},Ef=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,y=g.memoizedState,v=t.stateNode,x=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ir(t.type,m),y);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(j){Ot(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return g=NS,NS=!1,g}function kc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var s=a.destroy;a.destroy=void 0,s!==void 0&&Fv(t,n,s)}a=a.next}while(a!==r)}}function fp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Uv(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function FC(e){var t=e.alternate;t!==null&&(e.alternate=null,FC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ta],delete t[Hc],delete t[Av],delete t[ZL],delete t[JL])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function UC(e){return e.tag===5||e.tag===3||e.tag===4}function ES(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||UC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Cf));else if(r!==4&&(e=e.child,e!==null))for(Wv(e,t,n),e=e.sibling;e!==null;)Wv(e,t,n),e=e.sibling}function Hv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Hv(e,t,n),e=e.sibling;e!==null;)Hv(e,t,n),e=e.sibling}var fn=null,$r=!1;function Za(e,t,n){for(n=n.child;n!==null;)WC(e,t,n),n=n.sibling}function WC(e,t,n){if(ia&&typeof ia.onCommitFiberUnmount=="function")try{ia.onCommitFiberUnmount(ap,n)}catch{}switch(n.tag){case 5:Sn||ho(n,t);case 6:var r=fn,a=$r;fn=null,Za(e,t,n),fn=r,$r=a,fn!==null&&($r?(e=fn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):fn.removeChild(n.stateNode));break;case 18:fn!==null&&($r?(e=fn,n=n.stateNode,e.nodeType===8?Bm(e.parentNode,n):e.nodeType===1&&Bm(e,n),Bc(e)):Bm(fn,n.stateNode));break;case 4:r=fn,a=$r,fn=n.stateNode.containerInfo,$r=!0,Za(e,t,n),fn=r,$r=a;break;case 0:case 11:case 14:case 15:if(!Sn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var s=a,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Fv(n,t,o),a=a.next}while(a!==r)}Za(e,t,n);break;case 1:if(!Sn&&(ho(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ot(n,t,l)}Za(e,t,n);break;case 21:Za(e,t,n);break;case 22:n.mode&1?(Sn=(r=Sn)||n.memoizedState!==null,Za(e,t,n),Sn=r):Za(e,t,n);break;default:Za(e,t,n)}}function _S(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mD),t.forEach(function(r){var a=ND.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Rr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var s=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:fn=l.stateNode,$r=!1;break e;case 3:fn=l.stateNode.containerInfo,$r=!0;break e;case 4:fn=l.stateNode.containerInfo,$r=!0;break e}l=l.return}if(fn===null)throw Error(le(160));WC(s,o,a),fn=null,$r=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){Ot(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)HC(t,e),t=t.sibling}function HC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rr(t,e),Qr(e),r&4){try{kc(3,e,e.return),fp(3,e)}catch(m){Ot(e,e.return,m)}try{kc(5,e,e.return)}catch(m){Ot(e,e.return,m)}}break;case 1:Rr(t,e),Qr(e),r&512&&n!==null&&ho(n,n.return);break;case 5:if(Rr(t,e),Qr(e),r&512&&n!==null&&ho(n,n.return),e.flags&32){var a=e.stateNode;try{Ic(a,"")}catch(m){Ot(e,e.return,m)}}if(r&4&&(a=e.stateNode,a!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&fA(a,s),pv(l,o);var u=pv(l,s);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?vA(a,f):d==="dangerouslySetInnerHTML"?mA(a,f):d==="children"?Ic(a,f):qb(a,d,f,u)}switch(l){case"input":cv(a,s);break;case"textarea":hA(a,s);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?xo(a,!!s.multiple,p,!1):h!==!!s.multiple&&(s.defaultValue!=null?xo(a,!!s.multiple,s.defaultValue,!0):xo(a,!!s.multiple,s.multiple?[]:"",!1))}a[Hc]=s}catch(m){Ot(e,e.return,m)}}break;case 6:if(Rr(t,e),Qr(e),r&4){if(e.stateNode===null)throw Error(le(162));a=e.stateNode,s=e.memoizedProps;try{a.nodeValue=s}catch(m){Ot(e,e.return,m)}}break;case 3:if(Rr(t,e),Qr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Bc(t.containerInfo)}catch(m){Ot(e,e.return,m)}break;case 4:Rr(t,e),Qr(e);break;case 13:Rr(t,e),Qr(e),a=e.child,a.flags&8192&&(s=a.memoizedState!==null,a.stateNode.isHidden=s,!s||a.alternate!==null&&a.alternate.memoizedState!==null||(Nx=It())),r&4&&_S(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Sn=(u=Sn)||d,Rr(t,e),Sn=u):Rr(t,e),Qr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ye=e,d=e.child;d!==null;){for(f=ye=d;ye!==null;){switch(h=ye,p=h.child,h.tag){case 0:case 11:case 14:case 15:kc(4,h,h.return);break;case 1:ho(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(m){Ot(r,n,m)}}break;case 5:ho(h,h.return);break;case 22:if(h.memoizedState!==null){CS(f);continue}}p!==null?(p.return=h,ye=p):CS(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=gA("display",o))}catch(m){Ot(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){Ot(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Rr(t,e),Qr(e),r&4&&_S(e);break;case 21:break;default:Rr(t,e),Qr(e)}}function Qr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(UC(n)){var r=n;break e}n=n.return}throw Error(le(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Ic(a,""),r.flags&=-33);var s=ES(e);Hv(e,s,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=ES(e);Wv(e,l,o);break;default:throw Error(le(161))}}catch(c){Ot(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vD(e,t,n){ye=e,GC(e)}function GC(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var a=ye,s=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||_d;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Sn;l=_d;var u=Sn;if(_d=o,(Sn=c)&&!u)for(ye=a;ye!==null;)o=ye,c=o.child,o.tag===22&&o.memoizedState!==null?TS(a):c!==null?(c.return=o,ye=c):TS(a);for(;s!==null;)ye=s,GC(s),s=s.sibling;ye=a,_d=l,Sn=u}AS(e)}else a.subtreeFlags&8772&&s!==null?(s.return=a,ye=s):AS(e)}}function AS(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Sn||fp(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Sn)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Ir(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&fS(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}fS(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Bc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(le(163))}Sn||t.flags&512&&Uv(t)}catch(h){Ot(t,t.return,h)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function CS(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function TS(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fp(4,t)}catch(c){Ot(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){Ot(t,a,c)}}var s=t.return;try{Uv(t)}catch(c){Ot(t,s,c)}break;case 5:var o=t.return;try{Uv(t)}catch(c){Ot(t,o,c)}}}catch(c){Ot(t,t.return,c)}if(t===e){ye=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ye=l;break}ye=t.return}}var yD=Math.ceil,zf=za.ReactCurrentDispatcher,kx=za.ReactCurrentOwner,Sr=za.ReactCurrentBatchConfig,He=0,tn=null,Dt=null,pn=0,Jn=0,po=Ci(0),Vt=0,Xc=null,bs=0,hp=0,jx=0,jc=null,zn=null,Nx=0,Lo=1/0,Sa=null,Ff=!1,Gv=null,bi=null,Ad=!1,ui=null,Uf=0,Nc=0,qv=null,mf=-1,gf=0;function In(){return He&6?It():mf!==-1?mf:mf=It()}function xi(e){return e.mode&1?He&2&&pn!==0?pn&-pn:tD.transition!==null?(gf===0&&(gf=CA()),gf):(e=et,e!==0||(e=window.event,e=e===void 0?16:$A(e.type)),e):1}function Ur(e,t,n,r){if(50<Nc)throw Nc=0,qv=null,Error(le(185));Fu(e,n,r),(!(He&2)||e!==tn)&&(e===tn&&(!(He&2)&&(hp|=n),Vt===4&&ii(e,pn)),Gn(e,r),n===1&&He===0&&!(t.mode&1)&&(Lo=It()+500,cp&&Ti()))}function Gn(e,t){var n=e.callbackNode;tL(e,t);var r=Nf(e,e===tn?pn:0);if(r===0)n!==null&&B0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&B0(n),t===1)e.tag===0?eD(OS.bind(null,e)):tC(OS.bind(null,e)),XL(function(){!(He&6)&&Ti()}),n=null;else{switch(TA(r)){case 1:n=Qb;break;case 4:n=_A;break;case 16:n=jf;break;case 536870912:n=AA;break;default:n=jf}n=JC(n,qC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function qC(e,t){if(mf=-1,gf=0,He&6)throw Error(le(327));var n=e.callbackNode;if(No()&&e.callbackNode!==n)return null;var r=Nf(e,e===tn?pn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Wf(e,r);else{t=r;var a=He;He|=2;var s=VC();(tn!==e||pn!==t)&&(Sa=null,Lo=It()+500,ls(e,t));do try{wD();break}catch(l){KC(e,l)}while(!0);ux(),zf.current=s,He=a,Dt!==null?t=0:(tn=null,pn=0,t=Vt)}if(t!==0){if(t===2&&(a=bv(e),a!==0&&(r=a,t=Kv(e,a))),t===1)throw n=Xc,ls(e,0),ii(e,r),Gn(e,It()),n;if(t===6)ii(e,r);else{if(a=e.current.alternate,!(r&30)&&!bD(a)&&(t=Wf(e,r),t===2&&(s=bv(e),s!==0&&(r=s,t=Kv(e,s))),t===1))throw n=Xc,ls(e,0),ii(e,r),Gn(e,It()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(le(345));case 2:qi(e,zn,Sa);break;case 3:if(ii(e,r),(r&130023424)===r&&(t=Nx+500-It(),10<t)){if(Nf(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){In(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=_v(qi.bind(null,e,zn,Sa),t);break}qi(e,zn,Sa);break;case 4:if(ii(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-Fr(r);s=1<<o,o=t[o],o>a&&(a=o),r&=~s}if(r=a,r=It()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yD(r/1960))-r,10<r){e.timeoutHandle=_v(qi.bind(null,e,zn,Sa),r);break}qi(e,zn,Sa);break;case 5:qi(e,zn,Sa);break;default:throw Error(le(329))}}}return Gn(e,It()),e.callbackNode===n?qC.bind(null,e):null}function Kv(e,t){var n=jc;return e.current.memoizedState.isDehydrated&&(ls(e,t).flags|=256),e=Wf(e,t),e!==2&&(t=zn,zn=n,t!==null&&Vv(t)),e}function Vv(e){zn===null?zn=e:zn.push.apply(zn,e)}function bD(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],s=a.getSnapshot;a=a.value;try{if(!qr(s(),a))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 ii(e,t){for(t&=~jx,t&=~hp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Fr(t),r=1<<n;e[n]=-1,t&=~r}}function OS(e){if(He&6)throw Error(le(327));No();var t=Nf(e,0);if(!(t&1))return Gn(e,It()),null;var n=Wf(e,t);if(e.tag!==0&&n===2){var r=bv(e);r!==0&&(t=r,n=Kv(e,r))}if(n===1)throw n=Xc,ls(e,0),ii(e,t),Gn(e,It()),n;if(n===6)throw Error(le(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qi(e,zn,Sa),Gn(e,It()),null}function Ex(e,t){var n=He;He|=1;try{return e(t)}finally{He=n,He===0&&(Lo=It()+500,cp&&Ti())}}function xs(e){ui!==null&&ui.tag===0&&!(He&6)&&No();var t=He;He|=1;var n=Sr.transition,r=et;try{if(Sr.transition=null,et=1,e)return e()}finally{et=r,Sr.transition=n,He=t,!(He&6)&&Ti()}}function _x(){Jn=po.current,vt(po)}function ls(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,YL(n)),Dt!==null)for(n=Dt.return;n!==null;){var r=n;switch(ox(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Tf();break;case 3:Io(),vt(Wn),vt(En),gx();break;case 5:mx(r);break;case 4:Io();break;case 13:vt(jt);break;case 19:vt(jt);break;case 10:dx(r.type._context);break;case 22:case 23:_x()}n=n.return}if(tn=e,Dt=e=wi(e.current,null),pn=Jn=t,Vt=0,Xc=null,jx=hp=bs=0,zn=jc=null,ts!==null){for(t=0;t<ts.length;t++)if(n=ts[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=a,r.next=o}n.pending=r}ts=null}return e}function KC(e,t){do{var n=Dt;try{if(ux(),ff.current=Bf,Df){for(var r=Nt.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Df=!1}if(ys=0,Zt=Kt=Nt=null,Sc=!1,Kc=0,kx.current=null,n===null||n.return===null){Vt=1,Xc=t,Dt=null;break}e:{var s=e,o=n.return,l=n,c=t;if(t=pn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=yS(o);if(p!==null){p.flags&=-257,bS(p,o,l,s,t),p.mode&1&&vS(s,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var m=new Set;m.add(c),t.updateQueue=m}else g.add(c);break e}else{if(!(t&1)){vS(s,u,t),Ax();break e}c=Error(le(426))}}else if(wt&&l.mode&1){var y=yS(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),bS(y,o,l,s,t),lx($o(c,l));break e}}s=c=$o(c,l),Vt!==4&&(Vt=2),jc===null?jc=[s]:jc.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var v=TC(s,c,t);dS(s,v);break e;case 1:l=c;var x=s.type,S=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(bi===null||!bi.has(S)))){s.flags|=65536,t&=-t,s.lanes|=t;var j=OC(s,l,t);dS(s,j);break e}}s=s.return}while(s!==null)}XC(n)}catch(w){t=w,Dt===n&&n!==null&&(Dt=n=n.return);continue}break}while(!0)}function VC(){var e=zf.current;return zf.current=Bf,e===null?Bf:e}function Ax(){(Vt===0||Vt===3||Vt===2)&&(Vt=4),tn===null||!(bs&268435455)&&!(hp&268435455)||ii(tn,pn)}function Wf(e,t){var n=He;He|=2;var r=VC();(tn!==e||pn!==t)&&(Sa=null,ls(e,t));do try{xD();break}catch(a){KC(e,a)}while(!0);if(ux(),He=n,zf.current=r,Dt!==null)throw Error(le(261));return tn=null,pn=0,Vt}function xD(){for(;Dt!==null;)YC(Dt)}function wD(){for(;Dt!==null&&!q$();)YC(Dt)}function YC(e){var t=ZC(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,t===null?XC(e):Dt=t,kx.current=null}function XC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=pD(n,t),n!==null){n.flags&=32767,Dt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Vt=6,Dt=null;return}}else if(n=hD(n,t,Jn),n!==null){Dt=n;return}if(t=t.sibling,t!==null){Dt=t;return}Dt=t=e}while(t!==null);Vt===0&&(Vt=5)}function qi(e,t,n){var r=et,a=Sr.transition;try{Sr.transition=null,et=1,SD(e,t,n,r)}finally{Sr.transition=a,et=r}return null}function SD(e,t,n,r){do No();while(ui!==null);if(He&6)throw Error(le(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(le(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(nL(e,s),e===tn&&(Dt=tn=null,pn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ad||(Ad=!0,JC(jf,function(){return No(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Sr.transition,Sr.transition=null;var o=et;et=1;var l=He;He|=4,kx.current=null,gD(e,n),HC(n,e),UL(Nv),Ef=!!jv,Nv=jv=null,e.current=n,vD(n),K$(),He=l,et=o,Sr.transition=s}else e.current=n;if(Ad&&(Ad=!1,ui=e,Uf=a),s=e.pendingLanes,s===0&&(bi=null),X$(n.stateNode),Gn(e,It()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Ff)throw Ff=!1,e=Gv,Gv=null,e;return Uf&1&&e.tag!==0&&No(),s=e.pendingLanes,s&1?e===qv?Nc++:(Nc=0,qv=e):Nc=0,Ti(),null}function No(){if(ui!==null){var e=TA(Uf),t=Sr.transition,n=et;try{if(Sr.transition=null,et=16>e?16:e,ui===null)var r=!1;else{if(e=ui,ui=null,Uf=0,He&6)throw Error(le(331));var a=He;for(He|=4,ye=e.current;ye!==null;){var s=ye,o=s.child;if(ye.flags&16){var l=s.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ye=u;ye!==null;){var d=ye;switch(d.tag){case 0:case 11:case 15:kc(8,d,s)}var f=d.child;if(f!==null)f.return=d,ye=f;else for(;ye!==null;){d=ye;var h=d.sibling,p=d.return;if(FC(d),d===u){ye=null;break}if(h!==null){h.return=p,ye=h;break}ye=p}}}var g=s.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(m!==null)}}ye=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ye=o;else e:for(;ye!==null;){if(s=ye,s.flags&2048)switch(s.tag){case 0:case 11:case 15:kc(9,s,s.return)}var v=s.sibling;if(v!==null){v.return=s.return,ye=v;break e}ye=s.return}}var x=e.current;for(ye=x;ye!==null;){o=ye;var S=o.child;if(o.subtreeFlags&2064&&S!==null)S.return=o,ye=S;else e:for(o=x;ye!==null;){if(l=ye,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:fp(9,l)}}catch(w){Ot(l,l.return,w)}if(l===o){ye=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,ye=j;break e}ye=l.return}}if(He=a,Ti(),ia&&typeof ia.onPostCommitFiberRoot=="function")try{ia.onPostCommitFiberRoot(ap,e)}catch{}r=!0}return r}finally{et=n,Sr.transition=t}}return!1}function PS(e,t,n){t=$o(n,t),t=TC(e,t,1),e=yi(e,t,1),t=In(),e!==null&&(Fu(e,1,t),Gn(e,t))}function Ot(e,t,n){if(e.tag===3)PS(e,e,n);else for(;t!==null;){if(t.tag===3){PS(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(bi===null||!bi.has(r))){e=$o(n,e),e=OC(t,e,1),t=yi(t,e,1),e=In(),t!==null&&(Fu(t,1,e),Gn(t,e));break}}t=t.return}}function kD(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=In(),e.pingedLanes|=e.suspendedLanes&n,tn===e&&(pn&n)===n&&(Vt===4||Vt===3&&(pn&130023424)===pn&&500>It()-Nx?ls(e,0):jx|=n),Gn(e,t)}function QC(e,t){t===0&&(e.mode&1?(t=yd,yd<<=1,!(yd&130023424)&&(yd=4194304)):t=1);var n=In();e=Ia(e,t),e!==null&&(Fu(e,t,n),Gn(e,n))}function jD(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),QC(e,n)}function ND(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(le(314))}r!==null&&r.delete(t),QC(e,n)}var ZC;ZC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wn.current)Fn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Fn=!1,fD(e,t,n);Fn=!!(e.flags&131072)}else Fn=!1,wt&&t.flags&1048576&&nC(t,Rf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;pf(e,t),e=t.pendingProps;var a=Po(t,En.current);jo(t,n),a=yx(null,t,r,e,a,n);var s=bx();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Hn(r)?(s=!0,Of(t)):s=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,hx(t),a.updater=dp,t.stateNode=a,a._reactInternals=t,Mv(t,r,e,n),t=Lv(null,t,r,!0,s,n)):(t.tag=0,wt&&s&&sx(t),Pn(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(pf(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=_D(r),e=Ir(r,e),a){case 0:t=$v(null,t,r,e,n);break e;case 1:t=SS(null,t,r,e,n);break e;case 11:t=xS(null,t,r,e,n);break e;case 14:t=wS(null,t,r,Ir(r.type,e),n);break e}throw Error(le(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Ir(r,a),$v(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Ir(r,a),SS(e,t,r,a,n);case 3:e:{if(IC(t),e===null)throw Error(le(387));r=t.pendingProps,s=t.memoizedState,a=s.element,lC(e,t),$f(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){a=$o(Error(le(423)),t),t=kS(e,t,r,n,a);break e}else if(r!==a){a=$o(Error(le(424)),t),t=kS(e,t,r,n,a);break e}else for(nr=vi(t.stateNode.containerInfo.firstChild),rr=t,wt=!0,Dr=null,n=sC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ro(),r===a){t=$a(e,t,n);break e}Pn(e,t,r,n)}t=t.child}return t;case 5:return cC(t),e===null&&Ov(t),r=t.type,a=t.pendingProps,s=e!==null?e.memoizedProps:null,o=a.children,Ev(r,a)?o=null:s!==null&&Ev(r,s)&&(t.flags|=32),MC(e,t),Pn(e,t,o,n),t.child;case 6:return e===null&&Ov(t),null;case 13:return $C(e,t,n);case 4:return px(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Mo(t,null,r,n):Pn(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Ir(r,a),xS(e,t,r,a,n);case 7:return Pn(e,t,t.pendingProps,n),t.child;case 8:return Pn(e,t,t.pendingProps.children,n),t.child;case 12:return Pn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,s=t.memoizedProps,o=a.value,dt(Mf,r._currentValue),r._currentValue=o,s!==null)if(qr(s.value,o)){if(s.children===a.children&&!Wn.current){t=$a(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=Ca(-1,n&-n),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Pv(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(le(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Pv(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Pn(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,jo(t,n),a=jr(a),r=r(a),t.flags|=1,Pn(e,t,r,n),t.child;case 14:return r=t.type,a=Ir(r,t.pendingProps),a=Ir(r.type,a),wS(e,t,r,a,n);case 15:return PC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Ir(r,a),pf(e,t),t.tag=1,Hn(r)?(e=!0,Of(t)):e=!1,jo(t,n),CC(t,r,a),Mv(t,r,a,n),Lv(null,t,r,!0,e,n);case 19:return LC(e,t,n);case 22:return RC(e,t,n)}throw Error(le(156,t.tag))};function JC(e,t){return EA(e,t)}function ED(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xr(e,t,n,r){return new ED(e,t,n,r)}function Cx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _D(e){if(typeof e=="function")return Cx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Vb)return 11;if(e===Yb)return 14}return 2}function wi(e,t){var n=e.alternate;return n===null?(n=xr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function vf(e,t,n,r,a,s){var o=2;if(r=e,typeof e=="function")Cx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ro:return cs(n.children,a,s,t);case Kb:o=8,a|=8;break;case av:return e=xr(12,n,t,a|2),e.elementType=av,e.lanes=s,e;case iv:return e=xr(13,n,t,a),e.elementType=iv,e.lanes=s,e;case sv:return e=xr(19,n,t,a),e.elementType=sv,e.lanes=s,e;case cA:return pp(n,a,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oA:o=10;break e;case lA:o=9;break e;case Vb:o=11;break e;case Yb:o=14;break e;case ti:o=16,r=null;break e}throw Error(le(130,e==null?e:typeof e,""))}return t=xr(o,n,t,a),t.elementType=e,t.type=r,t.lanes=s,t}function cs(e,t,n,r){return e=xr(7,e,r,t),e.lanes=n,e}function pp(e,t,n,r){return e=xr(22,e,r,t),e.elementType=cA,e.lanes=n,e.stateNode={isHidden:!1},e}function Km(e,t,n){return e=xr(6,e,null,t),e.lanes=n,e}function Vm(e,t,n){return t=xr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function AD(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Am(0),this.expirationTimes=Am(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Am(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Tx(e,t,n,r,a,s,o,l,c){return e=new AD(e,t,n,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=xr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},hx(s),e}function CD(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:no,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function eT(e){if(!e)return Ei;e=e._reactInternals;e:{if(As(e)!==e||e.tag!==1)throw Error(le(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Hn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(le(171))}if(e.tag===1){var n=e.type;if(Hn(n))return eC(e,n,t)}return t}function tT(e,t,n,r,a,s,o,l,c){return e=Tx(n,r,!0,e,a,s,o,l,c),e.context=eT(null),n=e.current,r=In(),a=xi(n),s=Ca(r,a),s.callback=t??null,yi(n,s,a),e.current.lanes=a,Fu(e,a,r),Gn(e,r),e}function mp(e,t,n,r){var a=t.current,s=In(),o=xi(a);return n=eT(n),t.context===null?t.context=n:t.pendingContext=n,t=Ca(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=yi(a,t,o),e!==null&&(Ur(e,a,o,s),df(e,a,o)),o}function Hf(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function RS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ox(e,t){RS(e,t),(e=e.alternate)&&RS(e,t)}function TD(){return null}var nT=typeof reportError=="function"?reportError:function(e){console.error(e)};function Px(e){this._internalRoot=e}gp.prototype.render=Px.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(le(409));mp(e,t,null,null)};gp.prototype.unmount=Px.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xs(function(){mp(null,e,null,null)}),t[Ma]=null}};function gp(e){this._internalRoot=e}gp.prototype.unstable_scheduleHydration=function(e){if(e){var t=RA();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ai.length&&t!==0&&t<ai[n].priority;n++);ai.splice(n,0,e),n===0&&IA(e)}};function Rx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function MS(){}function OD(e,t,n,r,a){if(a){if(typeof r=="function"){var s=r;r=function(){var u=Hf(o);s.call(u)}}var o=tT(t,r,e,0,null,!1,!1,"",MS);return e._reactRootContainer=o,e[Ma]=o.current,Uc(e.nodeType===8?e.parentNode:e),xs(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var u=Hf(c);l.call(u)}}var c=Tx(e,0,!1,null,null,!1,!1,"",MS);return e._reactRootContainer=c,e[Ma]=c.current,Uc(e.nodeType===8?e.parentNode:e),xs(function(){mp(t,c,n,r)}),c}function yp(e,t,n,r,a){var s=n._reactRootContainer;if(s){var o=s;if(typeof a=="function"){var l=a;a=function(){var c=Hf(o);l.call(c)}}mp(t,o,e,a)}else o=OD(n,t,e,a,r);return Hf(o)}OA=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=fc(t.pendingLanes);n!==0&&(Zb(t,n|1),Gn(t,It()),!(He&6)&&(Lo=It()+500,Ti()))}break;case 13:xs(function(){var r=Ia(e,1);if(r!==null){var a=In();Ur(r,e,1,a)}}),Ox(e,1)}};Jb=function(e){if(e.tag===13){var t=Ia(e,134217728);if(t!==null){var n=In();Ur(t,e,134217728,n)}Ox(e,134217728)}};PA=function(e){if(e.tag===13){var t=xi(e),n=Ia(e,t);if(n!==null){var r=In();Ur(n,e,t,r)}Ox(e,t)}};RA=function(){return et};MA=function(e,t){var n=et;try{return et=e,t()}finally{et=n}};gv=function(e,t,n){switch(t){case"input":if(cv(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=lp(r);if(!a)throw Error(le(90));dA(r),cv(r,a)}}}break;case"textarea":hA(e,n);break;case"select":t=n.value,t!=null&&xo(e,!!n.multiple,t,!1)}};xA=Ex;wA=xs;var PD={usingClientEntryPoint:!1,Events:[Wu,oo,lp,yA,bA,Ex]},Vl={findFiberByHostInstance:es,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},RD={bundleType:Vl.bundleType,version:Vl.version,rendererPackageName:Vl.rendererPackageName,rendererConfig:Vl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:za.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jA(e),e===null?null:e.stateNode},findFiberByHostInstance:Vl.findFiberByHostInstance||TD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cd.isDisabled&&Cd.supportsFiber)try{ap=Cd.inject(RD),ia=Cd}catch{}}or.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PD;or.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Rx(t))throw Error(le(200));return CD(e,t,null,n)};or.createRoot=function(e,t){if(!Rx(e))throw Error(le(299));var n=!1,r="",a=nT;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Tx(e,1,!1,null,null,n,!1,r,a),e[Ma]=t.current,Uc(e.nodeType===8?e.parentNode:e),new Px(t)};or.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(le(188)):(e=Object.keys(e).join(","),Error(le(268,e)));return e=jA(t),e=e===null?null:e.stateNode,e};or.flushSync=function(e){return xs(e)};or.hydrate=function(e,t,n){if(!vp(t))throw Error(le(200));return yp(null,e,t,!0,n)};or.hydrateRoot=function(e,t,n){if(!Rx(e))throw Error(le(405));var r=n!=null&&n.hydratedSources||null,a=!1,s="",o=nT;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=tT(t,null,e,1,n??null,a,!1,s,o),e[Ma]=t.current,Uc(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new gp(t)};or.render=function(e,t,n){if(!vp(t))throw Error(le(200));return yp(null,e,t,!1,n)};or.unmountComponentAtNode=function(e){if(!vp(e))throw Error(le(40));return e._reactRootContainer?(xs(function(){yp(null,null,e,!1,function(){e._reactRootContainer=null,e[Ma]=null})}),!0):!1};or.unstable_batchedUpdates=Ex;or.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vp(n))throw Error(le(200));if(e==null||e._reactInternals===void 0)throw Error(le(38));return yp(e,t,n,!1,r)};or.version="18.3.1-next-f1338f8080-20240426";function rT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rT)}catch(e){console.error(e)}}rT(),rA.exports=or;var MD=rA.exports,aT,IS=MD;aT=IS.createRoot,IS.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.3
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function Qc(){return Qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qc.apply(null,arguments)}var di;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(di||(di={}));const $S="popstate";function ID(e){e===void 0&&(e={});function t(r,a){let{pathname:s,search:o,hash:l}=r.location;return Yv("",{pathname:s,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Gf(a)}return LD(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Mx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $D(){return Math.random().toString(36).substr(2,8)}function LS(e,t){return{usr:e.state,key:e.key,idx:t}}function Yv(e,t,n,r){return n===void 0&&(n=null),Qc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?dl(t):t,{state:n,key:t&&t.key||r||$D()})}function Gf(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function dl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function LD(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:s=!1}=r,o=a.history,l=di.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Qc({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=di.Pop;let y=d(),v=y==null?null:y-u;u=y,c&&c({action:l,location:m.location,delta:v})}function h(y,v){l=di.Push;let x=Yv(m.location,y,v);u=d()+1;let S=LS(x,u),j=m.createHref(x);try{o.pushState(S,"",j)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;a.location.assign(j)}s&&c&&c({action:l,location:m.location,delta:1})}function p(y,v){l=di.Replace;let x=Yv(m.location,y,v);u=d();let S=LS(x,u),j=m.createHref(x);o.replaceState(S,"",j),s&&c&&c({action:l,location:m.location,delta:0})}function g(y){let v=a.location.origin!=="null"?a.location.origin:a.location.href,x=typeof y=="string"?y:Gf(y);return x=x.replace(/ $/,"%20"),Et(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let m={get action(){return l},get location(){return e(a,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener($S,f),c=y,()=>{a.removeEventListener($S,f),c=null}},createHref(y){return t(a,y)},createURL:g,encodeLocation(y){let v=g(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:p,go(y){return o.go(y)}};return m}var DS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(DS||(DS={}));function DD(e,t,n){return n===void 0&&(n="/"),BD(e,t,n)}function BD(e,t,n,r){let a=typeof t=="string"?dl(t):t,s=Do(a.pathname||"/",n);if(s==null)return null;let o=iT(e);zD(o);let l=null,c=QD(s);for(let u=0;l==null&&u<o.length;++u)l=YD(o[u],c);return l}function iT(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(s,o,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(Et(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Si([r,c.relativePath]),d=n.concat(c);s.children&&s.children.length>0&&(Et(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),iT(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:KD(u,s.index),routesMeta:d})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))a(s,o);else for(let c of sT(s.path))a(s,o,c)}),t}function sT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let o=sT(r.join("/")),l=[];return l.push(...o.map(c=>c===""?s:[s,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function zD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:VD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const FD=/^:[\w-]+$/,UD=3,WD=2,HD=1,GD=10,qD=-2,BS=e=>e==="*";function KD(e,t){let n=e.split("/"),r=n.length;return n.some(BS)&&(r+=qD),t&&(r+=WD),n.filter(a=>!BS(a)).reduce((a,s)=>a+(FD.test(s)?UD:s===""?HD:GD),r)}function VD(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function YD(e,t,n){let{routesMeta:r}=e,a={},s="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",f=Xv({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(a,f.params),o.push({params:a,pathname:Si([s,f.pathname]),pathnameBase:n2(Si([s,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(s=Si([s,f.pathnameBase]))}return o}function Xv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=XD(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let s=a[0],o=s.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=l[f]||"";o=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const g=l[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function XD(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Mx(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function QD(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Mx(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Do(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const ZD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,JD=e=>ZD.test(e);function e2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?dl(e):e,s;if(n)if(JD(n))s=n;else{if(n.includes("//")){let o=n;n=oT(n),Mx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=zS(n.substring(1),"/"):s=zS(n,t)}else s=t;return{pathname:s,search:r2(r),hash:a2(a)}}function zS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ym(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function t2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ix(e,t){let n=t2(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function $x(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=dl(e):(a=Qc({},e),Et(!a.pathname||!a.pathname.includes("?"),Ym("?","pathname","search",a)),Et(!a.pathname||!a.pathname.includes("#"),Ym("#","pathname","hash",a)),Et(!a.search||!a.search.includes("#"),Ym("#","search","hash",a)));let s=e===""||a.pathname==="",o=s?"/":a.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=e2(a,l),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const oT=e=>e.replace(/\/\/+/g,"/"),Si=e=>oT(e.join("/")),n2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),r2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,a2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function i2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lT=["post","put","patch","delete"];new Set(lT);const s2=["get",...lT];new Set(s2);/**
|
|
50
|
+
* React Router v6.30.4
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function Zc(){return Zc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zc.apply(null,arguments)}const bp=k.createContext(null),cT=k.createContext(null),Fa=k.createContext(null),xp=k.createContext(null),Oi=k.createContext({outlet:null,matches:[],isDataRoute:!1}),uT=k.createContext(null);function o2(e,t){let{relative:n}=t===void 0?{}:t;fl()||Et(!1);let{basename:r,navigator:a}=k.useContext(Fa),{hash:s,pathname:o,search:l}=wp(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Si([r,o])),a.createHref({pathname:c,search:l,hash:s})}function fl(){return k.useContext(xp)!=null}function Cs(){return fl()||Et(!1),k.useContext(xp).location}function dT(e){k.useContext(Fa).static||k.useLayoutEffect(e)}function Lx(){let{isDataRoute:e}=k.useContext(Oi);return e?x2():l2()}function l2(){fl()||Et(!1);let e=k.useContext(bp),{basename:t,future:n,navigator:r}=k.useContext(Fa),{matches:a}=k.useContext(Oi),{pathname:s}=Cs(),o=JSON.stringify(Ix(a,n.v7_relativeSplatPath)),l=k.useRef(!1);return dT(()=>{l.current=!0}),k.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=$x(u,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Si([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,s,e])}function wp(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=k.useContext(Fa),{matches:a}=k.useContext(Oi),{pathname:s}=Cs(),o=JSON.stringify(Ix(a,r.v7_relativeSplatPath));return k.useMemo(()=>$x(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function c2(e,t){return u2(e,t)}function u2(e,t,n,r){fl()||Et(!1);let{navigator:a}=k.useContext(Fa),{matches:s}=k.useContext(Oi),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Cs(),d;if(t){var f;let y=typeof t=="string"?dl(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||Et(!1),d=y}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let y=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=DD(e,{pathname:p}),m=m2(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:Si([c,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:Si([c,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return t&&m?k.createElement(xp.Provider,{value:{location:Zc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:di.Pop}},m):m}function d2(){let e=b2(),t=i2(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:a},n):null,null)}const f2=k.createElement(d2,null);class h2 extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?k.createElement(Oi.Provider,{value:this.props.routeContext},k.createElement(uT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function p2(e){let{routeContext:t,match:n,children:r}=e,a=k.useContext(bp);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(Oi.Provider,{value:t},r)}function m2(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Et(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,g=!1,m=null,y=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||f2,c&&(u<0&&h===0?(w2("route-fallback"),g=!0,y=null):u===h&&(g=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,h+1)),x=()=>{let S;return p?S=m:g?S=y:f.route.Component?S=k.createElement(f.route.Component,null):f.route.element?S=f.route.element:S=d,k.createElement(p2,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:S})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?k.createElement(h2,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var fT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(fT||{}),hT=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(hT||{});function g2(e){let t=k.useContext(bp);return t||Et(!1),t}function v2(e){let t=k.useContext(cT);return t||Et(!1),t}function y2(e){let t=k.useContext(Oi);return t||Et(!1),t}function pT(e){let t=y2(),n=t.matches[t.matches.length-1];return n.route.id||Et(!1),n.route.id}function b2(){var e;let t=k.useContext(uT),n=v2(),r=pT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function x2(){let{router:e}=g2(fT.UseNavigateStable),t=pT(hT.UseNavigateStable),n=k.useRef(!1);return dT(()=>{n.current=!0}),k.useCallback(function(a,s){s===void 0&&(s={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Zc({fromRouteId:t},s)))},[e,t])}const FS={};function w2(e,t,n){FS[e]||(FS[e]=!0)}function S2(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function US(e){let{to:t,replace:n,state:r,relative:a}=e;fl()||Et(!1);let{future:s,static:o}=k.useContext(Fa),{matches:l}=k.useContext(Oi),{pathname:c}=Cs(),u=Lx(),d=$x(t,Ix(l,s.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(d);return k.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:a}),[u,f,a,n,r]),null}function Je(e){Et(!1)}function k2(e){let{basename:t="/",children:n=null,location:r,navigationType:a=di.Pop,navigator:s,static:o=!1,future:l}=e;fl()&&Et(!1);let c=t.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:c,navigator:s,static:o,future:Zc({v7_relativeSplatPath:!1},l)}),[c,l,s,o]);typeof r=="string"&&(r=dl(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=k.useMemo(()=>{let y=Do(d,c);return y==null?null:{location:{pathname:y,search:f,hash:h,state:p,key:g},navigationType:a}},[c,d,f,h,p,g,a]);return m==null?null:k.createElement(Fa.Provider,{value:u},k.createElement(xp.Provider,{children:n,value:m}))}function j2(e){let{children:t,location:n}=e;return c2(Qv(t),n)}new Promise(()=>{});function Qv(e,t){t===void 0&&(t=[]);let n=[];return k.Children.forEach(e,(r,a)=>{if(!k.isValidElement(r))return;let s=[...t,a];if(r.type===k.Fragment){n.push.apply(n,Qv(r.props.children,s));return}r.type!==Je&&Et(!1),!r.props.index||!r.props.children||Et(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Qv(r.props.children,s)),n.push(o)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.4
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function qf(){return qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qf.apply(null,arguments)}function mT(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function N2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function E2(e,t){return e.button===0&&(!t||t==="_self")&&!N2(e)}const _2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],A2=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],C2="6";try{window.__reactRouterVersion=C2}catch{}const T2=k.createContext({isTransitioning:!1}),O2="startTransition",WS=k$[O2];function P2(e){let{basename:t,children:n,future:r,window:a}=e,s=k.useRef();s.current==null&&(s.current=ID({window:a,v5Compat:!0}));let o=s.current,[l,c]=k.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=k.useCallback(f=>{u&&WS?WS(()=>c(f)):c(f)},[c,u]);return k.useLayoutEffect(()=>o.listen(d),[o,d]),k.useEffect(()=>S2(r),[r]),k.createElement(k2,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const R2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",M2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jt=k.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:s,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=mT(t,_2),{basename:p}=k.useContext(Fa),g,m=!1;if(typeof u=="string"&&M2.test(u)&&(g=u,R2))try{let S=new URL(window.location.href),j=u.startsWith("//")?new URL(S.protocol+u):new URL(u),w=Do(j.pathname,p);j.origin===S.origin&&w!=null?u=w+j.search+j.hash:m=!0}catch{}let y=o2(u,{relative:a}),v=$2(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function x(S){r&&r(S),S.defaultPrevented||v(S)}return k.createElement("a",qf({},h,{href:g||y,onClick:m||s?r:x,ref:n,target:c}))}),HS=k.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:s="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=mT(t,A2),h=wp(c,{relative:f.relative}),p=Cs(),g=k.useContext(cT),{navigator:m,basename:y}=k.useContext(Fa),v=g!=null&&L2(h)&&u===!0,x=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,S=p.pathname,j=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(S=S.toLowerCase(),j=j?j.toLowerCase():null,x=x.toLowerCase()),j&&y&&(j=Do(j,y)||j);const w=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let b=S===x||!o&&S.startsWith(x)&&S.charAt(w)==="/",N=j!=null&&(j===x||!o&&j.startsWith(x)&&j.charAt(x.length)==="/"),E={isActive:b,isPending:N,isTransitioning:v},T=b?r:void 0,A;typeof s=="function"?A=s(E):A=[s,b?"active":null,N?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let M=typeof l=="function"?l(E):l;return k.createElement(Jt,qf({},f,{"aria-current":T,className:A,ref:n,style:M,to:c,viewTransition:u}),typeof d=="function"?d(E):d)});var Zv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Zv||(Zv={}));var GS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(GS||(GS={}));function I2(e){let t=k.useContext(bp);return t||Et(!1),t}function $2(e,t){let{target:n,replace:r,state:a,preventScrollReset:s,relative:o,viewTransition:l}=t===void 0?{}:t,c=Lx(),u=Cs(),d=wp(e,{relative:o});return k.useCallback(f=>{if(E2(f,n)){f.preventDefault();let h=r!==void 0?r:Gf(u)===Gf(d);c(e,{replace:h,state:a,preventScrollReset:s,relative:o,viewTransition:l})}},[u,c,d,r,a,n,e,s,o,l])}function L2(e,t){t===void 0&&(t={});let n=k.useContext(T2);n==null&&Et(!1);let{basename:r}=I2(Zv.useViewTransitionState),a=wp(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Do(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Do(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xv(a.pathname,o)!=null||Xv(a.pathname,s)!=null}async function Qn(e){if(!e.ok)return null;const t=e.headers.get("content-type")||"";if(!t.includes("application/json")&&!t.includes("text/json"))return t.includes("text/html")&&console.warn(`[dashboard] GET ${e.url||"/api/*"} returned HTML (${e.status}) instead of JSON — the dashboard server may be an older version. Stop it and start it again (agent-nuvira dashboard stop, or Ctrl+C in its terminal).`),null;try{return await e.json()}catch{return null}}const mo="buff-dashboard-admin-token";function gT(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{}return null}function D2(e){if(!e||typeof e!="object")return!1;const t=e,n=t.diff;return typeof t.dir=="string"&&typeof t.base=="string"&&typeof t.removed=="boolean"&&!!n&&typeof n=="object"&&Array.isArray(n.files)&&n.files.every(r=>typeof r=="string")&&typeof n.summary=="string"&&!!n.payload&&typeof n.payload=="object"&&typeof n.payload.summary=="string"&&Array.isArray(n.payload.files)&&n.payload.files.every(r=>!!r&&typeof r.path=="string"&&typeof r.body=="string")}function B2(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.replayed=="number"&&typeof t.modelCalls=="number"&&typeof t.saved=="boolean"&&typeof t.notice=="string"&&(t.callsAvoided===void 0||typeof t.callsAvoided=="number")}const Jv=new Map;function z2(){const e=gT();if(e)try{const t=e.getItem(mo);if(t)return t}catch{}return Jv.get(mo)??null}function F2(e){const t=gT();if(t)try{e?t.setItem(mo,e):t.removeItem(mo);return}catch{}e?Jv.set(mo,e):Jv.delete(mo)}function un(){return z2()}function Xm(e){F2(e)}function cn(){const e=un();return e?{Authorization:`Bearer ${e}`}:{}}class U2{constructor(t=""){Xr(this,"sse",null);Xr(this,"listeners",new Set);Xr(this,"connectionListeners",new Set);Xr(this,"dagListeners",new Set);Xr(this,"typingListeners",new Set);Xr(this,"chatRetryListeners",new Set);Xr(this,"reconnectTimer",null);Xr(this,"baseUrl");Xr(this,"lastData",null);this.baseUrl=t}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}onConnectionChange(t){return this.connectionListeners.add(t),()=>this.connectionListeners.delete(t)}onDAGEvent(t){return this.dagListeners.add(t),()=>this.dagListeners.delete(t)}onTypingEvent(t){return this.typingListeners.add(t),()=>this.typingListeners.delete(t)}onChatRetryEvent(t){return this.chatRetryListeners.add(t),()=>this.chatRetryListeners.delete(t)}connect(){this.sse||(this.sse=new EventSource(`${this.baseUrl}/api/sse`),this.sse.addEventListener("init",t=>{try{const n=JSON.parse(t.data);this.lastData=n,this.notify(n),this.notifyConnection(!0)}catch(n){console.error("Failed to parse SSE init data:",n)}}),this.sse.addEventListener("refresh",t=>{try{const n=JSON.parse(t.data);this.lastData=n,this.notify(n),this.notifyConnection(!0)}catch(n){console.error("Failed to parse SSE refresh data:",n)}}),this.sse.addEventListener("dag",t=>{try{const n=JSON.parse(t.data);if(this.notifyDAG(n),this.lastData){const r={...this.lastData,dag:n};this.lastData=r,this.notify(r)}}catch(n){console.error("Failed to parse SSE dag event:",n)}}),this.sse.addEventListener("quota",t=>{try{const n=JSON.parse(t.data);if(this.lastData&&n.quota){const r={...this.lastData,routing:{...this.lastData.routing||{},quota:n.quota},serverTime:n.serverTime||this.lastData.serverTime};this.lastData=r,this.notify(r)}}catch(n){console.error("Failed to parse SSE quota event:",n)}}),this.sse.addEventListener("conversation",t=>{try{const n=JSON.parse(t.data);if(this.lastData&&n.conversations){const r={...this.lastData,conversations:{total:n.total??n.conversations.length,recent:n.conversations},serverTime:n.serverTime||this.lastData.serverTime};this.lastData=r,this.notify(r)}}catch(n){console.error("Failed to parse SSE conversation event:",n)}}),this.sse.addEventListener("typing",t=>{try{const n=JSON.parse(t.data);for(const r of this.typingListeners)try{r(n)}catch{}}catch(n){console.error("Failed to parse SSE typing event:",n)}}),this.sse.addEventListener("chat-retry",t=>{try{const n=JSON.parse(t.data);if(!n||typeof n.sessionId!="string"||typeof n.content!="string")return;for(const r of this.chatRetryListeners)try{r(n)}catch{}}catch(n){console.error("Failed to parse SSE chat-retry event:",n)}}),this.sse.onerror=()=>{this.notifyConnection(!1),this.disconnect(),this.reconnect()},this.sse.onopen=()=>{this.notifyConnection(!0)})}disconnect(){this.sse&&(this.sse.close(),this.sse=null),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}reconnect(){this.reconnectTimer=setTimeout(()=>{this.connect()},3e3)}notify(t){this.listeners.forEach(n=>n(t))}notifyDAG(t){this.dagListeners.forEach(n=>n(t))}notifyConnection(t){this.connectionListeners.forEach(n=>n(t))}async fetchAll(){try{const t=await fetch(`${this.baseUrl}/api/all`),n=await Qn(t);return n?(this.lastData=n,n):null}catch{return null}}async fetchExecutionAudit(t){try{const n=new URLSearchParams;t!=null&&t.skillName&&n.set("skillName",t.skillName),t!=null&&t.status&&n.set("status",t.status),t!=null&&t.limit&&n.set("limit",String(t.limit));const r=n.toString(),a=await fetch(`${this.baseUrl}/api/executions${r?`?${r}`:""}`,{signal:AbortSignal.timeout(8e3)}),s=await Qn(a);return(s==null?void 0:s.entries)??[]}catch{return[]}}async fetchTraces(){try{const t=await fetch(`${this.baseUrl}/api/traces`,{signal:AbortSignal.timeout(8e3)}),n=await Qn(t);return n!=null&&n.traces?n.traces:null}catch{return null}}async fetchAdminChecks(){try{const t=await fetch(`${this.baseUrl}/api/admin/checks`,{signal:AbortSignal.timeout(15e3)}),n=await Qn(t);return!n||!Array.isArray(n.system)||!Array.isArray(n.enterprise)||!Array.isArray(n.providers)?null:n}catch{return null}}async fetchHub(){var t;try{const n=await fetch(`${this.baseUrl}/api/hub`,{signal:AbortSignal.timeout(8e3)}),r=await Qn(n);return!r||!Array.isArray((t=r.toolsets)==null?void 0:t.toolsets)?null:r}catch{return null}}async fetchTraceDetail(t){try{const n=await fetch(`${this.baseUrl}/api/traces/${encodeURIComponent(t)}`,{signal:AbortSignal.timeout(8e3)}),r=await Qn(n);return r&&Array.isArray(r.steps)?r:null}catch{return null}}async sendAdminRequest(t,n,r){try{const a=un(),s=await fetch(`${this.baseUrl}${t}`,{method:n,headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},body:r!==void 0?JSON.stringify(r):void 0,signal:AbortSignal.timeout(15e3)}),o=s.headers.get("content-type")||"";let l=null;if(o.includes("application/json")||o.includes("text/json"))try{l=await s.json()}catch{l=null}return{status:s.status,data:l}}catch{return null}}async fetchAdminAuthStatus(){const t=await this.sendAdminRequest("/api/admin/auth-status","GET");if(!t||typeof t.data!="object"||t.data===null)return null;const n=t.data;return typeof n.configured!="boolean"||typeof n.authenticated!="boolean"?null:{configured:n.configured,authenticated:n.authenticated,user:typeof n.user=="string"?n.user:null,role:typeof n.role=="string"?n.role:null,mustChangePassword:n.mustChangePassword===!0}}async changeAdminPassword(t,n){const r=await this.sendAdminRequest("/api/admin/change-password","POST",{currentPassword:t,newPassword:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Could not change the password."}}async fetchAdminUsers(){const t=await this.sendAdminRequest("/api/admin/users","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok&&Array.isArray(n.users)?n:{ok:!1,error:n.error||"Failed to load users.",forbidden:t.status===403,unauthorized:t.status===401}}async addAdminUser(t,n,r){const a=await this.sendAdminRequest("/api/admin/users","POST",{user:t,password:n,role:r});if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?s:{ok:!1,error:s.error||"Failed to add user.",forbidden:a.status===403,unauthorized:a.status===401}}async removeAdminUser(t){const n=await this.sendAdminRequest(`/api/admin/users/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Failed to remove user.",forbidden:n.status===403,unauthorized:n.status===401}}async fetchAdminCatalog(){const t=await this.sendAdminRequest("/api/admin/catalog","GET"),n=t==null?void 0:t.data;return!n||!Array.isArray(n.providers)?null:n.providers}async adminSetup(t,n){const r=await this.sendAdminRequest("/api/admin/setup","POST",{user:t,password:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&typeof a.token=="string"?(Xm(a.token),{ok:!0,user:a.user,token:a.token}):{ok:!1,error:a.error||"Setup failed.",unauthorized:r.status===401}}async adminLogin(t,n){const r=await this.sendAdminRequest("/api/admin/login","POST",{user:t,password:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&typeof a.token=="string"?(Xm(a.token),{ok:!0,user:a.user,token:a.token}):{ok:!1,error:a.error||"Login failed.",unauthorized:r.status===401}}async adminLogout(){await this.sendAdminRequest("/api/admin/logout","POST"),Xm(null)}async shutdown(t){const n=await this.sendAdminRequest("/api/admin/shutdown","POST",{target:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Shutdown failed.",unauthorized:n.status===401,forbidden:n.status===403}}async saveProvider(t,n){const r=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}`,"PUT",n);if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Save failed.",unauthorized:r.status===401}}async deleteProvider(t){const n=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Remove failed.",unauthorized:n.status===401}}async testProvider(t){const n=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}/test`,"POST");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200?r:{ok:!1,error:r.error||"Test failed.",unauthorized:n.status===401}}async fetchAdminWorkspace(){const t=await this.sendAdminRequest("/api/admin/workspace","GET");if(!t)return null;const n=t.data??{};return t.status!==200||n.ok!==!0?null:{configured:typeof n.configured=="string"?n.configured:null,effective:typeof n.effective=="string"?n.effective:null,processCwd:typeof n.processCwd=="string"?n.processCwd:"",configuredValid:n.configuredValid===!0}}async saveAdminWorkspace(t){const n=await this.sendAdminRequest("/api/admin/workspace","PUT",{cwd:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok===!0?{ok:!0,workspace:{configured:typeof r.configured=="string"?r.configured:null,effective:typeof r.effective=="string"?r.effective:null,processCwd:typeof r.processCwd=="string"?r.processCwd:"",configuredValid:r.configuredValid===!0}}:{ok:!1,error:r.error||"Save failed.",unauthorized:n.status===401,forbidden:n.status===403}}async fetchAdminCache(){const t=await this.sendAdminRequest("/api/admin/cache","GET");if(!t)return null;const n=t.data;return!n||n.ok!==!0||!Array.isArray(n.workspaces)?null:n}async clearAdminCache(t){const n=await this.sendAdminRequest("/api/admin/cache/clear","POST",{scope:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0,removed:r.removed??0}:{ok:!1,error:r.error||"Could not clear the cache.",unauthorized:n.status===401,forbidden:n.status===403}}async fetchAdminServices(){const t=await this.sendAdminRequest("/api/admin/services","GET");if(!t)return null;const n=t.data;return!n||n.ok!==!0||!Array.isArray(n.services)?null:n}async saveService(t,n){const r=await this.sendAdminRequest(`/api/admin/services/${encodeURIComponent(t)}`,"PUT",{values:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Save failed.",unauthorized:r.status===401,forbidden:r.status===403}}async testService(t){const n=await this.sendAdminRequest(`/api/admin/services/${encodeURIComponent(t)}/test`,"POST");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200?r:{ok:!1,error:r.error||"Test failed."}}async removeService(t){const n=await this.sendAdminRequest(`/api/admin/services/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Remove failed.",unauthorized:n.status===401,forbidden:n.status===403}}async fetchAdminQuota(){const t=await this.sendAdminRequest("/api/admin/quota","GET");if(!t)return null;const n=t.data;return!n||!n.ok||typeof n.quota!="object"?null:n}async setToolsetEnabled(t,n){const r=await this.sendAdminRequest(`/api/admin/hub/toolsets/${encodeURIComponent(t)}`,"PUT",{enabled:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Toggle failed.",unauthorized:r.status===401,forbidden:r.status===403}}async setSkillEnabled(t,n){const r=await this.sendAdminRequest(`/api/admin/hub/skills/${encodeURIComponent(t)}`,"PUT",{enabled:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Toggle failed.",unauthorized:r.status===401,forbidden:r.status===403}}async marketplaceSearch(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/marketplace?q=${encodeURIComponent(t)}`,{headers:cn()})).json();return Array.isArray(r.results)?r.results:[]}catch{return[]}}async marketplaceInstall(t){try{const n=await fetch(`${this.baseUrl}/api/skills/marketplace/install`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({name:t})}),r=await n.json();return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Install failed.",quarantined:r.quarantined===!0}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async marketplaceUninstall(t){try{const n=await fetch(`${this.baseUrl}/api/skills/marketplace/uninstall`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({name:t})}),r=await n.json();return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Uninstall failed."}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async sendChannelMessage(t,n){const r=await this.sendAdminRequest("/api/admin/hub/channels/send","POST",{target:t,text:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Send failed.",unauthorized:r.status===401,forbidden:r.status===403}}async gatewayPolicies(){const t=await this.sendAdminRequest("/api/admin/gateway/policies","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?{ok:!0,policies:n.policies,statusRecipients:n.statusRecipients,contacts:n.contacts,askUserWait:n.askUserWait,askUserTimeoutMs:n.askUserTimeoutMs}:{ok:!1,error:n.error||"Failed to read policies.",unauthorized:t.status===401,forbidden:t.status===403}}async saveGatewayPolicies(t,n,r,a){const s={policies:t};Array.isArray(n)&&(s.statusRecipients=n),Array.isArray(r)&&(s.contacts=r),a&&(s.askUserWait=a.wait,typeof a.timeoutMs=="number"&&(s.askUserTimeoutMs=a.timeoutMs));const o=await this.sendAdminRequest("/api/admin/gateway/policies","PUT",s);if(!o)return{ok:!1,error:"Could not reach the dashboard server."};const l=o.data??{};return o.status===200&&l.ok?l:{ok:!1,error:l.error||"Failed to save policies.",unauthorized:o.status===401,forbidden:o.status===403}}async fetchGatewayConversations(t={}){const n=new URLSearchParams;t.offset&&n.set("offset",String(t.offset)),t.limit&&n.set("limit",String(t.limit)),t.q&&n.set("q",t.q);const r=n.toString(),a=await this.sendAdminRequest(`/api/admin/gateway/conversations${r?`?${r}`:""}`,"GET");if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?{ok:!0,conversations:s.conversations,total:s.total,hasMore:s.hasMore}:{ok:!1,error:s.error||"Failed to load conversations.",unauthorized:a.status===401,forbidden:a.status===403}}async clearGatewayConversation(t){const n=await this.sendAdminRequest("/api/admin/gateway/conversations","DELETE",{key:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Failed to clear conversation.",unauthorized:n.status===401,forbidden:n.status===403}}async addConversationTag(t,n){const r=await this.sendAdminRequest("/api/admin/gateway/conversations/tags","PUT",{action:"add",key:t,tag:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Failed to add tag.",unauthorized:r.status===401,forbidden:r.status===403}}async removeConversationTag(t,n){const r=await this.sendAdminRequest("/api/admin/gateway/conversations/tags","PUT",{action:"remove",key:t,tag:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Failed to remove tag.",unauthorized:r.status===401,forbidden:r.status===403}}async getAllConversationTags(){const t=await this.sendAdminRequest("/api/admin/gateway/conversations/tags","PUT",{action:"getAllTags"});if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?{ok:!0,tags:n.tags}:{ok:!1,error:n.error||"Failed to load tags.",unauthorized:t.status===401,forbidden:t.status===403}}async exportGatewayConversations(t){var n,r,a;try{const s=un(),o=await fetch(`${this.baseUrl}/api/admin/gateway/conversations/export`,{method:"POST",headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{}},body:JSON.stringify({keys:t}),signal:AbortSignal.timeout(3e4)});if(o.status===200&&((n=o.headers.get("content-type"))!=null&&n.includes("application/zip"))){const c=await o.blob(),u=URL.createObjectURL(c),d=document.createElement("a");return d.href=u,d.download=((a=(r=o.headers.get("content-disposition"))==null?void 0:r.match(/filename="(.+)"/))==null?void 0:a[1])||"conversations.zip",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u),{ok:!0}}return{ok:!1,error:(await o.json().catch(()=>({}))).error||"Export failed."}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}}async getContacts(){const t=await this.sendAdminRequest("/api/admin/contacts","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?{ok:!0,contacts:n.contacts}:{ok:!1,error:n.error||"Failed to read contacts."}}async approveContact(t,n){return this.contactAction("approve",t,n)}async rejectContact(t,n){return this.contactAction("reject",t,n)}async deleteContact(t,n){return this.contactAction("delete",t,n)}async updateContact(t,n,r){const a=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:"update",platform:t,id:n,...r});if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?s:{ok:!1,error:s.error||"Update failed."}}async contactAction(t,n,r){const a=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:t,platform:n,nameOrId:r});if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?s:{ok:!1,error:s.error||`${t} failed.`}}async getPlatformConfigs(){const t=await this.sendAdminRequest("/api/config/platforms","GET");if(!t)return[];const n=t.data??{};return Array.isArray(n.platforms)?n.platforms:[]}async setPlatformConfig(t,n){const r=await this.sendAdminRequest(`/api/config/platforms/${encodeURIComponent(t)}`,"POST",{values:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Save failed.",unauthorized:r.status===401,forbidden:r.status===403}}async removePlatformConfig(t){const n=await this.sendAdminRequest(`/api/config/platforms/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Remove failed.",unauthorized:n.status===401,forbidden:n.status===403}}async verifyPlatformConfig(t,n){const r=await this.sendAdminRequest(`/api/config/platforms/${encodeURIComponent(t)}/verify`,"POST",{values:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return{ok:a.ok??!1,info:a.info,error:a.error}}async saveAdminQuota(t){const n=await this.sendAdminRequest("/api/admin/quota","PUT",t);if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Save failed.",unauthorized:n.status===401}}async getBedrockStatus(){const t=await this.sendAdminRequest("/api/bedrock/status","GET");return!t||t.status!==200?{configured:!1,region:"us-east-1",authMethod:"none",apiKeySet:!1,iamKeySet:!1}:t.data??{}}async setupBedrock(t){const n=await this.sendAdminRequest("/api/bedrock/setup","POST",{envVars:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0,envVarsWritten:r.envVarsWritten}:{ok:!1,error:r.error||"Save failed."}}async probeBedrock(t){const n=await this.sendAdminRequest("/api/bedrock/probe","POST",{region:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0,models:r.models}:{ok:!1,error:r.error||"Probe failed."}}async listTasks(){const t=await this.sendAdminRequest("/api/tasks","GET");if(!t)return null;const n=t.data??{};return{status:t.status,tasks:Array.isArray(n.tasks)?n.tasks:[]}}async startTask(t,n){const r=await this.sendAdminRequest("/api/tasks","POST",{args:t,timeoutMs:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok&&a.task?a:{ok:!1,error:a.error||"Start failed.",unauthorized:r.status===401,forbidden:r.status===403}}async getTask(t){const n=await this.sendAdminRequest(`/api/tasks/${encodeURIComponent(t)}`,"GET");if(!n)return null;const r=n.data??{};return{status:n.status,task:r.task??null}}async cancelTask(t){const n=await this.sendAdminRequest(`/api/tasks/${encodeURIComponent(t)}/cancel`,"POST");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Cancel failed.",unauthorized:n.status===401,forbidden:n.status===403}}subscribeTask(t,n){const r=un(),a=new EventSource(`${this.baseUrl}/api/tasks/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return a.addEventListener("log",s=>{var o;try{(o=n.onLog)==null||o.call(n,JSON.parse(s.data))}catch{}}),a.addEventListener("status",s=>{var o;try{const l=JSON.parse(s.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),()=>a.close()}async getWhatsAppStatus(){const t=await this.sendAdminRequest("/api/whatsapp","GET");if(!t)return null;const n=t.data??{};return t.status===200&&n.ok&&n.status?{status:n.status,contacts:n.contacts??{}}:null}async startWhatsAppPair(t){const n=await this.sendAdminRequest("/api/whatsapp/pair","POST",{phone:t||void 0});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Pairing failed to start.",unauthorized:n.status===401,forbidden:n.status===403}}async cancelWhatsAppPair(){const t=await this.sendAdminRequest("/api/whatsapp/cancel","POST");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?n:{ok:!1,error:n.error||"Cancel failed.",unauthorized:t.status===401,forbidden:t.status===403}}async unpairWhatsApp(){const t=await this.sendAdminRequest("/api/whatsapp/unpair","POST");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?n:{ok:!1,error:n.error||"Unpair failed.",unauthorized:t.status===401,forbidden:t.status===403}}subscribeWhatsApp(t){const n=un(),r=new EventSource(`${this.baseUrl}/api/whatsapp/events?token=${encodeURIComponent(n??"")}`);return r.addEventListener("qr",a=>{var s;try{const o=JSON.parse(a.data);o.qr&&((s=t.onQr)==null||s.call(t,o.qr))}catch{}}),r.addEventListener("code",a=>{var s;try{const o=JSON.parse(a.data);o.code&&((s=t.onCode)==null||s.call(t,o.code))}catch{}}),r.addEventListener("status",a=>{var s;try{(s=t.onStatus)==null||s.call(t,JSON.parse(a.data))}catch{}}),()=>r.close()}async chatResolve(t){const n=un();try{const r=await fetch(`${this.baseUrl}/api/chat/resolve`,{method:"POST",headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{}},body:JSON.stringify({message:t}),signal:AbortSignal.timeout(1e4)}),a=await r.json();return r.status===200&&a.ok&&Array.isArray(a.matches)?{ok:!0,matches:a.matches}:{ok:!1,matches:[],error:typeof a.error=="string"?a.error:"Resolve failed."}}catch{return{ok:!1,matches:[],error:"Could not reach the dashboard server."}}}async listProjects(){const t=un();try{const n=await fetch(`${this.baseUrl}/api/projects`,{headers:t?{Authorization:`Bearer ${t}`}:{},signal:AbortSignal.timeout(1e4)}),r=await n.json();return n.status===200&&r.ok&&Array.isArray(r.projects)?r.projects:[]}catch{return[]}}async attachProject(t){const n=un();try{const r=await fetch(`${this.baseUrl}/api/projects/attach`,{method:"POST",headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{}},body:JSON.stringify({path:t}),signal:AbortSignal.timeout(3e4)}),a=await r.json();return r.status===200&&a.ok&&a.project?{ok:!0,project:a.project}:{ok:!1,error:typeof a.error=="string"?a.error:"Attach failed."}}catch{return{ok:!1,error:"Could not reach the dashboard server."}}}async browseDirectories(t,n){const r=un();try{const a=new URLSearchParams;t&&a.set("path",t),n!=null&&n.showDrives&&a.set("showDrives","1");const s=a.toString()?`?${a.toString()}`:"",o=await fetch(`${this.baseUrl}/api/browse${s}`,{headers:r?{Authorization:`Bearer ${r}`}:{},signal:AbortSignal.timeout(1e4)}),l=await o.json();return o.status===200&&l.ok&&Array.isArray(l.entries)?{ok:!0,path:l.path??"",entries:l.entries,parent:l.parent??null,isProject:l.isProject??!1,drives:l.drives,breadcrumbs:l.breadcrumbs}:{ok:!1,path:"",entries:[],parent:null,isProject:!1,error:typeof l.error=="string"?l.error:"Browse failed."}}catch{return{ok:!1,path:"",entries:[],parent:null,isProject:!1,error:"Could not reach the dashboard server."}}}async resolveFolder(t,n){const r=un();try{const a=await fetch(this.baseUrl+"/api/browse/resolve-folder",{method:"POST",headers:{"Content-Type":"application/json",...r?{Authorization:"Bearer "+r}:{}},body:JSON.stringify({name:t,subPath:n||""}),signal:AbortSignal.timeout(1e4)}),s=await a.json();return a.status===200&&s.ok&&s.path?{ok:!0,path:s.path}:{ok:!1,path:"",error:typeof s.error=="string"?s.error:"Could not resolve folder."}}catch{return{ok:!1,path:"",error:"Could not reach the dashboard server."}}}async listChatSessions(){const t=un();try{const n=await fetch(`${this.baseUrl}/api/sessions`,{headers:t?{Authorization:`Bearer ${t}`}:{},signal:AbortSignal.timeout(1e4)}),r=await n.json();return n.status===200&&r.ok&&Array.isArray(r.sessions)?r.sessions:[]}catch{return[]}}async deleteChatSession(t){const n=un();try{const r=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}`,{method:"DELETE",headers:n?{Authorization:`Bearer ${n}`}:{},signal:AbortSignal.timeout(1e4)}),a=await r.json();return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Could not delete the session."}}catch{return{ok:!1,error:"Network error — could not delete the session."}}}async renameChatSession(t,n){const r=un();try{const a=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}/rename`,{method:"POST",headers:{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:{}},body:JSON.stringify({title:n}),signal:AbortSignal.timeout(1e4)}),s=await a.json();return a.status===200&&s.ok?{ok:!0}:{ok:!1,error:s.error||"Could not rename the session."}}catch{return{ok:!1,error:"Network error — could not rename the session."}}}async getChatSession(t){const n=un();try{const r=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}`,{headers:n?{Authorization:`Bearer ${n}`}:{},signal:AbortSignal.timeout(1e4)}),a=await r.json();return r.status===200&&a.ok&&a.session?a.session:null}catch{return null}}async chatSend(t,n,r,a){const s=un();try{const o=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{}},body:JSON.stringify({sessionId:t,message:n,provider:r==null?void 0:r.provider,model:r==null?void 0:r.model,projectPath:r==null?void 0:r.projectPath,attachments:r==null?void 0:r.attachments,...(r==null?void 0:r.worktree)===void 0?{}:{worktree:r.worktree},...(r==null?void 0:r.keepWorktree)===void 0?{}:{keepWorktree:r.keepWorktree},...(r==null?void 0:r.resume)===void 0?{}:{resume:r.resume}}),signal:a?AbortSignal.any([AbortSignal.timeout(3e5),a]):AbortSignal.timeout(3e5)}),l=await o.json();return o.status===200&&l.ok?{ok:!0,content:typeof l.content=="string"?l.content:"",followups:Array.isArray(l.followups)?l.followups:[],provider:typeof l.provider=="string"?l.provider:null,model:typeof l.model=="string"?l.model:null,generationFailed:l.generationFailed===!0,retryQueued:l.retryQueued===!0,...l.needsProject===!0?{needsProject:!0}:{},...l.refused===!0?{refused:!0}:{},...D2(l.worktree)?{worktree:l.worktree}:{},...B2(l.resume)?{resume:l.resume}:{},...Array.isArray(l.findings)?{findings:l.findings}:{}}:{ok:!1,error:typeof l.error=="string"?l.error:"The agent could not answer.",unauthorized:o.status===401,forbidden:o.status===403}}catch{return{ok:!1,error:"Could not reach the dashboard server, or the turn timed out."}}}async chatReset(t){const n=await this.sendAdminRequest("/api/chat/reset","POST",{sessionId:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Reset failed."}}async chatSupportBundle(t){var r,a,s;const n=un();try{const o=await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/support-bundle`,{method:"GET",headers:{...n?{Authorization:`Bearer ${n}`}:{}},signal:AbortSignal.timeout(3e4)});if(o.status===200&&((r=o.headers.get("content-type"))!=null&&r.includes("application/zip"))){const c=await o.blob(),u=URL.createObjectURL(c),d=document.createElement("a");return d.href=u,d.download=((s=(a=o.headers.get("content-disposition"))==null?void 0:a.match(/filename="(.+)"/))==null?void 0:s[1])||"nuvira-support.zip",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u),{ok:!0}}return{ok:!1,error:(await o.json().catch(()=>({}))).error||"Could not build the support bundle."}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"Could not reach the dashboard server."}}}subscribeChat(t,n){const r=un(),a=new EventSource(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return a.addEventListener("progress",s=>{var o;try{const l=JSON.parse(s.data);l.line&&((o=n.onProgress)==null||o.call(n,l.line))}catch{}}),a.addEventListener("status",s=>{var o;try{const l=JSON.parse(s.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),a.addEventListener("token",s=>{var o;try{const l=JSON.parse(s.data);typeof l.text=="string"&&l.text.length>0&&((o=n.onToken)==null||o.call(n,l.text))}catch{}}),a.addEventListener("tool",s=>{var o;try{const l=JSON.parse(s.data);l.tool&&(l.phase==="started"||l.phase==="called")&&((o=n.onTool)==null||o.call(n,{id:l.id||`call_${Math.random().toString(36).slice(2,8)}`,tool:l.tool,phase:l.phase,args:l.args,ok:l.ok,result:l.result,error:l.error,durationMs:l.durationMs}))}catch{}}),a.addEventListener("plan",s=>{var o;try{const l=JSON.parse(s.data);l.goal&&Array.isArray(l.steps)&&((o=n.onPlan)==null||o.call(n,{goal:l.goal,steps:l.steps,revision:l.revision??0}))}catch{}}),a.addEventListener("diff",s=>{var o;try{const l=JSON.parse(s.data);Array.isArray(l.files)&&((o=n.onDiff)==null||o.call(n,{files:l.files,summary:l.summary??""}))}catch{}}),a.addEventListener("finding",s=>{var o;try{const c=JSON.parse(s.data).finding;c&&typeof c.claim=="string"&&(c.verdict==="CONFIRMED"||c.verdict==="PLAUSIBLE")&&((o=n.onFinding)==null||o.call(n,{claim:c.claim,verdict:c.verdict,outcome:typeof c.outcome=="string"?c.outcome:"",evidence:Array.isArray(c.evidence)?c.evidence:[],source:typeof c.source=="string"?c.source:""}))}catch{}}),a.addEventListener("skill_draft",s=>{var o;try{const l=JSON.parse(s.data);l.name&&l.markdown&&((o=n.onSkillDraft)==null||o.call(n,{name:l.name,description:l.description??"",markdown:l.markdown,updatedAt:l.updatedAt??0}))}catch{}}),a.addEventListener("secret_request",s=>{var o;try{const l=JSON.parse(s.data);l.skillName&&Array.isArray(l.missing)&&((o=n.onSecretRequest)==null||o.call(n,{skillName:l.skillName,missing:l.missing,persisted:l.persisted??{}}))}catch{}}),a.addEventListener("execution_result",s=>{var o;try{const l=JSON.parse(s.data);l.skillName&&l.runtime!==void 0&&((o=n.onExecutionResult)==null||o.call(n,{skillName:l.skillName,runtime:l.runtime,success:l.success??!1,durationMs:l.durationMs??0,exitCode:l.exitCode??0,stdout:l.stdout??"",stderr:l.stderr??"",timestamp:l.timestamp??Date.now()}))}catch{}}),a.addEventListener("question",s=>{var o;try{const l=JSON.parse(s.data);l.questionId&&l.question&&((o=n.onQuestion)==null||o.call(n,{questionId:l.questionId,question:l.question,choices:l.choices??[],multiSelect:l.multiSelect===!0}))}catch{}}),()=>a.close()}async chatRespond(t,n,r={}){try{const s=await(await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/respond`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({questionId:n,...r})})).json();return{ok:s.ok===!0,error:s.error}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async skillDraftAccept(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/drafts/${encodeURIComponent(t)}/accept`,{method:"POST",headers:{...cn()}})).json();return{ok:r.ok===!0,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async skillDraftReject(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/drafts/${encodeURIComponent(t)}`,{method:"DELETE",headers:{...cn()}})).json();return{ok:r.ok===!0,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async saveSecrets(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/secrets`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({vars:t})})).json();return{ok:r.ok===!0,error:r.error,saved:r.saved,refused:r.refused}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async fetchSkillEnv(){try{const t=await fetch(`${this.baseUrl}/api/skills/env`,{headers:{...cn()}}),n=await Qn(t);return(n==null?void 0:n.vars)??[]}catch{return[]}}async deleteSkillEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/env/delete`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,removed:r.removed,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async testSkillEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/env/test`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,usable:r.usable,detail:r.detail,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async fetchProcessEnv(){try{const t=await fetch(`${this.baseUrl}/api/process-env`,{headers:{...cn()}}),n=await Qn(t);return(n==null?void 0:n.vars)??[]}catch{return[]}}async fetchContinuity(){try{const t=await fetch(`${this.baseUrl}/api/continuity`,{headers:{...cn()}}),n=await Qn(t);return!n||n.ok!==!0?null:{sessions:n.sessions??[],recall:n.recall??[],toggles:n.toggles??{sessionStore:!1,sessionRecall:!1}}}catch{return null}}async clearContinuity(t,n){try{const a=await(await fetch(`${this.baseUrl}/api/continuity/clear`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({target:t,...n?{id:n}:{}})})).json();return{ok:a.ok===!0,removed:a.removed,error:a.error}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async fetchVerifyBacklog(){try{const t=await fetch(`${this.baseUrl}/api/models/verify-next`,{headers:{...cn()}});return await Qn(t)}catch{return null}}async startVerifyBacklog(t){try{const n=await fetch(`${this.baseUrl}/api/models/verify-next`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({count:t})}),r=await Qn(n);return r?{ok:r.ok===!0,error:r.error,refusal:r.refusal,state:r.state}:{ok:!1,error:"The dashboard server did not respond."}}catch(n){return{ok:!1,error:n instanceof Error?n.message:"Could not start the run."}}}async saveProcessEnvVar(t,n){try{const a=await(await fetch(`${this.baseUrl}/api/process-env`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({name:t,value:n})})).json();return{ok:a.ok===!0,row:a.row,error:a.error,reason:a.reason}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async deleteProcessEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/process-env/delete`,{method:"POST",headers:{"Content-Type":"application/json",...cn()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,removed:r.removed,row:r.row,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}}const Q=new U2,Jc=["enterprise","neutral","pastel","executive","contrast"],Sp=["light","dark"],Dx=[100,112,125,150],Kf={enterprise:"Enterprise",neutral:"Neutral",pastel:"Pastel",executive:"Executive",contrast:"High contrast"},vT="nuvira.dashboard.theme",qS={palette:"enterprise",mode:"dark",a11y:!1,fontScale:100};function Eo(e,t){return e.includes(t)}function W2(){return typeof window>"u"||typeof window.matchMedia!="function"?null:window.matchMedia("(prefers-color-scheme: dark)").matches}function yT(){const e=W2();return e===null?{...qS}:{...qS,mode:e?"dark":"light"}}function bT(){const e=yT();if(typeof localStorage>"u")return e;let t;try{const a=localStorage.getItem(vT);if(!a)return e;t=JSON.parse(a)}catch{return e}if(typeof t!="object"||t===null)return e;const n=t,r=Eo(Dx,n.fontScale)?n.fontScale:e.fontScale;return{palette:Eo(Jc,n.palette)?n.palette:e.palette,mode:Eo(Sp,n.mode)?n.mode:e.mode,a11y:typeof n.a11y=="boolean"?n.a11y:e.a11y,fontScale:r}}function xT(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(vT,JSON.stringify(e))}catch{}}function Bx(e,t){const n=typeof document<"u"?document.documentElement:void 0;n&&(n.setAttribute("data-palette",e.palette),n.setAttribute("data-mode",e.mode),n.setAttribute("data-a11y",e.a11y?"on":"off"),n.setAttribute("data-font-scale",String(e.fontScale)),n.style.colorScheme=e.mode)}function H2(e,t){const n={palette:Eo(Jc,t.palette)?t.palette:e.palette,mode:Eo(Sp,t.mode)?t.mode:e.mode,a11y:t.a11y??e.a11y,fontScale:Eo(Dx,t.fontScale)?t.fontScale:e.fontScale};return n.a11y||(n.fontScale=100),n}let gr=bT();const ey=new Set;function wT(){for(const e of ey)e()}function G2(e){return ey.add(e),()=>{ey.delete(e)}}function KS(){return gr}function Td(e){const t=H2(gr,e);t.palette===gr.palette&&t.mode===gr.mode&&t.a11y===gr.a11y&&t.fontScale===gr.fontScale||(gr=t,Bx(gr),xT(gr),wT())}function q2(){gr=yT(),Bx(gr),xT(gr),wT()}function K2(){return k.useSyncExternalStore(G2,KS,KS)}const VS={light:"Light",dark:"Dark"},YS={100:"100%",112:"112%",125:"125%",150:"150%"};function V2(){const e=K2(),[t,n]=k.useState(!1),r=k.useRef(null),a=k.useRef(null),s=k.useRef(null),o=k.useId(),l=`${o}-panel`;k.useEffect(()=>{if(!t)return;function u(f){var h;f.key==="Escape"&&(n(!1),(h=r.current)==null||h.focus())}function d(f){var p;const h=f.target;h&&((p=s.current)!=null&&p.contains(h))||n(!1)}return document.addEventListener("keydown",u),document.addEventListener("pointerdown",d),()=>{document.removeEventListener("keydown",u),document.removeEventListener("pointerdown",d)}},[t]),k.useEffect(()=>{var d,f,h;if(!t)return;(h=((d=a.current)==null?void 0:d.querySelector("input:checked"))??((f=a.current)==null?void 0:f.querySelector("input")))==null||h.focus()},[t]);const c=`${Kf[e.palette]} palette, ${VS[e.mode].toLowerCase()} mode, text size ${YS[e.fontScale]}`+(e.a11y?", accessibility mode on":"");return i.jsxs("div",{className:"theme-switcher",ref:s,onBlur:u=>{const d=u.relatedTarget;d&&!u.currentTarget.contains(d)&&n(!1)},children:[i.jsxs("button",{type:"button",ref:r,className:"theme-trigger","aria-expanded":t,"aria-controls":t?l:void 0,onClick:()=>n(u=>!u),children:[i.jsx("span",{"aria-hidden":"true",children:"🎨"}),i.jsx("span",{children:"Appearance"})]}),t&&i.jsxs("div",{className:"theme-panel",id:l,ref:a,children:[i.jsxs("fieldset",{className:"theme-group",children:[i.jsx("legend",{className:"theme-group-label",children:"Palette"}),Jc.map(u=>i.jsxs("label",{className:"theme-option",children:[i.jsx("input",{type:"radio",name:`${o}-palette`,value:u,checked:e.palette===u,onChange:()=>Td({palette:u})}),i.jsx("span",{className:"theme-swatch","data-swatch":u,"aria-hidden":"true"}),i.jsx("span",{className:"theme-option-label",children:Kf[u]})]},u))]}),i.jsxs("fieldset",{className:"theme-group",children:[i.jsx("legend",{className:"theme-group-label",children:"Mode"}),Sp.map(u=>i.jsxs("label",{className:"theme-option",children:[i.jsx("input",{type:"radio",name:`${o}-mode`,value:u,checked:e.mode===u,onChange:()=>Td({mode:u})}),i.jsx("span",{className:"theme-option-label",children:VS[u]})]},u))]}),i.jsxs("fieldset",{className:"theme-group",children:[i.jsx("legend",{className:"theme-group-label",children:"Text size"}),Dx.map(u=>i.jsxs("label",{className:"theme-option",children:[i.jsx("input",{type:"radio",name:`${o}-scale`,value:u,checked:e.fontScale===u,onChange:()=>Td({fontScale:u,a11y:e.a11y||u!==100})}),i.jsx("span",{className:"theme-option-label",children:YS[u]})]},u)),!e.a11y&&i.jsx("p",{className:"theme-hint",children:"A larger size turns on accessibility mode, which is what defines it."})]}),i.jsxs("div",{className:"theme-group",children:[i.jsxs("label",{className:"theme-switch",children:[i.jsx("input",{type:"checkbox",checked:e.a11y,onChange:u=>Td({a11y:u.target.checked})}),i.jsx("span",{className:"theme-switch-track","aria-hidden":"true"}),i.jsx("span",{className:"theme-option-label",children:"Accessibility mode"})]}),i.jsx("p",{className:"theme-hint",children:"Larger targets, stronger borders and no motion. Off by default so it never changes the look for anyone who does not need it."})]}),i.jsx("button",{type:"button",className:"theme-reset",onClick:q2,children:"Reset to system default"}),i.jsx("p",{className:"sr-only",role:"status",children:c})]})]})}function Y2(){const[e,t]=k.useState(null),[n,r]=k.useState(!1),[a,s]=k.useState(""),[o,l]=k.useState(""),[c,u]=k.useState(!1),[d,f]=k.useState(null),h=k.useRef(null),p=k.useCallback(()=>{Q.fetchAdminAuthStatus().then(S=>t(S))},[]);k.useEffect(()=>{p()},[p]),k.useEffect(()=>{if(!n)return;function S(w){h.current&&!h.current.contains(w.target)&&r(!1)}function j(w){w.key==="Escape"&&r(!1)}return document.addEventListener("mousedown",S),document.addEventListener("keydown",j),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("keydown",j)}},[n]);const g=(e==null?void 0:e.authenticated)===!0,m=(e==null?void 0:e.configured)===!0,y=async S=>{S.preventDefault(),u(!0),f(null);const j=m?await Q.adminLogin(a,o):await Q.adminSetup(a,o);j.ok?(s(""),l(""),r(!1),p()):f(j.error||(m?"Login failed.":"Setup failed.")),u(!1)},v=async()=>{r(!1),await Q.adminLogout(),p()},x=e?g?`👤 ${e.user||"account"}${e.role?` · ${e.role}`:""}`:"👤 Sign in":"👤 Account";return i.jsxs("div",{className:"topbar-account",ref:h,children:[i.jsx("button",{type:"button",className:"topbar-action","aria-haspopup":"menu","aria-expanded":n,onClick:()=>r(S=>!S),children:x}),n?i.jsx("div",{className:"topbar-account-menu",role:"menu",children:g?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"topbar-account-user",children:[i.jsx("span",{children:(e==null?void 0:e.user)||"account"}),e!=null&&e.role?i.jsx("span",{className:`admin-role-badge admin-role-${e.role}`,children:e.role}):null]}),e!=null&&e.mustChangePassword?i.jsx("p",{className:"topbar-account-hint",children:"Still on the first-run password — change it on the Admin page before writes will work."}):null,i.jsx("button",{type:"button",className:"topbar-account-item",onClick:()=>void v(),children:"🚪 Log out"})]}):i.jsxs("form",{className:"topbar-account-form",onSubmit:y,children:[i.jsx("p",{className:"topbar-account-title",children:m?"Sign in":"Create the first admin"}),i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:a,onChange:S=>s(S.target.value),autoComplete:"username",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password"}),i.jsx("input",{type:"password",value:o,onChange:S=>l(S.target.value),autoComplete:m?"current-password":"new-password",placeholder:"••••••••"})]}),d?i.jsx("div",{className:"admin-error",children:d}):null,i.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:c||!a||!o,children:c?"⏳ …":m?"🔐 Sign in":"🔐 Create admin"}),m?null:i.jsx("p",{className:"topbar-account-hint",children:"The first user is always an admin."})]})}):null]})}const ST=[{group:"General",items:[{keys:["?"],description:"Show the shortcut cheatsheet"},{keys:["F1"],description:"Open the Help page"},{keys:["Esc"],description:"Close a dialog or panel"},{keys:["g","c"],description:"Go to Chat"},{keys:["g","o"],description:"Go to Overview"},{keys:["g","t"],description:"Go to Tasks"},{keys:["g","m"],description:"Go to Models"},{keys:["g","s"],description:"Go to System"},{keys:["g","h"],description:"Go to Agent Hub"}]},{group:"Navigation",items:[{keys:["/"],description:"Focus the navigation filter"},{keys:["["],description:"Collapse / expand the navigation drawer"}]}],X2={c:"/",o:"/overview",t:"/tasks",m:"/models",s:"/system",h:"/hub"};function Q2(e){var a;const t=e;if(!t||typeof t.tagName!="string")return!1;if(t.isContentEditable)return!0;const n=(a=t.getAttribute)==null?void 0:a.call(t,"contenteditable");if(n!=null&&n!=="false")return!0;const r=t.tagName.toLowerCase();return r==="input"||r==="textarea"||r==="select"}function Z2({open:e,onClose:t}){const n=k.useId(),r=k.useRef(null),a=k.useRef(null);return k.useEffect(()=>{var l;if(!e)return;a.current=document.activeElement;const s=()=>{var c;return Array.from(((c=r.current)==null?void 0:c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))??[])};(l=s()[0])==null||l.focus();function o(c){if(c.key==="Escape"){c.stopPropagation(),t();return}if(c.key!=="Tab")return;const u=s();if(u.length===0)return;const d=u[0],f=u[u.length-1];c.shiftKey&&document.activeElement===d?(c.preventDefault(),f.focus()):!c.shiftKey&&document.activeElement===f&&(c.preventDefault(),d.focus())}return document.addEventListener("keydown",o),()=>{var c;document.removeEventListener("keydown",o),(c=a.current)==null||c.focus()}},[e,t]),e?i.jsx("div",{className:"modal-scrim",onClick:t,children:i.jsxs("div",{className:"shortcuts-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,ref:r,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:"shortcuts-head",children:[i.jsx("h2",{className:"shortcuts-title",id:n,children:"⌨️ Keyboard shortcuts"}),i.jsx("button",{type:"button",className:"btn-secondary",onClick:t,"aria-label":"Close keyboard shortcuts",children:"✕ Close"})]}),ST.map(s=>i.jsxs("section",{className:"shortcuts-group",children:[i.jsx("h3",{className:"shortcuts-group-title",children:s.group}),i.jsx("dl",{className:"shortcuts-list",children:s.items.map(o=>i.jsxs("div",{className:"shortcuts-row",children:[i.jsx("dt",{className:"shortcuts-keys",children:o.keys.map(l=>i.jsx("kbd",{className:"shortcuts-key",children:l},l))}),i.jsx("dd",{className:"shortcuts-description",children:o.description})]},o.description))})]},s.group)),i.jsxs("p",{className:"shortcuts-note",children:["Shortcuts are ignored while you are typing, so ",i.jsx("kbd",{className:"shortcuts-key",children:"?"})," in a question stays a question mark."]})]})}):null}const kT=[{path:"/overview",label:"Overview",icon:"📊"},{path:"/tasks",label:"Tasks",icon:"🚀"},{path:"/models",label:"Models",icon:"🧠"},{path:"/system",label:"System",icon:"⚙️"},{path:"/help",label:"Help",icon:"❓"}],ty=[{label:"Agent Management",items:[{path:"/",label:"Chat",icon:"💬"},{path:"/dag",label:"Execution",icon:"🔀"},{path:"/routing",label:"Routing",icon:"🤖"},{path:"/requests",label:"Requests",icon:"📨"},{path:"/hub",label:"Agent Hub",icon:"🧰"}]},{label:"Analysis & Monitoring",items:[{path:"/traces",label:"Traces",icon:"🔍"},{path:"/evals",label:"Evals",icon:"🏆"},{path:"/benchmarks",label:"Benchmarks",icon:"📈"},{path:"/costs",label:"Costs",icon:"💰"}]},{label:"Resources",items:[{path:"/memory",label:"Memory",icon:"💾"},{path:"/history",label:"History",icon:"📝"},{path:"/env",label:"Env Config",icon:"🔐"},{path:"/process-env",label:"Process Env",icon:"🌱"}]},{label:"Integrations",items:[{path:"/platforms",label:"Platforms",icon:"🌐"},{path:"/gateway",label:"Gateway",icon:"📡"},{path:"/contacts",label:"Contacts",icon:"📇"},{path:"/bedrock",label:"Bedrock",icon:"🪨"}]},{label:"Runtime",items:[{path:"/models/timeline",label:"Timeline",icon:"📅"},{path:"/executions",label:"Executions",icon:"📜"},{path:"/admin",label:"Admin",icon:"🛠️"}]}];function J2(e){const t=e.trim().toLowerCase();return t?ty.map(n=>n.label.toLowerCase().includes(t)?n:{...n,items:n.items.filter(r=>r.label.toLowerCase().includes(t))}).filter(n=>n.items.length>0):ty}function eB({children:e,connected:t,lastUpdated:n,onRefresh:r,refreshing:a=!1}){const[s,o]=k.useState(!1),[l,c]=k.useState(""),[u,d]=k.useState(!1),f=k.useRef(null),h=k.useRef(null),p=k.useRef(0),g=k.useId(),m=Cs(),y=Lx(),v=t?"connected":"reconnecting",x=t?"Connected":"Reconnecting...",S=J2(l),j=()=>o(!1);return k.useEffect(()=>{function w(b){var N,E;if(!(b.metaKey||b.ctrlKey||b.altKey)&&!Q2(b.target)){if(b.key==="Escape"){if(u)return;s&&(o(!1),(N=f.current)==null||N.focus());return}if(b.key==="?"){b.preventDefault(),d(!0);return}if(b.key==="F1"){b.preventDefault(),y("/help");return}if(b.key==="/"){b.preventDefault(),(E=h.current)==null||E.focus();return}if(b.key==="["){b.preventDefault(),o(T=>!T);return}if(b.key==="g"){p.current=Date.now();return}if(Date.now()-p.current<1500){const T=X2[b.key.toLowerCase()];p.current=0,T&&(b.preventDefault(),y(T))}}}return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[s,u,y]),k.useEffect(()=>{var w;s&&((w=h.current)==null||w.focus())},[s]),k.useEffect(()=>{j()},[m.pathname]),i.jsxs("div",{className:"layout",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{type:"button",ref:f,className:"topbar-menu","aria-label":"Toggle navigation","aria-controls":"app-nav","aria-expanded":s,onClick:()=>o(w=>!w),children:i.jsx("span",{"aria-hidden":"true",children:"☰"})}),i.jsxs("div",{className:"topbar-brand",children:[i.jsx("span",{className:"topbar-logo","aria-hidden":"true",children:"🤖"}),i.jsx("span",{className:"topbar-title",children:"Agent-Nuvira"})]}),i.jsx("nav",{className:"primary-nav","aria-label":"Primary",children:kT.map(w=>i.jsxs(HS,{to:w.path,end:!0,className:({isActive:b})=>`primary-link${b?" active":""}`,children:[i.jsx("span",{"aria-hidden":"true",children:w.icon})," ",w.label]},w.path))}),i.jsxs("div",{className:"topbar-actions",children:[i.jsxs("button",{type:"button",className:"topbar-action",onClick:r,disabled:a,"aria-busy":a,children:[i.jsx("span",{"aria-hidden":"true",children:"⟳"})," ",a?"Refreshing…":"Refresh"]}),i.jsxs("button",{type:"button",className:"topbar-action","aria-haspopup":"dialog","aria-expanded":u,onClick:()=>d(!0),children:[i.jsx("span",{"aria-hidden":"true",children:"⌨️"})," Shortcuts"]}),i.jsx(V2,{}),i.jsxs("a",{className:"topbar-action",href:"https://www.agent-nuvira.com",target:"_blank",rel:"noopener noreferrer",title:"Agent-Nuvira website — capabilities, commands, docs, setup",children:[i.jsx("span",{"aria-hidden":"true",children:"🌐"})," Website"]}),i.jsx(Y2,{})]})]}),i.jsxs("div",{className:"layout-body",children:[s&&i.jsx("div",{className:"nav-scrim",onClick:j,"aria-hidden":"true"}),i.jsxs("nav",{className:`nav${s?" open":""}`,id:"app-nav","aria-label":"Sections",children:[i.jsxs("div",{className:"nav-search",children:[i.jsx("label",{className:"sr-only",htmlFor:g,children:"Filter navigation"}),i.jsx("input",{id:g,ref:h,type:"search",className:"nav-search-input",placeholder:"Search",value:l,onChange:w=>c(w.target.value)})]}),i.jsxs("div",{className:"nav-links",children:[S.map(w=>i.jsxs("section",{className:"nav-group",children:[i.jsx("h2",{className:"nav-group-title",children:w.label}),w.items.map(b=>i.jsxs(HS,{to:b.path,end:b.path==="/",className:({isActive:N})=>`nav-link${N?" active":""}`,children:[i.jsx("span",{className:"nav-icon","aria-hidden":"true",children:b.icon}),b.label]},b.path))]},w.label)),S.length===0&&i.jsxs("p",{className:"nav-empty",children:["No sections match “",l,"”."]})]}),i.jsxs("div",{className:"nav-footer",children:[i.jsx("span",{className:`status-dot ${v}`}),i.jsx("span",{className:"status-text",children:x}),i.jsx("span",{className:"last-updated",children:n})]})]}),i.jsx("main",{className:"main",children:e})]}),i.jsx(Z2,{open:u,onClose:()=>d(!1)})]})}function jT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=jT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ve(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=jT(e))&&(r&&(r+=" "),r+=t);return r}var tB=Array.isArray,qn=tB,nB=typeof li=="object"&&li&&li.Object===Object&&li,NT=nB,rB=NT,aB=typeof self=="object"&&self&&self.Object===Object&&self,iB=rB||aB||Function("return this")(),da=iB,sB=da,oB=sB.Symbol,Gu=oB,XS=Gu,ET=Object.prototype,lB=ET.hasOwnProperty,cB=ET.toString,Yl=XS?XS.toStringTag:void 0;function uB(e){var t=lB.call(e,Yl),n=e[Yl];try{e[Yl]=void 0;var r=!0}catch{}var a=cB.call(e);return r&&(t?e[Yl]=n:delete e[Yl]),a}var dB=uB,fB=Object.prototype,hB=fB.toString;function pB(e){return hB.call(e)}var mB=pB,QS=Gu,gB=dB,vB=mB,yB="[object Null]",bB="[object Undefined]",ZS=QS?QS.toStringTag:void 0;function xB(e){return e==null?e===void 0?bB:yB:ZS&&ZS in Object(e)?gB(e):vB(e)}var Ua=xB;function wB(e){return e!=null&&typeof e=="object"}var Wa=wB,SB=Ua,kB=Wa,jB="[object Symbol]";function NB(e){return typeof e=="symbol"||kB(e)&&SB(e)==jB}var hl=NB,EB=qn,_B=hl,AB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,CB=/^\w*$/;function TB(e,t){if(EB(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||_B(e)?!0:CB.test(e)||!AB.test(e)||t!=null&&e in Object(t)}var zx=TB;function OB(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Pi=OB;const pl=Qe(Pi);var PB=Ua,RB=Pi,MB="[object AsyncFunction]",IB="[object Function]",$B="[object GeneratorFunction]",LB="[object Proxy]";function DB(e){if(!RB(e))return!1;var t=PB(e);return t==IB||t==$B||t==MB||t==LB}var Fx=DB;const Le=Qe(Fx);var BB=da,zB=BB["__core-js_shared__"],FB=zB,Qm=FB,JS=function(){var e=/[^.]+$/.exec(Qm&&Qm.keys&&Qm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function UB(e){return!!JS&&JS in e}var WB=UB,HB=Function.prototype,GB=HB.toString;function qB(e){if(e!=null){try{return GB.call(e)}catch{}try{return e+""}catch{}}return""}var _T=qB,KB=Fx,VB=WB,YB=Pi,XB=_T,QB=/[\\^$.*+?()[\]{}|]/g,ZB=/^\[object .+?Constructor\]$/,JB=Function.prototype,ez=Object.prototype,tz=JB.toString,nz=ez.hasOwnProperty,rz=RegExp("^"+tz.call(nz).replace(QB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function az(e){if(!YB(e)||VB(e))return!1;var t=KB(e)?rz:ZB;return t.test(XB(e))}var iz=az;function sz(e,t){return e==null?void 0:e[t]}var oz=sz,lz=iz,cz=oz;function uz(e,t){var n=cz(e,t);return lz(n)?n:void 0}var Ts=uz,dz=Ts,fz=dz(Object,"create"),kp=fz,ek=kp;function hz(){this.__data__=ek?ek(null):{},this.size=0}var pz=hz;function mz(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var gz=mz,vz=kp,yz="__lodash_hash_undefined__",bz=Object.prototype,xz=bz.hasOwnProperty;function wz(e){var t=this.__data__;if(vz){var n=t[e];return n===yz?void 0:n}return xz.call(t,e)?t[e]:void 0}var Sz=wz,kz=kp,jz=Object.prototype,Nz=jz.hasOwnProperty;function Ez(e){var t=this.__data__;return kz?t[e]!==void 0:Nz.call(t,e)}var _z=Ez,Az=kp,Cz="__lodash_hash_undefined__";function Tz(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Az&&t===void 0?Cz:t,this}var Oz=Tz,Pz=pz,Rz=gz,Mz=Sz,Iz=_z,$z=Oz;function ml(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ml.prototype.clear=Pz;ml.prototype.delete=Rz;ml.prototype.get=Mz;ml.prototype.has=Iz;ml.prototype.set=$z;var Lz=ml;function Dz(){this.__data__=[],this.size=0}var Bz=Dz;function zz(e,t){return e===t||e!==e&&t!==t}var Ux=zz,Fz=Ux;function Uz(e,t){for(var n=e.length;n--;)if(Fz(e[n][0],t))return n;return-1}var jp=Uz,Wz=jp,Hz=Array.prototype,Gz=Hz.splice;function qz(e){var t=this.__data__,n=Wz(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Gz.call(t,n,1),--this.size,!0}var Kz=qz,Vz=jp;function Yz(e){var t=this.__data__,n=Vz(t,e);return n<0?void 0:t[n][1]}var Xz=Yz,Qz=jp;function Zz(e){return Qz(this.__data__,e)>-1}var Jz=Zz,eF=jp;function tF(e,t){var n=this.__data__,r=eF(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var nF=tF,rF=Bz,aF=Kz,iF=Xz,sF=Jz,oF=nF;function gl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}gl.prototype.clear=rF;gl.prototype.delete=aF;gl.prototype.get=iF;gl.prototype.has=sF;gl.prototype.set=oF;var Np=gl,lF=Ts,cF=da,uF=lF(cF,"Map"),Wx=uF,tk=Lz,dF=Np,fF=Wx;function hF(){this.size=0,this.__data__={hash:new tk,map:new(fF||dF),string:new tk}}var pF=hF;function mF(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var gF=mF,vF=gF;function yF(e,t){var n=e.__data__;return vF(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Ep=yF,bF=Ep;function xF(e){var t=bF(this,e).delete(e);return this.size-=t?1:0,t}var wF=xF,SF=Ep;function kF(e){return SF(this,e).get(e)}var jF=kF,NF=Ep;function EF(e){return NF(this,e).has(e)}var _F=EF,AF=Ep;function CF(e,t){var n=AF(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var TF=CF,OF=pF,PF=wF,RF=jF,MF=_F,IF=TF;function vl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vl.prototype.clear=OF;vl.prototype.delete=PF;vl.prototype.get=RF;vl.prototype.has=MF;vl.prototype.set=IF;var Hx=vl,AT=Hx,$F="Expected a function";function Gx(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError($F);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],s=n.cache;if(s.has(a))return s.get(a);var o=e.apply(this,r);return n.cache=s.set(a,o)||s,o};return n.cache=new(Gx.Cache||AT),n}Gx.Cache=AT;var CT=Gx;const LF=Qe(CT);var DF=CT,BF=500;function zF(e){var t=DF(e,function(r){return n.size===BF&&n.clear(),r}),n=t.cache;return t}var FF=zF,UF=FF,WF=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,HF=/\\(\\)?/g,GF=UF(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(WF,function(n,r,a,s){t.push(a?s.replace(HF,"$1"):r||n)}),t}),qF=GF;function KF(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var qx=KF,nk=Gu,VF=qx,YF=qn,XF=hl,rk=nk?nk.prototype:void 0,ak=rk?rk.toString:void 0;function TT(e){if(typeof e=="string")return e;if(YF(e))return VF(e,TT)+"";if(XF(e))return ak?ak.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var QF=TT,ZF=QF;function JF(e){return e==null?"":ZF(e)}var OT=JF,eU=qn,tU=zx,nU=qF,rU=OT;function aU(e,t){return eU(e)?e:tU(e,t)?[e]:nU(rU(e))}var PT=aU,iU=hl;function sU(e){if(typeof e=="string"||iU(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var _p=sU,oU=PT,lU=_p;function cU(e,t){t=oU(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[lU(t[n++])];return n&&n==r?e:void 0}var Kx=cU,uU=Kx;function dU(e,t,n){var r=e==null?void 0:uU(e,t);return r===void 0?n:r}var RT=dU;const kr=Qe(RT);function fU(e){return e==null}var hU=fU;const Ye=Qe(hU);var pU=Ua,mU=qn,gU=Wa,vU="[object String]";function yU(e){return typeof e=="string"||!mU(e)&&gU(e)&&pU(e)==vU}var bU=yU;const ws=Qe(bU);var MT={exports:{}},tt={};/**
|
|
68
|
+
* @license React
|
|
69
|
+
* react-is.production.min.js
|
|
70
|
+
*
|
|
71
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the MIT license found in the
|
|
74
|
+
* LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/var Vx=Symbol.for("react.element"),Yx=Symbol.for("react.portal"),Ap=Symbol.for("react.fragment"),Cp=Symbol.for("react.strict_mode"),Tp=Symbol.for("react.profiler"),Op=Symbol.for("react.provider"),Pp=Symbol.for("react.context"),xU=Symbol.for("react.server_context"),Rp=Symbol.for("react.forward_ref"),Mp=Symbol.for("react.suspense"),Ip=Symbol.for("react.suspense_list"),$p=Symbol.for("react.memo"),Lp=Symbol.for("react.lazy"),wU=Symbol.for("react.offscreen"),IT;IT=Symbol.for("react.module.reference");function _r(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Vx:switch(e=e.type,e){case Ap:case Tp:case Cp:case Mp:case Ip:return e;default:switch(e=e&&e.$$typeof,e){case xU:case Pp:case Rp:case Lp:case $p:case Op:return e;default:return t}}case Yx:return t}}}tt.ContextConsumer=Pp;tt.ContextProvider=Op;tt.Element=Vx;tt.ForwardRef=Rp;tt.Fragment=Ap;tt.Lazy=Lp;tt.Memo=$p;tt.Portal=Yx;tt.Profiler=Tp;tt.StrictMode=Cp;tt.Suspense=Mp;tt.SuspenseList=Ip;tt.isAsyncMode=function(){return!1};tt.isConcurrentMode=function(){return!1};tt.isContextConsumer=function(e){return _r(e)===Pp};tt.isContextProvider=function(e){return _r(e)===Op};tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vx};tt.isForwardRef=function(e){return _r(e)===Rp};tt.isFragment=function(e){return _r(e)===Ap};tt.isLazy=function(e){return _r(e)===Lp};tt.isMemo=function(e){return _r(e)===$p};tt.isPortal=function(e){return _r(e)===Yx};tt.isProfiler=function(e){return _r(e)===Tp};tt.isStrictMode=function(e){return _r(e)===Cp};tt.isSuspense=function(e){return _r(e)===Mp};tt.isSuspenseList=function(e){return _r(e)===Ip};tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ap||e===Tp||e===Cp||e===Mp||e===Ip||e===wU||typeof e=="object"&&e!==null&&(e.$$typeof===Lp||e.$$typeof===$p||e.$$typeof===Op||e.$$typeof===Pp||e.$$typeof===Rp||e.$$typeof===IT||e.getModuleId!==void 0)};tt.typeOf=_r;MT.exports=tt;var SU=MT.exports,kU=Ua,jU=Wa,NU="[object Number]";function EU(e){return typeof e=="number"||jU(e)&&kU(e)==NU}var $T=EU;const _U=Qe($T);var AU=$T;function CU(e){return AU(e)&&e!=+e}var TU=CU;const qu=Qe(TU);var zr=function(t){return t===0?0:t>0?1:-1},rs=function(t){return ws(t)&&t.indexOf("%")===t.length-1},fe=function(t){return _U(t)&&!qu(t)},OU=function(t){return Ye(t)},Yt=function(t){return fe(t)||ws(t)},PU=0,Dp=function(t){var n=++PU;return"".concat(t||"").concat(n)},Ss=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!fe(t)&&!ws(t))return r;var s;if(rs(t)){var o=t.indexOf("%");s=n*parseFloat(t.slice(0,o))/100}else s=+t;return qu(s)&&(s=r),a&&s>n&&(s=n),s},si=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},RU=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},Gs=function(t,n){return fe(t)&&fe(n)?function(r){return t+r*(n-t)}:function(){return n}};function ny(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):kr(r,t))===n})}var MU=function(t,n){return fe(t)&&fe(n)?t-n:ws(t)&&ws(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function _o(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function ry(e){"@babel/helpers - typeof";return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ry(e)}var IU=["viewBox","children"],$U=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],ik=["points","pathLength"],Zm={svg:IU,polygon:ik,polyline:ik},Xx=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Vf=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(k.isValidElement(t)&&(r=t.props),!pl(r))return null;var a={};return Object.keys(r).forEach(function(s){Xx.includes(s)&&(a[s]=n||function(o){return r[s](r,o)})}),a},LU=function(t,n,r){return function(a){return t(n,r,a),null}},Yf=function(t,n,r){if(!pl(t)||ry(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(s){var o=t[s];Xx.includes(s)&&typeof o=="function"&&(a||(a={}),a[s]=LU(o,n,r))}),a},DU=["children"],BU=["children"];function sk(e,t){if(e==null)return{};var n=zU(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zU(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ok={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ta=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},lk=null,Jm=null,Qx=function e(t){if(t===lk&&Array.isArray(Jm))return Jm;var n=[];return k.Children.forEach(t,function(r){Ye(r)||(SU.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Jm=n,lk=t,n};function Wr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Ta(a)}):r=[Ta(t)],Qx(e).forEach(function(a){var s=kr(a,"type.displayName")||kr(a,"type.name");r.indexOf(s)!==-1&&n.push(a)}),n}function er(e,t){var n=Wr(e,t);return n&&n[0]}var ck=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!fe(r)||r<=0||!fe(a)||a<=0)},FU=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],UU=function(t){return t&&t.type&&ws(t.type)&&FU.indexOf(t.type)>=0},WU=function(t,n,r,a){var s,o=(s=Zm==null?void 0:Zm[a])!==null&&s!==void 0?s:[];return n.startsWith("data-")||!Le(t)&&(a&&o.includes(n)||$U.includes(n))||r&&Xx.includes(n)},Ke=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(k.isValidElement(t)&&(a=t.props),!pl(a))return null;var s={};return Object.keys(a).forEach(function(o){var l;WU((l=a)===null||l===void 0?void 0:l[o],o,n,r)&&(s[o]=a[o])}),s},ay=function e(t,n){if(t===n)return!0;var r=k.Children.count(t);if(r!==k.Children.count(n))return!1;if(r===0)return!0;if(r===1)return uk(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var s=t[a],o=n[a];if(Array.isArray(s)||Array.isArray(o)){if(!e(s,o))return!1}else if(!uk(s,o))return!1}return!0},uk=function(t,n){if(Ye(t)&&Ye(n))return!0;if(!Ye(t)&&!Ye(n)){var r=t.props||{},a=r.children,s=sk(r,DU),o=n.props||{},l=o.children,c=sk(o,BU);return a&&l?_o(s,c)&&ay(a,l):!a&&!l?_o(s,c):!1}return!1},dk=function(t,n){var r=[],a={};return Qx(t).forEach(function(s,o){if(UU(s))r.push(s);else if(s){var l=Ta(s.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(s,l,o);r.push(f),a[l]=!0}}}),r},HU=function(t){var n=t&&t.type;return n&&ok[n]?ok[n]:null},GU=function(t,n){return Qx(n).indexOf(t)},qU=["children","width","height","viewBox","className","style","title","desc"];function iy(){return iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iy.apply(this,arguments)}function KU(e,t){if(e==null)return{};var n=VU(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VU(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sy(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,s=e.className,o=e.style,l=e.title,c=e.desc,u=KU(e,qU),d=a||{width:n,height:r,x:0,y:0},f=Ve("recharts-surface",s);return G.createElement("svg",iy({},Ke(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),G.createElement("title",null,l),G.createElement("desc",null,c),t)}var YU=["children","className"];function oy(){return oy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oy.apply(this,arguments)}function XU(e,t){if(e==null)return{};var n=QU(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QU(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var en=G.forwardRef(function(e,t){var n=e.children,r=e.className,a=XU(e,YU),s=Ve("recharts-layer",r);return G.createElement("g",oy({className:s},Ke(a,!0),{ref:t}),n)}),Oa=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),s=2;s<r;s++)a[s-2]=arguments[s]};function ZU(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(a);++r<a;)s[r]=e[r+t];return s}var JU=ZU,e3=JU;function t3(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:e3(e,t,n)}var n3=t3,r3="\\ud800-\\udfff",a3="\\u0300-\\u036f",i3="\\ufe20-\\ufe2f",s3="\\u20d0-\\u20ff",o3=a3+i3+s3,l3="\\ufe0e\\ufe0f",c3="\\u200d",u3=RegExp("["+c3+r3+o3+l3+"]");function d3(e){return u3.test(e)}var LT=d3;function f3(e){return e.split("")}var h3=f3,DT="\\ud800-\\udfff",p3="\\u0300-\\u036f",m3="\\ufe20-\\ufe2f",g3="\\u20d0-\\u20ff",v3=p3+m3+g3,y3="\\ufe0e\\ufe0f",b3="["+DT+"]",ly="["+v3+"]",cy="\\ud83c[\\udffb-\\udfff]",x3="(?:"+ly+"|"+cy+")",BT="[^"+DT+"]",zT="(?:\\ud83c[\\udde6-\\uddff]){2}",FT="[\\ud800-\\udbff][\\udc00-\\udfff]",w3="\\u200d",UT=x3+"?",WT="["+y3+"]?",S3="(?:"+w3+"(?:"+[BT,zT,FT].join("|")+")"+WT+UT+")*",k3=WT+UT+S3,j3="(?:"+[BT+ly+"?",ly,zT,FT,b3].join("|")+")",N3=RegExp(cy+"(?="+cy+")|"+j3+k3,"g");function E3(e){return e.match(N3)||[]}var _3=E3,A3=h3,C3=LT,T3=_3;function O3(e){return C3(e)?T3(e):A3(e)}var P3=O3,R3=n3,M3=LT,I3=P3,$3=OT;function L3(e){return function(t){t=$3(t);var n=M3(t)?I3(t):void 0,r=n?n[0]:t.charAt(0),a=n?R3(n,1).join(""):t.slice(1);return r[e]()+a}}var D3=L3,B3=D3,z3=B3("toUpperCase"),F3=z3;const Bp=Qe(F3);function ut(e){return function(){return e}}const HT=Math.cos,Xf=Math.sin,Kr=Math.sqrt,Qf=Math.PI,zp=2*Qf,uy=Math.PI,dy=2*uy,Ki=1e-6,U3=dy-Ki;function GT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function W3(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return GT;const n=10**t;return function(r){this._+=r[0];for(let a=1,s=r.length;a<s;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class H3{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?GT:W3(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,s,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+s},${this._y1=+o}`}arcTo(t,n,r,a,s){if(t=+t,n=+n,r=+r,a=+a,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,l=this._y1,c=r-t,u=a-n,d=o-t,f=l-n,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Ki)if(!(Math.abs(f*c-u*d)>Ki)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-o,g=a-l,m=c*c+u*u,y=p*p+g*g,v=Math.sqrt(m),x=Math.sqrt(h),S=s*Math.tan((uy-Math.acos((m+h-y)/(2*v*x)))/2),j=S/x,w=S/v;Math.abs(j-1)>Ki&&this._append`L${t+j*d},${n+j*f}`,this._append`A${s},${s},0,0,${+(f*p>d*g)},${this._x1=t+w*c},${this._y1=n+w*u}`}}arc(t,n,r,a,s,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(a),c=r*Math.sin(a),u=t+l,d=n+c,f=1^o,h=o?a-s:s-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Ki||Math.abs(this._y1-d)>Ki)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%dy+dy),h>U3?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>Ki&&this._append`A${r},${r},0,${+(h>=uy)},${f},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function Zx(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new H3(t)}function Jx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qT(e){this._context=e}qT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Fp(e){return new qT(e)}function KT(e){return e[0]}function VT(e){return e[1]}function YT(e,t){var n=ut(!0),r=null,a=Fp,s=null,o=Zx(l);e=typeof e=="function"?e:e===void 0?KT:ut(e),t=typeof t=="function"?t:t===void 0?VT:ut(t);function l(c){var u,d=(c=Jx(c)).length,f,h=!1,p;for(r==null&&(s=a(p=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(f,u,c),+t(f,u,c));if(p)return s=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ut(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ut(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ut(!!c),l):n},l.curve=function(c){return arguments.length?(a=c,r!=null&&(s=a(r)),l):a},l.context=function(c){return arguments.length?(c==null?r=s=null:s=a(r=c),l):r},l}function Od(e,t,n){var r=null,a=ut(!0),s=null,o=Fp,l=null,c=Zx(u);e=typeof e=="function"?e:e===void 0?KT:ut(+e),t=typeof t=="function"?t:ut(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?VT:ut(+n);function u(f){var h,p,g,m=(f=Jx(f)).length,y,v=!1,x,S=new Array(m),j=new Array(m);for(s==null&&(l=o(x=c())),h=0;h<=m;++h){if(!(h<m&&a(y=f[h],h,f))===v)if(v=!v)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=p;--g)l.point(S[g],j[g]);l.lineEnd(),l.areaEnd()}v&&(S[h]=+e(y,h,f),j[h]=+t(y,h,f),l.point(r?+r(y,h,f):S[h],n?+n(y,h,f):j[h]))}if(x)return l=null,x+""||null}function d(){return YT().defined(a).curve(o).context(s)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ut(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ut(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:ut(!!f),u):a},u.curve=function(f){return arguments.length?(o=f,s!=null&&(l=o(s)),u):o},u.context=function(f){return arguments.length?(f==null?s=l=null:l=o(s=f),u):s},u}class XT{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function G3(e){return new XT(e,!0)}function q3(e){return new XT(e,!1)}const ew={draw(e,t){const n=Kr(t/Qf);e.moveTo(n,0),e.arc(0,0,n,0,zp)}},K3={draw(e,t){const n=Kr(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},QT=Kr(1/3),V3=QT*2,Y3={draw(e,t){const n=Kr(t/V3),r=n*QT;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},X3={draw(e,t){const n=Kr(t),r=-n/2;e.rect(r,r,n,n)}},Q3=.8908130915292852,ZT=Xf(Qf/10)/Xf(7*Qf/10),Z3=Xf(zp/10)*ZT,J3=-HT(zp/10)*ZT,e4={draw(e,t){const n=Kr(t*Q3),r=Z3*n,a=J3*n;e.moveTo(0,-n),e.lineTo(r,a);for(let s=1;s<5;++s){const o=zp*s/5,l=HT(o),c=Xf(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*a,c*r+l*a)}e.closePath()}},eg=Kr(3),t4={draw(e,t){const n=-Kr(t/(eg*3));e.moveTo(0,n*2),e.lineTo(-eg*n,-n),e.lineTo(eg*n,-n),e.closePath()}},hr=-.5,pr=Kr(3)/2,fy=1/Kr(12),n4=(fy/2+1)*3,r4={draw(e,t){const n=Kr(t/n4),r=n/2,a=n*fy,s=r,o=n*fy+n,l=-s,c=o;e.moveTo(r,a),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(hr*r-pr*a,pr*r+hr*a),e.lineTo(hr*s-pr*o,pr*s+hr*o),e.lineTo(hr*l-pr*c,pr*l+hr*c),e.lineTo(hr*r+pr*a,hr*a-pr*r),e.lineTo(hr*s+pr*o,hr*o-pr*s),e.lineTo(hr*l+pr*c,hr*c-pr*l),e.closePath()}};function a4(e,t){let n=null,r=Zx(a);e=typeof e=="function"?e:ut(e||ew),t=typeof t=="function"?t:ut(t===void 0?64:+t);function a(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return a.type=function(s){return arguments.length?(e=typeof s=="function"?s:ut(s),a):e},a.size=function(s){return arguments.length?(t=typeof s=="function"?s:ut(+s),a):t},a.context=function(s){return arguments.length?(n=s??null,a):n},a}function Zf(){}function Jf(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function JT(e){this._context=e}JT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Jf(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Jf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function i4(e){return new JT(e)}function eO(e){this._context=e}eO.prototype={areaStart:Zf,areaEnd:Zf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Jf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function s4(e){return new eO(e)}function tO(e){this._context=e}tO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Jf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function o4(e){return new tO(e)}function nO(e){this._context=e}nO.prototype={areaStart:Zf,areaEnd:Zf,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function l4(e){return new nO(e)}function fk(e){return e<0?-1:1}function hk(e,t,n){var r=e._x1-e._x0,a=t-e._x1,s=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),l=(s*a+o*r)/(r+a);return(fk(s)+fk(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function pk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function tg(e,t,n){var r=e._x0,a=e._y0,s=e._x1,o=e._y1,l=(s-r)/3;e._context.bezierCurveTo(r+l,a+l*t,s-l,o-l*n,s,o)}function eh(e){this._context=e}eh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:tg(this,this._t0,pk(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,tg(this,pk(this,n=hk(this,e,t)),n);break;default:tg(this,this._t0,n=hk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function rO(e){this._context=new aO(e)}(rO.prototype=Object.create(eh.prototype)).point=function(e,t){eh.prototype.point.call(this,t,e)};function aO(e){this._context=e}aO.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,s){this._context.bezierCurveTo(t,e,r,n,s,a)}};function c4(e){return new eh(e)}function u4(e){return new rO(e)}function iO(e){this._context=e}iO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=mk(e),a=mk(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(r[0][s],a[0][s],r[1][s],a[1][s],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function mk(e){var t,n=e.length-1,r,a=new Array(n),s=new Array(n),o=new Array(n);for(a[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,s[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/s[t-1],s[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/s[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/s[t];for(s[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-a[t+1];return[a,s]}function d4(e){return new iO(e)}function Up(e,t){this._context=e,this._t=t}Up.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function f4(e){return new Up(e,.5)}function h4(e){return new Up(e,0)}function p4(e){return new Up(e,1)}function Bo(e,t){if((o=e.length)>1)for(var n=1,r,a,s=e[t[0]],o,l=s.length;n<o;++n)for(a=s,s=e[t[n]],r=0;r<l;++r)s[r][1]+=s[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function hy(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function m4(e,t){return e[t]}function g4(e){const t=[];return t.key=e,t}function v4(){var e=ut([]),t=hy,n=Bo,r=m4;function a(s){var o=Array.from(e.apply(this,arguments),g4),l,c=o.length,u=-1,d;for(const f of s)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,s)]).data=f;for(l=0,d=Jx(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return a.keys=function(s){return arguments.length?(e=typeof s=="function"?s:ut(Array.from(s)),a):e},a.value=function(s){return arguments.length?(r=typeof s=="function"?s:ut(+s),a):r},a.order=function(s){return arguments.length?(t=s==null?hy:typeof s=="function"?s:ut(Array.from(s)),a):t},a.offset=function(s){return arguments.length?(n=s??Bo,a):n},a}function y4(e,t){if((r=e.length)>0){for(var n,r,a=0,s=e[0].length,o;a<s;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}Bo(e,t)}}function b4(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,s=r.length;n<s;++n){for(var o=0,l=0;o<a;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}Bo(e,t)}}function x4(e,t){if(!(!((o=e.length)>0)||!((s=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,s,o;r<s;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[r][1]||0,h=d[r-1][1]||0,p=(f-h)/2,g=0;g<l;++g){var m=e[t[g]],y=m[r][1]||0,v=m[r-1][1]||0;p+=y-v}c+=f,u+=p*f}a[r-1][1]+=a[r-1][0]=n,c&&(n-=u/c)}a[r-1][1]+=a[r-1][0]=n,Bo(e,t)}}function eu(e){"@babel/helpers - typeof";return eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(e)}var w4=["type","size","sizeType"];function py(){return py=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},py.apply(this,arguments)}function gk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gk(Object(n),!0).forEach(function(r){S4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function S4(e,t,n){return t=k4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k4(e){var t=j4(e,"string");return eu(t)=="symbol"?t:t+""}function j4(e,t){if(eu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function N4(e,t){if(e==null)return{};var n=E4(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function E4(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var sO={symbolCircle:ew,symbolCross:K3,symbolDiamond:Y3,symbolSquare:X3,symbolStar:e4,symbolTriangle:t4,symbolWye:r4},_4=Math.PI/180,A4=function(t){var n="symbol".concat(Bp(t));return sO[n]||ew},C4=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*_4;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},T4=function(t,n){sO["symbol".concat(Bp(t))]=n},tw=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,s=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=N4(t,w4),u=vk(vk({},c),{},{type:r,size:s,sizeType:l}),d=function(){var y=A4(r),v=a4().type(y).size(C4(s,l,r));return v()},f=u.className,h=u.cx,p=u.cy,g=Ke(u,!0);return h===+h&&p===+p&&s===+s?G.createElement("path",py({},g,{className:Ve("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};tw.registerSymbol=T4;function zo(e){"@babel/helpers - typeof";return zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zo(e)}function my(){return my=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},my.apply(this,arguments)}function yk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function O4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yk(Object(n),!0).forEach(function(r){tu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lO(r.key),r)}}function M4(e,t,n){return t&&R4(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function I4(e,t,n){return t=th(t),$4(e,oO()?Reflect.construct(t,n||[],th(e).constructor):t.apply(e,n))}function $4(e,t){if(t&&(zo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L4(e)}function L4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oO=function(){return!!e})()}function th(e){return th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},th(e)}function D4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gy(e,t)}function gy(e,t){return gy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},gy(e,t)}function tu(e,t,n){return t=lO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lO(e){var t=B4(e,"string");return zo(t)=="symbol"?t:t+""}function B4(e,t){if(zo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var mr=32,nw=function(e){function t(){return P4(this,t),I4(this,t,arguments)}return D4(t,e),M4(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,s=mr/2,o=mr/6,l=mr/3,c=r.inactive?a:r.color;if(r.type==="plainline")return G.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:s,x2:mr,y2:s,className:"recharts-legend-icon"});if(r.type==="line")return G.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(l,`
|
|
76
|
+
A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(s,`
|
|
77
|
+
H`).concat(mr,"M").concat(2*l,",").concat(s,`
|
|
78
|
+
A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(s),className:"recharts-legend-icon"});if(r.type==="rect")return G.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(mr/8,"h").concat(mr,"v").concat(mr*3/4,"h").concat(-mr,"z"),className:"recharts-legend-icon"});if(G.isValidElement(r.legendIcon)){var u=O4({},r);return delete u.legendIcon,G.cloneElement(r.legendIcon,u)}return G.createElement(tw,{fill:c,cx:s,cy:s,size:mr,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,s=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:mr,height:mr},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(p,g){var m=p.formatter||c,y=Ve(tu(tu({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var v=Le(p.value)?null:p.value;Oa(!Le(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var x=p.inactive?u:p.color;return G.createElement("li",my({className:y,style:f,key:"legend-item-".concat(g)},Yf(r.props,p,g)),G.createElement(sy,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),G.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},m?m(v,p,g):v))})}},{key:"render",value:function(){var r=this.props,a=r.payload,s=r.layout,o=r.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:s==="horizontal"?o:"left"};return G.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(k.PureComponent);tu(nw,"displayName","Legend");tu(nw,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var z4=Np;function F4(){this.__data__=new z4,this.size=0}var U4=F4;function W4(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var H4=W4;function G4(e){return this.__data__.get(e)}var q4=G4;function K4(e){return this.__data__.has(e)}var V4=K4,Y4=Np,X4=Wx,Q4=Hx,Z4=200;function J4(e,t){var n=this.__data__;if(n instanceof Y4){var r=n.__data__;if(!X4||r.length<Z4-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Q4(r)}return n.set(e,t),this.size=n.size,this}var e6=J4,t6=Np,n6=U4,r6=H4,a6=q4,i6=V4,s6=e6;function yl(e){var t=this.__data__=new t6(e);this.size=t.size}yl.prototype.clear=n6;yl.prototype.delete=r6;yl.prototype.get=a6;yl.prototype.has=i6;yl.prototype.set=s6;var cO=yl,o6="__lodash_hash_undefined__";function l6(e){return this.__data__.set(e,o6),this}var c6=l6;function u6(e){return this.__data__.has(e)}var d6=u6,f6=Hx,h6=c6,p6=d6;function nh(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new f6;++t<n;)this.add(e[t])}nh.prototype.add=nh.prototype.push=h6;nh.prototype.has=p6;var uO=nh;function m6(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var dO=m6;function g6(e,t){return e.has(t)}var fO=g6,v6=uO,y6=dO,b6=fO,x6=1,w6=2;function S6(e,t,n,r,a,s){var o=n&x6,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=n&w6?new v6:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var g=e[f],m=t[f];if(r)var y=o?r(m,g,f,t,e,s):r(g,m,f,e,t,s);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!y6(t,function(v,x){if(!b6(p,x)&&(g===v||a(g,v,n,r,s)))return p.push(x)})){h=!1;break}}else if(!(g===m||a(g,m,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}var hO=S6,k6=da,j6=k6.Uint8Array,N6=j6;function E6(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}var _6=E6;function A6(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var rw=A6,bk=Gu,xk=N6,C6=Ux,T6=hO,O6=_6,P6=rw,R6=1,M6=2,I6="[object Boolean]",$6="[object Date]",L6="[object Error]",D6="[object Map]",B6="[object Number]",z6="[object RegExp]",F6="[object Set]",U6="[object String]",W6="[object Symbol]",H6="[object ArrayBuffer]",G6="[object DataView]",wk=bk?bk.prototype:void 0,ng=wk?wk.valueOf:void 0;function q6(e,t,n,r,a,s,o){switch(n){case G6:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case H6:return!(e.byteLength!=t.byteLength||!s(new xk(e),new xk(t)));case I6:case $6:case B6:return C6(+e,+t);case L6:return e.name==t.name&&e.message==t.message;case z6:case U6:return e==t+"";case D6:var l=O6;case F6:var c=r&R6;if(l||(l=P6),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=M6,o.set(e,t);var d=T6(l(e),l(t),r,a,s,o);return o.delete(e),d;case W6:if(ng)return ng.call(e)==ng.call(t)}return!1}var K6=q6;function V6(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var pO=V6,Y6=pO,X6=qn;function Q6(e,t,n){var r=t(e);return X6(e)?r:Y6(r,n(e))}var Z6=Q6;function J6(e,t){for(var n=-1,r=e==null?0:e.length,a=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[a++]=o)}return s}var eW=J6;function tW(){return[]}var nW=tW,rW=eW,aW=nW,iW=Object.prototype,sW=iW.propertyIsEnumerable,Sk=Object.getOwnPropertySymbols,oW=Sk?function(e){return e==null?[]:(e=Object(e),rW(Sk(e),function(t){return sW.call(e,t)}))}:aW,lW=oW;function cW(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var uW=cW,dW=Ua,fW=Wa,hW="[object Arguments]";function pW(e){return fW(e)&&dW(e)==hW}var mW=pW,kk=mW,gW=Wa,mO=Object.prototype,vW=mO.hasOwnProperty,yW=mO.propertyIsEnumerable,bW=kk(function(){return arguments}())?kk:function(e){return gW(e)&&vW.call(e,"callee")&&!yW.call(e,"callee")},aw=bW,rh={exports:{}};function xW(){return!1}var wW=xW;rh.exports;(function(e,t){var n=da,r=wW,a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===a,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(rh,rh.exports);var gO=rh.exports,SW=9007199254740991,kW=/^(?:0|[1-9]\d*)$/;function jW(e,t){var n=typeof e;return t=t??SW,!!t&&(n=="number"||n!="symbol"&&kW.test(e))&&e>-1&&e%1==0&&e<t}var iw=jW,NW=9007199254740991;function EW(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=NW}var sw=EW,_W=Ua,AW=sw,CW=Wa,TW="[object Arguments]",OW="[object Array]",PW="[object Boolean]",RW="[object Date]",MW="[object Error]",IW="[object Function]",$W="[object Map]",LW="[object Number]",DW="[object Object]",BW="[object RegExp]",zW="[object Set]",FW="[object String]",UW="[object WeakMap]",WW="[object ArrayBuffer]",HW="[object DataView]",GW="[object Float32Array]",qW="[object Float64Array]",KW="[object Int8Array]",VW="[object Int16Array]",YW="[object Int32Array]",XW="[object Uint8Array]",QW="[object Uint8ClampedArray]",ZW="[object Uint16Array]",JW="[object Uint32Array]",pt={};pt[GW]=pt[qW]=pt[KW]=pt[VW]=pt[YW]=pt[XW]=pt[QW]=pt[ZW]=pt[JW]=!0;pt[TW]=pt[OW]=pt[WW]=pt[PW]=pt[HW]=pt[RW]=pt[MW]=pt[IW]=pt[$W]=pt[LW]=pt[DW]=pt[BW]=pt[zW]=pt[FW]=pt[UW]=!1;function e8(e){return CW(e)&&AW(e.length)&&!!pt[_W(e)]}var t8=e8;function n8(e){return function(t){return e(t)}}var vO=n8,ah={exports:{}};ah.exports;(function(e,t){var n=NT,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===r,o=s&&n.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(ah,ah.exports);var r8=ah.exports,a8=t8,i8=vO,jk=r8,Nk=jk&&jk.isTypedArray,s8=Nk?i8(Nk):a8,yO=s8,o8=uW,l8=aw,c8=qn,u8=gO,d8=iw,f8=yO,h8=Object.prototype,p8=h8.hasOwnProperty;function m8(e,t){var n=c8(e),r=!n&&l8(e),a=!n&&!r&&u8(e),s=!n&&!r&&!a&&f8(e),o=n||r||a||s,l=o?o8(e.length,String):[],c=l.length;for(var u in e)(t||p8.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||d8(u,c)))&&l.push(u);return l}var g8=m8,v8=Object.prototype;function y8(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||v8;return e===n}var b8=y8;function x8(e,t){return function(n){return e(t(n))}}var bO=x8,w8=bO,S8=w8(Object.keys,Object),k8=S8,j8=b8,N8=k8,E8=Object.prototype,_8=E8.hasOwnProperty;function A8(e){if(!j8(e))return N8(e);var t=[];for(var n in Object(e))_8.call(e,n)&&n!="constructor"&&t.push(n);return t}var C8=A8,T8=Fx,O8=sw;function P8(e){return e!=null&&O8(e.length)&&!T8(e)}var Ku=P8,R8=g8,M8=C8,I8=Ku;function $8(e){return I8(e)?R8(e):M8(e)}var Wp=$8,L8=Z6,D8=lW,B8=Wp;function z8(e){return L8(e,B8,D8)}var F8=z8,Ek=F8,U8=1,W8=Object.prototype,H8=W8.hasOwnProperty;function G8(e,t,n,r,a,s){var o=n&U8,l=Ek(e),c=l.length,u=Ek(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:H8.call(t,h)))return!1}var p=s.get(e),g=s.get(t);if(p&&g)return p==t&&g==e;var m=!0;s.set(e,t),s.set(t,e);for(var y=o;++f<c;){h=l[f];var v=e[h],x=t[h];if(r)var S=o?r(x,v,h,t,e,s):r(v,x,h,e,t,s);if(!(S===void 0?v===x||a(v,x,n,r,s):S)){m=!1;break}y||(y=h=="constructor")}if(m&&!y){var j=e.constructor,w=t.constructor;j!=w&&"constructor"in e&&"constructor"in t&&!(typeof j=="function"&&j instanceof j&&typeof w=="function"&&w instanceof w)&&(m=!1)}return s.delete(e),s.delete(t),m}var q8=G8,K8=Ts,V8=da,Y8=K8(V8,"DataView"),X8=Y8,Q8=Ts,Z8=da,J8=Q8(Z8,"Promise"),e5=J8,t5=Ts,n5=da,r5=t5(n5,"Set"),xO=r5,a5=Ts,i5=da,s5=a5(i5,"WeakMap"),o5=s5,vy=X8,yy=Wx,by=e5,xy=xO,wy=o5,wO=Ua,bl=_T,_k="[object Map]",l5="[object Object]",Ak="[object Promise]",Ck="[object Set]",Tk="[object WeakMap]",Ok="[object DataView]",c5=bl(vy),u5=bl(yy),d5=bl(by),f5=bl(xy),h5=bl(wy),Vi=wO;(vy&&Vi(new vy(new ArrayBuffer(1)))!=Ok||yy&&Vi(new yy)!=_k||by&&Vi(by.resolve())!=Ak||xy&&Vi(new xy)!=Ck||wy&&Vi(new wy)!=Tk)&&(Vi=function(e){var t=wO(e),n=t==l5?e.constructor:void 0,r=n?bl(n):"";if(r)switch(r){case c5:return Ok;case u5:return _k;case d5:return Ak;case f5:return Ck;case h5:return Tk}return t});var p5=Vi,rg=cO,m5=hO,g5=K6,v5=q8,Pk=p5,Rk=qn,Mk=gO,y5=yO,b5=1,Ik="[object Arguments]",$k="[object Array]",Pd="[object Object]",x5=Object.prototype,Lk=x5.hasOwnProperty;function w5(e,t,n,r,a,s){var o=Rk(e),l=Rk(t),c=o?$k:Pk(e),u=l?$k:Pk(t);c=c==Ik?Pd:c,u=u==Ik?Pd:u;var d=c==Pd,f=u==Pd,h=c==u;if(h&&Mk(e)){if(!Mk(t))return!1;o=!0,d=!1}if(h&&!d)return s||(s=new rg),o||y5(e)?m5(e,t,n,r,a,s):g5(e,t,c,n,r,a,s);if(!(n&b5)){var p=d&&Lk.call(e,"__wrapped__"),g=f&&Lk.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,y=g?t.value():t;return s||(s=new rg),a(m,y,n,r,s)}}return h?(s||(s=new rg),v5(e,t,n,r,a,s)):!1}var S5=w5,k5=S5,Dk=Wa;function SO(e,t,n,r,a){return e===t?!0:e==null||t==null||!Dk(e)&&!Dk(t)?e!==e&&t!==t:k5(e,t,n,r,SO,a)}var ow=SO,j5=cO,N5=ow,E5=1,_5=2;function A5(e,t,n,r){var a=n.length,s=a,o=!r;if(e==null)return!s;for(e=Object(e);a--;){var l=n[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<s;){l=n[a];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new j5;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?N5(d,u,E5|_5,r,f):h))return!1}}return!0}var C5=A5,T5=Pi;function O5(e){return e===e&&!T5(e)}var kO=O5,P5=kO,R5=Wp;function M5(e){for(var t=R5(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,P5(a)]}return t}var I5=M5;function $5(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var jO=$5,L5=C5,D5=I5,B5=jO;function z5(e){var t=D5(e);return t.length==1&&t[0][2]?B5(t[0][0],t[0][1]):function(n){return n===e||L5(n,e,t)}}var F5=z5;function U5(e,t){return e!=null&&t in Object(e)}var W5=U5,H5=PT,G5=aw,q5=qn,K5=iw,V5=sw,Y5=_p;function X5(e,t,n){t=H5(t,e);for(var r=-1,a=t.length,s=!1;++r<a;){var o=Y5(t[r]);if(!(s=e!=null&&n(e,o)))break;e=e[o]}return s||++r!=a?s:(a=e==null?0:e.length,!!a&&V5(a)&&K5(o,a)&&(q5(e)||G5(e)))}var Q5=X5,Z5=W5,J5=Q5;function eH(e,t){return e!=null&&J5(e,t,Z5)}var tH=eH,nH=ow,rH=RT,aH=tH,iH=zx,sH=kO,oH=jO,lH=_p,cH=1,uH=2;function dH(e,t){return iH(e)&&sH(t)?oH(lH(e),t):function(n){var r=rH(n,e);return r===void 0&&r===t?aH(n,e):nH(t,r,cH|uH)}}var fH=dH;function hH(e){return e}var xl=hH;function pH(e){return function(t){return t==null?void 0:t[e]}}var mH=pH,gH=Kx;function vH(e){return function(t){return gH(t,e)}}var yH=vH,bH=mH,xH=yH,wH=zx,SH=_p;function kH(e){return wH(e)?bH(SH(e)):xH(e)}var jH=kH,NH=F5,EH=fH,_H=xl,AH=qn,CH=jH;function TH(e){return typeof e=="function"?e:e==null?_H:typeof e=="object"?AH(e)?EH(e[0],e[1]):NH(e):CH(e)}var Ri=TH;function OH(e,t,n,r){for(var a=e.length,s=n+(r?1:-1);r?s--:++s<a;)if(t(e[s],s,e))return s;return-1}var NO=OH;function PH(e){return e!==e}var RH=PH;function MH(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var IH=MH,$H=NO,LH=RH,DH=IH;function BH(e,t,n){return t===t?DH(e,t,n):$H(e,LH,n)}var zH=BH,FH=zH;function UH(e,t){var n=e==null?0:e.length;return!!n&&FH(e,t,0)>-1}var WH=UH;function HH(e,t,n){for(var r=-1,a=e==null?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1}var GH=HH;function qH(){}var KH=qH,ag=xO,VH=KH,YH=rw,XH=1/0,QH=ag&&1/YH(new ag([,-0]))[1]==XH?function(e){return new ag(e)}:VH,ZH=QH,JH=uO,e9=WH,t9=GH,n9=fO,r9=ZH,a9=rw,i9=200;function s9(e,t,n){var r=-1,a=e9,s=e.length,o=!0,l=[],c=l;if(n)o=!1,a=t9;else if(s>=i9){var u=t?null:r9(e);if(u)return a9(u);o=!1,a=n9,c=new JH}else c=t?[]:l;e:for(;++r<s;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else a(c,f,n)||(c!==l&&c.push(f),l.push(d))}return l}var o9=s9,l9=Ri,c9=o9;function u9(e,t){return e&&e.length?c9(e,l9(t)):[]}var d9=u9;const Bk=Qe(d9);function EO(e,t,n){return t===!0?Bk(e,n):Le(t)?Bk(e,t):e}function Fo(e){"@babel/helpers - typeof";return Fo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fo(e)}var f9=["ref"];function zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function xa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zk(Object(n),!0).forEach(function(r){Hp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function h9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,AO(r.key),r)}}function p9(e,t,n){return t&&Fk(e.prototype,t),n&&Fk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function m9(e,t,n){return t=ih(t),g9(e,_O()?Reflect.construct(t,n||[],ih(e).constructor):t.apply(e,n))}function g9(e,t){if(t&&(Fo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return v9(e)}function v9(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_O=function(){return!!e})()}function ih(e){return ih=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ih(e)}function y9(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sy(e,t)}function Sy(e,t){return Sy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Sy(e,t)}function Hp(e,t,n){return t=AO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AO(e){var t=b9(e,"string");return Fo(t)=="symbol"?t:t+""}function b9(e,t){if(Fo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function x9(e,t){if(e==null)return{};var n=w9(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function w9(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function S9(e){return e.value}function k9(e,t){if(G.isValidElement(e))return G.cloneElement(e,t);if(typeof e=="function")return G.createElement(e,t);t.ref;var n=x9(t,f9);return G.createElement(nw,n)}var Uk=1,us=function(e){function t(){var n;h9(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=m9(this,t,[].concat(a)),Hp(n,"lastBoundingBox",{width:-1,height:-1}),n}return y9(t,e),p9(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>Uk||Math.abs(a.height-this.lastBoundingBox.height)>Uk)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?xa({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,s=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&s==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();h={top:((d||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return xa(xa({},f),h)}},{key:"render",value:function(){var r=this,a=this.props,s=a.content,o=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=xa(xa({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return G.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},k9(s,xa(xa({},this.props),{},{payload:EO(d,u,S9)})))}}],[{key:"getWithHeight",value:function(r,a){var s=xa(xa({},this.defaultProps),r.props),o=s.layout;return o==="vertical"&&fe(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])}(k.PureComponent);Hp(us,"displayName","Legend");Hp(us,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Wk=Gu,j9=aw,N9=qn,Hk=Wk?Wk.isConcatSpreadable:void 0;function E9(e){return N9(e)||j9(e)||!!(Hk&&e&&e[Hk])}var _9=E9,A9=pO,C9=_9;function CO(e,t,n,r,a){var s=-1,o=e.length;for(n||(n=C9),a||(a=[]);++s<o;){var l=e[s];t>0&&n(l)?t>1?CO(l,t-1,n,r,a):A9(a,l):r||(a[a.length]=l)}return a}var TO=CO;function T9(e){return function(t,n,r){for(var a=-1,s=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++a];if(n(s[c],c,s)===!1)break}return t}}var O9=T9,P9=O9,R9=P9(),M9=R9,I9=M9,$9=Wp;function L9(e,t){return e&&I9(e,t,$9)}var OO=L9,D9=Ku;function B9(e,t){return function(n,r){if(n==null)return n;if(!D9(n))return e(n,r);for(var a=n.length,s=t?a:-1,o=Object(n);(t?s--:++s<a)&&r(o[s],s,o)!==!1;);return n}}var z9=B9,F9=OO,U9=z9,W9=U9(F9),lw=W9,H9=lw,G9=Ku;function q9(e,t){var n=-1,r=G9(e)?Array(e.length):[];return H9(e,function(a,s,o){r[++n]=t(a,s,o)}),r}var PO=q9;function K9(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var V9=K9,Gk=hl;function Y9(e,t){if(e!==t){var n=e!==void 0,r=e===null,a=e===e,s=Gk(e),o=t!==void 0,l=t===null,c=t===t,u=Gk(t);if(!l&&!u&&!s&&e>t||s&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!a)return 1;if(!r&&!s&&!u&&e<t||u&&n&&a&&!r&&!s||l&&n&&a||!o&&a||!c)return-1}return 0}var X9=Y9,Q9=X9;function Z9(e,t,n){for(var r=-1,a=e.criteria,s=t.criteria,o=a.length,l=n.length;++r<o;){var c=Q9(a[r],s[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var J9=Z9,ig=qx,eG=Kx,tG=Ri,nG=PO,rG=V9,aG=vO,iG=J9,sG=xl,oG=qn;function lG(e,t,n){t.length?t=ig(t,function(s){return oG(s)?function(o){return eG(o,s.length===1?s[0]:s)}:s}):t=[sG];var r=-1;t=ig(t,aG(tG));var a=nG(e,function(s,o,l){var c=ig(t,function(u){return u(s)});return{criteria:c,index:++r,value:s}});return rG(a,function(s,o){return iG(s,o,n)})}var cG=lG;function uG(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var dG=uG,fG=dG,qk=Math.max;function hG(e,t,n){return t=qk(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=qk(r.length-t,0),o=Array(s);++a<s;)o[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(o),fG(e,this,l)}}var pG=hG;function mG(e){return function(){return e}}var gG=mG,vG=Ts,yG=function(){try{var e=vG(Object,"defineProperty");return e({},"",{}),e}catch{}}(),RO=yG,bG=gG,Kk=RO,xG=xl,wG=Kk?function(e,t){return Kk(e,"toString",{configurable:!0,enumerable:!1,value:bG(t),writable:!0})}:xG,SG=wG,kG=800,jG=16,NG=Date.now;function EG(e){var t=0,n=0;return function(){var r=NG(),a=jG-(r-n);if(n=r,a>0){if(++t>=kG)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var _G=EG,AG=SG,CG=_G,TG=CG(AG),OG=TG,PG=xl,RG=pG,MG=OG;function IG(e,t){return MG(RG(e,t,PG),e+"")}var $G=IG,LG=Ux,DG=Ku,BG=iw,zG=Pi;function FG(e,t,n){if(!zG(n))return!1;var r=typeof t;return(r=="number"?DG(n)&&BG(t,n.length):r=="string"&&t in n)?LG(n[t],e):!1}var Gp=FG,UG=TO,WG=cG,HG=$G,Vk=Gp,GG=HG(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Vk(e,t[0],t[1])?t=[]:n>2&&Vk(t[0],t[1],t[2])&&(t=[t[0]]),WG(e,UG(t,1),[])}),qG=GG;const cw=Qe(qG);function nu(e){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(e)}function ky(){return ky=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ky.apply(this,arguments)}function KG(e,t){return QG(e)||XG(e,t)||YG(e,t)||VG()}function VG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
79
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YG(e,t){if(e){if(typeof e=="string")return Yk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yk(e,t)}}function Yk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function XG(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function QG(e){if(Array.isArray(e))return e}function Xk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xk(Object(n),!0).forEach(function(r){ZG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZG(e,t,n){return t=JG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JG(e){var t=eq(e,"string");return nu(t)=="symbol"?t:t+""}function eq(e,t){if(nu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tq(e){return Array.isArray(e)&&Yt(e[0])&&Yt(e[1])?e.join(" ~ "):e}var nq=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,s=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,p=t.wrapperClassName,g=t.labelClassName,m=t.label,y=t.labelFormatter,v=t.accessibilityLayer,x=v===void 0?!1:v,S=function(){if(d&&d.length){var R={padding:0,margin:0},B=(h?cw(d,h):d).map(function(L,F){if(L.type==="none")return null;var z=sg({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},l),$=L.formatter||f||tq,O=L.value,U=L.name,C=O,Z=U;if($&&C!=null&&Z!=null){var D=$(O,U,L,F,d);if(Array.isArray(D)){var P=KG(D,2);C=P[0],Z=P[1]}else C=D}return G.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(F),style:z},Yt(Z)?G.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,Yt(Z)?G.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,G.createElement("span",{className:"recharts-tooltip-item-value"},C),G.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return G.createElement("ul",{className:"recharts-tooltip-item-list",style:R},B)}return null},j=sg({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),w=sg({margin:0},u),b=!Ye(m),N=b?m:"",E=Ve("recharts-default-tooltip",p),T=Ve("recharts-tooltip-label",g);b&&y&&d!==void 0&&d!==null&&(N=y(m,d));var A=x?{role:"status","aria-live":"assertive"}:{};return G.createElement("div",ky({className:E,style:j},A),G.createElement("p",{className:T,style:w},G.isValidElement(N)?N:"".concat(N)),S())};function ru(e){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(e)}function Rd(e,t,n){return t=rq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rq(e){var t=aq(e,"string");return ru(t)=="symbol"?t:t+""}function aq(e,t){if(ru(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xl="recharts-tooltip-wrapper",iq={visibility:"hidden"};function sq(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ve(Xl,Rd(Rd(Rd(Rd({},"".concat(Xl,"-right"),fe(n)&&t&&fe(t.x)&&n>=t.x),"".concat(Xl,"-left"),fe(n)&&t&&fe(t.x)&&n<t.x),"".concat(Xl,"-bottom"),fe(r)&&t&&fe(t.y)&&r>=t.y),"".concat(Xl,"-top"),fe(r)&&t&&fe(t.y)&&r<t.y))}function Qk(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,s=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(s&&fe(s[r]))return s[r];var d=n[r]-l-a,f=n[r]+a;if(t[r])return o[r]?d:f;if(o[r]){var h=d,p=c[r];return h<p?Math.max(f,c[r]):Math.max(d,c[r])}var g=f+l,m=c[r]+u;return g>m?Math.max(d,c[r]):Math.max(f,c[r])}function oq(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function lq(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,s=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=Qk({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=Qk({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=oq({translateX:d,translateY:f,useTranslate3d:l})):u=iq,{cssProperties:u,cssClasses:sq({translateX:d,translateY:f,coordinate:n})}}function Uo(e){"@babel/helpers - typeof";return Uo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uo(e)}function Zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Jk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zk(Object(n),!0).forEach(function(r){Ny(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,IO(r.key),r)}}function dq(e,t,n){return t&&uq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fq(e,t,n){return t=sh(t),hq(e,MO()?Reflect.construct(t,n||[],sh(e).constructor):t.apply(e,n))}function hq(e,t){if(t&&(Uo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pq(e)}function pq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MO=function(){return!!e})()}function sh(e){return sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sh(e)}function mq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jy(e,t)}function jy(e,t){return jy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},jy(e,t)}function Ny(e,t,n){return t=IO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IO(e){var t=gq(e,"string");return Uo(t)=="symbol"?t:t+""}function gq(e,t){if(Uo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var e1=1,vq=function(e){function t(){var n;cq(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=fq(this,t,[].concat(a)),Ny(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Ny(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return mq(t,e),dq(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>e1||Math.abs(r.height-this.state.lastBoundingBox.height)>e1)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,s=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,p=a.offset,g=a.position,m=a.reverseDirection,y=a.useTranslate3d,v=a.viewBox,x=a.wrapperStyle,S=lq({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:v}),j=S.cssClasses,w=S.cssProperties,b=Jk(Jk({transition:h&&s?"transform ".concat(l,"ms ").concat(c):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return G.createElement("div",{tabIndex:-1,className:j,style:b,ref:function(E){r.wrapperNode=E}},u)}}])}(k.PureComponent),yq=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Vu={isSsr:yq()};function Wo(e){"@babel/helpers - typeof";return Wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wo(e)}function t1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function n1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t1(Object(n),!0).forEach(function(r){uw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LO(r.key),r)}}function wq(e,t,n){return t&&xq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sq(e,t,n){return t=oh(t),kq(e,$O()?Reflect.construct(t,n||[],oh(e).constructor):t.apply(e,n))}function kq(e,t){if(t&&(Wo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jq(e)}function jq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($O=function(){return!!e})()}function oh(e){return oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},oh(e)}function Nq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ey(e,t)}function Ey(e,t){return Ey=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Ey(e,t)}function uw(e,t,n){return t=LO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LO(e){var t=Eq(e,"string");return Wo(t)=="symbol"?t:t+""}function Eq(e,t){if(Wo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function _q(e){return e.dataKey}function Aq(e,t){return G.isValidElement(e)?G.cloneElement(e,t):typeof e=="function"?G.createElement(e,t):G.createElement(nq,t)}var wn=function(e){function t(){return bq(this,t),Sq(this,t,arguments)}return Nq(t,e),wq(t,[{key:"render",value:function(){var r=this,a=this.props,s=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,h=a.isAnimationActive,p=a.offset,g=a.payload,m=a.payloadUniqBy,y=a.position,v=a.reverseDirection,x=a.useTranslate3d,S=a.viewBox,j=a.wrapperStyle,w=g??[];f&&w.length&&(w=EO(g.filter(function(N){return N.value!=null&&(N.hide!==!0||r.props.includeHidden)}),m,_q));var b=w.length>0;return G.createElement(vq,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:s,coordinate:d,hasPayload:b,offset:p,position:y,reverseDirection:v,useTranslate3d:x,viewBox:S,wrapperStyle:j},Aq(u,n1(n1({},this.props),{},{payload:w})))}}])}(k.PureComponent);uw(wn,"displayName","Tooltip");uw(wn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Vu.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Cq=da,Tq=function(){return Cq.Date.now()},Oq=Tq,Pq=/\s/;function Rq(e){for(var t=e.length;t--&&Pq.test(e.charAt(t)););return t}var Mq=Rq,Iq=Mq,$q=/^\s+/;function Lq(e){return e&&e.slice(0,Iq(e)+1).replace($q,"")}var Dq=Lq,Bq=Dq,r1=Pi,zq=hl,a1=NaN,Fq=/^[-+]0x[0-9a-f]+$/i,Uq=/^0b[01]+$/i,Wq=/^0o[0-7]+$/i,Hq=parseInt;function Gq(e){if(typeof e=="number")return e;if(zq(e))return a1;if(r1(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=r1(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Bq(e);var n=Uq.test(e);return n||Wq.test(e)?Hq(e.slice(2),n?2:8):Fq.test(e)?a1:+e}var DO=Gq,qq=Pi,og=Oq,i1=DO,Kq="Expected a function",Vq=Math.max,Yq=Math.min;function Xq(e,t,n){var r,a,s,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Kq);t=i1(t)||0,qq(n)&&(d=!!n.leading,f="maxWait"in n,s=f?Vq(i1(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(b){var N=r,E=a;return r=a=void 0,u=b,o=e.apply(E,N),o}function g(b){return u=b,l=setTimeout(v,t),d?p(b):o}function m(b){var N=b-c,E=b-u,T=t-N;return f?Yq(T,s-E):T}function y(b){var N=b-c,E=b-u;return c===void 0||N>=t||N<0||f&&E>=s}function v(){var b=og();if(y(b))return x(b);l=setTimeout(v,m(b))}function x(b){return l=void 0,h&&r?p(b):(r=a=void 0,o)}function S(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function j(){return l===void 0?o:x(og())}function w(){var b=og(),N=y(b);if(r=arguments,a=this,c=b,N){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(v,t),p(c)}return l===void 0&&(l=setTimeout(v,t)),o}return w.cancel=S,w.flush=j,w}var Qq=Xq,Zq=Qq,Jq=Pi,eK="Expected a function";function tK(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(eK);return Jq(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),Zq(e,t,{leading:r,maxWait:t,trailing:a})}var nK=tK;const BO=Qe(nK);function au(e){"@babel/helpers - typeof";return au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},au(e)}function s1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Md(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s1(Object(n),!0).forEach(function(r){rK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rK(e,t,n){return t=aK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aK(e){var t=iK(e,"string");return au(t)=="symbol"?t:t+""}function iK(e,t){if(au(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(au(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sK(e,t){return uK(e)||cK(e,t)||lK(e,t)||oK()}function oK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
80
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lK(e,t){if(e){if(typeof e=="string")return o1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o1(e,t)}}function o1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function uK(e){if(Array.isArray(e))return e}var Qi=k.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,s=e.width,o=s===void 0?"100%":s,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,p=e.children,g=e.debounce,m=g===void 0?0:g,y=e.id,v=e.className,x=e.onResize,S=e.style,j=S===void 0?{}:S,w=k.useRef(null),b=k.useRef();b.current=x,k.useImperativeHandle(t,function(){return Object.defineProperty(w.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),w.current},configurable:!0})});var N=k.useState({containerWidth:a.width,containerHeight:a.height}),E=sK(N,2),T=E[0],A=E[1],M=k.useCallback(function(B,L){A(function(F){var z=Math.round(B),$=Math.round(L);return F.containerWidth===z&&F.containerHeight===$?F:{containerWidth:z,containerHeight:$}})},[]);k.useEffect(function(){var B=function(U){var C,Z=U[0].contentRect,D=Z.width,P=Z.height;M(D,P),(C=b.current)===null||C===void 0||C.call(b,D,P)};m>0&&(B=BO(B,m,{trailing:!0,leading:!1}));var L=new ResizeObserver(B),F=w.current.getBoundingClientRect(),z=F.width,$=F.height;return M(z,$),L.observe(w.current),function(){L.disconnect()}},[M,m]);var R=k.useMemo(function(){var B=T.containerWidth,L=T.containerHeight;if(B<0||L<0)return null;Oa(rs(o)||rs(c),`The width(%s) and height(%s) are both fixed numbers,
|
|
81
|
+
maybe you don't need to use a ResponsiveContainer.`,o,c),Oa(!n||n>0,"The aspect(%s) must be greater than zero.",n);var F=rs(o)?B:o,z=rs(c)?L:c;n&&n>0&&(F?z=F/n:z&&(F=z*n),h&&z>h&&(z=h)),Oa(F>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
82
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
83
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
84
|
+
height and width.`,F,z,o,c,d,f,n);var $=!Array.isArray(p)&&Ta(p.type).endsWith("Chart");return G.Children.map(p,function(O){return G.isValidElement(O)?k.cloneElement(O,Md({width:F,height:z},$?{style:Md({height:"100%",width:"100%",maxHeight:z,maxWidth:F},O.props.style)}:{})):O})},[n,p,c,h,f,d,T,o]);return G.createElement("div",{id:y?"".concat(y):void 0,className:Ve("recharts-responsive-container",v),style:Md(Md({},j),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:w},R)}),iu=function(t){return null};iu.displayName="Cell";function su(e){"@babel/helpers - typeof";return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},su(e)}function l1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l1(Object(n),!0).forEach(function(r){dK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dK(e,t,n){return t=fK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fK(e){var t=hK(e,"string");return su(t)=="symbol"?t:t+""}function hK(e,t){if(su(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(su(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qs={widthCache:{},cacheCount:0},pK=2e3,mK={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},c1="recharts_measurement_span";function gK(e){var t=_y({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Ec=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Vu.isSsr)return{width:0,height:0};var r=gK(n),a=JSON.stringify({text:t,copyStyle:r});if(qs.widthCache[a])return qs.widthCache[a];try{var s=document.getElementById(c1);s||(s=document.createElement("span"),s.setAttribute("id",c1),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=_y(_y({},mK),r);Object.assign(s.style,o),s.textContent="".concat(t);var l=s.getBoundingClientRect(),c={width:l.width,height:l.height};return qs.widthCache[a]=c,++qs.cacheCount>pK&&(qs.cacheCount=0,qs.widthCache={}),c}catch{return{width:0,height:0}}},vK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ou(e){"@babel/helpers - typeof";return ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ou(e)}function lh(e,t){return wK(e)||xK(e,t)||bK(e,t)||yK()}function yK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
85
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bK(e,t){if(e){if(typeof e=="string")return u1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u1(e,t)}}function u1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function wK(e){if(Array.isArray(e))return e}function SK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jK(r.key),r)}}function kK(e,t,n){return t&&d1(e.prototype,t),n&&d1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jK(e){var t=NK(e,"string");return ou(t)=="symbol"?t:t+""}function NK(e,t){if(ou(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ou(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var f1=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,h1=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,EK=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,_K=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,zO={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},AK=Object.keys(zO),go="NaN";function CK(e,t){return e*zO[t]}var Id=function(){function e(t,n){SK(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!EK.test(n)&&(this.num=NaN,this.unit=""),AK.includes(n)&&(this.num=CK(t,n),this.unit="px")}return kK(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=_K.exec(n))!==null&&r!==void 0?r:[],s=lh(a,3),o=s[1],l=s[2];return new e(parseFloat(o),l??"")}}])}();function FO(e){if(e.includes(go))return go;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=f1.exec(t))!==null&&n!==void 0?n:[],a=lh(r,4),s=a[1],o=a[2],l=a[3],c=Id.parse(s??""),u=Id.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return go;t=t.replace(f1,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=h1.exec(t))!==null&&f!==void 0?f:[],p=lh(h,4),g=p[1],m=p[2],y=p[3],v=Id.parse(g??""),x=Id.parse(y??""),S=m==="+"?v.add(x):v.subtract(x);if(S.isNaN())return go;t=t.replace(h1,S.toString())}return t}var p1=/\(([^()]*)\)/;function TK(e){for(var t=e;t.includes("(");){var n=p1.exec(t),r=lh(n,2),a=r[1];t=t.replace(p1,FO(a))}return t}function OK(e){var t=e.replace(/\s+/g,"");return t=TK(t),t=FO(t),t}function PK(e){try{return OK(e)}catch{return go}}function lg(e){var t=PK(e.slice(5,-1));return t===go?"":t}var RK=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],MK=["dx","dy","angle","className","breakAll"];function Ay(){return Ay=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ay.apply(this,arguments)}function m1(e,t){if(e==null)return{};var n=IK(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function IK(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function g1(e,t){return BK(e)||DK(e,t)||LK(e,t)||$K()}function $K(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
86
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LK(e,t){if(e){if(typeof e=="string")return v1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v1(e,t)}}function v1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function DK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function BK(e){if(Array.isArray(e))return e}var UO=/[ \f\n\r\t\v\u2028\u2029]+/,WO=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var s=[];Ye(n)||(r?s=n.toString().split(""):s=n.toString().split(UO));var o=s.map(function(c){return{word:c,width:Ec(c,a).width}}),l=r?0:Ec(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},zK=function(t,n,r,a,s){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=fe(o),f=l,h=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(z,$){var O=$.word,U=$.width,C=z[z.length-1];if(C&&(a==null||s||C.width+U+r<Number(a)))C.words.push(O),C.width+=U+r;else{var Z={words:[O],width:U};z.push(Z)}return z},[])},p=h(n),g=function(F){return F.reduce(function(z,$){return z.width>$.width?z:$})};if(!d)return p;for(var m="…",y=function(F){var z=f.slice(0,F),$=WO({breakAll:u,style:c,children:z+m}).wordsWithComputedWidth,O=h($),U=O.length>o||g(O).width>Number(a);return[U,O]},v=0,x=f.length-1,S=0,j;v<=x&&S<=f.length-1;){var w=Math.floor((v+x)/2),b=w-1,N=y(b),E=g1(N,2),T=E[0],A=E[1],M=y(w),R=g1(M,1),B=R[0];if(!T&&!B&&(v=w+1),T&&B&&(x=w-1),!T&&B){j=A;break}S++}return j||p},y1=function(t){var n=Ye(t)?[]:t.toString().split(UO);return[{words:n}]},FK=function(t){var n=t.width,r=t.scaleToFit,a=t.children,s=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!Vu.isSsr){var c,u,d=WO({breakAll:o,children:a,style:s});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return y1(a);return zK({breakAll:o,children:a,maxLines:l,style:s},c,u,n,r)}return y1(a)},b1="#808080",ch=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,s=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,g=t.verticalAnchor,m=g===void 0?"end":g,y=t.fill,v=y===void 0?b1:y,x=m1(t,RK),S=k.useMemo(function(){return FK({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),j=x.dx,w=x.dy,b=x.angle,N=x.className,E=x.breakAll,T=m1(x,MK);if(!Yt(r)||!Yt(s))return null;var A=r+(fe(j)?j:0),M=s+(fe(w)?w:0),R;switch(m){case"start":R=lg("calc(".concat(u,")"));break;case"middle":R=lg("calc(".concat((S.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:R=lg("calc(".concat(S.length-1," * -").concat(l,")"));break}var B=[];if(f){var L=S[0].width,F=x.width;B.push("scale(".concat((fe(F)?F/L:1)/L,")"))}return b&&B.push("rotate(".concat(b,", ").concat(A,", ").concat(M,")")),B.length&&(T.transform=B.join(" ")),G.createElement("text",Ay({},Ke(T,!0),{x:A,y:M,className:Ve("recharts-text",N),textAnchor:p,fill:v.includes("url")?b1:v}),S.map(function(z,$){var O=z.words.join(E?"":" ");return G.createElement("tspan",{x:A,dy:$===0?R:l,key:"".concat(O,"-").concat($)},O)}))};function ki(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function UK(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function dw(e){let t,n,r;e.length!==2?(t=ki,n=(l,c)=>ki(e(l),c),r=(l,c)=>e(l)-c):(t=e===ki||e===UK?e:WK,n=e,r=e);function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:a,center:o,right:s}}function WK(){return 0}function HO(e){return e===null?NaN:+e}function*HK(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const GK=dw(ki),Yu=GK.right;dw(HO).center;class x1 extends Map{constructor(t,n=VK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(w1(this,t))}has(t){return super.has(w1(this,t))}set(t,n){return super.set(qK(this,t),n)}delete(t){return super.delete(KK(this,t))}}function w1({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function qK({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function KK({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function VK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function YK(e=ki){if(e===ki)return GO;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function GO(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const XK=Math.sqrt(50),QK=Math.sqrt(10),ZK=Math.sqrt(2);function uh(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),s=r/Math.pow(10,a),o=s>=XK?10:s>=QK?5:s>=ZK?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?uh(e,t,n*2):[l,c,u]}function Cy(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,s,o]=r?uh(t,e,n):uh(e,t,n);if(!(s>=a))return[];const l=s-a+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(s-u)/-o;else for(let u=0;u<l;++u)c[u]=(s-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(a+u)/-o;else for(let u=0;u<l;++u)c[u]=(a+u)*o;return c}function Ty(e,t,n){return t=+t,e=+e,n=+n,uh(e,t,n)[2]}function Oy(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?Ty(t,e,n):Ty(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function S1(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function k1(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function qO(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?GO:YK(a);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(n,Math.floor(t-u*f/c+h)),g=Math.min(r,Math.floor(t+(c-u)*f/c+h));qO(e,t,p,g,a)}const s=e[t];let o=n,l=r;for(Ql(e,n,t),a(e[r],s)>0&&Ql(e,n,r);o<l;){for(Ql(e,o,l),++o,--l;a(e[o],s)<0;)++o;for(;a(e[l],s)>0;)--l}a(e[n],s)===0?Ql(e,n,l):(++l,Ql(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Ql(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function JK(e,t,n){if(e=Float64Array.from(HK(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return k1(e);if(t>=1)return S1(e);var r,a=(r-1)*t,s=Math.floor(a),o=S1(qO(e,s).subarray(0,s+1)),l=k1(e.subarray(s+1));return o+(l-o)*(a-s)}}function eV(e,t,n=HO){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,s=Math.floor(a),o=+n(e[s],s,e),l=+n(e[s+1],s+1,e);return o+(l-o)*(a-s)}}function tV(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(a);++r<a;)s[r]=e+r*n;return s}function Ar(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ha(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Py=Symbol("implicit");function fw(){var e=new x1,t=[],n=[],r=Py;function a(s){let o=e.get(s);if(o===void 0){if(r!==Py)return r;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return a.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new x1;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(s){return arguments.length?(n=Array.from(s),a):n.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return fw(t,n).unknown(r)},Ar.apply(a,arguments),a}function lu(){var e=fw().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,s,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=a<r,g=p?a:r,m=p?r:a;s=(m-g)/Math.max(1,h-c+u*2),l&&(s=Math.floor(s)),g+=(m-g-s*(h-c))*d,o=s*(1-c),l&&(g=Math.round(g),o=Math.round(o));var y=tV(h).map(function(v){return g+s*v});return n(p?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,a]=h,r=+r,a=+a,f()):[r,a]},e.rangeRound=function(h){return[r,a]=h,r=+r,a=+a,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return s},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return lu(t(),[r,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},Ar.apply(f(),arguments)}function KO(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return KO(t())},e}function _c(){return KO(lu.apply(null,arguments).paddingInner(1))}function hw(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function VO(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xu(){}var cu=.7,dh=1/cu,Ao="\\s*([+-]?\\d+)\\s*",uu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",oa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nV=/^#([0-9a-f]{3,8})$/,rV=new RegExp(`^rgb\\(${Ao},${Ao},${Ao}\\)$`),aV=new RegExp(`^rgb\\(${oa},${oa},${oa}\\)$`),iV=new RegExp(`^rgba\\(${Ao},${Ao},${Ao},${uu}\\)$`),sV=new RegExp(`^rgba\\(${oa},${oa},${oa},${uu}\\)$`),oV=new RegExp(`^hsl\\(${uu},${oa},${oa}\\)$`),lV=new RegExp(`^hsla\\(${uu},${oa},${oa},${uu}\\)$`),j1={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};hw(Xu,du,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:N1,formatHex:N1,formatHex8:cV,formatHsl:uV,formatRgb:E1,toString:E1});function N1(){return this.rgb().formatHex()}function cV(){return this.rgb().formatHex8()}function uV(){return YO(this).formatHsl()}function E1(){return this.rgb().formatRgb()}function du(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=nV.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?_1(t):n===3?new Un(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$d(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$d(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=rV.exec(e))?new Un(t[1],t[2],t[3],1):(t=aV.exec(e))?new Un(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=iV.exec(e))?$d(t[1],t[2],t[3],t[4]):(t=sV.exec(e))?$d(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oV.exec(e))?T1(t[1],t[2]/100,t[3]/100,1):(t=lV.exec(e))?T1(t[1],t[2]/100,t[3]/100,t[4]):j1.hasOwnProperty(e)?_1(j1[e]):e==="transparent"?new Un(NaN,NaN,NaN,0):null}function _1(e){return new Un(e>>16&255,e>>8&255,e&255,1)}function $d(e,t,n,r){return r<=0&&(e=t=n=NaN),new Un(e,t,n,r)}function dV(e){return e instanceof Xu||(e=du(e)),e?(e=e.rgb(),new Un(e.r,e.g,e.b,e.opacity)):new Un}function Ry(e,t,n,r){return arguments.length===1?dV(e):new Un(e,t,n,r??1)}function Un(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}hw(Un,Ry,VO(Xu,{brighter(e){return e=e==null?dh:Math.pow(dh,e),new Un(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cu:Math.pow(cu,e),new Un(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Un(ds(this.r),ds(this.g),ds(this.b),fh(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:A1,formatHex:A1,formatHex8:fV,formatRgb:C1,toString:C1}));function A1(){return`#${as(this.r)}${as(this.g)}${as(this.b)}`}function fV(){return`#${as(this.r)}${as(this.g)}${as(this.b)}${as((isNaN(this.opacity)?1:this.opacity)*255)}`}function C1(){const e=fh(this.opacity);return`${e===1?"rgb(":"rgba("}${ds(this.r)}, ${ds(this.g)}, ${ds(this.b)}${e===1?")":`, ${e})`}`}function fh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ds(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function as(e){return e=ds(e),(e<16?"0":"")+e.toString(16)}function T1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Br(e,t,n,r)}function YO(e){if(e instanceof Br)return new Br(e.h,e.s,e.l,e.opacity);if(e instanceof Xu||(e=du(e)),!e)return new Br;if(e instanceof Br)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,l=s-a,c=(s+a)/2;return l?(t===s?o=(n-r)/l+(n<r)*6:n===s?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?s+a:2-s-a,o*=60):l=c>0&&c<1?0:o,new Br(o,l,c,e.opacity)}function hV(e,t,n,r){return arguments.length===1?YO(e):new Br(e,t,n,r??1)}function Br(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}hw(Br,hV,VO(Xu,{brighter(e){return e=e==null?dh:Math.pow(dh,e),new Br(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cu:Math.pow(cu,e),new Br(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,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Un(cg(e>=240?e-240:e+120,a,r),cg(e,a,r),cg(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Br(O1(this.h),Ld(this.s),Ld(this.l),fh(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=fh(this.opacity);return`${e===1?"hsl(":"hsla("}${O1(this.h)}, ${Ld(this.s)*100}%, ${Ld(this.l)*100}%${e===1?")":`, ${e})`}`}}));function O1(e){return e=(e||0)%360,e<0?e+360:e}function Ld(e){return Math.max(0,Math.min(1,e||0))}function cg(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 pw=e=>()=>e;function pV(e,t){return function(n){return e+n*t}}function mV(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function gV(e){return(e=+e)==1?XO:function(t,n){return n-t?mV(t,n,e):pw(isNaN(t)?n:t)}}function XO(e,t){var n=t-e;return n?pV(e,n):pw(isNaN(e)?t:e)}const P1=function e(t){var n=gV(t);function r(a,s){var o=n((a=Ry(a)).r,(s=Ry(s)).r),l=n(a.g,s.g),c=n(a.b,s.b),u=XO(a.opacity,s.opacity);return function(d){return a.r=o(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return r.gamma=e,r}(1);function vV(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(s){for(a=0;a<n;++a)r[a]=e[a]*(1-s)+t[a]*s;return r}}function yV(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function bV(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),s=new Array(n),o;for(o=0;o<r;++o)a[o]=wl(e[o],t[o]);for(;o<n;++o)s[o]=t[o];return function(l){for(o=0;o<r;++o)s[o]=a[o](l);return s}}function xV(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function hh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function wV(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=wl(e[a],t[a]):r[a]=t[a];return function(s){for(a in n)r[a]=n[a](s);return r}}var My=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ug=new RegExp(My.source,"g");function SV(e){return function(){return e}}function kV(e){return function(t){return e(t)+""}}function jV(e,t){var n=My.lastIndex=ug.lastIndex=0,r,a,s,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=My.exec(e))&&(a=ug.exec(t));)(s=a.index)>n&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(r=r[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:hh(r,a)})),n=ug.lastIndex;return n<t.length&&(s=t.slice(n),l[o]?l[o]+=s:l[++o]=s),l.length<2?c[0]?kV(c[0].x):SV(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 wl(e,t){var n=typeof t,r;return t==null||n==="boolean"?pw(t):(n==="number"?hh:n==="string"?(r=du(t))?(t=r,P1):jV:t instanceof du?P1:t instanceof Date?xV:yV(t)?vV:Array.isArray(t)?bV:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wV:hh)(e,t)}function mw(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function NV(e,t){t===void 0&&(t=e,e=wl);for(var n=0,r=t.length-1,a=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(a,a=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return s[l](o-l)}}function EV(e){return function(){return e}}function ph(e){return+e}var R1=[0,1];function Mn(e){return e}function Iy(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:EV(isNaN(t)?NaN:.5)}function _V(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function AV(e,t,n){var r=e[0],a=e[1],s=t[0],o=t[1];return a<r?(r=Iy(a,r),s=n(o,s)):(r=Iy(r,a),s=n(s,o)),function(l){return s(r(l))}}function CV(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),s=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=Iy(e[o],e[o+1]),s[o]=n(t[o],t[o+1]);return function(l){var c=Yu(e,l,1,r)-1;return s[c](a[c](l))}}function Qu(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function qp(){var e=R1,t=R1,n=wl,r,a,s,o=Mn,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==Mn&&(o=_V(e[0],e[h-1])),l=h>2?CV:AV,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?s:(c||(c=l(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(a((u||(u=l(t,e.map(r),hh)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,ph),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=mw,d()},f.clamp=function(h){return arguments.length?(o=h?!0:Mn,d()):o!==Mn},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,p){return r=h,a=p,d()}}function gw(){return qp()(Mn,Mn)}function TV(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function mh(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Ho(e){return e=mh(Math.abs(e)),e?e[1]:NaN}function OV(e,t){return function(n,r){for(var a=n.length,s=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),s.push(n.substring(a-=l,a+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function PV(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var RV=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fu(e){if(!(t=RV.exec(e)))throw new Error("invalid format: "+e);var t;return new vw({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}fu.prototype=vw.prototype;function vw(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}vw.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function MV(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var gh;function IV(e,t){var n=mh(e,t);if(!n)return gh=void 0,e.toPrecision(t);var r=n[0],a=n[1],s=a-(gh=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+mh(e,Math.max(0,t+s-1))[0]}function M1(e,t){var n=mh(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const I1={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:TV,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>M1(e*100,t),r:M1,s:IV,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function $1(e){return e}var L1=Array.prototype.map,D1=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $V(e){var t=e.grouping===void 0||e.thousands===void 0?$1:OV(L1.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?$1:PV(L1.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=fu(f);var p=f.fill,g=f.align,m=f.sign,y=f.symbol,v=f.zero,x=f.width,S=f.comma,j=f.precision,w=f.trim,b=f.type;b==="n"?(S=!0,b="g"):I1[b]||(j===void 0&&(j=12),w=!0,b="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var N=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),E=(y==="$"?r:/[%p]/.test(b)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),T=I1[b],A=/[defgprs%]/.test(b);j=j===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function M(R){var B=N,L=E,F,z,$;if(b==="c")L=T(R)+L,R="";else{R=+R;var O=R<0||1/R<0;if(R=isNaN(R)?c:T(Math.abs(R),j),w&&(R=MV(R)),O&&+R==0&&m!=="+"&&(O=!1),B=(O?m==="("?m:l:m==="-"||m==="("?"":m)+B,L=(b==="s"&&!isNaN(R)&&gh!==void 0?D1[8+gh/3]:"")+L+(O&&m==="("?")":""),A){for(F=-1,z=R.length;++F<z;)if($=R.charCodeAt(F),48>$||$>57){L=($===46?a+R.slice(F+1):R.slice(F))+L,R=R.slice(0,F);break}}}S&&!v&&(R=t(R,1/0));var U=B.length+R.length+L.length,C=U<x?new Array(x-U+1).join(p):"";switch(S&&v&&(R=t(C+R,C.length?x-L.length:1/0),C=""),g){case"<":R=B+R+L+C;break;case"=":R=B+C+R+L;break;case"^":R=C.slice(0,U=C.length>>1)+B+R+L+C.slice(U);break;default:R=C+B+R+L;break}return s(R)}return M.toString=function(){return f+""},M}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(Ho(h)/3)))*3,g=Math.pow(10,-p),m=u((f=fu(f),f.type="f",f),{suffix:D1[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:d}}var Dd,yw,QO;LV({thousands:",",grouping:[3],currency:["$",""]});function LV(e){return Dd=$V(e),yw=Dd.format,QO=Dd.formatPrefix,Dd}function DV(e){return Math.max(0,-Ho(Math.abs(e)))}function BV(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ho(t)/3)))*3-Ho(Math.abs(e)))}function zV(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ho(t)-Ho(e))+1}function ZO(e,t,n,r){var a=Oy(e,t,n),s;switch(r=fu(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=BV(a,o))&&(r.precision=s),QO(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=zV(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=DV(a))&&(r.precision=s-(r.type==="%")*2);break}}return yw(r)}function Mi(e){var t=e.domain;return e.ticks=function(n){var r=t();return Cy(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return ZO(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,s=r.length-1,o=r[a],l=r[s],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=a,a=s,s=u);d-- >0;){if(u=Ty(o,l,n),u===c)return r[a]=o,r[s]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function vh(){var e=gw();return e.copy=function(){return Qu(e,vh())},Ar.apply(e,arguments),Mi(e)}function JO(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,ph),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return JO(e).unknown(t)},e=arguments.length?Array.from(e,ph):[0,1],Mi(n)}function eP(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],s=e[r],o;return s<a&&(o=n,n=r,r=o,o=a,a=s,s=o),e[n]=t.floor(a),e[r]=t.ceil(s),e}function B1(e){return Math.log(e)}function z1(e){return Math.exp(e)}function FV(e){return-Math.log(-e)}function UV(e){return-Math.exp(-e)}function WV(e){return isFinite(e)?+("1e"+e):e<0?0:e}function HV(e){return e===10?WV:e===Math.E?Math.exp:t=>Math.pow(e,t)}function GV(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function F1(e){return(t,n)=>-e(-t,n)}function bw(e){const t=e(B1,z1),n=t.domain;let r=10,a,s;function o(){return a=GV(r),s=HV(r),n()[0]<0?(a=F1(a),s=F1(s),e(FV,UV)):e(B1,z1),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=a(u),p=a(d),g,m;const y=l==null?10:+l;let v=[];if(!(r%1)&&p-h<y){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(g=1;g<r;++g)if(m=h<0?g/s(-h):g*s(h),!(m<u)){if(m>d)break;v.push(m)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(m=h>0?g/s(-h):g*s(h),!(m<u)){if(m>d)break;v.push(m)}v.length*2<y&&(v=Cy(u,d,y))}else v=Cy(h,p,Math.min(p-h,y)).map(s);return f?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=fu(c)).precision==null&&(c.trim=!0),c=yw(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/s(Math.round(a(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(eP(n(),{floor:l=>s(Math.floor(a(l))),ceil:l=>s(Math.ceil(a(l)))})),t}function tP(){const e=bw(qp()).domain([1,10]);return e.copy=()=>Qu(e,tP()).base(e.base()),Ar.apply(e,arguments),e}function U1(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function W1(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xw(e){var t=1,n=e(U1(t),W1(t));return n.constant=function(r){return arguments.length?e(U1(t=+r),W1(t)):t},Mi(n)}function nP(){var e=xw(qp());return e.copy=function(){return Qu(e,nP()).constant(e.constant())},Ar.apply(e,arguments)}function H1(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function qV(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function KV(e){return e<0?-e*e:e*e}function ww(e){var t=e(Mn,Mn),n=1;function r(){return n===1?e(Mn,Mn):n===.5?e(qV,KV):e(H1(n),H1(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Mi(t)}function Sw(){var e=ww(qp());return e.copy=function(){return Qu(e,Sw()).exponent(e.exponent())},Ar.apply(e,arguments),e}function VV(){return Sw.apply(null,arguments).exponent(.5)}function G1(e){return Math.sign(e)*e*e}function YV(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function rP(){var e=gw(),t=[0,1],n=!1,r;function a(s){var o=YV(e(s));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(s){return e.invert(G1(s))},a.domain=function(s){return arguments.length?(e.domain(s),a):e.domain()},a.range=function(s){return arguments.length?(e.range((t=Array.from(s,ph)).map(G1)),a):t.slice()},a.rangeRound=function(s){return a.range(s).round(!0)},a.round=function(s){return arguments.length?(n=!!s,a):n},a.clamp=function(s){return arguments.length?(e.clamp(s),a):e.clamp()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return rP(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ar.apply(a,arguments),Mi(a)}function aP(){var e=[],t=[],n=[],r;function a(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=eV(e,o/l);return s}function s(o){return o==null||isNaN(o=+o)?r:t[Yu(n,o)]}return s.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(ki),a()},s.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return aP().domain(e).range(t).unknown(r)},Ar.apply(s,arguments)}function iP(){var e=0,t=1,n=1,r=[.5],a=[0,1],s;function o(c){return c!=null&&c<=c?a[Yu(r,c,0,n)]:s}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return iP().domain([e,t]).range(a).unknown(s)},Ar.apply(Mi(o),arguments)}function sP(){var e=[.5],t=[0,1],n,r=1;function a(s){return s!=null&&s<=s?t[Yu(e,s,0,r)]:n}return a.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},a.unknown=function(s){return arguments.length?(n=s,a):n},a.copy=function(){return sP().domain(e).range(t).unknown(n)},Ar.apply(a,arguments)}const dg=new Date,fg=new Date;function Xt(e,t,n,r){function a(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return a.floor=s=>(e(s=new Date(+s)),s),a.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),a.round=s=>{const o=a(s),l=a.ceil(s);return s-o<l-s?o:l},a.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),a.range=(s,o,l)=>{const c=[];if(s=a.ceil(s),l=l==null?1:Math.floor(l),!(s<o)||!(l>0))return c;let u;do c.push(u=new Date(+s)),t(s,l),e(s);while(u<s&&s<o);return c},a.filter=s=>Xt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),n&&(a.count=(s,o)=>(dg.setTime(+s),fg.setTime(+o),e(dg),e(fg),Math.floor(n(dg,fg))),a.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?a.filter(r?o=>r(o)%s===0:o=>a.count(0,o)%s===0):a)),a}const yh=Xt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);yh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Xt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):yh);yh.range;const Ea=1e3,wr=Ea*60,_a=wr*60,La=_a*24,kw=La*7,q1=La*30,hg=La*365,is=Xt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ea)},(e,t)=>(t-e)/Ea,e=>e.getUTCSeconds());is.range;const jw=Xt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ea)},(e,t)=>{e.setTime(+e+t*wr)},(e,t)=>(t-e)/wr,e=>e.getMinutes());jw.range;const Nw=Xt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wr)},(e,t)=>(t-e)/wr,e=>e.getUTCMinutes());Nw.range;const Ew=Xt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ea-e.getMinutes()*wr)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getHours());Ew.range;const _w=Xt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getUTCHours());_w.range;const Zu=Xt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wr)/La,e=>e.getDate()-1);Zu.range;const Kp=Xt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/La,e=>e.getUTCDate()-1);Kp.range;const oP=Xt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/La,e=>Math.floor(e/La));oP.range;function Os(e){return Xt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*wr)/kw)}const Vp=Os(0),bh=Os(1),XV=Os(2),QV=Os(3),Go=Os(4),ZV=Os(5),JV=Os(6);Vp.range;bh.range;XV.range;QV.range;Go.range;ZV.range;JV.range;function Ps(e){return Xt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/kw)}const Yp=Ps(0),xh=Ps(1),e7=Ps(2),t7=Ps(3),qo=Ps(4),n7=Ps(5),r7=Ps(6);Yp.range;xh.range;e7.range;t7.range;qo.range;n7.range;r7.range;const Aw=Xt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Aw.range;const Cw=Xt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Cw.range;const Da=Xt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Da.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Da.range;const Ba=Xt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ba.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Ba.range;function lP(e,t,n,r,a,s){const o=[[is,1,Ea],[is,5,5*Ea],[is,15,15*Ea],[is,30,30*Ea],[s,1,wr],[s,5,5*wr],[s,15,15*wr],[s,30,30*wr],[a,1,_a],[a,3,3*_a],[a,6,6*_a],[a,12,12*_a],[r,1,La],[r,2,2*La],[n,1,kw],[t,1,q1],[t,3,3*q1],[e,1,hg]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),g=p?p.range(u,+d+1):[];return h?g.reverse():g}function c(u,d,f){const h=Math.abs(d-u)/f,p=dw(([,,y])=>y).right(o,h);if(p===o.length)return e.every(Oy(u/hg,d/hg,f));if(p===0)return yh.every(Math.max(Oy(u,d,f),1));const[g,m]=o[h/o[p-1][2]<o[p][2]/h?p-1:p];return g.every(m)}return[l,c]}const[a7,i7]=lP(Ba,Cw,Yp,oP,_w,Nw),[s7,o7]=lP(Da,Aw,Vp,Zu,Ew,jw);function pg(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function mg(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Zl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function l7(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,s=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=Jl(a),d=ec(a),f=Jl(s),h=ec(s),p=Jl(o),g=ec(o),m=Jl(l),y=ec(l),v=Jl(c),x=ec(c),S={a:$,A:O,b:U,B:C,c:null,d:Z1,e:Z1,f:O7,g:F7,G:W7,H:A7,I:C7,j:T7,L:cP,m:P7,M:R7,p:Z,q:D,Q:tj,s:nj,S:M7,u:I7,U:$7,V:L7,w:D7,W:B7,x:null,X:null,y:z7,Y:U7,Z:H7,"%":ej},j={a:P,A:ie,b:ve,B:pe,c:null,d:J1,e:J1,f:V7,g:aY,G:sY,H:G7,I:q7,j:K7,L:dP,m:Y7,M:X7,p:Te,q,Q:tj,s:nj,S:Q7,u:Z7,U:J7,V:eY,w:tY,W:nY,x:null,X:null,y:rY,Y:iY,Z:oY,"%":ej},w={a:A,A:M,b:R,B,c:L,d:X1,e:X1,f:j7,g:Y1,G:V1,H:Q1,I:Q1,j:x7,L:k7,m:b7,M:w7,p:T,q:y7,Q:E7,s:_7,S:S7,u:h7,U:p7,V:m7,w:f7,W:g7,x:F,X:z,y:Y1,Y:V1,Z:v7,"%":N7};S.x=b(n,S),S.X=b(r,S),S.c=b(t,S),j.x=b(n,j),j.X=b(r,j),j.c=b(t,j);function b(X,oe){return function(ue){var V=[],_e=-1,je=0,Ne=X.length,ge,ze,me;for(ue instanceof Date||(ue=new Date(+ue));++_e<Ne;)X.charCodeAt(_e)===37&&(V.push(X.slice(je,_e)),(ze=K1[ge=X.charAt(++_e)])!=null?ge=X.charAt(++_e):ze=ge==="e"?" ":"0",(me=oe[ge])&&(ge=me(ue,ze)),V.push(ge),je=_e+1);return V.push(X.slice(je,_e)),V.join("")}}function N(X,oe){return function(ue){var V=Zl(1900,void 0,1),_e=E(V,X,ue+="",0),je,Ne;if(_e!=ue.length)return null;if("Q"in V)return new Date(V.Q);if("s"in V)return new Date(V.s*1e3+("L"in V?V.L:0));if(oe&&!("Z"in V)&&(V.Z=0),"p"in V&&(V.H=V.H%12+V.p*12),V.m===void 0&&(V.m="q"in V?V.q:0),"V"in V){if(V.V<1||V.V>53)return null;"w"in V||(V.w=1),"Z"in V?(je=mg(Zl(V.y,0,1)),Ne=je.getUTCDay(),je=Ne>4||Ne===0?xh.ceil(je):xh(je),je=Kp.offset(je,(V.V-1)*7),V.y=je.getUTCFullYear(),V.m=je.getUTCMonth(),V.d=je.getUTCDate()+(V.w+6)%7):(je=pg(Zl(V.y,0,1)),Ne=je.getDay(),je=Ne>4||Ne===0?bh.ceil(je):bh(je),je=Zu.offset(je,(V.V-1)*7),V.y=je.getFullYear(),V.m=je.getMonth(),V.d=je.getDate()+(V.w+6)%7)}else("W"in V||"U"in V)&&("w"in V||(V.w="u"in V?V.u%7:"W"in V?1:0),Ne="Z"in V?mg(Zl(V.y,0,1)).getUTCDay():pg(Zl(V.y,0,1)).getDay(),V.m=0,V.d="W"in V?(V.w+6)%7+V.W*7-(Ne+5)%7:V.w+V.U*7-(Ne+6)%7);return"Z"in V?(V.H+=V.Z/100|0,V.M+=V.Z%100,mg(V)):pg(V)}}function E(X,oe,ue,V){for(var _e=0,je=oe.length,Ne=ue.length,ge,ze;_e<je;){if(V>=Ne)return-1;if(ge=oe.charCodeAt(_e++),ge===37){if(ge=oe.charAt(_e++),ze=w[ge in K1?oe.charAt(_e++):ge],!ze||(V=ze(X,ue,V))<0)return-1}else if(ge!=ue.charCodeAt(V++))return-1}return V}function T(X,oe,ue){var V=u.exec(oe.slice(ue));return V?(X.p=d.get(V[0].toLowerCase()),ue+V[0].length):-1}function A(X,oe,ue){var V=p.exec(oe.slice(ue));return V?(X.w=g.get(V[0].toLowerCase()),ue+V[0].length):-1}function M(X,oe,ue){var V=f.exec(oe.slice(ue));return V?(X.w=h.get(V[0].toLowerCase()),ue+V[0].length):-1}function R(X,oe,ue){var V=v.exec(oe.slice(ue));return V?(X.m=x.get(V[0].toLowerCase()),ue+V[0].length):-1}function B(X,oe,ue){var V=m.exec(oe.slice(ue));return V?(X.m=y.get(V[0].toLowerCase()),ue+V[0].length):-1}function L(X,oe,ue){return E(X,t,oe,ue)}function F(X,oe,ue){return E(X,n,oe,ue)}function z(X,oe,ue){return E(X,r,oe,ue)}function $(X){return o[X.getDay()]}function O(X){return s[X.getDay()]}function U(X){return c[X.getMonth()]}function C(X){return l[X.getMonth()]}function Z(X){return a[+(X.getHours()>=12)]}function D(X){return 1+~~(X.getMonth()/3)}function P(X){return o[X.getUTCDay()]}function ie(X){return s[X.getUTCDay()]}function ve(X){return c[X.getUTCMonth()]}function pe(X){return l[X.getUTCMonth()]}function Te(X){return a[+(X.getUTCHours()>=12)]}function q(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var oe=b(X+="",S);return oe.toString=function(){return X},oe},parse:function(X){var oe=N(X+="",!1);return oe.toString=function(){return X},oe},utcFormat:function(X){var oe=b(X+="",j);return oe.toString=function(){return X},oe},utcParse:function(X){var oe=N(X+="",!0);return oe.toString=function(){return X},oe}}}var K1={"-":"",_:" ",0:"0"},nn=/^\s*\d+/,c7=/^%/,u7=/[\\^$*+?|[\]().{}]/g;function qe(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",s=a.length;return r+(s<n?new Array(n-s+1).join(t)+a:a)}function d7(e){return e.replace(u7,"\\$&")}function Jl(e){return new RegExp("^(?:"+e.map(d7).join("|")+")","i")}function ec(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function f7(e,t,n){var r=nn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function h7(e,t,n){var r=nn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function p7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function m7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function g7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function V1(e,t,n){var r=nn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Y1(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function v7(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function y7(e,t,n){var r=nn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function b7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function X1(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function x7(e,t,n){var r=nn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Q1(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function w7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function S7(e,t,n){var r=nn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function k7(e,t,n){var r=nn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function j7(e,t,n){var r=nn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function N7(e,t,n){var r=c7.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function E7(e,t,n){var r=nn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function _7(e,t,n){var r=nn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Z1(e,t){return qe(e.getDate(),t,2)}function A7(e,t){return qe(e.getHours(),t,2)}function C7(e,t){return qe(e.getHours()%12||12,t,2)}function T7(e,t){return qe(1+Zu.count(Da(e),e),t,3)}function cP(e,t){return qe(e.getMilliseconds(),t,3)}function O7(e,t){return cP(e,t)+"000"}function P7(e,t){return qe(e.getMonth()+1,t,2)}function R7(e,t){return qe(e.getMinutes(),t,2)}function M7(e,t){return qe(e.getSeconds(),t,2)}function I7(e){var t=e.getDay();return t===0?7:t}function $7(e,t){return qe(Vp.count(Da(e)-1,e),t,2)}function uP(e){var t=e.getDay();return t>=4||t===0?Go(e):Go.ceil(e)}function L7(e,t){return e=uP(e),qe(Go.count(Da(e),e)+(Da(e).getDay()===4),t,2)}function D7(e){return e.getDay()}function B7(e,t){return qe(bh.count(Da(e)-1,e),t,2)}function z7(e,t){return qe(e.getFullYear()%100,t,2)}function F7(e,t){return e=uP(e),qe(e.getFullYear()%100,t,2)}function U7(e,t){return qe(e.getFullYear()%1e4,t,4)}function W7(e,t){var n=e.getDay();return e=n>=4||n===0?Go(e):Go.ceil(e),qe(e.getFullYear()%1e4,t,4)}function H7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+qe(t/60|0,"0",2)+qe(t%60,"0",2)}function J1(e,t){return qe(e.getUTCDate(),t,2)}function G7(e,t){return qe(e.getUTCHours(),t,2)}function q7(e,t){return qe(e.getUTCHours()%12||12,t,2)}function K7(e,t){return qe(1+Kp.count(Ba(e),e),t,3)}function dP(e,t){return qe(e.getUTCMilliseconds(),t,3)}function V7(e,t){return dP(e,t)+"000"}function Y7(e,t){return qe(e.getUTCMonth()+1,t,2)}function X7(e,t){return qe(e.getUTCMinutes(),t,2)}function Q7(e,t){return qe(e.getUTCSeconds(),t,2)}function Z7(e){var t=e.getUTCDay();return t===0?7:t}function J7(e,t){return qe(Yp.count(Ba(e)-1,e),t,2)}function fP(e){var t=e.getUTCDay();return t>=4||t===0?qo(e):qo.ceil(e)}function eY(e,t){return e=fP(e),qe(qo.count(Ba(e),e)+(Ba(e).getUTCDay()===4),t,2)}function tY(e){return e.getUTCDay()}function nY(e,t){return qe(xh.count(Ba(e)-1,e),t,2)}function rY(e,t){return qe(e.getUTCFullYear()%100,t,2)}function aY(e,t){return e=fP(e),qe(e.getUTCFullYear()%100,t,2)}function iY(e,t){return qe(e.getUTCFullYear()%1e4,t,4)}function sY(e,t){var n=e.getUTCDay();return e=n>=4||n===0?qo(e):qo.ceil(e),qe(e.getUTCFullYear()%1e4,t,4)}function oY(){return"+0000"}function ej(){return"%"}function tj(e){return+e}function nj(e){return Math.floor(+e/1e3)}var Ks,hP,pP;lY({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lY(e){return Ks=l7(e),hP=Ks.format,Ks.parse,pP=Ks.utcFormat,Ks.utcParse,Ks}function cY(e){return new Date(e)}function uY(e){return e instanceof Date?+e:+new Date(+e)}function Tw(e,t,n,r,a,s,o,l,c,u){var d=gw(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),x=u("%b %d"),S=u("%B"),j=u("%Y");function w(b){return(c(b)<b?p:l(b)<b?g:o(b)<b?m:s(b)<b?y:r(b)<b?a(b)<b?v:x:n(b)<b?S:j)(b)}return d.invert=function(b){return new Date(f(b))},d.domain=function(b){return arguments.length?h(Array.from(b,uY)):h().map(cY)},d.ticks=function(b){var N=h();return e(N[0],N[N.length-1],b??10)},d.tickFormat=function(b,N){return N==null?w:u(N)},d.nice=function(b){var N=h();return(!b||typeof b.range!="function")&&(b=t(N[0],N[N.length-1],b??10)),b?h(eP(N,b)):d},d.copy=function(){return Qu(d,Tw(e,t,n,r,a,s,o,l,c,u))},d}function dY(){return Ar.apply(Tw(s7,o7,Da,Aw,Vp,Zu,Ew,jw,is,hP).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function fY(){return Ar.apply(Tw(a7,i7,Ba,Cw,Yp,Kp,_w,Nw,is,pP).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Xp(){var e=0,t=1,n,r,a,s,o=Mn,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(a===0?.5:(f=(s(f)-n)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=s(e=+e),r=s(t=+t),a=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(h){var p,g;return arguments.length?([p,g]=h,o=f(p,g),u):[o(0),o(1)]}}return u.range=d(wl),u.rangeRound=d(mw),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return s=f,n=f(e),r=f(t),a=n===r?0:1/(r-n),u}}function Ii(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function mP(){var e=Mi(Xp()(Mn));return e.copy=function(){return Ii(e,mP())},Ha.apply(e,arguments)}function gP(){var e=bw(Xp()).domain([1,10]);return e.copy=function(){return Ii(e,gP()).base(e.base())},Ha.apply(e,arguments)}function vP(){var e=xw(Xp());return e.copy=function(){return Ii(e,vP()).constant(e.constant())},Ha.apply(e,arguments)}function Ow(){var e=ww(Xp());return e.copy=function(){return Ii(e,Ow()).exponent(e.exponent())},Ha.apply(e,arguments)}function hY(){return Ow.apply(null,arguments).exponent(.5)}function yP(){var e=[],t=Mn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Yu(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(ki),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,s)=>JK(e,s/r))},n.copy=function(){return yP(t).domain(e)},Ha.apply(n,arguments)}function Qp(){var e=0,t=.5,n=1,r=1,a,s,o,l,c,u=Mn,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-s)*(r*m<r*s?l:c),u(f?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,n]=m,a=d(e=+e),s=d(t=+t),o=d(n=+n),l=a===s?0:.5/(s-a),c=s===o?0:.5/(o-s),r=s<a?-1:1,p):[e,t,n]},p.clamp=function(m){return arguments.length?(f=!!m,p):f},p.interpolator=function(m){return arguments.length?(u=m,p):u};function g(m){return function(y){var v,x,S;return arguments.length?([v,x,S]=y,u=NV(m,[v,x,S]),p):[u(0),u(.5),u(1)]}}return p.range=g(wl),p.rangeRound=g(mw),p.unknown=function(m){return arguments.length?(h=m,p):h},function(m){return d=m,a=m(e),s=m(t),o=m(n),l=a===s?0:.5/(s-a),c=s===o?0:.5/(o-s),r=s<a?-1:1,p}}function bP(){var e=Mi(Qp()(Mn));return e.copy=function(){return Ii(e,bP())},Ha.apply(e,arguments)}function xP(){var e=bw(Qp()).domain([.1,1,10]);return e.copy=function(){return Ii(e,xP()).base(e.base())},Ha.apply(e,arguments)}function wP(){var e=xw(Qp());return e.copy=function(){return Ii(e,wP()).constant(e.constant())},Ha.apply(e,arguments)}function Pw(){var e=ww(Qp());return e.copy=function(){return Ii(e,Pw()).exponent(e.exponent())},Ha.apply(e,arguments)}function pY(){return Pw.apply(null,arguments).exponent(.5)}const rj=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:lu,scaleDiverging:bP,scaleDivergingLog:xP,scaleDivergingPow:Pw,scaleDivergingSqrt:pY,scaleDivergingSymlog:wP,scaleIdentity:JO,scaleImplicit:Py,scaleLinear:vh,scaleLog:tP,scaleOrdinal:fw,scalePoint:_c,scalePow:Sw,scaleQuantile:aP,scaleQuantize:iP,scaleRadial:rP,scaleSequential:mP,scaleSequentialLog:gP,scaleSequentialPow:Ow,scaleSequentialQuantile:yP,scaleSequentialSqrt:hY,scaleSequentialSymlog:vP,scaleSqrt:VV,scaleSymlog:nP,scaleThreshold:sP,scaleTime:dY,scaleUtc:fY,tickFormat:ZO},Symbol.toStringTag,{value:"Module"}));var mY=hl;function gY(e,t,n){for(var r=-1,a=e.length;++r<a;){var s=e[r],o=t(s);if(o!=null&&(l===void 0?o===o&&!mY(o):n(o,l)))var l=o,c=s}return c}var SP=gY;function vY(e,t){return e>t}var yY=vY,bY=SP,xY=yY,wY=xl;function SY(e){return e&&e.length?bY(e,wY,xY):void 0}var kY=SY;const Zp=Qe(kY);function jY(e,t){return e<t}var NY=jY,EY=SP,_Y=NY,AY=xl;function CY(e){return e&&e.length?EY(e,AY,_Y):void 0}var TY=CY;const Jp=Qe(TY);var OY=qx,PY=Ri,RY=PO,MY=qn;function IY(e,t){var n=MY(e)?OY:RY;return n(e,PY(t))}var $Y=IY,LY=TO,DY=$Y;function BY(e,t){return LY(DY(e,t),1)}var zY=BY;const FY=Qe(zY);var UY=ow;function WY(e,t){return UY(e,t)}var HY=WY;const Rw=Qe(HY);var Sl=1e9,GY={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Iw,St=!0,Er="[DecimalError] ",fs=Er+"Invalid argument: ",Mw=Er+"Exponent out of range: ",kl=Math.floor,Yi=Math.pow,qY=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,tr,Qt=1e7,mt=7,kP=9007199254740991,wh=kl(kP/mt),be={};be.absoluteValue=be.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};be.comparedTo=be.cmp=function(e){var t,n,r,a,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===a?0:r>a^s.s<0?1:-1};be.decimalPlaces=be.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*mt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};be.dividedBy=be.div=function(e){return Pa(this,new this.constructor(e))};be.dividedToIntegerBy=be.idiv=function(e){var t=this,n=t.constructor;return it(Pa(t,new n(e),0,1),n.precision)};be.equals=be.eq=function(e){return!this.cmp(e)};be.exponent=function(){return Bt(this)};be.greaterThan=be.gt=function(e){return this.cmp(e)>0};be.greaterThanOrEqualTo=be.gte=function(e){return this.cmp(e)>=0};be.isInteger=be.isint=function(){return this.e>this.d.length-2};be.isNegative=be.isneg=function(){return this.s<0};be.isPositive=be.ispos=function(){return this.s>0};be.isZero=function(){return this.s===0};be.lessThan=be.lt=function(e){return this.cmp(e)<0};be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1};be.logarithm=be.log=function(e){var t,n=this,r=n.constructor,a=r.precision,s=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(tr))throw Error(Er+"NaN");if(n.s<1)throw Error(Er+(n.s?"NaN":"-Infinity"));return n.eq(tr)?new r(0):(St=!1,t=Pa(hu(n,s),hu(e,s),s),St=!0,it(t,a))};be.minus=be.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?EP(t,e):jP(t,(e.s=-e.s,e))};be.modulo=be.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Er+"NaN");return n.s?(St=!1,t=Pa(n,e,0,1).times(e),St=!0,n.minus(t)):it(new r(n),a)};be.naturalExponential=be.exp=function(){return NP(this)};be.naturalLogarithm=be.ln=function(){return hu(this)};be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};be.plus=be.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?jP(t,e):EP(t,(e.s=-e.s,e))};be.precision=be.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(fs+e);if(t=Bt(a)+1,r=a.d.length-1,n=r*mt+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};be.squareRoot=be.sqrt=function(){var e,t,n,r,a,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Er+"NaN")}for(e=Bt(l),St=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=aa(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=kl((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(a.toString()),n=c.precision,a=o=n+3;;)if(s=r,r=s.plus(Pa(l,s,o+2)).times(.5),aa(s.d).slice(0,o)===(t=aa(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(it(s,n+1,0),s.times(s).eq(l)){r=s;break}}else if(t!="9999")break;o+=4}return St=!0,it(r,n)};be.times=be.mul=function(e){var t,n,r,a,s,o,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=p.length,c<u&&(s=h,h=p,p=s,o=c,c=u,u=o),s=[],o=c+u,r=o;r--;)s.push(0);for(r=u;--r>=0;){for(t=0,a=c+r;a>r;)l=s[a]+p[r]*h[a-r-1]+t,s[a--]=l%Qt|0,t=l/Qt|0;s[a]=(s[a]+t)%Qt|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,St?it(e,f.precision):e};be.toDecimalPlaces=be.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ca(e,0,Sl),t===void 0?t=r.rounding:ca(t,0,8),it(n,e+Bt(n)+1,t))};be.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=ks(r,!0):(ca(e,0,Sl),t===void 0?t=a.rounding:ca(t,0,8),r=it(new a(r),e+1,t),n=ks(r,!0,e+1)),n};be.toFixed=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?ks(a):(ca(e,0,Sl),t===void 0?t=s.rounding:ca(t,0,8),r=it(new s(a),e+Bt(a)+1,t),n=ks(r.abs(),!1,e+Bt(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};be.toInteger=be.toint=function(){var e=this,t=e.constructor;return it(new t(e),Bt(e)+1,t.rounding)};be.toNumber=function(){return+this};be.toPower=be.pow=function(e){var t,n,r,a,s,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(tr);if(l=new c(l),!l.s){if(e.s<1)throw Error(Er+"Infinity");return l}if(l.eq(tr))return l;if(r=c.precision,e.eq(tr))return it(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,s=l.s,o){if((n=d<0?-d:d)<=kP){for(a=new c(tr),t=Math.ceil(r/mt+4),St=!1;n%2&&(a=a.times(l),ij(a.d,t)),n=kl(n/2),n!==0;)l=l.times(l),ij(l.d,t);return St=!0,e.s<0?new c(tr).div(a):it(a,r)}}else if(s<0)throw Error(Er+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,St=!1,a=e.times(hu(l,r+u)),St=!0,a=NP(a),a.s=s,a};be.toPrecision=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?(n=Bt(a),r=ks(a,n<=s.toExpNeg||n>=s.toExpPos)):(ca(e,1,Sl),t===void 0?t=s.rounding:ca(t,0,8),a=it(new s(a),e,t),n=Bt(a),r=ks(a,e<=n||n<=s.toExpNeg,e)),r};be.toSignificantDigits=be.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ca(e,1,Sl),t===void 0?t=r.rounding:ca(t,0,8)),it(new r(n),e,t)};be.toString=be.valueOf=be.val=be.toJSON=be[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Bt(e),n=e.constructor;return ks(e,t<=n.toExpNeg||t>=n.toExpPos)};function jP(e,t){var n,r,a,s,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),St?it(t,f):t;if(c=e.d,u=t.d,o=e.e,a=t.e,c=c.slice(),s=o-a,s){for(s<0?(r=c,s=-s,l=u.length):(r=u,a=o,l=c.length),o=Math.ceil(f/mt),l=o>l?o+1:l+1,s>l&&(s=l,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(l=c.length,s=u.length,l-s<0&&(s=l,r=u,u=c,c=r),n=0;s;)n=(c[--s]=c[s]+u[s]+n)/Qt|0,c[s]%=Qt;for(n&&(c.unshift(n),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,St?it(t,f):t}function ca(e,t,n){if(e!==~~e||e<t||e>n)throw Error(fs+e)}function aa(e){var t,n,r,a=e.length-1,s="",o=e[0];if(a>0){for(s+=o,t=1;t<a;t++)r=e[t]+"",n=mt-r.length,n&&(s+=ri(n)),s+=r;o=e[t],r=o+"",n=mt-r.length,n&&(s+=ri(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}var Pa=function(){function e(r,a){var s,o=0,l=r.length;for(r=r.slice();l--;)s=r[l]*a+o,r[l]=s%Qt|0,o=s/Qt|0;return o&&r.unshift(o),r}function t(r,a,s,o){var l,c;if(s!=o)c=s>o?1:-1;else for(l=c=0;l<s;l++)if(r[l]!=a[l]){c=r[l]>a[l]?1:-1;break}return c}function n(r,a,s){for(var o=0;s--;)r[s]-=o,o=r[s]<a[s]?1:0,r[s]=o*Qt+r[s]-a[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,s,o){var l,c,u,d,f,h,p,g,m,y,v,x,S,j,w,b,N,E,T=r.constructor,A=r.s==a.s?1:-1,M=r.d,R=a.d;if(!r.s)return new T(r);if(!a.s)throw Error(Er+"Division by zero");for(c=r.e-a.e,N=R.length,w=M.length,p=new T(A),g=p.d=[],u=0;R[u]==(M[u]||0);)++u;if(R[u]>(M[u]||0)&&--c,s==null?x=s=T.precision:o?x=s+(Bt(r)-Bt(a))+1:x=s,x<0)return new T(0);if(x=x/mt+2|0,u=0,N==1)for(d=0,R=R[0],x++;(u<w||d)&&x--;u++)S=d*Qt+(M[u]||0),g[u]=S/R|0,d=S%R|0;else{for(d=Qt/(R[0]+1)|0,d>1&&(R=e(R,d),M=e(M,d),N=R.length,w=M.length),j=N,m=M.slice(0,N),y=m.length;y<N;)m[y++]=0;E=R.slice(),E.unshift(0),b=R[0],R[1]>=Qt/2&&++b;do d=0,l=t(R,m,N,y),l<0?(v=m[0],N!=y&&(v=v*Qt+(m[1]||0)),d=v/b|0,d>1?(d>=Qt&&(d=Qt-1),f=e(R,d),h=f.length,y=m.length,l=t(f,m,h,y),l==1&&(d--,n(f,N<h?E:R,h))):(d==0&&(l=d=1),f=R.slice()),h=f.length,h<y&&f.unshift(0),n(m,f,y),l==-1&&(y=m.length,l=t(R,m,N,y),l<1&&(d++,n(m,N<y?E:R,y))),y=m.length):l===0&&(d++,m=[0]),g[u++]=d,l&&m[0]?m[y++]=M[j]||0:(m=[M[j]],y=1);while((j++<w||m[0]!==void 0)&&x--)}return g[0]||g.shift(),p.e=c,it(p,o?s+Bt(p)+1:s)}}();function NP(e,t){var n,r,a,s,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Bt(e)>16)throw Error(Mw+Bt(e));if(!e.s)return new d(tr);for(St=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Yi(2,u))/Math.LN10*2+5|0,l+=r,n=a=s=new d(tr),d.precision=l;;){if(a=it(a.times(e),l),n=n.times(++c),o=s.plus(Pa(a,n,l)),aa(o.d).slice(0,l)===aa(s.d).slice(0,l)){for(;u--;)s=it(s.times(s),l);return d.precision=f,t==null?(St=!0,it(s,f)):s}s=o}}function Bt(e){for(var t=e.e*mt,n=e.d[0];n>=10;n/=10)t++;return t}function gg(e,t,n){if(t>e.LN10.sd())throw St=!0,n&&(e.precision=n),Error(Er+"LN10 precision limit exceeded");return it(new e(e.LN10),t)}function ri(e){for(var t="";e--;)t+="0";return t}function hu(e,t){var n,r,a,s,o,l,c,u,d,f=1,h=10,p=e,g=p.d,m=p.constructor,y=m.precision;if(p.s<1)throw Error(Er+(p.s?"NaN":"-Infinity"));if(p.eq(tr))return new m(0);if(t==null?(St=!1,u=y):u=t,p.eq(10))return t==null&&(St=!0),gg(m,u);if(u+=h,m.precision=u,n=aa(g),r=n.charAt(0),s=Bt(p),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=aa(p.d),r=n.charAt(0),f++;s=Bt(p),r>1?(p=new m("0."+n),s++):p=new m(r+"."+n.slice(1))}else return c=gg(m,u+2,y).times(s+""),p=hu(new m(r+"."+n.slice(1)),u-h).plus(c),m.precision=y,t==null?(St=!0,it(p,y)):p;for(l=o=p=Pa(p.minus(tr),p.plus(tr),u),d=it(p.times(p),u),a=3;;){if(o=it(o.times(d),u),c=l.plus(Pa(o,new m(a),u)),aa(c.d).slice(0,u)===aa(l.d).slice(0,u))return l=l.times(2),s!==0&&(l=l.plus(gg(m,u+2,y).times(s+""))),l=Pa(l,new m(f),u),m.precision=y,t==null?(St=!0,it(l,y)):l;l=c,a+=2}}function aj(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=kl(n/mt),e.d=[],r=(n+1)%mt,n<0&&(r+=mt),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=mt;r<a;)e.d.push(+t.slice(r,r+=mt));t=t.slice(r),r=mt-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),St&&(e.e>wh||e.e<-wh))throw Error(Mw+n)}else e.s=0,e.e=0,e.d=[0];return e}function it(e,t,n){var r,a,s,o,l,c,u,d,f=e.d;for(o=1,s=f[0];s>=10;s/=10)o++;if(r=t-o,r<0)r+=mt,a=t,u=f[d=0];else{if(d=Math.ceil((r+1)/mt),s=f.length,d>=s)return e;for(u=s=f[d],o=1;s>=10;s/=10)o++;r%=mt,a=r-mt+o}if(n!==void 0&&(s=Yi(10,o-a-1),l=u/s%10|0,c=t<0||f[d+1]!==void 0||u%s,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?a>0?u/Yi(10,o-a):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(s=Bt(e),f.length=1,t=t-s-1,f[0]=Yi(10,(mt-t%mt)%mt),e.e=kl(-t/mt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,s=1,d--):(f.length=d+1,s=Yi(10,mt-r),f[d]=a>0?(u/Yi(10,o-a)%Yi(10,a)|0)*s:0),c)for(;;)if(d==0){(f[0]+=s)==Qt&&(f[0]=1,++e.e);break}else{if(f[d]+=s,f[d]!=Qt)break;f[d--]=0,s=1}for(r=f.length;f[--r]===0;)f.pop();if(St&&(e.e>wh||e.e<-wh))throw Error(Mw+Bt(e));return e}function EP(e,t){var n,r,a,s,o,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),St?it(t,p):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),a=Math.max(Math.ceil(p/mt),l)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=c.length,l=f.length,d=a<l,d&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>o;){if(c[--a]<f[a]){for(s=a;s&&c[--s]===0;)c[s]=Qt-1;--c[s],c[a]+=Qt}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,St?it(t,p):t):new h(0)}function ks(e,t,n){var r,a=Bt(e),s=aa(e.d),o=s.length;return t?(n&&(r=n-o)>0?s=s.charAt(0)+"."+s.slice(1)+ri(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(a<0?"e":"e+")+a):a<0?(s="0."+ri(-a-1)+s,n&&(r=n-o)>0&&(s+=ri(r))):a>=o?(s+=ri(a+1-o),n&&(r=n-a-1)>0&&(s=s+"."+ri(r))):((r=a+1)<o&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(s+="."),s+=ri(r))),e.s<0?"-"+s:s}function ij(e,t){if(e.length>t)return e.length=t,!0}function _P(e){var t,n,r;function a(s){var o=this;if(!(o instanceof a))return new a(s);if(o.constructor=a,s instanceof a){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(fs+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return aj(o,s.toString())}else if(typeof s!="string")throw Error(fs+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,qY.test(s))aj(o,s);else throw Error(fs+s)}if(a.prototype=be,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=_P,a.config=a.set=KY,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return a.config(e),a}function KY(e){if(!e||typeof e!="object")throw Error(Er+"Object expected");var t,n,r,a=["precision",1,Sl,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(kl(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(fs+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(fs+n+": "+r);return this}var Iw=_P(GY);tr=new Iw(1);const rt=Iw;function VY(e){return ZY(e)||QY(e)||XY(e)||YY()}function YY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
87
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XY(e,t){if(e){if(typeof e=="string")return $y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $y(e,t)}}function QY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function ZY(e){if(Array.isArray(e))return $y(e)}function $y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var JY=function(t){return t},AP={},CP=function(t){return t===AP},sj=function(t){return function n(){return arguments.length===0||arguments.length===1&&CP(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},eX=function e(t,n){return t===1?n:sj(function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];var o=a.filter(function(l){return l!==AP}).length;return o>=t?n.apply(void 0,a):e(t-o,sj(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=a.map(function(f){return CP(f)?c.shift():f});return n.apply(void 0,VY(d).concat(c))}))})},em=function(t){return eX(t.length,t)},Ly=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},tX=em(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),nX=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return JY;var a=n.reverse(),s=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},s.apply(void 0,arguments))}},Dy=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},TP=function(t){var n=null,r=null;return function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return n&&s.every(function(l,c){return l===n[c]})||(n=s,r=t.apply(void 0,s)),r}};function rX(e){var t;return e===0?t=1:t=Math.floor(new rt(e).abs().log(10).toNumber())+1,t}function aX(e,t,n){for(var r=new rt(e),a=0,s=[];r.lt(t)&&a<1e5;)s.push(r.toNumber()),r=r.add(n),a++;return s}var iX=em(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),sX=em(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),oX=em(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const tm={rangeStep:aX,getDigitCount:rX,interpolateNumber:iX,uninterpolateNumber:sX,uninterpolateTruncation:oX};function By(e){return uX(e)||cX(e)||OP(e)||lX()}function lX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
88
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cX(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function uX(e){if(Array.isArray(e))return zy(e)}function pu(e,t){return hX(e)||fX(e,t)||OP(e,t)||dX()}function dX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
89
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OP(e,t){if(e){if(typeof e=="string")return zy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zy(e,t)}}function zy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fX(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,s=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){a=!0,s=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw s}}return n}}function hX(e){if(Array.isArray(e))return e}function PP(e){var t=pu(e,2),n=t[0],r=t[1],a=n,s=r;return n>r&&(a=r,s=n),[a,s]}function RP(e,t,n){if(e.lte(0))return new rt(0);var r=tm.getDigitCount(e.toNumber()),a=new rt(10).pow(r),s=e.div(a),o=r!==1?.05:.1,l=new rt(Math.ceil(s.div(o).toNumber())).add(n).mul(o),c=l.mul(a);return t?c:new rt(Math.ceil(c))}function pX(e,t,n){var r=1,a=new rt(e);if(!a.isint()&&n){var s=Math.abs(e);s<1?(r=new rt(10).pow(tm.getDigitCount(e)-1),a=new rt(Math.floor(a.div(r).toNumber())).mul(r)):s>1&&(a=new rt(Math.floor(e)))}else e===0?a=new rt(Math.floor((t-1)/2)):n||(a=new rt(Math.floor(e)));var o=Math.floor((t-1)/2),l=nX(tX(function(c){return a.add(new rt(c-o).mul(r)).toNumber()}),Ly);return l(0,t)}function MP(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new rt(0),tickMin:new rt(0),tickMax:new rt(0)};var s=RP(new rt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new rt(0):(o=new rt(e).add(t).div(2),o=o.sub(new rt(o).mod(s)));var l=Math.ceil(o.sub(e).div(s).toNumber()),c=Math.ceil(new rt(t).sub(o).div(s).toNumber()),u=l+c+1;return u>n?MP(e,t,n,r,a+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:s,tickMin:o.sub(new rt(l).mul(s)),tickMax:o.add(new rt(c).mul(s))})}function mX(e){var t=pu(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=PP([n,r]),c=pu(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(By(Ly(0,a-1).map(function(){return 1/0}))):[].concat(By(Ly(0,a-1).map(function(){return-1/0})),[d]);return n>r?Dy(f):f}if(u===d)return pX(u,a,s);var h=MP(u,d,o,s),p=h.step,g=h.tickMin,m=h.tickMax,y=tm.rangeStep(g,m.add(new rt(.1).mul(p)),p);return n>r?Dy(y):y}function gX(e,t){var n=pu(e,2),r=n[0],a=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=PP([r,a]),l=pu(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,a];if(c===u)return[c];var d=Math.max(t,2),f=RP(new rt(u).sub(c).div(d-1),s,0),h=[].concat(By(tm.rangeStep(new rt(c),new rt(u).sub(new rt(.99).mul(f)),f)),[u]);return r>a?Dy(h):h}var vX=TP(mX),yX=TP(gX),bX="Invariant failed";function js(e,t){throw new Error(bX)}var xX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ko(e){"@babel/helpers - typeof";return Ko=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ko(e)}function Sh(){return Sh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sh.apply(this,arguments)}function wX(e,t){return NX(e)||jX(e,t)||kX(e,t)||SX()}function SX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
90
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kX(e,t){if(e){if(typeof e=="string")return oj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oj(e,t)}}function oj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jX(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function NX(e){if(Array.isArray(e))return e}function EX(e,t){if(e==null)return{};var n=_X(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _X(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function AX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LP(r.key),r)}}function TX(e,t,n){return t&&CX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function OX(e,t,n){return t=kh(t),PX(e,IP()?Reflect.construct(t,n||[],kh(e).constructor):t.apply(e,n))}function PX(e,t){if(t&&(Ko(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return RX(e)}function RX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IP=function(){return!!e})()}function kh(e){return kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kh(e)}function MX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fy(e,t)}function Fy(e,t){return Fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Fy(e,t)}function $P(e,t,n){return t=LP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LP(e){var t=IX(e,"string");return Ko(t)=="symbol"?t:t+""}function IX(e,t){if(Ko(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ko(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var nm=function(e){function t(){return AX(this,t),OX(this,t,arguments)}return MX(t,e),TX(t,[{key:"render",value:function(){var r=this.props,a=r.offset,s=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,h=EX(r,xX),p=Ke(h,!1);this.props.direction==="x"&&d.type!=="number"&&js();var g=c.map(function(m){var y=u(m,l),v=y.x,x=y.y,S=y.value,j=y.errorVal;if(!j)return null;var w=[],b,N;if(Array.isArray(j)){var E=wX(j,2);b=E[0],N=E[1]}else b=N=j;if(s==="vertical"){var T=d.scale,A=x+a,M=A+o,R=A-o,B=T(S-b),L=T(S+N);w.push({x1:L,y1:M,x2:L,y2:R}),w.push({x1:B,y1:A,x2:L,y2:A}),w.push({x1:B,y1:M,x2:B,y2:R})}else if(s==="horizontal"){var F=f.scale,z=v+a,$=z-o,O=z+o,U=F(S-b),C=F(S+N);w.push({x1:$,y1:C,x2:O,y2:C}),w.push({x1:z,y1:U,x2:z,y2:C}),w.push({x1:$,y1:U,x2:O,y2:U})}return G.createElement(en,Sh({className:"recharts-errorBar",key:"bar-".concat(w.map(function(Z){return"".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))},p),w.map(function(Z){return G.createElement("line",Sh({},Z,{key:"line-".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))}))});return G.createElement(en,{className:"recharts-errorBars"},g)}}])}(G.Component);$P(nm,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});$P(nm,"displayName","ErrorBar");function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function lj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Fi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lj(Object(n),!0).forEach(function(r){$X(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $X(e,t,n){return t=LX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LX(e){var t=DX(e,"string");return mu(t)=="symbol"?t:t+""}function DX(e,t){if(mu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DP=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,s=t.legendContent,o=er(n,us);if(!o)return null;var l=us.defaultProps,c=l!==void 0?Fi(Fi({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:s==="children"?u=(r||[]).reduce(function(d,f){var h=f.item,p=f.props,g=p.sectors||p.data||[];return d.concat(g.map(function(m){return{type:o.props.iconType||h.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?Fi(Fi({},h),f.props):{},g=p.dataKey,m=p.name,y=p.legendType,v=p.hide;return{inactive:v,dataKey:g,type:c.iconType||y||"square",color:$w(f),value:m||g,payload:p}}),Fi(Fi(Fi({},c),us.getWithHeight(o,a)),{},{payload:u,item:o})};function gu(e){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gu(e)}function cj(e){return UX(e)||FX(e)||zX(e)||BX()}function BX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
91
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zX(e,t){if(e){if(typeof e=="string")return Uy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uy(e,t)}}function FX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UX(e){if(Array.isArray(e))return Uy(e)}function Uy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uj(Object(n),!0).forEach(function(r){Co(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Co(e,t,n){return t=WX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WX(e){var t=HX(e,"string");return gu(t)=="symbol"?t:t+""}function HX(e,t){if(gu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ua(e,t,n){return Ye(e)||Ye(t)?n:Yt(t)?kr(e,t,n):Le(t)?t(e):n}function Ac(e,t,n,r){var a=FY(e,function(l){return ua(l,t)});if(n==="number"){var s=a.filter(function(l){return fe(l)||parseFloat(l)});return s.length?[Jp(s),Zp(s)]:[1/0,-1/0]}var o=r?a.filter(function(l){return!Ye(l)}):a;return o.map(function(l){return Yt(l)||l instanceof Date?l:""})}var GX=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<l;u++){var d=u>0?a[u-1].coordinate:a[l-1].coordinate,f=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,p=void 0;if(zr(f-d)!==zr(h-f)){var g=[];if(zr(h-f)===zr(c[1]-c[0])){p=h;var m=f+c[1]-c[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var y=h+c[1]-c[0];g[0]=Math.min(f,(y+f)/2),g[1]=Math.max(f,(y+f)/2)}var v=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>v[0]&&t<=v[1]||t>=g[0]&&t<=g[1]){o=a[u].index;break}}else{var x=Math.min(d,h),S=Math.max(d,h);if(t>(x+f)/2&&t<=(S+f)/2){o=a[u].index;break}}}else for(var j=0;j<l;j++)if(j===0&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j>0&&j<l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j===l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2){o=r[j].index;break}return o},$w=function(t){var n,r=t,a=r.type.displayName,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,o=s.stroke,l=s.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},qX=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,s=a===void 0?{}:a;if(!s)return{};for(var o={},l=Object.keys(s),c=0,u=l.length;c<u;c++)for(var d=s[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var g=d[f[h]],m=g.items,y=g.cateAxisId,v=m.filter(function(N){return Ta(N.type).indexOf("Bar")>=0});if(v&&v.length){var x=v[0].type.defaultProps,S=x!==void 0?Pt(Pt({},x),v[0].props):v[0].props,j=S.barSize,w=S[y];o[w]||(o[w]=[]);var b=Ye(j)?n:j;o[w].push({item:v[0],stackList:v.slice(1),barSize:Ye(b)?void 0:Ss(b,r,0)})}}return o},KX=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,s=t.sizeList,o=s===void 0?[]:s,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=Ss(n,a,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=a/c,g=o.reduce(function(j,w){return j+w.barSize||0},0);g+=(c-1)*u,g>=a&&(g-=(c-1)*u,u=0),g>=a&&p>0&&(h=!0,p*=.9,g=c*p);var m=(a-g)/2>>0,y={offset:m-u,size:0};d=o.reduce(function(j,w){var b={item:w.item,position:{offset:y.offset+y.size+u,size:h?p:w.barSize}},N=[].concat(cj(j),[b]);return y=N[N.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(E){N.push({item:E,position:y})}),N},f)}else{var v=Ss(r,a,0,!0);a-2*v-(c-1)*u<=0&&(u=0);var x=(a-2*v-(c-1)*u)/c;x>1&&(x>>=0);var S=l===+l?Math.min(x,l):x;d=o.reduce(function(j,w,b){var N=[].concat(cj(j),[{item:w.item,position:{offset:v+(x+u)*b+(x-S)/2,size:S}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(E){N.push({item:E,position:N[N.length-1].position})}),N},f)}return d},VX=function(t,n,r,a){var s=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=DP({children:s,legendWidth:c});if(u){var d=a||{},f=d.width,h=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&fe(t[p]))return Pt(Pt({},t),{},Co({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&fe(t[g]))return Pt(Pt({},t),{},Co({},g,t[g]+(h||0)))}return t},YX=function(t,n,r){return Ye(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},BP=function(t,n,r,a,s){var o=n.props.children,l=Wr(o,nm).filter(function(u){return YX(a,s,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=ua(d,r);if(Ye(f))return u;var h=Array.isArray(f)?[Jp(f),Zp(f)]:[f,f],p=c.reduce(function(g,m){var y=ua(d,m,0),v=h[0]-Math.abs(Array.isArray(y)?y[0]:y),x=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(v,g[0]),Math.max(x,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},XX=function(t,n,r,a,s){var o=n.map(function(l){return BP(t,l,r,s,a)}).filter(function(l){return!Ye(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},zP=function(t,n,r,a,s){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&BP(t,c,u,a)||Ac(t,u,r,s)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},FP=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},UP=function(t,n,r,a){if(a)return t.map(function(c){return c.coordinate});var s,o,l=t.map(function(c){return c.coordinate===n&&(s=!0),c.coordinate===r&&(o=!0),c.coordinate});return s||l.push(n),o||l.push(r),l},Aa=function(t,n,r){if(!t)return null;var a=t.scale,s=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(n||r)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?zr(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=s?s.indexOf(f):f;return{coordinate:a(h)+u,value:f,offset:u}});return d.filter(function(f){return!qu(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:a(f)+u,value:f,index:h,offset:u}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,h){return{coordinate:a(f)+u,value:s?s[f]:f,index:h,offset:u}})},vg=new WeakMap,Bd=function(t,n){if(typeof n!="function")return t;vg.has(t)||vg.set(t,new WeakMap);var r=vg.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},QX=function(t,n,r){var a=t.scale,s=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:lu(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:vh(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:_c(),realScaleType:"point"}:s==="category"?{scale:lu(),realScaleType:"band"}:{scale:vh(),realScaleType:"linear"};if(ws(a)){var c="scale".concat(Bp(a));return{scale:(rj[c]||_c)(),realScaleType:rj[c]?c:"point"}}return Le(a)?{scale:a}:{scale:_c(),realScaleType:"point"}},dj=1e-4,ZX=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),s=Math.min(a[0],a[1])-dj,o=Math.max(a[0],a[1])+dj,l=t(n[0]),c=t(n[r-1]);(l<s||l>o||c<s||c>o)&&t.domain([n[0],n[r-1]])}},JX=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},eQ=function(t,n){if(!n||n.length!==2||!fe(n[0])||!fe(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),s=[t[0],t[1]];return(!fe(t[0])||t[0]<r)&&(s[0]=r),(!fe(t[1])||t[1]>a)&&(s[1]=a),s[0]>a&&(s[0]=a),s[1]<r&&(s[1]=r),s},tQ=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var s=0,o=0,l=0;l<n;++l){var c=qu(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=s,t[l][r][1]=s+c,s=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},nQ=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var s=0,o=0;o<n;++o){var l=qu(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=s,t[o][r][1]=s+l,s=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},rQ={sign:tQ,expand:y4,none:Bo,silhouette:b4,wiggle:x4,positive:nQ},aQ=function(t,n,r){var a=n.map(function(l){return l.props.dataKey}),s=rQ[r],o=v4().keys(a).value(function(l,c){return+ua(l,c,0)}).order(hy).offset(s);return o(t)},iQ=function(t,n,r,a,s,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Pt(Pt({},h.type.defaultProps),h.props):h.props,m=g.stackId,y=g.hide;if(y)return f;var v=g[r],x=f[v]||{hasStack:!1,stackGroups:{}};if(Yt(m)){var S=x.stackGroups[m]||{numericAxisId:r,cateAxisId:a,items:[]};S.items.push(h),x.hasStack=!0,x.stackGroups[m]=S}else x.stackGroups[Dp("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[h]};return Pt(Pt({},f),{},Co({},v,x))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,y){var v=p.stackGroups[y];return Pt(Pt({},m),{},Co({},y,{numericAxisId:r,cateAxisId:a,items:v.items,stackedData:aQ(t,v.items,s)}))},g)}return Pt(Pt({},f),{},Co({},h,p))},d)},sQ=function(t,n){var r=n.realScaleType,a=n.type,s=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=vX(u,s,l);return t.domain([Jp(d),Zp(d)]),{niceTicks:d}}if(s&&a==="number"){var f=t.domain(),h=yX(f,s,l);return{niceTicks:h}}return null},fj=function(t){var n=t.axis,r=t.ticks,a=t.offset,s=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+a:null;var c=ua(o,n.dataKey,n.domain[l]);return Ye(c)?null:n.scale(c)-s/2+a},oQ=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return a<=0&&s>=0?0:s<0?s:a}return r[0]},lQ=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,s=a.stackId;if(Yt(s)){var o=n[s];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},cQ=function(t){return t.reduce(function(n,r){return[Jp(r.concat([n[0]]).filter(fe)),Zp(r.concat([n[1]]).filter(fe))]},[1/0,-1/0])},WP=function(t,n,r){return Object.keys(t).reduce(function(a,s){var o=t[s],l=o.stackedData,c=l.reduce(function(u,d){var f=cQ(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},hj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Wy=function(t,n,r){if(Le(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(fe(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(hj.test(t[0])){var s=+hj.exec(t[0])[1];a[0]=n[0]-s}else Le(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(fe(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(pj.test(t[1])){var o=+pj.exec(t[1])[1];a[1]=n[1]+o}else Le(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},jh=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var s=cw(n,function(f){return f.coordinate}),o=1/0,l=1,c=s.length;l<c;l++){var u=s[l],d=s[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},mj=function(t,n,r){return!t||!t.length||Rw(t,kr(r,"type.defaultProps.domain"))?n:t},HP=function(t,n){var r=t.type.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,a=r.dataKey,s=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return Pt(Pt({},Ke(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:s||a,color:$w(t),value:ua(n,a),type:c,payload:n,chartType:u,hide:d})};function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function gj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gj(Object(n),!0).forEach(function(r){uQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uQ(e,t,n){return t=dQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dQ(e){var t=fQ(e,"string");return vu(t)=="symbol"?t:t+""}function fQ(e,t){if(vu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nh=Math.PI/180,hQ=function(t){return t*180/Math.PI},hn=function(t,n,r,a){return{x:t+Math.cos(-Nh*a)*r,y:n+Math.sin(-Nh*a)*r}},pQ=function(t,n){var r=t.x,a=t.y,s=n.x,o=n.y;return Math.sqrt(Math.pow(r-s,2)+Math.pow(a-o,2))},mQ=function(t,n){var r=t.x,a=t.y,s=n.cx,o=n.cy,l=pQ({x:r,y:a},{x:s,y:o});if(l<=0)return{radius:l};var c=(r-s)/l,u=Math.acos(c);return a>o&&(u=2*Math.PI-u),{radius:l,angle:hQ(u),angleInRadian:u}},gQ=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),s=Math.floor(r/360),o=Math.min(a,s);return{startAngle:n-o*360,endAngle:r-o*360}},vQ=function(t,n){var r=n.startAngle,a=n.endAngle,s=Math.floor(r/360),o=Math.floor(a/360),l=Math.min(s,o);return t+l*360},yj=function(t,n){var r=t.x,a=t.y,s=mQ({x:r,y:a},n),o=s.radius,l=s.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=gQ(n),f=d.startAngle,h=d.endAngle,p=l,g;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;g=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=f}return g?vj(vj({},n),{},{radius:o,angle:vQ(p,n)}):null};function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}var yQ=["offset"];function bQ(e){return kQ(e)||SQ(e)||wQ(e)||xQ()}function xQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
92
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wQ(e,t){if(e){if(typeof e=="string")return Hy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hy(e,t)}}function SQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kQ(e){if(Array.isArray(e))return Hy(e)}function Hy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jQ(e,t){if(e==null)return{};var n=NQ(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function NQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bj(Object(n),!0).forEach(function(r){EQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EQ(e,t,n){return t=_Q(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Q(e){var t=AQ(e,"string");return yu(t)=="symbol"?t:t+""}function AQ(e,t){if(yu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bu(){return bu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bu.apply(this,arguments)}var CQ=function(t){var n=t.value,r=t.formatter,a=Ye(t.children)?n:t.children;return Le(r)?r(a):a},TQ=function(t,n){var r=zr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},OQ=function(t,n,r){var a=t.position,s=t.viewBox,o=t.offset,l=t.className,c=s,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,g=c.endAngle,m=c.clockWise,y=(f+h)/2,v=TQ(p,g),x=v>=0?1:-1,S,j;a==="insideStart"?(S=p+x*o,j=m):a==="insideEnd"?(S=g-x*o,j=!m):a==="end"&&(S=g+x*o,j=m),j=v<=0?j:!j;var w=hn(u,d,y,S),b=hn(u,d,y,S+(j?1:-1)*359),N="M".concat(w.x,",").concat(w.y,`
|
|
93
|
+
A`).concat(y,",").concat(y,",0,1,").concat(j?0:1,`,
|
|
94
|
+
`).concat(b.x,",").concat(b.y),E=Ye(t.id)?Dp("recharts-radial-line-"):t.id;return G.createElement("text",bu({},r,{dominantBaseline:"central",className:Ve("recharts-radial-bar-label",l)}),G.createElement("defs",null,G.createElement("path",{id:E,d:N})),G.createElement("textPath",{xlinkHref:"#".concat(E)},n))},PQ=function(t){var n=t.viewBox,r=t.offset,a=t.position,s=n,o=s.cx,l=s.cy,c=s.innerRadius,u=s.outerRadius,d=s.startAngle,f=s.endAngle,h=(d+f)/2;if(a==="outside"){var p=hn(o,l,u+r,h),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,v=hn(o,l,y,h),x=v.x,S=v.y;return{x,y:S,textAnchor:"middle",verticalAnchor:"middle"}},RQ=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,s=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*a,p=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,y=m*a,v=m>0?"end":"start",x=m>0?"start":"end";if(s==="top"){var S={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:p};return Gt(Gt({},S),r?{height:Math.max(c-r.y,0),width:u}:{})}if(s==="bottom"){var j={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:g};return Gt(Gt({},j),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(s==="left"){var w={x:l-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return Gt(Gt({},w),r?{width:Math.max(w.x-r.x,0),height:d}:{})}if(s==="right"){var b={x:l+u+y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return Gt(Gt({},b),r?{width:Math.max(r.x+r.width-b.x,0),height:d}:{})}var N=r?{width:u,height:d}:{};return s==="insideLeft"?Gt({x:l+y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},N):s==="insideRight"?Gt({x:l+u-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},N):s==="insideTop"?Gt({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},N):s==="insideBottom"?Gt({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},N):s==="insideTopLeft"?Gt({x:l+y,y:c+h,textAnchor:x,verticalAnchor:g},N):s==="insideTopRight"?Gt({x:l+u-y,y:c+h,textAnchor:v,verticalAnchor:g},N):s==="insideBottomLeft"?Gt({x:l+y,y:c+d-h,textAnchor:x,verticalAnchor:p},N):s==="insideBottomRight"?Gt({x:l+u-y,y:c+d-h,textAnchor:v,verticalAnchor:p},N):pl(s)&&(fe(s.x)||rs(s.x))&&(fe(s.y)||rs(s.y))?Gt({x:l+Ss(s.x,u),y:c+Ss(s.y,d),textAnchor:"end",verticalAnchor:"end"},N):Gt({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},N)},MQ=function(t){return"cx"in t&&fe(t.cx)};function kn(e){var t=e.offset,n=t===void 0?5:t,r=jQ(e,yQ),a=Gt({offset:n},r),s=a.viewBox,o=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!s||Ye(l)&&Ye(c)&&!k.isValidElement(u)&&!Le(u))return null;if(k.isValidElement(u))return k.cloneElement(u,a);var p;if(Le(u)){if(p=k.createElement(u,a),k.isValidElement(p))return p}else p=CQ(a);var g=MQ(s),m=Ke(a,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return OQ(a,p,m);var y=g?PQ(a):RQ(a);return G.createElement(ch,bu({className:Ve("recharts-label",f)},m,y,{breakAll:h}),p)}kn.displayName="Label";var GP=function(t){var n=t.cx,r=t.cy,a=t.angle,s=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,g=t.left,m=t.width,y=t.height,v=t.clockWise,x=t.labelViewBox;if(x)return x;if(fe(m)&&fe(y)){if(fe(f)&&fe(h))return{x:f,y:h,width:m,height:y};if(fe(p)&&fe(g))return{x:p,y:g,width:m,height:y}}return fe(f)&&fe(h)?{x:f,y:h,width:0,height:0}:fe(n)&&fe(r)?{cx:n,cy:r,startAngle:s||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:v}:t.viewBox?t.viewBox:{}},IQ=function(t,n){return t?t===!0?G.createElement(kn,{key:"label-implicit",viewBox:n}):Yt(t)?G.createElement(kn,{key:"label-implicit",viewBox:n,value:t}):k.isValidElement(t)?t.type===kn?k.cloneElement(t,{key:"label-implicit",viewBox:n}):G.createElement(kn,{key:"label-implicit",content:t,viewBox:n}):Le(t)?G.createElement(kn,{key:"label-implicit",content:t,viewBox:n}):pl(t)?G.createElement(kn,bu({viewBox:n},t,{key:"label-implicit"})):null:null},$Q=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,s=GP(t),o=Wr(a,kn).map(function(c,u){return k.cloneElement(c,{viewBox:n||s,key:"label-".concat(u)})});if(!r)return o;var l=IQ(t.label,n||s);return[l].concat(bQ(o))};kn.parseViewBox=GP;kn.renderCallByParent=$Q;function LQ(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var DQ=LQ;const BQ=Qe(DQ);function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}var zQ=["valueAccessor"],FQ=["data","dataKey","clockWise","id","textBreakAll"];function UQ(e){return qQ(e)||GQ(e)||HQ(e)||WQ()}function WQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
95
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HQ(e,t){if(e){if(typeof e=="string")return Gy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gy(e,t)}}function GQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qQ(e){if(Array.isArray(e))return Gy(e)}function Gy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Eh(){return Eh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Eh.apply(this,arguments)}function xj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function wj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xj(Object(n),!0).forEach(function(r){KQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KQ(e,t,n){return t=VQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VQ(e){var t=YQ(e,"string");return xu(t)=="symbol"?t:t+""}function YQ(e,t){if(xu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sj(e,t){if(e==null)return{};var n=XQ(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var QQ=function(t){return Array.isArray(t.value)?BQ(t.value):t.value};function hs(e){var t=e.valueAccessor,n=t===void 0?QQ:t,r=Sj(e,zQ),a=r.data,s=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=Sj(r,FQ);return!a||!a.length?null:G.createElement(en,{className:"recharts-label-list"},a.map(function(d,f){var h=Ye(s)?n(d,f):ua(d&&d.payload,s),p=Ye(l)?{}:{id:"".concat(l,"-").concat(f)};return G.createElement(kn,Eh({},Ke(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:kn.parseViewBox(Ye(o)?d:wj(wj({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}hs.displayName="LabelList";function ZQ(e,t){return e?e===!0?G.createElement(hs,{key:"labelList-implicit",data:t}):G.isValidElement(e)||Le(e)?G.createElement(hs,{key:"labelList-implicit",data:t,content:e}):pl(e)?G.createElement(hs,Eh({data:t},e,{key:"labelList-implicit"})):null:null}function JQ(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=Wr(r,hs).map(function(o,l){return k.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return a;var s=ZQ(e.label,t);return[s].concat(UQ(a))}hs.renderCallByParent=JQ;function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function qy(){return qy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qy.apply(this,arguments)}function kj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function jj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kj(Object(n),!0).forEach(function(r){eZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eZ(e,t,n){return t=tZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tZ(e){var t=nZ(e,"string");return wu(t)=="symbol"?t:t+""}function nZ(e,t){if(wu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rZ=function(t,n){var r=zr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},zd=function(t){var n=t.cx,r=t.cy,a=t.radius,s=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/Nh,h=u?s:s+o*f,p=hn(n,r,d,h),g=hn(n,r,a,h),m=u?s-o*f:s,y=hn(n,r,d*Math.cos(f*Nh),m);return{center:p,circleTangency:g,lineTangency:y,theta:f}},qP=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,s=t.outerRadius,o=t.startAngle,l=t.endAngle,c=rZ(o,l),u=o+c,d=hn(n,r,s,o),f=hn(n,r,s,u),h="M ".concat(d.x,",").concat(d.y,`
|
|
96
|
+
A `).concat(s,",").concat(s,`,0,
|
|
97
|
+
`).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
|
|
98
|
+
`).concat(f.x,",").concat(f.y,`
|
|
99
|
+
`);if(a>0){var p=hn(n,r,a,o),g=hn(n,r,a,u);h+="L ".concat(g.x,",").concat(g.y,`
|
|
100
|
+
A `).concat(a,",").concat(a,`,0,
|
|
101
|
+
`).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
|
|
102
|
+
`).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},aZ=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,s=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=zr(d-u),h=zd({cx:n,cy:r,radius:s,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,m=h.theta,y=zd({cx:n,cy:r,radius:s,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),v=y.circleTangency,x=y.lineTangency,S=y.theta,j=c?Math.abs(u-d):Math.abs(u-d)-m-S;if(j<0)return l?"M ".concat(g.x,",").concat(g.y,`
|
|
103
|
+
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
|
|
104
|
+
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
|
|
105
|
+
`):qP({cx:n,cy:r,innerRadius:a,outerRadius:s,startAngle:u,endAngle:d});var w="M ".concat(g.x,",").concat(g.y,`
|
|
106
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
|
|
107
|
+
A`).concat(s,",").concat(s,",0,").concat(+(j>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
|
|
108
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,`
|
|
109
|
+
`);if(a>0){var b=zd({cx:n,cy:r,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),N=b.circleTangency,E=b.lineTangency,T=b.theta,A=zd({cx:n,cy:r,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),M=A.circleTangency,R=A.lineTangency,B=A.theta,L=c?Math.abs(u-d):Math.abs(u-d)-T-B;if(L<0&&o===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(R.x,",").concat(R.y,`
|
|
110
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(M.x,",").concat(M.y,`
|
|
111
|
+
A`).concat(a,",").concat(a,",0,").concat(+(L>180),",").concat(+(f>0),",").concat(N.x,",").concat(N.y,`
|
|
112
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(E.x,",").concat(E.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},iZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},KP=function(t){var n=jj(jj({},iZ),t),r=n.cx,a=n.cy,s=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(o<s||d===f)return null;var p=Ve("recharts-sector",h),g=o-s,m=Ss(l,g,0,!0),y;return m>0&&Math.abs(d-f)<360?y=aZ({cx:r,cy:a,innerRadius:s,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):y=qP({cx:r,cy:a,innerRadius:s,outerRadius:o,startAngle:d,endAngle:f}),G.createElement("path",qy({},Ke(n,!0),{className:p,d:y,role:"img"}))};function Su(e){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(e)}function Ky(){return Ky=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ky.apply(this,arguments)}function Nj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ej(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nj(Object(n),!0).forEach(function(r){sZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sZ(e,t,n){return t=oZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oZ(e){var t=lZ(e,"string");return Su(t)=="symbol"?t:t+""}function lZ(e,t){if(Su(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Su(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _j={curveBasisClosed:s4,curveBasisOpen:o4,curveBasis:i4,curveBumpX:G3,curveBumpY:q3,curveLinearClosed:l4,curveLinear:Fp,curveMonotoneX:c4,curveMonotoneY:u4,curveNatural:d4,curveStep:f4,curveStepAfter:p4,curveStepBefore:h4},Fd=function(t){return t.x===+t.x&&t.y===+t.y},tc=function(t){return t.x},nc=function(t){return t.y},cZ=function(t,n){if(Le(t))return t;var r="curve".concat(Bp(t));return(r==="curveMonotone"||r==="curveBump")&&n?_j["".concat(r).concat(n==="vertical"?"Y":"X")]:_j[r]||Fp},uZ=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,s=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=cZ(r,l),f=u?s.filter(function(m){return Fd(m)}):s,h;if(Array.isArray(o)){var p=u?o.filter(function(m){return Fd(m)}):o,g=f.map(function(m,y){return Ej(Ej({},m),{},{base:p[y]})});return l==="vertical"?h=Od().y(nc).x1(tc).x0(function(m){return m.base.x}):h=Od().x(tc).y1(nc).y0(function(m){return m.base.y}),h.defined(Fd).curve(d),h(g)}return l==="vertical"&&fe(o)?h=Od().y(nc).x1(tc).x0(o):fe(o)?h=Od().x(tc).y1(nc).y0(o):h=YT().x(tc).y(nc),h.defined(Fd).curve(d),h(f)},Aj=function(t){var n=t.className,r=t.points,a=t.path,s=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?uZ(t):a;return k.createElement("path",Ky({},Ke(t,!1),Vf(t),{className:Ve("recharts-curve",n),d:o,ref:s}))},VP={exports:{}},dZ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",fZ=dZ,hZ=fZ;function YP(){}function XP(){}XP.resetWarningCache=YP;var pZ=function(){function e(r,a,s,o,l,c){if(c!==hZ){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:XP,resetWarningCache:YP};return n.PropTypes=n,n};VP.exports=pZ();var mZ=VP.exports;const Xe=Qe(mZ),{getOwnPropertyNames:gZ,getOwnPropertySymbols:vZ}=Object,{hasOwnProperty:yZ}=Object.prototype;function yg(e,t){return function(r,a,s){return e(r,a,s)&&t(r,a,s)}}function Ud(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);const{cache:s}=a,o=s.get(n),l=s.get(r);if(o&&l)return o===r&&l===n;s.set(n,r),s.set(r,n);const c=e(n,r,a);return s.delete(n),s.delete(r),c}}function bZ(e){return e!=null?e[Symbol.toStringTag]:void 0}function Cj(e){return gZ(e).concat(vZ(e))}const xZ=Object.hasOwn||((e,t)=>yZ.call(e,t));function Rs(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const wZ="__v",SZ="__o",kZ="_owner",{getOwnPropertyDescriptor:Tj,keys:Oj}=Object;function jZ(e,t){return e.byteLength===t.byteLength&&_h(new Uint8Array(e),new Uint8Array(t))}function NZ(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function EZ(e,t){return e.byteLength===t.byteLength&&_h(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function _Z(e,t){return Rs(e.getTime(),t.getTime())}function AZ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function CZ(e,t){return e===t}function Pj(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),s=e.entries();let o,l,c=0;for(;(o=s.next())&&!o.done;){const u=t.entries();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(a[f]){f++;continue}const h=o.value,p=l.value;if(n.equals(h[0],p[0],c,f,e,t,n)&&n.equals(h[1],p[1],h[0],p[0],e,t,n)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}const TZ=Rs;function OZ(e,t,n){const r=Oj(e);let a=r.length;if(Oj(t).length!==a)return!1;for(;a-- >0;)if(!QP(e,t,n,r[a]))return!1;return!0}function rc(e,t,n){const r=Cj(e);let a=r.length;if(Cj(t).length!==a)return!1;let s,o,l;for(;a-- >0;)if(s=r[a],!QP(e,t,n,s)||(o=Tj(e,s),l=Tj(t,s),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function PZ(e,t){return Rs(e.valueOf(),t.valueOf())}function RZ(e,t){return e.source===t.source&&e.flags===t.flags}function Rj(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),s=e.values();let o,l;for(;(o=s.next())&&!o.done;){const c=t.values();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(!a[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function _h(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function MZ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function QP(e,t,n,r){return(r===kZ||r===SZ||r===wZ)&&(e.$$typeof||t.$$typeof)?!0:xZ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const IZ="[object ArrayBuffer]",$Z="[object Arguments]",LZ="[object Boolean]",DZ="[object DataView]",BZ="[object Date]",zZ="[object Error]",FZ="[object Map]",UZ="[object Number]",WZ="[object Object]",HZ="[object RegExp]",GZ="[object Set]",qZ="[object String]",KZ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},VZ="[object URL]",YZ=Object.prototype.toString;function XZ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:g}){return function(y,v,x){if(y===v)return!0;if(y==null||v==null)return!1;const S=typeof y;if(S!==typeof v)return!1;if(S!=="object")return S==="number"?l(y,v,x):S==="function"?s(y,v,x):!1;const j=y.constructor;if(j!==v.constructor)return!1;if(j===Object)return c(y,v,x);if(Array.isArray(y))return t(y,v,x);if(j===Date)return r(y,v,x);if(j===RegExp)return d(y,v,x);if(j===Map)return o(y,v,x);if(j===Set)return f(y,v,x);const w=YZ.call(y);if(w===BZ)return r(y,v,x);if(w===HZ)return d(y,v,x);if(w===FZ)return o(y,v,x);if(w===GZ)return f(y,v,x);if(w===WZ)return typeof y.then!="function"&&typeof v.then!="function"&&c(y,v,x);if(w===VZ)return p(y,v,x);if(w===zZ)return a(y,v,x);if(w===$Z)return c(y,v,x);if(KZ[w])return h(y,v,x);if(w===IZ)return e(y,v,x);if(w===DZ)return n(y,v,x);if(w===LZ||w===UZ||w===qZ)return u(y,v,x);if(g){let b=g[w];if(!b){const N=bZ(y);N&&(b=g[N])}if(b)return b(y,v,x)}return!1}}function QZ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:jZ,areArraysEqual:n?rc:NZ,areDataViewsEqual:EZ,areDatesEqual:_Z,areErrorsEqual:AZ,areFunctionsEqual:CZ,areMapsEqual:n?yg(Pj,rc):Pj,areNumbersEqual:TZ,areObjectsEqual:n?rc:OZ,arePrimitiveWrappersEqual:PZ,areRegExpsEqual:RZ,areSetsEqual:n?yg(Rj,rc):Rj,areTypedArraysEqual:n?yg(_h,rc):_h,areUrlsEqual:MZ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=Ud(r.areArraysEqual),s=Ud(r.areMapsEqual),o=Ud(r.areObjectsEqual),l=Ud(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:l})}return r}function ZZ(e){return function(t,n,r,a,s,o,l){return e(t,n,l)}}function JZ({circular:e,comparator:t,createState:n,equals:r,strict:a}){if(n)return function(l,c){const{cache:u=e?new WeakMap:void 0,meta:d}=n();return t(l,c,{cache:u,equals:r,meta:d,strict:a})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:a})};const s={cache:void 0,equals:r,meta:void 0,strict:a};return function(l,c){return t(l,c,s)}}const eJ=$i();$i({strict:!0});$i({circular:!0});$i({circular:!0,strict:!0});$i({createInternalComparator:()=>Rs});$i({strict:!0,createInternalComparator:()=>Rs});$i({circular:!0,createInternalComparator:()=>Rs});$i({circular:!0,createInternalComparator:()=>Rs,strict:!0});function $i(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,s=QZ(e),o=XZ(s),l=n?n(o):ZZ(o);return JZ({circular:t,comparator:o,createState:r,equals:l,strict:a})}function tJ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Mj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(s){n<0&&(n=s),s-n>t?(e(s),n=-1):tJ(a)};requestAnimationFrame(r)}function Vy(e){"@babel/helpers - typeof";return Vy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vy(e)}function nJ(e){return sJ(e)||iJ(e)||aJ(e)||rJ()}function rJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aJ(e,t){if(e){if(typeof e=="string")return Ij(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ij(e,t)}}function Ij(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sJ(e){if(Array.isArray(e))return e}function oJ(){var e={},t=function(){return null},n=!1,r=function a(s){if(!n){if(Array.isArray(s)){if(!s.length)return;var o=s,l=nJ(o),c=l[0],u=l.slice(1);if(typeof c=="number"){Mj(a.bind(null,u),c);return}a(c),Mj(a.bind(null,u));return}Vy(s)==="object"&&(e=s,t(e)),typeof s=="function"&&s()}};return{stop:function(){n=!0},start:function(s){n=!1,r(s)},subscribe:function(s){return t=s,function(){t=function(){return null}}}}}function ku(e){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ku(e)}function $j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Lj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$j(Object(n),!0).forEach(function(r){ZP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$j(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZP(e,t,n){return t=lJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lJ(e){var t=cJ(e,"string");return ku(t)==="symbol"?t:String(t)}function cJ(e,t){if(ku(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ku(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uJ=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(s){return a.includes(s)})})},dJ=function(t){return t},fJ=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Cc=function(t,n){return Object.keys(n).reduce(function(r,a){return Lj(Lj({},r),{},ZP({},a,t(a,n[a])))},{})},Dj=function(t,n,r){return t.map(function(a){return"".concat(fJ(a)," ").concat(n,"ms ").concat(r)}).join(",")};function hJ(e,t){return gJ(e)||mJ(e,t)||JP(e,t)||pJ()}function pJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
114
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function gJ(e){if(Array.isArray(e))return e}function vJ(e){return xJ(e)||bJ(e)||JP(e)||yJ()}function yJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
115
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JP(e,t){if(e){if(typeof e=="string")return Yy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yy(e,t)}}function bJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xJ(e){if(Array.isArray(e))return Yy(e)}function Yy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ah=1e-4,eR=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},tR=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},Bj=function(t,n){return function(r){var a=eR(t,n);return tR(a,r)}},wJ=function(t,n){return function(r){var a=eR(t,n),s=[].concat(vJ(a.map(function(o,l){return o*l}).slice(1)),[0]);return tR(s,r)}},zj=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],s=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,s=0,o=1,l=1;break;case"ease":a=.25,s=.1,o=.25,l=1;break;case"ease-in":a=.42,s=0,o=1,l=1;break;case"ease-out":a=.42,s=0,o=.58,l=1;break;case"ease-in-out":a=0,s=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),d=hJ(u,4);a=d[0],s=d[1],o=d[2],l=d[3]}}}var f=Bj(a,o),h=Bj(s,l),p=wJ(a,o),g=function(v){return v>1?1:v<0?0:v},m=function(v){for(var x=v>1?1:v,S=x,j=0;j<8;++j){var w=f(S)-x,b=p(S);if(Math.abs(w-x)<Ah||b<Ah)return h(S);S=g(S-w/b)}return h(S)};return m.isStepper=!1,m},SJ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,s=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var p=-(d-f)*r,g=h*s,m=h+(p-g)*l/1e3,y=h*l/1e3+d;return Math.abs(y-f)<Ah&&Math.abs(m)<Ah?[f,0]:[y,m]};return c.isStepper=!0,c.dt=l,c},kJ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return zj(a);case"spring":return SJ();default:if(a.split("(")[0]==="cubic-bezier")return zj(a)}return typeof a=="function"?a:null};function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function Fj(e){return EJ(e)||NJ(e)||nR(e)||jJ()}function jJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
116
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function EJ(e){if(Array.isArray(e))return Qy(e)}function Uj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uj(Object(n),!0).forEach(function(r){Xy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xy(e,t,n){return t=_J(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _J(e){var t=AJ(e,"string");return ju(t)==="symbol"?t:String(t)}function AJ(e,t){if(ju(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ju(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CJ(e,t){return PJ(e)||OJ(e,t)||nR(e,t)||TJ()}function TJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
117
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nR(e,t){if(e){if(typeof e=="string")return Qy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qy(e,t)}}function Qy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function PJ(e){if(Array.isArray(e))return e}var Ch=function(t,n,r){return t+(n-t)*r},Zy=function(t){var n=t.from,r=t.to;return n!==r},RJ=function e(t,n,r){var a=Cc(function(s,o){if(Zy(o)){var l=t(o.from,o.to,o.velocity),c=CJ(l,2),u=c[0],d=c[1];return dn(dn({},o),{},{from:u,velocity:d})}return o},n);return r<1?Cc(function(s,o){return Zy(o)?dn(dn({},o),{},{velocity:Ch(o.velocity,a[s].velocity,r),from:Ch(o.from,a[s].from,r)}):o},n):e(t,a,r-1)};const MJ=function(e,t,n,r,a){var s=uJ(e,t),o=s.reduce(function(y,v){return dn(dn({},y),{},Xy({},v,[e[v],t[v]]))},{}),l=s.reduce(function(y,v){return dn(dn({},y),{},Xy({},v,{from:e[v],velocity:0,to:t[v]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return Cc(function(v,x){return x.from},l)},p=function(){return!Object.values(l).filter(Zy).length},g=function(v){u||(u=v);var x=v-u,S=x/n.dt;l=RJ(n,l,S),a(dn(dn(dn({},e),t),h())),u=v,p()||(c=requestAnimationFrame(f))},m=function(v){d||(d=v);var x=(v-d)/r,S=Cc(function(w,b){return Ch.apply(void 0,Fj(b).concat([n(x)]))},o);if(a(dn(dn(dn({},e),t),S)),x<1)c=requestAnimationFrame(f);else{var j=Cc(function(w,b){return Ch.apply(void 0,Fj(b).concat([n(1)]))},o);a(dn(dn(dn({},e),t),j))}};return f=n.isStepper?g:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function Vo(e){"@babel/helpers - typeof";return Vo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vo(e)}var IJ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function $J(e,t){if(e==null)return{};var n=LJ(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,s;for(s=0;s<r.length;s++)a=r[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function bg(e){return FJ(e)||zJ(e)||BJ(e)||DJ()}function DJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
118
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BJ(e,t){if(e){if(typeof e=="string")return Jy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jy(e,t)}}function zJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FJ(e){if(Array.isArray(e))return Jy(e)}function Jy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Mr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wj(Object(n),!0).forEach(function(r){pc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pc(e,t,n){return t=rR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rR(r.key),r)}}function HJ(e,t,n){return t&&WJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rR(e){var t=GJ(e,"string");return Vo(t)==="symbol"?t:String(t)}function GJ(e,t){if(Vo(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vo(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eb(e,t)}function eb(e,t){return eb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},eb(e,t)}function KJ(e){var t=VJ();return function(){var r=Th(e),a;if(t){var s=Th(this).constructor;a=Reflect.construct(r,arguments,s)}else a=r.apply(this,arguments);return tb(this,a)}}function tb(e,t){if(t&&(Vo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nb(e)}function nb(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Th(e){return Th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Th(e)}var _i=function(e){qJ(n,e);var t=KJ(n);function n(r,a){var s;UJ(this,n),s=t.call(this,r,a);var o=s.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(s.handleStyleChange=s.handleStyleChange.bind(nb(s)),s.changeStyle=s.changeStyle.bind(nb(s)),!l||p<=0)return s.state={style:{}},typeof h=="function"&&(s.state={style:d}),tb(s);if(f&&f.length)s.state={style:f[0].style};else if(u){if(typeof h=="function")return s.state={style:u},tb(s);s.state={style:c?pc({},c,u):u}}else s.state={style:{}};return s}return HJ(n,[{key:"componentDidMount",value:function(){var a=this.props,s=a.isActive,o=a.canBegin;this.mounted=!0,!(!s||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var s=this.props,o=s.isActive,l=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,d=s.to,f=s.from,h=this.state.style;if(l){if(!o){var p={style:c?pc({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(eJ(a.to,d)&&a.canBegin&&a.isActive)){var g=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?f:a.to;if(this.state&&h){var y={style:c?pc({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(y)}this.runAnimation(Mr(Mr({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var s=this,o=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,p=MJ(o,l,kJ(u),c,this.changeStyle),g=function(){s.stopJSAnimation=p()};this.manager.start([h,d,g,c,f])}},{key:"runStepAnimation",value:function(a){var s=this,o=a.steps,l=a.begin,c=a.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,y,v){if(v===0)return m;var x=y.duration,S=y.easing,j=S===void 0?"ease":S,w=y.style,b=y.properties,N=y.onAnimationEnd,E=v>0?o[v-1]:y,T=b||Object.keys(w);if(typeof j=="function"||j==="spring")return[].concat(bg(m),[s.runJSAnimation.bind(s,{from:E.style,to:w,duration:x,easing:j}),x]);var A=Dj(T,x,j),M=Mr(Mr(Mr({},E.style),w),{},{transition:A});return[].concat(bg(m),[M,x,N]).filter(dJ)};return this.manager.start([c].concat(bg(o.reduce(p,[d,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=oJ());var s=a.begin,o=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,p=a.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var m=l?pc({},l,c):c,y=Dj(Object.keys(m),o,u);g.start([d,s,Mr(Mr({},m),{},{transition:y}),o,f])}},{key:"render",value:function(){var a=this.props,s=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=$J(a,IJ),u=k.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!l||u===0||o<=0)return s;var f=function(p){var g=p.props,m=g.style,y=m===void 0?{}:m,v=g.className,x=k.cloneElement(p,Mr(Mr({},c),{},{style:Mr(Mr({},y),d),className:v}));return x};return u===1?f(k.Children.only(s)):G.createElement("div",null,k.Children.map(s,function(h){return f(h)}))}}]),n}(k.PureComponent);_i.displayName="Animate";_i.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};_i.propTypes={from:Xe.oneOfType([Xe.object,Xe.string]),to:Xe.oneOfType([Xe.object,Xe.string]),attributeName:Xe.string,duration:Xe.number,begin:Xe.number,easing:Xe.oneOfType([Xe.string,Xe.func]),steps:Xe.arrayOf(Xe.shape({duration:Xe.number.isRequired,style:Xe.object.isRequired,easing:Xe.oneOfType([Xe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Xe.func]),properties:Xe.arrayOf("string"),onAnimationEnd:Xe.func})),children:Xe.oneOfType([Xe.node,Xe.func]),isActive:Xe.bool,canBegin:Xe.bool,onAnimationEnd:Xe.func,shouldReAnimate:Xe.bool,onAnimationStart:Xe.func,onAnimationReStart:Xe.func};function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}function Oh(){return Oh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oh.apply(this,arguments)}function YJ(e,t){return JJ(e)||ZJ(e,t)||QJ(e,t)||XJ()}function XJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
119
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QJ(e,t){if(e){if(typeof e=="string")return Hj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hj(e,t)}}function Hj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ZJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function JJ(e){if(Array.isArray(e))return e}function Gj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gj(Object(n),!0).forEach(function(r){eee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eee(e,t,n){return t=tee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tee(e){var t=nee(e,"string");return Nu(t)=="symbol"?t:t+""}function nee(e,t){if(Nu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kj=function(t,n,r,a,s){var o=Math.min(Math.abs(r)/2,Math.abs(a)/2),l=a>=0?1:-1,c=r>=0?1:-1,u=a>=0&&r>=0||a<0&&r<0?1:0,d;if(o>0&&s instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=s[h]>o?o:s[h];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
|
|
120
|
+
`).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
|
|
121
|
+
`).concat(t+r-c*f[2],",").concat(n+a)),d+="L ".concat(t+c*f[3],",").concat(n+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
|
|
122
|
+
`).concat(t,",").concat(n+a-l*f[3])),d+="Z"}else if(o>0&&s===+s&&s>0){var g=Math.min(o,s);d="M ".concat(t,",").concat(n+l*g,`
|
|
123
|
+
A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(n,`
|
|
124
|
+
L `).concat(t+r-c*g,",").concat(n,`
|
|
125
|
+
A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*g,`
|
|
126
|
+
L `).concat(t+r,",").concat(n+a-l*g,`
|
|
127
|
+
A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r-c*g,",").concat(n+a,`
|
|
128
|
+
L `).concat(t+c*g,",").concat(n+a,`
|
|
129
|
+
A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(n+a-l*g," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return d},ree=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,s=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(s,s+l),d=Math.max(s,s+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return r>=u&&r<=d&&a>=f&&a<=h}return!1},aee={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Lw=function(t){var n=qj(qj({},aee),t),r=k.useRef(),a=k.useState(-1),s=YJ(a,2),o=s[0],l=s[1];k.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var j=r.current.getTotalLength();j&&l(j)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,g=n.animationEasing,m=n.animationDuration,y=n.animationBegin,v=n.isAnimationActive,x=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var S=Ve("recharts-rectangle",p);return x?G.createElement(_i,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:m,animationEasing:g,isActive:x},function(j){var w=j.width,b=j.height,N=j.x,E=j.y;return G.createElement(_i,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:v,easing:g},G.createElement("path",Oh({},Ke(n,!0),{className:S,d:Kj(N,E,w,b,h),ref:r})))}):G.createElement("path",Oh({},Ke(n,!0),{className:S,d:Kj(c,u,d,f,h)}))};function rb(){return rb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rb.apply(this,arguments)}var aR=function(t){var n=t.cx,r=t.cy,a=t.r,s=t.className,o=Ve("recharts-dot",s);return n===+n&&r===+r&&a===+a?k.createElement("circle",rb({},Ke(t,!1),Vf(t),{className:o,cx:n,cy:r,r:a})):null};function Eu(e){"@babel/helpers - typeof";return Eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eu(e)}var iee=["x","y","top","left","width","height","className"];function ab(){return ab=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ab.apply(this,arguments)}function Vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function see(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vj(Object(n),!0).forEach(function(r){oee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oee(e,t,n){return t=lee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lee(e){var t=cee(e,"string");return Eu(t)=="symbol"?t:t+""}function cee(e,t){if(Eu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Eu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uee(e,t){if(e==null)return{};var n=dee(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var fee=function(t,n,r,a,s,o){return"M".concat(t,",").concat(s,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},hee=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,s=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,g=t.className,m=uee(t,iee),y=see({x:r,y:s,top:l,left:u,width:f,height:p},m);return!fe(r)||!fe(s)||!fe(f)||!fe(p)||!fe(l)||!fe(u)?null:G.createElement("path",ab({},Ke(y,!0),{className:Ve("recharts-cross",g),d:fee(r,s,f,p,l,u)}))},pee=bO,mee=pee(Object.getPrototypeOf,Object),gee=mee,vee=Ua,yee=gee,bee=Wa,xee="[object Object]",wee=Function.prototype,See=Object.prototype,iR=wee.toString,kee=See.hasOwnProperty,jee=iR.call(Object);function Nee(e){if(!bee(e)||vee(e)!=xee)return!1;var t=yee(e);if(t===null)return!0;var n=kee.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&iR.call(n)==jee}var Eee=Nee;const _ee=Qe(Eee);var Aee=Ua,Cee=Wa,Tee="[object Boolean]";function Oee(e){return e===!0||e===!1||Cee(e)&&Aee(e)==Tee}var Pee=Oee;const Ree=Qe(Pee);function _u(e){"@babel/helpers - typeof";return _u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_u(e)}function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ph.apply(this,arguments)}function Mee(e,t){return Dee(e)||Lee(e,t)||$ee(e,t)||Iee()}function Iee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
130
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ee(e,t){if(e){if(typeof e=="string")return Yj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yj(e,t)}}function Yj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Dee(e){if(Array.isArray(e))return e}function Xj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Qj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xj(Object(n),!0).forEach(function(r){Bee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bee(e,t,n){return t=zee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zee(e){var t=Fee(e,"string");return _u(t)=="symbol"?t:t+""}function Fee(e,t){if(_u(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_u(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zj=function(t,n,r,a,s){var o=r-a,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+s),l+="L ".concat(t+r-o/2-a,",").concat(n+s),l+="L ".concat(t,",").concat(n," Z"),l},Uee={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Wee=function(t){var n=Qj(Qj({},Uee),t),r=k.useRef(),a=k.useState(-1),s=Mee(a,2),o=s[0],l=s[1];k.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&l(S)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,h=n.height,p=n.className,g=n.animationEasing,m=n.animationDuration,y=n.animationBegin,v=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var x=Ve("recharts-trapezoid",p);return v?G.createElement(_i,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:m,animationEasing:g,isActive:v},function(S){var j=S.upperWidth,w=S.lowerWidth,b=S.height,N=S.x,E=S.y;return G.createElement(_i,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:g},G.createElement("path",Ph({},Ke(n,!0),{className:x,d:Zj(N,E,j,w,b),ref:r})))}):G.createElement("g",null,G.createElement("path",Ph({},Ke(n,!0),{className:x,d:Zj(c,u,d,f,h)})))},Hee=["option","shapeType","propTransformer","activeClassName","isActive"];function Au(e){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Au(e)}function Gee(e,t){if(e==null)return{};var n=qee(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Rh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jj(Object(n),!0).forEach(function(r){Kee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kee(e,t,n){return t=Vee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vee(e){var t=Yee(e,"string");return Au(t)=="symbol"?t:t+""}function Yee(e,t){if(Au(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Au(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xee(e,t){return Rh(Rh({},t),e)}function Qee(e,t){return e==="symbols"}function eN(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return G.createElement(Lw,n);case"trapezoid":return G.createElement(Wee,n);case"sector":return G.createElement(KP,n);case"symbols":if(Qee(t))return G.createElement(tw,n);break;default:return null}}function Zee(e){return k.isValidElement(e)?e.props:e}function Jee(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?Xee:r,s=e.activeClassName,o=s===void 0?"recharts-active-shape":s,l=e.isActive,c=Gee(e,Hee),u;if(k.isValidElement(t))u=k.cloneElement(t,Rh(Rh({},c),Zee(t)));else if(Le(t))u=t(c);else if(_ee(t)&&!Ree(t)){var d=a(t,c);u=G.createElement(eN,{shapeType:n,elementProps:d})}else{var f=c;u=G.createElement(eN,{shapeType:n,elementProps:f})}return l?G.createElement(en,{className:o},u):u}function rm(e,t){return t!=null&&"trapezoids"in e.props}function am(e,t){return t!=null&&"sectors"in e.props}function Cu(e,t){return t!=null&&"points"in e.props}function ete(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,s=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&s}function tte(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function nte(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function rte(e,t){var n;return rm(e,t)?n=ete:am(e,t)?n=tte:Cu(e,t)&&(n=nte),n}function ate(e,t){var n;return rm(e,t)?n="trapezoids":am(e,t)?n="sectors":Cu(e,t)&&(n="points"),n}function ite(e,t){if(rm(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(am(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return Cu(e,t)?t.payload:{}}function ste(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=ate(n,t),s=ite(n,t),o=r.filter(function(c,u){var d=Rw(s,c),f=n.props[a].filter(function(g){var m=rte(n,t);return m(g,t)}),h=n.props[a].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=r.indexOf(o[o.length-1]);return l}var ote=Math.ceil,lte=Math.max;function cte(e,t,n,r){for(var a=-1,s=lte(ote((t-e)/(n||1)),0),o=Array(s);s--;)o[r?s:++a]=e,e+=n;return o}var ute=cte,dte=DO,tN=1/0,fte=17976931348623157e292;function hte(e){if(!e)return e===0?e:0;if(e=dte(e),e===tN||e===-tN){var t=e<0?-1:1;return t*fte}return e===e?e:0}var sR=hte,pte=ute,mte=Gp,xg=sR;function gte(e){return function(t,n,r){return r&&typeof r!="number"&&mte(t,n,r)&&(n=r=void 0),t=xg(t),n===void 0?(n=t,t=0):n=xg(n),r=r===void 0?t<n?1:-1:xg(r),pte(t,n,r,e)}}var vte=gte,yte=vte,bte=yte(),xte=bte;const Mh=Qe(xte);function Tu(e){"@babel/helpers - typeof";return Tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tu(e)}function nN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nN(Object(n),!0).forEach(function(r){oR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oR(e,t,n){return t=wte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wte(e){var t=Ste(e,"string");return Tu(t)=="symbol"?t:t+""}function Ste(e,t){if(Tu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kte=["Webkit","Moz","O","ms"],jte=function(t,n){var r=t.replace(/(\w)/,function(s){return s.toUpperCase()}),a=kte.reduce(function(s,o){return rN(rN({},s),{},oR({},o+r,n))},{});return a[t]=n,a};function Yo(e){"@babel/helpers - typeof";return Yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(e)}function Ih(){return Ih=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ih.apply(this,arguments)}function aN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function wg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aN(Object(n),!0).forEach(function(r){Zn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cR(r.key),r)}}function Ete(e,t,n){return t&&iN(e.prototype,t),n&&iN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _te(e,t,n){return t=$h(t),Ate(e,lR()?Reflect.construct(t,n||[],$h(e).constructor):t.apply(e,n))}function Ate(e,t){if(t&&(Yo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cte(e)}function Cte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lR=function(){return!!e})()}function $h(e){return $h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$h(e)}function Tte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ib(e,t)}function ib(e,t){return ib=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ib(e,t)}function Zn(e,t,n){return t=cR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cR(e){var t=Ote(e,"string");return Yo(t)=="symbol"?t:t+""}function Ote(e,t){if(Yo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Pte=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,s=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=_c().domain(Mh(0,c)).range([s,s+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(a),scale:u,scaleValues:d}},sN=function(t){return t.changedTouches&&!!t.changedTouches.length},Xo=function(e){function t(n){var r;return Nte(this,t),r=_te(this,t,[n]),Zn(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Zn(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Zn(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,s=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:s,startIndex:l})}),r.detachDragEndListener()}),Zn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Zn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Zn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Zn(r,"handleSlideDragStart",function(a){var s=sN(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Tte(t,e),Ete(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,s=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,s),h=Math.max(a,s),p=t.getIndexInRange(o,f),g=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:g===d?d:g-g%c}}},{key:"getTextOfTick",value:function(r){var a=this.props,s=a.data,o=a.tickFormatter,l=a.dataKey,c=ua(s[r],l,r);return Le(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,s=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,g=c.onChange,m=r.pageX-s;m>0?m=Math.min(m,u+d-f-l,u+d-f-o):m<0&&(m=Math.max(m,u-o,u-l));var y=this.getIndex({startX:o+m,endX:l+m});(y.startIndex!==h||y.endIndex!==p)&&g&&g(y),this.setState({startX:o+m,endX:l+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var s=sN(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,s=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,y=d.data,v={startX:this.state.startX,endX:this.state.endX},x=r.pageX-s;x>0?x=Math.min(x,f+h-p-u):x<0&&(x=Math.max(x,f-u)),v[o]=u+x;var S=this.getIndex(v),j=S.startIndex,w=S.endIndex,b=function(){var E=y.length-1;return o==="startX"&&(l>c?j%m===0:w%m===0)||l<c&&w===E||o==="endX"&&(l>c?w%m===0:j%m===0)||l>c&&w===E};this.setState(Zn(Zn({},o,u+x),"brushMoveStartX",r.pageX),function(){g&&b()&&g(S)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var s=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState(Zn({},a,p),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,s=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return G.createElement("rect",{stroke:u,fill:c,x:a,y:s,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,s=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=k.Children.only(u);return f?G.cloneElement(f,{x:a,y:s,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,a){var s,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,g=c.data,m=c.startIndex,y=c.endIndex,v=Math.max(r,this.props.x),x=wg(wg({},Ke(this.props,!1)),{},{x:v,y:u,width:d,height:f}),S=p||"Min value: ".concat((s=g[m])===null||s===void 0?void 0:s.name,", Max value: ").concat((o=g[y])===null||o===void 0?void 0:o.name);return G.createElement(en,{tabIndex:0,role:"slider","aria-label":S,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),l.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(r,a){var s=this.props,o=s.y,l=s.height,c=s.stroke,u=s.travellerWidth,d=Math.min(r,a)+u,f=Math.max(Math.abs(a-r)-u,0);return G.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,s=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,g={pointerEvents:"none",fill:u};return G.createElement(en,{className:"recharts-brush-texts"},G.createElement(ch,Ih({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},g),this.getTextOfTick(a)),G.createElement(ch,Ih({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:o+l/2},g),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,a=r.data,s=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,g=h.endX,m=h.isTextActive,y=h.isSlideMoving,v=h.isTravellerMoving,x=h.isTravellerFocused;if(!a||!a.length||!fe(l)||!fe(c)||!fe(u)||!fe(d)||u<=0||d<=0)return null;var S=Ve("recharts-brush",s),j=G.Children.count(o)===1,w=jte("userSelect","none");return G.createElement(en,{className:S,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||y||v||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,s=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(s+l/2)-1;return G.createElement(G.Fragment,null,G.createElement("rect",{x:a,y:s,width:o,height:l,fill:c,stroke:"none"}),G.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),G.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var s;return G.isValidElement(r)?s=G.cloneElement(r,a):Le(r)?s=r(a):s=t.renderDefaultTraveller(a),s}},{key:"getDerivedStateFromProps",value:function(r,a){var s=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(s!==a.prevData||u!==a.prevUpdateId)return wg({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},s&&s.length?Pte({data:s,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,a){for(var s=r.length,o=0,l=s-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>a?l=c:o=c}return a>=r[l]?l:o}}])}(k.PureComponent);Zn(Xo,"displayName","Brush");Zn(Xo,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Rte=lw;function Mte(e,t){var n;return Rte(e,function(r,a,s){return n=t(r,a,s),!n}),!!n}var Ite=Mte,$te=dO,Lte=Ri,Dte=Ite,Bte=qn,zte=Gp;function Fte(e,t,n){var r=Bte(e)?$te:Dte;return n&&zte(e,t,n)&&(t=void 0),r(e,Lte(t))}var Ute=Fte;const Wte=Qe(Ute);var la=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},oN=RO;function Hte(e,t,n){t=="__proto__"&&oN?oN(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Gte=Hte,qte=Gte,Kte=OO,Vte=Ri;function Yte(e,t){var n={};return t=Vte(t),Kte(e,function(r,a,s){qte(n,a,t(r,a,s))}),n}var Xte=Yte;const Qte=Qe(Xte);function Zte(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var Jte=Zte,ene=lw;function tne(e,t){var n=!0;return ene(e,function(r,a,s){return n=!!t(r,a,s),n}),n}var nne=tne,rne=Jte,ane=nne,ine=Ri,sne=qn,one=Gp;function lne(e,t,n){var r=sne(e)?rne:ane;return n&&one(e,t,n)&&(t=void 0),r(e,ine(t))}var cne=lne;const uR=Qe(cne);var une=["x","y"];function Ou(e){"@babel/helpers - typeof";return Ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ou(e)}function sb(){return sb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sb.apply(this,arguments)}function lN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ac(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lN(Object(n),!0).forEach(function(r){dne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dne(e,t,n){return t=fne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fne(e){var t=hne(e,"string");return Ou(t)=="symbol"?t:t+""}function hne(e,t){if(Ou(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ou(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pne(e,t){if(e==null)return{};var n=mne(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function mne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function gne(e,t){var n=e.x,r=e.y,a=pne(e,une),s="".concat(n),o=parseInt(s,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return ac(ac(ac(ac(ac({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function cN(e){return G.createElement(Jee,sb({shapeType:"rectangle",propTransformer:gne,activeClassName:"recharts-active-bar"},e))}var vne=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var s=fe(r)||OU(r);return s?t(r,a):(s||js(),n)}},yne=["value","background"],dR;function Qo(e){"@babel/helpers - typeof";return Qo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qo(e)}function bne(e,t){if(e==null)return{};var n=xne(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Lh(){return Lh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lh.apply(this,arguments)}function uN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uN(Object(n),!0).forEach(function(r){fi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hR(r.key),r)}}function Sne(e,t,n){return t&&dN(e.prototype,t),n&&dN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kne(e,t,n){return t=Dh(t),jne(e,fR()?Reflect.construct(t,n||[],Dh(e).constructor):t.apply(e,n))}function jne(e,t){if(t&&(Qo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nne(e)}function Nne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fR=function(){return!!e})()}function Dh(e){return Dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dh(e)}function Ene(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ob(e,t)}function ob(e,t){return ob=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ob(e,t)}function fi(e,t,n){return t=hR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hR(e){var t=_ne(e,"string");return Qo(t)=="symbol"?t:t+""}function _ne(e,t){if(Qo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var xn=function(e){function t(){var n;wne(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=kne(this,t,[].concat(a)),fi(n,"state",{isAnimationFinished:!1}),fi(n,"id",Dp("recharts-bar-")),fi(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),fi(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return Ene(t,e),Sne(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,s=this.props,o=s.shape,l=s.dataKey,c=s.activeIndex,u=s.activeBar,d=Ke(this.props,!1);return r&&r.map(function(f,h){var p=h===c,g=p?u:o,m=$t($t($t({},d),f),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return G.createElement(en,Lh({className:"recharts-bar-rectangle"},Yf(a.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),G.createElement(cN,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,s=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,h=this.state.prevData;return G.createElement(_i,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var g=p.t,m=s.map(function(y,v){var x=h&&h[v];if(x){var S=Gs(x.x,y.x),j=Gs(x.y,y.y),w=Gs(x.width,y.width),b=Gs(x.height,y.height);return $t($t({},y),{},{x:S(g),y:j(g),width:w(g),height:b(g)})}if(o==="horizontal"){var N=Gs(0,y.height),E=N(g);return $t($t({},y),{},{y:y.y+y.height-E,height:E})}var T=Gs(0,y.width),A=T(g);return $t($t({},y),{},{width:A})});return G.createElement(en,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,s=r.isAnimationActive,o=this.state.prevData;return s&&a&&a.length&&(!o||!Rw(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,s=a.data,o=a.dataKey,l=a.activeIndex,c=Ke(this.props.background,!1);return s.map(function(u,d){u.value;var f=u.background,h=bne(u,yne);if(!f)return null;var p=$t($t($t($t($t({},h),{},{fill:"#eee"},f),c),Yf(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return G.createElement(cN,Lh({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.data,l=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,f=Wr(d,nm);if(!f)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,p=function(y,v){var x=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:x,errorVal:ua(y,v)}},g={clipPath:r?"url(#clipPath-".concat(a,")"):null};return G.createElement(en,g,f.map(function(m){return G.cloneElement(m,{key:"error-bar-".concat(a,"-").concat(m.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,s=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,h=r.height,p=r.isAnimationActive,g=r.background,m=r.id;if(a||!s||!s.length)return null;var y=this.state.isAnimationFinished,v=Ve("recharts-bar",o),x=l&&l.allowDataOverflow,S=c&&c.allowDataOverflow,j=x||S,w=Ye(m)?this.id:m;return G.createElement(en,{className:v},x||S?G.createElement("defs",null,G.createElement("clipPath",{id:"clipPath-".concat(w)},G.createElement("rect",{x:x?u:u-f/2,y:S?d:d-h/2,width:x?f:f*2,height:S?h:h*2}))):null,G.createElement(en,{className:"recharts-bar-rectangles",clipPath:j?"url(#clipPath-".concat(w,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(j,w),(!p||y)&&hs.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])}(k.PureComponent);dR=xn;fi(xn,"displayName","Bar");fi(xn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Vu.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});fi(xn,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,s=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=JX(r,n);if(!p)return null;var g=t.layout,m=n.type.defaultProps,y=m!==void 0?$t($t({},m),n.props):n.props,v=y.dataKey,x=y.children,S=y.minPointSize,j=g==="horizontal"?o:s,w=u?j.scale.domain():null,b=oQ({numericAxis:j}),N=Wr(x,iu),E=f.map(function(T,A){var M,R,B,L,F,z;u?M=eQ(u[d+A],w):(M=ua(T,v),Array.isArray(M)||(M=[b,M]));var $=vne(S,dR.defaultProps.minPointSize)(M[1],A);if(g==="horizontal"){var O,U=[o.scale(M[0]),o.scale(M[1])],C=U[0],Z=U[1];R=fj({axis:s,ticks:l,bandSize:a,offset:p.offset,entry:T,index:A}),B=(O=Z??C)!==null&&O!==void 0?O:void 0,L=p.size;var D=C-Z;if(F=Number.isNaN(D)?0:D,z={x:R,y:o.y,width:L,height:o.height},Math.abs($)>0&&Math.abs(F)<Math.abs($)){var P=zr(F||$)*(Math.abs($)-Math.abs(F));B-=P,F+=P}}else{var ie=[s.scale(M[0]),s.scale(M[1])],ve=ie[0],pe=ie[1];if(R=ve,B=fj({axis:o,ticks:c,bandSize:a,offset:p.offset,entry:T,index:A}),L=pe-ve,F=p.size,z={x:s.x,y:B,width:s.width,height:F},Math.abs($)>0&&Math.abs(L)<Math.abs($)){var Te=zr(L||$)*(Math.abs($)-Math.abs(L));L+=Te}}return $t($t($t({},T),{},{x:R,y:B,width:L,height:F,value:u?M:M[1],payload:T,background:z},N&&N[A]&&N[A].props),{},{tooltipPayload:[HP(n,T)],tooltipPosition:{x:R+L/2,y:B+F/2}})});return $t({data:E,layout:g},h)});function Pu(e){"@babel/helpers - typeof";return Pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pu(e)}function Ane(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pR(r.key),r)}}function Cne(e,t,n){return t&&fN(e.prototype,t),n&&fN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Lr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hN(Object(n),!0).forEach(function(r){im(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function im(e,t,n){return t=pR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pR(e){var t=Tne(e,"string");return Pu(t)=="symbol"?t:t+""}function Tne(e,t){if(Pu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var One=function(t,n,r,a,s){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},h=!!er(u,xn);return d.reduce(function(p,g){var m=n[g],y=m.orientation,v=m.domain,x=m.padding,S=x===void 0?{}:x,j=m.mirror,w=m.reversed,b="".concat(y).concat(j?"Mirror":""),N,E,T,A,M;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var R=v[1]-v[0],B=1/0,L=m.categoricalDomain.sort(MU);if(L.forEach(function(ie,ve){ve>0&&(B=Math.min((ie||0)-(L[ve-1]||0),B))}),Number.isFinite(B)){var F=B/R,z=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(N=F*z/2),m.padding==="no-gap"){var $=Ss(t.barCategoryGap,F*z),O=F*z/2;N=O-$-(O-$)/z*$}}}a==="xAxis"?E=[r.left+(S.left||0)+(N||0),r.left+r.width-(S.right||0)-(N||0)]:a==="yAxis"?E=c==="horizontal"?[r.top+r.height-(S.bottom||0),r.top+(S.top||0)]:[r.top+(S.top||0)+(N||0),r.top+r.height-(S.bottom||0)-(N||0)]:E=m.range,w&&(E=[E[1],E[0]]);var U=QX(m,s,h),C=U.scale,Z=U.realScaleType;C.domain(v).range(E),ZX(C);var D=sQ(C,Lr(Lr({},m),{},{realScaleType:Z}));a==="xAxis"?(M=y==="top"&&!j||y==="bottom"&&j,T=r.left,A=f[b]-M*m.height):a==="yAxis"&&(M=y==="left"&&!j||y==="right"&&j,T=f[b]-M*m.width,A=r.top);var P=Lr(Lr(Lr({},m),D),{},{realScaleType:Z,x:T,y:A,scale:C,width:a==="xAxis"?r.width:m.width,height:a==="yAxis"?r.height:m.height});return P.bandSize=jh(P,D),!m.hide&&a==="xAxis"?f[b]+=(M?-1:1)*P.height:m.hide||(f[b]+=(M?-1:1)*P.width),Lr(Lr({},p),{},im({},g,P))},{})},mR=function(t,n){var r=t.x,a=t.y,s=n.x,o=n.y;return{x:Math.min(r,s),y:Math.min(a,o),width:Math.abs(s-r),height:Math.abs(o-a)}},Pne=function(t){var n=t.x1,r=t.y1,a=t.x2,s=t.y2;return mR({x:n,y:r},{x:a,y:s})},gR=function(){function e(t){Ane(this,e),this.scale=t}return Cne(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],s=r[r.length-1];return a<=s?n>=a&&n<=s:n>=s&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])}();im(gR,"EPS",1e-4);var Dw=function(t){var n=Object.keys(t).reduce(function(r,a){return Lr(Lr({},r),{},im({},a,gR.create(t[a])))},{});return Lr(Lr({},n),{},{apply:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.bandAware,l=s.position;return Qte(a,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return uR(a,function(s,o){return n[o].isInRange(s)})}})};function Rne(e){return(e%180+180)%180}var Mne=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=Rne(a),o=s*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},Ine=Ri,$ne=Ku,Lne=Wp;function Dne(e){return function(t,n,r){var a=Object(t);if(!$ne(t)){var s=Ine(n);t=Lne(t),n=function(l){return s(a[l],l,a)}}var o=e(t,n,r);return o>-1?a[s?t[o]:o]:void 0}}var Bne=Dne,zne=sR;function Fne(e){var t=zne(e),n=t%1;return t===t?n?t-n:t:0}var Une=Fne,Wne=NO,Hne=Ri,Gne=Une,qne=Math.max;function Kne(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:Gne(n);return a<0&&(a=qne(r+a,0)),Wne(e,Hne(t),a)}var Vne=Kne,Yne=Bne,Xne=Vne,Qne=Yne(Xne),Zne=Qne;const Jne=Qe(Zne);var ere=LF(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Bw=k.createContext(void 0),zw=k.createContext(void 0),vR=k.createContext(void 0),yR=k.createContext({}),bR=k.createContext(void 0),xR=k.createContext(0),wR=k.createContext(0),pN=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,s=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=ere(s);return G.createElement(Bw.Provider,{value:r},G.createElement(zw.Provider,{value:a},G.createElement(yR.Provider,{value:s},G.createElement(vR.Provider,{value:d},G.createElement(bR.Provider,{value:o},G.createElement(xR.Provider,{value:u},G.createElement(wR.Provider,{value:c},l)))))))},tre=function(){return k.useContext(bR)},SR=function(t){var n=k.useContext(Bw);n==null&&js();var r=n[t];return r==null&&js(),r},nre=function(){var t=k.useContext(Bw);return si(t)},rre=function(){var t=k.useContext(zw),n=Jne(t,function(r){return uR(r.domain,Number.isFinite)});return n||si(t)},kR=function(t){var n=k.useContext(zw);n==null&&js();var r=n[t];return r==null&&js(),r},are=function(){var t=k.useContext(vR);return t},ire=function(){return k.useContext(yR)},Fw=function(){return k.useContext(wR)},Uw=function(){return k.useContext(xR)};function Zo(e){"@babel/helpers - typeof";return Zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zo(e)}function sre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ore(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,NR(r.key),r)}}function lre(e,t,n){return t&&ore(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cre(e,t,n){return t=Bh(t),ure(e,jR()?Reflect.construct(t,n||[],Bh(e).constructor):t.apply(e,n))}function ure(e,t){if(t&&(Zo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dre(e)}function dre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jR=function(){return!!e})()}function Bh(e){return Bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bh(e)}function fre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lb(e,t)}function lb(e,t){return lb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},lb(e,t)}function mN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function gN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mN(Object(n),!0).forEach(function(r){Ww(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ww(e,t,n){return t=NR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NR(e){var t=hre(e,"string");return Zo(t)=="symbol"?t:t+""}function hre(e,t){if(Zo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function pre(e,t){return yre(e)||vre(e,t)||gre(e,t)||mre()}function mre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
131
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gre(e,t){if(e){if(typeof e=="string")return vN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vN(e,t)}}function vN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function yre(e){if(Array.isArray(e))return e}function cb(){return cb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cb.apply(this,arguments)}var bre=function(t,n){var r;return G.isValidElement(t)?r=G.cloneElement(t,n):Le(t)?r=t(n):r=G.createElement("line",cb({},n,{className:"recharts-reference-line-line"})),r},xre=function(t,n,r,a,s,o,l,c,u){var d=s.x,f=s.y,h=s.width,p=s.height;if(r){var g=u.y,m=t.y.apply(g,{position:o});if(la(u,"discard")&&!t.y.isInRange(m))return null;var y=[{x:d+h,y:m},{x:d,y:m}];return c==="left"?y.reverse():y}if(n){var v=u.x,x=t.x.apply(v,{position:o});if(la(u,"discard")&&!t.x.isInRange(x))return null;var S=[{x,y:f+p},{x,y:f}];return l==="top"?S.reverse():S}if(a){var j=u.segment,w=j.map(function(b){return t.apply(b,{position:o})});return la(u,"discard")&&Wte(w,function(b){return!t.isInRange(b)})?null:w}return null};function wre(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,s=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=tre(),d=SR(a),f=kR(s),h=are();if(!u||!h)return null;Oa(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Dw({x:d.scale,y:f.scale}),g=Yt(t),m=Yt(n),y=r&&r.length===2,v=xre(p,g,m,y,h,e.position,d.orientation,f.orientation,e);if(!v)return null;var x=pre(v,2),S=x[0],j=S.x,w=S.y,b=x[1],N=b.x,E=b.y,T=la(e,"hidden")?"url(#".concat(u,")"):void 0,A=gN(gN({clipPath:T},Ke(e,!0)),{},{x1:j,y1:w,x2:N,y2:E});return G.createElement(en,{className:Ve("recharts-reference-line",l)},bre(o,A),kn.renderCallByParent(e,Pne({x1:j,y1:w,x2:N,y2:E})))}var Hw=function(e){function t(){return sre(this,t),cre(this,t,arguments)}return fre(t,e),lre(t,[{key:"render",value:function(){return G.createElement(wre,this.props)}}])}(G.Component);Ww(Hw,"displayName","ReferenceLine");Ww(Hw,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function ub(){return ub=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ub.apply(this,arguments)}function Jo(e){"@babel/helpers - typeof";return Jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(e)}function yN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yN(Object(n),!0).forEach(function(r){sm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_R(r.key),r)}}function jre(e,t,n){return t&&kre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nre(e,t,n){return t=zh(t),Ere(e,ER()?Reflect.construct(t,n||[],zh(e).constructor):t.apply(e,n))}function Ere(e,t){if(t&&(Jo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _re(e)}function _re(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ER(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ER=function(){return!!e})()}function zh(e){return zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zh(e)}function Are(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&db(e,t)}function db(e,t){return db=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},db(e,t)}function sm(e,t,n){return t=_R(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _R(e){var t=Cre(e,"string");return Jo(t)=="symbol"?t:t+""}function Cre(e,t){if(Jo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Tre=function(t){var n=t.x,r=t.y,a=t.xAxis,s=t.yAxis,o=Dw({x:a.scale,y:s.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return la(t,"discard")&&!o.isInRange(l)?null:l},om=function(e){function t(){return Sre(this,t),Nre(this,t,arguments)}return Are(t,e),jre(t,[{key:"render",value:function(){var r=this.props,a=r.x,s=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=Yt(a),d=Yt(s);if(Oa(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=Tre(this.props);if(!f)return null;var h=f.x,p=f.y,g=this.props,m=g.shape,y=g.className,v=la(this.props,"hidden")?"url(#".concat(c,")"):void 0,x=bN(bN({clipPath:v},Ke(this.props,!0)),{},{cx:h,cy:p});return G.createElement(en,{className:Ve("recharts-reference-dot",y)},t.renderDot(m,x),kn.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(G.Component);sm(om,"displayName","ReferenceDot");sm(om,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});sm(om,"renderDot",function(e,t){var n;return G.isValidElement(e)?n=G.cloneElement(e,t):Le(e)?n=e(t):n=G.createElement(aR,ub({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function fb(){return fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fb.apply(this,arguments)}function el(e){"@babel/helpers - typeof";return el=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},el(e)}function xN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function wN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xN(Object(n),!0).forEach(function(r){lm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ore(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CR(r.key),r)}}function Rre(e,t,n){return t&&Pre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mre(e,t,n){return t=Fh(t),Ire(e,AR()?Reflect.construct(t,n||[],Fh(e).constructor):t.apply(e,n))}function Ire(e,t){if(t&&(el(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $re(e)}function $re(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AR=function(){return!!e})()}function Fh(e){return Fh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Fh(e)}function Lre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hb(e,t)}function hb(e,t){return hb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},hb(e,t)}function lm(e,t,n){return t=CR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CR(e){var t=Dre(e,"string");return el(t)=="symbol"?t:t+""}function Dre(e,t){if(el(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(el(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Bre=function(t,n,r,a,s){var o=s.x1,l=s.x2,c=s.y1,u=s.y2,d=s.xAxis,f=s.yAxis;if(!d||!f)return null;var h=Dw({x:d.scale,y:f.scale}),p={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:r?h.y.apply(c,{position:"start"}):h.y.rangeMin},g={x:n?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return la(s,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:mR(p,g)},cm=function(e){function t(){return Ore(this,t),Mre(this,t,arguments)}return Lre(t,e),Rre(t,[{key:"render",value:function(){var r=this.props,a=r.x1,s=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;Oa(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Yt(a),h=Yt(s),p=Yt(o),g=Yt(l),m=this.props.shape;if(!f&&!h&&!p&&!g&&!m)return null;var y=Bre(f,h,p,g,this.props);if(!y&&!m)return null;var v=la(this.props,"hidden")?"url(#".concat(d,")"):void 0;return G.createElement(en,{className:Ve("recharts-reference-area",c)},t.renderRect(m,wN(wN({clipPath:v},Ke(this.props,!0)),y)),kn.renderCallByParent(this.props,y))}}])}(G.Component);lm(cm,"displayName","ReferenceArea");lm(cm,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});lm(cm,"renderRect",function(e,t){var n;return G.isValidElement(e)?n=G.cloneElement(e,t):Le(e)?n=e(t):n=G.createElement(Lw,fb({},t,{className:"recharts-reference-area-rect"})),n});function TR(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function zre(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Mne(r,n)}function Fre(e,t,n){var r=n==="width",a=e.x,s=e.y,o=e.width,l=e.height;return t===1?{start:r?a:s,end:r?a+o:s+l}:{start:r?a+o:s+l,end:r?a:s}}function Uh(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-a)<=0}function Ure(e,t){return TR(e,t+1)}function Wre(e,t,n,r,a){for(var s=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:TR(r,u)};var m=c,y,v=function(){return y===void 0&&(y=n(g,m)),y},x=g.coordinate,S=c===0||Uh(e,x,v,d,l);S||(c=0,d=o,u+=1),S&&(d=x+e*(v()/2+a),c+=u)},h;u<=s.length;)if(h=f(),h)return h.v;return[]}function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}function SN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SN(Object(n),!0).forEach(function(r){Hre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hre(e,t,n){return t=Gre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gre(e){var t=qre(e,"string");return Ru(t)=="symbol"?t:t+""}function qre(e,t){if(Ru(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kre(e,t,n,r,a){for(var s=(r||[]).slice(),o=s.length,l=t.start,c=t.end,u=function(h){var p=s[h],g,m=function(){return g===void 0&&(g=n(p,h)),g};if(h===o-1){var y=e*(p.coordinate+e*m()/2-c);s[h]=p=bn(bn({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate})}else s[h]=p=bn(bn({},p),{},{tickCoord:p.coordinate});var v=Uh(e,p.tickCoord,m,l,c);v&&(c=p.tickCoord-e*(m()/2+a),s[h]=bn(bn({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return s}function Vre(e,t,n,r,a,s){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(s){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=bn(bn({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=Uh(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+a),o[l-1]=bn(bn({},d),{},{isShow:!0}))}for(var g=s?l-1:l,m=function(x){var S=o[x],j,w=function(){return j===void 0&&(j=n(S,x)),j};if(x===0){var b=e*(S.coordinate-e*w()/2-c);o[x]=S=bn(bn({},S),{},{tickCoord:b<0?S.coordinate-b*e:S.coordinate})}else o[x]=S=bn(bn({},S),{},{tickCoord:S.coordinate});var N=Uh(e,S.tickCoord,w,c,u);N&&(c=S.tickCoord+e*(w()/2+a),o[x]=bn(bn({},S),{},{isShow:!0}))},y=0;y<g;y++)m(y);return o}function Gw(e,t,n){var r=e.tick,a=e.ticks,s=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!r)return[];if(fe(c)||Vu.isSsr)return Ure(a,typeof c=="number"&&fe(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=d&&p==="width"?Ec(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(S,j){var w=Le(u)?u(S.value,j):S.value;return p==="width"?zre(Ec(w,{fontSize:t,letterSpacing:n}),g,f):Ec(w,{fontSize:t,letterSpacing:n})[p]},y=a.length>=2?zr(a[1].coordinate-a[0].coordinate):1,v=Fre(s,y,p);return c==="equidistantPreserveStart"?Wre(y,v,m,a,o):(c==="preserveStart"||c==="preserveStartEnd"?h=Vre(y,v,m,a,o,c==="preserveStartEnd"):h=Kre(y,v,m,a,o),h.filter(function(x){return x.isShow}))}var Yre=["viewBox"],Xre=["viewBox"],Qre=["ticks"];function tl(e){"@babel/helpers - typeof";return tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tl(e)}function vo(){return vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vo.apply(this,arguments)}function kN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ht(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kN(Object(n),!0).forEach(function(r){qw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sg(e,t){if(e==null)return{};var n=Zre(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,PR(r.key),r)}}function eae(e,t,n){return t&&jN(e.prototype,t),n&&jN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tae(e,t,n){return t=Wh(t),nae(e,OR()?Reflect.construct(t,n||[],Wh(e).constructor):t.apply(e,n))}function nae(e,t){if(t&&(tl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rae(e)}function rae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OR=function(){return!!e})()}function Wh(e){return Wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wh(e)}function aae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pb(e,t)}function pb(e,t){return pb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},pb(e,t)}function qw(e,t,n){return t=PR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PR(e){var t=iae(e,"string");return tl(t)=="symbol"?t:t+""}function iae(e,t){if(tl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jl=function(e){function t(n){var r;return Jre(this,t),r=tae(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return aae(t,e),eae(t,[{key:"shouldComponentUpdate",value:function(r,a){var s=r.viewBox,o=Sg(r,Yre),l=this.props,c=l.viewBox,u=Sg(l,Xre);return!_o(s,c)||!_o(o,u)||!_o(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,s=a.x,o=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,h=a.tickMargin,p,g,m,y,v,x,S=f?-1:1,j=r.tickSize||d,w=fe(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=g=r.coordinate,y=o+ +!f*c,m=y-S*j,x=m-S*h,v=w;break;case"left":m=y=r.coordinate,g=s+ +!f*l,p=g-S*j,v=p-S*h,x=w;break;case"right":m=y=r.coordinate,g=s+ +f*l,p=g+S*j,v=p+S*h,x=w;break;default:p=g=r.coordinate,y=o+ +f*c,m=y+S*j,x=m+S*h,v=w;break}return{line:{x1:p,y1:m,x2:g,y2:y},tick:{x:v,y:x}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,s=r.mirror,o;switch(a){case"left":o=s?"start":"end";break;case"right":o=s?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,s=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=s?"start":"end";break;default:o=s?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,s=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=Ht(Ht(Ht({},Ke(this.props,!1)),Ke(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Ht(Ht({},f),{},{x1:a,y1:s+h*l,x2:a+o,y2:s+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=Ht(Ht({},f),{},{x1:a+p*o,y1:s,x2:a+p*o,y2:s+l})}return G.createElement("line",vo({},f,{className:Ve("recharts-cartesian-axis-line",kr(d,"className"))}))}},{key:"renderTicks",value:function(r,a,s){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=Gw(Ht(Ht({},this.props),{},{ticks:r}),a,s),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),y=Ke(this.props,!1),v=Ke(d,!1),x=Ht(Ht({},y),{},{fill:"none"},Ke(c,!1)),S=p.map(function(j,w){var b=o.getTickLineCoord(j),N=b.line,E=b.tick,T=Ht(Ht(Ht(Ht({textAnchor:g,verticalAnchor:m},y),{},{stroke:"none",fill:u},v),E),{},{index:w,payload:j,visibleTicksCount:p.length,tickFormatter:f});return G.createElement(en,vo({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},Yf(o.props,j,w)),c&&G.createElement("line",vo({},x,N,{className:Ve("recharts-cartesian-axis-tick-line",kr(c,"className"))})),d&&t.renderTickItem(d,T,"".concat(Le(f)?f(j.value,w):j.value).concat(h||"")))});return G.createElement("g",{className:"recharts-cartesian-axis-ticks"},S)}},{key:"render",value:function(){var r=this,a=this.props,s=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,u=a.className,d=a.hide;if(d)return null;var f=this.props,h=f.ticks,p=Sg(f,Qre),g=h;return Le(c)&&(g=h&&h.length>0?c(this.props):c(p)),o<=0||l<=0||!g||!g.length?null:G.createElement(en,{className:Ve("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},s&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),kn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,s){var o,l=Ve(a.className,"recharts-cartesian-axis-tick-value");return G.isValidElement(r)?o=G.cloneElement(r,Ht(Ht({},a),{},{className:l})):Le(r)?o=r(Ht(Ht({},a),{},{className:l})):o=G.createElement(ch,vo({},a,{className:"recharts-cartesian-axis-tick-value"}),s),o}}])}(k.Component);qw(jl,"displayName","CartesianAxis");qw(jl,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var sae=["x1","y1","x2","y2","key"],oae=["offset"];function Ns(e){"@babel/helpers - typeof";return Ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ns(e)}function NN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NN(Object(n),!0).forEach(function(r){lae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lae(e,t,n){return t=cae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cae(e){var t=uae(e,"string");return Ns(t)=="symbol"?t:t+""}function uae(e,t){if(Ns(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ns(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ss(){return ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ss.apply(this,arguments)}function EN(e,t){if(e==null)return{};var n=dae(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var fae=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,s=t.y,o=t.width,l=t.height,c=t.ry;return G.createElement("rect",{x:a,y:s,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function RR(e,t){var n;if(G.isValidElement(e))n=G.cloneElement(e,t);else if(Le(e))n=e(t);else{var r=t.x1,a=t.y1,s=t.x2,o=t.y2,l=t.key,c=EN(t,sae),u=Ke(c,!1);u.offset;var d=EN(u,oae);n=G.createElement("line",ss({},d,{x1:r,y1:a,x2:s,y2:o,fill:"none",key:l}))}return n}function hae(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,s=e.horizontalPoints;if(!a||!s||!s.length)return null;var o=s.map(function(l,c){var u=jn(jn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return RR(a,u)});return G.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function pae(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,s=e.verticalPoints;if(!a||!s||!s.length)return null;var o=s.map(function(l,c){var u=jn(jn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return RR(a,u)});return G.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function mae(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,s=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?a+o-h:d[p+1]-h;if(m<=0)return null;var y=p%t.length;return G.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:m,width:s,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return G.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function gae(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,s=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+s-s)}).sort(function(h,p){return h-p});s!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?s+l-h:d[p+1]-h;if(m<=0)return null;var y=p%r.length;return G.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:c,stroke:"none",fill:r[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return G.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var vae=function(t,n){var r=t.xAxis,a=t.width,s=t.height,o=t.offset;return UP(Gw(jn(jn(jn({},jl.defaultProps),r),{},{ticks:Aa(r,!0),viewBox:{x:0,y:0,width:a,height:s}})),o.left,o.left+o.width,n)},yae=function(t,n){var r=t.yAxis,a=t.width,s=t.height,o=t.offset;return UP(Gw(jn(jn(jn({},jl.defaultProps),r),{},{ticks:Aa(r,!0),viewBox:{x:0,y:0,width:a,height:s}})),o.top,o.top+o.height,n)},Vs={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function oi(e){var t,n,r,a,s,o,l=Fw(),c=Uw(),u=ire(),d=jn(jn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Vs.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Vs.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Vs.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Vs.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:Vs.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Vs.verticalFill,x:fe(e.x)?e.x:u.left,y:fe(e.y)?e.y:u.top,width:fe(e.width)?e.width:u.width,height:fe(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,y=d.horizontalValues,v=d.verticalValues,x=nre(),S=rre();if(!fe(p)||p<=0||!fe(g)||g<=0||!fe(f)||f!==+f||!fe(h)||h!==+h)return null;var j=d.verticalCoordinatesGenerator||vae,w=d.horizontalCoordinatesGenerator||yae,b=d.horizontalPoints,N=d.verticalPoints;if((!b||!b.length)&&Le(w)){var E=y&&y.length,T=w({yAxis:S?jn(jn({},S),{},{ticks:E?y:S.ticks}):void 0,width:l,height:c,offset:u},E?!0:m);Oa(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Ns(T),"]")),Array.isArray(T)&&(b=T)}if((!N||!N.length)&&Le(j)){var A=v&&v.length,M=j({xAxis:x?jn(jn({},x),{},{ticks:A?v:x.ticks}):void 0,width:l,height:c,offset:u},A?!0:m);Oa(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Ns(M),"]")),Array.isArray(M)&&(N=M)}return G.createElement("g",{className:"recharts-cartesian-grid"},G.createElement(fae,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),G.createElement(hae,ss({},d,{offset:u,horizontalPoints:b,xAxis:x,yAxis:S})),G.createElement(pae,ss({},d,{offset:u,verticalPoints:N,xAxis:x,yAxis:S})),G.createElement(mae,ss({},d,{horizontalPoints:b})),G.createElement(gae,ss({},d,{verticalPoints:N})))}oi.displayName="CartesianGrid";function nl(e){"@babel/helpers - typeof";return nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(e)}function bae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,$R(r.key),r)}}function wae(e,t,n){return t&&xae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sae(e,t,n){return t=Hh(t),kae(e,MR()?Reflect.construct(t,n||[],Hh(e).constructor):t.apply(e,n))}function kae(e,t){if(t&&(nl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jae(e)}function jae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MR=function(){return!!e})()}function Hh(e){return Hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hh(e)}function Nae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mb(e,t)}function mb(e,t){return mb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},mb(e,t)}function IR(e,t,n){return t=$R(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $R(e){var t=Eae(e,"string");return nl(t)=="symbol"?t:t+""}function Eae(e,t){if(nl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function gb(){return gb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gb.apply(this,arguments)}function _ae(e){var t=e.xAxisId,n=Fw(),r=Uw(),a=SR(t);return a==null?null:k.createElement(jl,gb({},a,{className:Ve("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Aa(o,!0)}}))}var na=function(e){function t(){return bae(this,t),Sae(this,t,arguments)}return Nae(t,e),wae(t,[{key:"render",value:function(){return k.createElement(_ae,this.props)}}])}(k.Component);IR(na,"displayName","XAxis");IR(na,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function rl(e){"@babel/helpers - typeof";return rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rl(e)}function Aae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,BR(r.key),r)}}function Tae(e,t,n){return t&&Cae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oae(e,t,n){return t=Gh(t),Pae(e,LR()?Reflect.construct(t,n||[],Gh(e).constructor):t.apply(e,n))}function Pae(e,t){if(t&&(rl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rae(e)}function Rae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LR=function(){return!!e})()}function Gh(e){return Gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gh(e)}function Mae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vb(e,t)}function vb(e,t){return vb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},vb(e,t)}function DR(e,t,n){return t=BR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BR(e){var t=Iae(e,"string");return rl(t)=="symbol"?t:t+""}function Iae(e,t){if(rl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function yb(){return yb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yb.apply(this,arguments)}var $ae=function(t){var n=t.yAxisId,r=Fw(),a=Uw(),s=kR(n);return s==null?null:k.createElement(jl,yb({},s,{className:Ve("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(l){return Aa(l,!0)}}))},ra=function(e){function t(){return Aae(this,t),Oae(this,t,arguments)}return Mae(t,e),Tae(t,[{key:"render",value:function(){return k.createElement($ae,this.props)}}])}(k.Component);DR(ra,"displayName","YAxis");DR(ra,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function _N(e){return zae(e)||Bae(e)||Dae(e)||Lae()}function Lae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
132
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dae(e,t){if(e){if(typeof e=="string")return bb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bb(e,t)}}function Bae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zae(e){if(Array.isArray(e))return bb(e)}function bb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xb=function(t,n,r,a,s){var o=Wr(t,Hw),l=Wr(t,om),c=[].concat(_N(o),_N(l)),u=Wr(t,cm),d="".concat(a,"Id"),f=a[0],h=n;if(c.length&&(h=c.reduce(function(m,y){if(y.props[d]===r&&la(y.props,"extendDomain")&&fe(y.props[f])){var v=y.props[f];return[Math.min(m[0],v),Math.max(m[1],v)]}return m},h)),u.length){var p="".concat(f,"1"),g="".concat(f,"2");h=u.reduce(function(m,y){if(y.props[d]===r&&la(y.props,"extendDomain")&&fe(y.props[p])&&fe(y.props[g])){var v=y.props[p],x=y.props[g];return[Math.min(m[0],v,x),Math.max(m[1],v,x)]}return m},h)}return s&&s.length&&(h=s.reduce(function(m,y){return fe(y)?[Math.min(m[0],y),Math.max(m[1],y)]:m},h)),h},zR={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new a(d,f||c,h),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=p,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,g=new Array(p);h<p;h++)g[h]=f[h].fn;return g},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var y=this._events[m],v=arguments.length,x,S;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),v){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,f),!0;case 4:return y.fn.call(y.context,d,f,h),!0;case 5:return y.fn.call(y.context,d,f,h,p),!0;case 6:return y.fn.call(y.context,d,f,h,p,g),!0}for(S=1,x=new Array(v-1);S<v;S++)x[S-1]=arguments[S];y.fn.apply(y.context,x)}else{var j=y.length,w;for(S=0;S<j;S++)switch(y[S].once&&this.removeListener(u,y[S].fn,void 0,!0),v){case 1:y[S].fn.call(y[S].context);break;case 2:y[S].fn.call(y[S].context,d);break;case 3:y[S].fn.call(y[S].context,d,f);break;case 4:y[S].fn.call(y[S].context,d,f,h);break;default:if(!x)for(w=1,x=new Array(v-1);w<v;w++)x[w-1]=arguments[w];y[S].fn.apply(y[S].context,x)}}return!0},l.prototype.on=function(u,d,f){return s(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return s(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=n?n+u:u;if(!this._events[p])return this;if(!d)return o(this,p),this;var g=this._events[p];if(g.fn)g.fn===d&&(!h||g.once)&&(!f||g.context===f)&&o(this,p);else{for(var m=0,y=[],v=g.length;m<v;m++)(g[m].fn!==d||h&&!g[m].once||f&&g[m].context!==f)&&y.push(g[m]);y.length?this._events[p]=y.length===1?y[0]:y:o(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(zR);var Fae=zR.exports;const Uae=Qe(Fae);var kg=new Uae,jg="recharts.syncMouseEvents";function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function Wae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,FR(r.key),r)}}function Gae(e,t,n){return t&&Hae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ng(e,t,n){return t=FR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FR(e){var t=qae(e,"string");return Mu(t)=="symbol"?t:t+""}function qae(e,t){if(Mu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Kae=function(){function e(){Wae(this,e),Ng(this,"activeIndex",0),Ng(this,"coordinateList",[]),Ng(this,"layout","horizontal")}return Gae(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,s=a===void 0?null:a,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,h=n.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(r=s??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),s=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=s+c+u,h=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function Vae(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],a=e==null?void 0:e[1];if(r&&a&&fe(r)&&fe(a))return!0}return!1}function Yae(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function UR(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,s=e.endAngle,o=hn(t,n,r,a),l=hn(t,n,r,s);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:a,endAngle:s}}function Xae(e,t,n){var r,a,s,o;if(e==="horizontal")r=t.x,s=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,s=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=hn(l,c,u,f),p=hn(l,c,d,f);r=h.x,a=h.y,s=p.x,o=p.y}else return UR(t);return[{x:r,y:a},{x:s,y:o}]}function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function AN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Wd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AN(Object(n),!0).forEach(function(r){Qae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qae(e,t,n){return t=Zae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zae(e){var t=Jae(e,"string");return Iu(t)=="symbol"?t:t+""}function Jae(e,t){if(Iu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Iu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eie(e){var t,n,r=e.element,a=e.tooltipEventType,s=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,p=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!p||!s||!o||h!=="ScatterChart"&&a!=="axis")return null;var g,m=Aj;if(h==="ScatterChart")g=o,m=hee;else if(h==="BarChart")g=Yae(f,o,c,d),m=Lw;else if(f==="radial"){var y=UR(o),v=y.cx,x=y.cy,S=y.radius,j=y.startAngle,w=y.endAngle;g={cx:v,cy:x,startAngle:j,endAngle:w,innerRadius:S,outerRadius:S},m=KP}else g={points:Xae(f,o,c)},m=Aj;var b=Wd(Wd(Wd(Wd({stroke:"#ccc",pointerEvents:"none"},c),g),Ke(p,!1)),{},{payload:l,payloadIndex:u,className:Ve("recharts-tooltip-cursor",p.className)});return k.isValidElement(p)?k.cloneElement(p,b):k.createElement(m,b)}var tie=["item"],nie=["children","className","width","height","style","compact","title","desc"];function al(e){"@babel/helpers - typeof";return al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},al(e)}function yo(){return yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yo.apply(this,arguments)}function CN(e,t){return iie(e)||aie(e,t)||HR(e,t)||rie()}function rie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
133
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function iie(e){if(Array.isArray(e))return e}function TN(e,t){if(e==null)return{};var n=sie(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sie(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function oie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GR(r.key),r)}}function cie(e,t,n){return t&&lie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function uie(e,t,n){return t=qh(t),die(e,WR()?Reflect.construct(t,n||[],qh(e).constructor):t.apply(e,n))}function die(e,t){if(t&&(al(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fie(e)}function fie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WR=function(){return!!e})()}function qh(e){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qh(e)}function hie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wb(e,t)}function wb(e,t){return wb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},wb(e,t)}function il(e){return gie(e)||mie(e)||HR(e)||pie()}function pie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
134
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HR(e,t){if(e){if(typeof e=="string")return Sb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sb(e,t)}}function mie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gie(e){if(Array.isArray(e))return Sb(e)}function Sb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ON(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ON(Object(n),!0).forEach(function(r){Ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ON(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ce(e,t,n){return t=GR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GR(e){var t=vie(e,"string");return al(t)=="symbol"?t:t+""}function vie(e,t){if(al(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(al(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yie={xAxis:["bottom","top"],yAxis:["left","right"]},bie={width:"100%",height:"100%"},qR={x:0,y:0};function Hd(e){return e}var xie=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},wie=function(t,n,r,a){var s=n.find(function(d){return d&&d.index===r});if(s){if(t==="horizontal")return{x:s.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:s.coordinate};if(t==="centric"){var o=s.coordinate,l=a.radius;return J(J(J({},a),hn(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=s.coordinate,u=a.angle;return J(J(J({},a),hn(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return qR},um=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,s=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(il(l),il(u)):l},[]);return o.length>0?o:t&&t.length&&fe(a)&&fe(s)?t.slice(a,s+1):[]};function KR(e){return e==="number"?[0,"auto"]:void 0}var kb=function(t,n,r,a){var s=t.graphicalItems,o=t.tooltipAxis,l=um(n,t);return r<0||!s||!s.length||r>=l.length?null:s.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=f===void 0?l:f;h=ny(p,o.dataKey,a)}else h=f&&f[r]||l[r];return h?[].concat(il(c),[HP(u,h)]):c},[])},PN=function(t,n,r,a){var s=a||{x:t.chartX,y:t.chartY},o=xie(s,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=GX(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=kb(t,n,d,f),p=wie(r,l,d,s);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},Sie=function(t,n){var r=n.axes,a=n.graphicalItems,s=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=FP(d,s);return r.reduce(function(g,m){var y,v=m.type.defaultProps!==void 0?J(J({},m.type.defaultProps),m.props):m.props,x=v.type,S=v.dataKey,j=v.allowDataOverflow,w=v.allowDuplicatedCategory,b=v.scale,N=v.ticks,E=v.includeHidden,T=v[o];if(g[T])return g;var A=um(t.data,{graphicalItems:a.filter(function(D){var P,ie=o in D.props?D.props[o]:(P=D.type.defaultProps)===null||P===void 0?void 0:P[o];return ie===T}),dataStartIndex:c,dataEndIndex:u}),M=A.length,R,B,L;Vae(v.domain,j,x)&&(R=Wy(v.domain,null,j),p&&(x==="number"||b!=="auto")&&(L=Ac(A,S,"category")));var F=KR(x);if(!R||R.length===0){var z,$=(z=v.domain)!==null&&z!==void 0?z:F;if(S){if(R=Ac(A,S,x),x==="category"&&p){var O=RU(R);w&&O?(B=R,R=Mh(0,M)):w||(R=mj($,R,m).reduce(function(D,P){return D.indexOf(P)>=0?D:[].concat(il(D),[P])},[]))}else if(x==="category")w?R=R.filter(function(D){return D!==""&&!Ye(D)}):R=mj($,R,m).reduce(function(D,P){return D.indexOf(P)>=0||P===""||Ye(P)?D:[].concat(il(D),[P])},[]);else if(x==="number"){var U=XX(A,a.filter(function(D){var P,ie,ve=o in D.props?D.props[o]:(P=D.type.defaultProps)===null||P===void 0?void 0:P[o],pe="hide"in D.props?D.props.hide:(ie=D.type.defaultProps)===null||ie===void 0?void 0:ie.hide;return ve===T&&(E||!pe)}),S,s,d);U&&(R=U)}p&&(x==="number"||b!=="auto")&&(L=Ac(A,S,"category"))}else p?R=Mh(0,M):l&&l[T]&&l[T].hasStack&&x==="number"?R=h==="expand"?[0,1]:WP(l[T].stackGroups,c,u):R=zP(A,a.filter(function(D){var P=o in D.props?D.props[o]:D.type.defaultProps[o],ie="hide"in D.props?D.props.hide:D.type.defaultProps.hide;return P===T&&(E||!ie)}),x,d,!0);if(x==="number")R=xb(f,R,T,s,N),$&&(R=Wy($,R,j));else if(x==="category"&&$){var C=$,Z=R.every(function(D){return C.indexOf(D)>=0});Z&&(R=C)}}return J(J({},g),{},Ce({},T,J(J({},v),{},{axisType:s,domain:R,categoricalDomain:L,duplicateDomain:B,originalDomain:(y=v.domain)!==null&&y!==void 0?y:F,isCategorical:p,layout:d})))},{})},kie=function(t,n){var r=n.graphicalItems,a=n.Axis,s=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=um(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=FP(d,s),m=-1;return r.reduce(function(y,v){var x=v.type.defaultProps!==void 0?J(J({},v.type.defaultProps),v.props):v.props,S=x[o],j=KR("number");if(!y[S]){m++;var w;return g?w=Mh(0,p):l&&l[S]&&l[S].hasStack?(w=WP(l[S].stackGroups,c,u),w=xb(f,w,S,s)):(w=Wy(j,zP(h,r.filter(function(b){var N,E,T=o in b.props?b.props[o]:(N=b.type.defaultProps)===null||N===void 0?void 0:N[o],A="hide"in b.props?b.props.hide:(E=b.type.defaultProps)===null||E===void 0?void 0:E.hide;return T===S&&!A}),"number",d),a.defaultProps.allowDataOverflow),w=xb(f,w,S,s)),J(J({},y),{},Ce({},S,J(J({axisType:s},a.defaultProps),{},{hide:!0,orientation:kr(yie,"".concat(s,".").concat(m%2),null),domain:w,originalDomain:j,isCategorical:g,layout:d})))}return y},{})},jie=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,s=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=Wr(d,s),p={};return h&&h.length?p=Sie(t,{axes:h,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=kie(t,{Axis:s,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},Nie=function(t){var n=si(t),r=Aa(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:cw(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:jh(n,r)}},RN=function(t){var n=t.children,r=t.defaultShowTooltip,a=er(n,Xo),s=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(s=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},Eie=function(t){return!t||!t.length?!1:t.some(function(n){var r=Ta(n&&n.type);return r&&r.indexOf("Bar")>=0})},MN=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},_ie=function(t,n){var r=t.props,a=t.graphicalItems,s=t.xAxisMap,o=s===void 0?{}:s,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=er(f,Xo),g=er(f,us),m=Object.keys(c).reduce(function(w,b){var N=c[b],E=N.orientation;return!N.mirror&&!N.hide?J(J({},w),{},Ce({},E,w[E]+N.width)):w},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(w,b){var N=o[b],E=N.orientation;return!N.mirror&&!N.hide?J(J({},w),{},Ce({},E,kr(w,"".concat(E))+N.height)):w},{top:h.top||0,bottom:h.bottom||0}),v=J(J({},y),m),x=v.bottom;p&&(v.bottom+=p.props.height||Xo.defaultProps.height),g&&n&&(v=VX(v,a,r,n));var S=u-v.left-v.right,j=d-v.top-v.bottom;return J(J({brushBottom:x},v),{},{width:Math.max(S,0),height:Math.max(j,0)})},Aie=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Cie=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,s=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(v,x){var S=x.graphicalItems,j=x.stackGroups,w=x.offset,b=x.updateId,N=x.dataStartIndex,E=x.dataEndIndex,T=v.barSize,A=v.layout,M=v.barGap,R=v.barCategoryGap,B=v.maxBarSize,L=MN(A),F=L.numericAxisName,z=L.cateAxisName,$=Eie(S),O=[];return S.forEach(function(U,C){var Z=um(v.data,{graphicalItems:[U],dataStartIndex:N,dataEndIndex:E}),D=U.type.defaultProps!==void 0?J(J({},U.type.defaultProps),U.props):U.props,P=D.dataKey,ie=D.maxBarSize,ve=D["".concat(F,"Id")],pe=D["".concat(z,"Id")],Te={},q=c.reduce(function(Ae,Ze){var yt=x["".concat(Ze.axisType,"Map")],An=D["".concat(Ze.axisType,"Id")];yt&&yt[An]||Ze.axisType==="zAxis"||js();var bt=yt[An];return J(J({},Ae),{},Ce(Ce({},Ze.axisType,bt),"".concat(Ze.axisType,"Ticks"),Aa(bt)))},Te),X=q[z],oe=q["".concat(z,"Ticks")],ue=j&&j[ve]&&j[ve].hasStack&&lQ(U,j[ve].stackGroups),V=Ta(U.type).indexOf("Bar")>=0,_e=jh(X,oe),je=[],Ne=$&&qX({barSize:T,stackGroups:j,totalSize:Aie(q,z)});if(V){var ge,ze,me=Ye(ie)?B:ie,ft=(ge=(ze=jh(X,oe,!0))!==null&&ze!==void 0?ze:me)!==null&&ge!==void 0?ge:0;je=KX({barGap:M,barCategoryGap:R,bandSize:ft!==_e?ft:_e,sizeList:Ne[pe],maxBarSize:me}),ft!==_e&&(je=je.map(function(Ae){return J(J({},Ae),{},{position:J(J({},Ae.position),{},{offset:Ae.position.offset-ft/2})})}))}var Ge=U&&U.type&&U.type.getComposedData;Ge&&O.push({props:J(J({},Ge(J(J({},q),{},{displayedData:Z,props:v,dataKey:P,item:U,bandSize:_e,barPosition:je,offset:w,stackedData:ue,layout:A,dataStartIndex:N,dataEndIndex:E}))),{},Ce(Ce(Ce({key:U.key||"item-".concat(C)},F,q[F]),z,q[z]),"animationId",b)),childIndex:GU(U,v.children),item:U})}),O},p=function(v,x){var S=v.props,j=v.dataStartIndex,w=v.dataEndIndex,b=v.updateId;if(!ck({props:S}))return null;var N=S.children,E=S.layout,T=S.stackOffset,A=S.data,M=S.reverseStackOrder,R=MN(E),B=R.numericAxisName,L=R.cateAxisName,F=Wr(N,r),z=iQ(A,F,"".concat(B,"Id"),"".concat(L,"Id"),T,M),$=c.reduce(function(D,P){var ie="".concat(P.axisType,"Map");return J(J({},D),{},Ce({},ie,jie(S,J(J({},P),{},{graphicalItems:F,stackGroups:P.axisType===B&&z,dataStartIndex:j,dataEndIndex:w}))))},{}),O=_ie(J(J({},$),{},{props:S,graphicalItems:F}),x==null?void 0:x.legendBBox);Object.keys($).forEach(function(D){$[D]=d(S,$[D],O,D.replace("Map",""),n)});var U=$["".concat(L,"Map")],C=Nie(U),Z=h(S,J(J({},$),{},{dataStartIndex:j,dataEndIndex:w,updateId:b,graphicalItems:F,stackGroups:z,offset:O}));return J(J({formattedGraphicalItems:Z,graphicalItems:F,offset:O,stackGroups:z},C),$)},g=function(y){function v(x){var S,j,w;return oie(this,v),w=uie(this,v,[x]),Ce(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ce(w,"accessibilityManager",new Kae),Ce(w,"handleLegendBBoxUpdate",function(b){if(b){var N=w.state,E=N.dataStartIndex,T=N.dataEndIndex,A=N.updateId;w.setState(J({legendBBox:b},p({props:w.props,dataStartIndex:E,dataEndIndex:T,updateId:A},J(J({},w.state),{},{legendBBox:b}))))}}),Ce(w,"handleReceiveSyncEvent",function(b,N,E){if(w.props.syncId===b){if(E===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(N)}}),Ce(w,"handleBrushChange",function(b){var N=b.startIndex,E=b.endIndex;if(N!==w.state.dataStartIndex||E!==w.state.dataEndIndex){var T=w.state.updateId;w.setState(function(){return J({dataStartIndex:N,dataEndIndex:E},p({props:w.props,dataStartIndex:N,dataEndIndex:E,updateId:T},w.state))}),w.triggerSyncEvent({dataStartIndex:N,dataEndIndex:E})}}),Ce(w,"handleMouseEnter",function(b){var N=w.getMouseInfo(b);if(N){var E=J(J({},N),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var T=w.props.onMouseEnter;Le(T)&&T(E,b)}}),Ce(w,"triggeredAfterMouseMove",function(b){var N=w.getMouseInfo(b),E=N?J(J({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(E),w.triggerSyncEvent(E);var T=w.props.onMouseMove;Le(T)&&T(E,b)}),Ce(w,"handleItemMouseEnter",function(b){w.setState(function(){return{isTooltipActive:!0,activeItem:b,activePayload:b.tooltipPayload,activeCoordinate:b.tooltipPosition||{x:b.cx,y:b.cy}}})}),Ce(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Ce(w,"handleMouseMove",function(b){b.persist(),w.throttleTriggeredAfterMouseMove(b)}),Ce(w,"handleMouseLeave",function(b){w.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};w.setState(N),w.triggerSyncEvent(N);var E=w.props.onMouseLeave;Le(E)&&E(N,b)}),Ce(w,"handleOuterEvent",function(b){var N=HU(b),E=kr(w.props,"".concat(N));if(N&&Le(E)){var T,A;/.*touch.*/i.test(N)?A=w.getMouseInfo(b.changedTouches[0]):A=w.getMouseInfo(b),E((T=A)!==null&&T!==void 0?T:{},b)}}),Ce(w,"handleClick",function(b){var N=w.getMouseInfo(b);if(N){var E=J(J({},N),{},{isTooltipActive:!0});w.setState(E),w.triggerSyncEvent(E);var T=w.props.onClick;Le(T)&&T(E,b)}}),Ce(w,"handleMouseDown",function(b){var N=w.props.onMouseDown;if(Le(N)){var E=w.getMouseInfo(b);N(E,b)}}),Ce(w,"handleMouseUp",function(b){var N=w.props.onMouseUp;if(Le(N)){var E=w.getMouseInfo(b);N(E,b)}}),Ce(w,"handleTouchMove",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(b.changedTouches[0])}),Ce(w,"handleTouchStart",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&w.handleMouseDown(b.changedTouches[0])}),Ce(w,"handleTouchEnd",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&w.handleMouseUp(b.changedTouches[0])}),Ce(w,"handleDoubleClick",function(b){var N=w.props.onDoubleClick;if(Le(N)){var E=w.getMouseInfo(b);N(E,b)}}),Ce(w,"handleContextMenu",function(b){var N=w.props.onContextMenu;if(Le(N)){var E=w.getMouseInfo(b);N(E,b)}}),Ce(w,"triggerSyncEvent",function(b){w.props.syncId!==void 0&&kg.emit(jg,w.props.syncId,b,w.eventEmitterSymbol)}),Ce(w,"applySyncEvent",function(b){var N=w.props,E=N.layout,T=N.syncMethod,A=w.state.updateId,M=b.dataStartIndex,R=b.dataEndIndex;if(b.dataStartIndex!==void 0||b.dataEndIndex!==void 0)w.setState(J({dataStartIndex:M,dataEndIndex:R},p({props:w.props,dataStartIndex:M,dataEndIndex:R,updateId:A},w.state)));else if(b.activeTooltipIndex!==void 0){var B=b.chartX,L=b.chartY,F=b.activeTooltipIndex,z=w.state,$=z.offset,O=z.tooltipTicks;if(!$)return;if(typeof T=="function")F=T(O,b);else if(T==="value"){F=-1;for(var U=0;U<O.length;U++)if(O[U].value===b.activeLabel){F=U;break}}var C=J(J({},$),{},{x:$.left,y:$.top}),Z=Math.min(B,C.x+C.width),D=Math.min(L,C.y+C.height),P=O[F]&&O[F].value,ie=kb(w.state,w.props.data,F),ve=O[F]?{x:E==="horizontal"?O[F].coordinate:Z,y:E==="horizontal"?D:O[F].coordinate}:qR;w.setState(J(J({},b),{},{activeLabel:P,activeCoordinate:ve,activePayload:ie,activeTooltipIndex:F}))}else w.setState(b)}),Ce(w,"renderCursor",function(b){var N,E=w.state,T=E.isTooltipActive,A=E.activeCoordinate,M=E.activePayload,R=E.offset,B=E.activeTooltipIndex,L=E.tooltipAxisBandSize,F=w.getTooltipEventType(),z=(N=b.props.active)!==null&&N!==void 0?N:T,$=w.props.layout,O=b.key||"_recharts-cursor";return G.createElement(eie,{key:O,activeCoordinate:A,activePayload:M,activeTooltipIndex:B,chartName:n,element:b,isActive:z,layout:$,offset:R,tooltipAxisBandSize:L,tooltipEventType:F})}),Ce(w,"renderPolarAxis",function(b,N,E){var T=kr(b,"type.axisType"),A=kr(w.state,"".concat(T,"Map")),M=b.type.defaultProps,R=M!==void 0?J(J({},M),b.props):b.props,B=A&&A[R["".concat(T,"Id")]];return k.cloneElement(b,J(J({},B),{},{className:Ve(T,B.className),key:b.key||"".concat(N,"-").concat(E),ticks:Aa(B,!0)}))}),Ce(w,"renderPolarGrid",function(b){var N=b.props,E=N.radialLines,T=N.polarAngles,A=N.polarRadius,M=w.state,R=M.radiusAxisMap,B=M.angleAxisMap,L=si(R),F=si(B),z=F.cx,$=F.cy,O=F.innerRadius,U=F.outerRadius;return k.cloneElement(b,{polarAngles:Array.isArray(T)?T:Aa(F,!0).map(function(C){return C.coordinate}),polarRadius:Array.isArray(A)?A:Aa(L,!0).map(function(C){return C.coordinate}),cx:z,cy:$,innerRadius:O,outerRadius:U,key:b.key||"polar-grid",radialLines:E})}),Ce(w,"renderLegend",function(){var b=w.state.formattedGraphicalItems,N=w.props,E=N.children,T=N.width,A=N.height,M=w.props.margin||{},R=T-(M.left||0)-(M.right||0),B=DP({children:E,formattedGraphicalItems:b,legendWidth:R,legendContent:u});if(!B)return null;var L=B.item,F=TN(B,tie);return k.cloneElement(L,J(J({},F),{},{chartWidth:T,chartHeight:A,margin:M,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Ce(w,"renderTooltip",function(){var b,N=w.props,E=N.children,T=N.accessibilityLayer,A=er(E,wn);if(!A)return null;var M=w.state,R=M.isTooltipActive,B=M.activeCoordinate,L=M.activePayload,F=M.activeLabel,z=M.offset,$=(b=A.props.active)!==null&&b!==void 0?b:R;return k.cloneElement(A,{viewBox:J(J({},z),{},{x:z.left,y:z.top}),active:$,label:F,payload:$?L:[],coordinate:B,accessibilityLayer:T})}),Ce(w,"renderBrush",function(b){var N=w.props,E=N.margin,T=N.data,A=w.state,M=A.offset,R=A.dataStartIndex,B=A.dataEndIndex,L=A.updateId;return k.cloneElement(b,{key:b.key||"_recharts-brush",onChange:Bd(w.handleBrushChange,b.props.onChange),data:T,x:fe(b.props.x)?b.props.x:M.left,y:fe(b.props.y)?b.props.y:M.top+M.height+M.brushBottom-(E.bottom||0),width:fe(b.props.width)?b.props.width:M.width,startIndex:R,endIndex:B,updateId:"brush-".concat(L)})}),Ce(w,"renderReferenceElement",function(b,N,E){if(!b)return null;var T=w,A=T.clipPathId,M=w.state,R=M.xAxisMap,B=M.yAxisMap,L=M.offset,F=b.type.defaultProps||{},z=b.props,$=z.xAxisId,O=$===void 0?F.xAxisId:$,U=z.yAxisId,C=U===void 0?F.yAxisId:U;return k.cloneElement(b,{key:b.key||"".concat(N,"-").concat(E),xAxis:R[O],yAxis:B[C],viewBox:{x:L.left,y:L.top,width:L.width,height:L.height},clipPathId:A})}),Ce(w,"renderActivePoints",function(b){var N=b.item,E=b.activePoint,T=b.basePoint,A=b.childIndex,M=b.isRange,R=[],B=N.props.key,L=N.item.type.defaultProps!==void 0?J(J({},N.item.type.defaultProps),N.item.props):N.item.props,F=L.activeDot,z=L.dataKey,$=J(J({index:A,dataKey:z,cx:E.x,cy:E.y,r:4,fill:$w(N.item),strokeWidth:2,stroke:"#fff",payload:E.payload,value:E.value},Ke(F,!1)),Vf(F));return R.push(v.renderActiveDot(F,$,"".concat(B,"-activePoint-").concat(A))),T?R.push(v.renderActiveDot(F,J(J({},$),{},{cx:T.x,cy:T.y}),"".concat(B,"-basePoint-").concat(A))):M&&R.push(null),R}),Ce(w,"renderGraphicChild",function(b,N,E){var T=w.filterFormatItem(b,N,E);if(!T)return null;var A=w.getTooltipEventType(),M=w.state,R=M.isTooltipActive,B=M.tooltipAxis,L=M.activeTooltipIndex,F=M.activeLabel,z=w.props.children,$=er(z,wn),O=T.props,U=O.points,C=O.isRange,Z=O.baseLine,D=T.item.type.defaultProps!==void 0?J(J({},T.item.type.defaultProps),T.item.props):T.item.props,P=D.activeDot,ie=D.hide,ve=D.activeBar,pe=D.activeShape,Te=!!(!ie&&R&&$&&(P||ve||pe)),q={};A!=="axis"&&$&&$.props.trigger==="click"?q={onClick:Bd(w.handleItemMouseEnter,b.props.onClick)}:A!=="axis"&&(q={onMouseLeave:Bd(w.handleItemMouseLeave,b.props.onMouseLeave),onMouseEnter:Bd(w.handleItemMouseEnter,b.props.onMouseEnter)});var X=k.cloneElement(b,J(J({},T.props),q));function oe(Ze){return typeof B.dataKey=="function"?B.dataKey(Ze.payload):null}if(Te)if(L>=0){var ue,V;if(B.dataKey&&!B.allowDuplicatedCategory){var _e=typeof B.dataKey=="function"?oe:"payload.".concat(B.dataKey.toString());ue=ny(U,_e,F),V=C&&Z&&ny(Z,_e,F)}else ue=U==null?void 0:U[L],V=C&&Z&&Z[L];if(pe||ve){var je=b.props.activeIndex!==void 0?b.props.activeIndex:L;return[k.cloneElement(b,J(J(J({},T.props),q),{},{activeIndex:je})),null,null]}if(!Ye(ue))return[X].concat(il(w.renderActivePoints({item:T,activePoint:ue,basePoint:V,childIndex:L,isRange:C})))}else{var Ne,ge=(Ne=w.getItemByXY(w.state.activeCoordinate))!==null&&Ne!==void 0?Ne:{graphicalItem:X},ze=ge.graphicalItem,me=ze.item,ft=me===void 0?b:me,Ge=ze.childIndex,Ae=J(J(J({},T.props),q),{},{activeIndex:Ge});return[k.cloneElement(ft,Ae),null,null]}return C?[X,null,null]:[X,null]}),Ce(w,"renderCustomized",function(b,N,E){return k.cloneElement(b,J(J({key:"recharts-customized-".concat(E)},w.props),w.state))}),Ce(w,"renderMap",{CartesianGrid:{handler:Hd,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:Hd},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:Hd},YAxis:{handler:Hd},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((S=x.id)!==null&&S!==void 0?S:Dp("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=BO(w.triggeredAfterMouseMove,(j=x.throttleDelay)!==null&&j!==void 0?j:1e3/60),w.state={},w}return hie(v,y),cie(v,[{key:"componentDidMount",value:function(){var S,j;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var S=this.props,j=S.children,w=S.data,b=S.height,N=S.layout,E=er(j,wn);if(E){var T=E.props.defaultIndex;if(!(typeof T!="number"||T<0||T>this.state.tooltipTicks.length-1)){var A=this.state.tooltipTicks[T]&&this.state.tooltipTicks[T].value,M=kb(this.state,w,T,A),R=this.state.tooltipTicks[T].coordinate,B=(this.state.offset.top+b)/2,L=N==="horizontal",F=L?{x:R,y:B}:{y:R,x:B},z=this.state.formattedGraphicalItems.find(function(O){var U=O.item;return U.type.name==="Scatter"});z&&(F=J(J({},F),z.props.points[T].tooltipPosition),M=z.props.points[T].tooltipPayload);var $={activeTooltipIndex:T,isTooltipActive:!0,activeLabel:A,activePayload:M,activeCoordinate:F};this.setState($),this.renderCursor(E),this.accessibilityManager.setIndex(T)}}}},{key:"getSnapshotBeforeUpdate",value:function(S,j){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==j.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==S.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==S.margin){var w,b;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0}})}return null}},{key:"componentDidUpdate",value:function(S){ay([er(S.children,wn)],[er(this.props.children,wn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var S=er(this.props.children,wn);if(S&&typeof S.props.shared=="boolean"){var j=S.props.shared?"axis":"item";return l.indexOf(j)>=0?j:s}return s}},{key:"getMouseInfo",value:function(S){if(!this.container)return null;var j=this.container,w=j.getBoundingClientRect(),b=vK(w),N={chartX:Math.round(S.pageX-b.left),chartY:Math.round(S.pageY-b.top)},E=w.width/j.offsetWidth||1,T=this.inRange(N.chartX,N.chartY,E);if(!T)return null;var A=this.state,M=A.xAxisMap,R=A.yAxisMap,B=this.getTooltipEventType(),L=PN(this.state,this.props.data,this.props.layout,T);if(B!=="axis"&&M&&R){var F=si(M).scale,z=si(R).scale,$=F&&F.invert?F.invert(N.chartX):null,O=z&&z.invert?z.invert(N.chartY):null;return J(J({},N),{},{xValue:$,yValue:O},L)}return L?J(J({},N),L):null}},{key:"inRange",value:function(S,j){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,b=this.props.layout,N=S/w,E=j/w;if(b==="horizontal"||b==="vertical"){var T=this.state.offset,A=N>=T.left&&N<=T.left+T.width&&E>=T.top&&E<=T.top+T.height;return A?{x:N,y:E}:null}var M=this.state,R=M.angleAxisMap,B=M.radiusAxisMap;if(R&&B){var L=si(R);return yj({x:N,y:E},L)}return null}},{key:"parseEventsOfWrapper",value:function(){var S=this.props.children,j=this.getTooltipEventType(),w=er(S,wn),b={};w&&j==="axis"&&(w.props.trigger==="click"?b={onClick:this.handleClick}:b={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var N=Vf(this.props,this.handleOuterEvent);return J(J({},N),b)}},{key:"addListener",value:function(){kg.on(jg,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){kg.removeListener(jg,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(S,j,w){for(var b=this.state.formattedGraphicalItems,N=0,E=b.length;N<E;N++){var T=b[N];if(T.item===S||T.props.key===S.key||j===Ta(T.item.type)&&w===T.childIndex)return T}return null}},{key:"renderClipPath",value:function(){var S=this.clipPathId,j=this.state.offset,w=j.left,b=j.top,N=j.height,E=j.width;return G.createElement("defs",null,G.createElement("clipPath",{id:S},G.createElement("rect",{x:w,y:b,height:N,width:E})))}},{key:"getXScales",value:function(){var S=this.state.xAxisMap;return S?Object.entries(S).reduce(function(j,w){var b=CN(w,2),N=b[0],E=b[1];return J(J({},j),{},Ce({},N,E.scale))},{}):null}},{key:"getYScales",value:function(){var S=this.state.yAxisMap;return S?Object.entries(S).reduce(function(j,w){var b=CN(w,2),N=b[0],E=b[1];return J(J({},j),{},Ce({},N,E.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(S){var j;return(j=this.state.xAxisMap)===null||j===void 0||(j=j[S])===null||j===void 0?void 0:j.scale}},{key:"getYScaleByAxisId",value:function(S){var j;return(j=this.state.yAxisMap)===null||j===void 0||(j=j[S])===null||j===void 0?void 0:j.scale}},{key:"getItemByXY",value:function(S){var j=this.state,w=j.formattedGraphicalItems,b=j.activeItem;if(w&&w.length)for(var N=0,E=w.length;N<E;N++){var T=w[N],A=T.props,M=T.item,R=M.type.defaultProps!==void 0?J(J({},M.type.defaultProps),M.props):M.props,B=Ta(M.type);if(B==="Bar"){var L=(A.data||[]).find(function(O){return ree(S,O)});if(L)return{graphicalItem:T,payload:L}}else if(B==="RadialBar"){var F=(A.data||[]).find(function(O){return yj(S,O)});if(F)return{graphicalItem:T,payload:F}}else if(rm(T,b)||am(T,b)||Cu(T,b)){var z=ste({graphicalItem:T,activeTooltipItem:b,itemData:R.data}),$=R.activeIndex===void 0?z:R.activeIndex;return{graphicalItem:J(J({},T),{},{childIndex:$}),payload:Cu(T,b)?R.data[z]:T.props.data[z]}}}return null}},{key:"render",value:function(){var S=this;if(!ck(this))return null;var j=this.props,w=j.children,b=j.className,N=j.width,E=j.height,T=j.style,A=j.compact,M=j.title,R=j.desc,B=TN(j,nie),L=Ke(B,!1);if(A)return G.createElement(pN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},G.createElement(sy,yo({},L,{width:N,height:E,title:M,desc:R}),this.renderClipPath(),dk(w,this.renderMap)));if(this.props.accessibilityLayer){var F,z;L.tabIndex=(F=this.props.tabIndex)!==null&&F!==void 0?F:0,L.role=(z=this.props.role)!==null&&z!==void 0?z:"application",L.onKeyDown=function(O){S.accessibilityManager.keyboardEvent(O)},L.onFocus=function(){S.accessibilityManager.focus()}}var $=this.parseEventsOfWrapper();return G.createElement(pN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},G.createElement("div",yo({className:Ve("recharts-wrapper",b),style:J({position:"relative",cursor:"default",width:N,height:E},T)},$,{ref:function(U){S.container=U}}),G.createElement(sy,yo({},L,{width:N,height:E,title:M,desc:R,style:bie}),this.renderClipPath(),dk(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(k.Component);Ce(g,"displayName",n),Ce(g,"defaultProps",J({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Ce(g,"getDerivedStateFromProps",function(y,v){var x=y.dataKey,S=y.data,j=y.children,w=y.width,b=y.height,N=y.layout,E=y.stackOffset,T=y.margin,A=v.dataStartIndex,M=v.dataEndIndex;if(v.updateId===void 0){var R=RN(y);return J(J(J({},R),{},{updateId:0},p(J(J({props:y},R),{},{updateId:0}),v)),{},{prevDataKey:x,prevData:S,prevWidth:w,prevHeight:b,prevLayout:N,prevStackOffset:E,prevMargin:T,prevChildren:j})}if(x!==v.prevDataKey||S!==v.prevData||w!==v.prevWidth||b!==v.prevHeight||N!==v.prevLayout||E!==v.prevStackOffset||!_o(T,v.prevMargin)){var B=RN(y),L={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},F=J(J({},PN(v,S,N)),{},{updateId:v.updateId+1}),z=J(J(J({},B),L),F);return J(J(J({},z),p(J({props:y},z),v)),{},{prevDataKey:x,prevData:S,prevWidth:w,prevHeight:b,prevLayout:N,prevStackOffset:E,prevMargin:T,prevChildren:j})}if(!ay(j,v.prevChildren)){var $,O,U,C,Z=er(j,Xo),D=Z&&($=(O=Z.props)===null||O===void 0?void 0:O.startIndex)!==null&&$!==void 0?$:A,P=Z&&(U=(C=Z.props)===null||C===void 0?void 0:C.endIndex)!==null&&U!==void 0?U:M,ie=D!==A||P!==M,ve=!Ye(S),pe=ve&&!ie?v.updateId:v.updateId+1;return J(J({updateId:pe},p(J(J({props:y},v),{},{updateId:pe,dataStartIndex:D,dataEndIndex:P}),v)),{},{prevChildren:j,dataStartIndex:D,dataEndIndex:P})}return null}),Ce(g,"renderActiveDot",function(y,v,x){var S;return k.isValidElement(y)?S=k.cloneElement(y,v):Le(y)?S=y(v):S=G.createElement(aR,v),G.createElement(en,{className:"recharts-active-dot",key:x},S)});var m=k.forwardRef(function(v,x){return G.createElement(g,yo({},v,{ref:x}))});return m.displayName=g.displayName,m},Zi=Cie({chartName:"BarChart",GraphicalChild:xn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:na},{axisType:"yAxis",AxisComp:ra}],formatAxisMap:One});const Tie=new Intl.NumberFormat("en-US");function gt(e){return Tie.format(e)}function jb(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function qt(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function Oie(e,t){var a,s;const n=[];if(t){const o=t.toolsets.toolsets.filter(l=>l.enabled).reduce((l,c)=>l+c.toolCount,0);n.push({key:"tools",icon:"🔧",value:qt(o),label:"Active Tools",tone:"accent"})}const r=((a=t==null?void 0:t.conversations)==null?void 0:a.total)??((s=e==null?void 0:e.conversations)==null?void 0:s.total);return r!==void 0&&n.push({key:"conversations",icon:"💬",value:qt(r),label:"Active Conversations",tone:"ok"}),t&&n.push({key:"skills",icon:"🧩",value:qt(t.skills.total),label:"Skills Loaded",tone:"warn"}),e&&n.push({key:"cost",icon:"💰",value:jb(e.cost.totalCost),label:"Total Cost",tone:"danger"}),n}function Pie({tiles:e}){return e.length===0?null:i.jsx("ul",{className:"metric-tiles",children:e.map(t=>i.jsxs("li",{className:`metric-tile metric-tile--${t.tone}`,children:[i.jsx("span",{className:"metric-tile-icon","aria-hidden":"true",children:t.icon}),i.jsxs("span",{children:[i.jsx("span",{className:"metric-tile-value",children:t.value}),i.jsx("span",{className:"metric-tile-label",children:t.label})]})]},t.key))})}function $e({icon:e,title:t,description:n,actions:r}){return i.jsxs("header",{className:"page-header",children:[i.jsxs("div",{className:"page-header-text",children:[i.jsxs("h1",{className:"page-header-title",children:[i.jsx("span",{"aria-hidden":"true",children:e})," ",t]}),n?i.jsx("p",{className:"page-header-description",children:n}):null]}),r?i.jsx("div",{className:"page-header-actions",children:r}):null]})}const Rie={local:"var(--accent-green)",groq:"var(--accent-blue)",gemini:"var(--accent-purple)",nim:"var(--accent-cyan)",openrouter:"var(--accent-yellow)"};function IN(e){if(!e)return!1;const t=new Date;return t.setHours(0,0,0,0),e>=t.getTime()}function Eg({title:e,children:t,action:n}){return i.jsxs("section",{className:"summary-card",children:[i.jsx("h2",{className:"summary-card-title",children:e}),i.jsx("div",{className:"summary-rows",children:t}),n?i.jsx("div",{className:"summary-card-action",children:n}):null]})}function wa({value:e,label:t}){return i.jsxs("p",{className:"summary-row",children:[i.jsx("span",{className:"summary-row-value",children:e}),i.jsx("span",{className:"summary-row-label",children:t})]})}function Mie({data:e,onRefresh:t,refreshing:n=!1}){var E,T,A,M;const[r,a]=k.useState(null),[s,o]=k.useState(null);if(k.useEffect(()=>{let R=!1;return Q.fetchHub().then(B=>{!R&&B&&a(B)}),Q.listTasks().then(B=>{!R&&B&&o(B)}),()=>{R=!0}},[]),!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"📊",title:"System Overview",description:"Cost, memory, benchmarks and routing — read live from the dashboard server."}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Connecting to dashboard..."})]})]});const{cost:l,history:c,benchmarks:u,memory:d,health:f}=e,h=[{icon:"💰",value:jb(l.totalCost),label:"Total Cost"},{icon:"📞",value:qt(l.totalRequests),label:"API Requests"},{icon:"🧠",value:qt(d.total),label:"Trajectories"},{icon:"📝",value:qt(c.total),label:"Chat Sessions"},{icon:"🏆",value:qt(u.totalRuns),label:"Benchmark Runs"},{icon:"📦",value:qt(f.vectors),label:"Vector Entries"}],p=Object.entries(l.byProvider||{}).map(([R,B])=>({name:R,value:B})).sort((R,B)=>B.value-R.value),g=Object.entries(d.byFingerprint||{}).map(([R,B])=>({name:R.length>15?R.slice(0,13)+"..":R,value:B})).sort((R,B)=>B.value-R.value).slice(0,8),m=Oie(e,r),y=(s==null?void 0:s.tasks)??[],v=s!==null&&s.status===401,x=y.filter(R=>R.status==="running").length,S=y.filter(R=>IN(R.finishedAt)&&(R.status==="failed"||R.status==="error")).length,j=y.filter(R=>IN(R.finishedAt)&&R.status==="done").length,w=e.modelRegistry,b=((E=r==null?void 0:r.channels)==null?void 0:E.platforms)??[],N=b.filter(R=>R.configured).length;return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"📊",title:"System Overview",description:"Cost, memory, benchmarks and routing — read live from the dashboard server.",actions:t?i.jsx("button",{type:"button",className:"btn-secondary",onClick:t,disabled:n,"aria-busy":n,children:n?"Refreshing…":"⟳ Refresh data"}):null}),i.jsx(Pie,{tiles:m}),i.jsxs("div",{className:"overview-summary",children:[i.jsxs("div",{className:"summary-cards",children:[i.jsx(Eg,{title:"Task Summary",action:i.jsx(Jt,{className:"summary-card-link",to:"/tasks",children:"Open console →"}),children:v?i.jsx("p",{className:"summary-note",children:"Sign in to Admin to see task history."}):s===null?i.jsx("p",{className:"summary-note",children:"Loading task history…"}):i.jsxs(i.Fragment,{children:[i.jsx(wa,{value:qt(x),label:"Running now"}),i.jsx(wa,{value:qt(j),label:"Completed today"}),S>0&&i.jsx(wa,{value:qt(S),label:"Failed today"})]})}),w&&i.jsxs(Eg,{title:"Models",action:i.jsx(Jt,{className:"summary-card-link",to:"/models",children:"Manage →"}),children:[i.jsx(wa,{value:qt(w.verified),label:"Verified / routable"}),i.jsx(wa,{value:qt(w.total),label:"In the registry"}),w.parked>0&&i.jsx(wa,{value:qt(w.parked),label:"Quota-parked"})]}),r&&i.jsxs(Eg,{title:"Gateway Status",action:i.jsx(Jt,{className:"summary-card-link",to:"/gateway",children:"Gateway ops →"}),children:[i.jsx(wa,{value:`${N}/${b.length}`,label:"Platforms configured"}),i.jsx(wa,{value:qt(r.skills.total),label:"Skills loaded"}),i.jsx(wa,{value:qt(r.toolsets.enabled),label:"Toolsets enabled"})]})]}),i.jsxs("aside",{className:"quick-actions","aria-labelledby":"quick-actions-title",children:[i.jsx("h2",{className:"summary-card-title",id:"quick-actions-title",children:"Quick Actions"}),i.jsxs(Jt,{className:"quick-action",to:"/tasks",children:[i.jsx("span",{"aria-hidden":"true",children:"🚀"})," Run a CLI command"]}),i.jsxs(Jt,{className:"quick-action",to:"/hub",children:[i.jsx("span",{"aria-hidden":"true",children:"🧰"})," Skills & channels"]}),i.jsxs(Jt,{className:"quick-action",to:"/models",children:[i.jsx("span",{"aria-hidden":"true",children:"🧠"})," Model registry"]}),i.jsxs(Jt,{className:"quick-action",to:"/traces",children:[i.jsx("span",{"aria-hidden":"true",children:"🔍"})," Reasoning traces"]}),i.jsxs(Jt,{className:"quick-action",to:"/system",children:[i.jsx("span",{"aria-hidden":"true",children:"⚙️"})," Doctor checks"]})]})]}),i.jsx("h2",{className:"section-subtitle",children:"Key metrics"}),i.jsx("div",{className:"stats-grid",children:h.map(R=>i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-icon",children:R.icon}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:R.value}),i.jsx("div",{className:"stat-label",children:R.label})]})]},R.label))}),i.jsxs("div",{className:"memory-health-card",children:[i.jsx("h2",{className:"section-subtitle",children:"🧠 Memory Health"}),i.jsxs("div",{className:"memory-health-stats",children:[i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:qt(d.total)}),i.jsx("span",{className:"memory-health-label",children:"Trajectories"})]}),i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:qt(((T=d.facts)==null?void 0:T.total)||0)}),i.jsx("span",{className:"memory-health-label",children:"Facts Learned"})]}),i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:qt(((A=d.recall)==null?void 0:A.last7d)||0)}),i.jsx("span",{className:"memory-health-label",children:"Recalls This Week"})]}),i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:f.patterns||0}),i.jsx("span",{className:"memory-health-label",children:"Coding Patterns"})]})]}),i.jsxs("p",{className:"memory-health-status",children:["Memory tier: ",i.jsx("code",{children:d.backend||"local"})," · ","Vector index: ",i.jsx("code",{children:d.vectorBackend||"unknown"}),(M=d.recall)!=null&&M.last7d?` · ${d.recall.last7d} recall(s) this week`:" · no recalls yet"]})]}),i.jsx("h2",{className:"section-subtitle",children:"💰 Cost by Provider"}),i.jsx("div",{className:"chart-container",children:p.length>0?i.jsx(Qi,{width:"100%",height:260,children:i.jsxs(Zi,{data:p,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(oi,{strokeDasharray:"3 3"}),i.jsx(na,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ra,{tick:{fontSize:11},tickFormatter:R=>"$"+R.toFixed(4)}),i.jsx(wn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:R=>[jb(R),"Cost"]}),i.jsx(xn,{dataKey:"value",radius:[4,4,0,0],children:p.map(R=>i.jsx(iu,{fillOpacity:.8,style:{fill:Rie[R.name]||"var(--accent-blue)"}},R.name))})]})}):i.jsx("div",{className:"empty-state",children:"No cost data yet."})}),i.jsx("h2",{className:"section-subtitle",children:"📊 Trajectories by Project Type"}),i.jsx("div",{className:"chart-container",children:g.length>0?i.jsx(Qi,{width:"100%",height:260,children:i.jsxs(Zi,{data:g,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(oi,{strokeDasharray:"3 3"}),i.jsx(na,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ra,{tick:{fontSize:11}}),i.jsx(wn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"}}),i.jsx(xn,{dataKey:"value",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-purple)",style:{fill:"var(--accent-purple)"}})]})}):i.jsx("div",{className:"empty-state",children:"No trajectory data yet."})})]})}function Iie(){return i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"❓",title:"Help",description:"What this dashboard is, how to get work done in it, and every keyboard shortcut."}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"Start here"}),i.jsxs("ol",{className:"help-steps",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Talk to the agent in Chat."})," It is the front door — the other pages are views of what has already happened. ",i.jsx(Jt,{to:"/",children:"Open Chat"}),"."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Run a command from Tasks."})," The Command Console executes the same CLI you would type in a terminal, and it can group-browse every command for you."," ",i.jsx(Jt,{to:"/tasks",children:"Open Command Console"}),"."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Sign in for anything that changes something."})," Running a task, editing environment secrets and the Agent Hub toggles all need an admin session. Controls that need one are disabled and say so."," ",i.jsx(Jt,{to:"/admin",children:"Go to Admin"}),"."]})]})]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"How the dashboard is laid out"}),i.jsxs("dl",{className:"help-anatomy",children:[i.jsx("dt",{children:"Top bar"}),i.jsxs("dd",{children:["The cross-cutting views on the left; on the right, ",i.jsx("strong",{children:"Refresh"})," (re-fetches everything the page shows), ",i.jsx("strong",{children:"Shortcuts"})," (the cheatsheet), and ",i.jsx("strong",{children:"Appearance"})," (theme and accessibility)."]}),i.jsx("dt",{children:"Navigation rail"}),i.jsx("dd",{children:"Every remaining destination, grouped by what it is for. The filter box narrows it as you type. Below the width where it becomes a drawer, it opens from the ☰ button."}),i.jsx("dt",{children:"Page body"}),i.jsx("dd",{children:"One page per destination. Each starts with its own title and, where it has one, a short description of what you are looking at."}),i.jsx("dt",{children:"Status footer"}),i.jsx("dd",{children:"Whether the dashboard is connected to the local server, and when it last received data. “Reconnecting” means the live stream dropped and is being retried — the pages keep the last data they had."})]})]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"Keyboard shortcuts"}),i.jsx("div",{className:"help-shortcuts",children:ST.map(e=>i.jsxs("div",{className:"shortcuts-group",children:[i.jsx("h3",{className:"shortcuts-group-title",children:e.group}),i.jsx("dl",{className:"shortcuts-list",children:e.items.map(t=>i.jsxs("div",{className:"shortcuts-row",children:[i.jsx("dt",{className:"shortcuts-keys",children:t.keys.map(n=>i.jsx("kbd",{className:"shortcuts-key",children:n},n))}),i.jsx("dd",{className:"shortcuts-description",children:t.description})]},t.description))})]},e.group))}),i.jsxs("p",{className:"help-note",children:["Shortcuts are ignored while you are typing, so ",i.jsx("kbd",{className:"shortcuts-key",children:"?"})," in a question stays a question mark. The ",i.jsx("kbd",{className:"shortcuts-key",children:"g"})," chords expire about a second and a half after the prefix, so a stray ",i.jsx("kbd",{className:"shortcuts-key",children:"g"})," cannot navigate somewhere later."]})]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"Appearance & accessibility"}),i.jsxs("p",{className:"help-body",children:[i.jsx("strong",{children:"Appearance"})," in the top bar offers ",Jc.length," palettes in light and dark, plus a text size and an accessibility mode. Your choice is remembered in this browser only — nothing is sent anywhere."]}),i.jsxs("dl",{className:"help-anatomy",children:[i.jsx("dt",{children:"Palette"}),i.jsxs("dd",{children:[Jc.map(e=>Kf[e]).join(" · "),". The"," ",Kf.contrast," palette is the one to pick when you need maximum legibility."]}),i.jsx("dt",{children:"Mode"}),i.jsxs("dd",{children:[Sp.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" or "),". “Reset to system default” goes back to what your operating system asks for."]}),i.jsx("dt",{children:"Text size"}),i.jsx("dd",{children:"Scales the whole interface, not just the body text. Choosing a larger size turns accessibility mode on, because that is what defines it."}),i.jsx("dt",{children:"Accessibility mode"}),i.jsx("dd",{children:"Larger click targets, a thicker focus ring and no motion. Off by default so it never changes the look for anyone who does not need it."})]}),i.jsx("p",{className:"help-note",children:"Focus is always visible: every control draws a ring when reached by keyboard. Opportunistic hover-only effects are never the only cue for a state, and a selected state is carried by a filled shape plus weight rather than a faint tint."})]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"Where everything lives"}),i.jsxs("dl",{className:"help-anatomy",children:[i.jsx("dt",{children:"Top bar"}),i.jsx("dd",{className:"help-links",children:kT.map(e=>i.jsxs(Jt,{to:e.path,children:[i.jsx("span",{"aria-hidden":"true",children:e.icon})," ",e.label]},e.path))})]}),ty.map(e=>i.jsxs("dl",{className:"help-anatomy help-group",children:[i.jsx("dt",{children:e.label}),i.jsx("dd",{className:"help-links",children:e.items.map(t=>i.jsxs(Jt,{to:t.path,children:[i.jsx("span",{"aria-hidden":"true",children:t.icon})," ",t.label]},t.path))})]},e.label))]}),i.jsxs("section",{className:"help-section",children:[i.jsx("h2",{className:"section-title",children:"If something looks wrong"}),i.jsxs("dl",{className:"help-anatomy",children:[i.jsx("dt",{children:"A control is disabled"}),i.jsxs("dd",{children:["It needs an admin session. Sign in from ",i.jsx(Jt,{to:"/admin",children:"Admin"}),"; the page will say which session it wants."]}),i.jsx("dt",{children:"A task failed"}),i.jsx("dd",{children:"Open it from the Command Console's History — the full output and the exit code are kept per run."}),i.jsx("dt",{children:"The footer says “Reconnecting”"}),i.jsx("dd",{children:"The live stream dropped. The dashboard retries on its own and keeps showing the last data it received; Refresh forces a fresh fetch."}),i.jsx("dt",{children:"A page is empty"}),i.jsxs("dd",{children:["Most pages report “no data yet” rather than a zero, because a zero and an absent source look identical. Check ",i.jsx(Jt,{to:"/system",children:"System"})," for the health checks behind it."]})]})]})]})}const $N={planner:"📋","context-gatherer":"📂",writer:"✏️",reviewer:"👁️",tester:"🧪",debugger:"🐛",runner:"▶️",git:"🔀",package:"📦","github-release":"🏷️",security:"🔒",orchestrator:"🎯"},LN={planner:"var(--accent-blue)","context-gatherer":"var(--accent-cyan)",writer:"var(--accent-yellow)",reviewer:"var(--accent-purple)",tester:"var(--accent-green)",debugger:"var(--accent-red)",runner:"var(--accent-blue)",git:"var(--accent-yellow)",package:"var(--accent-yellow)","github-release":"var(--accent-green)",security:"var(--accent-red)",orchestrator:"var(--accent-yellow)"},_g={planner:"Planner","context-gatherer":"Context",writer:"Writer",reviewer:"Reviewer",tester:"Tester",debugger:"Debugger",runner:"Runner",git:"Git",package:"Package","github-release":"Release",security:"Security",orchestrator:"Orchestrator"},DN={pending:{icon:"⏳",label:"Pending"},running:{icon:"▶️",label:"Running"},completed:{icon:"✅",label:"Done"},failed:{icon:"❌",label:"Failed"}},$ie={pending:"var(--text-muted)",running:"var(--accent-blue)",completed:"var(--accent-green)",failed:"var(--accent-red)"};function Lie(e){if(!e||e.nodes.length===0)return null;const t=e.nodes.map(s=>s.startedAt||0).filter(Boolean),n=e.nodes.map(s=>s.completedAt||0).filter(Boolean),r=t.length>0?Math.min(...t):Date.now(),a=n.length>0?Math.max(...n):Date.now();return{id:`live-${r}`,goal:e.pipeline||"Active execution",startedAt:r,endedAt:n.length>0?a:void 0,success:e.nodes.length>0&&e.nodes.every(s=>s.status==="completed"),totalDurationMs:Math.max(0,a-r),phases:e.nodes.map(s=>({id:s.id,agentType:s.agentType,status:s.status,description:s.description,complexity:s.complexity,summary:s.summary,startedAt:s.startedAt,completedAt:s.completedAt,durationMs:s.startedAt&&s.completedAt?s.completedAt-s.startedAt:void 0}))}}function Die(e,t){const n=[],r=new Set,a=Lie(e);a&&(n.push(a),r.add(a.id));for(const s of(t==null?void 0:t.runs)||[])r.has(s.id)||(n.push(s),r.add(s.id));return n}function Ja(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function BN(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Bie(e,t){if(e.length===0)return{laid:[],total:0};const n=e.length,r=e.map(d=>d.durationMs&&d.durationMs>0?d.durationMs:0),a=r.reduce((d,f)=>d+f,0),s=a>0?e.map((d,f)=>r[f]>0?r[f]:a/n):e.map(()=>1),o=s.reduce((d,f)=>d+f,0)||1;let l=0;const c=e.map((d,f)=>{const h=s[f]/o,p=l;return l+=h,{...d,start:p,width:h,dur:s[f]}}),u=t>0?t:o;return{laid:c,total:u}}function zie({runs:e,selectedRunId:t,onSelectRun:n,onScrub:r}){const[a,s]=k.useState(null),o=e.find(N=>N.id===(t??a))??e[0]??null,[l,c]=k.useState(0),[u,d]=k.useState(!1),f=k.useRef(null),h=k.useRef(!1),p=k.useRef(r);k.useEffect(()=>{p.current=r},[r]),k.useEffect(()=>{var N;!o&&e.length>0?s(e[0].id):o&&!e.some(E=>E.id===o.id)&&s(((N=e[0])==null?void 0:N.id)??null)},[e,o]);const{laid:g,total:m}=k.useMemo(()=>Bie((o==null?void 0:o.phases)||[],(o==null?void 0:o.totalDurationMs)||0),[o]),y=m>0?Math.min(1,Math.max(0,l/m)):0,v=k.useMemo(()=>{if(m<=0)return null;const N=y*m;return g.find(E=>N>=E.start*m&&N<(E.start+E.width)*m)||null},[g,y,m]);k.useEffect(()=>{var N;(N=p.current)==null||N.call(p,(v==null?void 0:v.id)??null)},[v==null?void 0:v.id]),k.useEffect(()=>{if(!u)return;const N=setInterval(()=>{c(E=>E+m/2e3*50)},50);return()=>clearInterval(N)},[u,m]),k.useEffect(()=>{u&&m>0&&l>=m&&(d(!1),c(0))},[u,m,l]);const x=k.useCallback(N=>{const E=f.current;if(!E||m<=0)return;const T=E.getBoundingClientRect(),A=T.width||1,M=Math.min(1,Math.max(0,(N-T.left)/A));c(M*m)},[m]),S=N=>{h.current=!0,d(!1),x(N.clientX)};if(k.useEffect(()=>{const N=T=>{h.current&&x(T.clientX)},E=()=>{h.current=!1};return window.addEventListener("pointermove",N),window.addEventListener("pointerup",E),()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",E)}},[x]),!o)return i.jsx("div",{className:"phase-timeline phase-timeline-empty",children:i.jsx("p",{children:"No pipeline runs yet. Run an agent task to see its phase timeline here."})});const j=o.id.startsWith("live-"),w=o.phases.filter(N=>N.status==="completed").length,b=o.phases.filter(N=>N.status==="failed").length;return i.jsxs("div",{className:"phase-timeline",children:[i.jsxs("div",{className:"phase-timeline-header",children:[i.jsx("div",{className:"phase-timeline-runs",children:e.map(N=>i.jsxs("button",{className:`phase-run-chip ${N.id===o.id?"active":""} ${N.id.startsWith("live-")?"live":""}`,onClick:()=>{s(N.id),c(0),d(!1),n==null||n(N.id)},title:N.goal,children:[N.id.startsWith("live-")&&i.jsx("span",{className:"dag-live-dot"}),N.engine&&i.jsx("span",{className:`phase-run-chip-engine phase-run-chip-engine-${N.engine}`,children:N.engine==="loop"?"🔁":"⬡"}),N.goal.length>32?N.goal.slice(0,30)+"…":N.goal,i.jsx("span",{className:"phase-run-chip-time",children:BN(N.startedAt)})]},N.id))}),i.jsxs("div",{className:"phase-timeline-meta",children:[j&&i.jsx("span",{className:"dag-live-badge",children:"LIVE"}),o.engine&&i.jsx("span",{className:`dag-engine-badge dag-engine-${o.engine}`,title:o.engine==="loop"?"Loop turn (per-tool telemetry below)":"Orchestrator pipeline",children:o.engine==="loop"?"🔁 loop":"⬡ pipeline"}),i.jsxs("span",{className:"phase-meta-item",children:[o.phases.length," steps"]}),i.jsxs("span",{className:"phase-meta-item phase-meta-ok",children:["✅ ",w]}),b>0&&i.jsxs("span",{className:"phase-meta-item phase-meta-bad",children:["❌ ",b]}),o.turnTelemetry&&i.jsxs("span",{className:"phase-meta-item",title:`tool calls: ${o.turnTelemetry.toolCallCount}, errored: ${o.turnTelemetry.erroredToolCount}${o.turnTelemetry.bounded?", bounded":""}${o.turnTelemetry.provider?`, ${o.turnTelemetry.provider}${o.turnTelemetry.model?`/${o.turnTelemetry.model}`:""}`:""}`,children:["🔧 ",o.turnTelemetry.toolCallCount,o.turnTelemetry.erroredToolCount>0&&i.jsxs("span",{className:"phase-meta-bad",children:[" (",o.turnTelemetry.erroredToolCount," err)"]})]}),i.jsxs("span",{className:"phase-meta-item",children:["⏱ ",Ja(m)]})]})]}),i.jsxs("div",{className:"phase-timeline-controls",children:[i.jsx("button",{className:`phase-play-btn ${u?"paused":""}`,onClick:()=>{u?d(!1):(l>=m&&c(0),d(!0))},"aria-label":u?"Pause scrub":"Play scrub",children:u?"⏸ Pause":"▶ Play"}),i.jsxs("span",{className:"phase-time-label",children:[Ja(l)," / ",Ja(m)]}),i.jsx("input",{className:"phase-range",type:"range",min:0,max:m||1,step:1,value:Math.min(l,m||1),onChange:N=>{d(!1),c(Number(N.target.value))},"aria-label":"Scrub pipeline timeline"})]}),i.jsxs("div",{className:"phase-track-wrap",children:[i.jsxs("div",{ref:f,className:"phase-track",onPointerDown:S,style:{cursor:"grab"},children:[g.map(N=>{const E=LN[N.agentType]||"var(--accent-blue)",T=$ie[N.status],A=(v==null?void 0:v.id)===N.id;return i.jsxs("button",{className:`phase-block phase-block-${N.status} ${A?"active":""}`,style:{left:`${N.start*100}%`,width:`${Math.max(N.width*100,2)}%`,background:`linear-gradient(180deg, ${E}cc, ${E}66)`,boxShadow:A?`0 0 0 2px ${T}`:void 0},onClick:M=>{M.stopPropagation(),d(!1),c((N.start+N.width/2)*m)},title:`${_g[N.agentType]||N.agentType}: ${N.description}`,children:[i.jsx("span",{className:"phase-block-icon",children:$N[N.agentType]||"⚙️"}),i.jsx("span",{className:"phase-block-label",children:_g[N.agentType]||N.agentType})]},N.id)}),i.jsx("div",{className:"phase-caret",style:{left:`${y*100}%`},onPointerDown:N=>{N.stopPropagation(),S(N)},title:`${Ja(l)} elapsed`})]}),i.jsxs("div",{className:"phase-ticks",children:[i.jsx("span",{children:"0"}),i.jsx("span",{children:Ja(Math.round(m/2))}),i.jsx("span",{children:Ja(m)})]})]}),i.jsx("div",{className:"phase-detail",children:v?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"phase-detail-title",children:[i.jsx("span",{className:"phase-detail-icon",children:$N[v.agentType]||"⚙️"}),i.jsx("span",{className:"phase-detail-agent",style:{color:LN[v.agentType]||"var(--accent-blue)"},children:_g[v.agentType]||v.agentType}),i.jsxs("span",{className:`phase-status-badge phase-status-${v.status}`,children:[DN[v.status].icon," ",DN[v.status].label]})]}),i.jsx("p",{className:"phase-detail-desc",children:v.description}),i.jsxs("div",{className:"phase-detail-meta",children:[i.jsxs("span",{children:["⏱ ",v.durationMs?Ja(v.dur):`~${Ja(v.dur)}`]}),v.startedAt?i.jsxs("span",{children:["🕐 ",BN(v.startedAt)]}):null,v.complexity?i.jsxs("span",{children:["🎯 ",v.complexity]}):null]}),v.summary&&i.jsx("p",{className:"phase-detail-summary",children:v.summary})]}):i.jsxs("div",{className:"phase-detail-gap",children:[i.jsx("span",{className:"phase-detail-icon",children:"⏳"}),i.jsx("span",{children:"Between steps — waiting for the next agent."})]})})]})}function Ag(e){return e===void 0?"—":`$${e.toFixed(5)}`}function zN(e){if(e===void 0||!Number.isFinite(e)||e<0)return"—";if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=Math.floor(t/60);return n<60?`${n}m ${String(Math.round(t%60)).padStart(2,"0")}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,"0")}m`}function Cg(e){return e===void 0?"—":e.toLocaleString("en-US")}function Fie({jobs:e}){const t=k.useMemo(()=>e.filter(u=>u.batchStats.length>0),[e]),[n,r]=k.useState(null);if(t.length===0)return null;const a=t.find(u=>u.id===n)??t[0],s=a.batchStats,o=s.filter(u=>u.durationMs!==void 0),l=o.reduce((u,d)=>u+(d.durationMs??0),0),c=o.length>0?l/o.length:void 0;return i.jsxs("div",{className:"dag-timeline-section","data-testid":"batch-economy",children:[i.jsxs("h2",{className:"section-subtitle",children:["📊 Per-batch cost & latency"," ",i.jsx("span",{className:"timeline-subtitle",children:"— measured, not estimated"})]}),t.length>1&&i.jsx("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:t.slice(0,5).map(u=>i.jsx("button",{type:"button",className:"dag-loop-turn-chip",onClick:()=>r(u.id),style:{cursor:"pointer",opacity:u.id===a.id?1:.55,fontWeight:u.id===a.id?600:400},children:u.progressLine??u.goal.slice(0,40)},u.id))}),i.jsxs("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:[i.jsxs("span",{className:"dag-loop-turn-chip",children:[a.kind==="long-form"?"📖":"🛠️"," ",a.status]}),i.jsxs("span",{className:"dag-loop-turn-chip",children:[a.progress,"% done"]}),i.jsxs("span",{className:"dag-loop-turn-chip",children:[a.batches," batch",a.batches===1?"":"es"]}),i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[Cg(a.tokens)," tokens · ",Ag(a.costUsd)]}),a.stopReason&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["stopped: ",a.stopReason]})]}),i.jsx("div",{className:"dag-table-wrapper",children:i.jsxs("table",{className:"dag-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Batch"}),i.jsx("th",{children:"Done"}),i.jsx("th",{children:"Tokens"}),i.jsx("th",{children:"Cost"}),i.jsx("th",{children:"Time"})]})}),i.jsxs("tbody",{children:[s.map(u=>i.jsxs("tr",{children:[i.jsx("td",{children:u.index}),i.jsx("td",{children:`${Math.round(u.progress)}%`}),i.jsx("td",{children:Cg(u.tokens)}),i.jsx("td",{children:Ag(u.costUsd)}),i.jsx("td",{children:zN(u.durationMs)})]},u.index)),s.some(u=>u.error)&&i.jsx("tr",{children:i.jsxs("td",{colSpan:5,style:{opacity:.75},children:["✗ failures:"," ",s.filter(u=>u.error).map(u=>`#${u.index} ${u.error}`).join(" · ")]})}),i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx("strong",{children:"total"})}),i.jsx("td",{children:i.jsx("strong",{children:`${a.progress}%`})}),i.jsx("td",{children:i.jsx("strong",{children:Cg(a.tokens)})}),i.jsx("td",{children:i.jsx("strong",{children:Ag(a.costUsd)})}),i.jsx("td",{children:i.jsx("strong",{children:c===void 0?"—":`~${zN(c)} avg`})})]})]})]})})]})}const FN={planner:"📋","context-gatherer":"📂",writer:"✏️",reviewer:"👁️",tester:"🧪",debugger:"🐛",runner:"▶️",git:"🔀",package:"📦","github-release":"🏷️",security:"🔒",orchestrator:"🎯"},Tg={planner:"var(--accent-blue)","context-gatherer":"var(--accent-cyan)",writer:"var(--accent-yellow)",reviewer:"var(--accent-purple)",tester:"var(--accent-green)",debugger:"var(--accent-red)",runner:"var(--accent-blue)",git:"var(--accent-yellow)",package:"var(--accent-yellow)","github-release":"var(--accent-green)",security:"var(--accent-red)",orchestrator:"var(--accent-yellow)"},Uie={pending:{bg:"var(--bg-card)",stroke:"var(--border)",text:"var(--text-muted)"},running:{bg:"color-mix(in srgb, var(--accent-blue) 12%, transparent)",stroke:"var(--accent-blue)",text:"var(--accent-blue)"},completed:{bg:"color-mix(in srgb, var(--accent-green) 12%, transparent)",stroke:"var(--accent-green)",text:"var(--accent-green)"},failed:{bg:"color-mix(in srgb, var(--accent-red) 12%, transparent)",stroke:"var(--accent-red)",text:"var(--accent-red)"}},UN={pending:"⏳ Pending",running:"▶️ Running",completed:"✅ Done",failed:"❌ Failed"},Ys={trivial:{icon:"🟢",color:"var(--accent-green)"},simple:{icon:"🔵",color:"var(--accent-blue)"},moderate:{icon:"🟡",color:"var(--accent-yellow)"},complex:{icon:"🟠",color:"var(--accent-yellow)"},critical:{icon:"🔴",color:"var(--accent-red)"}},Og={planner:"Planner","context-gatherer":"Context",writer:"Writer",reviewer:"Reviewer",tester:"Tester",debugger:"Debugger",runner:"Runner",git:"Git",package:"Package","github-release":"Release",security:"Security",orchestrator:"Orchestrator"};function Wie(e,t,n=160,r=68,a=40,s=24,o=40){if(e.length===0)return{layoutNodes:[],svgW:400,svgH:200};const l=new Map,c=new Set;function u(y){if(l.has(y))return l.get(y);if(c.has(y))return 0;c.add(y);const v=t.filter(j=>j.to===y);if(v.length===0)return l.set(y,0),0;const S=Math.max(...v.map(j=>u(j.from)))+1;return l.set(y,S),S}for(const y of e)u(y.id);const d=new Map;for(const y of e){const v=l.get(y.id)??0;d.has(v)||d.set(v,[]),d.get(v).push(y)}const f=Math.max(...d.keys()),h=Math.max(...Array.from(d.values()).map(y=>y.length)),p=(f+1)*(n+a)+o*2-a,g=Math.max(h,1)*(r+s)+o*2-s,m=[];for(const y of e){const v=l.get(y.id)??0,x=d.get(v),S=x.indexOf(y),j=x.length,w=j*(r+s)-s,b=g/2-w/2;m.push({...y,x:o+v*(n+a),y:b+S*(r+s),w:n,h:r,step:v,totalInStep:j,indexInStep:S})}return{layoutNodes:m,svgW:p,svgH:g}}function Pg(e,t){if(!e)return"--";const n=(t||Date.now())-e;return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.floor(n/6e4)}m ${Math.floor(n%6e4/1e3)}s`}function WN(e){return e?new Date(e).toLocaleTimeString("en-US",{minute:"2-digit",second:"2-digit"}):""}function Hie({memoryTotal:e}){return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"🔀",title:"Agent Execution DAG"}),i.jsx("p",{className:"section-description",children:"Live visualization of the agent execution pipeline. When an agent task runs, you'll see each step appear here in real time as it moves through planning → context gathering → writing → review → testing."}),i.jsxs("div",{className:"dag-empty",children:[i.jsx("div",{className:"dag-empty-icon",children:"🔀"}),i.jsx("h2",{children:"No Active Pipeline"}),i.jsx("p",{children:"Run an agent task to see the execution pipeline appear here in real time."}),e!==void 0&&e>0&&i.jsxs("p",{className:"dag-empty-hint",children:[i.jsx("code",{children:e})," past executions are stored in memory."]})]})]})}function Gie({data:e}){var C,Z;const t=e==null?void 0:e.dag,n=(C=e==null?void 0:e.memory)==null?void 0:C.total,[r,a]=k.useState(null),[s,o]=k.useState(null),[l,c]=k.useState(void 0),[u,d]=k.useState(void 0),[f,h]=k.useState(void 0);k.useEffect(()=>Q.onDAGEvent(P=>{a(P),c(P.engine),d(P.engineExplanation),h(P.loopTurn)}),[]);const p=t||r,g=r?l:(t==null?void 0:t.engine)??l,m=r?u:(t==null?void 0:t.engineExplanation)??u,y=r?f:(t==null?void 0:t.loopTurn)??f,v=k.useMemo(()=>Die(p,e==null?void 0:e.pipelineRuns),[p,e==null?void 0:e.pipelineRuns]),x=D=>{o(D)},S=!!(p&&(p.nodes.length>0||p.active)),j=v.length>0,w=!!y,b=((Z=e==null?void 0:e.unattendedJobs)==null?void 0:Z.jobs)??[],N=b.some(D=>D.batchStats.length>0);if(!S&&!j&&!w&&!N)return i.jsx(Hie,{memoryTotal:n});const{nodes:E,edges:T,pipeline:A,active:M}=p??{nodes:[],edges:[],pipeline:null,active:!1},{layoutNodes:R,svgW:B,svgH:L}=Wie(E,T),F=E.filter(D=>D.status==="running").length,z=E.filter(D=>D.status==="completed").length,$=E.filter(D=>D.status==="failed").length,O=E.filter(D=>D.status==="pending").length,U=E.length;return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"🔀",title:"Agent Execution DAG"}),j&&i.jsxs("div",{className:"dag-timeline-section",children:[i.jsxs("h2",{className:"section-subtitle",children:["⏱ Run Timeline ",i.jsx("span",{className:"timeline-subtitle",children:"— scrub to replay · click a run to switch"})]}),i.jsx(zie,{runs:v,onScrub:x})]}),i.jsx(Fie,{jobs:b}),y&&i.jsxs("div",{className:"dag-loop-turn-card","data-testid":"dag-loop-turn-card",children:[i.jsxs("div",{className:"dag-loop-turn-header",children:[i.jsx("span",{className:"dag-loop-turn-icon",children:"🔁"}),i.jsxs("span",{className:"dag-loop-turn-title",children:["Loop turn — ",y.title||"chat turn"]}),y.active&&i.jsx("span",{className:"dag-loop-turn-live",children:"● recording"})]}),i.jsxs("div",{className:"dag-loop-turn-meta",children:[i.jsxs("span",{className:"dag-loop-turn-chip",children:["🔧 ",y.toolCallCount," tool call",y.toolCallCount===1?"":"s"]}),y.erroredToolCount>0&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:["❌ ",y.erroredToolCount," errored"]}),y.provider&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[y.provider,y.model?` · ${y.model}`:""]}),typeof y.startedAt=="number"&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["⏱ ",Pg(y.startedAt,y.endedAt)]}),y.bounded&&i.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"⛔ bounded"}),y.generationFailed&&i.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"💀 generation failed"}),y.cancelled&&i.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:"✖ cancelled"})]}),y.toolCalls.length>0&&i.jsx("div",{className:"dag-loop-turn-tools",children:y.toolCalls.slice(-12).map((D,P)=>i.jsxs("span",{className:`dag-loop-tool ${D.ok===!1?"dag-loop-tool-error":""}`,title:D.error||`${D.tool}${D.durationMs!==void 0?` · ${D.durationMs}ms`:""}`,children:[D.ok===!1?"❌":"✓"," ",D.tool]},`${D.tool}-${P}`))})]}),S&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`dag-status-bar ${M?"active":""}`,children:[i.jsxs("div",{className:"dag-pipeline-name",children:[M&&i.jsx("span",{className:"dag-live-dot"}),A||"Execution Pipeline"]}),i.jsxs("div",{className:"dag-pipeline-meta",children:[M&&i.jsx("span",{className:"dag-live-badge",children:"LIVE"}),g&&i.jsx("span",{className:`dag-engine-badge dag-engine-${g}`,title:m||(g==="loop"?"Single agentic loop":"Orchestrator pipeline"),"data-testid":"dag-engine-badge",children:g==="loop"?"🔁 loop engine":"⬡ pipeline engine"}),i.jsxs("span",{className:"dag-step-count",children:[U," steps"]}),F>0&&i.jsxs("span",{className:"dag-running-badge",children:["▶ ",F," running"]}),O>0&&i.jsxs("span",{className:"dag-pending-badge",children:["⏳ ",O," pending"]}),i.jsxs("span",{className:"dag-completed-badge",children:["✅ ",z," done"]}),$>0&&i.jsxs("span",{className:"dag-failed-badge",children:["❌ ",$," failed"]})]})]}),i.jsx("div",{className:"dag-container",children:i.jsxs("svg",{width:B,height:L,viewBox:`0 0 ${B} ${L}`,children:[i.jsxs("defs",{children:[T.map(D=>i.jsx("marker",{id:`arrow-${D.from}-${D.to}`,markerWidth:"8",markerHeight:"6",refX:"8",refY:"3",orient:"auto",children:i.jsx("polygon",{points:"0 0, 8 3, 0 6",style:{fill:"var(--accent-blue)"}})},`arrow-${D.from}-${D.to}`)),i.jsxs("filter",{id:"glow",children:[i.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),i.jsxs("feMerge",{children:[i.jsx("feMergeNode",{in:"coloredBlur"}),i.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),T.map(D=>{const P=R.find(V=>V.id===D.from),ie=R.find(V=>V.id===D.to);if(!P||!ie)return null;const ve=P.x+P.w,pe=P.y+P.h/2,Te=ie.x,q=ie.y+ie.h/2,X=(ve+Te)/2,oe=ie.status,ue=oe==="failed"?"var(--accent-red)":oe==="running"?"var(--accent-blue)":oe==="completed"?"var(--accent-green)":"var(--border)";return i.jsx("g",{children:i.jsx("path",{d:`M ${ve} ${pe} C ${X} ${pe}, ${X} ${q}, ${Te} ${q}`,fill:"none",style:{stroke:ue},strokeWidth:oe==="pending"?1.5:2.5,strokeOpacity:oe==="pending"?.3:.8,markerEnd:`url(#arrow-${D.from}-${D.to})`,className:"dag-edge"})},`edge-${D.from}-${D.to}`)}),R.map(D=>{const P=Uie[D.status];Tg[D.agentType];const ie=FN[D.agentType]||"⚙️",ve=Og[D.agentType]||D.agentType,pe=s===D.id,Te=D.status==="running";return i.jsxs("g",{onClick:()=>o(pe?null:D.id),style:{cursor:"pointer"},className:"dag-node-group",children:[pe&&i.jsx("rect",{x:D.x-4,y:D.y-4,width:D.w+8,height:D.h+8,rx:10,ry:10,fill:"none",style:{stroke:"var(--accent-blue)"},strokeWidth:2,strokeOpacity:.5}),i.jsx("rect",{x:D.x,y:D.y,width:D.w,height:D.h,rx:8,ry:8,style:{fill:P.bg,stroke:P.stroke},strokeWidth:Te?2.5:1.5,strokeOpacity:.9,className:Te?"dag-node-running":"",filter:Te?"url(#glow)":void 0}),i.jsxs("text",{x:D.x+10,y:D.y+22,style:{fill:"var(--text-primary)"},fontSize:10,fontWeight:600,children:[ie," ",ve]}),i.jsx("text",{x:D.x+D.w-10,y:D.y+22,textAnchor:"end",style:{fill:P.text},fontSize:9,fontWeight:500,children:UN[D.status]}),i.jsx("text",{x:D.x+10,y:D.y+40,style:{fill:"var(--text-secondary)"},fontSize:9,children:D.description.length>28?D.description.slice(0,26)+"..":D.description}),D.complexity&&Ys[D.complexity]&&i.jsxs("text",{x:D.x+10,y:D.y+54,style:{fill:Ys[D.complexity].color},fontSize:8,fontWeight:600,children:[Ys[D.complexity].icon," ",D.complexity]}),i.jsx("text",{x:D.x+10,y:D.y+56,style:{fill:"var(--text-muted)"},fontSize:8,children:Pg(D.startedAt,D.completedAt)}),i.jsx("text",{x:D.x+D.w-10,y:D.y+56,textAnchor:"end",style:{fill:"var(--text-muted)"},fontSize:8,children:WN(D.startedAt||D.completedAt)}),(D.status==="failed"||pe)&&D.summary&&i.jsx("foreignObject",{x:Math.max(10,D.x-80),y:D.y+D.h+6,width:D.w+160,height:36,children:i.jsx("div",{className:"dag-node-summary",style:{color:D.status==="failed"?"var(--accent-red)":"var(--text-secondary)",fontSize:"10px",lineHeight:1.4,background:"var(--scrim)",padding:"4px 8px",borderRadius:"4px",border:`1px solid ${D.status==="failed"?"color-mix(in srgb, var(--accent-red) 30%, transparent)":"color-mix(in srgb, var(--border) 50%, transparent)"}`,maxHeight:"32px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D.summary})})]},`node-${D.id}`)})]})}),i.jsx("h2",{className:"section-subtitle",children:"Step Details"}),i.jsx("div",{className:"dag-table-wrapper",children:i.jsxs("table",{className:"dag-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Agent"}),i.jsx("th",{children:"Complexity"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Summary"})]})}),i.jsx("tbody",{children:R.map(D=>i.jsxs("tr",{className:`dag-row dag-row-${D.status}`,children:[i.jsx("td",{className:"dag-cell-step",children:D.step}),i.jsxs("td",{className:"dag-cell-agent",children:[i.jsx("span",{className:"dag-agent-dot",style:{background:Tg[D.agentType]||"var(--accent-blue)"}}),Og[D.agentType]||D.agentType]}),i.jsx("td",{className:"dag-cell-complexity",children:D.complexity&&Ys[D.complexity]?i.jsxs("span",{style:{color:Ys[D.complexity].color,fontSize:12},children:[Ys[D.complexity].icon," ",D.complexity]}):i.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:"—"})}),i.jsx("td",{className:`dag-cell-status dag-status-${D.status}`,children:UN[D.status]}),i.jsx("td",{className:"dag-cell-duration",children:Pg(D.startedAt,D.completedAt)}),i.jsx("td",{className:"dag-cell-time",children:WN(D.startedAt||D.completedAt)}),i.jsx("td",{className:"dag-cell-summary",children:D.summary||D.description||"--"})]},D.id))})]})}),i.jsx("h2",{className:"section-subtitle",children:"Agent Types"}),i.jsxs("div",{className:"dag-legend",children:[Object.entries(FN).map(([D,P])=>i.jsxs("div",{className:"legend-item",children:[i.jsx("span",{className:"legend-dot",style:{background:Tg[D]||"var(--accent-blue)"}}),i.jsx("span",{className:"legend-icon",children:P}),i.jsx("span",{className:"legend-label",children:Og[D]||D})]},D)),i.jsxs("div",{className:"legend-item",children:[i.jsx("span",{className:"legend-dot",style:{background:"transparent",border:"2px dashed var(--accent-blue)"}}),i.jsx("span",{className:"legend-icon",children:"⚡"}),i.jsx("span",{className:"legend-label",children:"Live node"})]})]})]})]})}function Xs(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function ic(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function qie(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Kie({data:e}){if(!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"💰",title:"Cost Tracking"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading cost data..."})})]});const{cost:t}=e,n=Object.entries(t.byProvider||{}).sort(([,s],[,o])=>o-s),r=Object.entries(t.byModel||{}).sort(([,s],[,o])=>o-s).slice(0,10),a=n.reduce((s,[,o])=>s+o,0);return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"💰",title:"Cost Tracking"}),i.jsxs("div",{className:"cost-summary",children:[i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"Total Spent"}),i.jsx("span",{className:"cost-amount",children:Xs(t.totalCost)})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"Total Tokens"}),i.jsx("span",{className:"cost-amount",children:ic(t.totalTokens)})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"Total Requests"}),i.jsx("span",{className:"cost-amount",children:ic(t.totalRequests)})]})]}),i.jsxs("div",{className:"cost-summary cost-summary-sub",children:[i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"📏 Measured (exact wire tokens)"}),i.jsx("span",{className:"cost-amount",children:Xs(t.measuredCost)}),i.jsxs("span",{className:"cost-label",children:[ic(t.measuredCalls)," calls"]})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"📐 Estimated (length-based)"}),i.jsx("span",{className:"cost-amount",children:Xs(t.estimatedCost)}),i.jsxs("span",{className:"cost-label",children:[ic(t.estimatedCalls)," calls"]})]})]}),i.jsx("h2",{className:"section-subtitle",children:"By Provider"}),i.jsx("div",{className:"cost-list",children:n.length===0?i.jsx("div",{className:"empty-state",children:"No costs recorded yet."}):n.map(([s,o])=>{const l=a>0?(o/a*100).toFixed(1):"0";return i.jsxs("div",{className:"cost-row",children:[i.jsx("span",{className:"cost-row-name",children:s}),i.jsx("div",{className:"cost-row-bar",children:i.jsx("div",{className:"cost-row-fill",style:{width:`${l}%`}})}),i.jsx("span",{className:"cost-row-value",children:Xs(o)})]},s)})}),i.jsx("h2",{className:"section-subtitle",children:"By Model"}),i.jsx("div",{className:"cost-list",children:r.length===0?i.jsx("div",{className:"empty-state",children:"No model costs recorded yet."}):r.map(([s,o])=>{const l=a>0?(o/a*100).toFixed(1):"0",c=s.length>30?s.slice(0,28)+"..":s;return i.jsxs("div",{className:"cost-row",children:[i.jsx("span",{className:"cost-row-name",children:c}),i.jsx("div",{className:"cost-row-bar",children:i.jsx("div",{className:"cost-row-fill",style:{width:`${l}%`}})}),i.jsx("span",{className:"cost-row-value",children:Xs(o)})]},s)})}),i.jsx("h2",{className:"section-subtitle",children:"Recent Requests"}),i.jsx("div",{className:"request-list",children:!t.recent||t.recent.length===0?i.jsx("div",{className:"empty-state",children:"No requests recorded yet."}):t.recent.slice(0,30).map((s,o)=>i.jsxs("div",{className:"request-row",children:[i.jsx("span",{className:"request-time",children:qie(s.timestamp)}),i.jsx("span",{className:"request-provider",children:s.provider||"--"}),i.jsx("span",{className:"request-model",children:s.model||"--"}),i.jsx("span",{className:"request-cost",children:Xs(s.costUsd)}),i.jsxs("span",{className:"request-tokens",children:[ic(s.totalTokens)," tok"]})]},o))})]})}function Vie(e){return e==null?"$0.00":"$"+e.toFixed(6)}function Gd(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function Yie({data:e}){if(!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"📈",title:"Benchmark Results"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading benchmark data..."})})]});const{benchmarks:t,evals:n}=e,r=t.latest,a=t.runs||[],s=(n==null?void 0:n.runs)||[],o=(n==null?void 0:n.latest)||null,l=s.map(u=>({name:u.model.length>12?u.model.slice(0,10)+"..":u.model,score:Math.round(u.summary.avgCompositeScore*100),completion:Math.round(u.summary.completionRate*100),tests:Math.round(u.summary.testPassRate*100),recovery:Math.round(u.summary.recoveryRate*100),efficiency:Math.round(u.summary.avgTokenEfficiency*100),fullModel:u.model,provider:u.provider})).reverse(),c=a.map(u=>({name:u.model.length>12?u.model.slice(0,10)+"..":u.model,passRate:u.summary.totalTasks>0?Math.round(u.summary.tasksPassed/u.summary.totalTasks*100):0,quality:Math.round(u.summary.avgQualityScore*100),latency:u.summary.medianLatencyMs,cost:u.summary.totalCostUsd,fullModel:u.model,provider:u.provider})).reverse();return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"📈",title:"Benchmark Results"}),i.jsx("div",{className:"benchmark-latest",children:r?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"benchmark-header",children:[i.jsx("strong",{children:"Latest Run:"})," ",r.provider,"/",r.model]}),i.jsxs("div",{className:"benchmark-stats",children:[i.jsxs("div",{className:"benchmark-stat pass",children:[i.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),i.jsx("div",{className:"benchmark-stat-label",children:"Passed"})]}),i.jsxs("div",{className:"benchmark-stat quality",children:[i.jsx("div",{className:"benchmark-stat-value",children:Gd(r.summary.avgQualityScore)}),i.jsx("div",{className:"benchmark-stat-label",children:"Quality"})]}),i.jsxs("div",{className:"benchmark-stat latency",children:[i.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.medianLatencyMs,"ms"]}),i.jsx("div",{className:"benchmark-stat-label",children:"Latency"})]}),i.jsxs("div",{className:"benchmark-stat fail",children:[i.jsx("div",{className:"benchmark-stat-value",children:Vie(r.summary.totalCostUsd)}),i.jsx("div",{className:"benchmark-stat-label",children:"Cost"})]})]})]}):i.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",i.jsx("code",{children:"buff benchmark"})," to start."]})}),c.length>1&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Pass Rate by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(Qi,{width:"100%",height:260,children:i.jsxs(Zi,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(oi,{strokeDasharray:"3 3"}),i.jsx(na,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ra,{domain:[0,100],tick:{fontSize:11},tickFormatter:u=>u+"%"}),i.jsx(wn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>[u+"%","Pass Rate"]}),i.jsx(xn,{dataKey:"passRate",radius:[4,4,0,0],children:c.map((u,d)=>i.jsx(iu,{fillOpacity:.8,style:{fill:u.passRate>=80?"var(--accent-green)":u.passRate>=50?"var(--accent-yellow)":"var(--accent-red)"}},d))})]})})}),i.jsx("h2",{className:"section-subtitle",children:"Latency by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(Qi,{width:"100%",height:260,children:i.jsxs(Zi,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(oi,{strokeDasharray:"3 3"}),i.jsx(na,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ra,{tick:{fontSize:11},tickFormatter:u=>u+"ms"}),i.jsx(wn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>[u+"ms","Latency"]}),i.jsx(xn,{dataKey:"latency",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-yellow)",style:{fill:"var(--accent-yellow)"}})]})})}),i.jsx("h2",{className:"section-subtitle",children:"Cost by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(Qi,{width:"100%",height:260,children:i.jsxs(Zi,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(oi,{strokeDasharray:"3 3"}),i.jsx(na,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ra,{tick:{fontSize:11},tickFormatter:u=>"$"+u.toFixed(6)}),i.jsx(wn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>["$"+u.toFixed(6),"Cost"]}),i.jsx(xn,{dataKey:"cost",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-purple)",style:{fill:"var(--accent-purple)"}})]})})})]}),i.jsx("h2",{className:"section-subtitle",children:"🎯 Agent Evaluation"}),i.jsx("p",{className:"section-hint",style:{color:"var(--text-secondary)",fontSize:12,marginBottom:16},children:"End-to-end coding tasks run through the full agent pipeline — measures if the agent is actually improving."}),i.jsx("div",{className:"benchmark-latest",children:o?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"benchmark-header",children:[i.jsx("strong",{children:"Latest Eval Run:"})," ",o.provider,"/",o.model]}),i.jsxs("div",{className:"benchmark-stats",children:[i.jsxs("div",{className:"benchmark-stat pass",children:[i.jsxs("div",{className:"benchmark-stat-value",children:[o.summary.tasksPassed,"/",o.summary.totalTasks]}),i.jsx("div",{className:"benchmark-stat-label",children:"Tests Passed"})]}),i.jsxs("div",{className:"benchmark-stat quality",children:[i.jsx("div",{className:"benchmark-stat-value",children:Gd(o.summary.avgCompositeScore)}),i.jsx("div",{className:"benchmark-stat-label",children:"Composite Score"})]}),i.jsxs("div",{className:"benchmark-stat latency",children:[i.jsx("div",{className:"benchmark-stat-value",children:Gd(o.summary.recoveryRate)}),i.jsx("div",{className:"benchmark-stat-label",children:"Recovery Rate"})]}),i.jsxs("div",{className:"benchmark-stat fail",children:[i.jsx("div",{className:"benchmark-stat-value",children:o.summary.totalRollbacks}),i.jsx("div",{className:"benchmark-stat-label",children:"Rollbacks"})]}),i.jsxs("div",{className:"benchmark-stat deps",children:[i.jsx("div",{className:"benchmark-stat-value",children:Gd(o.summary.dependencyInstallRate)}),i.jsx("div",{className:"benchmark-stat-label",children:"Deps Installed"})]})]})]}):i.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",i.jsx("code",{children:"buff eval run"})," to measure the agent end-to-end."]})}),l.length>1&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Composite Score by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(Qi,{width:"100%",height:260,children:i.jsxs(Zi,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(oi,{strokeDasharray:"3 3"}),i.jsx(na,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ra,{domain:[0,100],tick:{fontSize:11},tickFormatter:u=>u+"%"}),i.jsx(wn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>[u+"%","Composite Score"]}),i.jsx(xn,{dataKey:"score",radius:[4,4,0,0],children:l.map((u,d)=>i.jsx(iu,{fillOpacity:.8,style:{fill:u.score>=80?"var(--accent-green)":u.score>=50?"var(--accent-yellow)":"var(--accent-red)"}},d))})]})})}),i.jsx("h2",{className:"section-subtitle",children:"Metric Breakdown (completion / tests / recovery / token efficiency)"}),i.jsx("div",{className:"chart-container",children:i.jsx(Qi,{width:"100%",height:260,children:i.jsxs(Zi,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(oi,{strokeDasharray:"3 3"}),i.jsx(na,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ra,{domain:[0,100],tick:{fontSize:11},tickFormatter:u=>u+"%"}),i.jsx(wn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"}}),i.jsx(us,{}),i.jsx(xn,{dataKey:"completion",name:"Completion",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-green)",style:{fill:"var(--accent-green)"}}),i.jsx(xn,{dataKey:"tests",name:"Tests",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-blue)",style:{fill:"var(--accent-blue)"}}),i.jsx(xn,{dataKey:"recovery",name:"Recovery",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-yellow)",style:{fill:"var(--accent-yellow)"}}),i.jsx(xn,{dataKey:"efficiency",name:"Token Eff.",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-purple)",style:{fill:"var(--accent-purple)"}})]})})})]}),i.jsx("h2",{className:"section-subtitle",children:"Eval Run History"}),i.jsx("div",{className:"benchmark-list",children:s.length===0?i.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",i.jsx("code",{children:"buff eval run"})," to start."]}):s.map(u=>{const d=Math.round(u.summary.avgCompositeScore*100),f=d>=80?"high":d>=50?"medium":"low";return i.jsxs("div",{className:"benchmark-item",children:[i.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),i.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),i.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})}),i.jsx("h2",{className:"section-subtitle",children:"Run History"}),i.jsx("div",{className:"benchmark-list",children:a.length===0?i.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",i.jsx("code",{children:"buff benchmark"})," to start."]}):a.map(u=>{const d=u.summary.totalTasks>0?Math.round(u.summary.tasksPassed/u.summary.totalTasks*100):0,f=d>=80?"high":d>=50?"medium":"low";return i.jsxs("div",{className:"benchmark-item",children:[i.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),i.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),i.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})})]})}const Xie={pass:"✅",warn:"⚠️",fail:"❌"},Qie={pass:"PASS",warn:"WARN",fail:"FAIL"};function VR(e){const t={pass:0,warn:0,fail:0};for(const n of e)t[n.status]!==void 0&&(t[n.status]+=1);return t}function YR(e){const t=[];return e.fail>0&&t.push(`${e.fail} failing`),e.warn>0&&t.push(`${e.warn} warning${e.warn===1?"":"s"}`),e.pass>0&&t.push(`${e.pass} passing`),t.length>0?t.join(" · "):"no checks"}function Nb({check:e}){return i.jsxs("div",{className:"admin-check-row","data-status":e.status,"data-testid":`check-${e.name}`,children:[i.jsxs("span",{className:`admin-check-badge admin-check-${e.status}`,children:[Xie[e.status]," ",Qie[e.status]]}),i.jsxs("div",{className:"admin-check-body",children:[i.jsx("div",{className:"admin-check-name",children:e.name}),i.jsx("div",{className:"admin-check-message",children:e.message}),e.detail?i.jsx("div",{className:"admin-check-detail",children:e.detail}):null,e.fix?i.jsxs("div",{className:"admin-check-fix",children:["💡 ",e.fix]}):null]})]})}function HN(e){return`${(e*100).toFixed(1)}%`}function sc(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function Zie(e){if(!e)return"never";const t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m ago`:`${Math.floor(r/24)}d ago`}function GN({title:e,blurb:t,checks:n,testId:r}){const a=VR(n);return i.jsxs("section",{style:{marginBottom:18},"data-testid":r,children:[i.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[i.jsx("h2",{className:"section-subtitle",style:{margin:0},children:e}),i.jsx("span",{style:{fontSize:12,color:a.fail>0?"var(--accent-red)":a.warn>0?"var(--accent-yellow)":"var(--accent-green)"},"data-testid":`${r}-summary`,children:YR(a)})]}),i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",margin:"4px 0 10px"},children:t}),i.jsx("div",{className:"admin-check-list",children:n.length>0?n.map(s=>i.jsx(Nb,{check:s},s.name)):i.jsxs("div",{className:"empty-state",children:["No ",e.toLowerCase()," checks returned."]})})]})}function Jie({data:e,connected:t,lastUpdated:n}){const[r,a]=k.useState(null),[s,o]=k.useState(null),[l,c]=k.useState(!1),u=k.useCallback(async()=>{c(!0),o(null);const v=await Q.fetchAdminChecks();v?a(v):o("Could not reach the dashboard server, or it is older than this page. Run `nuvira dashboard` to start it."),c(!1)},[]);k.useEffect(()=>{u()},[u]);const d=e==null?void 0:e.health,f=(d==null?void 0:d.agentStats)??null,h=[...(r==null?void 0:r.system)??[],...(r==null?void 0:r.enterprise)??[]],p=VR(h),g=((r==null?void 0:r.providers)??[]).filter(v=>v.configured).length,m=((r==null?void 0:r.providers)??[]).length,y=f?Object.entries(f.agents).map(([v,x])=>({agent:v,...x})).sort((v,x)=>x.totalRuns-v.totalRuns||v.agent.localeCompare(x.agent)):[];return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"⚙️",title:"System Health"}),i.jsxs("p",{className:"section-description",style:{fontSize:12,color:"var(--text-secondary)",marginBottom:14},children:["The same checks ",i.jsx("code",{children:"nuvira doctor"})," runs, executed on demand — pass / warn / fail, with the fix for anything that is not passing. The store counters at the bottom are how big the agent's memory files are; they are not a health verdict."]}),i.jsxs("div",{className:"health-grid",style:{marginBottom:18},children:[i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:t?"🟢":"🟠"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Live Stream"}),i.jsx("div",{className:"health-value","data-testid":"connection-state",children:t?"● Connected":"● Reconnecting…"})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"⏱️"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Last Update"}),i.jsx("div",{className:"health-value",children:n})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"🩺"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Doctor"}),i.jsx("div",{className:"health-value","data-testid":"doctor-verdict",style:{color:p.fail>0?"var(--accent-red)":p.warn>0?"var(--accent-yellow)":"var(--accent-green)"},children:r?YR(p):l?"running…":"--"})]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:6},children:[i.jsx("h2",{className:"section-subtitle",style:{margin:0},children:"Doctor Checks"}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:l,onClick:()=>void u(),"data-testid":"run-checks",children:l?"⏳ Running…":"↻ Run checks again"}),m>0?i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:[g," of ",m," providers configured — per-provider detail is on the Admin tab"]}):null]}),s?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",style:{marginBottom:12},children:s}):null,!r&&!s?i.jsx("div",{className:"loading-state",children:"Running checks…"}):null,r?i.jsxs(i.Fragment,{children:[i.jsx(GN,{title:"System",blurb:"Runtime, filesystem, configuration and the local model surface.",checks:r.system,testId:"checks-system"}),i.jsx(GN,{title:"Enterprise",blurb:"Governance, audit, RBAC and the controls an operator is accountable for.",checks:r.enterprise,testId:"checks-enterprise"})]}):null,i.jsx("h2",{className:"section-subtitle",children:"Agent Performance"}),f?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",style:{marginBottom:10},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:sc(f.totalRuns)}),i.jsx("div",{className:"stat-label",children:"Recorded runs"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:HN(f.overallSuccessRate)}),i.jsx("div",{className:"stat-label",children:"Overall success rate"})]})]}),y.length>0?i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:18},children:y.map(v=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:12,padding:"4px 0",borderBottom:"1px solid var(--border-light)"},"data-testid":`agent-stats-${v.agent}`,children:[i.jsx("span",{style:{flex:1,color:"var(--text-primary)"},children:v.agent}),i.jsxs("span",{style:{color:"var(--text-secondary)"},children:[sc(v.totalRuns)," runs"]}),i.jsx("span",{style:{color:v.successRate>=.9?"var(--accent-green)":v.successRate>=.7?"var(--accent-yellow)":"var(--accent-red)"},children:HN(v.successRate)}),i.jsx("span",{style:{color:"var(--text-secondary)",minWidth:78,textAlign:"right"},children:Zie(v.lastRun)})]},v.agent))}):i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:18},children:"No agent runs recorded yet — this fills in as agents execute."})]}):i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:18},children:"No agent-stats file yet. Run a task and the per-agent success rates appear here."}),i.jsx("h2",{className:"section-subtitle",children:"Learning Stores"}),i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",margin:"4px 0 10px"},children:"What the agent has learned into disk. Sizes, not verdicts."}),i.jsxs("div",{className:"health-grid",children:[i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"💾"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Memory Directory"}),i.jsx("div",{className:"health-path",children:(d==null?void 0:d.memoryDir)||"~/.buff/memory/"})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"📝"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Coding Patterns"}),i.jsx("div",{className:"health-value",children:sc(d==null?void 0:d.patterns)})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"👍"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"User Feedback"}),i.jsxs("div",{className:"health-value",children:[sc(d==null?void 0:d.feedback)," ratings"]})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"🧠"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Vector Index"}),i.jsxs("div",{className:"health-value",children:[sc(d==null?void 0:d.vectors)," entries"]})]})]})]}),e?null:i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:10},children:"Waiting for the first data frame from the dashboard server — the checks above do not depend on it."}),i.jsx("h2",{className:"section-subtitle",children:"Server Info"}),i.jsxs("div",{className:"server-info",children:[i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Stream"}),i.jsx("span",{className:"info-value",children:t?"● Connected":"● Reconnecting…"})]}),i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Last Updated"}),i.jsx("span",{className:"info-value",children:n})]}),i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Checks run at"}),i.jsx("span",{className:"info-value",children:r!=null&&r.serverTime?new Date(r.serverTime).toLocaleString():"--"})]}),i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Data Directory"}),i.jsx("span",{className:"info-value",children:(d==null?void 0:d.memoryDir)||"~/.buff/memory/"})]})]})]})}const ese=new Set(["local","lmstudio","vllm"]),tse=new Set([]),Kh={available:{bg:"var(--ok-soft)",text:"var(--accent-green)",dot:"var(--accent-green)",cardBorder:"var(--accent-green)",cardBg:"var(--ok-soft)"},limited:{bg:"var(--warn-soft)",text:"var(--accent-yellow)",dot:"var(--accent-yellow)",cardBorder:"var(--accent-yellow)",cardBg:"var(--warn-soft)"},unavailable:{bg:"var(--danger-soft)",text:"var(--accent-red)",dot:"var(--accent-red)",cardBorder:"var(--accent-red)",cardBg:"var(--danger-soft)"}},nse=[3,4,5],XR=12e3,qN=[300,700],rse=6e4,ase=5e3;function ise(e){return new Promise(t=>setTimeout(t,e))}async function QR(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{return await fetch(e,{signal:n.signal})}finally{clearTimeout(r)}}function ZR(e){return e instanceof TypeError||e instanceof Error&&e.name==="AbortError"}async function sse(e){let t=null,n=!1;for(let r=0;;r++){try{const a=await QR("/api/models",XR);if(!a.ok)t=a.status;else{const s=await Qn(a);if(s&&Array.isArray(s.providers))return s;throw new Error("Model health endpoint returned an unexpected response — is the dashboard server up to date?")}}catch(a){if(!ZR(a))throw a;n=!0,e==null||e()}if(r>=qN.length)throw new Error(n?"Dashboard server unreachable — is it still running? Retrying automatically…":`Model health endpoint failed (HTTP ${t})`);await ise(qN[r])}}async function ose(e){for(let t=0;;t++)try{const n=await QR("/api/model-registry",XR);return n.ok?await Qn(n):null}catch(n){if(!ZR(n)||t>=1)return null;e==null||e()}}function lse(e){return e==="available"?"Available":e==="limited"?"Limited":"Unavailable"}function cse(e){return e==="available"?"Ready":e==="limited"?"Limited":"Down"}function JR(e){return{local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣",openai:"🤖",anthropic:"🔮",mistral:"🌀",cohere:"🧠",together:"🟢",deepinfra:"🌐",fireworks:"🎆",perplexity:"❓",azure:"🔵",anyscale:"🔷",lmstudio:"🎨",vllm:"⚡"}[e]||"🔌"}function Kw(e){return{local:"Ollama",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter",openai:"OpenAI",anthropic:"Anthropic",mistral:"Mistral",cohere:"Cohere",together:"Together AI",deepinfra:"DeepInfra",fireworks:"Fireworks AI",perplexity:"Perplexity",azure:"Azure OpenAI",anyscale:"Anyscale",lmstudio:"LM Studio",vllm:"vLLM / TGI"}[e]||e}function KN({status:e,label:t}){const n=Kh[e];return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,background:n.bg,color:n.text,padding:"3px 10px",borderRadius:12,fontSize:12,fontWeight:500,border:`1px solid ${n.text}22`},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:n.dot}}),t]})}function use({onRefresh:e,loading:t}){return i.jsxs("div",{className:"stats-grid mini",style:{marginBottom:16},children:[i.jsx("button",{onClick:e,disabled:t,className:"stat-card",style:{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,border:"1px solid var(--border)",justifyContent:"center",fontSize:13},children:t?"⏳ Testing...":"🔄 Refresh Status"}),i.jsx("div",{className:"stat-card",style:{border:"1px solid var(--border)"},children:i.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",textAlign:"center",width:"100%"},children:"Tests all configured providers and their API keys in real time"})})]})}function dse({data:e}){const t=e.totalModels;if(t===0)return null;const n=e.available||0,r=e.limited||0,a=e.unavailable||0;return i.jsxs("div",{style:{marginBottom:16},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:8,overflow:"hidden",height:10,display:"flex",border:"1px solid var(--border-light)"},children:[n>0&&i.jsx("div",{style:{width:`${n/t*100}%`,background:"var(--accent-green)",transition:"width 0.5s"},title:`${n} available`}),r>0&&i.jsx("div",{style:{width:`${r/t*100}%`,background:"var(--accent-yellow)",transition:"width 0.5s"},title:`${r} limited`}),a>0&&i.jsx("div",{style:{width:`${a/t*100}%`,background:"var(--accent-red)",transition:"width 0.5s"},title:`${a} unavailable`})]}),i.jsxs("div",{style:{display:"flex",gap:16,marginTop:6,fontSize:12,color:"var(--text-secondary)"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"●"})," Ready"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"●"})," Limited"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-red)"},children:"●"})," Unavailable"]})]}),typeof e.routable=="number"&&i.jsxs("div",{style:{marginTop:6,fontSize:12,color:"var(--text-secondary)",lineHeight:1.5},children:[i.jsx("strong",{style:{color:"var(--text-primary)"},children:t})," listed by providers ·"," ",i.jsx("strong",{style:{color:e.routable>0?"var(--accent-green)":"var(--accent-yellow)"},children:e.routable})," ","routable right now (verified, un-parked, not stale)",typeof e.registryTotal=="number"&&e.registryTotal>0&&i.jsxs(i.Fragment,{children:[" ","· registry tracks"," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:e.registryVerified??0})," of"," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:e.registryTotal})," verified"]})]})]})}function qd({provider:e}){const[t,n]=k.useState(!1),r=Kh[e.overallStatus].text,a={available:e.models.filter(s=>s.status==="available").length,limited:e.models.filter(s=>s.status==="limited").length,unavailable:e.models.filter(s=>s.status==="unavailable").length};return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[i.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[i.jsx("span",{style:{fontSize:24},children:e.icon}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[i.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)"},children:e.providerLabel}),i.jsx(KN,{status:e.overallStatus,label:lse(e.overallStatus)})]}),i.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:[e.models.length," model",e.models.length!==1?"s":"",a.available>0&&i.jsxs("span",{style:{color:"var(--accent-green)"},children:[" · ",a.available," ready"]}),a.limited>0&&i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:[" · ",a.limited," limited"]}),a.unavailable>0&&i.jsxs("span",{style:{color:"var(--accent-red)"},children:[" · ",a.unavailable," unavailable"]})]})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",textAlign:"right"},children:[i.jsx("div",{style:{marginBottom:2,color:e.apiConfigured?"var(--accent-green)":"var(--accent-red)"},children:e.apiConfigured?"✅ Key set":"❌ No key"}),i.jsx("div",{style:{color:e.apiAccessible?"var(--accent-green)":"var(--accent-red)"},children:e.apiAccessible?"✅ Connected":"❌ Offline"})]}),i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{padding:"10px 18px",background:"var(--bg-primary)",fontSize:13,color:"var(--text-secondary)",display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:8,borderTop:"1px solid var(--border-light)"},children:[i.jsx("span",{children:e.notes}),e.freeTierInfo&&i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:["🎁 ",e.freeTierInfo]})]}),i.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid var(--border-light)"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Model"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Status"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Quota"}),i.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Details"})]})}),i.jsx("tbody",{children:e.models.map((s,o)=>i.jsxs("tr",{style:{borderBottom:o<e.models.length-1?"1px solid var(--border-light)":"none",background:s.status==="unavailable"?"var(--bg-primary)":"transparent"},children:[i.jsxs("td",{style:{padding:"8px 18px",color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:Kh[s.status].dot,marginRight:8}}),s.name]}),i.jsx("td",{style:{padding:"8px 12px"},children:i.jsx(KN,{status:s.status,label:cse(s.status)})}),i.jsx("td",{style:{padding:"8px 12px",color:"var(--text-secondary)",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:s.rateLimitRemaining!==void 0?s.rateLimitTotal?`${s.rateLimitRemaining}/${s.rateLimitTotal}`:`${s.rateLimitRemaining} left`:"—"}),i.jsx("td",{style:{padding:"8px 18px",color:"var(--text-secondary)",fontSize:12},children:s.statusReason})]},s.id))})]})})]})]})}function eM(e){if(e<=0)return"now";const t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4);return t>0?`${t}h ${n}m`:n>0?`${n}m`:`${Math.ceil(e/1e3)}s`}function fse(e){return e==="verified"?{text:"var(--accent-green)",bg:"var(--ok-soft)",dot:"var(--accent-green)"}:e==="unavailable"?{text:"var(--accent-red)",bg:"var(--danger-soft)",dot:"var(--accent-red)"}:{text:"var(--text-secondary)",bg:"var(--bg-hover)",dot:"var(--bg-hover)"}}function hse({rate:e}){const t=Math.round(e*100);return i.jsxs("span",{title:`⏸ flaky mid-stream ${t}% — started streaming, died before finish; the router deprioritizes flaky models (P4 M4.4)`,style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--purple-soft)",border:"1px solid var(--accent-purple)",color:"var(--accent-purple)"},children:["⏸ flaky ",t,"%"]})}function pse({tokens:e}){const t=e>=1048576?`${(e/1048576).toFixed(1).replace(/\.0$/,"")}M`:e>=1024?`${(e/1024).toFixed(0)}K`:`${e}`;return i.jsxs("span",{title:`⏳ context window ${gt(e)} tokens — live from the provider's model list (v1.60.x); feeds the router's context preflight`,style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--info-soft)",border:"1px solid var(--accent-blue)",color:"var(--accent-blue)"},children:["⏳ ",t]})}function mse({history:e}){if(!e||e.length<2)return null;const t=46,n=14,r=1.5,a=Math.max(.01,...e.map(d=>d.rate)),s=e.map((d,f)=>{const h=r+f/(e.length-1)*(t-r*2),p=n-r-d.rate/a*(n-r*2);return`${h.toFixed(1)},${p.toFixed(1)}`}).join(" "),o=e[0].rate,l=e[e.length-1].rate,c=l<o,u=Math.round(l*100);return i.jsxs("svg",{width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:{marginLeft:8,verticalAlign:"middle",cursor:"default"},"aria-label":"Flakiness trend",children:[i.jsx("title",{children:c?`Flakiness healing — ${u}% now, trending down (clean successes decay the signal)`:`Flakiness climbing — ${u}% now (recent mid-stream interruptions)`}),i.jsx("polyline",{points:s,fill:"none",style:{stroke:"var(--accent-purple)"},strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),i.jsx("circle",{cx:t-r,cy:n-r-l/a*(n-r*2),r:2,style:{fill:c?"var(--accent-green)":"var(--accent-purple)"}})]})}function gse({entry:e}){const t=fse(e.status),n=e.remainingTokens>=0?`${gt(e.remainingTokens)} left`:"unlimited";return i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"8px 12px",color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:t.dot,marginRight:8}}),e.model.length>32?e.model.slice(0,29)+"…":e.model,(e.partialRate??0)>0&&i.jsx(hse,{rate:e.partialRate??0}),e.partialHistory&&e.partialHistory.length>=2&&i.jsx(mse,{history:e.partialHistory}),e.parked&&i.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,background:"var(--danger-soft)",border:"1px solid var(--accent-red)",color:"var(--accent-red)"},children:"⏸ parked"}),e.measuredSamples?i.jsxs("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--ok-soft)",border:"1px solid var(--accent-green)",color:"var(--accent-green)"},children:["📏 ",e.measuredInputTokens,"→",e.measuredOutputTokens," tok"]}):i.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--bg-hover)",border:"1px solid var(--border-hover)",color:"var(--text-secondary)"},children:"📐 est"}),e.contextWindowTokens&&i.jsx(pse,{tokens:e.contextWindowTokens})]}),i.jsx("td",{style:{padding:"8px 12px"},children:i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,fontWeight:600,background:t.bg,color:t.text,padding:"2px 8px",borderRadius:6},children:e.status==="verified"?"✓ Verified":e.status==="unavailable"?"✗ Unavailable":"◌ Unverified"})}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:e.remainingTokens>=0&&e.remainingTokens<=100?"var(--accent-yellow)":"var(--text-secondary)"},children:n}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"var(--text-secondary)",fontSize:12,whiteSpace:"nowrap"},children:e.resetsInMs>0?eM(e.resetsInMs):"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"var(--text-secondary)",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.latencyMs!==void 0?`${e.latencyMs}ms`:"—"}),i.jsx("td",{style:{padding:"8px 12px",color:"var(--text-muted)",fontSize:11,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.lastError||(e.source?`learned via ${e.source}`:"")})]})}function vse({provider:e}){const[t,n]=k.useState(!1),r=e.verified>0?"var(--accent-green)":e.unavailable>0?"var(--accent-red)":"var(--border-hover)";return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[i.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[i.jsx("span",{style:{fontSize:24},children:JR(e.provider)}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[i.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)"},children:Kw(e.provider)}),i.jsx("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:e.parked>0?"var(--danger-soft)":"var(--ok-soft)",border:`1px solid ${e.parked>0?"var(--accent-red)":"var(--accent-green)"}`,color:e.parked>0?"var(--accent-red)":"var(--accent-green)"},children:e.parked>0?`${e.parked} parked`:"routable"}),(e.flaky??0)>0&&i.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:"var(--purple-soft)",border:"1px solid var(--accent-purple)",color:"var(--accent-purple)"},children:["⏸ ",e.flaky," flaky"]})]}),i.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:[e.verified," verified · ",e.unverified," unverified · ",e.unavailable," unavailable"]})]}),i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&i.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid var(--border-light)"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Model"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Availability"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Tokens left"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Resets in"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Latency"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Reason / Source"})]})}),i.jsx("tbody",{children:e.models.map(a=>i.jsx(gse,{entry:a},a.model))})]})})]})}function yse(e){if(!e)return null;const t=Object.entries(e.consecutive).filter(([,n])=>n>0);return t.length===0?null:i.jsxs("div",{style:{background:"color-mix(in srgb, var(--accent-yellow) 8%, transparent)",border:"1px solid var(--accent-yellow)",borderRadius:10,padding:"10px 14px",marginBottom:14,fontSize:12,color:"var(--accent-yellow)",display:"flex",gap:10,alignItems:"flex-start"},children:[i.jsx("span",{style:{fontSize:15,lineHeight:"18px"},children:"🧹"}),i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:600,color:"var(--accent-yellow)",marginBottom:2},children:"Key hygiene in progress"}),i.jsx("div",{children:t.map(([n,r])=>i.jsxs("span",{style:{display:"inline-block",marginRight:12},children:[i.jsx("code",{style:{color:"var(--text-primary)"},children:n})," ",r,"/",e.threshold," consecutive auth failures",r>=e.threshold?" — key auto-cleared 🚫":" — key will be auto-cleared at the threshold"]},n))}),i.jsxs("div",{style:{marginTop:4,color:"var(--accent-yellow)"},children:["After ",e.threshold," consecutive 401/403s the invalid key is removed from config; run"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff config set providers.<provider>.apiKey <real-key>"})," to re-enable."]})]})]})}function bse({data:e}){return e.enabled?i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"📦",title:"Model Availability Registry"}),i.jsxs("p",{className:"section-description",children:["The unified sub-ms FAISS/JSON snapshot the Auto router consults on every pick: verified vs unavailable models plus quota telemetry (tokens remaining, reset windows) mirrored from the ledger. Each row's ",i.jsx("strong",{children:"⏳ chip"})," is the LIVE provider-advertised context window (v1.60.x) — the real spec the router's context preflight uses, recorded by the probe from each provider's model list (Ollama /api/tags + /api/show, OpenRouter, Gemini, NIM). State changes during a session are reported to the watch daemon and recorded here immediately."]}),i.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"📦"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:e.total}),i.jsx("div",{className:"stat-label",children:"Tracked models"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"✅"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-green)"},children:e.verified}),i.jsx("div",{className:"stat-label",children:"Verified"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"◌"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--text-secondary)"},children:e.unverified}),i.jsx("div",{className:"stat-label",children:"Unverified"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"⛔"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-red)"},children:e.unavailable}),i.jsx("div",{className:"stat-label",children:"Unavailable"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"⏸"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-yellow)"},children:e.parked}),i.jsx("div",{className:"stat-label",children:"Quota-parked"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"⏸"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-purple)"},children:e.flaky??0}),i.jsx("div",{className:"stat-label",children:"Flaky mid-stream"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"🗑️"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--text-secondary)"},children:e.deletedLocal??0}),i.jsx("div",{className:"stat-label",children:"Deleted locally"})]})]})]}),yse(e.keyHygiene),e.providers.map(t=>i.jsx(vse,{provider:t},t.provider)),i.jsx("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:12},children:"Backend snapshot · auto-refreshes every 60s"})]}):i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:24,marginBottom:8},children:"📦"}),i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Model Availability Registry"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["No registry data yet — run ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff models refresh"})," or use Auto routing; the registry learns from real usage and probes."]})]})}const xse={chat:"💬",execute:"⚙️",plan:"🗺️",edit:"✏️",skill:"🧩",learn:"📚",ci:"🔁",doctor:"🩺",probe:"🔭","spot-check":"🧪",telemetry:"📡",usage:"🧮"};function wse(e){return{chat:"Chat",execute:"Execute",plan:"Plan",edit:"Edit",skill:"Skill",learn:"Learn",ci:"CI Review",doctor:"Doctor Probe",probe:"Probe","spot-check":"Spot-check",telemetry:"Usage mirror"}[e]||e.charAt(0).toUpperCase()+e.slice(1)}function Sse(e){return xse[e]||"🎯"}function kse(e){return e?new Date(e).toLocaleDateString()+" "+new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"—"}function os({provider:e,model:t,reason:n,killed:r,transient:a,partial:s,streamedChunks:o}){const l=r===!0,c=a===!0,u=s===!0,d=u?"var(--accent-purple)":c?"var(--accent-yellow)":l?"var(--accent-red)":"var(--accent-green)",f=u?"var(--purple-soft)":c?"var(--warn-soft)":l?"var(--danger-soft)":"var(--ok-soft)";return i.jsxs("span",{title:u?`Mid-stream interruption — started streaming${typeof o=="number"?` ~${o} chunks in`:""}, died before finish (P4 M4.4); router deprioritizes flaky mid-stream providers${n?` · ${n}`:""}`:c?`Transient failure — health decayed, no flip${n?` · ${n}`:""}`:l?`Killed by this action — predictively skipped by routing${n?` · ${n}`:""}`:"Verified by this action — trusted by routing",style:{display:"inline-flex",alignItems:"center",gap:6,background:f,border:`1px solid ${d}`,color:d,padding:"3px 9px",borderRadius:8,fontSize:11,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",transition:"transform 0.15s",cursor:"default"},onMouseEnter:h=>{h.currentTarget.style.transform="scale(1.05)"},onMouseLeave:h=>{h.currentTarget.style.transform="scale(1)"},children:[i.jsx("span",{style:{opacity:.85},children:u?"⏸":c?"~":l?"✗":"✓"}),e,"/",t.length>30?t.slice(0,27)+"…":t,(l||u)&&n&&i.jsxs("span",{style:{color:`${d}99`,fontSize:10,fontWeight:400},children:["· ",n]})]})}function jse(e){const t=new Map;for(const r of e)t.set(`${r.provider}|${r.model}|${r.outcome}`,r);const n={unavailable:0,partial:1,verified:2,error:3};return[...t.values()].sort((r,a)=>n[r.outcome]-n[a.outcome]||a.at-r.at)}function Nse(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.verified+n.killed+n.transient+(n.partial||0)>0)return t}return Math.max(0,e.length-1)}function Ese({timeline:e}){const[t,n]=k.useState(()=>Nse(e||[])),[r,a]=k.useState(!1),s=k.useRef(null),o=k.useRef(!1),l=(e==null?void 0:e.length)??0,c=Math.max(0,Math.min(t,l-1));k.useEffect(()=>{n(m=>Math.min(m,Math.max(0,l-1)))},[l]);const u=k.useCallback(m=>{const y=s.current;if(!y||l<=0)return;const v=y.getBoundingClientRect(),x=v.width||1,S=Math.min(1,Math.max(0,(m-v.left)/x));n(Math.min(l-1,Math.floor(S*l)))},[l]),d=m=>{o.current=!0,a(!1),u(m.clientX)};if(k.useEffect(()=>{const m=v=>{o.current&&u(v.clientX)},y=()=>{o.current=!1};return window.addEventListener("pointermove",m),window.addEventListener("pointerup",y),()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",y)}},[u]),k.useEffect(()=>{if(!r||l<=1)return;const m=setInterval(()=>{n(y=>Math.min(l-1,y+1))},300);return()=>clearInterval(m)},[r,l]),k.useEffect(()=>{r&&l>1&&t>=l-1&&(a(!1),n(0))},[r,l,t]),!e||l===0)return null;const f=Math.max(1,...e.map(m=>m.verified+m.killed+m.transient+(m.partial||0))),h=m=>new Date(m).toLocaleDateString([],{month:"short",day:"numeric"}),p=e[c],g=p?jse(p.events||[]):[];return i.jsxs("div",{style:{marginTop:12,paddingTop:10,borderTop:"1px solid var(--border-light)"},children:[i.jsxs("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-secondary)",marginBottom:8,textTransform:"uppercase",letterSpacing:.4,display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[i.jsxs("span",{children:["📈 Learned from real usage — last ",l," days"]}),i.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",letterSpacing:0},children:"— drag across days · click a day · play to sweep"})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[i.jsx("button",{onClick:()=>{r?a(!1):(t>=l-1&&n(0),a(!0))},disabled:l<=1,"aria-label":r?"Pause scrub":"Play scrub",style:{background:"var(--bg-hover)",border:`1px solid ${r?"var(--accent-red)":"var(--border)"}`,color:"var(--text-primary)",padding:"3px 10px",borderRadius:6,cursor:l<=1?"not-allowed":"pointer",fontSize:11,fontWeight:600,transition:"all 0.15s",whiteSpace:"nowrap",opacity:l<=1?.5:1},children:r?"⏸ Pause":"▶ Play"}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:[h(p.day)," · ✓ ",p.verified," · ✗ ",p.killed,p.transient>0?` · ~ ${p.transient}`:"",p.partial>0?` · ⏸ ${p.partial}`:""]}),i.jsx("input",{type:"range",min:0,max:Math.max(0,l-1),step:1,value:c,onChange:m=>{a(!1),n(Number(m.target.value))},"aria-label":"Scrub action timeline",style:{flex:1,accentColor:"var(--accent-blue)",cursor:"pointer",minWidth:80}})]}),i.jsx("div",{ref:s,onPointerDown:d,style:{position:"relative",display:"flex",alignItems:"flex-end",gap:3,height:64,padding:"0 2px",cursor:"grab",userSelect:"none",touchAction:"none"},children:e.map((m,y)=>{const v=m.verified+m.killed+m.transient+(m.partial||0),x=m.verified/f*56,S=m.killed/f*56,j=m.transient/f*56,w=(m.partial||0)/f*56,b=y===c;return i.jsxs("div",{onClick:()=>{a(!1),n(y)},title:`${h(m.day)} — ✓ ${m.verified} verified · ✗ ${m.killed} killed · ~ ${m.transient} transient${(m.partial||0)>0?` · ⏸ ${m.partial} partial`:""}`,style:{flex:1,display:"flex",flexDirection:"column-reverse",alignItems:"center",gap:0,cursor:"pointer"},children:[i.jsxs("div",{style:{position:"relative",width:"100%",borderRadius:3,overflow:b?"visible":"hidden",background:v===0?"var(--bg-hover)":"transparent",height:v===0?4:56,display:"flex",flexDirection:"column-reverse",boxShadow:b?"0 0 0 1.5px var(--accent-blue)":void 0,opacity:v===0?.5:1,transition:"box-shadow 0.15s"},children:[b&&i.jsx("div",{style:{position:"absolute",top:-3,bottom:-3,width:2,left:"50%",transform:"translateX(-50%)",background:"var(--accent-blue)",borderRadius:2,pointerEvents:"none",boxShadow:"0 0 8px color-mix(in srgb, var(--accent-blue) 53%, transparent)",zIndex:1}}),m.verified>0&&i.jsx("div",{style:{height:x,background:"var(--accent-green)",minHeight:3}}),m.killed>0&&i.jsx("div",{style:{height:S,background:"var(--accent-red)",minHeight:3}}),m.transient>0&&i.jsx("div",{style:{height:j,background:"var(--accent-yellow)",minHeight:3}}),m.partial>0&&i.jsx("div",{style:{height:w,background:"var(--accent-purple)",minHeight:3}})]}),i.jsx("div",{style:{fontSize:9,color:b?"var(--accent-blue)":"var(--text-muted)",marginTop:4,whiteSpace:"nowrap",fontWeight:b?700:400},children:h(m.day)})]},m.day)})}),i.jsxs("div",{style:{display:"flex",gap:14,marginTop:6,fontSize:11,color:"var(--text-secondary)"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"■"})," verified"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-red)"},children:"■"})," killed"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"■"})," transient"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-purple)"},children:"■"})," partial"]})]}),i.jsxs("div",{style:{marginTop:10,background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:8,padding:"10px 12px"},children:[i.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:[h(p.day)," ",i.jsx("span",{style:{color:"var(--text-secondary)",fontWeight:400},children:"— what this action learned that day"})]}),g.length===0?i.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"No learning recorded that day — nothing verified, killed, or partial."}):i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:g.map(m=>m.outcome==="unavailable"?i.jsx(os,{provider:m.provider,model:m.model,reason:m.errorType,killed:!0},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="verified"?i.jsx(os,{provider:m.provider,model:m.model},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="partial"?i.jsx(os,{provider:m.provider,model:m.model,reason:m.errorType,partial:!0,streamedChunks:m.streamedChunks},`${m.provider}|${m.model}|${m.outcome}`):i.jsx(os,{provider:m.provider,model:m.model,reason:m.errorType,transient:!0},`${m.provider}|${m.model}|${m.outcome}`))})]})]})}function _se({entry:e}){var a,s;const[t,n]=k.useState(!0),r=(e.partial||0)>0?"var(--accent-purple)":e.killed>0?"var(--accent-red)":e.verified>0?"var(--accent-green)":"var(--accent-yellow)";return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:`1px solid ${r}33`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[i.jsxs("div",{onClick:()=>n(!t),style:{padding:"12px 16px",cursor:"pointer",display:"flex",alignItems:"center",gap:12,userSelect:"none"},children:[i.jsx("span",{style:{fontSize:20},children:Sse(e.action)}),i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",marginBottom:2},children:wse(e.action)}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",display:"flex",gap:14,flexWrap:"wrap"},children:[i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-green)"},children:["✓ ",e.verified]})," verified"]}),i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-red)"},children:["✗ ",e.killed]})," killed"]}),e.transient>0&&i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:["~ ",e.transient]})," transient"]}),(e.partial||0)>0&&i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-purple)"},children:["⏸ ",e.partial]})," partial"]})]})]}),i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:16,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&i.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--border-light)",background:"var(--bg-primary)"},children:[e.killedModels.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--accent-red)",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"⛔ Killed — skipped predictively by routing"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.killedModels.map(o=>i.jsx(os,{provider:o.provider,model:o.model,reason:o.reason,killed:!0},`${o.provider}|${o.model}`))})]}),e.verifiedModels.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--accent-green)",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"✅ Verified — trusted by routing"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.verifiedModels.map(o=>i.jsx(os,{provider:o.provider,model:o.model},`${o.provider}|${o.model}`))})]}),(((a=e.partialModels)==null?void 0:a.length)||0)>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--accent-purple)",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"⏸ Partial — mid-stream interruption (flaky provider, deprioritized)"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.partialModels.map(o=>i.jsx(os,{provider:o.provider,model:o.model,reason:o.reason,partial:!0,streamedChunks:o.streamedChunks},`${o.provider}|${o.model}`))})]}),e.killedModels.length===0&&e.verifiedModels.length===0&&(((s=e.partialModels)==null?void 0:s.length)||0)===0&&i.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"Only transient failures — health decayed, no model flipped."}),i.jsx(Ese,{timeline:e.timeline})]})]})}function Ase({registry:e}){const t=e.actionTelemetry;return t?t.enabled?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"🎓 Learned from real usage — per action"}),i.jsxs("p",{className:"section-description",children:["Every LLM call writes through to the health store with its action tag. This panel shows which provider × model each action ",i.jsx("span",{style:{color:"var(--accent-green)"},children:"verified"})," (routable) or"," ",i.jsx("span",{style:{color:"var(--accent-red)"},children:"killed"})," (predictively skipped) — the exact feed that turns “fail gemini → fail nim → local” into “straight to local”."]}),i.jsxs("div",{className:"stats-grid mini",style:{marginBottom:16},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"📊"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:t.total}),i.jsx("div",{className:"stat-label",children:"Telemetry events"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"🎯"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:t.actions.length}),i.jsx("div",{className:"stat-label",children:"Actions learning"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"⏱️"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{fontSize:15},children:kse(t.updatedAt)}),i.jsx("div",{className:"stat-label",children:"Last update"})]})]}),t.synthetic>0&&i.jsxs("div",{className:"stat-card",title:"Written by a test process — excluded from every number on this panel. The records remain in the hash-chained log.",children:[i.jsx("span",{className:"stat-icon",children:"🧪"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-yellow)"},children:t.synthetic}),i.jsx("div",{className:"stat-label",children:"Test-origin, excluded"})]})]})]}),t.actions.map(n=>i.jsx(_se,{entry:n},n.action)),i.jsx("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:12},children:"All actions share one health store — a provider killed by any action is skipped by all others"})]}):i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"18px 24px",marginTop:24,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,marginBottom:6},children:"🎓"}),i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Learned from real usage — per action"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)",lineHeight:1.5},children:["No per-action telemetry yet. As you use ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"chat"}),","," ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"execute"}),", ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"plan"}),", and ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"edit"}),", each action's verified / killed provider × model combos appear here — showing exactly what routing learned from real usage."]})]}):null}function Kd({icon:e,title:t,count:n}){return n===0?null:i.jsxs("h3",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:"24px 0 12px 0",display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{children:e})," ",t,i.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)",fontWeight:400,background:"var(--bg-card)",padding:"1px 8px",borderRadius:8},children:n})]})}function Cse({value:e,onChange:t,totalCount:n}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[i.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"center",background:"var(--bg-card)",borderRadius:8,border:"1px solid var(--border)",transition:"border-color 0.2s"},children:[i.jsx("span",{style:{position:"absolute",left:12,fontSize:14,color:"var(--text-muted)",pointerEvents:"none"},children:"🔍"}),i.jsx("input",{type:"text",value:e,onChange:r=>t(r.target.value),placeholder:"Search models by name or provider...",style:{width:"100%",padding:"10px 12px 10px 36px",background:"transparent",border:"none",color:"var(--text-primary)",fontSize:13,outline:"none",fontFamily:"inherit"},onFocus:r=>{r.currentTarget.parentElement.style.borderColor="var(--accent-blue)"},onBlur:r=>{r.currentTarget.parentElement.style.borderColor="var(--border)"}}),e&&i.jsx("button",{onClick:()=>t(""),style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",padding:"8px 12px",fontSize:14,lineHeight:1},children:"✕"})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:[n," model",n!==1?"s":""]})]})}function Tse({value:e,onChange:t}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--text-secondary)",marginBottom:14},children:[i.jsx("span",{children:"Columns:"}),nse.map(n=>i.jsx("button",{onClick:()=>t(n),style:{padding:"4px 12px",borderRadius:6,background:e===n?"var(--accent-blue)":"var(--bg-hover)",color:e===n?"var(--text-on-accent)":"var(--text-secondary)",border:`1px solid ${e===n?"var(--accent-blue)":"var(--border)"}`,cursor:"pointer",fontSize:12,fontWeight:e===n?600:400,transition:"all 0.15s"},children:n},n))]})}function Ose({model:e,provider:t}){const n=Kh[e.status],r=e.rateLimitRemaining!==void 0?e.rateLimitTotal?`${e.rateLimitRemaining} / ${e.rateLimitTotal}`:`${e.rateLimitRemaining} left`:"—";return i.jsx("td",{style:{padding:10,verticalAlign:"top"},children:i.jsxs("div",{style:{background:n.cardBg,border:`1px solid ${n.cardBorder}44`,borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:8,height:"100%",transition:"all 0.2s ease",position:"relative",overflow:"hidden",cursor:"default"},onMouseEnter:a=>{a.currentTarget.style.borderColor=n.cardBorder,a.currentTarget.style.boxShadow=`0 2px 10px ${n.cardBorder}22`},onMouseLeave:a=>{a.currentTarget.style.borderColor=`${n.cardBorder}44`,a.currentTarget.style.boxShadow="none"},children:[i.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:3,background:n.cardBorder,opacity:.6}}),i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingTop:2},children:e.name.length>28?e.name.slice(0,25)+"…":e.name}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:[JR(t)," ",Kw(t)]}),i.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:5,background:n.bg,color:n.text,padding:"3px 8px",borderRadius:6,fontSize:11,fontWeight:600,alignSelf:"flex-start"},children:[i.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:n.dot}}),e.status==="available"?"Available":e.status==="limited"?"Limited":"Unavailable"]}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)"},children:[i.jsx("span",{style:{color:"var(--text-secondary)"},children:"Tokens:"})," ",i.jsx("span",{style:{color:e.rateLimitRemaining!==void 0&&e.rateLimitRemaining<=10?"var(--accent-yellow)":"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontWeight:500},children:r})]}),e.routable===!1&&i.jsx("div",{style:{fontSize:10,color:"var(--accent-yellow)",lineHeight:1.3,marginTop:2},children:e.registryStatus==="unavailable"?e.registryDead?"✗ Not served here — this id does not exist on the endpoint":"✗ Your key cannot use this model (auth / entitlement / access)":e.registryStatus==="verified"?"◌ Parked or gone stale — not routable now":e.registryStatus==="unverified"?"◌ Listed but never verified — the router cannot pick it":"◌ Not in the registry — never probed"}),e.routable===!1&&e.registryError&&i.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",lineHeight:1.3,marginTop:1},children:e.registryError.length>60?e.registryError.slice(0,57)+"…":e.registryError}),e.entitlement&&e.entitlement.tier!=="unknown"&&i.jsx("div",{title:e.entitlement.basis,style:{fontSize:10,lineHeight:1.3,marginTop:2,color:e.entitlement.tier==="free"?"var(--accent-green)":"var(--text-secondary)"},children:e.entitlement.tier==="free"?"🎁 free":"💸 metered"}),e.status!=="available"&&e.statusReason&&i.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",lineHeight:1.3,marginTop:2},children:e.statusReason.length>45?e.statusReason.slice(0,42)+"…":e.statusReason}),e.parked&&e.resetsInMs!==void 0&&e.resetsInMs>0&&i.jsxs("div",{style:{fontSize:10,color:"var(--accent-yellow)",lineHeight:1.3,marginTop:4,padding:"3px 6px",borderRadius:4,background:"var(--warn-soft)",border:"1px solid color-mix(in srgb, var(--accent-yellow) 27%, transparent)"},children:["⏳ Resets in ",eM(e.resetsInMs)]})]})})}function Pse({providers:e,colsPerRow:t,searchQuery:n}){const r=[];for(const l of e)for(const c of l.models)r.push({model:c,provider:l.provider});if(r.length===0)return null;let a=r;if(n.trim()){const l=n.toLowerCase().trim();a=r.filter(({model:c,provider:u})=>c.name.toLowerCase().includes(l)||Kw(u).toLowerCase().includes(l)||u.toLowerCase().includes(l))}const s={available:0,limited:1,unavailable:2};a.sort((l,c)=>s[l.model.status]-s[c.model.status]);const o=[];for(let l=0;l<a.length;l+=t)o.push(a.slice(l,l+t));return i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"📋 Model Health Overview"}),i.jsx("p",{className:"section-description",children:"All models across all providers, color-coded by health status. Each cell shows: Model · Provider · Health · Token Remaining."}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsx("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:10,tableLayout:"fixed"},children:i.jsx("tbody",{children:o.length>0?o.map((l,c)=>i.jsxs("tr",{children:[l.map(({model:u,provider:d})=>i.jsx(Ose,{model:u,provider:d},`${d}-${u.id}`)),l.length<t&&Array.from({length:t-l.length}).map((u,d)=>i.jsx("td",{style:{padding:10}},`empty-${d}`))]},c)):i.jsx("tr",{children:i.jsxs("td",{colSpan:t,style:{textAlign:"center",padding:40,color:"var(--text-muted)",fontSize:13},children:['No models match your search "',n,'"']})})})})}),n.trim()&&a.length>0&&i.jsxs("div",{style:{textAlign:"right",fontSize:11,color:"var(--text-muted)",marginTop:4},children:["Showing ",a.length," of ",r.length," models"]})]})}function Rse(){return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:24,marginBottom:8},children:"🎙️"}),i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Speech / TTS Provider"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["Speech/TTS provider support coming soon."," ",i.jsx("a",{href:"https://github.com/imdheerajKube/agent-nuvira-documentation/issues/new",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-blue)",textDecoration:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.textDecoration="underline"},onMouseLeave:e=>{e.currentTarget.style.textDecoration="none"},children:"Request a provider"})]})]})}function Mse(){return i.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:10,padding:14,marginBottom:20,border:"1px solid var(--border-light)",fontSize:13,color:"var(--text-secondary)",display:"flex",flexWrap:"wrap",gap:20},children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:"Color Coding"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"●"})," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Green"})," — Working with rate limit available"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"●"})," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Amber"})," — Slow / low rate limit / needs action"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-red)"},children:"●"})," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Red"})," — API key missing / payment needed / unreachable"]})]})]}),i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:"Provider Sections"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,fontSize:12},children:[i.jsxs("span",{children:["✅ ",i.jsx("strong",{children:"Cloud"})," — Online providers with active API keys"]}),i.jsxs("span",{children:["🏠 ",i.jsx("strong",{children:"Local"})," — Locally running inference servers"]}),i.jsxs("span",{children:["⛔ ",i.jsx("strong",{children:"Unavailable"})," — Missing keys or unreachable endpoints"]}),i.jsxs("span",{children:["🎙️ ",i.jsx("strong",{children:"Speech"})," — Text-to-speech / speech-to-text providers (coming)"]})]})]})]})}function Ise(){const[e,t]=k.useState(null),[n,r]=k.useState(null),[a,s]=k.useState(!0),[o,l]=k.useState(null),[c,u]=k.useState(4),[d,f]=k.useState(""),h=k.useRef(!0),p=k.useRef(null),g=k.useRef(!1);function m(){p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h.current&&y()},ase)}async function y(){s(!0),l(null),g.current=!1;try{const[x,S]=await Promise.all([sse(()=>{g.current=!0}),ose(()=>{g.current=!0})]);if(!h.current)return;t(x),r(S),g.current&&m()}catch(x){if(!h.current)return;l(x instanceof Error&&x.message?x.message:"Failed to fetch model status"),g.current&&m()}finally{h.current&&s(!1)}}k.useEffect(()=>{h.current=!0,y();const x=setInterval(y,rse);return()=>{h.current=!1,clearInterval(x),p.current&&clearTimeout(p.current)}},[]);function v(x){const S=[],j=[],w=[],b=[],N={available:0,limited:1,unavailable:2};for(const E of x.providers)tse.has(E.provider)?w.push(E):ese.has(E.provider)?j.push(E):E.overallStatus==="available"?S.push(E):b.push(E);return S.sort((E,T)=>N[E.overallStatus]-N[T.overallStatus]),j.sort((E,T)=>N[E.overallStatus]-N[T.overallStatus]),w.sort((E,T)=>N[E.overallStatus]-N[T.overallStatus]),b.sort((E,T)=>N[E.overallStatus]-N[T.overallStatus]),{available:S,local:j,speech:w,unavailable:b}}return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"🧠",title:"Model Provider Status",description:"Real-time health check of all AI providers and their available models. Providers are grouped into sections: Available cloud → Local → Unavailable."}),i.jsx(use,{onRefresh:y,loading:a}),i.jsx(Mse,{}),a&&!e&&i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Testing all 17 provider connections..."})]}),o&&i.jsxs("div",{className:"empty-state",style:{color:"var(--accent-red)",border:"1px solid color-mix(in srgb, var(--accent-red) 27%, transparent)",borderRadius:10,padding:16,marginBottom:16},children:["⚠️ ",o]}),e&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"🧠"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:e.totalModels}),i.jsx("div",{className:"stat-label",children:"Total Models"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"✅"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-green)"},children:e.available}),i.jsx("div",{className:"stat-label",children:"Available"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"🟡"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-yellow)"},children:e.limited}),i.jsx("div",{className:"stat-label",children:"Limited"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"🔴"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-red)"},children:e.unavailable}),i.jsx("div",{className:"stat-label",children:"Unavailable"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"🔌"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:e.providers.length}),i.jsx("div",{className:"stat-label",children:"Providers"})]})]})]}),i.jsx(dse,{data:e}),(()=>{const{available:x,local:S,speech:j,unavailable:w}=v(e);return i.jsxs(i.Fragment,{children:[i.jsx(Kd,{icon:"✅",title:"Available Cloud Providers",count:x.length}),x.map(b=>i.jsx(qd,{provider:b},b.provider)),i.jsx(Kd,{icon:"🏠",title:"Local Providers",count:S.length}),S.map(b=>i.jsx(qd,{provider:b},b.provider)),i.jsx(Kd,{icon:"⛔",title:"Unavailable Providers",count:w.length}),w.map(b=>i.jsx(qd,{provider:b},b.provider)),i.jsx(Kd,{icon:"🎙️",title:"Speech / TTS Providers",count:j.length}),j.map(b=>i.jsx(qd,{provider:b},b.provider))]})})(),i.jsx(Cse,{value:d,onChange:f,totalCount:e.providers.reduce((x,S)=>x+S.models.length,0)}),i.jsx(Tse,{value:c,onChange:u}),i.jsx(Pse,{providers:e.providers,colsPerRow:c,searchQuery:d}),n&&i.jsx(bse,{data:n}),n&&i.jsx(Ase,{registry:n}),e&&!n&&i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"14px 20px",marginTop:24,fontSize:12,color:"var(--text-secondary)",lineHeight:1.6},children:["📦 Registry & telemetry sections are hidden — this dashboard server did not return model-registry data (it may be an"," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"older version"}),"). Restart the dashboard from the latest install to see them."]}),i.jsx(Rse,{}),i.jsxs("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:16},children:["Last checked: ",new Date(e.lastChecked).toLocaleTimeString()," · ","Auto-refreshes every 60s"]})]})]})}const $se={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},Lse={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},Dse={trivial:"🟢",simple:"🔵",moderate:"🟡",complex:"🟠",critical:"🔴"},tM={trivial:"🟢 trivial",simple:"🔵 simple",moderate:"🟡 moderate",complex:"🟠 complex",critical:"🔴 critical"},Bse={chat:"💬 chat",orchestrator:"🔀 orchestrator",explain:"🔍 explain",benchmark:"📈 benchmark",eval:"🎯 eval"},Ui=[{key:"request",icon:"🎯",title:"Request"},{key:"candidates",icon:"⚖️",title:"Candidates"},{key:"exclusions",icon:"🚫",title:"Exclusions"},{key:"pick",icon:"✅",title:"Pick"}],zse=2400;function Rg(e){return $se[e]||"🔌"}function VN(e){return Lse[e]||e}function Vw(e){return e&&Bse[e]||e||"unknown"}function Fse(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}function YN(e){const t=Math.ceil(e/6e4);return t>=60?`${Math.floor(t/60)}h ${t%60}m`:`${t}m`}const Use=8;function XN(e,t){const n=t.quota,r=n==null?void 0:n.entries.find(s=>s.provider===e);return r!=null&&r.parked?r.resetsInMs>0?`quota exhausted — auto re-enables in ${YN(r.resetsInMs)}`:"quota exhausted — parked":r&&r.cooldownRemaining>0?`circuit-breaker cooldown — ${YN(r.cooldownRemaining)} remaining`:t.providers.some(s=>s.provider===e)?"ranked below the candidate cutoff for this complexity":"not scored for this complexity (no benchmark quality data)"}function Wse(e){var s,o,l;const t=new Set;for(const c of e.providers)t.add(c.provider);if(e.usage)for(const c of Object.keys(e.usage.byProvider))t.add(c);if(e.bestModels)for(const c of e.bestModels)t.add(c.model.split("/")[0]);if(e.quota)for(const c of e.quota.entries)t.add(c.provider);const n=new Map(e.preference.map(c=>[c.complexity,c])),r=[],a=[...e.history??[]].sort((c,u)=>(u.timestamp??0)-(c.timestamp??0));for(const c of a.slice(0,Use)){const u=n.get(c.complexity),d=(s=u==null?void 0:u.providers)!=null&&s.length?u.providers.map(g=>({provider:g.provider,score:g.score,reason:g.reason})):[{provider:c.provider,score:c.score,reason:"actual pick recorded"}];d.some(g=>g.provider===c.provider)||d.push({provider:c.provider,score:c.score,reason:"actual pick recorded"});const f=new Set(d.map(g=>g.provider)),h=[...t].filter(g=>!f.has(g)).map(g=>({provider:g,reason:XN(g,e)})),p=(o=d.find(g=>g.provider===c.provider))==null?void 0:o.reason;r.push({id:c.id,label:`${Vw(c.source)} · ${c.complexity} · ${(c.task||c.agentType).slice(0,26)}`,real:!0,complexity:c.complexity,task:c.task||c.agentType,agentType:c.agentType,source:c.source,timestamp:c.timestamp,winner:`${c.provider}/${c.model}`,winnerScore:c.score,winnerReason:p,candidates:d,exclusions:h})}if(r.length===0)for(const c of e.preference){const u=c.winner.split("/"),d=c.providers.map(g=>({provider:g.provider,score:g.score,reason:g.reason})),f=new Set(d.map(g=>g.provider)),h=[...t].filter(g=>!f.has(g)).map(g=>({provider:g,reason:XN(g,e)})),p=u[0];r.push({id:`profile-${c.complexity}`,label:`${tM[c.complexity]||c.complexity} — what the router would pick`,real:!1,complexity:c.complexity,task:p?`A ${c.complexity} task (auto-routed)`:`A ${c.complexity} task`,agentType:"chat",winner:c.winner,winnerScore:c.score,winnerReason:(l=d.find(g=>g.provider===p))==null?void 0:l.reason,candidates:d,exclusions:h})}return r}function Hse(e,t){switch(e){case"request":return`A ${t.complexity} task arrives${t.source?` from ${Vw(t.source)}`:""} and must be routed.`;case"candidates":return`${t.candidates.length} provider${t.candidates.length!==1?"s":""} are scored against the ${t.complexity} weight profile.`;case"exclusions":return t.exclusions.length>0?`${t.exclusions.length} provider${t.exclusions.length!==1?"s":""} known to the system are skipped before scoring.`:"Every known provider was scored — nothing was skipped.";case"pick":return t.winnerReason?`The top score wins: ${t.winner.split("/")[0]} ranked first — ${t.winnerReason}.`:`The top score wins: ${t.winner}.`}}function Gse({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return i.jsx("div",{style:{flex:1,background:"var(--bg-primary)",borderRadius:4,height:6,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function qse({icon:e,title:t,narration:n}){return i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,marginBottom:14},children:[i.jsx("span",{style:{fontSize:20,lineHeight:"24px"},children:e}),i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:t}),i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:2},children:n})]})]})}function Kse({routing:e}){const t=k.useMemo(()=>Wse(e),[e]),[n,r]=k.useState(""),[a,s]=k.useState(0),[o,l]=k.useState(!1);if(k.useEffect(()=>{t.length!==0&&(t.some(p=>p.id===n)||(r(t[0].id),s(0)))},[t,n]),k.useEffect(()=>{if(!o||t.length===0)return;const p=setInterval(()=>{s(g=>(g+1)%Ui.length)},zse);return()=>clearInterval(p)},[o,t.length]),t.length===0)return null;const c=t.find(p=>p.id===n)??t[0],u=Ui[a],d=()=>{s(p=>(p+Ui.length-1)%Ui.length),l(!1)},f=()=>{s(p=>(p+1)%Ui.length),l(!1)},h=()=>l(p=>!p);return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px solid var(--border-light)",padding:"18px 20px",marginBottom:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[i.jsx("span",{style:{fontSize:20},children:"🎬"}),i.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:0},children:"Why did the router pick this?"}),c.real&&i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--ok-soft)",border:"1px solid var(--accent-green)",color:"var(--accent-green)"},children:"✓ real decision"})]}),i.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",margin:"2px 0 12px 0"},children:"Narrated step-by-step replay of a routing decision — request, candidates, exclusions, and the pick. Scrubbable, or hit play."}),i.jsx("select",{"aria-label":"Routing decision to replay",value:n,onChange:p=>{r(p.target.value),s(0),l(!1)},style:{width:"100%",marginBottom:16,padding:"8px 10px",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:12,border:"1px solid var(--border)",borderRadius:8,outline:"none"},children:t.map(p=>i.jsxs("option",{value:p.id,style:{background:"var(--bg-primary)",color:"var(--text-primary)"},children:[p.real?"● ":"○ ",p.label]},p.id))}),i.jsx(qse,{icon:u.icon,title:`${a+1}. ${u.title}${a>0?` — ${c.complexity}`:""}`,narration:Hse(u.key,c)}),u.key==="request"&&i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"14px 16px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:8},children:[i.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"var(--bg-card)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:[Dse[c.complexity]||"•"," ",tM[c.complexity]||c.complexity]}),i.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"var(--bg-card)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["🤖 ",c.agentType]}),c.source&&i.jsx("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"var(--bg-card)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:Vw(c.source)}),c.timestamp&&i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",marginLeft:"auto"},children:Fse(c.timestamp)})]}),i.jsx("div",{style:{fontSize:13,color:"var(--text-primary)"},children:c.task})]}),u.key==="candidates"&&i.jsxs("div",{children:[c.candidates.map((p,g)=>{const m=p.provider===c.winner.split("/")[0];return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:m?"var(--ok-soft)":"var(--bg-primary)",border:`1px solid ${m?"var(--accent-green)":"var(--border-light)"}`,borderRadius:8,marginBottom:6},children:[i.jsxs("span",{style:{width:18,fontSize:11,color:"var(--text-muted)",textAlign:"right"},children:[g+1,"."]}),i.jsxs("span",{style:{width:104,color:m?"var(--accent-green)":"var(--text-primary)",fontWeight:m?600:400,whiteSpace:"nowrap",fontSize:12},children:[Rg(p.provider)," ",VN(p.provider).split(" ")[0],m&&" 👑"]}),i.jsx(Gse,{value:p.score,color:m?"var(--accent-green)":"var(--accent-blue)"}),i.jsx("span",{style:{width:44,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:p.score.toFixed(3)})]},p.provider)}),c.candidates.length>0&&i.jsxs("div",{style:{marginTop:10},children:[i.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginBottom:4},children:"Why each ranked where it did"}),c.candidates.map(p=>i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:3},children:[i.jsx("span",{style:{color:"var(--text-primary)"},children:p.provider}),": ",p.reason||"scored"]},p.provider))]})]}),u.key==="exclusions"&&(c.exclusions.length>0?i.jsx("div",{children:c.exclusions.map(p=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:8,marginBottom:6},children:[i.jsx("span",{style:{fontSize:13},children:"🚫"}),i.jsxs("span",{style:{width:110,color:"var(--text-primary)",whiteSpace:"nowrap",fontSize:12},children:[Rg(p.provider)," ",VN(p.provider).split(" ")[0]]}),i.jsx("span",{style:{flex:1,fontSize:12,color:"var(--text-secondary)"},children:p.reason})]},p.provider))}):i.jsx("div",{style:{background:"var(--bg-primary)",border:"1px dashed var(--border)",borderRadius:10,padding:"14px 16px",color:"var(--text-secondary)",fontSize:13},children:"✅ No exclusions — every provider known to the system was scored for this decision."})),u.key==="pick"&&i.jsxs("div",{style:{background:"var(--ok-soft)",border:"1px solid var(--accent-green)",borderRadius:10,padding:"16px 18px"},children:[i.jsx("div",{style:{fontSize:12,color:"var(--accent-green)",fontWeight:600,marginBottom:6},children:"🏆 ROUTER PICK"}),i.jsxs("div",{style:{fontSize:16,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",marginBottom:4},children:[Rg(c.winner.split("/")[0])," ",c.winner]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:10},children:["composite score ",i.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--accent-green)"},children:c.winnerScore.toFixed(3)}),!c.real&&" · profile preview"]}),c.winnerReason&&i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",borderTop:"1px solid color-mix(in srgb, var(--accent-green) 33%, transparent)",paddingTop:8},children:[i.jsx("span",{style:{color:"var(--text-primary)"},children:"Why:"})," ",c.winnerReason]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:16},children:[i.jsx("button",{onClick:d,"aria-label":"Previous step",style:Mg,children:"◀"}),i.jsx("button",{onClick:h,"aria-label":o?"Pause playback":"Play playback",style:{...Mg,minWidth:84,color:o?"var(--accent-yellow)":"var(--accent-green)"},children:o?"⏸ Pause":"▶ Play"}),i.jsx("button",{onClick:f,"aria-label":"Next step",style:Mg,children:"▶"}),i.jsx("div",{style:{display:"flex",gap:6,marginLeft:8},children:Ui.map((p,g)=>i.jsx("button",{"aria-label":`Go to step ${g+1}: ${p.title}`,onClick:()=>{s(g),l(!1)},style:{width:22,height:22,borderRadius:11,border:"none",cursor:"pointer",fontSize:10,lineHeight:"22px",padding:0,background:g===a?"var(--accent-blue)":"var(--bg-hover)",color:g===a?"var(--bg-primary)":"var(--text-secondary)"},title:p.title,children:p.icon},p.key))}),i.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-muted)"},children:["step ",a+1,"/",Ui.length]})]})]})}const Mg={background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:8,padding:"6px 12px",fontSize:13,cursor:"pointer",transition:"background 0.15s"},Vse={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},Yse={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},nM={trivial:"🟢",simple:"🔵",moderate:"🟡",complex:"🟠",critical:"🔴"};function Hr(e){return Vse[e]||"🔌"}function ji(e){return Yse[e]||e}function Vh(e,t=1){return`${(e*100).toFixed(t)}%`}function Xse(e){return`$${e.toFixed(6)}`}function sr({icon:e,title:t,subtitle:n,children:r}){return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px solid var(--border-light)",padding:"18px 20px",marginBottom:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[i.jsx("span",{style:{fontSize:20},children:e}),i.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:0},children:t})]}),n&&i.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",margin:"2px 0 12px 0"},children:n}),!n&&i.jsx("div",{style:{height:6}}),r]})}function Yw({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return i.jsx("div",{style:{flex:1,background:"var(--bg-primary)",borderRadius:4,height:6,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function bo(e,t,n="var(--text-secondary)"){return{fontSize:10,padding:"1px 7px",borderRadius:9,background:e,border:`1px solid ${t}`,color:n,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap"}}function Qse(){return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px dashed var(--border)",borderRadius:10,padding:"18px 20px",color:"var(--text-secondary)",fontSize:13,textAlign:"center"},children:["📊 No routing data yet — run ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff benchmark"})," to populate provider quality scores, or use Auto routing (",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff model switch auto"}),") to build per-agent best-model stats over time."]})}const Zse={chat:"💬 chat",orchestrator:"🔀 orchestrator",explain:"🔍 explain",benchmark:"📈 benchmark",eval:"🎯 eval"},Jse={trivial:"🟢 trivial",simple:"🔵 simple",moderate:"🟡 moderate",complex:"🟠 complex",critical:"🔴 critical"};function rM(e){return Zse[e]||e}function aM(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}function QN(e){if(e<=0)return"now";const t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4);return t>0?`${t}h ${n}m`:n>0?`${n}m`:`${Math.ceil(e/1e3)}s`}function eoe({label:e,value:t,total:n,color:r}){const a=n>0?t/n*100:0;return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[i.jsx("span",{style:{width:110,color:"var(--text-primary)",whiteSpace:"nowrap",fontSize:12},children:e}),i.jsx("div",{style:{flex:1,background:"var(--bg-primary)",borderRadius:4,height:6,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${Math.min(100,a)}%`,background:r,height:"100%",transition:"width 0.4s ease"}})}),i.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:t})]})}function toe({usage:e}){if(!e.total)return null;const t=e.total,n=Object.entries(e.byProvider).sort((a,s)=>s[1]-a[1]).slice(0,6),r=Object.entries(e.byModel).sort((a,s)=>s[1]-a[1]).slice(0,5);return i.jsxs(sr,{icon:"🧮",title:"Routing Usage — actual picks over time",subtitle:"Recorded from live chat, orchestrator runs, explain snapshots, benchmark --routing, and eval --routing",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.total}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"total decisions"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:e.last24h>0?"var(--accent-green)":"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.last24h}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"last 24h"})]})]}),i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:"By provider"}),n.map(([a,s])=>i.jsx(eoe,{label:`${Hr(a)} ${ji(a).split(" ")[0]}`,value:s,total:t,color:"var(--accent-blue)"},a)),Object.keys(e.bySource).length>0&&i.jsx("div",{style:{marginTop:12,display:"flex",gap:6,flexWrap:"wrap"},children:Object.entries(e.bySource).sort((a,s)=>s[1]-a[1]).map(([a,s])=>i.jsxs("span",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:20,padding:"3px 10px",fontSize:11,color:"var(--text-primary)"},children:[rM(a)," · ",s]},a))}),r.length>0&&i.jsxs("div",{style:{marginTop:14},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:"Most-picked models"}),r.map(([a,s])=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[i.jsx("span",{style:{flex:1,color:"var(--text-primary)",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:a,children:a.length>42?a.slice(0,39)+"…":a}),i.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:s})]},a))]})]})}function noe({history:e}){return e.length?i.jsx(sr,{icon:"🕓",title:"Audit Trail — routing decision timeline",subtitle:"Every explain snapshot (and routing-mode pick) persisted for transparency",children:i.jsx("div",{style:{maxHeight:320,overflowY:"auto",paddingRight:4},children:e.map(t=>i.jsxs("div",{style:{display:"flex",gap:10,padding:"8px 4px",borderBottom:"1px solid var(--border-light)"},children:[i.jsx("div",{style:{width:52,flexShrink:0,fontSize:11,color:"var(--text-muted)",paddingTop:2},children:aM(t.timestamp)}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:rM(t.source)}),i.jsxs("span",{style:{fontSize:12,fontWeight:600,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${t.provider}/${t.model}`,children:[Hr(t.provider)," ",t.provider,"/",t.model.length>26?t.model.slice(0,23)+"…":t.model]}),t.complexity&&i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)"},children:Jse[t.complexity]||t.complexity})]}),i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.task,children:t.task||t.agentType})]})]},t.id))})}):null}function roe({routing:e}){return e.preference.length?i.jsx(sr,{icon:"🤖",title:"Auto Router — What the agent would pick",subtitle:"Complexity-weighted scoring across reasoning, speed, cost, privacy, and reliability (real provider pricing)",children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Complexity"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Winner"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Score"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"All providers"})]})}),i.jsx("tbody",{children:e.preference.map(t=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"10px 12px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:[nM[t.complexity]||"•"," ",t.complexity]}),i.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:i.jsxs("span",{style:{color:"var(--accent-green)",fontWeight:600},children:[Hr(t.winner.split("/")[0])," ",t.winner]})}),i.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:t.score.toFixed(3)}),i.jsx("td",{style:{padding:"10px 12px",minWidth:300},children:t.providers.map((n,r)=>i.jsxs("div",{style:{marginBottom:5},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsxs("span",{style:{width:16,fontSize:11,color:"var(--text-muted)",textAlign:"right"},children:[r+1,"."]}),i.jsxs("span",{style:{width:90,color:"var(--text-primary)",whiteSpace:"nowrap",fontSize:12},children:[Hr(n.provider)," ",ji(n.provider).split(" ")[0]]}),i.jsx(Yw,{value:n.score,color:r===0?"var(--accent-green)":"var(--accent-blue)"}),i.jsx("span",{style:{width:40,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:n.score.toFixed(2)})]}),(n.capabilityFit!==void 0||n.costSource||n.contextUtilization!==void 0)&&i.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingLeft:16,marginTop:2},children:[n.capabilityFit!==void 0&&i.jsxs("span",{style:bo("var(--bg-tertiary)","var(--border-hover)"),children:["🎯 fit ",n.capabilityFit,"%"]}),n.costSource==="measured"&&n.costBasis?i.jsxs("span",{style:bo("var(--ok-soft)","var(--accent-green)","var(--accent-green)"),children:["📏 measured ",gt(n.costBasis.inputTokens),"→",gt(n.costBasis.outputTokens)," tok"]}):i.jsx("span",{style:bo("var(--bg-tertiary)","var(--border-hover)"),children:"📐 estimated"}),n.contextUtilization!==void 0&&n.contextWindowTokens!==void 0&&i.jsxs("span",{style:bo("var(--bg-tertiary)","var(--accent-blue)","var(--accent-blue)"),children:["⏳ ctx ",n.contextUtilization,"% (",gt(n.contextWindowTokens)," tok)"]})]})]},n.provider))})]},t.complexity))})]})})}):null}function aoe({routing:e}){return e.providers.length?i.jsx(sr,{icon:"📈",title:"Provider Benchmark Quality",subtitle:"Measured from your own `buff benchmark` runs — blended into Auto routing decisions",children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Provider"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Runs"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Avg Quality"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Pass Rate"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Total Cost"})]})}),i.jsx("tbody",{children:e.providers.map(t=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"10px 12px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:[Hr(t.provider)," ",ji(t.provider)]}),i.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)"},children:t.runs}),i.jsx("td",{style:{padding:"10px 12px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx(Yw,{value:t.avgQuality,color:"var(--accent-blue)"}),i.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"var(--text-secondary)",width:44,textAlign:"right"},children:Vh(t.avgQuality)})]})}),i.jsx("td",{style:{padding:"10px 12px",color:t.passRate>=.8?"var(--accent-green)":"var(--accent-yellow)"},children:Vh(t.passRate)}),i.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:Xse(t.totalCostUsd)})]},t.provider))})]})})}):null}const ZN=["trivial","simple","moderate","complex","critical"];function ioe(e){return e>=.7?"var(--accent-green)":e>=.45?"var(--accent-yellow)":"var(--accent-red)"}function soe({bandit:e}){const t=Object.keys(e.priors).sort();if(!e.enabled||t.length===0)return null;const n=e.learningHistory.slice(-15).reverse();return i.jsxs(sr,{icon:"🎰",title:"Bandit Learning — Thompson-sampling priors",subtitle:"Beta(α, β) per provider × complexity bucket, learned from real task outcomes (routing.bandit = true). Higher expected win rate = more successful history.",children:[i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider"}),ZN.map(r=>i.jsxs("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:[nM[r]||"•"," ",r]},r))]})}),i.jsx("tbody",{children:t.map(r=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"8px 10px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:[Hr(r)," ",ji(r).split(" ")[0]]}),ZN.map(a=>{var o;const s=(o=e.priors[r])==null?void 0:o[a];return!s||s.alpha===0&&s.beta===0?i.jsx("td",{style:{padding:"8px 10px",textAlign:"center",color:"var(--text-muted)"},children:"·"},a):i.jsxs("td",{style:{padding:"8px 10px",textAlign:"center"},children:[i.jsxs("div",{style:{fontSize:13,fontWeight:600,color:ioe(s.expectedWinRate),fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[(s.expectedWinRate*100).toFixed(0),"%"]}),i.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["α",s.alpha," β",s.beta]})]},a)})]},r))})]})}),n.length>0&&i.jsxs("div",{style:{marginTop:16},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:8},children:"Recent learning history"}),i.jsx("div",{style:{maxHeight:180,overflowY:"auto",paddingRight:4},children:n.map((r,a)=>{const s=r.outcome==="success"?"✅":r.outcome==="escalated"?"🔄":"❌",o=new Date(r.timestamp).toLocaleTimeString();return i.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",padding:"5px 4px",borderBottom:"1px solid var(--border-light)"},children:[i.jsx("span",{children:s}),i.jsx("span",{style:{color:"var(--text-primary)",fontSize:12,width:110,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:r.provider,children:r.provider}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",width:80},children:r.complexity}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["reward ",r.reward.toFixed(2)]}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",marginLeft:"auto"},children:o})]},a)})})]}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Cold-start Beta(1,1) behaves like the heuristic router until outcomes accumulate. Enable learning with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff config set routing.bandit true"}),"."]})]})}function ooe(e,t=1){return`${e>0?"+":""}${(e*100).toFixed(t)}%`}function loe({state:e}){const t={pass:{bg:"var(--ok-soft)",border:"var(--accent-green)",color:"var(--accent-green)",label:"✓ pass"},fail:{bg:"var(--danger-soft)",border:"var(--accent-red)",color:"var(--accent-red)",label:"✗ fail"},neutral:{bg:"var(--bg-tertiary)",border:"var(--border-hover)",color:"var(--text-secondary)",label:"○ neutral"}}[e];return i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:t.bg,border:`1px solid ${t.border}`,color:t.color},children:t.label})}function coe({promotion:e}){if(!e.decisionCount)return null;const t=e.promoted?{icon:"🎖️",label:"Promoted — the bandit beats the heuristic",color:"var(--accent-green)"}:e.sufficient?{icon:"⚠️",label:"Not promoted — the bandit is not (yet) better",color:"var(--accent-yellow)"}:{icon:"⏳",label:"Collecting data — need more diverged decisions",color:"var(--accent-blue)"},n=e.minDecisions>0?Math.min(100,Math.round(e.divergedCount/e.minDecisions*100)):0,r=[{key:"quality",label:"Quality ↑",delta:e.qualityDelta,state:e.criteria.quality?"pass":"fail",note:"needs > +2%"},{key:"cost",label:"Cost ↓",delta:e.costDelta,state:e.criteria.cost?"pass":"fail",note:"regression < +1%"},{key:"latency",label:"Latency ↓",delta:e.latencyDelta,state:e.latencyMeasured?e.criteria.latency?"pass":"fail":"neutral",note:e.latencyMeasured?"regression < +5%":"no latency measurements yet"}];return i.jsxs(sr,{icon:"🎖️",title:"Promotion Gate — is the bandit better than the heuristic?",subtitle:"A/B verdict from real trajectories (router-promotion.jsonl): quality must improve >2% while cost and latency don't regress (ruflo ADR-150)",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[i.jsx("span",{style:{fontSize:22},children:t.icon}),i.jsx("span",{style:{fontSize:14,fontWeight:600,color:t.color},children:t.label})]}),i.jsxs("div",{style:{marginBottom:14},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"var(--text-secondary)",marginBottom:5},children:[i.jsxs("span",{children:[e.divergedCount," diverged decisions"]}),i.jsxs("span",{children:["need ",e.minDecisions," for a verdict"]})]}),i.jsx("div",{style:{background:"var(--bg-primary)",borderRadius:4,height:8,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${n}%`,background:e.sufficient?"var(--accent-green)":"var(--accent-blue)",height:"100%",transition:"width 0.4s ease"}})}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:[e.decisionCount," total decisions logged"]})]}),r.map(a=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"7px 0",borderBottom:"1px solid var(--border-light)"},children:[i.jsx("span",{style:{width:70,fontSize:12,color:"var(--text-primary)"},children:a.label}),i.jsx("span",{style:{width:92,fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"var(--text-secondary)"},children:ooe(a.delta)}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",flex:1},children:a.note}),i.jsx(loe,{state:a.state})]},a.key)),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Run auto-routed tasks with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"routing.bandit true"})," to accumulate A/B decisions. The gate does not disable the bandit — it tells you whether it's actually winning."]})]})}function uoe({ml:e}){if(!e.enabled||e.recordCount===0)return null;const t=e.providers.filter(r=>r.trusted),n=e.providers.filter(r=>!r.trusted);return i.jsxs(sr,{icon:"🧠",title:"ML Router — learned from similar tasks",subtitle:"Task-feature kNN (ruflo neural-router analog): outcomes of the most similar PAST tasks nudge each provider's score. Win rate is similarity-weighted; factor = 1 + 0.5 × (winRate − 0.5), trusted only after 5 similar-task samples.",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:gt(e.recordCount)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"learned tasks"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-green)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.length}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"trusted providers"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-yellow)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-yellow)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n.length}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"still learning"})]})]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.providers.map(r=>i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"10px 14px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[i.jsx("span",{children:Hr(r.provider)}),i.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:ji(r.provider)}),r.trusted?i.jsxs("span",{style:bo("color-mix(in srgb, var(--accent-green) 15%, transparent)","var(--accent-green)","var(--accent-green)"),children:["trusted · ",r.samples," samples"]}):i.jsxs("span",{style:bo("color-mix(in srgb, var(--accent-yellow) 15%, transparent)","var(--accent-yellow)","var(--accent-yellow)"),children:[r.samples,"/5 samples"]}),r.model&&i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace",marginLeft:"auto"},children:r.model.length>30?r.model.slice(0,27)+"…":r.model})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[i.jsxs("div",{style:{width:70,fontSize:11,color:"var(--text-secondary)"},children:["win ",Vh(r.winRate,0)]}),i.jsx(Yw,{value:r.winRate,color:r.winRate>=.5?"var(--accent-green)":"var(--accent-red)"}),i.jsxs("div",{style:{width:74,fontSize:11,color:"var(--text-secondary)",textAlign:"right"},children:["factor ",i.jsxs("span",{style:{color:r.trusted&&r.factor!==1?"var(--accent-blue)":"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[r.factor.toFixed(2),"×"]})]})]})]},r.provider))}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Enabled with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff config set routing.mlRouter true"})," — the factor only adjusts scores when the provider has ≥ 5 similar-task wins (cold start is neutral)."]})]})}function doe({routing:e}){return e.bestModels.length?i.jsx(sr,{icon:"🏆",title:"Best Model per Agent (from your runs)",subtitle:"Success-rate-ranked models from agent-stats — the Auto router boosts the proven winner",children:i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:10},children:e.bestModels.map(t=>i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 14px",minWidth:200,flex:"1 1 200px",transition:"border-color 0.2s, box-shadow 0.2s"},onMouseEnter:n=>{n.currentTarget.style.borderColor="var(--accent-green)",n.currentTarget.style.boxShadow="0 2px 10px color-mix(in srgb, var(--accent-green) 13%, transparent)"},onMouseLeave:n=>{n.currentTarget.style.borderColor="var(--border-light)",n.currentTarget.style.boxShadow="none"},children:[i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:4},children:[Hr(t.model.split("/")[0])," ",t.agentType]}),i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:t.model,children:t.model.length>34?t.model.slice(0,31)+"…":t.model}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:6},children:[i.jsxs("span",{style:{color:t.successRate>=.8?"var(--accent-green)":"var(--accent-yellow)"},children:[Vh(t.successRate,0)," success"]})," · ",t.runs," run",t.runs!==1?"s":""]})]},`${t.agentType}-${t.model}`))})}):null}function foe({retrieval:e}){var l,c;if(!e.enabled&&e.repoChunks===0)return null;const t=e.totalSavedTokens??0,n=e.avgPctReduced??0,r=e.lastCall,a=e.totalCalls??0,s=e.totalRetrievals??0,o=e.totalFailovers??0;return i.jsxs(sr,{icon:"🧠",title:"Vector Retrieval — token savings",subtitle:"Large contexts are chunked, embedded locally (bge-small-en-v1.5), and reduced to the top-k relevant chunks before the LLM — saving tokens so free quotas stretch further. Complements the quota ledger: retrieval saves, the ledger manages.",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-green)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:gt(t)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"tokens saved"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsxs("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[n.toFixed(1),"%"]}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"avg context reduction"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-yellow)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-yellow)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:gt(e.repoChunks)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"repo chunks indexed"})]})]}),i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",fontSize:12,color:"var(--text-secondary)",marginBottom:14},children:[i.jsxs("span",{children:["📞 ",a," context calls · 🧠 ",s," retrievals used · ⚠️ ",o," failovers (full-context fallback)"]}),e.dimensions>0&&i.jsxs("span",{children:["· ",e.dimensions,"-dim embeddings"]})]}),r&&r.used!==!1&&((l=r.hits)==null?void 0:l.length)>0&&i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 16px",marginBottom:12},children:[i.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)",marginBottom:8},children:["Latest retrieval — ",gt(r.originalTokens)," → ",gt(r.reducedTokens)," tokens",i.jsxs("span",{style:{color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" (−",(c=r.pctReduced)==null?void 0:c.toFixed(0),"%)"]})]}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)"},children:r.hits.slice(0,5).map(u=>i.jsxs("div",{style:{marginTop:3},children:[i.jsx("span",{style:{color:"var(--accent-blue)"},children:"▸"})," ",u.filePath," ",i.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["(sim ",u.similarity.toFixed(3),")"]})]},u.filePath))})]}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)"},children:["Pre-index your repo with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff retrieval index <dir>"}),", query it with"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:'buff retrieval query "<question>"'}),", and see the same stats with"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff retrieval stats"}),"."]})]})}function hoe({quota:e}){var c;if((!e.enabled||e.entries.length===0)&&(((c=e.events)==null?void 0:c.length)??0)===0)return null;const t=e.entries.reduce((u,d)=>u+d.tokensConsumed,0),n=e.entries.reduce((u,d)=>u+d.requests,0),r=e.entries.filter(u=>u.parked).length,a=e.freeTokens??t-(e.paidTokens??0),s=e.paidTokens??0,o=e.estimatedSavedUsd??0,l=t>0?a/t*100:0;return i.jsxs(sr,{icon:"📒",title:"Quota Ledger — free-tier usage & auto re-enable",subtitle:"Tokens/requests per provider × model with reset windows. Exhausted providers are parked (excluded from Auto routing) and re-enable when the window rolls.",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:gt(t)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"tokens tracked"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"requests"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:r>0?"var(--accent-yellow)":"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"parked"})]})]}),i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:16},children:[i.jsxs("div",{style:{flex:"1 1 200px",background:"var(--bg-primary)",borderRadius:10,padding:"12px 16px",border:"1px solid var(--accent-green)"},children:[i.jsx("div",{style:{fontSize:20,fontWeight:700,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:gt(a)}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:["tokens on free/local · ",l.toFixed(0),"% of usage"]}),i.jsxs("div",{style:{fontSize:12,color:"var(--accent-green)",marginTop:4,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["💰 est. $",o.toFixed(4)," saved"]})]}),i.jsxs("div",{style:{flex:"1 1 200px",background:"var(--bg-primary)",borderRadius:10,padding:"12px 16px",border:"1px solid var(--accent-yellow)"},children:[i.jsx("div",{style:{fontSize:20,fontWeight:700,color:s>0?"var(--accent-yellow)":"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:gt(s)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"tokens on paid providers (spend triggered)"}),i.jsxs("div",{style:{fontSize:12,color:s>0?"var(--accent-yellow)":"var(--text-secondary)",marginTop:4},children:[e.paidRequests??0," paid request",e.paidRequests===1?"":"s"]})]})]}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider / Model"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Tokens"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Requests"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Resets in"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:"State"})]})}),i.jsx("tbody",{children:e.entries.map(u=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"8px 10px",whiteSpace:"nowrap"},children:[i.jsxs("span",{style:{color:"var(--text-primary)"},children:[Hr(u.provider)," ",ji(u.provider).split(" ")[0]]}),i.jsxs("span",{style:{color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" / ",u.model.length>24?u.model.slice(0,21)+"…":u.model]})]}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:gt(u.tokensConsumed)}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:u.requests}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"right",color:"var(--text-secondary)",whiteSpace:"nowrap"},children:QN(u.resetsInMs)}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"center"},children:u.parked?i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--danger-soft)",border:"1px solid var(--accent-red)",color:"var(--accent-red)"},children:"⏸ parked"}):i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--ok-soft)",border:"1px solid var(--accent-green)",color:"var(--accent-green)"},children:"✓ available"})})]},`${u.provider}|${u.model}`))})]})}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Configure limits with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff config set routing.quota.gemini.requestsPerWindow 1500"}),"; the ledger always tracks usage but only parks when limits are set."]}),e.parkedAccounts&&e.parkedAccounts.length>0&&i.jsxs("div",{style:{marginTop:18},children:[i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",marginBottom:10},children:"🔑 Parked Accounts — multi-account key rotation"}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:8},children:"Accounts skipped predictively by the failover walk (rate-limit / auth). Fingerprints only — raw keys are never stored."}),i.jsx("div",{style:{maxHeight:180,overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"8px 0"},children:e.parkedAccounts.map((u,d)=>{const f=u.reason==="auth"?"auth":u.reason==="rate-limit"?"rate-limit":u.reason||"cooldown",h=u.reason==="rate-limit"?"var(--accent-yellow)":"var(--accent-red)";return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.parkedAccounts.length-1?"1px solid var(--bg-card)":"none"},children:[i.jsx("span",{style:{fontSize:13},children:"🔒"}),i.jsxs("span",{style:{width:90,flexShrink:0,fontSize:12,color:"var(--text-primary)"},children:[Hr(u.provider)," ",ji(u.provider).split(" ")[0]]}),i.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},title:u.accountId,children:["#",u.accountId.slice(0,8)]}),i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--bg-card)",border:`1px solid ${h}`,color:h,textAlign:"center"},children:f}),i.jsx("span",{style:{flex:1}}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)",whiteSpace:"nowrap"},children:["re-admits in ",QN(u.remainingMs)]})]},`${u.provider}-${u.accountId}-${d}`)})})]}),e.events&&e.events.length>0&&i.jsxs("div",{style:{marginTop:18},children:[i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",marginBottom:10},children:"🛟 Failover Timeline — quota management & mid-session swaps"}),i.jsx("div",{style:{maxHeight:220,overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"8px 0"},children:e.events.map((u,d)=>{const f=u.type==="parked"?"⏸":u.type==="re-enabled"?"🔁":u.type==="released"?"✅":"⚡",h=u.type==="parked"?"var(--accent-red)":u.type==="re-enabled"||u.type==="released"?"var(--accent-green)":"var(--accent-yellow)",p=u.type==="parked"?"parked":u.type==="re-enabled"?"re-enabled":u.type==="released"?"released":"failover";return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.events.length-1?"1px solid var(--bg-card)":"none"},children:[i.jsx("span",{style:{fontSize:13},children:f}),i.jsx("span",{style:{width:80,flexShrink:0,fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--bg-card)",border:`1px solid ${h}`,color:h,textAlign:"center"},children:p}),i.jsxs("span",{style:{flex:1,fontSize:12,color:"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[Hr(u.provider)," ",ji(u.provider)]}),u.reason&&i.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:u.reason}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",whiteSpace:"nowrap"},children:aM(u.timestamp)})]},`${u.timestamp}-${d}`)})})]})]})}function yf({ok:e,children:t}){return i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,padding:"3px 9px",borderRadius:8,background:e===!1?"var(--danger-soft)":"var(--ok-soft)",border:`1px solid ${e===!1?"var(--accent-red)":"var(--accent-green)"}`,color:e===!1?"var(--accent-red)":"var(--accent-green)",whiteSpace:"nowrap"},children:t})}function poe({governance:e}){var r,a,s,o,l;if(!e.enabled)return i.jsx(sr,{icon:"⚖️",title:"Admin Governance Policy",subtitle:"Hard-constraint rules the Auto router enforces on every pick",children:i.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"Fully permissive"})," — no governance rules active; any provider × model is eligible.",i.jsxs("div",{style:{marginTop:6,fontSize:12,color:"var(--text-muted)"},children:["Add rules with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin allow <provider>"})," ·"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin deny <provider>"})," ·"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin max-cost <usd>"})]})]})});const t=[];(r=e.allowProviders)!=null&&r.length&&t.push({label:"allow providers",items:e.allowProviders}),(a=e.denyProviders)!=null&&a.length&&t.push({label:"deny providers",items:e.denyProviders,deny:!0}),(s=e.allowModels)!=null&&s.length&&t.push({label:"allow models",items:e.allowModels}),(o=e.denyModels)!=null&&o.length&&t.push({label:"deny models",items:e.denyModels,deny:!0});const n=[];return e.maxCostUsd!==void 0&&n.push(`max cost $${e.maxCostUsd}`),e.minPrivacyForPii!==void 0&&e.minPrivacyForPii<1&&n.push(`PII min privacy ${e.minPrivacyForPii}`),(l=e.piiPatterns)!=null&&l.length&&n.push(`PII guard (${e.piiPatterns.length} patterns)`),e.allowUnblock===!1&&n.push("unblock admin-hard"),i.jsxs(sr,{icon:"⚖️",title:"Admin Governance Policy",subtitle:"Hard-constraint rules — violating providers are eliminated, never just scored lower",children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:10},children:[t.map(c=>i.jsxs(yf,{ok:!c.deny,children:[c.deny?"⛔":"✅"," ",c.label,": ",c.items.join(", ")]},c.label)),n.map(c=>i.jsx(yf,{children:c},c)),t.length===0&&n.length===0&&i.jsx(yf,{ok:!1,children:"policy configured but no rules active"})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["Managed via ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin"})," — the same policy the CLI’s"," ",i.jsx("code",{children:"model explain"})," surfaces as governance-blocked."]})]})}function moe({rbac:e}){const t=n=>n==="admin"?"var(--accent-yellow)":n==="operator"?"var(--accent-green)":"var(--text-secondary)";return i.jsxs(sr,{icon:"🔐",title:"RBAC Identity",subtitle:"Who may write policy — role file ~/.buff/rbac.json",children:[i.jsxs("div",{style:{fontSize:13,marginBottom:10},children:[i.jsx("span",{style:{color:"var(--text-secondary)"},children:"You are "}),i.jsx("code",{style:{color:"var(--accent-blue)"},children:e.identity}),i.jsx("span",{style:{color:"var(--text-secondary)"},children:" as "}),e.role?i.jsx("span",{style:{color:t(e.role),fontWeight:600},children:e.role}):i.jsx("span",{style:{color:"var(--text-secondary)"},children:"unassigned"})]}),e.legacy?i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"Legacy single-user mode"})," — no roles assigned; policy writes are open to every user. Assign roles with"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin role add <you> admin"}),"."]}):i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[e.users.map(n=>i.jsxs(yf,{ok:n.role!=="viewer",children:[n.user," · ",n.role,n.via==="oidc"?" (oidc)":""]},n.user)),i.jsxs("div",{style:{width:"100%",fontSize:12,color:"var(--text-muted)",marginTop:4},children:["Policy ",i.jsx("em",{children:"writes"})," require ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"admin"}),"; reads are open to every role."]})]})]})}function goe({data:e}){var p,g,m,y,v,x,S,j,w,b;const t=e==null?void 0:e.routing,n=t&&(t.preference.length>0||t.providers.length>0||t.bestModels.length>0),r=!!((p=t==null?void 0:t.usage)!=null&&p.total),a=!!((g=t==null?void 0:t.history)!=null&&g.length),s=!!t&&(((m=t.history)==null?void 0:m.length)??0)>0||!!((y=t==null?void 0:t.preference)!=null&&y.length),o=!!((v=t==null?void 0:t.bandit)!=null&&v.enabled),l=!!((x=t==null?void 0:t.promotion)!=null&&x.decisionCount),c=!!((S=t==null?void 0:t.ml)!=null&&S.enabled)&&(t.ml.recordCount??0)>0,u=!!((j=t==null?void 0:t.quota)!=null&&j.enabled),d=!!((w=t==null?void 0:t.retrieval)!=null&&w.enabled)||!!((b=t==null?void 0:t.retrieval)!=null&&b.repoChunks),f=!!(t!=null&&t.governance),h=!!(t!=null&&t.rbac);return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"🤖",title:"Auto Routing Insights"}),i.jsxs("p",{className:"section-description",children:["Which providers and models the Auto router prefers — from real pricing, benchmark quality, per-agent success stats, and the Thompson-sampling bandit. Run"," ",i.jsx("code",{children:"buff benchmark"})," and use Auto routing to build this up over time."]}),!n&&!r&&!a&&!o&&!l&&!c&&!u&&!d&&!f&&!h?i.jsx(Qse,{}):i.jsxs(i.Fragment,{children:[s&&t&&i.jsx(Kse,{routing:t}),f&&t.governance&&i.jsx(poe,{governance:t.governance}),(t==null?void 0:t.rbac)&&i.jsx(moe,{rbac:t.rbac}),r&&i.jsx(toe,{usage:t.usage}),a&&i.jsx(noe,{history:t.history}),o&&i.jsx(soe,{bandit:t.bandit}),l&&i.jsx(coe,{promotion:t.promotion}),c&&t.ml&&i.jsx(uoe,{ml:t.ml}),u&&i.jsx(hoe,{quota:t.quota}),d&&i.jsx(foe,{retrieval:t.retrieval}),i.jsx(roe,{routing:t}),i.jsx(aoe,{routing:t}),i.jsx(doe,{routing:t})]}),t&&t.providers.length===0&&t.bestModels.length===0&&t.preference.length>0&&i.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4},children:"Auto-router preference is always available (static profiles + real pricing); quality metrics appear once you run benchmarks and agent tasks."})]})}const JN={chat:"💬",execute:"⚙️",plan:"🗺️",edit:"✏️",skill:"🧩",learn:"📚",ci:"🔁",doctor:"🩺",probe:"🔭","spot-check":"🧪",telemetry:"📡",usage:"🧮","ide-chat":"💬","ide-inline":"✍️","ide-execute":"⚙️"};function voe(e){return new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Vd(e){return e!==void 0?`${e}ms`:"—"}function iM(e){return e===0?"var(--accent-green)":e<.2?"var(--accent-yellow)":"var(--accent-red)"}function yoe({data:e}){const t=e.rows,n=t.reduce((c,u)=>c+u.requests,0),r=t.reduce((c,u)=>c+Math.round(u.errorRate*u.requests),0),a=t.reduce((c,u)=>c+(u.costUsd??0),0),s=t.flatMap(c=>c.latency?[c.latency.avg]:[]),o=s.length>0?Math.round(s.reduce((c,u)=>c+u,0)/s.length):void 0,l=new Set(t.map(c=>c.action)).size;return i.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"📨"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:gt(n)}),i.jsx("div",{className:"stat-label",children:"Requests"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"🎯"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:t.length}),i.jsx("div",{className:"stat-label",children:"provider × model × action groups"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"⚡"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:o!==void 0?"var(--accent-green)":"var(--text-secondary)"},children:o!==void 0?`${o}ms`:"—"}),i.jsxs("div",{className:"stat-label",children:["Avg latency",o!==void 0?` (${s.length} groups)`:" (no samples)"]})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"📛"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:iM(n>0?r/n:0)},children:n>0?`${(r/n*100).toFixed(1)}%`:"—"}),i.jsxs("div",{className:"stat-label",children:["Overall error rate (",gt(r)," failures)"]})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"💰"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:a>0?"var(--accent-yellow)":"var(--text-secondary)"},children:a>0?`$${a.toFixed(4)}`:"—"}),i.jsxs("div",{className:"stat-label",children:["Measured cost",l>0?` · ${l} actions`:""]})]})]})]})}function boe({data:e}){const[t,n]=k.useState(""),[r,a]=k.useState("all"),s=e==null?void 0:e.requests,o=k.useMemo(()=>{if(!s)return[];const u=t.trim().toLowerCase();return s.rows.filter(d=>r!=="all"&&d.action!==r?!1:u?`${d.provider} ${d.model} ${d.action}`.toLowerCase().includes(u):!0)},[s,t,r]),l=i.jsx($e,{icon:"📨",title:"Requests — per provider × model × action",description:"Aggregated from the same action-telemetry log as the Models panel — every Auto-routed call, grouped by action × provider × model. Latency percentiles appear once ≥3 samples exist; cost when the caller reported usage."});if(!e)return i.jsxs(i.Fragment,{children:[l,i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading requests..."})})]});if(!s||!s.enabled||s.rows.length===0)return i.jsxs(i.Fragment,{children:[l,i.jsxs("div",{className:"empty-state",style:{padding:"40px 24px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:28,marginBottom:10},children:"📨"}),i.jsxs("p",{className:"section-description",style:{maxWidth:560,margin:"0 auto"},children:["No request telemetry yet. As you use ",i.jsx("strong",{children:"chat"}),", ",i.jsx("strong",{children:"execute"}),","," ",i.jsx("strong",{children:"plan"})," and ",i.jsx("strong",{children:"edit"})," under Auto routing, every call writes to the action-telemetry log and this panel aggregates it: request counts, p50/p95/p99 latency, error rate and measured cost — the same feed that drives the Models panel."]})]})]});const c=[...new Set(s.rows.map(u=>u.action))].sort();return i.jsxs(i.Fragment,{children:[l,i.jsx(yoe,{data:s}),i.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14,flexWrap:"wrap",alignItems:"center"},children:[i.jsxs("select",{value:r,onChange:u=>a(u.target.value),"aria-label":"Filter by action",style:{background:"var(--bg-card)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:8,padding:"8px 10px",fontSize:13,cursor:"pointer"},children:[i.jsx("option",{value:"all",children:"All actions"}),c.map(u=>i.jsxs("option",{value:u,children:[JN[u]||"🎯"," ",u]},u))]}),i.jsxs("div",{style:{flex:1,minWidth:220,position:"relative"},children:[i.jsx("span",{style:{position:"absolute",left:10,top:8,color:"var(--text-muted)",fontSize:13},children:"🔍"}),i.jsx("input",{type:"text",value:t,onChange:u=>n(u.target.value),placeholder:"Search provider, model or action...",style:{width:"100%",padding:"8px 12px 8px 32px",background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8,color:"var(--text-primary)",fontSize:13,outline:"none"}})]}),i.jsxs("span",{style:{fontSize:12,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:[o.length," of ",s.rows.length," groups"]})]}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)",textAlign:"left"},children:[i.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Action"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Provider"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Model"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Requests"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Error rate"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Latency avg"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p50"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p95"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p99"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Measured cost"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Last seen"})]})}),i.jsx("tbody",{children:o.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:11,style:{padding:28,textAlign:"center",color:"var(--text-muted)"},children:"No request groups match your filter."})}):o.map(u=>{var d;return i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsx("td",{style:{padding:"8px 12px",whiteSpace:"nowrap"},children:i.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)",border:"1px solid var(--border)"},children:[JN[u.action]||"🎯"," ",u.action]})}),i.jsx("td",{style:{padding:"8px 12px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:u.provider}),i.jsxs("td",{style:{padding:"8px 12px",color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:u.callIds.length>0?`Correlation ids: ${u.callIds.join(", ")}`:void 0,children:[u.model.length>42?u.model.slice(0,39)+"…":u.model,u.callIds.length>0&&i.jsxs("span",{style:{color:"var(--text-muted)",marginLeft:6},title:u.callIds.join(", "),children:["🔗",u.callIds.length]})]}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:u.requests}),i.jsxs("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:iM(u.errorRate)},children:[(u.errorRate*100).toFixed(1),"%",(u.partials??0)>0&&i.jsxs("span",{title:`⏸ ${u.partials} mid-stream interruption(s) — started streaming, died before finish; the router deprioritizes flaky providers (P4 M4.4)`,style:{display:"inline-flex",alignItems:"center",gap:3,marginLeft:6,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--purple-soft)",border:"1px solid var(--accent-purple)",color:"var(--accent-purple)"},children:["⏸ ",u.partials]})]}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:Vd((d=u.latency)==null?void 0:d.avg)}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:u.latency&&u.latency.samples>=3?Vd(u.latency.p50):"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:u.latency&&u.latency.samples>=3?Vd(u.latency.p95):"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:u.latency&&u.latency.samples>=3?Vd(u.latency.p99):"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:u.costUsd?"var(--accent-yellow)":"var(--text-muted)"},children:u.costUsd!==void 0?`$${u.costUsd.toFixed(4)}`:"—"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"var(--text-muted)",fontSize:11,whiteSpace:"nowrap"},children:voe(u.lastAt)})]},`${u.action}|${u.provider}|${u.model}`)})})]})}),i.jsx("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:12},children:"Auto-refreshes with the dashboard feed · percentile columns need ≥3 latency samples per group"})]})}const xoe={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},woe={planner:"🗺️",writer:"✍️",reviewer:"🔎",tester:"🧪",debugger:"🐛",runner:"🏃","context-gatherer":"📂",memory:"🧠","self-improver":"📈"};function Soe(e){return xoe[e]||"🔌"}function koe(e){return woe[e]||"🤖"}function sM(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${new Date(e).toLocaleDateString()}`}function Xw(e){return e===void 0?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function Tc(e){return e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function joe(e){var n,r;if(!e)return null;const t={bg:"var(--bg-primary)",border:"var(--border)"};return e.unverifiedClaim?{text:"⚠️ unverified claim — said it acted, but no tool ran",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unfulfilledPromise?{text:"⚠️ unfulfilled promise — announced an action it never performed",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unverifiedBuildClaim?{text:"⚠️ unverified build claim — a build failed but the reply reported success",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unverifiedEditClaim?{text:"⚠️ unverified edit claim — asserted a fix, but nothing verified it",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unverifiedEdit?{text:`⚠️ unverified edit — ${((n=e.tools)==null?void 0:n.length)??0} tool(s), no test/typecheck/browser run`,color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.kind==="acted"?{text:e.delivered?"✅ action performed — message sent":`🔧 acted — ${((r=e.tools)==null?void 0:r.length)??0} tool(s)`,color:"var(--accent-green)",bg:"var(--ok-soft)",border:"var(--accent-green)"}:e.kind==="answered"?{text:"💬 answered — no action taken",color:"var(--text-secondary)",...t}:e.kind==="incomplete"?{text:"⏳ incomplete — ended with work still outstanding",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.kind==="cancelled"?{text:"⏹ cancelled",color:"var(--text-secondary)",...t}:{text:"❌ generation failed",color:"var(--accent-red)",bg:"var(--danger-soft)",border:"var(--accent-red)"}}function eE(e){const t=e.filter(n=>n.verdict==="CONFIRMED"&&Qw(n).length>0).length;return`${e.length} finding${e.length===1?"":"s"}: ${t} confirmed, ${e.length-t} plausible`}function Qw(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function Noe({finding:e}){const t=Qw(e),n=e.verdict==="CONFIRMED"&&t.length>0;return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderLeft:`3px solid ${n?"var(--accent-green)":"var(--accent-yellow)"}`,borderRadius:8,padding:"8px 12px",marginBottom:8},children:[i.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[i.jsx("span",{style:{fontSize:13},children:n?"✅":"🔎"}),i.jsx("span",{style:{flex:1,fontSize:12.5,fontWeight:600,color:"var(--text-primary)"},children:e.claim}),i.jsx("span",{style:{fontSize:9.5,fontWeight:700,letterSpacing:"0.04em",padding:"1px 7px",borderRadius:10,border:"1px solid",color:n?"var(--accent-green)":"var(--accent-yellow)",background:n?"var(--ok-soft)":"var(--warn-soft)",borderColor:n?"var(--accent-green)":"var(--accent-yellow)"},children:n?"CONFIRMED":"PLAUSIBLE"})]}),e.outcome?i.jsx("div",{style:{marginTop:3,fontSize:11.5,color:"var(--text-secondary)"},children:e.outcome}):null,t.length>0?i.jsx("ul",{style:{listStyle:"none",margin:"5px 0 0",padding:0},children:t.map((r,a)=>i.jsxs("li",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:3},children:[i.jsx("span",{style:{fontSize:9.5,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--accent-blue)",marginRight:5},children:r.kind}),i.jsx("span",{style:{color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.ref}),r.detail?i.jsxs("span",{style:{marginLeft:5},children:["(",r.detail,")"]}):null]},a))}):i.jsx("div",{style:{marginTop:5,fontSize:11,color:"var(--accent-yellow)"},children:"no evidence — reported as PLAUSIBLE, not verified"}),e.source?i.jsxs("div",{style:{marginTop:4,fontSize:10,color:"var(--text-muted)"},children:["source: ",e.source]}):null]})}function Eb({icon:e,title:t,subtitle:n,children:r}){return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px solid var(--border-light)",padding:"18px 20px",marginBottom:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[i.jsx("span",{style:{fontSize:20},children:e}),i.jsx("h2",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:0},children:t})]}),n&&i.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",margin:"2px 0 12px 0"},children:n}),!n&&i.jsx("div",{style:{height:6}}),r]})}function Eoe(){return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px dashed var(--border)",borderRadius:10,padding:"18px 20px",color:"var(--text-secondary)",fontSize:13,textAlign:"center"},children:["🔍 No reasoning traces yet — every LLM call in a ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff execute"})," pipeline is recorded to ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"reasoning-traces.json"}),". Run a pipeline, then replay it here or with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff trace replay <id>"}),"."]})}function _oe({step:e}){const[t,n]=k.useState(!1),r=e.success?"var(--accent-green)":"var(--accent-red)",a=e.success?"ok":"failed";return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:8,marginBottom:8,overflow:"hidden"},children:[i.jsxs("button",{onClick:()=>n(!t),style:{width:"100%",background:"none",border:"none",cursor:"pointer",padding:"10px 14px",textAlign:"left",display:"flex",alignItems:"center",gap:10,color:"inherit"},children:[i.jsx("span",{style:{width:26,fontSize:16},children:koe(e.agentType)}),i.jsx("span",{style:{width:130,fontSize:12,fontWeight:600,color:"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:e.agentType,children:e.agentType}),i.jsxs("span",{style:{flex:1,fontSize:12,color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${e.provider}/${e.model}`,children:[Soe(e.provider)," ",e.provider,"/",e.model]}),i.jsx("span",{style:{width:70,fontSize:11,color:"var(--text-muted)",textAlign:"right"},children:Xw(e.latencyMs)}),i.jsxs("span",{style:{width:86,fontSize:11,color:"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace",textAlign:"right"},children:[Tc(e.inputTokens),"→",Tc(e.outputTokens)," tok"]}),i.jsx("span",{style:{width:46,fontSize:11,color:r,textAlign:"right"},children:a}),i.jsx("span",{style:{width:22,fontSize:11,textAlign:"right"},children:e.escalated?i.jsx("span",{title:"Repair escalated to a stronger routed model (v1.60.4)",children:"🚀"}):""}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)"},children:t?"▾":"▸"})]}),t&&i.jsxs("div",{style:{padding:"0 14px 12px 50px",fontSize:12},children:[e.taskId&&i.jsxs("div",{style:{color:"var(--text-muted)",marginBottom:4},children:["Task: ",i.jsx("span",{style:{color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.taskId})]}),e.description&&i.jsx("div",{style:{color:"var(--text-secondary)",marginBottom:6},children:e.description}),e.routing&&i.jsxs("div",{style:{marginBottom:6},children:[i.jsxs("span",{style:{fontSize:10,padding:"1px 8px",borderRadius:10,background:e.escalated?"var(--warn-soft)":"var(--bg-tertiary)",border:e.escalated?"1px solid var(--accent-yellow)":"1px solid var(--accent-blue)",color:e.escalated?"var(--accent-yellow)":"var(--accent-blue)"},children:[e.escalated?"🚀 escalated auto → ":"🤖 auto → ",e.routing.provider,"/",e.routing.model," · score ",e.routing.score.toFixed(3)," · ",e.routing.complexity]}),e.escalated&&i.jsx("div",{style:{color:"var(--accent-yellow)",marginTop:4,fontSize:11},children:"Repair escalated to a stronger routed model (next complexity level)."}),e.routing.explanation&&i.jsx("div",{style:{color:"var(--text-muted)",marginTop:4,fontSize:11},children:e.routing.explanation})]}),e.layers&&i.jsxs("div",{style:{marginBottom:6,fontSize:11,color:"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[i.jsx("span",{style:{color:"var(--accent-blue)"},children:"sys"})," ",e.layers.systemChars,"c/#",e.layers.systemDigest," ·"," ",i.jsx("span",{style:{color:"var(--accent-green)"},children:"ctx"})," ",e.layers.contextChars,"c/#",e.layers.contextDigest," ·"," ",i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"vol"})," ",e.layers.volatileChars,"c/#",e.layers.volatileDigest,i.jsxs("div",{style:{color:"var(--text-muted)",marginTop:2},children:["a constant ",i.jsx("span",{style:{color:"var(--accent-blue)"},children:"sys"})," digest across steps ⇒ the stable layer is prompt-cacheable"]})]}),e.error&&i.jsxs("div",{style:{color:"var(--accent-red)",marginBottom:6},children:["⚠️ ",e.error.slice(0,300)]}),i.jsxs("div",{style:{color:"var(--text-muted)",margin:"6px 0 3px 0"},children:["Prompt ",i.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["#",e.promptDigest]})," · ",e.promptPreview.length,"+ chars:"]}),i.jsx("pre",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:6,padding:8,margin:0,color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:180,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.promptPreview.slice(0,900)}),i.jsxs("div",{style:{color:"var(--text-muted)",margin:"8px 0 3px 0"},children:["Response (",Tc(e.responseLength)," chars):"]}),i.jsx("pre",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:6,padding:8,margin:0,color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:240,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.responsePreview.slice(0,1200)})]})]})}function Aoe({trace:e}){const[t,n]=k.useState(e.steps??null),[r,a]=k.useState(!1);k.useEffect(()=>{if(e.steps){n(e.steps);return}let l=!1;return Q.fetchTraceDetail(e.id).then(c=>{l||(c!=null&&c.steps?n(c.steps):a(!0))}),()=>{l=!0}},[e.id,e.steps]);const s=e.success===!0?"✅":e.success===!1?"❌":"⏳",o=e.success===!0?"success":e.success===!1?"failed":"in progress";return i.jsxs(Eb,{icon:s,title:`${e.id} — ${o}`,subtitle:e.goal,children:[i.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12},children:[i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["🕓 ",sM(e.startedAt)]}),(()=>{const l=joe(e.outcome);return l?i.jsx("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:l.bg,border:`1px solid ${l.border}`,color:l.color},children:l.text}):null})(),i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["⏱ ",Xw(e.durationMs)]}),i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["🔢 ",(t==null?void 0:t.length)??"?"," call(s)"]}),t&&t.some(l=>l.escalated)&&i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--warn-soft)",border:"1px solid var(--accent-yellow)",color:"var(--accent-yellow)"},children:["🚀 ",t.filter(l=>l.escalated).length," escalated repair(s)"]}),e.totalTokens!==void 0&&i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["🧮 ",Tc(e.totalTokens)," tok"]}),e.findings&&e.findings.length>0&&i.jsx("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:`🔎 ${eE(e.findings)}`})]}),e.findings&&e.findings.length>0?i.jsxs("div",{style:{marginBottom:12},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:`🔎 Findings — ${eE(e.findings)}`}),e.findings.map((l,c)=>i.jsx(Noe,{finding:l},`finding-${c}`))]}):null,e.systemPrompt&&i.jsxs("details",{style:{marginBottom:12},children:[i.jsxs("summary",{style:{cursor:"pointer",fontSize:12,color:"var(--accent-blue)"},children:["🧬 System prompt — stable layer (",e.systemPromptChars??e.systemPrompt.length," chars)"]}),i.jsx("pre",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:6,padding:10,margin:"8px 0 0 0",color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:320,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.systemPrompt})]}),r&&i.jsx("div",{style:{color:"var(--accent-red)",fontSize:12,marginBottom:10},children:"Could not load trace steps (trace may have been deleted)."}),t===null&&!r&&i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:12},children:"Loading steps…"}),t&&t.length===0&&i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:12},children:"No LLM calls recorded in this trace."}),t&&t.map(l=>i.jsx(_oe,{step:l},l.seq))]})}function Coe({traces:e}){const[t,n]=k.useState(null);return t?i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>n(null),style:{background:"var(--bg-hover)",border:"1px solid var(--border)",color:"var(--text-primary)",borderRadius:8,padding:"6px 14px",fontSize:12,cursor:"pointer",marginBottom:12},children:"← Back to traces"}),i.jsx(Aoe,{trace:t})]}):i.jsx("div",{children:e.map(r=>{const a=r.success===!0?"✅":r.success===!1?"❌":"⏳",s=r.steps?[...new Set(r.steps.map(o=>o.agentType))].join(", "):"";return i.jsxs("button",{onClick:()=>n(r),style:{width:"100%",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 16px",marginBottom:8,cursor:"pointer",textAlign:"left",color:"inherit",transition:"border-color 0.2s, box-shadow 0.2s"},onMouseEnter:o=>{o.currentTarget.style.borderColor="var(--accent-blue)",o.currentTarget.style.boxShadow="0 2px 10px color-mix(in srgb, var(--accent-blue) 13%, transparent)"},onMouseLeave:o=>{o.currentTarget.style.borderColor="var(--border-light)",o.currentTarget.style.boxShadow="none"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[i.jsx("span",{children:a}),i.jsx("span",{style:{fontSize:11,color:"var(--accent-blue)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.id}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",marginLeft:"auto"},children:sM(r.startedAt)})]}),i.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",marginBottom:6},children:r.goal}),i.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",fontSize:11,color:"var(--text-secondary)"},children:[i.jsxs("span",{children:["🔢 ",r.stepCount??0," call(s)"]}),i.jsxs("span",{children:["⏱ ",Xw(r.durationMs)]}),r.failedSteps?i.jsxs("span",{style:{color:"var(--accent-red)"},children:["❌ ",r.failedSteps," failed"]}):i.jsx("span",{style:{color:"var(--accent-green)"},children:"✓ all ok"}),r.totalTokens!==void 0&&i.jsxs("span",{children:["🧮 ",Tc(r.totalTokens)," tok"]}),r.findings&&r.findings.length>0&&i.jsx("span",{style:{color:"var(--accent-yellow)"},children:`🔎 ${r.findings.filter(o=>o.verdict==="CONFIRMED"&&Qw(o).length>0).length}/${r.findings.length} confirmed`}),s&&i.jsxs("span",{children:["🤖 ",s.slice(0,60)]})]})]},r.id)})})}function Toe(){const[e,t]=k.useState(null),[n,r]=k.useState(!1),a=k.useCallback(()=>{Q.fetchTraces().then(s=>{s?(t(s),r(!1)):r(!0)})},[]);return k.useEffect(()=>{a();const s=setInterval(a,15e3);return()=>clearInterval(s)},[a]),i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"🔍",title:"Reasoning Traces",description:"Every LLM call in each pipeline — agent × model × prompt digest × response × tokens × latency × routing snapshot (assessment P0)."}),e===null&&!n&&i.jsx(Eb,{icon:"⏳",title:"Loading…",children:i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:13},children:"Fetching reasoning traces…"})}),n&&e===null&&i.jsx(Eb,{icon:"⚠️",title:"Could not reach the dashboard server",children:i.jsxs("div",{style:{color:"var(--text-secondary)",fontSize:13},children:["The traces endpoint is unavailable right now — retrying automatically. Run"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff trace list"})," in the terminal to inspect traces directly."]})}),e!==null&&e.length===0&&i.jsx(Eoe,{}),e!==null&&e.length>0&&i.jsx(Coe,{traces:e})]})}function Ig(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function Ooe({authed:e,role:t}){const[n,r]=k.useState(null),[a,s]=k.useState({}),[o,l]=k.useState(""),[c,u]=k.useState(!1),[d,f]=k.useState(null),[h,p]=k.useState(null),g=e&&(t==="admin"||t==="operator"),m=e&&t==="admin",y=k.useCallback(async()=>{var N,E,T;const w=await Q.fetchAdminQuota();if(!w){p("Could not load budget config.");return}p(null),r(w);const b={};for(const A of w.providers){const M=w.quota[A]||{};b[A]={provider:A,tokens:((N=M.tokensPerWindow)==null?void 0:N.toString())??"",requests:((E=M.requestsPerWindow)==null?void 0:E.toString())??"",windowMs:((T=M.windowMs)==null?void 0:T.toString())??""}}s(b),l(w.costUsd===null?"":String(w.costUsd))},[]);k.useEffect(()=>{y()},[y]);const v=(w,b,N)=>{s(E=>({...E,[w]:{...E[w]||{provider:w},[b]:N}}))},x=async()=>{u(!0),f(null);const w={};for(const E of Object.values(a)){const T={},A=Ig(E.tokens),M=Ig(E.requests),R=Ig(E.windowMs);A!==null&&(T.tokensPerWindow=A),M!==null&&(T.requestsPerWindow=M),R!==null&&(T.windowMs=R),w[E.provider]=Object.keys(T).length>0?T:null}const b={quota:w};if(m)if(o.trim()!==""){const E=Number(o);if(!Number.isFinite(E)||E<0){f({ok:!1,text:"Cost cap must be a non-negative number."}),u(!1);return}b.costUsd=E}else b.costUsd=null;const N=await Q.saveAdminQuota(b);u(!1),N.ok?(f({ok:!0,text:"Budget saved — the quota ledger + auto-router will enforce it."}),y()):f({ok:!1,text:N.error||"Save failed."})},S=w=>{const b=n==null?void 0:n.quota[w];return!!b&&(b.tokensPerWindow!==void 0||b.requestsPerWindow!==void 0||b.windowMs!==void 0)},j=w=>"admin-input";return i.jsxs("div",{className:"admin-quota-panel",children:[i.jsx("h2",{className:"section-subtitle",children:"💰 Daily Budget (routing.quota — your plan, your say)"}),i.jsxs("p",{className:"admin-quota-note",children:["Free-tier providers enforce tokens-per-day caps the API doesn't advertise — only you know your plan's allowance. Declare it here and the agent paces around it (parks the provider at the cap, auto-resumes at window rollover) instead of exhausting your budget mid-task. Unset = current behavior. Same config as ",i.jsx("code",{children:"buff model quota set"}),"."]}),h?i.jsx("div",{className:"admin-error",children:h}):null,n?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-quota-table",children:[i.jsxs("div",{className:"admin-quota-row admin-quota-head",children:[i.jsx("span",{children:"Provider"}),i.jsx("span",{children:"Tokens / window"}),i.jsx("span",{children:"Requests / window"}),i.jsx("span",{children:"Window (ms)"}),i.jsx("span",{children:"Status"})]}),n.providers.map(w=>{var b,N,E;return i.jsxs("div",{className:"admin-quota-row",children:[i.jsx("span",{className:"admin-provider-type",children:w}),i.jsx("input",{className:j(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((b=a[w])==null?void 0:b.tokens)??"",onChange:T=>v(w,"tokens",T.target.value)}),i.jsx("input",{className:j(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((N=a[w])==null?void 0:N.requests)??"",onChange:T=>v(w,"requests",T.target.value)}),i.jsx("input",{className:j(!g),type:"number",min:0,placeholder:"86400000 (24h)",disabled:!g,value:((E=a[w])==null?void 0:E.windowMs)??"",onChange:T=>v(w,"windowMs",T.target.value)}),i.jsx("span",{className:`admin-role-badge ${S(w)?"admin-role-admin":"admin-role-viewer"}`,children:S(w)?"declared":"unset"})]},w)})]}),i.jsxs("div",{className:"admin-quota-row admin-quota-cost",children:[i.jsx("span",{className:"admin-provider-type",children:"Max cost / call (USD, admin)"}),i.jsx("input",{className:j(!m),type:"number",min:0,step:.01,placeholder:"unset",disabled:!m,value:o,onChange:w=>l(w.target.value)}),i.jsx("span",{className:"admin-quota-cost-hint",children:"governance.maxCostUsd — hard admin cap"})]}),g||m?i.jsxs("div",{className:"admin-quota-actions",children:[i.jsx("button",{className:"admin-mini-btn",onClick:()=>void x(),disabled:c,children:c?"⏳ Saving…":"💾 Save budget"}),d?i.jsx("span",{className:d.ok?"admin-quota-ok":"admin-quota-err",children:d.text}):null]}):i.jsxs("div",{className:"admin-readonly-note",children:["🔒 Read-only for ",i.jsx("code",{children:t})," — budget limits need ",i.jsx("code",{children:"admin"})," or"," ",i.jsx("code",{children:"operator"}),"; the cost cap needs ",i.jsx("code",{children:"admin"}),"."]})]}):i.jsx("div",{className:"empty-state",children:"Loading budget…"})]})}const Poe=["image","video","search","vision","speech"],Roe={image:"🖼️ Image generation",video:"🎬 Video generation",search:"🔎 Web search & page reading",vision:"👁️ Vision / interpretation",speech:"🔊 Speech (TTS / STT)"};function Moe({authed:e,role:t}){const[n,r]=k.useState([]),[a,s]=k.useState({}),[o,l]=k.useState(null),[c,u]=k.useState({}),[d,f]=k.useState(null),h=e&&t==="admin",p=k.useCallback(async()=>{const w=await Q.fetchAdminServices();if(!w){f("Could not load service configuration — is the dashboard server up to date?");return}f(null),r(w.services)},[]);k.useEffect(()=>{p()},[p]);const g=(w,b)=>`${w}:${b}`,m=(w,b,N)=>{s(E=>({...E,[g(w,b)]:N}))},y=async w=>{const b={};for(const E of w.envVars){const T=a[g(w.id,E.varName)];T!==void 0&&T.trim()!==""&&(b[E.varName]=T.trim())}if(Object.keys(b).length===0){u(E=>({...E,[w.id]:"ℹ️ Type a value to save."}));return}l(w.id),u(E=>({...E,[w.id]:""}));const N=await Q.saveService(w.id,b);if(N.ok&&N.service){const E=N.service;r(T=>T.map(A=>A.id===w.id?E:A)),s(T=>{const A={...T};for(const M of w.envVars)delete A[g(w.id,M.varName)];return A}),u(T=>({...T,[w.id]:"✅ Saved — the agent will use it on the next call."}))}else u(E=>({...E,[w.id]:`❌ ${N.error||"Save failed."}`}));l(null)},v=async w=>{l(w.id),u(N=>({...N,[w.id]:"⏳ Testing…"}));const b=await Q.testService(w.id);u(N=>({...N,[w.id]:b.ok?`✅ ${b.detail||"Reachable"}`:`❌ ${b.error||b.detail||"Unreachable"}`})),l(null)},x=async w=>{if(!window.confirm(`Remove ${w.label}'s stored key(s)? The agent will fall back to another configured backend.`))return;l(w.id);const b=await Q.removeService(w.id);if(b.ok&&b.service){const N=b.service;r(E=>E.map(T=>T.id===w.id?N:T)),s(E=>{const T={...E};for(const A of w.envVars)delete T[g(w.id,A.varName)];return T}),u(E=>{var T;return{...E,[w.id]:`🗑️ Removed ${((T=b.removed)==null?void 0:T.join(", "))||"key(s)"}.`}})}else u(N=>({...N,[w.id]:`❌ ${b.error||"Remove failed."}`}));l(null)},S=Poe.map(w=>({cap:w,services:n.filter(b=>b.capability===w)})).filter(w=>w.services.length>0),j=n.filter(w=>w.configured).length;return i.jsxs("div",{className:"service-providers-panel",children:[i.jsx("h2",{className:"section-subtitle",children:"🔌 Service Provider API Keys (image · video · search · vision · speech)"}),i.jsxs("p",{className:"admin-subtitle",children:["These are the third-party services the agent calls directly — separate from the LLM providers above. Each row maps to a real environment variable the tool path reads; keys are written to the credential env file and picked up by the agent on the next call.",n.length>0?` ${j} of ${n.length} services ready.`:""]}),h?null:i.jsxs("div",{className:"admin-readonly-note",children:["🔒 Read-only — configuring service keys requires the ",i.jsx("code",{children:"admin"})," role (credential.write). Secret values are shown redacted."]}),d?i.jsx("div",{className:"admin-error",children:d}):null,n.length===0&&!d?i.jsx("div",{className:"empty-state",children:"Loading service configuration…"}):null,S.map(w=>i.jsxs("section",{className:"service-providers-group",children:[i.jsx("h3",{className:"process-env-group-title",children:Roe[w.cap]??w.cap}),i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Service"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Configuration"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:w.services.map(b=>i.jsxs("tr",{children:[i.jsxs("td",{className:"admin-provider-type",children:[b.icon," ",b.label,i.jsx("div",{className:"admin-provider-sub",children:b.id}),i.jsx("div",{className:"admin-hint",children:b.description}),b.sharedNote?i.jsxs("div",{className:"admin-hint",children:["🔗 ",b.sharedNote]}):null,b.docsUrl?i.jsx("div",{className:"admin-hint",children:i.jsx("a",{href:b.docsUrl,target:"_blank",rel:"noreferrer",children:"Get a key ↗"})}):null]}),i.jsxs("td",{children:[i.jsx("span",{className:`admin-check-badge ${b.configured?"admin-check-pass":"admin-check-warn"}`,children:b.configured?"✅ Ready":"⚠️ Not set"}),b.keyless?i.jsx("div",{className:"admin-hint",children:"no key needed"}):null,b.free?i.jsx("div",{className:"admin-hint",children:"free"}):null]}),i.jsx("td",{children:b.envVars.length===0?i.jsx("div",{className:"admin-hint",children:"Nothing to configure — works out of the box."}):b.envVars.map(N=>{const E=g(b.id,N.varName),T=a[E]??"",A=!N.secret&&N.set?N.value:"";return i.jsxs("div",{className:"service-env-row",children:[i.jsxs("label",{className:"service-env-label",htmlFor:E,children:[i.jsx("code",{children:N.varName}),i.jsx("span",{className:"admin-hint",children:N.prompt})]}),h?i.jsx("input",{id:E,className:"admin-input",type:N.secret?"password":"text","aria-label":`${b.id} ${N.varName}`,placeholder:N.set?N.secret?"•••••• set — type to replace":A:"not set",value:T,onChange:M=>m(b.id,N.varName,M.target.value),autoComplete:"new-password"}):i.jsx("div",{className:"admin-hint",children:N.set?N.value:"—"})]},N.varName)})}),i.jsxs("td",{children:[b.envVars.length===0?i.jsx("div",{className:"admin-hint",children:"always available"}):h?i.jsxs("div",{className:"admin-row-actions",children:[i.jsx("button",{className:"admin-mini-btn",disabled:o===b.id,onClick:()=>void y(b),children:"💾 Save"}),i.jsx("button",{className:"admin-mini-btn",disabled:o===b.id,title:"Probes the SAVED configuration — save first to test a new key",onClick:()=>void v(b),children:"🔌 Test"}),i.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:o===b.id,onClick:()=>void x(b),children:"🗑 Remove"})]}):i.jsx("div",{className:"admin-hint",children:"read-only"}),c[b.id]?i.jsx("div",{className:"admin-row-msg",children:c[b.id]}):null]})]},b.id))})]})})]},w.cap))]})}const Ioe={env:"Environment",config:"Config",vault:"Vault",local:"Local (no key)",none:"Not configured"};function $oe(){const[e,t]=k.useState(null),[n,r]=k.useState(!0),[a,s]=k.useState(null),[o,l]=k.useState(null),[c,u]=k.useState(!1),[d,f]=k.useState(!1),[h,p]=k.useState(""),[g,m]=k.useState(""),[y,v]=k.useState(null),[x,S]=k.useState(null),[j,w]=k.useState(""),[b,N]=k.useState(""),[E,T]=k.useState(""),[A,M]=k.useState(null),[R,B]=k.useState(!1),[L,F]=k.useState([]),[z,$]=k.useState(null),[O,U]=k.useState(""),[C,Z]=k.useState(""),[D,P]=k.useState("viewer"),[ie,ve]=k.useState(null),[pe,Te]=k.useState(""),[q,X]=k.useState(null),[oe,ue]=k.useState(!1),[V,_e]=k.useState(null),[je,Ne]=k.useState(null),[ge,ze]=k.useState(null),[me,ft]=k.useState([]),[Ge,Ae]=k.useState({}),[Ze,yt]=k.useState(null),[An,bt]=k.useState({}),[W,Y]=k.useState(""),[se,he]=k.useState(null),[xe,Fe]=k.useState(null),Rt=k.useCallback(async()=>{r(!0),s(null);const H=await Q.fetchAdminChecks();t(H),H||s("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),r(!1)},[]),xt=k.useCallback(async()=>{const H=await Q.fetchAdminCatalog();H&&H.length>0&&ft(H)},[]),zt=k.useCallback(async()=>{const H=await Q.fetchAdminUsers();H.ok&&H.users&&F(H.users)},[]),rn=k.useCallback(async()=>{const H=await Q.fetchAdminWorkspace();H&&(ve(H),Te(H.configured??""))},[]),Pe=k.useCallback(async()=>{const H=await Q.fetchAdminCache();H&&_e(H)},[]),Vn=async H=>{ze(H??"__none__"),Ne(null);const ne=await Q.clearAdminCache(H);ne.ok?(Ne(`✅ Cleared ${ne.removed??0} cached answer(s) for ${H??"the no-workspace bucket"}.`),Pe()):ne.unauthorized?(Cn(),Ne(`❌ ${ne.error||"Session expired — log in again."}`)):Ne(`❌ ${ne.error||"Could not clear the cache."}`),ze(null)},Ft=async H=>{H.preventDefault(),ue(!0),X(null);const ne=await Q.saveAdminWorkspace(pe.trim());ne.ok&&ne.workspace?(ve(ne.workspace),Te(ne.workspace.configured??""),X(ne.workspace.effective?`✅ Unattached chat turns now run in ${ne.workspace.effective}`:"✅ Cleared — unattached project asks will ask you to attach a folder.")):ne.unauthorized?(Cn(),X(`❌ ${ne.error||"Session expired — log in again."}`)):X(`❌ ${ne.error||"Could not save the workspace."}`),ue(!1)};k.useEffect(()=>{let H=!0;return Q.fetchAdminAuthStatus().then(ne=>{if(H){if(!ne){s("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),r(!1);return}l({configured:ne.configured,authenticated:ne.authenticated}),u(ne.authenticated),v(ne.role??null),S(ne.user??null),f(ne.mustChangePassword===!0),ne.authenticated?(Rt(),xt(),zt(),rn(),Pe()):r(!1)}}),()=>{H=!1}},[Rt,xt,zt,rn,Pe]);const an=y==="admin",Cr=y==="admin"||y==="operator",Cn=()=>{u(!1),l(H=>H&&{...H,authenticated:!1}),M("Session expired — log in again.")},sn=async H=>{H.preventDefault(),B(!0),M(null);const ne=await Q.adminLogin(j,b);ne.ok?(u(!0),l({configured:!0,authenticated:!0}),v(ne.role??"admin"),S(ne.user??null),w(""),N(""),Q.fetchAdminAuthStatus().then(Me=>{Me&&f(Me.mustChangePassword===!0)}),Rt(),xt(),zt(),rn(),Pe()):M(ne.error||"Login failed."),B(!1)},Tr=async H=>{if(H.preventDefault(),B(!0),M(null),b.length<8){M("Password must be at least 8 characters."),B(!1);return}if(b!==E){M("Passwords do not match."),B(!1);return}const ne=await Q.adminSetup(j,b);ne.ok?(u(!0),l({configured:!0,authenticated:!0}),v(ne.role??"admin"),S(ne.user??null),w(""),N(""),T(""),Rt(),xt(),zt()):M(ne.error||"Setup failed."),B(!1)},ha=async()=>{await Q.adminLogout(),u(!1),l(H=>H&&{...H,authenticated:!1}),v(null),S(null),t(null),Ae({}),bt({}),F([])},qa=async()=>{if(!window.confirm("Stop the running gateway? Channels will stop responding until you restart it with `buff gateway start`."))return;Fe("gateway"),he(null);const H=await Q.shutdown("gateway");Fe(null),H.ok?he(H.stopped?"✅ Gateway stopped.":`ℹ️ ${H.reason||"No running gateway found — nothing to stop."}`):(he(`❌ ${H.error||"Stop failed."}`),H.unauthorized&&Cn())},pa=async()=>{window.confirm("Shut down the dashboard? This page will disconnect and the server will exit. Restart with `buff dashboard`.")&&(Fe("dashboard"),he("🛑 Shutting down the dashboard — this page will disconnect…"),await Q.shutdown("dashboard"),Fe(null),he("ℹ️ The dashboard server did not stop (see the server terminal). You can also stop it with `buff dashboard stop`."))},Ka=async H=>{if(H.preventDefault(),$(null),C.length<8){$("Password must be at least 8 characters.");return}const ne=await Q.addAdminUser(O,C,D);ne.ok?(U(""),Z(""),$("✅ User added"),zt()):($(`❌ ${ne.error||"Failed to add user"}`),ne.unauthorized&&Cn())},gn=async H=>{if(!window.confirm(`Remove dashboard user '${H}'?`))return;$(null);const ne=await Q.removeAdminUser(H);ne.ok?($(`✅ Removed ${H}`),zt()):($(`❌ ${ne.error||"Failed to remove user"}`),ne.unauthorized&&Cn())},ma=(H,ne,Me)=>{Ae(Oe=>({...Oe,[H]:{...Oe[H]||{},[ne]:Me}}))},on=async H=>{yt(H),bt({});const ne=Ge[H]||{},Me=await Q.saveProvider(H,ne);Me.ok?(t(Oe=>{if(!Oe)return Oe;const va=Oe.providers.some(cr=>cr.type===H)?Oe.providers.map(cr=>cr.type===H&&Me.provider?Me.provider:cr):Me.provider?[...Oe.providers,Me.provider]:Oe.providers;return{...Oe,providers:va}}),Ae(Oe=>{const ot={...Oe};return delete ot[H],ot}),bt(Oe=>({...Oe,[H]:"✅ Saved"}))):(bt(Oe=>({...Oe,[H]:`❌ ${Me.error||"Save failed"}`})),Me.unauthorized&&Cn()),yt(null)},Va=async H=>{if(!window.confirm(`Remove ${H}'s API key and configuration? This cannot be undone.`))return;yt(H),bt({});const ne=await Q.deleteProvider(H);ne.ok?ne.envSourced?(t(Me=>Me&&{...Me,providers:Me.providers.map(Oe=>Oe.type===H&&ne.provider||Oe)}),bt(Me=>({...Me,[H]:`⚠️ Key comes from ${ne.envVar?`$${ne.envVar}`:"an env var"} — unset it there to remove it (config can't override the env).`}))):(t(Me=>Me&&{...Me,providers:Me.providers.filter(Oe=>Oe.type!==H)}),Ae(Me=>{const Oe={...Me};return delete Oe[H],Oe})):(bt(Me=>({...Me,[H]:`❌ ${ne.error||"Remove failed"}`})),ne.unauthorized&&Cn()),yt(null)},Di=async H=>{yt(H);const ne=await Q.testProvider(H);bt(Me=>{var Oe;return{...Me,[H]:ne.ok?`✅ Connected — ${((Oe=ne.models)==null?void 0:Oe.length)??0} model(s) reachable`:`❌ ${ne.error||"Connection failed"}`}}),yt(null)},Ls=()=>{W&&(Ae(H=>({...H,[W]:{}})),Y(""))};if(a&&!o)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"🛠️",title:"Admin"}),i.jsx("div",{className:"admin-error",children:a})]});if(!o||!c&&n)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"🛠️",title:"Admin"}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Loading…"})]})]});if(!c){const H=!o.configured;return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"🛠️",title:`Admin — ${H?"Set up access":"Log in"}`}),i.jsx("p",{className:"admin-subtitle",children:H?"Create the admin user-id and password that gate the dashboard write surface (API-key/provider configuration). The CLI keeps working exactly as before — this only guards the GUI.":"The write surface (API-key/provider configuration) is gated by the admin credentials. Read-only checks stay open."}),i.jsxs("form",{className:"admin-gate-form",onSubmit:H?Tr:sn,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:j,onChange:ne=>w(ne.target.value),autoComplete:"username",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password"}),i.jsx("input",{type:"password",value:b,onChange:ne=>N(ne.target.value),autoComplete:H?"new-password":"current-password",placeholder:"••••••••"})]}),H?i.jsxs("label",{children:[i.jsx("span",{children:"Confirm password"}),i.jsx("input",{type:"password",value:E,onChange:ne=>T(ne.target.value),autoComplete:"new-password",placeholder:"••••••••"})]}):null,A?i.jsx("div",{className:"admin-error",children:A}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:R||!j||!b,children:R?"⏳ …":H?"🔐 Create admin":"🔐 Log in"}),H?i.jsxs("p",{className:"admin-hint",children:["Automation alternative: set ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_USER"})," and"," ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_PASSWORD"})," in the dashboard's environment."]}):null]})]})}if(d){const H=h.length>0&&h.length<8,ne=g.length>0&&g!==h,Me=async Oe=>{if(Oe.preventDefault(),H||ne||!h)return;B(!0),M(null);const ot=await Q.changeAdminPassword(b,h);ot.ok?(f(!1),N(""),p(""),m(""),Rt(),xt(),zt()):M(ot.error||"Could not change the password."),B(!1)};return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"🔐",title:"Set your own password"}),i.jsxs("p",{className:"admin-subtitle",children:["This dashboard is running on its ",i.jsx("strong",{children:"published default password"}),", so anyone who can reach this port can sign in. Until you replace it, the agent will refuse to save anything — API keys, provider settings, users."]}),i.jsxs("form",{className:"admin-gate-form",onSubmit:Me,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Current password"}),i.jsx("input",{type:"password",value:b,onChange:Oe=>N(Oe.target.value),autoComplete:"current-password",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"New password"}),i.jsx("input",{type:"password",value:h,onChange:Oe=>p(Oe.target.value),autoComplete:"new-password",placeholder:"at least 8 characters"})]}),H?i.jsx("div",{className:"admin-error",children:"Use at least 8 characters."}):null,i.jsxs("label",{children:[i.jsx("span",{children:"Confirm new password"}),i.jsx("input",{type:"password",value:g,onChange:Oe=>m(Oe.target.value),autoComplete:"new-password",placeholder:"repeat it"})]}),ne?i.jsx("div",{className:"admin-error",children:"The two passwords do not match."}):null,A?i.jsx("div",{className:"admin-error",children:A}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:R||!b||!h||H||ne,children:R?"⏳ …":"🔐 Save new password"})]})]})}const Ds=(e==null?void 0:e.system.filter(H=>H.status==="pass").length)??0,ga=(e==null?void 0:e.system.filter(H=>H.status==="warn").length)??0,Or=(e==null?void 0:e.system.filter(H=>H.status==="fail").length)??0,_l=(e==null?void 0:e.enterprise.filter(H=>H.status==="pass").length)??0,Al=(e==null?void 0:e.enterprise.filter(H=>H.status==="warn").length)??0,Bs=(e==null?void 0:e.enterprise.filter(H=>H.status==="fail").length)??0,Vr=(e==null?void 0:e.providers)??[],Bi=H=>{const ne=me.find(Me=>Me.id===H);return ne||{label:H}};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"🛠️",title:i.jsxs(i.Fragment,{children:["Admin — Command Runner & Configuration",x?i.jsxs("span",{className:`admin-role-badge admin-role-${y||"viewer"}`,children:[" ",x," · ",y||"viewer"]}):null]})}),i.jsxs("div",{className:"admin-header-actions",children:[i.jsx("button",{className:"admin-refresh-btn",onClick:()=>void Rt(),disabled:n,children:n?"⏳ Running checks…":"🔄 Refresh (run all commands)"}),an||y==="operator"?i.jsx("button",{className:"admin-logout-btn",onClick:()=>void qa(),disabled:xe!==null,title:"Stop the running gateway (buff gateway stop)",children:xe==="gateway"?"⏳ Stopping…":"⏻ Stop gateway"}):null,an?i.jsx("button",{className:"admin-logout-btn",onClick:()=>void pa(),disabled:xe!==null,title:"Shut down this dashboard server (buff dashboard stop)",children:xe==="dashboard"?"⏳ Stopping…":"🛑 Stop dashboard"}):null,i.jsx("button",{className:"admin-logout-btn",onClick:()=>void ha(),children:"🚪 Log out"})]})]}),se?i.jsx("div",{className:"admin-error",children:se}):null,an?null:i.jsxs("div",{className:"admin-readonly-note",children:["🔒 Your role (",i.jsx("code",{children:y||"viewer"}),") is read-only here — provider configuration and user management require the ",i.jsx("code",{children:"admin"})," role. The CLI enforces the same governance policy (rbac.json)."]}),i.jsx("p",{className:"admin-subtitle",children:"The dashboard executes the same state commands as the CLI — no command needed. Provider keys are masked here and every write goes through the same config the CLI uses."}),a?i.jsx("div",{className:"admin-error",children:a}):null,e?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card admin-summary-pass",children:[i.jsx("div",{className:"admin-summary-value",children:Ds+_l}),i.jsx("div",{className:"admin-summary-label",children:"✅ Passing"})]}),i.jsxs("div",{className:"admin-summary-card admin-summary-warn",children:[i.jsx("div",{className:"admin-summary-value",children:ga+Al}),i.jsx("div",{className:"admin-summary-label",children:"⚠️ Warnings"})]}),i.jsxs("div",{className:"admin-summary-card admin-summary-fail",children:[i.jsx("div",{className:"admin-summary-value",children:Or+Bs}),i.jsx("div",{className:"admin-summary-label",children:"❌ Failing"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:Vr.length}),i.jsx("div",{className:"admin-summary-label",children:"Providers"})]})]}),an?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"👥 Dashboard Users (role.manage)"}),i.jsxs("div",{className:"admin-users-list",children:[L.map(H=>i.jsxs("div",{className:"admin-user-row",children:[i.jsx("span",{className:"admin-user-name",children:H.user}),i.jsx("span",{className:`admin-role-badge admin-role-${H.role}`,children:H.role}),i.jsxs("span",{className:"admin-user-since",children:["since ",new Date(H.createdAt).toLocaleDateString()]}),H.user!==x?i.jsx("button",{className:"admin-mini-btn admin-mini-danger",onClick:()=>void gn(H.user),children:"🗑 Remove user"}):i.jsx("span",{className:"admin-hint",children:"you"})]},H.user)),L.length===0?i.jsx("div",{className:"empty-state",children:"No dashboard users yet."}):null]}),i.jsxs("form",{className:"admin-gate-form admin-user-form",onSubmit:Ka,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:O,onChange:H=>U(H.target.value),autoComplete:"off"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password (min 8 chars)"}),i.jsx("input",{type:"password",value:C,onChange:H=>Z(H.target.value),autoComplete:"new-password"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Role"}),i.jsxs("select",{value:D,onChange:H=>P(H.target.value),children:[i.jsx("option",{value:"viewer",children:"viewer — read-only"}),i.jsx("option",{value:"operator",children:"operator — read-only in the dashboard today"}),i.jsx("option",{value:"admin",children:"admin — full control"})]})]}),z?i.jsx("div",{className:"admin-row-msg",children:z}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:!O||!C,children:"➕ Add user"})]})]}):null,i.jsx("h2",{className:"section-subtitle",children:"🔑 Provider Configuration (keys masked)"}),i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Key"}),i.jsx("th",{children:"Base URL"}),i.jsx("th",{children:"Model"}),i.jsx("th",{children:"Actions"})]})}),i.jsxs("tbody",{children:[Vr.map(H=>{const ne=Bi(H.type),Me=Ge[H.type]||{};return i.jsxs("tr",{children:[i.jsxs("td",{className:"admin-provider-type",children:[ne.icon?`${ne.icon} `:"",ne.label,i.jsxs("div",{className:"admin-provider-sub",children:[H.type," · ",Ioe[H.keySource]||H.keySource]}),H.keySource==="env"?i.jsxs("div",{className:"admin-hint",children:["comes from ",ne.envVar||"env var"," — change it there, config can't override it"]}):H.keySource==="vault"?i.jsx("div",{className:"admin-hint",children:"stored in the OS keyring (vault)"}):null]}),i.jsx("td",{children:i.jsx("span",{className:`admin-check-badge ${H.configured?"admin-check-pass":"admin-check-warn"}`,children:H.configured?"✅ Configured":"⚠️ Not configured"})}),i.jsx("td",{children:ne.keyless?i.jsx("div",{className:"admin-hint",children:"No key needed (probed)"}):an?i.jsx("input",{className:"admin-input admin-key-input",type:"password","aria-label":`${H.type} API key`,placeholder:H.keyMasked||"set a new key…",value:Me.apiKey??"",onChange:Oe=>ma(H.type,"apiKey",Oe.target.value),autoComplete:"new-password"}):i.jsx("div",{className:"admin-hint",children:H.keyMasked||"—"})}),i.jsx("td",{children:an?i.jsx("input",{className:"admin-input",type:"text","aria-label":`${H.type} base URL`,placeholder:H.baseUrl||"default endpoint",value:Me.baseUrl??"",onChange:Oe=>ma(H.type,"baseUrl",Oe.target.value)}):i.jsx("div",{className:"admin-hint",children:H.baseUrl?H.baseUrl.replace(/^https?:\/\/(?:[^@/]*@)?/,""):"default endpoint"})}),i.jsx("td",{children:an?i.jsx("input",{className:"admin-input",type:"text","aria-label":`${H.type} model`,placeholder:H.model||"default model",value:Me.model??"",onChange:Oe=>ma(H.type,"model",Oe.target.value)}):i.jsx("div",{className:"admin-hint",children:H.model||"default model"})}),i.jsx("td",{children:an?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-row-actions",children:[i.jsx("button",{className:"admin-mini-btn",disabled:Ze===H.type,onClick:()=>void on(H.type),children:"💾 Save"}),i.jsx("button",{className:"admin-mini-btn",disabled:Ze===H.type,title:"Tests the SAVED configuration — save first to test a new key",onClick:()=>void Di(H.type),children:"🔌 Test"}),i.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:Ze===H.type,onClick:()=>void Va(H.type),children:"🗑 Remove"})]}),An[H.type]?i.jsx("div",{className:"admin-row-msg",children:An[H.type]}):null]}):i.jsx("div",{className:"admin-hint",children:"read-only"})})]},H.type)}),Vr.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:6,className:"admin-empty-cell",children:"No providers configured yet."})}):null]})]})}),an&&me.length>0?i.jsxs("div",{className:"admin-add-provider",children:[i.jsxs("select",{className:"admin-input",value:W,onChange:H=>Y(H.target.value),children:[i.jsx("option",{value:"",children:"Add a provider…"}),me.filter(H=>!Vr.some(ne=>ne.type===H.id)).map(H=>i.jsxs("option",{value:H.id,children:[H.icon?`${H.icon} `:"",H.label," (",H.id,")"]},H.id))]}),i.jsx("button",{className:"admin-mini-btn",disabled:!W,onClick:Ls,children:"➕ Add"})]}):null,i.jsx("h2",{className:"section-subtitle",children:"📁 Workspace (chat turns with no attached folder)"}),i.jsx("p",{className:"admin-hint",children:"A chat turn runs against a directory. An attached folder always wins; with none attached, this is where the turn lands. Leave it empty and an ask that needs a project — an assessment, a file, an image — asks you to attach a folder instead of scanning the server's own working directory."}),i.jsxs("form",{className:"admin-gate-form",onSubmit:Ft,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Working directory"}),i.jsx("input",{type:"text",value:pe,onChange:H=>Te(H.target.value),placeholder:"/Users/you/Documents/my-project",disabled:oe||!c||!Cr})]}),ie?i.jsxs("p",{className:"admin-hint",children:[ie.effective?i.jsxs(i.Fragment,{children:["Effective: ",i.jsx("code",{children:ie.effective})]}):i.jsxs(i.Fragment,{children:["Not set — unattached project asks will ask for a folder (server cwd: ",i.jsx("code",{children:ie.processCwd}),")"]}),ie.configured&&!ie.configuredValid?" ⚠️ The saved path no longer exists and is being ignored.":""]}):null,q?i.jsx("div",{className:"admin-row-msg",children:q}):null,Cr?i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:oe||!c,children:oe?"⏳ Saving…":"💾 Save workspace"}):i.jsx("span",{className:"admin-hint",children:"🔒 Changing the workspace requires admin or operator."})]}),i.jsx("h2",{className:"section-subtitle",children:"🧠 Response Cache (answers by workspace)"}),i.jsx("p",{className:"admin-hint",children:"The cache is keyed by the folder an answer was produced in. If a project has changed and an ask replays an old answer, clear that project — every other project keeps its cached answers."}),je?i.jsx("div",{className:"admin-row-msg",children:je}):null,V&&V.workspaces.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Workspace"}),i.jsx("th",{children:"Answers"}),i.jsx("th",{children:"Newest"}),i.jsx("th",{children:"Models"}),i.jsx("th",{children:"Sample"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:V.workspaces.map(H=>{var ne;return i.jsxs("tr",{children:[i.jsx("td",{className:"admin-provider-type",children:H.scope?i.jsx("code",{children:H.scope}):i.jsx("em",{children:"no workspace attached"})}),i.jsx("td",{children:H.count}),i.jsx("td",{className:"admin-hint",children:new Date(H.newestAt).toLocaleString()}),i.jsxs("td",{className:"admin-hint",children:[H.models.slice(0,2).join(", "),H.models.length>2?` +${H.models.length-2}`:""]}),i.jsx("td",{className:"admin-hint",children:((ne=H.samples[0])==null?void 0:ne.prompt)??""}),i.jsx("td",{children:i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:ge!==null||!Cr,onClick:()=>void Vn(H.scope),children:ge===(H.scope??"__none__")?"⏳ …":"🗑 Clear"})})]},H.scope??"__none__")})})]})}):i.jsx("div",{className:"empty-state",children:"No cached answers — every turn reached a model."}),V&&V.total>0?i.jsxs("p",{className:"admin-hint",children:[V.total," cached answer",V.total===1?"":"s"," across"," ",V.workspaces.length," workspace",V.workspaces.length===1?"":"s","."]}):null,i.jsx(Moe,{authed:c,role:y||"viewer"}),i.jsx(Ooe,{authed:c,role:y||"viewer"}),i.jsx("h2",{className:"section-subtitle",children:"⚙️ System Checks (buff doctor)"}),i.jsx("div",{className:"admin-check-list",children:e.system.map(H=>i.jsx(Nb,{check:H},H.name))}),i.jsx("h2",{className:"section-subtitle",children:"🏥 Enterprise Self-Check (doctor --enterprise)"}),i.jsx("div",{className:"admin-check-list",children:e.enterprise.length>0?e.enterprise.map(H=>i.jsx(Nb,{check:H},H.name)):i.jsx("div",{className:"empty-state",children:"No enterprise checks returned."})})]}):n?i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Running all state checks…"})]}):null]})}function oM(e){return String(e??"").replace(/\d{3,}/g,t=>t.slice(0,2)+"***")}const Loe={idle:"Not paired",pairing:"⏳ Pairing…",paired:"✅ Paired",failed:"❌ Pairing failed",cancelled:"⏹ Cancelled",error:"💥 Pairing error"};function Doe({authed:e,canWrite:t,sessionExpired:n,reveal:r=!1}){const[a,s]=k.useState(null),[o,l]=k.useState({}),[c,u]=k.useState(""),[d,f]=k.useState(!1),[h,p]=k.useState(null),g=k.useRef(null),m=k.useCallback(async()=>{const b=await Q.getWhatsAppStatus();b&&(s(b.status),l(b.contacts??{}))},[]);k.useEffect(()=>{if(m(),!e||typeof EventSource>"u")return;const b=Q.subscribeWhatsApp({onQr:N=>s(E=>E&&{...E,qr:N,state:"pairing"}),onCode:N=>s(E=>E&&{...E,pairingCode:N}),onStatus:N=>{s(N),(N.state==="paired"||N.state==="failed"||N.state==="error"||N.state==="cancelled")&&f(!1)}});return g.current=b,()=>{b(),g.current=null}},[e,m]);const y=async b=>{f(!0),p(null);const N=await b();if(!N.ok&&N.error&&/Not authenticated|Session expired/i.test(N.error)){n(),f(!1);return}N.ok?(p({kind:"ok",text:"Done."}),await m()):p({kind:"err",text:N.error||"Action failed."}),f(!1)},v=b=>{p(null),y(()=>Q.startWhatsAppPair(b?c.trim():void 0)).then(()=>u(""))},x=()=>{p(null),y(()=>Q.cancelWhatsAppPair())},S=()=>{window.confirm("Remove the paired WhatsApp session from this machine? You will need to scan a QR to pair again.")&&(p(null),y(()=>Q.unpairWhatsApp()))},j=(a==null?void 0:a.state)??"idle",w=j==="pairing";return i.jsxs("div",{className:"wa-panel",children:[i.jsxs("div",{className:"wa-panel-head",children:[i.jsx("span",{className:"wa-panel-title",children:"🟢 WhatsApp bridge"}),a?i.jsx("span",{className:`wa-badge ${a.paired?"wa-badge-paired":w?"wa-badge-pairing":""}`,children:Loe[j]}):i.jsx("span",{className:"admin-hint",children:"loading…"})]}),i.jsxs("p",{className:"admin-hint",children:["The personal Baileys bridge (no Meta Business account) — pair once, and the gateway can send & receive WhatsApp. Session: ",i.jsx("code",{children:(a==null?void 0:a.sessionDir)??"~/.buff/whatsapp/session"}),". Same engine as"," ",i.jsx("code",{children:"buff whatsapp pair"}),"."]}),w?i.jsxs("div",{className:"wa-pairing",children:[a!=null&&a.qr?i.jsxs("div",{className:"wa-qr-box",children:[i.jsx("img",{className:"wa-qr-img",src:a.qr,alt:"WhatsApp pairing QR code"}),i.jsxs("p",{className:"admin-hint",children:["Open WhatsApp on the phone → ",i.jsx("strong",{children:"Linked devices → Link a device → scan"}),". The QR refreshes automatically while this window is open."]})]}):a!=null&&a.phone?i.jsxs("div",{className:"wa-code-box",children:[i.jsxs("p",{className:"admin-hint",children:["On the phone with ",i.jsx("strong",{children:a.phone}),": WhatsApp → Linked devices → Link a device →"," ",i.jsx("strong",{children:"“Link with phone number instead”"})," → enter:"]}),i.jsx("div",{className:"wa-code",children:a.pairingCode??"… waiting for code"})]}):i.jsx("div",{className:"wa-code-box",children:i.jsx("p",{className:"admin-hint",children:"Waiting for WhatsApp to hand over a QR… (it usually appears within a few seconds)"})}),a!=null&&a.phone?null:i.jsxs("div",{className:"admin-hint",children:["Tip: on a phone, “Link with phone number instead” needs the number format"," ",i.jsx("code",{children:"918844433322"})," (country code included) — enter it below instead of scanning."]}),a!=null&&a.error?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:a.error}):null,t&&e?i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:x,disabled:d,children:d?"⏳…":"⏹ Cancel pairing"}):null]}):i.jsxs("div",{className:"wa-actions",children:[t&&e?a!=null&&a.paired?i.jsxs("div",{className:"wa-action-row",children:[i.jsx("button",{className:"admin-refresh-btn wa-unpair-btn",type:"button",onClick:S,disabled:d,children:d?"⏳…":"🗑 Unpair (remove session)"}),i.jsx("span",{className:"admin-hint",children:"Removes creds.json — you will need to scan a QR again."})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"wa-action-row",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>v(!1),disabled:d,children:d?"⏳…":"🔳 Pair with a QR"}),i.jsx("span",{className:"admin-hint",children:"Scans from the phone you want to link."})]}),i.jsxs("div",{className:"wa-action-row wa-phone-row",children:[i.jsx("input",{type:"text",className:"wa-phone-input",value:c,onChange:b=>u(b.target.value),placeholder:"or pair with a number — e.g. 918844433322",disabled:d,maxLength:16}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>v(!0),disabled:d||!c.trim(),children:"Pair by number"})]})]}):null,j==="failed"||j==="error"||j==="cancelled"?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:(a==null?void 0:a.error)||(j==="cancelled"?"Pairing cancelled.":"Pairing failed — try again.")}):null,e?t?null:i.jsx("div",{className:"admin-row-msg",children:"Your role can view pairing status but not change it (requires admin or operator)."}):i.jsx("div",{className:"admin-row-msg",children:"Log in (admin or operator) to pair, cancel, or unpair."}),h?i.jsx("div",{className:`admin-row-msg${h.kind==="ok"?"":" admin-row-msg-err"}`,children:h.text}):null]}),i.jsxs("div",{className:"wa-contacts",children:[i.jsxs("div",{className:"wa-contacts-head",children:[i.jsx("span",{className:"wa-panel-title",children:"📇 Send-by-name contacts"}),i.jsxs("span",{className:"admin-hint",children:[Object.keys(o).length," mapped"]})]}),i.jsxs("p",{className:"admin-hint",children:["These names are for ",i.jsx("strong",{children:"sending messages by name"})," (e.g."," ",i.jsx("code",{children:'buff gateway send whatsapp:Name "…"'}),") — they do"," ",i.jsx("strong",{children:"NOT"})," let these numbers trigger the agent."]}),i.jsx("div",{className:"hub-alias-list",children:Object.keys(o).length===0?i.jsxs("span",{className:"admin-hint",children:["(none — add one with ",i.jsx("code",{children:"buff whatsapp contact add <Name> <number>"}),")"]}):Object.entries(o).map(([b,N])=>i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:b}),i.jsxs("span",{className:"admin-hint",children:["→ ",r?N:oM(N)]})]},b))}),i.jsxs("p",{className:"admin-hint",style:{marginTop:8},children:["To let a number ",i.jsx("strong",{children:"trigger the agent"})," (respond to its messages), add it to the"," ",i.jsx("strong",{children:"verified list"})," in the ",i.jsx("strong",{children:"Permissions tab above"}),", or run"," ",i.jsx("code",{children:"buff config gateway allow whatsapp user <number>"}),"."]})]})]})}function Boe({canWrite:e,sessionExpired:t,mode:n="grid"}){const[r,a]=k.useState(null),[s,o]=k.useState(null),[l,c]=k.useState(null),[u,d]=k.useState(null),[f,h]=k.useState(null),[p,g]=k.useState(0),[m,y]=k.useState({}),[v,x]=k.useState(!1),[S,j]=k.useState(null),w=k.useRef(!0),b=k.useCallback(async()=>{const B=await Q.getPlatformConfigs();w.current&&a(B)},[t]);k.useEffect(()=>(b(),()=>{w.current=!1}),[b]);const N=async(B,L)=>{c(B),d(null);const F=await Q.setPlatformConfig(B,L);if(w.current){if(c(null),F.unauthorized||F.forbidden){t(F.error);return}d({kind:F.ok?"ok":"err",text:F.ok?"Saved — transport active.":F.error||"Save failed."}),F.ok&&(o(null),b())}},E=async B=>{if(!window.confirm(`Remove ${B} transport config? Tokens will be deleted from ~/.buff/.env.`))return;c(B),d(null);const L=await Q.removePlatformConfig(B);if(w.current){if(c(null),L.unauthorized||L.forbidden){t(L.error);return}d({kind:L.ok?"ok":"err",text:L.ok?"Removed.":L.error||"Remove failed."}),L.ok&&b()}},T={telegram:{steps:["Open Telegram and search for @BotFather","Send /newbot to BotFather and follow the prompts",'Give your bot a name (e.g. "My Agent Bot")','Give your bot a username (must end with "bot", e.g. "my_agent_bot")',"BotFather will give you a token — paste it in the field below","Open your bot in Telegram and send it a message (e.g. /start)"],postSetup:["Start the gateway: buff gateway start (or from the Gateway tab)","Open your bot in Telegram and send a message — the agent replies!"]},discord:{steps:["Go to https://discord.com/developers/applications",'Click "New Application" → give it a name → Create','Go to "Bot" in the left sidebar → click "Add Bot"','Under "Token", click "Copy" to copy the bot token','Enable "Message Content Intent" under Privileged Gateway Intents',"Invite the bot to your server with the OAuth2 URL generator"],postSetup:["Start the gateway: buff gateway start","Mention the bot in a Discord channel or send it a DM","The agent will reply automatically!"]},slack:{steps:["Go to https://api.slack.com/apps",'Click "Create New App" → "From scratch"',"Add Bot Token Scopes: chat:write, im:read, im:write","Install the app to your workspace","Copy the Bot User OAuth Token (starts with xoxb-)"],postSetup:["Start the gateway: buff gateway start","DM the bot or mention it in a channel","The agent will reply automatically!"]},email:{steps:["You need an SMTP relay (Gmail, SendGrid, Mailgun, etc.)","For Gmail: use smtp.gmail.com:587 with an App Password","For SendGrid/Mailgun: get SMTP credentials from their dashboard"],postSetup:["Start the gateway: buff gateway start","Send an email to the configured address","The agent will reply via email!"]}},A=B=>{e&&(h(B),g(0),y(Object.fromEntries(B.envVars.map(L=>[L.varName,L.value]))),j(null))},M=async()=>{if(!f||!e)return;x(!0),j(null);const B=await Q.setPlatformConfig(f.platform,m);if(x(!1),B.unauthorized||B.forbidden){t(B.error);return}B.ok?(j({kind:"ok",text:"✅ Token saved! The transport is now active."}),b()):j({kind:"err",text:B.error||"Save failed."})};if(r===null)return i.jsx("div",{className:"empty-state",children:"Loading platform transports…"});const R=f?T[f.platform]:null;return n==="table"?i.jsxs(i.Fragment,{children:[f&&R?i.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:i.jsxs("div",{className:"wizard-modal",onClick:B=>B.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:"🚀"}),i.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"✕"})]}),i.jsx("div",{className:"wizard-body",children:p===0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"📋 Steps to create your bot:"}),i.jsx("ol",{className:"wizard-steps",children:R.steps.map((B,L)=>i.jsx("li",{children:B},L))}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token →"}),f.setupUrl?i.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Docs"}):null]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"🔑 Paste your token:"}),f.envVars.map(B=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:B.prompt}),i.jsx("input",{type:B.secret?"password":"text",value:m[B.varName]??"",onChange:L=>y(F=>({...F,[B.varName]:L.target.value})),placeholder:B.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},B.varName)),S?i.jsx("div",{className:`admin-row-msg${S.kind==="ok"?"":" admin-row-msg-err"}`,children:S.text}):null,i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"← Back"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void M(),disabled:v||!e,children:v?"⏳ Saving…":"💾 Save token"})]}),(S==null?void 0:S.kind)==="ok"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"📋 Next steps:"}),i.jsx("ol",{className:"wizard-steps",children:R.postSetup.map((B,L)=>i.jsx("li",{children:B},L))})]}):null]})})]})}):null,u?i.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,i.jsx("div",{className:"platform-config-table-wrapper",children:i.jsxs("table",{className:"platform-config-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Configuration"}),i.jsx("th",{children:"CLI Command"})]})}),i.jsx("tbody",{children:r.map(B=>i.jsxs(G.Fragment,{children:[i.jsxs("tr",{className:`platform-config-row ${B.configured?"configured":""}`,children:[i.jsxs("td",{className:"platform-config-name",children:[i.jsx("span",{className:"hub-platform-label",children:B.label}),i.jsx("span",{className:"hub-card-id",children:B.platform})]}),i.jsxs("td",{children:[i.jsx("span",{className:`status-dot ${B.configured?"connected":"reconnecting"}`}),i.jsx("span",{className:"platform-config-status-text",children:B.configured?"Active":"Not configured"})]}),i.jsxs("td",{className:"platform-config-actions",children:[B.configured?null:i.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>A(B),disabled:!e,children:"🚀 Getting Started"}),B.setupUrl?i.jsx("a",{href:B.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Docs"}):null,i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(s===B.platform?null:B.platform),disabled:!e,children:s===B.platform?"▴ Close":B.configured?"✎ Edit":"⚙ Configure"}),B.configured?i.jsx("button",{type:"button",className:"admin-mini-btn contact-delete-btn",onClick:()=>void E(B.platform),disabled:!e,children:"🗑️"}):null]}),i.jsx("td",{className:"platform-config-cli",children:i.jsxs("code",{children:["buff gateway setup ",B.platform]})})]}),s===B.platform?i.jsx("tr",{className:"platform-config-expanded",children:i.jsx("td",{colSpan:4,children:i.jsxs("div",{className:"platform-config-form",children:[B.envVars.map(L=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:L.prompt}),i.jsx("input",{type:L.secret?"password":"text",value:L.value,readOnly:!0,className:"platform-config-readonly",placeholder:L.secret?"••••••••":"value"})]},L.varName)),i.jsxs("p",{className:"admin-hint",children:["Tokens are in ",i.jsx("code",{children:"~/.buff/.env"})," — edit there or use the wizard above."]})]})})}):null]},B.platform))})]})})]}):i.jsxs(i.Fragment,{children:[f&&R?i.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:i.jsxs("div",{className:"wizard-modal",onClick:B=>B.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:"🚀"}),i.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"✕"})]}),i.jsx("div",{className:"wizard-body",children:p===0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"📋 Steps to create your bot:"}),i.jsx("ol",{className:"wizard-steps",children:R.steps.map((B,L)=>i.jsx("li",{children:B},L))}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token →"}),f.setupUrl?i.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Open docs in new tab"}):null]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"🔑 Paste your token:"}),f.envVars.map(B=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:B.prompt}),i.jsx("input",{type:B.secret?"password":"text",value:m[B.varName]??"",onChange:L=>y(F=>({...F,[B.varName]:L.target.value})),placeholder:B.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},B.varName)),S?i.jsx("div",{className:`admin-row-msg${S.kind==="ok"?"":" admin-row-msg-err"}`,children:S.text}):null,i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"← Back"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void M(),disabled:v||!e,children:v?"⏳ Saving…":"💾 Save token"})]}),(S==null?void 0:S.kind)==="ok"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"📋 Next steps:"}),i.jsx("ol",{className:"wizard-steps",children:R.postSetup.map((B,L)=>i.jsx("li",{children:B},L))})]}):null]})})]})}):null,i.jsxs("div",{className:"platform-config",children:[i.jsx("h2",{className:"section-subtitle",children:"⚙️ Platform transports (buff config gateway)"}),u?i.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,i.jsx("div",{className:"hub-platform-grid",children:r.map(B=>i.jsx(zoe,{entry:B,canWrite:e,busy:l===B.platform,expanded:s===B.platform,onToggle:()=>o(s===B.platform?null:B.platform),onSave:L=>void N(B.platform,L),onRemove:()=>void E(B.platform),onStartWizard:()=>A(B)},B.platform))}),i.jsxs("p",{className:"admin-hint",children:["Tokens are written to ",i.jsx("code",{children:"~/.buff/.env"})," (loaded by both the CLI and this dashboard at startup) — no env vars to hand-export. The WhatsApp personal bridge is configured separately above via QR/code pairing."]})]})]})}function zoe(e){const{entry:t,canWrite:n,busy:r,expanded:a,onToggle:s,onSave:o,onRemove:l,onStartWizard:c}=e,[u,d]=k.useState(()=>Object.fromEntries(t.envVars.map(h=>[h.varName,h.value]))),f=(h,p)=>{d(g=>({...g,[h]:p}))};return i.jsxs("div",{className:`hub-platform${t.configured?" configured":""}`,children:[i.jsxs("div",{className:"hub-platform-head",children:[i.jsx("span",{className:`status-dot ${t.configured?"connected":"reconnecting"}`}),i.jsx("span",{className:"hub-platform-label",children:t.label}),i.jsx("span",{className:"hub-card-id",children:t.platform}),t.configured?null:i.jsx("button",{type:"button",className:"wizard-start-btn",onClick:c,disabled:!n,title:"Step-by-step setup wizard",children:"🚀 Getting Started"}),t.setupUrl?i.jsx("a",{href:t.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",title:"Setup documentation",children:"📖 Docs"}):null,i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:s,disabled:!n,children:a?"▴ Collapse":t.configured?"✎ Edit":"⚙ Configure"})]}),!a&&t.setupHint&&!t.configured?i.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,a?i.jsxs("div",{className:"platform-config-form",children:[t.setupHint?i.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,t.envVars.map(h=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:h.prompt}),i.jsx("input",{type:h.secret?"password":"text",value:u[h.varName]??"",onChange:p=>f(h.varName,p.target.value),placeholder:h.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,maxLength:512})]},h.varName)),i.jsxs("div",{className:"platform-config-actions",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(u),disabled:r||!n,children:r?"⏳ Saving…":"💾 Save"}),t.configured?i.jsx("button",{type:"button",className:"hub-remove-btn",onClick:l,disabled:r||!n,children:"🗑 Remove"}):null]})]}):i.jsx("div",{className:"hub-platform-env",children:t.envVars.map(h=>i.jsxs("div",{children:[i.jsx("code",{children:h.varName})," ",h.set?"✓ set":"— unset"]},h.varName))})]})}const Foe=[{id:"tools",label:"Tools",icon:"🧰"},{id:"channels",label:"Channels",icon:"📡"},{id:"conversations",label:"Conversations",icon:"💬"},{id:"artifacts",label:"Artifacts",icon:"📦"},{id:"skills",label:"Skills",icon:"🧠"},{id:"subagents",label:"Subagents",icon:"🤖"}],Uoe={pending:"⏳ pending",sent:"✅ sent",failed:"❌ failed"},Woe=5e3,Hoe={spawning:"⏳ spawning",running:"▶ running",completed:"✅ completed",failed:"❌ failed",timeout:"⏰ timed out",killed:"⛔ killed"};function Goe(e){const t=typeof document<"u"?document.documentElement:null,n=(r,a)=>!t||typeof getComputedStyle!="function"?a:getComputedStyle(t).getPropertyValue(r).trim()||a;return{canvas:n("--bg-primary","Canvas"),text:n("--text-primary","CanvasText"),muted:n("--text-muted","GrayText"),userBubble:n("--accent-blue","Highlight"),onUserBubble:n("--text-on-accent","HighlightText"),agentBubble:n("--bg-card","ButtonFace")}}function Qs(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function qoe(e,t,n=new Date){const r=Qs(e.displayName),a=Qs(e.platform),s=e.messages.map(o=>{const l=o.role==="user",c=l?"user":"assistant",u=Qs(l?e.displayName:"Agent");return`<div class="msg msg-${c}">
|
|
135
|
+
<div class="bubble bubble-${c}">${Qs(o.content)}</div>
|
|
136
|
+
<div class="timestamp">${u} · ${Qs(new Date(o.ts).toLocaleString())}</div>
|
|
137
|
+
</div>`}).join(`
|
|
138
|
+
`);return`<!DOCTYPE html>
|
|
139
|
+
<html lang="en">
|
|
140
|
+
<head>
|
|
141
|
+
<meta charset="utf-8">
|
|
142
|
+
<title>Conversation with ${r}</title>
|
|
143
|
+
<style>
|
|
144
|
+
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 700px; margin: 40px auto; padding: 0 20px; background: ${t.canvas}; color: ${t.text}; line-height: 1.6; }
|
|
145
|
+
h1 { font-size: 20px; margin-bottom: 4px; }
|
|
146
|
+
.meta { color: ${t.muted}; font-size: 13px; margin-bottom: 20px; }
|
|
147
|
+
.msg { margin-bottom: 16px; }
|
|
148
|
+
.msg-user { text-align: right; }
|
|
149
|
+
.msg-assistant { text-align: left; }
|
|
150
|
+
.bubble { display: inline-block; max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; text-align: left; }
|
|
151
|
+
.bubble-user { background: ${t.userBubble}; color: ${t.onUserBubble}; border-bottom-right-radius: 4px; }
|
|
152
|
+
.bubble-assistant { background: ${t.agentBubble}; color: ${t.text}; border-bottom-left-radius: 4px; }
|
|
153
|
+
.timestamp { font-size: 11px; color: ${t.muted}; margin-top: 2px; }
|
|
154
|
+
@media print { body { margin: 0; } }
|
|
155
|
+
</style>
|
|
156
|
+
</head>
|
|
157
|
+
<body>
|
|
158
|
+
<h1>Conversation with ${r}</h1>
|
|
159
|
+
<div class="meta">Platform: ${a} · ${e.messageCount} messages · Exported: ${Qs(n.toLocaleString())}</div>
|
|
160
|
+
${s}
|
|
161
|
+
</body>
|
|
162
|
+
</html>`}function Koe(){var Pr,Wt,Dn,kt,Yr,Yn,we,Ue,ct,Mt,ln,k0,j0,N0,E0;const[e,t]=k.useState("tools"),[n,r]=k.useState(null),[a,s]=k.useState(!0),[o,l]=k.useState(null),[c,u]=k.useState(!1),[d,f]=k.useState(null),[h,p]=k.useState(!1),[g,m]=k.useState(null),[y,v]=k.useState(null),[x,S]=k.useState(""),[j,w]=k.useState(""),[b,N]=k.useState(null),[E,T]=k.useState(!1),[A,M]=k.useState(null),[R,B]=k.useState(null),[L,F]=k.useState({}),[z,$]=k.useState(""),[O,U]=k.useState(""),[C,Z]=k.useState(!1),[D,P]=k.useState(null),[ie,ve]=k.useState(!1),[pe,Te]=k.useState({}),[q,X]=k.useState(!1),[oe,ue]=k.useState(null),[V,_e]=k.useState({}),[je,Ne]=k.useState({}),[ge,ze]=k.useState({}),[me,ft]=k.useState(!1),[Ge,Ae]=k.useState(null),[Ze,yt]=k.useState(""),[An,bt]=k.useState(null),[W,Y]=k.useState(!1),[se,he]=k.useState(new Map),[xe,Fe]=k.useState(new Set),[Rt,xt]=k.useState(!1),[zt,rn]=k.useState([]),[Pe,Vn]=k.useState(""),[Ft,an]=k.useState(null),[Cr,Cn]=k.useState(""),[sn,Tr]=k.useState([]),[ha,qa]=k.useState(0),[pa,Ka]=k.useState(0),[gn,ma]=k.useState(!0),[on,Va]=k.useState(!1),[Di,Ls]=k.useState(!1),Ds=20,ga=k.useRef(null),Or=k.useCallback(async(_=!1)=>{if(on)return;const K=_?0:pa;Va(!0);try{const re=await Q.fetchGatewayConversations({offset:K,limit:Ds,q:Ze||void 0});re.ok&&re.conversations&&(Tr(ae=>_?re.conversations:[...ae,...re.conversations]),qa(re.total??0),Ka(K+re.conversations.length),ma(re.hasMore??!1))}catch{}Va(!1)},[on,pa,Ze]);k.useEffect(()=>{e==="conversations"&&!Di&&!on&&(Ls(!0),Or(!0))},[e,Di,on,Or]),k.useEffect(()=>{const _=ga.current;if(!_)return;const K=new IntersectionObserver(re=>{var ae;(ae=re[0])!=null&&ae.isIntersecting&&gn&&!on&&Or(!1)},{threshold:.1});return K.observe(_),()=>K.disconnect()},[gn,on,Or]),k.useEffect(()=>{const _=setTimeout(()=>{e==="conversations"&&Di&&(Tr([]),Ka(0),ma(!0),Or(!0))},300);return()=>clearTimeout(_)},[Ze]),k.useEffect(()=>Q.onTypingEvent(K=>{he(re=>{const ae=new Map(re),de=`${K.platform}:${K.channelId}`;return K.typing?ae.set(de,{platform:K.platform,channelId:K.channelId,startedAt:Date.now()}):ae.delete(de),ae})}),[]);const _l=k.useCallback((_,K)=>{K.stopPropagation(),Fe(re=>{const ae=new Set(re);return ae.has(_)?ae.delete(_):ae.add(_),ae})},[]),Al=k.useCallback(()=>{Fe(_=>_.size===sn.length?new Set:new Set(sn.map(K=>K.key)))},[sn]),Bs=k.useCallback(async()=>{if(xe.size!==0){xt(!0);try{await Q.exportGatewayConversations([...xe])}catch{}xt(!1)}},[xe]);k.useEffect(()=>{e==="conversations"&&Q.getAllConversationTags().then(_=>{_.ok&&_.tags&&rn(_.tags)})},[e]);const Vr=k.useCallback(async(_,K)=>{if(!K.trim())return;(await Q.addConversationTag(_,K.trim())).ok&&(Tr(ae=>ae.map(de=>de.key===_?{...de,tags:[...de.tags??[],K.trim().toLowerCase()]}:de)),rn(ae=>ae.includes(K.trim().toLowerCase())?ae:[...ae,K.trim().toLowerCase()].sort())),an(null),Cn("")},[]),Bi=k.useCallback(async(_,K)=>{(await Q.removeConversationTag(_,K)).ok&&Tr(ae=>ae.map(de=>de.key===_?{...de,tags:(de.tags??[]).filter(Re=>Re!==K)}:de))},[]),H=k.useCallback((_,K)=>{K.stopPropagation();const re=_.contactName||_.channelId,ae=[`Conversation with ${re} (${_.platform})`,`Exported: ${new Date().toLocaleString()}`,`Messages: ${_.messageCount}`,"─".repeat(50),""];if(_.messages)for(const Ct of _.messages){const Se=Ct.role==="user"?re:"Agent",Tt=new Date(Ct.ts).toLocaleString();ae.push(`[${Tt}] ${Se}:`),ae.push(Ct.content),ae.push("")}const de=new Blob([ae.join(`
|
|
163
|
+
`)],{type:"text/plain;charset=utf-8"}),Re=URL.createObjectURL(de),At=document.createElement("a");At.href=Re,At.download=`conversation-${_.platform}-${_.channelId.replace(/[^\w]/g,"_")}-${new Date().toISOString().slice(0,10)}.txt`,document.body.appendChild(At),At.click(),document.body.removeChild(At),URL.revokeObjectURL(Re)},[]),ne=k.useCallback((_,K)=>{K.stopPropagation();const re=_.contactName||_.channelId,ae=_.messages??[],de=qoe({displayName:re,platform:_.platform,messageCount:_.messageCount,messages:ae},Goe()),Re=window.open("","_blank");Re&&(Re.document.write(de),Re.document.close(),setTimeout(()=>Re.print(),300))},[]);k.useEffect(()=>{var K;const _=(K=n==null?void 0:n.conversations)==null?void 0:K.recent;!_||_.length===0||Di&&(pa>Ds||Ze||Tr(re=>{const ae=new Set(re.map(Se=>Se.key)),de=_.map(Se=>({...Se})),Re=new Map(re.map(Se=>[Se.key,Se]));for(const Se of de)Re.has(Se.key)&&Re.set(Se.key,Se);const Ct=[...de.filter(Se=>!ae.has(Se.key)),...Re.values()];return Ct.sort((Se,Tt)=>Tt.lastActiveAt-Se.lastActiveAt),Ct}))},[(Pr=n==null?void 0:n.conversations)==null?void 0:Pr.recent]);const[Me,Oe]=k.useState(""),[ot,va]=k.useState([]),[cr,Cl]=k.useState(!1),[Ya,Tl]=k.useState(!1),[Ol,Tn]=k.useState(null),[ya,zs]=k.useState(null),[Pl,rd]=k.useState({}),[Xa,Rl]=k.useState([]),[ba,Ml]=k.useState([]),[Qa,ur]=k.useState(""),dr=_=>me?String(_??""):oM(_),Il=_=>{const K=_.match(/^(\d+)@/);if(!K)return"";const re=K[1];return re.length===12&&re.startsWith("91")?`+${re.slice(0,2)} ${re.slice(2,7)} ${re.slice(7)}`:re.length===10?`+91 ${re.slice(0,5)} ${re.slice(5)}`:`+${re}`},$l=_=>{const K=Il(_.channelId),re=dr(_.channelId);return _.contactName?{name:_.contactName,phone:K||re}:{name:K||re,phone:""}},Fs=k.useCallback(_=>{var K,re;r(_),(K=_==null?void 0:_.channels)!=null&&K.statusRecipients&&Ml(_.channels.statusRecipients),(re=_==null?void 0:_.channels)!=null&&re.contacts&&Rl(_.channels.contacts),_||l("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),s(!1)},[]),lt=k.useCallback(async()=>{u(!0),l(null),Fs(await Q.fetchHub()),u(!1)},[Fs]);k.useEffect(()=>{lt(),Q.fetchAdminAuthStatus().then(_=>{_&&(f({configured:_.configured,authenticated:_.authenticated}),p(_.authenticated),m(_.role??null),v(_.user??null))})},[lt]);const ad=((Wt=n==null?void 0:n.subagents)==null?void 0:Wt.running)??0;k.useEffect(()=>{if(ad===0)return;const _=setInterval(()=>{Q.fetchHub().then(K=>{K&&Fs(K)})},Woe);return()=>clearInterval(_)},[ad,Fs]);const Ut=h&&(g==="admin"||g==="operator"),Ll=k.useRef(!1);k.useEffect(()=>{Ut&&!Ll.current&&(Ll.current=!0,ft(!0))},[Ut]);const id=async _=>{_==null||_.preventDefault();const K=Me.trim();if(!K)return;Tl(!0),Tn(null);const re=await Q.marketplaceSearch(K);va(re),Cl(!0),Tl(!1)},sd=async _=>{if(!h){Tn({kind:"err",text:"🔐 Log in (or set up admin access) to install skills."});return}if(!Ut){Tn({kind:"err",text:"Your role cannot install skills — admin or operator only."});return}zs(_),Tn(null);const K=await Q.marketplaceInstall(_);K.ok?(Tn({kind:"ok",text:`✅ Installed ${_} (quarantine checked) — it appears in the Skills list and loads via the skill tool next turn.`}),lt()):Tn({kind:"err",text:K.quarantined?`⛔ ${K.error||"checksum mismatch — quarantined"}`:`❌ ${K.error||"Install failed."}`}),zs(null)},ym=async _=>{if(!h){Tn({kind:"err",text:"🔐 Log in (or set up admin access) to uninstall skills."});return}if(!Ut){Tn({kind:"err",text:"Your role cannot uninstall skills — admin or operator only."});return}zs(_),Tn(null);const K=await Q.marketplaceUninstall(_);K.ok?(Tn({kind:"ok",text:`🗑️ Uninstalled ${_} — removed from .agents/skills/ and provenance.`}),lt()):Tn({kind:"err",text:`❌ ${K.error||"Uninstall failed."}`}),zs(null)},zi=()=>{p(!1),f(_=>_&&{..._,authenticated:!1}),N("Session expired — log in again to toggle capabilities.")},bm=async _=>{_.preventDefault(),T(!0),N(null);const K=await Q.adminLogin(x,j);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),v(K.user??null),S(""),w("");const re=A;M(null),re&&await fr(re.kind,re.name,re.enabled)}else N(K.error||"Login failed.");T(!1)},od=async _=>{if(_.preventDefault(),T(!0),N(null),j.length<8){N("Password must be at least 8 characters."),T(!1);return}const K=await Q.adminSetup(x,j);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),v(K.user??null),S(""),w("");const re=A;M(null),re&&await fr(re.kind,re.name,re.enabled)}else N(K.error||"Setup failed.");T(!1)},xm=async()=>{await Q.adminLogout(),p(!1),f(_=>_&&{..._,authenticated:!1}),m(null),v(null)},fr=async(_,K,re)=>{B(K);const ae=_==="skill"?await Q.setSkillEnabled(K,re):await Q.setToolsetEnabled(K,re);ae.ok?(F(de=>({...de,[K]:`✅ ${re?"Enabled":"Disabled"} — live for new agent runs`})),lt()):ae.unauthorized?zi():(F(de=>({...de,[K]:`❌ ${ae.error||"Toggle failed"}`})),ae.forbidden&&N(ae.error||"Your role cannot change capabilities.")),B(null)},ld=(_,K)=>{if(!h){M({kind:"toolset",name:_,enabled:K});return}fr("toolset",_,K)},cd=(_,K)=>{if(!h){M({kind:"skill",name:_,enabled:K});return}fr("skill",_,K)},wm=async _=>{if(_.preventDefault(),!h){P({kind:"err",text:"🔐 Log in (or set up admin access) to send test messages."});return}if(!Ut){P({kind:"err",text:"🔒 Your role cannot send channel messages — requires the admin or operator role."});return}Z(!0),P(null);const K=await Q.sendChannelMessage(z.trim(),O);K.ok?(P({kind:"ok",text:`✅ Sent to ${z.trim()} (${K.platform}:${dr(K.channelId??"")})`}),U("")):K.unauthorized?(zi(),P({kind:"err",text:K.error||"Session expired — log in again."})):P({kind:"err",text:K.error||"Send failed."}),Z(!1)},ud=(_,K)=>{var ae,de;return(((de=(ae=n==null?void 0:n.channels)==null?void 0:ae.policies)==null?void 0:de[_])??{})[K]??[]},Dl=_=>_==="user"?"allowedUsers":_==="group"?"allowedGroups":"outboundSenders",Us=(_,K,re)=>{const ae=re.trim();ae&&Te(de=>{var Tt;const Re={...de[_]??{}},At=Dl(K),Se=[...((Tt=de[_])==null?void 0:Tt[At])??ud(_,At)];return Se.includes(ae)||Se.push(ae),Re[At]=Se,{...de,[_]:Re}})},Ws=(_,K,re)=>{Te(ae=>{var Tt;const de=Dl(K),Re=ud(_,de),Ct=(((Tt=ae[_])==null?void 0:Tt[de])??Re).filter(zl=>zl!==re);if(Ct.length===0&&Re.length===0){const zl={...ae[_]??{}};delete zl[de];const Sm={...ae};return Object.keys(zl).length===0?delete Sm[_]:Sm[_]=zl,Sm}const Se={...ae[_]??{}};return Se[de]=Ct,{...ae,[_]:Se}})},Bl=(_,K)=>{const re=_.trim().toLowerCase(),ae=K.trim().toLowerCase();if(re==="*"||ae==="*"||re===ae)return!0;const de=re.replace(/\D+/g,""),Re=ae.replace(/\D+/g,"");return de.length>0&&de===Re},dd=_=>{const K=(Pl[_]??"").trim(),re=(V[_]??"").trim();re&&(Us(_,"user",re),K&&Rl(ae=>[...ae.filter(Re=>!(Re.platform===_&&(Bl(Re.id,re)||Re.name.toLowerCase()===K.toLowerCase()))),{name:K,platform:_,id:re,addedAt:Date.now()}]),_e(ae=>({...ae,[_]:""})),rd(ae=>({...ae,[_]:""})))},fd=(_,K)=>{Ws(_,"user",K),Rl(re=>re.filter(ae=>!(ae.platform===_&&Bl(ae.id,K))))},I=(_,K)=>{Te(re=>{const ae={...re[_]??{}};return K==="silentDrop"?ae.silentDrop=ae.silentDrop===!1:ae[K]?delete ae[K]:ae[K]=!0,{...re,[_]:ae}})},te=Object.keys(pe).length>0||Xa.length!==(((kt=(Dn=n==null?void 0:n.channels)==null?void 0:Dn.contacts)==null?void 0:kt.length)??0)||Xa.some((_,K)=>{var re,ae;return!((ae=(re=n==null?void 0:n.channels)==null?void 0:re.contacts)!=null&&ae[K])||_.platform!==n.channels.contacts[K].platform||_.id!==n.channels.contacts[K].id||_.name!==n.channels.contacts[K].name})||ba.length!==(((Yn=(Yr=n==null?void 0:n.channels)==null?void 0:Yr.statusRecipients)==null?void 0:Yn.length)??0)||ba.some((_,K)=>{var re,ae;return _!==((ae=(re=n==null?void 0:n.channels)==null?void 0:re.statusRecipients)==null?void 0:ae[K])}),ee=async()=>{var K;if(!h){ue({kind:"err",text:"🔐 Log in (or set up admin access) to change permissions."});return}if(!Ut){ue({kind:"err",text:"🔒 Your role cannot change permissions — requires the admin or operator role."});return}X(!0),ue(null);const _=await Q.saveGatewayPolicies(pe,ba,Xa);if(_.ok){const re=(K=_.contactErrors)!=null&&K.length?`
|
|
164
|
+
⚠️ Some contacts were rejected: ${_.contactErrors.join("; ")}`:"";ue({kind:re?"warn":"ok",text:`✅ Permissions + saved contacts + status recipients saved — the running gateway applies them immediately.${re}`}),Te({}),lt()}else _.unauthorized?(zi(),ue({kind:"err",text:_.error||"Session expired — log in again."})):ue({kind:"err",text:_.error||"Failed to save permissions."});X(!1)};if(a)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"🧰",title:"Agent Hub"}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Loading hub…"})]})]});const ke=!h&&A!==null;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"🧰",title:i.jsxs(i.Fragment,{children:["Agent Hub",y?i.jsxs("span",{className:`admin-role-badge admin-role-${g||"viewer"}`,children:[" ",y," · ",g||"viewer"]}):null]})}),i.jsxs("div",{className:"admin-header-actions",children:[i.jsxs("label",{className:"hub-reveal-toggle",children:[i.jsx("input",{type:"checkbox",checked:me,onChange:_=>ft(_.target.checked),disabled:!Ut}),"Show full ids"]}),Ut?null:i.jsx("span",{className:"admin-hint",children:"🔒 admins/operators only"}),i.jsx("button",{className:"admin-refresh-btn",onClick:()=>void lt(),disabled:c,children:c?"⏳ Refreshing…":"🔄 Refresh"}),h?i.jsx("button",{className:"admin-logout-btn",onClick:()=>void xm(),children:"🚪 Log out"}):null]})]}),i.jsxs("p",{className:"admin-subtitle",children:["Capabilities, messaging, artifacts and skills in one place — a single 4-view management page. Toggles persist to ",i.jsx("code",{children:"buffconfig"})," and are honored by the runtime immediately (never cosmetic)."]}),o?i.jsx("div",{className:"admin-error",children:o}):null,ke?i.jsxs("div",{className:"admin-header",children:[i.jsx("h2",{className:"section-subtitle",children:d!=null&&d.configured?`🔐 Log in to ${A.enabled?"enable":"disable"} '${A.name}'`:`🔐 Set up admin access to ${A.enabled?"enable":"disable"} '${A.name}'`}),i.jsxs("form",{className:"admin-gate-form",onSubmit:d!=null&&d.configured?bm:od,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:x,onChange:_=>S(_.target.value),autoComplete:"username",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password"}),i.jsx("input",{type:"password",value:j,onChange:_=>w(_.target.value),autoComplete:d!=null&&d.configured?"current-password":"new-password",placeholder:"••••••••"})]}),b?i.jsx("div",{className:"admin-error",children:b}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:E||!x||!j,children:E?"⏳ …":d!=null&&d.configured?"🔐 Log in & apply":"🔐 Create admin & apply"}),d!=null&&d.configured?null:i.jsxs("p",{className:"admin-hint",children:["The first user is always an admin. Automation alternative: set"," ",i.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," / ",i.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"}),"."]})]})]}):null,!ke&&!Ut&&h?i.jsxs("div",{className:"admin-readonly-note",children:["🔒 Your role (",i.jsx("code",{children:g||"viewer"}),") can view but not change capabilities — toggles require the ",i.jsx("code",{children:"admin"})," or ",i.jsx("code",{children:"operator"})," role."]}):null,i.jsx("div",{className:"hub-tabs",role:"tablist",children:Foe.map(_=>{var re,ae,de;const K=_.id==="tools"?n?`${n.toolsets.enabled}/${n.toolsets.toolsets.length}`:"":_.id==="channels"?n?String(n.channels.delivery.total):"":_.id==="conversations"?n?String(((re=n.conversations)==null?void 0:re.total)??0):"":_.id==="artifacts"?n?String(n.artifacts.totalSessions):"":_.id==="subagents"?n?`${((ae=n.subagents)==null?void 0:ae.running)??0}/${((de=n.subagents)==null?void 0:de.total)??0}`:"":n?`${n.skills.enabled}/${n.skills.total}`:"";return i.jsxs("button",{role:"tab","aria-selected":e===_.id,className:`hub-tab${e===_.id?" active":""}`,onClick:()=>t(_.id),children:[_.icon," ",_.label,K?i.jsx("span",{className:"hub-tab-count",children:K}):null]},_.id)})}),e==="tools"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.toolsets.enabled}),i.jsx("div",{className:"admin-summary-label",children:"Enabled toolsets"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.toolsets.disabled}),i.jsx("div",{className:"admin-summary-label",children:"Disabled toolsets"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.toolsets.totalTools}),i.jsx("div",{className:"admin-summary-label",children:"Registered tools"})]})]}),i.jsx("div",{className:"hub-toolset-grid",children:n.toolsets.toolsets.map(_=>i.jsxs("div",{className:`hub-card${_.enabled?"":" hub-card-disabled"}`,children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.label}),i.jsx("span",{className:"hub-card-id",children:_.name})]}),i.jsx("button",{role:"switch","aria-checked":_.enabled,"aria-label":`${_.enabled?"Disable":"Enable"} ${_.label}`,className:`hub-switch${_.enabled?" on":""}`,disabled:R===_.name||A!==null||h&&!Ut,onClick:()=>ld(_.name,!_.enabled),children:i.jsx("span",{className:"hub-switch-knob"})})]}),i.jsx("p",{className:"hub-card-desc",children:_.description}),i.jsx("div",{className:"hub-card-tools",children:_.tools.length>0?_.tools.map(K=>i.jsx("span",{className:"hub-chip",children:K},K)):i.jsx("span",{className:"admin-hint",children:"gates dynamic MCP tools (no static names)"})}),L[_.name]?i.jsx("div",{className:"admin-row-msg",children:L[_.name]}):null,_.enabled?null:i.jsx("div",{className:"hub-card-note",children:"⛔ Removed from the model schema — calls return an explicit error"})]},_.name))})]}):null,e==="channels"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.pending}),i.jsx("div",{className:"admin-summary-label",children:"⏳ Queued for retry"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.sent}),i.jsx("div",{className:"admin-summary-label",children:"✅ Delivered"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.failed}),i.jsx("div",{className:"admin-summary-label",children:"❌ Failed (max retries)"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.aliases.length}),i.jsx("div",{className:"admin-summary-label",children:"Channel aliases"})]})]}),i.jsx("h2",{className:"section-subtitle",children:"📮 Delivery ledger (guaranteed delivery)"}),n.channels.delivery.recent.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Target"}),i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Attempts"}),i.jsx("th",{children:"Next retry"}),i.jsx("th",{children:"Message"})]})}),i.jsx("tbody",{children:n.channels.delivery.recent.map(_=>i.jsxs("tr",{children:[i.jsx("td",{className:"admin-provider-type",children:dr(_.target)}),i.jsx("td",{children:_.platform}),i.jsx("td",{children:i.jsx("span",{className:`admin-check-badge admin-check-${_.status==="sent"?"pass":_.status==="failed"?"fail":"warn"}`,children:Uoe[_.status]||_.status})}),i.jsxs("td",{children:[_.attempts,"/5"]}),i.jsx("td",{children:_.status==="pending"?`${Math.max(0,Math.round((_.nextAttemptAt-Date.now())/1e3))}s`:"—"}),i.jsx("td",{className:"admin-hint",children:_.lastError?`⚠️ ${_.lastError}`:(_.text||"").slice(0,60)})]},_.id))})]})}):i.jsx("div",{className:"empty-state",children:"Delivery ledger is empty — every gateway send has gone through."}),i.jsx("h2",{className:"section-subtitle",children:"📥 Inbox (received messages)"}),n.channels.inbox.recent.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"From"}),i.jsx("th",{children:"Message"}),i.jsx("th",{children:"Handled"}),i.jsx("th",{children:"When"})]})}),i.jsx("tbody",{children:n.channels.inbox.recent.map(_=>i.jsxs("tr",{children:[i.jsxs("td",{className:"admin-provider-type",children:[_.platform,_.isGroup?i.jsx("span",{className:"hub-chip",children:"group"}):null]}),i.jsx("td",{children:dr(_.from||_.senderId||_.channelId)}),i.jsx("td",{className:"admin-hint",children:(_.text||"").slice(0,60)}),i.jsxs("td",{children:[i.jsx("span",{className:`admin-check-badge admin-check-${_.handled==="pipeline"?"pass":_.handled==="refused"?"fail":"warn"}`,children:_.handled}),_.reply?i.jsx("div",{className:"admin-hint",children:_.reply.slice(0,_.handled==="attachment_failed"?160:40)}):null]}),i.jsx("td",{className:"admin-hint",children:new Date(_.at).toLocaleString()})]},_.id))})]})}):i.jsx("div",{className:"empty-state",children:"Inbox is empty — messages the gateway receives will appear here."}),i.jsxs("p",{className:"admin-hint",children:[n.channels.inbox.total," received · ",n.channels.inbox.pipeline," triggered the pipeline ·"," ",n.channels.inbox.help," got the help line · ",n.channels.inbox.refused," refused by policy ·"," ",n.channels.inbox.duplicate??0," duplicate re-deliveries ignored ·"," ",n.channels.inbox.attachmentFailed??0," attachment(s) could not be read."]}),i.jsx("h2",{className:"section-subtitle",children:"🔌 Platform transports"}),i.jsx(Boe,{canWrite:Ut,sessionExpired:zi,mode:"table"}),i.jsx("h2",{className:"section-subtitle",children:"🔗 Channel aliases (buff gateway status)"}),n.channels.aliases.length>0?i.jsx("div",{className:"hub-alias-list",children:n.channels.aliases.map(_=>i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:_.alias}),i.jsxs("span",{className:"admin-hint",children:["→ ",_.platform,":",dr(_.channelId)]})]},_.alias))}):i.jsxs("div",{className:"empty-state",children:["No aliases yet — register one with ",i.jsx("code",{children:"buff gateway alias <name> <platform> <channelId>"}),"."]}),te?i.jsxs("div",{className:"hub-unsaved-banner",role:"status",children:[i.jsxs("span",{children:["⚠️ ",i.jsx("strong",{children:"Unsaved changes"})," — what you see below is a ",i.jsx("em",{children:"draft"}),". Press"," ",i.jsx("strong",{children:"💾 Save permissions"})," to apply it to the gateway; leaving the page discards it."]}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:q,onClick:()=>void ee(),children:q?"⏳ Saving…":"💾 Save permissions"})]}):null,i.jsx("div",{style:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:8,marginBottom:8},onClick:()=>ve(!ie),children:i.jsxs("h2",{className:"section-subtitle",style:{margin:0},children:[ie?"▼":"▶"," 🔐 Permissions — who can TRIGGER the agent"]})}),i.jsxs("p",{className:"admin-hint",style:{marginBottom:ie?10:0},children:["This list controls ",i.jsx("strong",{children:"who may trigger the agent"})," when they message you on each platform (WhatsApp, Telegram, email, …). Click to ",ie?"collapse":"expand"," and manage permissions."]}),ie?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-hint",style:{marginBottom:10},children:["⚠ ",i.jsx("strong",{children:"Not the same as send-by-name contacts:"})," a WhatsApp contact name (from"," ",i.jsx("code",{children:"buff whatsapp contact add"}),", shown in the WhatsApp bridge panel below) only lets"," ",i.jsx("em",{children:"you"})," send ",i.jsx("em",{children:"to"})," it by name — it does ",i.jsx("strong",{children:"not"})," let that number trigger the agent. Add the number here (or ",i.jsx("code",{children:"buff config gateway allow <platform> user <id>"}),") to grant inbound access."]}),i.jsx("div",{className:"hub-permissions",children:n.channels.platforms.map(_=>{const K={...n.channels.policies[_.platform]??{},...pe[_.platform]??{}},re=K.allowedUsers??[],ae=K.allowedGroups??[];return i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsx("span",{className:"hub-chip",children:_.label}),i.jsx("span",{className:"hub-card-id",children:_.platform}),K.disabled?i.jsx("span",{className:"hub-chip",children:"disabled"}):null]}),i.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed users — who may trigger the agent"}),i.jsxs("div",{className:"hub-alias-list",children:[re.length===0?i.jsxs("span",{className:"admin-hint",children:["(blank — no one may trigger; add ",i.jsx("code",{children:"Allow-All"})," to allow everyone)"]}):null,re.map(de=>{var At,Ct,Se,Tt;const Re=(((At=pe[_.platform])==null?void 0:At.allowedUsers)??[]).includes(de)&&!(((Tt=(Se=(Ct=n==null?void 0:n.channels)==null?void 0:Ct.policies)==null?void 0:Se[_.platform])==null?void 0:Tt.allowedUsers)??[]).includes(de);return i.jsxs("div",{className:"hub-alias-row",children:[i.jsxs("span",{className:`hub-chip${Re?" hub-chip-pending":""}`,title:Re?"Not saved yet — press 💾 Save permissions":void 0,children:[dr(de),Re?" · unsaved":""]}),i.jsx("button",{className:"admin-refresh-btn",disabled:q,onClick:()=>fd(_.platform,de),children:"✕"})]},`u-${de}`)})]}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[i.jsx("input",{type:"text",value:Pl[_.platform]??"",onChange:de=>rd(Re=>({...Re,[_.platform]:de.target.value})),placeholder:"Name (optional)",disabled:q}),i.jsx("input",{type:"text",value:V[_.platform]??"",onChange:de=>_e(Re=>({...Re,[_.platform]:de.target.value})),placeholder:"Contact no / sender id, or Allow-All",disabled:q}),i.jsx("button",{className:"admin-refresh-btn",disabled:q||!(V[_.platform]??"").trim(),onClick:()=>dd(_.platform),children:"+ User"})]}),i.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed groups"}),i.jsxs("div",{className:"hub-alias-list",children:[ae.length===0?i.jsx("span",{className:"admin-hint",children:"(none — any group may trigger)"}):null,ae.map(de=>{var At,Ct,Se,Tt;const Re=(((At=pe[_.platform])==null?void 0:At.allowedGroups)??[]).includes(de)&&!(((Tt=(Se=(Ct=n==null?void 0:n.channels)==null?void 0:Ct.policies)==null?void 0:Se[_.platform])==null?void 0:Tt.allowedGroups)??[]).includes(de);return i.jsxs("div",{className:"hub-alias-row",children:[i.jsxs("span",{className:`hub-chip${Re?" hub-chip-pending":""}`,title:Re?"Not saved yet — press 💾 Save permissions":void 0,children:[de,Re?" · unsaved":""]}),i.jsx("button",{className:"admin-refresh-btn",disabled:q,onClick:()=>Ws(_.platform,"group",de),children:"✕"})]},`g-${de}`)})]}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[i.jsx("input",{type:"text",value:je[_.platform]??"",onChange:de=>Ne(Re=>({...Re,[_.platform]:de.target.value})),placeholder:"group id, e.g. 1203630283471234@g.us",disabled:q}),i.jsx("button",{className:"admin-refresh-btn",disabled:q||!(je[_.platform]??"").trim(),onClick:()=>{Us(_.platform,"group",je[_.platform]??""),Ne(de=>({...de,[_.platform]:""}))},children:"+ Group"})]}),i.jsx("div",{className:"admin-hint",style:{margin:"12px 0 4px"},children:"Send authority — who may tell the agent to send to OTHER people"}),i.jsx("div",{className:"admin-hint",style:{margin:"0 0 6px",opacity:.8},children:(K.outboundSenders??[]).length===0?"Open — anyone above who can trigger the agent can also direct outbound sends. Add senders to restrict it.":"Restricted to the senders below (Allow-All = everyone)."}),i.jsx("div",{className:"hub-alias-list",children:(K.outboundSenders??[]).map(de=>{var At,Ct,Se,Tt;const Re=(((At=pe[_.platform])==null?void 0:At.outboundSenders)??[]).includes(de)&&!(((Tt=(Se=(Ct=n==null?void 0:n.channels)==null?void 0:Ct.policies)==null?void 0:Se[_.platform])==null?void 0:Tt.outboundSenders)??[]).includes(de);return i.jsxs("div",{className:"hub-alias-row",children:[i.jsxs("span",{className:`hub-chip${Re?" hub-chip-pending":""}`,title:Re?"Not saved yet — press 💾 Save permissions":void 0,children:[dr(de),Re?" · unsaved":""]}),i.jsx("button",{className:"admin-refresh-btn",disabled:q,onClick:()=>Ws(_.platform,"send",de),children:"✕"})]},`s-${de}`)})}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[i.jsx("input",{type:"text",value:ge[_.platform]??"",onChange:de=>ze(Re=>({...Re,[_.platform]:de.target.value})),placeholder:"sender id, or Allow-All",disabled:q}),i.jsx("button",{className:"admin-refresh-btn",disabled:q||!(ge[_.platform]??"").trim(),onClick:()=>{Us(_.platform,"send",ge[_.platform]??""),ze(de=>({...de,[_.platform]:""}))},children:"+ Sender"})]}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 0"},children:[i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[i.jsx("input",{type:"checkbox",checked:K.silentDrop!==!1,disabled:q,onChange:()=>I(_.platform,"silentDrop")}),i.jsx("span",{className:"admin-hint",children:"Silent (no reply to unapproved) — default"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[i.jsx("input",{type:"checkbox",checked:!!K.requireMention,disabled:q,onChange:()=>I(_.platform,"requireMention")}),i.jsx("span",{className:"admin-hint",children:"Groups: mention only"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[i.jsx("input",{type:"checkbox",checked:!!K.disabled,disabled:q,onChange:()=>I(_.platform,"disabled")}),i.jsx("span",{className:"admin-hint",children:"Disabled (off)"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[i.jsx("input",{type:"checkbox",checked:!!K.requireApprovedTarget,disabled:q,onChange:()=>I(_.platform,"requireApprovedTarget")}),i.jsx("span",{className:"admin-hint",children:"Require approved recipients for sends"})]})]})]},_.platform)})})]}):null,i.jsx("h2",{className:"section-subtitle",style:{marginTop:22},children:"📇 Telegram User Onboarding"}),i.jsxs("div",{className:"onboarding-summary",children:[i.jsx("p",{className:"admin-hint",style:{marginBottom:12},children:"Users who message your bot are auto-registered here. Approve them to enable outbound messaging."}),(()=>{const _=Xa.filter(ae=>ae.status==="pending").length,K=Xa.filter(ae=>ae.status==="approved").length,re=Xa.filter(ae=>ae.status==="rejected").length;return i.jsxs("div",{className:"onboarding-stats",children:[i.jsxs("span",{className:"onboarding-stat pending",children:["⏳ ",_," pending"]}),i.jsxs("span",{className:"onboarding-stat approved",children:["✅ ",K," approved"]}),i.jsxs("span",{className:"onboarding-stat rejected",children:["🚫 ",re," rejected"]})]})})(),i.jsxs("div",{className:"onboarding-steps",children:[i.jsxs("div",{className:"onboarding-step",children:[i.jsx("span",{className:"onboarding-step-num",children:"1"}),i.jsxs("span",{children:["User sends any message to ",i.jsx("code",{children:"@agent_nuvira_bot"})]})]}),i.jsxs("div",{className:"onboarding-step",children:[i.jsx("span",{className:"onboarding-step-num",children:"2"}),i.jsxs("span",{children:["Bot auto-registers them as ",i.jsx("strong",{children:"⏳ pending"})]})]}),i.jsxs("div",{className:"onboarding-step",children:[i.jsx("span",{className:"onboarding-step-num",children:"3"}),i.jsx("span",{children:"Admin approves → they can receive outbound messages"})]})]}),i.jsx("a",{href:"/contacts",className:"admin-refresh-btn",style:{marginTop:12,display:"inline-block",textDecoration:"none"},children:"📋 Go to Contacts tab to manage →"})]}),i.jsx("h2",{className:"section-subtitle",style:{marginTop:22},children:"📊 Status recipients"}),i.jsxs("p",{className:"admin-hint",children:["Contacts/groups that ALWAYS receive the pipeline completion summary, whoever triggered it. Use a contact name, number, or ",i.jsx("code",{children:"platform:channelId"})," — e.g."," ",i.jsx("code",{children:"whatsapp:Name"}),", ",i.jsx("code",{children:"whatsapp:+91***"}),", ",i.jsx("code",{children:"telegram:123456"}),","," ",i.jsx("code",{children:"slack:ops"}),"."]}),ba.length>0?i.jsx("div",{className:"hub-alias-list",children:ba.map(_=>{var K,re;return i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:"📊"}),i.jsx("span",{className:"admin-hint",children:((re=(K=n==null?void 0:n.channels)==null?void 0:K.statusRecipientDisplay)==null?void 0:re[_])??_}),i.jsx("button",{className:"admin-refresh-btn",disabled:q,onClick:()=>Ml(ae=>ae.filter(de=>de!==_)),children:"✕"})]},_)})}):i.jsx("div",{className:"empty-state",style:{padding:"14px"},children:"No status recipients — add one below."}),i.jsxs("div",{className:"hub-send-form",children:[i.jsx("input",{type:"text",value:Qa,onChange:_=>ur(_.target.value),placeholder:"whatsapp:Name or whatsapp:+91***",disabled:q,maxLength:128}),i.jsx("button",{className:"admin-refresh-btn",disabled:q||!Qa.trim()||ba.includes(Qa.trim()),onClick:()=>{Ml(_=>[..._,Qa.trim()]),ur("")},children:"+ Add"})]}),i.jsxs("div",{className:"hub-send-form",style:{marginTop:10},children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:q,onClick:()=>void ee(),children:q?"⏳ Saving…":"💾 Save permissions"}),Object.keys(pe).length>0?i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:q,onClick:()=>Te({}),children:"Discard draft"}):null]}),oe?i.jsx("div",{className:`admin-row-msg${oe.kind==="err"?" admin-row-msg-err":""}`,children:oe.text}):null,i.jsx("h2",{className:"section-subtitle",children:"📤 Test a channel (buff gateway send)"}),i.jsxs("form",{className:"hub-send-form",onSubmit:_=>void wm(_),children:[i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Target — an alias or platform:channelId"}),i.jsx("input",{type:"text",value:z,onChange:_=>$(_.target.value),placeholder:"ops or slack:C0123 or email:team@example.com",disabled:C,maxLength:128})]}),i.jsxs("label",{className:"hub-send-message",children:[i.jsx("span",{className:"admin-hint",children:"Message"}),i.jsx("input",{type:"text",value:O,onChange:_=>U(_.target.value),placeholder:"nightly build done 🎉",disabled:C,maxLength:4e3})]}),i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:C||!z.trim()||!O,children:C?"⏳ Sending…":"📤 Send test message"})]}),D?i.jsx("div",{className:`admin-row-msg${D.kind==="ok"?"":" admin-row-msg-err"}`,children:D.text}):null,i.jsxs("p",{className:"admin-hint",children:["Sends through the same gateway the CLI uses — the dashboard process must have the platform's env token set (e.g. ",i.jsx("code",{children:"BUFF_SMTP_HOST"}),"). Requires admin or operator."]}),i.jsx("h2",{className:"section-subtitle",children:"🟢 WhatsApp bridge (buff whatsapp pair)"}),i.jsx(Doe,{authed:h,canWrite:Ut,sessionExpired:zi,reveal:me})]}):null,e==="conversations"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((we=n.conversations)==null?void 0:we.total)??0}),i.jsx("div",{className:"admin-summary-label",children:"Stored conversations"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:sn.filter(_=>Date.now()-_.lastActiveAt<864e5).length}),i.jsx("div",{className:"admin-summary-label",children:"Active today"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:sn.filter(_=>_.platform==="whatsapp").length}),i.jsx("div",{className:"admin-summary-label",children:"WhatsApp"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:sn.filter(_=>_.platform==="telegram").length}),i.jsx("div",{className:"admin-summary-label",children:"Telegram"})]})]}),((Ue=n.conversations)==null?void 0:Ue.analytics)&&n.conversations.analytics.totalConversations>0&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>Y(!W),style:{marginBottom:12},children:W?"📊 Hide Analytics":"📊 Show Analytics"}),W?i.jsxs("div",{className:"hub-session-list",style:{marginBottom:16},children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.totalMessages}),i.jsx("div",{className:"admin-summary-label",children:"Total messages"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgMessagesPerConversation}),i.jsx("div",{className:"admin-summary-label",children:"Avg msgs/conversation"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgUserMessageLength}),i.jsx("div",{className:"admin-summary-label",children:"Avg user msg length"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgAssistantMessageLength}),i.jsx("div",{className:"admin-summary-label",children:"Avg assistant msg length"})]})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"🏆 Most Active Contacts"})})}),i.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.topContacts.map((_,K)=>{var de;const re=((de=n.conversations.analytics.topContacts[0])==null?void 0:de.messageCount)||1,ae=Math.round(_.messageCount/re*100);return i.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[i.jsx("span",{style:{width:24,textAlign:"center",fontWeight:600,color:K<3?"var(--accent-yellow)":"var(--muted)"},children:K===0?"🥇":K===1?"🥈":K===2?"🥉":`${K+1}.`}),i.jsxs("span",{style:{flex:1,marginLeft:8},children:[_.platform==="whatsapp"?"📱":"✈️"," ",_.name]}),i.jsx("span",{style:{width:60,textAlign:"right",fontWeight:600},children:_.messageCount}),i.jsx("div",{style:{width:100,height:8,background:"var(--border)",borderRadius:4,marginLeft:8},children:i.jsx("div",{style:{width:`${ae}%`,height:"100%",background:"var(--accent-blue)",borderRadius:4}})})]},K)})})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"🕐 Peak Hours"})})}),i.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:80,marginTop:8,gap:2},children:n.conversations.analytics.hourlyDistribution.map(({hour:_,count:K})=>{const re=Math.max(...n.conversations.analytics.hourlyDistribution.map(de=>de.count),1),ae=Math.round(K/re*70);return i.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:i.jsx("div",{style:{width:"100%",height:ae,background:_>=9&&_<=21?"var(--accent-blue)":"var(--text-muted)",borderRadius:2},title:`${_}:00 — ${K} messages`})},_)})}),i.jsx("div",{style:{display:"flex",fontSize:10,color:"var(--muted)",marginTop:4},children:[0,6,12,18,23].map(_=>i.jsxs("span",{style:{flex:1,textAlign:_===0?"left":_===23?"right":"center"},children:[_,":00"]},_))})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"📱 Platform Breakdown"})})}),i.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.platformBreakdown.map(_=>i.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[i.jsx("span",{className:"hub-chip",style:{width:80,textAlign:"center"},children:_.platform}),i.jsxs("span",{style:{marginLeft:8,flex:1},children:[_.conversations," conversations"]}),i.jsxs("span",{style:{fontWeight:600},children:[_.messages," msgs"]})]},_.platform))})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"📈 Daily Volume (14 days)"})})}),i.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:60,marginTop:8,gap:2},children:n.conversations.analytics.dailyVolume.map(({date:_,count:K})=>{const re=Math.max(...n.conversations.analytics.dailyVolume.map(de=>de.count),1),ae=Math.round(K/re*50);return i.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:i.jsx("div",{style:{width:"100%",height:ae,background:"var(--accent-green)",borderRadius:2},title:`${_}: ${K} messages`})},_)})}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"var(--muted)",marginTop:4},children:[i.jsx("span",{children:(ct=n.conversations.analytics.dailyVolume[0])==null?void 0:ct.date}),i.jsx("span",{children:(Mt=n.conversations.analytics.dailyVolume[n.conversations.analytics.dailyVolume.length-1])==null?void 0:Mt.date})]})]})]}):null]}),i.jsx("h2",{className:"section-subtitle",children:"💬 Per-contact chat history"}),i.jsx("p",{className:"admin-hint",children:"Conversation history is stored per-contact and survives gateway restarts. Messages older than 7 days are auto-pruned. Click a conversation to expand the full chat thread."}),sn.length>0||on?i.jsxs(i.Fragment,{children:[zt.length>0&&i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:[i.jsx("span",{className:"admin-hint",style:{marginRight:4},children:"Filter by tag:"}),zt.map(_=>i.jsxs("button",{type:"button",onClick:()=>Vn(Pe===_?"":_),style:{padding:"2px 10px",borderRadius:12,fontSize:11,cursor:"pointer",border:`1px solid ${Pe===_?"var(--accent-blue)":"var(--border)"}`,background:Pe===_?"color-mix(in srgb, var(--accent-blue) 13%, transparent)":"transparent",color:Pe===_?"var(--accent-blue)":"var(--muted)"},children:["🏷️ ",_]},_))]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12,flexWrap:"wrap"},children:[i.jsx("input",{type:"text",value:Ze,onChange:_=>yt(_.target.value),placeholder:"🔍 Search by contact name, phone number, or message content…",style:{flex:1,minWidth:200}}),i.jsxs("span",{className:"admin-hint",children:[ha," conversation",ha===1?"":"s",Ze?` matching "${Ze}"`:""]}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:Al,style:{fontSize:12,padding:"4px 10px"},children:xe.size===sn.length?"☑ Deselect All":"☐ Select All"}),xe.size>0&&i.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:Rt,onClick:()=>void Bs(),style:{fontSize:12,padding:"4px 10px",background:"var(--accent-blue)",color:"var(--text-on-accent)",border:"none"},children:Rt?"⏳ Exporting…":`📦 Export ${xe.size} as ZIP`})]}),i.jsxs("div",{className:"hub-session-list",children:[sn.filter(_=>!Pe||(_.tags??[]).includes(Pe)).map(_=>{const K=Date.now()-_.lastActiveAt,re=K<6e4?"just now":K<36e5?`${Math.round(K/6e4)}m ago`:K<864e5?`${Math.round(K/36e5)}h ago`:`${Math.round(K/864e5)}d ago`,ae=Ge===_.key,{name:de,phone:Re}=$l(_),At=async Se=>{if(Se.stopPropagation(),!h||!Ut){ue({kind:"err",text:"🔐 Log in (admin/operator) to clear conversations."});return}bt(_.key);try{await Q.clearGatewayConversation(_.key),lt()}catch{}bt(null)},Ct=xe.has(_.key);return i.jsxs("div",{className:"hub-card",style:{cursor:"pointer",borderLeft:`3px solid ${_.platform==="whatsapp"?"#25d366":_.platform==="telegram"?"#0088cc":"var(--text-muted)"}`,opacity:xe.size>0&&!Ct?.5:1,transition:"opacity 0.2s"},onClick:()=>Ae(ae?null:_.key),children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("input",{type:"checkbox",checked:Ct,onClick:Se=>_l(_.key,Se),onChange:()=>{},style:{cursor:"pointer",width:16,height:16}}),i.jsxs("div",{className:"hub-card-title",children:[i.jsxs("span",{className:"hub-card-name",children:[_.platform==="whatsapp"?"📱":_.platform==="telegram"?"✈️":"💬"," ",de]}),i.jsxs("span",{className:"hub-card-id",children:[Re&&i.jsx("span",{style:{color:"var(--text-secondary, var(--text-secondary))",marginRight:6},children:Re}),_.platform," · ",re]})]})]}),i.jsxs("div",{className:"hub-card-actions",style:{gap:6},children:[i.jsxs("span",{className:"hub-chip",children:[_.messageCount," msgs"]}),ae&&_.messages&&_.messages.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"hub-mini-btn",onClick:Se=>H(_,Se),title:"Export as text file",children:"📄"}),i.jsx("button",{type:"button",className:"hub-mini-btn",onClick:Se=>ne(_,Se),title:"Export as PDF (opens print dialog)",children:"📑"})]}),i.jsx("button",{type:"button",className:"hub-mini-btn",disabled:An===_.key,onClick:At,title:"Clear conversation history",style:{color:"var(--accent-red)"},children:"🗑️"}),i.jsx("span",{style:{fontSize:18,transition:"transform 0.2s",transform:ae?"rotate(180deg)":"none"},children:"▼"})]})]}),i.jsxs("p",{className:"hub-card-desc",style:{fontStyle:"italic",color:"var(--text-muted, var(--text-muted))"},children:[i.jsx("span",{style:{color:"var(--text-primary, var(--text-primary))",fontWeight:500},children:"Last message:"})," ",_.lastUserMessage.slice(0,120),_.lastUserMessage.length>120?"…":""]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:[(_.tags??[]).map(Se=>i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 8px",borderRadius:12,fontSize:11,background:"color-mix(in srgb, var(--accent-blue) 13%, transparent)",color:"var(--accent-blue)",border:"1px solid color-mix(in srgb, var(--accent-blue) 25%, transparent)"},children:["🏷️ ",Se,i.jsx("button",{type:"button",onClick:Tt=>{Tt.stopPropagation(),Bi(_.key,Se)},style:{background:"none",border:"none",color:"var(--accent-blue)",cursor:"pointer",padding:0,fontSize:12,lineHeight:1},children:"×"})]},Se)),Ft===_.key?i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:i.jsx("input",{type:"text",value:Cr,onChange:Se=>Cn(Se.target.value),onKeyDown:Se=>{Se.key==="Enter"&&Vr(_.key,Cr),Se.key==="Escape"&&(an(null),Cn(""))},placeholder:"tag name",autoFocus:!0,onClick:Se=>Se.stopPropagation(),style:{width:80,padding:"1px 6px",fontSize:11,borderRadius:8,border:"1px solid var(--border)"}})}):i.jsx("button",{type:"button",onClick:Se=>{Se.stopPropagation(),an(_.key),Cn("")},style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 8px",borderRadius:12,fontSize:11,background:"var(--border)",color:"var(--muted)",border:"none",cursor:"pointer"},children:"+ tag"})]}),ae&&_.messages&&_.messages.length>0?i.jsxs("div",{className:"conversation-thread",style:{marginTop:10,borderTop:"1px solid var(--border)",paddingTop:10,maxHeight:400,overflowY:"auto"},children:[_.messages.map((Se,Tt)=>i.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:Se.role==="user"?"flex-end":"flex-start"},children:[i.jsxs("div",{style:{maxWidth:"80%",padding:"8px 12px",borderRadius:12,backgroundColor:Se.role==="user"?"var(--accent-blue)":"var(--bg-card, var(--bg-card))",color:Se.role==="user"?"var(--text-on-accent)":"var(--text-primary, var(--text-primary))",fontSize:13,lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[Se.content.slice(0,500),Se.content.length>500?"…":""]}),i.jsxs("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:[Se.role==="user"?"👤":"🤖"," ",new Date(Se.ts).toLocaleString()]})]},Tt)),se.has(_.key)&&i.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[i.jsxs("div",{style:{padding:"8px 16px",borderRadius:12,backgroundColor:"var(--bg-card, var(--bg-card))",fontSize:13,display:"flex",alignItems:"center",gap:4},children:[i.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out"},children:"●"}),i.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.2s"},children:"●"}),i.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.4s"},children:"●"})]}),i.jsx("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:"🤖 typing…"})]})]}):ae?i.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"No message details available."}):null]},_.key)}),gn&&!on&&i.jsx("div",{ref:ga,style:{height:1}}),on&&i.jsxs("div",{className:"loading-state",style:{padding:12},children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("span",{className:"admin-hint",style:{marginLeft:8},children:"Loading more conversations…"})]}),!on&&!gn&&sn.length>0&&i.jsxs("p",{className:"admin-hint",style:{textAlign:"center",padding:12},children:["All ",ha," conversation",ha===1?"":"s"," loaded."]})]})]}):on?i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{className:"admin-hint",children:"Loading conversations…"})]}):i.jsx("div",{className:"empty-state",children:"No conversations stored yet. Conversations are created when users message the agent via WhatsApp/Telegram/etc."})]}):null,e==="artifacts"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalSessions}),i.jsx("div",{className:"admin-summary-label",children:"Sessions"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalArtifacts}),i.jsx("div",{className:"admin-summary-label",children:"Artifacts"})]})]}),n.artifacts.sessions.length>0?i.jsx("div",{className:"hub-session-list",children:n.artifacts.sessions.map(_=>i.jsxs("div",{className:"hub-card",children:[i.jsx("div",{className:"hub-card-top",children:i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.sessionId}),i.jsxs("span",{className:"hub-card-id",children:[_.count," artifact",_.count===1?"":"s"," · ",new Date(_.latestAt).toLocaleString()]})]})}),_.recent.length>0?i.jsx("ul",{className:"hub-artifact-list",children:_.recent.map((K,re)=>i.jsxs("li",{children:[i.jsx("span",{className:"hub-chip",children:K.kind}),i.jsx("span",{className:"hub-artifact-title",children:K.title||"(untitled)"}),K.preview?i.jsx("div",{className:"hub-artifact-preview",children:K.preview}):null]},re))}):i.jsx("div",{className:"admin-hint",children:"No artifact details."})]},_.sessionId))}):i.jsx("div",{className:"empty-state",children:"No artifacts yet — tools that return a deliverable payload land here per session."})]}):null,e==="skills"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.skills.enabled}),i.jsx("div",{className:"admin-summary-label",children:"Enabled skills"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.skills.disabled}),i.jsx("div",{className:"admin-summary-label",children:"Disabled skills"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.skills.hub.length}),i.jsx("div",{className:"admin-summary-label",children:"Hub skills (SKILL.md)"})]})]}),i.jsx("h2",{className:"section-subtitle",children:"📚 Compiled skills (SkillStore — matched at plan time)"}),n.skills.compiled.length>0?i.jsx("div",{className:"hub-session-list",children:n.skills.compiled.map(_=>i.jsxs("div",{className:`hub-card${_.enabled?"":" hub-card-disabled"}`,children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.name}),i.jsxs("span",{className:"hub-card-id",children:[_.id,_.version?` · v${_.version}`:""]})]}),i.jsxs("div",{className:"hub-card-actions",children:[_.bundled===!0?i.jsx("span",{className:"hub-chip hub-chip-bundled",children:"🧠 bundled"}):i.jsx("span",{className:"hub-chip",children:"community"}),i.jsx("button",{role:"switch","aria-checked":_.enabled,"aria-label":`${_.enabled?"Disable":"Enable"} ${_.name}`,className:`hub-switch${_.enabled?" on":""}`,disabled:R===_.id||A!==null||h&&!Ut,onClick:()=>cd(_.id,!_.enabled),children:i.jsx("span",{className:"hub-switch-knob"})})]})]}),i.jsx("p",{className:"hub-card-desc",children:_.description}),i.jsxs("div",{className:"hub-card-tools",children:[typeof _.usageCount=="number"?i.jsxs("span",{className:"hub-chip",children:[_.usageCount," uses"]}):null,_.enabled?null:i.jsx("span",{className:"hub-chip",children:"disabled"})]}),L[_.id]?i.jsx("div",{className:"admin-row-msg",children:L[_.id]}):null,_.enabled?null:i.jsx("div",{className:"hub-card-note",children:"⛔ Excluded from skill matching — not injected into the planner"})]},`c-${_.id}`))}):i.jsx("div",{className:"empty-state",children:"No compiled skills."}),i.jsx("h2",{className:"section-subtitle",children:"🌍 Hub skills (installed SKILL.md)"}),n.skills.hub.length>0?i.jsx("div",{className:"hub-session-list",children:n.skills.hub.map(_=>i.jsxs("div",{className:`hub-card${_.enabled?"":" hub-card-disabled"}`,children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.name}),i.jsx("span",{className:"hub-card-id",children:_.id})]}),i.jsxs("div",{className:"hub-card-actions",children:[i.jsx("button",{type:"button",className:"hub-mini-btn",disabled:ya===_.id||h&&!Ut,onClick:()=>void ym(_.id),children:"🗑 Uninstall"}),i.jsx("button",{role:"switch","aria-checked":_.enabled,"aria-label":`${_.enabled?"Disable":"Enable"} ${_.name}`,className:`hub-switch${_.enabled?" on":""}`,disabled:R===_.id||A!==null||h&&!Ut,onClick:()=>cd(_.id,!_.enabled),children:i.jsx("span",{className:"hub-switch-knob"})})]})]}),i.jsx("p",{className:"hub-card-desc",children:_.description}),i.jsxs("div",{className:"hub-card-tools",children:[i.jsx("span",{className:"hub-chip",children:"SKILL.md"}),_.enabled?null:i.jsx("span",{className:"hub-chip",children:"disabled"})]}),L[_.id]?i.jsx("div",{className:"admin-row-msg",children:L[_.id]}):null,_.enabled?null:i.jsx("div",{className:"hub-card-note",children:"⛔ Excluded from skill matching — not injected into the planner"})]},`h-${_.id}`))}):i.jsxs("div",{className:"empty-state",children:["No hub skills installed — search the marketplace below or run ",i.jsx("code",{children:"buff skills install <name>"}),"."]}),i.jsx("h2",{className:"section-subtitle",children:"🛒 Marketplace (community skills)"}),i.jsxs("form",{className:"hub-market-search",onSubmit:id,children:[i.jsx("input",{type:"text",value:Me,onChange:_=>Oe(_.target.value),placeholder:"Search community skills (e.g. code-assist, deploy, testing)…"}),i.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:Ya,children:Ya?"Searching…":"🔎 Search"})]}),Ol?i.jsx("div",{className:`admin-row-msg${Ol.kind==="err"?" admin-row-msg-err":""}`,children:Ol.text}):null,cr&&!Ya?ot.length>0?i.jsx("div",{className:"hub-session-list",children:ot.map(_=>i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.name}),i.jsxs("span",{className:"hub-card-id",children:["v",_.version," · ",_.sourceKind]})]}),i.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:ya===_.name||h&&!Ut,onClick:()=>void sd(_.name),children:ya===_.name?"Installing…":"⬇ Install"})]}),i.jsx("p",{className:"hub-card-desc",children:_.description}),i.jsxs("div",{className:"hub-card-tools",children:[i.jsx("span",{className:"hub-chip",children:_.author}),_.tags.slice(0,3).map(K=>i.jsx("span",{className:"hub-chip",children:K},K))]})]},`m-${_.name}`))}):i.jsxs("div",{className:"empty-state",children:['No skills match "',Me,'" — try a broader term, or add a registry to ',i.jsx("code",{children:"skills.registries"})," in config."]}):null]}):null,e==="subagents"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((ln=n.subagents)==null?void 0:ln.total)??0}),i.jsx("div",{className:"admin-summary-label",children:"Runs recorded"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((k0=n.subagents)==null?void 0:k0.running)??0}),i.jsx("div",{className:"admin-summary-label",children:"Running now"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((j0=n.subagents)==null?void 0:j0.failed)??0}),i.jsx("div",{className:"admin-summary-label",children:"Failed"})]})]}),i.jsxs("p",{className:"admin-hint",children:["Each run is a separate child process. A transport of ",i.jsx("code",{children:"json"})," means the provider has no native tool protocol and the shared JSON fallback carried the tool calls; a refusal code means the run stopped deliberately instead of returning an answer."]}),(((N0=n.subagents)==null?void 0:N0.recent)??[]).length>0?i.jsx("div",{className:"hub-session-list",children:(((E0=n.subagents)==null?void 0:E0.recent)??[]).map(_=>i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.goal||"(no goal recorded)"}),i.jsxs("span",{className:"hub-card-id",children:[_.id.slice(0,8),_.startedAt?` · ${new Date(_.startedAt).toLocaleString()}`:""]})]}),i.jsx("div",{className:"hub-card-actions",children:i.jsx("span",{className:"hub-chip",children:Hoe[_.status]??_.status})})]}),i.jsxs("div",{className:"hub-card-tools",children:[i.jsxs("span",{className:"hub-chip",children:["🔌 ",_.provider??"provider unknown",_.model?` · ${_.model}`:""]}),i.jsxs("span",{className:"hub-chip",children:["🛠 ",_.transport??"transport unknown"," transport"]}),i.jsxs("span",{className:"hub-chip",children:[_.llmCalls," model call",_.llmCalls===1?"":"s"]}),i.jsxs("span",{className:"hub-chip",children:[_.toolCalls," tool call",_.toolCalls===1?"":"s"]}),typeof _.durationMs=="number"?i.jsxs("span",{className:"hub-chip",children:[(_.durationMs/1e3).toFixed(1),"s"]}):null]}),_.refusalCode?i.jsxs("div",{className:"hub-card-note",children:["⛔ Refused before answering — code ",i.jsx("code",{children:_.refusalCode})]}):null,_.error?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:_.error}):null,_.resultPreview?i.jsx("div",{className:"hub-artifact-preview",children:_.resultPreview}):null]},_.id))}):i.jsxs("div",{className:"empty-state",children:["No subagent runs recorded yet — a run shows up here once the agent spawns one (the ",i.jsx("code",{children:"subagent"})," tool), and only if it actually started."]})]}):null]})}const Voe=256,Yoe=52,Xoe=[{name:"admin",description:"Admin governance policy for Auto routing (P6 M6.5) — allow/deny providers & models, hard cost cap, PII privacy, unblock control",commands:[{name:"admin policy",description:"Show the current governance policy + enforcement status",flags:["--json"]},{name:"admin allow",description:"Add providers to the allow-list (empty = all providers allowed)",flags:[]},{name:"admin deny",description:"Add providers to the deny-list (wins over the allow-list)",flags:[]},{name:"admin allow-model",description:"Add models to the allow-list — a provider survives only if one of its candidate models is listed",flags:[]},{name:"admin deny-model",description:"Add models to the deny-list (wins over the allow-list)",flags:[]},{name:"admin max-cost",description:"Set the admin hard max cost per call (USD); joins routing.maxCostUsd (stricter wins)",flags:[]},{name:"admin pii-min",description:"Set the minimum privacy score (0-1) required when a task matches a PII pattern (default 1.0 = local-only)",flags:[]},{name:"admin unblock",description:"Control whether `nuvira models unblock` may override REGISTRY-learned blocks (false = admin-hard)",flags:[]},{name:"admin clear",description:"Remove one governance rule (the policy becomes permissive on that field)",flags:[]},{name:"admin role",description:"Manage RBAC roles over the admin surface (P6 M6.1 — requires admin role)",flags:[]},{name:"admin role add",description:"Assign a role to a user (first assignment exits legacy single-user mode)",flags:[]},{name:"admin role remove",description:"Remove a user's role assignment (if none remain, legacy permissive mode resumes)",flags:[]},{name:"admin role list",description:"List all role assignments",flags:[]},{name:"admin whoami",description:"Show the current identity and its effective RBAC permissions",flags:[]},{name:"admin cron",description:"Scheduled tool invocations (J2 — cron/jobs.py)",flags:[]},{name:"admin cron add",description:'Add a cron job: nuvira admin cron add nightly-build "0 3 * * *" build',flags:["--args <args>","--channel <channel>","--dry-run"]},{name:"admin cron list",description:"List cron jobs with schedule + next run",flags:[]},{name:"admin cron remove",description:"Remove a cron job",flags:[]},{name:"admin cron run",description:"Run a cron job NOW (invoke its tool immediately)",flags:[]}]},{name:"chat",description:"Start an interactive chat session with AI",commands:[]},{name:"edit",description:"Edit a file using AI assistance",commands:[]},{name:"plan",description:"Generate an implementation plan for a codebase task",commands:[]},{name:"config",description:"Manage Nuvira configuration",commands:[{name:"config set",description:"Set a configuration value",flags:[]},{name:"config get",description:"Get a configuration value",flags:[]},{name:"config list",description:"List all providers and their status",flags:[]},{name:"config init",description:"Initialize configuration interactively",flags:[]},{name:"config vault",description:"Secret vault management (Phase A1)",flags:[]},{name:"config vault status",description:"Show the active vault tier and migration state",flags:[]},{name:"config vault log",description:"Show recent vault access-log entries (K3 tamper-evident audit)",flags:["--limit <limit>"]},{name:"config vault migrate-keys",description:"Move plaintext provider API keys from buffconfig.json into the vault",flags:[]},{name:"config gateway",description:"Manage gateway platform transports (tokens written to ~/.nuvira/.env)",flags:[]},{name:"config gateway list",description:"Show every platform transport and its env-var status",flags:[]},{name:"config gateway set",description:"Configure a platform transport (interactive wizard, or --set VAR=value)",flags:["--set <set>"]},{name:"config gateway remove",description:"Remove a platform transport from the env file",flags:["--yes"]},{name:"config gateway allow",description:"Allow a user/group to trigger the agent on a platform (written to gateway.policies in config)",flags:[]},{name:"config gateway disallow",description:"Remove a user/group from the allowed list of a platform",flags:[]},{name:"config gateway reply",description:"Set how unapproved senders are handled on a platform: polite (⛔ message) or silent (no reply)",flags:[]},{name:"config gateway send-authority",description:"Manage who may command the agent to send to OTHER people (gateway_send). Outbound-only gate — separate from `allow` (who may trigger).",flags:[]},{name:"config gateway notify",description:"Manage status recipients — contacts/groups that ALWAYS get pipeline completion summaries",flags:[]},{name:"config gateway ask-user-wait",description:"Ask-and-wait for clarifying questions on messaging channels: when a turn asks the sender a question, hold it for their reply instead of assuming option 1",flags:[]},{name:"config service",description:"Manage third-party service keys (image/video/search/vision/speech) in ~/.nuvira/.env",flags:[]},{name:"config service list",description:"Show every service backend and its env-var status",flags:[]},{name:"config service set",description:"Set a service key: config service set <serviceId> <ENV_VAR> <value> (or --set VAR=value)",flags:["--set <set>"]},{name:"config service unset",description:"Remove a service key (all vars, or one with [varName]) from the env file",flags:["--yes"]}]},{name:"cache",description:"Manage inference cache",commands:[{name:"cache stats",description:"Show cache statistics",flags:[]},{name:"cache clear",description:"Clear cached responses — all of them, or one workspace (project folder)",flags:["--unscoped"]}]},{name:"models",description:"List available models from inference providers",commands:[{name:"models refresh",description:"Probe providers and spot-check models, updating the Model Availability Registry",flags:["--json","--no-spot-check"]},{name:"models status",description:"Show the Model Availability Registry (verified / unavailable / quota-parked models)",flags:["--json","--verbose"]},{name:"models unblock",description:"Manually release a registry-blocked provider (escape hatch) and re-probe it against the live API",flags:["--json","--no-spot-check"]},{name:"models excluded",description:"Show which providers routing is currently skipping, and why (failure cooldowns, registry blocks, governance policy)",flags:["--json"]},{name:"models staleness",description:"Show model staleness: last probe time, days since verification, and removal risk",flags:["--json"]},{name:"models watch",description:"Run the model-registry maintenance daemon: probe + spot-check on a schedule",flags:["--interval <interval>","--no-spot-check"]}]},{name:"execute",description:"Run a multi-agent pipeline to accomplish a goal",commands:[]},{name:"run",description:"Execute a shell command and show output (lightweight alternative to the full pipeline)",commands:[]},{name:"workflow",description:"Run, manage, and share workflow templates",commands:[{name:"workflow list",description:"Show available workflow templates (built-in + installed)",flags:[]},{name:"workflow run",description:"Run a workflow template",flags:["--dry-run","--model <model>","--provider <provider>","--verbose"]},{name:"workflow search",description:"Search the GitHub workflow template registry",flags:["--refresh"]},{name:"workflow install",description:"Install a workflow template from the GitHub registry",flags:[]},{name:"workflow publish",description:"Prepare a local workflow template for publishing to the registry",flags:[]},{name:"workflow info",description:"Show detailed information about a registry template",flags:[]},{name:"workflow upgrade",description:"Check for and apply template upgrades from the registry",flags:[]}]},{name:"whatsapp",description:"WhatsApp bridge (Baileys) — pair a personal number via QR and check status (I8)",commands:[{name:"whatsapp pair",description:"Pair WhatsApp (personal number — no Meta Business account, no paid API)",flags:["--phone <phone>","--timeout <timeout>"]},{name:"whatsapp status",description:"Show bridge session path + pairing state",flags:[]},{name:"whatsapp contacts",description:"List resolvable contacts (mapping file + learned) — connects briefly to learn names from live traffic",flags:["--timeout <timeout>"]},{name:"whatsapp contact",description:'Manage the WhatsApp contact-name mapping (send by name: nuvira gateway send whatsapp:<Name> "message")',flags:[]},{name:"whatsapp contact add",description:"Map a display name to a number (E.164, no +): nuvira whatsapp contact add Name 919876543210",flags:[]},{name:"whatsapp contact remove",description:"Remove a mapped contact name",flags:[]}]},{name:"plugins",description:"Manage provider plugins, agent plugins, and workflow templates",commands:[{name:"plugins list",description:"List all discovered plugins and workflows",flags:[]},{name:"plugins scan",description:"Force re-scan all plugin directories",flags:[]}]},{name:"learn",description:"Self-improvement system — agent stats, patterns, and optimization",commands:[{name:"learn stats",description:"Show per-agent performance statistics",flags:[]},{name:"learn patterns",description:"Show extracted coding patterns",flags:["--extract","--model <model>","--provider <provider>"]},{name:"learn lessons",description:"Show failure lessons — what past runs learned from mistakes",flags:["--extract","--model <model>","--provider <provider>"]},{name:"learn optimize",description:"Generate optimized model-to-agent routing recommendations",flags:[]},{name:"learn status",description:"Show overall self-improvement status",flags:[]},{name:"learn clear",description:"Reset all learning data (stats, patterns, memory)",flags:["--force"]},{name:"learn compare",description:"Compare benchmark results between two models",flags:["--all","--last"]},{name:"learn feedback",description:"Rate a trajectory or view feedback statistics",flags:["--comment <comment>","--rating <rating>","--stats","--trajectory <trajectory>"]},{name:"learn quality",description:"Show pattern quality and decay metrics",flags:["--details"]},{name:"learn gc",description:"Garbage-collect low-quality patterns",flags:["--dry-run"]}]},{name:"init",description:"Scaffold a new project from a template",commands:[]},{name:"stats",description:"View usage statistics and cost tracking",commands:[{name:"stats cost",description:"Show API cost tracking details",flags:["--clear"]},{name:"stats history",description:"Show conversation history statistics",flags:[]}]},{name:"history",description:"Browse and search conversation history",commands:[{name:"history list",description:"Show all saved conversations",flags:["--limit <limit>"]},{name:"history search",description:"Search conversations by keyword or semantic similarity",flags:["--limit <limit>","--semantic"]},{name:"history show",description:"Show a specific conversation",flags:[]},{name:"history clear",description:"Clear all conversation history",flags:[]},{name:"history prune",description:"Remove conversations older than the retention period",flags:["--days <days>"]},{name:"history reindex",description:"Rebuild the semantic search index for all past conversations (embeds each session for vector search)",flags:[]}]},{name:"skill",description:"Manage and run compiled skills — reusable execution plans derived from past trajectories",commands:[{name:"skill list",description:"List all compiled skills",flags:["--quality <quality>"]},{name:"skill show",description:"Show detailed skill definition",flags:[]},{name:"skill run",description:"Run a skill — resolves parameters and invokes the multi-agent pipeline",flags:["--auto-route","--dry-run","--memory","--model <model>","--params <params>","--provider <provider>","--verbose"]},{name:"skill compile",description:"Force skill compilation from stored trajectories",flags:["--model <model>","--provider <provider>"]},{name:"skill search",description:"Search skills by name, tag, or description",flags:[]},{name:"skill gc",description:"Garbage-collect low-quality skills",flags:["--dry-run"]},{name:"skill quality",description:"Show skill quality and decay metrics",flags:["--details"]},{name:"skill clear",description:"Remove all compiled skills",flags:["--force"]}]},{name:"skills",description:"Skills hub — search, install, update, and audit community skills (J3)",commands:[{name:"skills search",description:"Search all configured skill registries (I7 P1 multi-source)",flags:["--refresh","--source <source>"]},{name:"skills install",description:"Install a skill from the configured registries into <project>/.agents/skills/ (sandboxed, checksummed)",flags:["--project <project>","--source <source>"]},{name:"skills uninstall",description:"Uninstall a skill: removes .agents/skills/<name> and its provenance record",flags:["--project <project>"]},{name:"skills update",description:"Update installed skills to newer registry versions (checksum-verified)",flags:["--project <project>"]},{name:"skills bundle",description:"P6b — skill bundles: group skills under one id and load them together (Hermes parity)",flags:["--create","--delete","--description <description>","--name <name>","--skills <skills>"]},{name:"skills list",description:"List installed skills with provenance (origin: registry vs local)",flags:["--origin <origin>","--project <project>"]}]},{name:"gateway",description:"Multi-channel gateway — talk to the agent from Telegram/Discord/Slack/WhatsApp/Email/Signal (J1)",commands:[{name:"gateway status",description:"Show configured adapters and reachable channels",flags:[]},{name:"gateway send",description:"Send a message to a channel alias or platform:channelId",flags:[]},{name:"gateway send-media",description:"Send a media file (image/video/audio/document) — type from the file extension; WhatsApp/Telegram/Discord",flags:["--caption <caption>"]},{name:"gateway alias",description:"Manage channel aliases",flags:[]},{name:"gateway alias add",description:"Register an alias: nuvira gateway alias add ops slack C0123",flags:[]},{name:"gateway alias remove",description:"Remove an alias",flags:[]},{name:"gateway contact",description:"Manage contacts for outbound messaging (name → platform:id resolution)",flags:[]},{name:"gateway contact list",description:"List all contacts with status, platform, and ID",flags:["--pending","--platform <platform>"]},{name:"gateway contact approve",description:"Approve a contact for outbound messaging",flags:["--platform <platform>"]},{name:"gateway contact reject",description:"Reject a contact (block outbound messages)",flags:["--platform <platform>"]},{name:"gateway contact delete",description:"Delete a contact permanently",flags:["--platform <platform>"]},{name:"gateway contact add",description:"Manually add a contact (e.g. nuvira gateway contact add Anuj telegram 616825477)",flags:["--phone <phone>"]},{name:"gateway delivery",description:"Show the delivery ledger (failed sends awaiting retry) and optionally drain it",flags:["--flush"]},{name:"gateway logs",description:"Show the structured gateway log (send failures, refused senders, pipeline outcomes)",flags:["--event <event>","--limit <limit>","--path"]},{name:"gateway history",description:"Manage per-contact conversation history (gateway chat memory)",flags:[]},{name:"gateway history list",description:"List all stored conversations with last message preview",flags:["--platform <platform>"]},{name:"gateway history show",description:"Show conversation history for a contact (e.g. nuvira gateway history show whatsapp:918800663237)",flags:["--limit <limit>"]},{name:"gateway history clear",description:"Clear conversation history for a contact",flags:[]},{name:"gateway history prune",description:"Remove conversations older than 7 days",flags:[]},{name:"gateway start",description:"Run all configured adapters in the foreground (Ctrl-C to stop; --supervise auto-restarts on crash)",flags:["--host <host>","--no-events","--port <port>","--supervise"]},{name:"gateway stop",description:"Stop a running gateway gracefully (SIGTERM — from any terminal)",flags:["--port <port>"]},{name:"gateway setup",description:"Interactive setup wizard for a messaging platform (e.g. nuvira gateway setup telegram)",flags:[]}]},{name:"model",description:"Manage inference providers and models — switch, list, inspect, and recommend",commands:[{name:"model list",description:"List all providers and their configuration status",flags:["--all","--json"]},{name:"model switch",description:"Switch active provider/model (interactive or via argument). Use `auto` for smart routing",flags:["--model <model>","--provider <provider>"]},{name:"model info",description:"Show current active provider and model configuration",flags:["--verbose"]},{name:"model recommend",description:"Show model routing recommendations",flags:[]},{name:"model explain",description:"Explain Auto model routing — why a provider/model would be picked for a task",flags:["--agent <agent>","--json","--since <since>"]},{name:"model health",description:"Quick health check for the currently active provider",flags:["--provider <provider>","--verbose"]},{name:"model bandit",description:"Show learning-router bandit state (Thompson-sampling priors per provider × complexity bucket). Action: reset",flags:["--json"]},{name:"model ml",description:"Show the ML task-similarity router state (learned outcomes per provider, kNN over task features). Action: reset",flags:["--json"]},{name:"model quota",description:"Show the central quota ledger (tokens/requests per provider × model, reset windows, parked state). Actions: reset | set <provider> | clear <provider>",flags:["--cost-usd <cost_usd>","--json","--requests <requests>","--tokens <tokens>","--window-ms <window_ms>"]}]},{name:"benchmark",description:"Run standardized model benchmarks against coding tasks",commands:[{name:"benchmark run",description:"Run the benchmark suite",flags:["--budget <budget>","--format <format>","--model <model>","--provider <provider>","--routing","--tasks <tasks>"]},{name:"benchmark list",description:"List available benchmark tasks",flags:[]},{name:"benchmark results",description:"Show previous benchmark results",flags:["--compare","--format <format>","--last"]},{name:"benchmark clear",description:"Clear all benchmark data",flags:[]}]},{name:"eval",description:"Run the Agent-Nuvira evaluation framework — measures if the agent is actually improving",commands:[{name:"eval run",description:"Run the evaluation suite",flags:["--budget <budget>","--engine <engine>","--format <format>","--keep-workspaces","--model <model>","--pace","--provider <provider>","--routing","--suite <suite>","--tasks <tasks>"]},{name:"eval verify-seeds",description:"Prove every seeded bug is genuinely broken (and genuinely fixable) — no provider needed",flags:["--tasks <tasks>"]},{name:"eval list",description:"List available eval tasks",flags:[]},{name:"eval results",description:"Show previous eval runs",flags:["--compare","--format <format>","--last"]},{name:"eval score",description:"Show the evaluation scoring rules",flags:[]},{name:"eval clear",description:"Clear all eval data",flags:[]}]},{name:"sandbox",description:"Manage Docker sandbox isolation for code execution",commands:[{name:"sandbox status",description:"Check Docker availability and sandbox status",flags:[]},{name:"sandbox config",description:"Show or update sandbox configuration",flags:["--cpu <cpu>","--disable","--disk <disk>","--enable","--image <image>","--memory <memory>","--network","--timeout <timeout>"]},{name:"sandbox images",description:"List available pre-defined sandbox images",flags:[]},{name:"sandbox run",description:"Run a command inside a new sandbox container",flags:["--cpu <cpu>","--image <image>","--memory <memory>","--network","--project <project>","--timeout <timeout>"]},{name:"sandbox cleanup",description:"Destroy all active sandbox containers",flags:[]}]},{name:"doctor",description:"Run diagnostic checks on all provider configurations and system health",commands:[]},{name:"memory",description:"Manage agent memory store — compression, pruning, and optimization",commands:[{name:"memory stats",description:"Show memory store statistics",flags:[]},{name:"memory optimize",description:"Run automatic memory compression and pruning",flags:["--aggressive","--dry-run"]},{name:"memory prune",description:"Prune old or low-quality trajectories",flags:["--max-age <max_age>","--max-count <max_count>","--min-score <min_score>","--verbose"]},{name:"memory summarize",description:"Summarize old trajectories by merging similar ones",flags:["--retention <retention>","--verbose"]},{name:"memory info",description:"Show detailed compression analysis",flags:[]},{name:"memory backend",description:"Show the active vector-search backend and why it was chosen",flags:["--check"]},{name:"memory list",description:"List all memory entries (facts, preferences, lessons, observations)",flags:["--limit <limit>","--type <type>"]},{name:"memory search",description:"Search memory entries by content",flags:["--limit <limit>","--type <type>"]},{name:"memory add",description:"Add a memory entry",flags:["--tags <tags>","--type <type>"]},{name:"memory delete",description:"Delete a memory entry by ID",flags:[]},{name:"memory export",description:"Export all memories to a JSON file",flags:["--output <output>"]},{name:"memory import",description:"Import memories from a JSON file",flags:["--merge"]},{name:"memory facts",description:"Fact & preference memory (project-scoped, cross-session)",flags:[]},{name:"memory facts list",description:"List facts, optionally for a project (git slug or cwd:<hash>)",flags:["--project <project>"]},{name:"memory facts add",description:"Manually store a fact for the current project",flags:["--project <project>","--tags <tags>"]},{name:"memory facts stats",description:"Show fact-store statistics",flags:[]},{name:"memory clear",description:"Clear all stored trajectories and reset memory",flags:["--force"]}]},{name:"dashboard",description:"Launch the web-based dashboard for visualizing agent execution and system status",commands:[{name:"dashboard stop",description:"Stop a running dashboard gracefully (SIGTERM — from any terminal)",flags:["--port <port>"]}]},{name:"agent",description:"Scaffold and manage custom agent-nuvira agents",commands:[{name:"agent create",description:"Create a new custom agent project from a template",flags:["--agent-name <agent_name>","--description <description>","--dir <dir>"]},{name:"agent list",description:"List all discovered custom agent plugins",flags:[]},{name:"agent info",description:"Show details about a discovered agent plugin",flags:[]}]},{name:"federation",description:"Connect to and manage remote agent instances",commands:[{name:"federation status",description:"Show federation connection status and configuration",flags:[]},{name:"federation start",description:"Start the federation server (listens for incoming connections)",flags:["--auth <auth>","--daemon","--host <host>","--oidc-public-key <oidc_public_key>","--port <port>","--secret <secret>"]},{name:"federation connect",description:"Connect to a remote federation server",flags:["--port <port>","--secret <secret>"]},{name:"federation disconnect",description:"Disconnect from the remote federation server",flags:[]},{name:"federation run",description:"Run a task on the remote federation server",flags:["--agent <agent>","--model <model>","--no-stream","--provider <provider>","--timeout <timeout>"]},{name:"federation health",description:"Check the health of the remote federation server",flags:[]},{name:"federation config",description:"Show or update federation configuration",flags:["--set-port <set_port>","--set-secret <set_secret>","--show"]},{name:"federation a2a",description:"A2A (Agent-to-Agent) protocol — discover and connect to external A2A-compliant agents",flags:[]},{name:"federation a2a discover",description:"Discover an A2A-compliant agent and fetch its AgentCard",flags:[]},{name:"federation a2a start",description:"Start the A2A server (listens for incoming A2A connections)",flags:["--host <host>","--port <port>"]},{name:"federation a2a status",description:"Check the health and status of a remote A2A agent",flags:[]},{name:"federation a2a run",description:"Delegate a task to a remote A2A-compliant agent",flags:["--agent <agent>","--skill <skill>","--timeout <timeout>"]}]},{name:"team",description:"Team collaboration — shared config, git-synced memory, and review workflow",commands:[{name:"team init",description:"Initialize team configuration in the working directory",flags:["--branch <branch>","--repo <repo>"]},{name:"team join",description:"Clone and join an existing team repository",flags:[]},{name:"team sync",description:"Sync team memory with remote (pull latest + push local changes)",flags:[]},{name:"team status",description:"Show team configuration and memory status",flags:[]},{name:"team share",description:"Share local trajectories and patterns with the team",flags:[]},{name:"team review",description:"Manage review bundles — agent PR → review → merge workflow",flags:[]},{name:"team review list",description:"List all review bundles",flags:["--limit <limit>"]},{name:"team review show",description:"Show a specific review bundle with full details",flags:[]},{name:"team review approve",description:"Approve a review bundle (sets status to approved)",flags:["--message <message>"]},{name:"team review request-changes",description:"Request changes on a review bundle",flags:[]},{name:"team review reject",description:"Reject a review bundle",flags:[]},{name:"team review merge",description:"Merge an approved review into the working directory",flags:[]},{name:"team review create",description:"Create a review bundle from specified files",flags:["--files <files>","--model <model>","--provider <provider>"]}]},{name:"sdk",description:"Create and manage custom agents with the Agent-Nuvira SDK",commands:[{name:"sdk scaffold",description:"Generate a new custom agent project",flags:["--agent-type <agent_type>","--template <template>"]},{name:"sdk templates",description:"List available scaffold templates",flags:[]},{name:"sdk info",description:"Show SDK package info and version",flags:[]},{name:"sdk register",description:"Register a custom agent with the orchestrator",flags:["--icon <icon>","--orchestrator-path <orchestrator_path>"]},{name:"sdk unregister",description:"Remove a custom agent from the orchestrator",flags:["--orchestrator-path <orchestrator_path>"]}]},{name:"provider",description:"List and check health of all inference providers",commands:[{name:"provider list",description:"Show all providers with color-coded status table",flags:["--all"]},{name:"provider health",description:"Show detailed health checks for one or all providers",flags:["--verbose","--watch"]}]},{name:"security",description:"Scan code, prompts, or files for security issues",commands:[{name:"security scan",description:"Scan for PII, injection attempts, or dangerous code patterns",flags:["--code","--file <file>","--generated","--json","--pii","--prompt","--stdin","--strict"]}]},{name:"audit",description:"Verify and export the tamper-evident (hash-chained) audit trail (P6 M6.3)",commands:[{name:"audit verify",description:"Verify hash-chain integrity of audit stores (tamper detection)",flags:["--file <file>","--json"]},{name:"audit export",description:"Export an audit store as SIEM-friendly CEF lines",flags:["--file <file>","--out <out>"]}]},{name:"sbom",description:"Generate and verify the CycloneDX software bill of materials (P6 M6.6)",commands:[]},{name:"feedback",description:"Record, view, and manage user feedback on agent outputs",commands:[{name:"feedback record",description:"Record feedback for a trajectory (interactive)",flags:["--comment <comment>","--negative","--neutral","--positive"]},{name:"feedback list",description:"Show recent feedback entries",flags:["--limit <limit>","--trajectory <trajectory>"]},{name:"feedback stats",description:"Show aggregated feedback statistics",flags:[]},{name:"feedback clear",description:"Clear all feedback data",flags:[]}]},{name:"nlu",description:"NLU request understanding — debug intent/entity/action resolution",commands:[{name:"nlu debug",description:"Debug how a request is understood (rule path + optional LLM verify)",flags:["--llm"]},{name:"nlu learnings",description:"Show the routing corrections learned from CONFIRMED misreadings (the agent improving itself)",flags:["--forget <forget>","--json"]}]},{name:"intent",description:"Plain-English → CLI routing — resolve an ask into the exact `nuvira` command(s) to run",commands:[{name:"intent resolve",description:'Resolve a plain-English ask (e.g. "stop the dashboard", "add Rahul to whatsapp") into CLI commands',flags:["--json","--semantic"]},{name:"intent eval",description:"Score deterministic vs semantic matching over a labeled ask corpus (novel phrasings included)",flags:["--json"]}]},{name:"code-map",description:"Project symbol map — functions, classes, methods with line numbers (AST engine)",commands:[]},{name:"tools",description:"Inspect the agent tool registry (pipeline + experience tools)",commands:[{name:"tools list",description:"List every registered tool (the H1 tool-calling surface)",flags:[]},{name:"tools show",description:"Show a tool's description and input schema",flags:[]},{name:"tools toolsets",description:"List toolset groups (capability gating) with enabled state; enable/disable a group",flags:["--disable <disable>","--enable <enable>"]}]},{name:"parity",description:"Surface-parity harness — prove the same experience on chat, execute, dashboard, gateway and subagents",commands:[{name:"parity surfaces",description:"Compare the surface registry against the real import graph",flags:[]},{name:"parity debt",description:"Check the anti-silo debt ratchet (observed surface debt must equal the frozen list)",flags:[]},{name:"parity matrix",description:"Show every capability × surface and any unproven `supported` claim",flags:[]},{name:"parity faults",description:"List the declared faults the harness can inject, and what each one proves",flags:[]},{name:"parity run",description:"Drive all five surfaces through the real harness and report the verdict",flags:[]}]},{name:"session",description:"Project-scoped session continuity (debug surface — `continue` is the primary path)",commands:[{name:"session list",description:"List recent sessions, optionally filtered by project + time range",flags:["--limit <limit>","--project <project>","--since <since>"]},{name:"session summarize",description:"Show summary + metadata for one session (transcript: nuvira history show)",flags:[]},{name:"session resume",description:"Run D1 auto-recall for a project and print the recall card",flags:["--project <project>","--since <since>"]}]},{name:"marketplace",description:"Browse and install community plugins and workflow templates",commands:[{name:"marketplace browse",description:"Browse all available marketplace items",flags:["--plugins","--refresh","--workflows"]},{name:"marketplace search",description:"Search across plugins and workflow templates",flags:[]},{name:"marketplace install",description:"Install a workflow template from the registry",flags:[]},{name:"marketplace info",description:"Show detailed information about a marketplace item",flags:[]}]},{name:"mcp",description:"Manage MCP (Model Context Protocol) server connections",commands:[{name:"mcp list",description:"List all discovered MCP servers and their tools",flags:[]},{name:"mcp connect",description:"Connect to an MCP server",flags:["--all"]},{name:"mcp call",description:"Call a tool on an MCP server",flags:["--args <args>","--server <server>"]},{name:"mcp info",description:"Show detailed information for an MCP server",flags:[]},{name:"mcp refresh",description:"Re-discover and reconnect to all MCP servers",flags:[]},{name:"mcp catalog",description:"List the curated MCP server catalog (vetted, exact-version pins)",flags:["--search <search>"]},{name:"mcp install",description:"Install a vetted MCP server from the catalog (writes ~/.nuvira/mcp/<name>.json)",flags:["--env <env>"]},{name:"mcp uninstall",description:"Remove an installed MCP server config",flags:[]},{name:"mcp serve",description:"Expose the agent's H1 tools as an MCP server over stdio (MCP clients / IDEs / other agents can connect)",flags:["--with <with>"]}]},{name:"ci",description:"Headless CI/CD mode — structured JSON output and exit codes for pipelines",commands:[{name:"ci execute",description:"Execute a goal and emit JSON result (exit 0 = success, 1 = failure)",flags:["--context-limit <context_limit>","--context-prune <context_prune>","--github-annotations","--memory","--model <model>","--planner-model <planner_model>","--provider <provider>","--reviewer-model <reviewer_model>","--sandbox","--timeout <timeout>","--writer-model <writer_model>"]},{name:"ci check",description:"Run a gate check (exit 0 = pass, 1 = fail) — minimal output, ideal for workflow gates",flags:["--model <model>","--provider <provider>","--verbose"]},{name:"ci review",description:"Review one or more files and emit JSON findings",flags:["--context <context>","--format <format>","--model <model>","--provider <provider>"]}]},{name:"publish",description:"Autonomous publish workflow — version, build, publish to npm & GitHub",commands:[]},{name:"credentials",description:"Store GitHub/npm release credentials so the agent can release without re-entering them",commands:[{name:"credentials status",description:"Show which release credentials are available, and where each came from",flags:[]},{name:"credentials set",description:"Store a credential in the nuvira credential store",flags:["--stdin","--value <value>"]},{name:"credentials forget",description:"Delete a stored credential",flags:[]},{name:"credentials verify",description:"Check the stored GitHub and npm tokens against the live services",flags:[]}]},{name:"bedrock",description:"AWS Bedrock setup and management (dedicated onboarding for Bedrock)",commands:[{name:"bedrock setup",description:"Interactive wizard to configure AWS Bedrock (credentials, region, model access)",flags:[]},{name:"bedrock status",description:"Show current Bedrock configuration and connectivity status",flags:[]},{name:"bedrock test",description:"Probe Bedrock models and test inference",flags:["--region <region>"]}]},{name:"phase",description:"Phase-wise project scope execution — multi-goal pipelines",commands:[{name:"phase create",description:"Create a new phase scope with ordered goals",flags:["--output <output>"]},{name:"phase execute",description:"Execute a phase scope from start to finish",flags:["--dry-run","--model <model>","--non-interactive","--provider <provider>","--skip-tests","--verbose"]},{name:"phase resume",description:"Resume a saved phase scope from where it left off",flags:["--model <model>","--provider <provider>","--skip-tests","--verbose"]},{name:"phase status",description:"Show progress of a phase scope",flags:[]},{name:"phase delete",description:"Delete a saved phase scope",flags:[]},{name:"phase list",description:"List all saved phase scopes",flags:[]}]},{name:"retrieval",description:"Vector retrieval — token-efficient context via local embeddings",commands:[{name:"retrieval stats",description:"Show token-savings transparency (how many tokens retrieval saved)",flags:[]},{name:"retrieval index",description:"Index a repo/file into the retrieval store (chunks embedded locally)",flags:[]},{name:"retrieval query",description:"Semantic search over the indexed repo (top-k chunks)",flags:[]},{name:"retrieval clear",description:"Clear the retrieval index and token-savings stats",flags:[]}]},{name:"trace",description:"Inspect and replay per-step reasoning traces (every LLM call in a pipeline)",commands:[{name:"trace list",description:"Show recent traces",flags:["--limit <limit>"]},{name:"trace show",description:"Show a single trace (goal, timing, step summary)",flags:[]},{name:"trace replay",description:"Step-by-step replay of a trace — every LLM call with prompt digest, model, tokens, latency, and routing",flags:["--full"]},{name:"trace clear",description:"Delete all stored traces",flags:[]}]},{name:"continuity",description:"Session continuity — what is stored, and how to forget it",commands:[{name:"continuity list",description:"Show the continuity switches, stored sessions, and the semantic recall index",flags:[]},{name:"continuity clear",description:"Forget stored continuity data (no flags = both sessions and recall)",flags:["--recall","--sessions"]}]},{name:"website",description:"Open the Agent-Nuvira website — capabilities, commands, docs, setup",commands:[]}],mc={commandCount:Voe,groupCount:Yoe,groups:Xoe},tE=mc.groups;function Qoe(e,t){return e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)}function Zoe({onPick:e}){const[t,n]=k.useState(""),r=k.useId(),a=t.trim().toLowerCase(),s=k.useMemo(()=>a?tE.map(l=>l.name.toLowerCase().includes(a)?l:{...l,commands:l.commands.filter(c=>Qoe(c,a))}).filter(l=>l.commands.length>0):tE,[a]),o=s.reduce((l,c)=>l+c.commands.length,0);return i.jsxs("section",{className:"command-browser",children:[i.jsxs("div",{className:"command-browser-head",children:[i.jsx("h2",{className:"section-title command-browser-title",children:"Browse commands"}),i.jsx("p",{className:"command-browser-count",children:a?`${o} of ${mc.commandCount} commands match “${t.trim()}”`:`${mc.commandCount} commands in ${mc.groupCount} groups`})]}),i.jsx("label",{className:"sr-only",htmlFor:r,children:"Filter commands"}),i.jsx("input",{id:r,type:"search",className:"admin-input command-browser-search",placeholder:"Filter commands — e.g. eval, memory, gateway status",value:t,onChange:l=>n(l.target.value),autoComplete:"off",spellCheck:!1}),s.length===0?i.jsxs("p",{className:"command-browser-empty",children:["No command matches “",t.trim(),"”. Clear the filter to see all ",mc.groupCount," groups."]}):i.jsx("div",{className:"command-browser-groups",children:s.map(l=>i.jsxs("details",{className:"command-group",open:a?!0:void 0,children:[i.jsxs("summary",{className:"command-group-summary",children:[i.jsx("code",{className:"command-group-name",children:l.name}),i.jsx("span",{className:"command-group-description",children:l.description}),i.jsx("span",{className:"command-group-count",children:l.commands.length})]}),i.jsx("ul",{className:"command-list",children:l.commands.map(c=>i.jsx("li",{className:"command-item",children:i.jsxs("button",{type:"button",className:"command-use",onClick:()=>e(c.name),title:`Insert “${c.name}” into the command box`,children:[i.jsx("span",{className:"command-item-name",children:c.name}),i.jsx("span",{className:"command-item-description",children:c.description}),c.flags.length>0&&i.jsx("span",{className:"command-item-flags",children:c.flags.map(u=>i.jsx("code",{children:u},u))})]})},c.name))})]},`${l.name}:${a?"filtering":"browsing"}`))})]})}const nE={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error"};function rE(e){switch(e){case"done":return"task-status-done";case"running":return"task-status-running";case"failed":return"task-status-failed";case"cancelled":return"task-status-cancelled";case"timeout":return"task-status-timeout";default:return"task-status-error"}}function Joe(e){const t=[];let n="",r=null;for(const a of e.trim())r?a===r?r=null:n+=a:a==='"'||a==="'"?r=a:/\s/.test(a)?n&&(t.push(n),n=""):n+=a;return n&&t.push(n),t}function aE(e){return e===null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function ele(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function tle(){const[e,t]=k.useState(null),[n,r]=k.useState(""),[a,s]=k.useState(300),[o,l]=k.useState(!1),[c,u]=k.useState(""),[d,f]=k.useState(null),[h,p]=k.useState([]),[g,m]=k.useState(!0),y=k.useRef(null),v=k.useRef(null),x=k.useRef(null),S=k.useCallback(async()=>{const A=await Q.listTasks();A&&p(A.tasks)},[]);k.useEffect(()=>{Q.fetchAdminAuthStatus().then(A=>{t(A?{configured:A.configured,authenticated:A.authenticated,role:A.role??null}:{configured:!1,authenticated:!1,role:null}),A!=null&&A.authenticated&&S()})},[S]),k.useEffect(()=>{var A,M;if(g&&(d==null?void 0:d.status)==="running")try{(M=(A=y.current)==null?void 0:A.scrollIntoView)==null||M.call(A,{block:"end"})}catch{}},[d==null?void 0:d.logs.length,d==null?void 0:d.status,g]),k.useEffect(()=>()=>{var A;return(A=x.current)==null?void 0:A.call(x)},[]);const j=k.useCallback((A,M)=>{var B;if((B=x.current)==null||B.call(x),f(A),u(""),!M)return;const R=Q.subscribeTask(A.id,{onLog:L=>f(F=>F&&F.id===A.id?{...F,logs:[...F.logs,L]}:F),onStatus:L=>f(F=>F&&F.id===A.id?{...F,status:L}:F)});x.current=R},[]),w=k.useCallback(async()=>{const A=Joe(n);if(A.length===0){u("Type a command first — e.g. `eval run --task smoke-test` or `gateway status`.");return}l(!0),u("");const M=await Q.startTask(A,a*1e3);if(l(!1),!M.ok||!M.task){u(M.error||"Failed to start task.");return}r(""),S(),j(M.task,!0)},[n,a,j,S]),b=k.useCallback(async A=>{await Q.cancelTask(A)},[]),N=k.useCallback(A=>{var M;r(`${A} `),u(""),(M=v.current)==null||M.focus()},[]),E=k.useCallback(async A=>{const M=await Q.getTask(A);M!=null&&M.task&&j(M.task,!1)},[j]),T=k.useCallback(()=>{var A;(A=x.current)==null||A.call(x),f(null)},[]);return e?e.authenticated?i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"🚀",title:"Command Console"}),i.jsx("p",{className:"admin-subtitle",children:"Run any agent-nuvira command — the same CLI, executed by the dashboard. Messaging, skills, tools, eval, memory, traces and more."}),i.jsxs("form",{className:"task-run-form",onSubmit:A=>{A.preventDefault(),w()},children:[i.jsx("input",{ref:v,className:"admin-input task-cmd-input",placeholder:"eval run --task smoke-test · gateway status · skill list · memory stats",value:n,onChange:A=>r(A.target.value),autoComplete:"off",spellCheck:!1}),i.jsxs("select",{className:"admin-input task-timeout-select",title:"Task timeout",value:a,onChange:A=>s(Number(A.target.value)),children:[i.jsx("option",{value:60,children:"1 min"}),i.jsx("option",{value:300,children:"5 min"}),i.jsx("option",{value:600,children:"10 min"}),i.jsx("option",{value:1800,children:"30 min"})]}),i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||n.trim()==="",children:o?"⏳ Starting…":"▶ Run"})]}),c&&i.jsx("div",{className:"admin-error",children:c}),i.jsx("p",{className:"task-hint",children:"Long-running commands stream their output live. Runs are capped at the chosen timeout and can be cancelled."}),i.jsx(Zoe,{onPick:N}),d&&i.jsxs("div",{className:"task-console-wrap",children:[i.jsxs("div",{className:"task-console-header",children:[i.jsx("code",{className:"task-console-cmd",children:d.command}),i.jsx("span",{className:`task-status ${rE(d.status)}`,children:nE[d.status]}),i.jsxs("span",{className:"task-meta",children:["exit ",d.exitCode??"—"," · ",aE(d.durationMs)]}),d.status==="running"&&i.jsx("button",{className:"admin-mini-btn task-cancel-btn",onClick:()=>void b(d.id),children:"⏹ Cancel"}),i.jsx("button",{className:"admin-mini-btn",onClick:T,children:"✕ Close"})]}),i.jsxs("div",{className:"task-console",children:[d.logs.map((A,M)=>i.jsx("div",{className:`task-line task-line-${A.stream}`,children:A.text},M)),d.logs.length===0&&d.status==="running"&&i.jsx("div",{className:"task-line task-line-system",children:"⏳ waiting for output…"}),i.jsx("div",{ref:y})]}),i.jsxs("label",{className:"task-autoscroll",children:[i.jsx("input",{type:"checkbox",checked:g,onChange:A=>m(A.target.checked)})," auto-scroll"]})]}),i.jsx("h2",{className:"task-history-title",children:"History"}),h.length===0?i.jsx("div",{className:"empty-state",children:"No tasks yet — run your first command above."}):i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table task-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Command"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Exit"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"When"})]})}),i.jsx("tbody",{children:h.map(A=>i.jsxs("tr",{className:(d==null?void 0:d.id)===A.id?"task-row-active":"",onClick:()=>void E(A.id),children:[i.jsx("td",{children:i.jsx("code",{children:A.command})}),i.jsx("td",{children:i.jsx("span",{className:`task-status ${rE(A.status)}`,children:nE[A.status]})}),i.jsx("td",{children:A.exitCode??"—"}),i.jsx("td",{children:aE(A.durationMs)}),i.jsx("td",{children:ele(A.startedAt)})]},A.id))})]})})]}):i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"🚀",title:"Command Console"}),i.jsxs("div",{className:"empty-state",children:[i.jsxs("p",{children:[i.jsx("strong",{children:"Log in to run tasks."})," The console executes commands on this machine, so it needs an admin session (like the Agent Hub toggles)."]}),i.jsx("p",{children:e.configured?i.jsx(Jt,{className:"admin-refresh-btn",to:"/admin",children:"🔐 Log in"}):i.jsx(Jt,{className:"admin-refresh-btn",to:"/admin",children:"🔐 Create admin account"})})]})]}):i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"🚀",title:"Command Console"}),i.jsx("div",{className:"loading-state",children:"Loading…"})]})}function nle(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const rle=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ale=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ile={};function iE(e,t){return(ile.jsx?ale:rle).test(e)}const sle=/[ \t\n\f\r]/g;function ole(e){return typeof e=="object"?e.type==="text"?sE(e.value):!1:sE(e)}function sE(e){return e.replace(sle,"")===""}class Ju{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ju.prototype.normal={};Ju.prototype.property={};Ju.prototype.space=void 0;function lM(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Ju(n,r,t)}function _b(e){return e.toLowerCase()}class Kn{constructor(t,n){this.attribute=n,this.property=t}}Kn.prototype.attribute="";Kn.prototype.booleanish=!1;Kn.prototype.boolean=!1;Kn.prototype.commaOrSpaceSeparated=!1;Kn.prototype.commaSeparated=!1;Kn.prototype.defined=!1;Kn.prototype.mustUseProperty=!1;Kn.prototype.number=!1;Kn.prototype.overloadedBoolean=!1;Kn.prototype.property="";Kn.prototype.spaceSeparated=!1;Kn.prototype.space=void 0;let lle=0;const Ie=Ms(),Lt=Ms(),Ab=Ms(),ce=Ms(),at=Ms(),ps=Ms(),Xn=Ms();function Ms(){return 2**++lle}const Cb=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Lt,commaOrSpaceSeparated:Xn,commaSeparated:ps,number:ce,overloadedBoolean:Ab,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),$g=Object.keys(Cb);class Zw extends Kn{constructor(t,n,r,a){let s=-1;if(super(t,n),oE(this,"space",a),typeof r=="number")for(;++s<$g.length;){const o=$g[s];oE(this,$g[s],(r&Cb[o])===Cb[o])}}}Zw.prototype.defined=!0;function oE(e,t,n){n&&(e[t]=n)}function Nl(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const s=new Zw(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[_b(r)]=r,n[_b(s.attribute)]=r}return new Ju(t,n,e.space)}const cM=Nl({properties:{ariaActiveDescendant:null,ariaAtomic:Lt,ariaAutoComplete:null,ariaBusy:Lt,ariaChecked:Lt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:Lt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:Lt,ariaFlowTo:at,ariaGrabbed:Lt,ariaHasPopup:null,ariaHidden:Lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:ce,ariaLive:null,ariaModal:Lt,ariaMultiLine:Lt,ariaMultiSelectable:Lt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:Lt,ariaReadOnly:Lt,ariaRelevant:null,ariaRequired:Lt,ariaRoleDescription:at,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:Lt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function uM(e,t){return t in e?e[t]:t}function dM(e,t){return uM(e,t.toLowerCase())}const cle=Nl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ps,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:at,autoFocus:Ie,autoPlay:Ie,blocking:at,capture:null,charSet:null,checked:Ie,cite:null,className:at,closedBy:null,colorSpace:null,cols:ce,colSpan:ce,command:null,commandFor:null,content:null,contentEditable:Lt,controls:Ie,controlsList:at,coords:ce|ps,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:Ab,draggable:Lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:at,height:ce,hidden:Ab,high:ce,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:at,itemRef:at,itemScope:Ie,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:ce,pattern:null,ping:at,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:at,required:Ie,reversed:Ie,rows:ce,rowSpan:ce,sandbox:at,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:Lt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Lt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:Lt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:ps,part:at,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:dM}),ule=Nl({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:Xn,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:at,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:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,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:ps,g2:ps,glyphName:ps,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:Xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,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:ce,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:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xn,rev:Xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xn,requiredFeatures:Xn,requiredFonts:Xn,requiredFormats:Xn,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:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:Xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xn,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:uM}),fM=Nl({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()}}),hM=Nl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dM}),pM=Nl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),dle={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"},fle=/[A-Z]/g,lE=/-[a-z]/g,hle=/^data[-\w.:]+$/i;function ple(e,t){const n=_b(t);let r=t,a=Kn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&hle.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(lE,gle);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!lE.test(s)){let o=s.replace(fle,mle);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=Zw}return new a(r,t)}function mle(e){return"-"+e.toLowerCase()}function gle(e){return e.charAt(1).toUpperCase()}const vle=lM([cM,cle,fM,hM,pM],"html"),Jw=lM([cM,ule,fM,hM,pM],"svg");function yle(e){return e.join(" ").trim()}var e0={},cE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ble=/\n/g,xle=/^\s*/,wle=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Sle=/^:\s*/,kle=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,jle=/^[;\s]*/,Nle=/^\s+|\s+$/g,Ele=`
|
|
165
|
+
`,uE="/",dE="*",Ji="",_le="comment",Ale="declaration";function Cle(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function a(g){var m=g.match(ble);m&&(n+=m.length);var y=g.lastIndexOf(Ele);r=~y?g.length-y:r+g.length}function s(){var g={line:n,column:r};return function(m){return m.position=new o(g),u(),m}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(g){var m=new Error(t.source+":"+n+":"+r+": "+g);if(m.reason=g,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function c(g){var m=g.exec(e);if(m){var y=m[0];return a(y),e=e.slice(y.length),m}}function u(){c(xle)}function d(g){var m;for(g=g||[];m=f();)m!==!1&&g.push(m);return g}function f(){var g=s();if(!(uE!=e.charAt(0)||dE!=e.charAt(1))){for(var m=2;Ji!=e.charAt(m)&&(dE!=e.charAt(m)||uE!=e.charAt(m+1));)++m;if(m+=2,Ji===e.charAt(m-1))return l("End of comment missing");var y=e.slice(2,m-2);return r+=2,a(y),e=e.slice(m),r+=2,g({type:_le,comment:y})}}function h(){var g=s(),m=c(wle);if(m){if(f(),!c(Sle))return l("property missing ':'");var y=c(kle),v=g({type:Ale,property:fE(m[0].replace(cE,Ji)),value:y?fE(y[0].replace(cE,Ji)):Ji});return c(jle),v}}function p(){var g=[];d(g);for(var m;m=h();)m!==!1&&(g.push(m),d(g));return g}return u(),p()}function fE(e){return e?e.replace(Nle,Ji):Ji}var Tle=Cle,Ole=li&&li.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e0,"__esModule",{value:!0});e0.default=Rle;const Ple=Ole(Tle);function Rle(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Ple.default)(e),a=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;a?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var dm={};Object.defineProperty(dm,"__esModule",{value:!0});dm.camelCase=void 0;var Mle=/^--[a-zA-Z0-9_-]+$/,Ile=/-([a-z])/g,$le=/^[^-]+$/,Lle=/^-(webkit|moz|ms|o|khtml)-/,Dle=/^-(ms)-/,Ble=function(e){return!e||$le.test(e)||Mle.test(e)},zle=function(e,t){return t.toUpperCase()},hE=function(e,t){return"".concat(t,"-")},Fle=function(e,t){return t===void 0&&(t={}),Ble(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Dle,hE):e=e.replace(Lle,hE),e.replace(Ile,zle))};dm.camelCase=Fle;var Ule=li&&li.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Wle=Ule(e0),Hle=dm;function Tb(e,t){var n={};return!e||typeof e!="string"||(0,Wle.default)(e,function(r,a){r&&a&&(n[(0,Hle.camelCase)(r,t)]=a)}),n}Tb.default=Tb;var Gle=Tb;const qle=Qe(Gle),mM=gM("end"),t0=gM("start");function gM(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Kle(e){const t=t0(e),n=mM(e);if(t&&n)return{start:t,end:n}}function Oc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?pE(e.position):"start"in e||"end"in e?pE(e):"line"in e||"column"in e?Ob(e):""}function Ob(e){return mE(e&&e.line)+":"+mE(e&&e.column)}function pE(e){return Ob(e&&e.start)+"-"+Ob(e&&e.end)}function mE(e){return e&&typeof e=="number"?e:1}class _n extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?a=t:!s.cause&&t&&(o=!0,a=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=l?l.line:void 0,this.name=Oc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}_n.prototype.file="";_n.prototype.name="";_n.prototype.reason="";_n.prototype.message="";_n.prototype.stack="";_n.prototype.column=void 0;_n.prototype.line=void 0;_n.prototype.ancestors=void 0;_n.prototype.cause=void 0;_n.prototype.fatal=void 0;_n.prototype.place=void 0;_n.prototype.ruleId=void 0;_n.prototype.source=void 0;const n0={}.hasOwnProperty,Vle=new Map,Yle=/[A-Z]/g,Xle=new Set(["table","tbody","thead","tfoot","tr"]),Qle=new Set(["td","th"]),vM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Zle(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=sce(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");r=ice(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Jw:vle,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=yM(a,e,void 0);return s&&typeof s!="string"?s:a.create(e,a.Fragment,{children:s||void 0},void 0)}function yM(e,t,n){if(t.type==="element")return Jle(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ece(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return nce(e,t,n);if(t.type==="mdxjsEsm")return tce(e,t);if(t.type==="root")return rce(e,t,n);if(t.type==="text")return ace(e,t)}function Jle(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=Jw,e.schema=a),e.ancestors.push(t);const s=xM(e,t.tagName,!1),o=oce(e,t);let l=a0(e,t);return Xle.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!ole(c):!0})),bM(e,o,s,t),r0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function ece(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}$u(e,t.position)}function tce(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$u(e,t.position)}function nce(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=Jw,e.schema=a),e.ancestors.push(t);const s=t.name===null?e.Fragment:xM(e,t.name,!0),o=lce(e,t),l=a0(e,t);return bM(e,o,s,t),r0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function rce(e,t,n){const r={};return r0(r,a0(e,t)),e.create(t,e.Fragment,r,n)}function ace(e,t){return t.value}function bM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function r0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ice(e,t,n){return r;function r(a,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function sce(e,t){return n;function n(r,a,s,o){const l=Array.isArray(s.children),c=t0(r);return t(a,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function oce(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&n0.call(t.properties,a)){const s=cce(e,a,t.properties[a]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Qle.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function lce(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else $u(e,t.position);else{const a=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else $u(e,t.position);else s=r.value===null?!0:r.value;n[a]=s}return n}function a0(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:Vle;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const u=a.get(c)||0;o=c+"-"+u,a.set(c,u+1)}}const l=yM(e,s,o);l!==void 0&&n.push(l)}return n}function cce(e,t,n){const r=ple(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?nle(n):yle(n)),r.property==="style"){let a=typeof n=="object"?n:uce(e,String(n));return e.stylePropertyNameCase==="css"&&(a=dce(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?dle[r.property]||r.property:r.attribute,n]}}function uce(e,t){try{return qle(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new _n("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=vM+"#cannot-parse-style-attribute",a}}function xM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let s=-1,o;for(;++s<a.length;){const l=iE(a[s])?{type:"Identifier",name:a[s]}:{type:"Literal",value:a[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=o}else r=iE(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return n0.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);$u(e)}function $u(e,t){const n=new _n("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=vM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function dce(e){const t={};let n;for(n in e)n0.call(e,n)&&(t[fce(n)]=e[n]);return t}function fce(e){let t=e.replace(Yle,hce);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function hce(e){return"-"+e.toLowerCase()}const Lg={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"]},pce={};function i0(e,t){const n=pce,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return wM(e,r,a)}function wM(e,t,n){if(mce(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 gE(e.children,t,n)}return Array.isArray(e)?gE(e,t,n):""}function gE(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=wM(e[a],t,n);return r.join("")}function mce(e){return!!(e&&typeof e=="object")}const vE=document.createElement("i");function s0(e){const t="&"+e+";";vE.innerHTML=t;const n=vE.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ar(e,t,n,r){const a=e.length;let s=0,o;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function br(e,t){return e.length>0?(ar(e,e.length,0,t),e):t}const yE={}.hasOwnProperty;function SM(e){const t={};let n=-1;for(;++n<e.length;)gce(t,e[n]);return t}function gce(e,t){let n;for(n in t){const a=(yE.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){yE.call(a,o)||(a[o]=[]);const l=s[o];vce(a[o],Array.isArray(l)?l:l?[l]:[])}}}function vce(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ar(e,0,0,r)}function kM(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.fromCodePoint(n)}function Gr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Rn=Li(/[A-Za-z]/),Nn=Li(/[\dA-Za-z]/),yce=Li(/[#-'*+\--9=?A-Z^-~]/);function Yh(e){return e!==null&&(e<32||e===127)}const Pb=Li(/\d/),bce=Li(/[\dA-Fa-f]/),xce=Li(/[!-/:-@[-`{-~]/);function Ee(e){return e!==null&&e<-2}function st(e){return e!==null&&(e<0||e===32)}function De(e){return e===-2||e===-1||e===32}const fm=Li(new RegExp("\\p{P}|\\p{S}","u")),Es=Li(/\s/);function Li(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function El(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&Nn(e.charCodeAt(n+1))&&Nn(e.charCodeAt(n+2)))a=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),a=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+a+1,o=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function We(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return De(c)?(e.enter(n),l(c)):t(c)}function l(c){return De(c)&&s++<a?(e.consume(c),l):(e.exit(n),t(c))}}const wce={tokenize:Sce};function Sce(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),We(e,t,"linePrefix")}function a(l){return e.enter("paragraph"),s(l)}function s(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ee(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),o)}}const kce={tokenize:jce},bE={tokenize:Nce};function jce(e){const t=this,n=[];let r=0,a,s,o;return l;function l(S){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,c,u)(S)}return u(S)}function c(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&x();const j=t.events.length;let w=j,b;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){b=t.events[w][1].end;break}v(r);let N=j;for(;N<t.events.length;)t.events[N][1].end={...b},N++;return ar(t.events,w+1,0,t.events.slice(j)),t.events.length=N,u(S)}return l(S)}function u(S){if(r===n.length){if(!a)return h(S);if(a.currentConstruct&&a.currentConstruct.concrete)return g(S);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bE,d,f)(S)}function d(S){return a&&x(),v(r),h(S)}function f(S){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(S)}function h(S){return t.containerState={},e.attempt(bE,p,g)(S)}function p(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function g(S){if(S===null){a&&x(),v(0),e.consume(S);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:s}),m(S)}function m(S){if(S===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(S);return}return Ee(S)?(e.consume(S),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(S),m)}function y(S,j){const w=t.sliceStream(S);if(j&&w.push(null),S.previous=s,s&&(s.next=S),s=S,a.defineSkip(S.start),a.write(w),t.parser.lazy[S.start.line]){let b=a.events.length;for(;b--;)if(a.events[b][1].start.offset<o&&(!a.events[b][1].end||a.events[b][1].end.offset>o))return;const N=t.events.length;let E=N,T,A;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(T){A=t.events[E][1].end;break}T=!0}for(v(r),b=N;b<t.events.length;)t.events[b][1].end={...A},b++;ar(t.events,E+1,0,t.events.slice(N)),t.events.length=b}}function v(S){let j=n.length;for(;j-- >S;){const w=n[j];t.containerState=w[1],w[0].exit.call(t,e)}n.length=S}function x(){a.write([null]),s=void 0,a=void 0,t.containerState._closeFlow=void 0}}function Nce(e,t,n){return We(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sl(e){if(e===null||st(e)||Es(e))return 1;if(fm(e))return 2}function hm(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const s=e[a].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Rb={name:"attention",resolveAll:Ece,tokenize:_ce};function Ece(e,t){let n=-1,r,a,s,o,l,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};xE(f,-c),xE(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=br(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=br(u,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=br(u,hm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=br(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=br(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ar(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function _ce(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=sl(r);let s;return o;function o(c){return s=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===s)return e.consume(c),l;const u=e.exit("attentionSequence"),d=sl(c),f=!d||d===2&&a||n.includes(c),h=!a||a===2&&d||n.includes(r);return u._open=!!(s===42?f:f&&(a||!h)),u._close=!!(s===42?h:h&&(d||!f)),t(c)}}function xE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ace={name:"autolink",tokenize:Cce};function Cce(e,t,n){let r=0;return a;function a(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return Rn(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||Nn(p)?(r=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||Nn(p))&&r++<32?(e.consume(p),l):(r=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||Yh(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):yce(p)?(e.consume(p),u):n(p)}function d(p){return Nn(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=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||Nn(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const ed={partial:!0,tokenize:Tce};function Tce(e,t,n){return r;function r(s){return De(s)?We(e,a,"linePrefix")(s):a(s)}function a(s){return s===null||Ee(s)?t(s):n(s)}}const jM={continuation:{tokenize:Pce},exit:Rce,name:"blockQuote",tokenize:Oce};function Oce(e,t,n){const r=this;return a;function a(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return De(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Pce(e,t,n){const r=this;return a;function a(o){return De(o)?We(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(jM,t,n)(o)}}function Rce(e){e.exit("blockQuote")}const NM={name:"characterEscape",tokenize:Mce};function Mce(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),a}function a(s){return xce(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const EM={name:"characterReference",tokenize:Ice};function Ice(e,t,n){const r=this;let a=0,s,o;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"),s=31,o=Nn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=bce,d):(e.enter("characterReferenceValue"),s=7,o=Pb,d(f))}function d(f){if(f===59&&a){const h=e.exit("characterReferenceValue");return o===Nn&&!s0(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&a++<s?(e.consume(f),d):n(f)}}const wE={partial:!0,tokenize:Lce},SE={concrete:!0,name:"codeFenced",tokenize:$ce};function $ce(e,t,n){const r=this,a={partial:!0,tokenize:w};let s=0,o=0,l;return c;function c(b){return u(b)}function u(b){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,l=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(b)}function d(b){return b===l?(o++,e.consume(b),d):o<3?n(b):(e.exit("codeFencedFenceSequence"),De(b)?We(e,f,"whitespace")(b):f(b))}function f(b){return b===null||Ee(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(wE,m,j)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===null||Ee(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(b)):De(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),We(e,p,"whitespace")(b)):b===96&&b===l?n(b):(e.consume(b),h)}function p(b){return b===null||Ee(b)?f(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||Ee(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(b)):b===96&&b===l?n(b):(e.consume(b),g)}function m(b){return e.attempt(a,j,y)(b)}function y(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),v}function v(b){return s>0&&De(b)?We(e,x,"linePrefix",s+1)(b):x(b)}function x(b){return b===null||Ee(b)?e.check(wE,m,j)(b):(e.enter("codeFlowValue"),S(b))}function S(b){return b===null||Ee(b)?(e.exit("codeFlowValue"),x(b)):(e.consume(b),S)}function j(b){return e.exit("codeFenced"),t(b)}function w(b,N,E){let T=0;return A;function A(F){return b.enter("lineEnding"),b.consume(F),b.exit("lineEnding"),M}function M(F){return b.enter("codeFencedFence"),De(F)?We(b,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):R(F)}function R(F){return F===l?(b.enter("codeFencedFenceSequence"),B(F)):E(F)}function B(F){return F===l?(T++,b.consume(F),B):T>=o?(b.exit("codeFencedFenceSequence"),De(F)?We(b,L,"whitespace")(F):L(F)):E(F)}function L(F){return F===null||Ee(F)?(b.exit("codeFencedFence"),N(F)):E(F)}}}function Lce(e,t,n){const r=this;return a;function a(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Dg={name:"codeIndented",tokenize:Bce},Dce={partial:!0,tokenize:zce};function Bce(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),We(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Ee(u)?e.attempt(Dce,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ee(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function zce(e,t,n){const r=this;return a;function a(o){return r.parser.lazy[r.now().line]?n(o):Ee(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):We(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Ee(o)?a(o):n(o)}}const Fce={name:"codeText",previous:Wce,resolve:Uce,tokenize:Hce};function Uce(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function Wce(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Hce(e,t,n){let r=0,a,s;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),r++,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?(s=e.enter("codeTextSequence"),a=0,d(f)):Ee(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||Ee(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",u(f))}}class Gce{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&oc(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),oc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),oc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);oc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);oc(this.left,n.reverse())}}}function oc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _M(e){const t={};let n=-1,r,a,s,o,l,c,u;const d=new Gce(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,qce(d,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,a=void 0;s--;)if(o=d.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),o[1].type="lineEnding",a=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;a&&(r[1].end={...d.get(a)[1].start},l=d.slice(a,n),l.unshift(r),d.splice(a,n-a+1,l))}}return ar(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function qce(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,f,h=-1,p=n,g=0,m=0;const y=[m];for(;p;){for(;e.get(++a)[1]!==p;);s.push(a),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._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&&(m=h+1,y.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const v=l.slice(y[h],y[h+1]),x=s.pop();c.push([x,x+v.length-1]),e.splice(x,2,v)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const Kce={resolve:Yce,tokenize:Xce},Vce={partial:!0,tokenize:Qce};function Yce(e){return _M(e),e}function Xce(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(l)}function a(l){return l===null?s(l):Ee(l)?e.check(Vce,o,s)(l):(e.consume(l),a)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function Qce(e,t,n){const r=this;return a;function a(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),We(e,s,"linePrefix")}function s(o){if(o===null||Ee(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function AM(e,t,n,r,a,s,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(v){return v===60?(e.enter(r),e.enter(a),e.enter(s),e.consume(v),e.exit(s),h):v===null||v===32||v===41||Yh(v)?n(v):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),m(v))}function h(v){return v===62?(e.enter(s),e.consume(v),e.exit(s),e.exit(a),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===62?(e.exit("chunkString"),e.exit(l),h(v)):v===null||v===60||Ee(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===60||v===62||v===92?(e.consume(v),p):p(v)}function m(v){return!d&&(v===null||v===41||st(v))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(v)):d<u&&v===40?(e.consume(v),d++,m):v===41?(e.consume(v),d--,m):v===null||v===32||v===40||Yh(v)?n(v):(e.consume(v),v===92?y:m)}function y(v){return v===40||v===41||v===92?(e.consume(v),m):m(v)}}function CM(e,t,n,r,a,s){const o=this;let l=0,c;return u;function u(p){return e.enter(r),e.enter(a),e.consume(p),e.exit(a),e.enter(s),d}function d(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):Ee(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||Ee(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!De(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function TM(e,t,n,r,a,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(a),e.consume(h),e.exit(a),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(a),e.consume(h),e.exit(a),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),c(o)):h===null?n(h):Ee(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),We(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Ee(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function Pc(e,t){let n;return r;function r(a){return Ee(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):De(a)?We(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const Zce={name:"definition",tokenize:eue},Jce={partial:!0,tokenize:tue};function eue(e,t,n){const r=this;let a;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return CM.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return a=Gr(r.sliceSerialize(r.events[r.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 st(p)?Pc(e,u)(p):u(p)}function u(p){return AM(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Jce,f,f)(p)}function f(p){return De(p)?We(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Ee(p)?(e.exit("definition"),r.parser.defined.push(a),t(p)):n(p)}}function tue(e,t,n){return r;function r(l){return st(l)?Pc(e,a)(l):n(l)}function a(l){return TM(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return De(l)?We(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ee(l)?t(l):n(l)}}const nue={name:"hardBreakEscape",tokenize:rue};function rue(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),a}function a(s){return Ee(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const aue={name:"headingAtx",resolve:iue,tokenize:sue};function iue(e,t){let n=e.length-2,r=3,a,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ar(e,r,n-r+1,[["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t]])),e}function sue(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||st(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ee(d)?(e.exit("atxHeading"),t(d)):De(d)?We(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||st(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const oue=["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"],kE=["pre","script","style","textarea"],lue={concrete:!0,name:"htmlFlow",resolveTo:due,tokenize:fue},cue={partial:!0,tokenize:pue},uue={partial:!0,tokenize:hue};function due(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 fue(e,t,n){const r=this;let a,s,o,l,c;return u;function u(P){return d(P)}function d(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),s=!0,m):P===63?(e.consume(P),a=3,r.interrupt?t:C):Rn(P)?(e.consume(P),o=String.fromCharCode(P),y):n(P)}function h(P){return P===45?(e.consume(P),a=2,p):P===91?(e.consume(P),a=5,l=0,g):Rn(P)?(e.consume(P),a=4,r.interrupt?t:C):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:C):n(P)}function g(P){const ie="CDATA[";return P===ie.charCodeAt(l++)?(e.consume(P),l===ie.length?r.interrupt?t:R:g):n(P)}function m(P){return Rn(P)?(e.consume(P),o=String.fromCharCode(P),y):n(P)}function y(P){if(P===null||P===47||P===62||st(P)){const ie=P===47,ve=o.toLowerCase();return!ie&&!s&&kE.includes(ve)?(a=1,r.interrupt?t(P):R(P)):oue.includes(o.toLowerCase())?(a=6,ie?(e.consume(P),v):r.interrupt?t(P):R(P)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):s?x(P):S(P))}return P===45||Nn(P)?(e.consume(P),o+=String.fromCharCode(P),y):n(P)}function v(P){return P===62?(e.consume(P),r.interrupt?t:R):n(P)}function x(P){return De(P)?(e.consume(P),x):A(P)}function S(P){return P===47?(e.consume(P),A):P===58||P===95||Rn(P)?(e.consume(P),j):De(P)?(e.consume(P),S):A(P)}function j(P){return P===45||P===46||P===58||P===95||Nn(P)?(e.consume(P),j):w(P)}function w(P){return P===61?(e.consume(P),b):De(P)?(e.consume(P),w):S(P)}function b(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,N):De(P)?(e.consume(P),b):E(P)}function N(P){return P===c?(e.consume(P),c=null,T):P===null||Ee(P)?n(P):(e.consume(P),N)}function E(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||st(P)?w(P):(e.consume(P),E)}function T(P){return P===47||P===62||De(P)?S(P):n(P)}function A(P){return P===62?(e.consume(P),M):n(P)}function M(P){return P===null||Ee(P)?R(P):De(P)?(e.consume(P),M):n(P)}function R(P){return P===45&&a===2?(e.consume(P),z):P===60&&a===1?(e.consume(P),$):P===62&&a===4?(e.consume(P),Z):P===63&&a===3?(e.consume(P),C):P===93&&a===5?(e.consume(P),U):Ee(P)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(cue,D,B)(P)):P===null||Ee(P)?(e.exit("htmlFlowData"),B(P)):(e.consume(P),R)}function B(P){return e.check(uue,L,D)(P)}function L(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),F}function F(P){return P===null||Ee(P)?B(P):(e.enter("htmlFlowData"),R(P))}function z(P){return P===45?(e.consume(P),C):R(P)}function $(P){return P===47?(e.consume(P),o="",O):R(P)}function O(P){if(P===62){const ie=o.toLowerCase();return kE.includes(ie)?(e.consume(P),Z):R(P)}return Rn(P)&&o.length<8?(e.consume(P),o+=String.fromCharCode(P),O):R(P)}function U(P){return P===93?(e.consume(P),C):R(P)}function C(P){return P===62?(e.consume(P),Z):P===45&&a===2?(e.consume(P),C):R(P)}function Z(P){return P===null||Ee(P)?(e.exit("htmlFlowData"),D(P)):(e.consume(P),Z)}function D(P){return e.exit("htmlFlow"),t(P)}}function hue(e,t,n){const r=this;return a;function a(o){return Ee(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function pue(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(ed,t,n)}}const mue={name:"htmlText",tokenize:gue};function gue(e,t,n){const r=this;let a,s,o;return l;function l(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),c}function c(C){return C===33?(e.consume(C),u):C===47?(e.consume(C),w):C===63?(e.consume(C),S):Rn(C)?(e.consume(C),E):n(C)}function u(C){return C===45?(e.consume(C),d):C===91?(e.consume(C),s=0,g):Rn(C)?(e.consume(C),x):n(C)}function d(C){return C===45?(e.consume(C),p):n(C)}function f(C){return C===null?n(C):C===45?(e.consume(C),h):Ee(C)?(o=f,$(C)):(e.consume(C),f)}function h(C){return C===45?(e.consume(C),p):f(C)}function p(C){return C===62?z(C):C===45?h(C):f(C)}function g(C){const Z="CDATA[";return C===Z.charCodeAt(s++)?(e.consume(C),s===Z.length?m:g):n(C)}function m(C){return C===null?n(C):C===93?(e.consume(C),y):Ee(C)?(o=m,$(C)):(e.consume(C),m)}function y(C){return C===93?(e.consume(C),v):m(C)}function v(C){return C===62?z(C):C===93?(e.consume(C),v):m(C)}function x(C){return C===null||C===62?z(C):Ee(C)?(o=x,$(C)):(e.consume(C),x)}function S(C){return C===null?n(C):C===63?(e.consume(C),j):Ee(C)?(o=S,$(C)):(e.consume(C),S)}function j(C){return C===62?z(C):S(C)}function w(C){return Rn(C)?(e.consume(C),b):n(C)}function b(C){return C===45||Nn(C)?(e.consume(C),b):N(C)}function N(C){return Ee(C)?(o=N,$(C)):De(C)?(e.consume(C),N):z(C)}function E(C){return C===45||Nn(C)?(e.consume(C),E):C===47||C===62||st(C)?T(C):n(C)}function T(C){return C===47?(e.consume(C),z):C===58||C===95||Rn(C)?(e.consume(C),A):Ee(C)?(o=T,$(C)):De(C)?(e.consume(C),T):z(C)}function A(C){return C===45||C===46||C===58||C===95||Nn(C)?(e.consume(C),A):M(C)}function M(C){return C===61?(e.consume(C),R):Ee(C)?(o=M,$(C)):De(C)?(e.consume(C),M):T(C)}function R(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),a=C,B):Ee(C)?(o=R,$(C)):De(C)?(e.consume(C),R):(e.consume(C),L)}function B(C){return C===a?(e.consume(C),a=void 0,F):C===null?n(C):Ee(C)?(o=B,$(C)):(e.consume(C),B)}function L(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||st(C)?T(C):(e.consume(C),L)}function F(C){return C===47||C===62||st(C)?T(C):n(C)}function z(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function $(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),O}function O(C){return De(C)?We(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):U(C)}function U(C){return e.enter("htmlTextData"),o(C)}}const o0={name:"labelEnd",resolveAll:xue,resolveTo:wue,tokenize:Sue},vue={tokenize:kue},yue={tokenize:jue},bue={tokenize:Nue};function xue(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&ar(e,0,e.length,n),e}function wue(e,t){let n=e.length,r=0,a,s,o,l;for(;n--;)if(a=e[n][1],s){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(s=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(o=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=br(l,e.slice(s+1,s+r+3)),l=br(l,[["enter",d,t]]),l=br(l,hm(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),l=br(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=br(l,e.slice(o+1)),l=br(l,[["exit",c,t]]),ar(e,s,e.length,l),e}function Sue(e,t,n){const r=this;let a=r.events.length,s,o;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){s=r.events[a][1];break}return l;function l(h){return s?s._inactive?f(h):(o=r.parser.defined.includes(Gr(r.sliceSerialize({start:s.end,end:r.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(vue,d,o?d:f)(h):h===91?e.attempt(yue,d,o?u:f)(h):o?d(h):f(h)}function u(h){return e.attempt(bue,d,f)(h)}function d(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function kue(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),a}function a(f){return st(f)?Pc(e,s)(f):s(f)}function s(f){return f===41?d(f):AM(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return st(f)?Pc(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?TM(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return st(f)?Pc(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 jue(e,t,n){const r=this;return a;function a(l){return CM.call(r,e,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Gr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function Nue(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),a}function a(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Eue={name:"labelStartImage",resolveAll:o0.resolveAll,tokenize:_ue};function _ue(e,t,n){const r=this;return a;function a(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Aue={name:"labelStartLink",resolveAll:o0.resolveAll,tokenize:Cue};function Cue(e,t,n){const r=this;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Bg={name:"lineEnding",tokenize:Tue};function Tue(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),We(e,t,"linePrefix")}}const bf={name:"thematicBreak",tokenize:Oue};function Oue(e,t,n){let r=0,a;return s;function s(u){return e.enter("thematicBreak"),o(u)}function o(u){return a=u,l(u)}function l(u){return u===a?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ee(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===a?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),De(u)?We(e,l,"whitespace")(u):l(u))}}const Bn={continuation:{tokenize:Iue},exit:Lue,name:"list",tokenize:Mue},Pue={partial:!0,tokenize:Due},Rue={partial:!0,tokenize:$ue};function Mue(e,t,n){const r=this,a=r.events[r.events.length-1];let s=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,o=0;return l;function l(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Pb(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(bf,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return Pb(p)&&++o<10?(e.consume(p),c):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.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"),r.containerState.marker=r.containerState.marker||p,e.check(ed,r.interrupt?n:d,e.attempt(Pue,h,f))}function d(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return De(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Iue(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ed,a,s);function a(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,We(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!De(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Rue,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,We(e,e.attempt(Bn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function $ue(e,t,n){const r=this;return We(e,a,"listItemIndent",r.containerState.size+1);function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function Lue(e){e.exit(this.containerState.type)}function Due(e,t,n){const r=this;return We(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(s){const o=r.events[r.events.length-1];return!De(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const jE={name:"setextUnderline",resolveTo:Bue,tokenize:zue};function Bue(e,t){let n=e.length,r,a,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",s?(e.splice(a,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function zue(e,t,n){const r=this;let a;return s;function s(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),a=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===a?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),De(u)?We(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ee(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Fue={tokenize:Uue};function Uue(e){const t=this,n=e.attempt(ed,r,e.attempt(this.parser.constructs.flowInitial,a,We(e,e.attempt(this.parser.constructs.flow,a,e.attempt(Kce,a)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Wue={resolveAll:PM()},Hue=OM("string"),Gue=OM("text");function OM(e){return{resolveAll:PM(e==="text"?que:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],s=n.attempt(a,o,l);return o;function o(d){return u(d)?s(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"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=a[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function PM(e){return t;function t(n,r){let a=-1,s;for(;++a<=n.length;)s===void 0?n[a]&&n[a][1].type==="data"&&(s=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==s+2&&(n[s][1].end=n[a-1][1].end,n.splice(s+2,a-s-2),a=s+2),s=void 0);return e?e(n,r):n}}function que(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let s=a.length,o=-1,l=0,c;for(;s--;){const u=a[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Kue={42:Bn,43:Bn,45:Bn,48:Bn,49:Bn,50:Bn,51:Bn,52:Bn,53:Bn,54:Bn,55:Bn,56:Bn,57:Bn,62:jM},Vue={91:Zce},Yue={[-2]:Dg,[-1]:Dg,32:Dg},Xue={35:aue,42:bf,45:[jE,bf],60:lue,61:jE,95:bf,96:SE,126:SE},Que={38:EM,92:NM},Zue={[-5]:Bg,[-4]:Bg,[-3]:Bg,33:Eue,38:EM,42:Rb,60:[Ace,mue],91:Aue,92:[nue,NM],93:o0,95:Rb,96:Fce},Jue={null:[Rb,Wue]},ede={null:[42,95]},tde={null:[]},nde=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ede,contentInitial:Vue,disable:tde,document:Kue,flow:Xue,flowInitial:Yue,insideSpan:Jue,string:Que,text:Zue},Symbol.toStringTag,{value:"Module"}));function rde(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},s=[];let o=[],l=[];const c={attempt:N(w),check:N(b),consume:x,enter:S,exit:j,interrupt:N(b,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&s.push(t),u;function f(M){return o=br(o,M),y(),o[o.length-1]!==null?[]:(E(t,0),u.events=hm(s,u.events,u),u.events)}function h(M,R){return ide(p(M),R)}function p(M){return ade(o,M)}function g(){const{_bufferIndex:M,_index:R,line:B,column:L,offset:F}=r;return{_bufferIndex:M,_index:R,line:B,column:L,offset:F}}function m(M){a[M.line]=M.column,A()}function y(){let M;for(;r._index<o.length;){const R=o[r._index];if(typeof R=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<R.length;)v(R.charCodeAt(r._bufferIndex));else v(R)}}function v(M){d=d(M)}function x(M){Ee(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,A()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=M}function S(M,R){const B=R||{};return B.type=M,B.start=g(),u.events.push(["enter",B,u]),l.push(B),B}function j(M){const R=l.pop();return R.end=g(),u.events.push(["exit",R,u]),R}function w(M,R){E(M,R.from)}function b(M,R){R.restore()}function N(M,R){return B;function B(L,F,z){let $,O,U,C;return Array.isArray(L)?D(L):"tokenize"in L?D([L]):Z(L);function Z(pe){return Te;function Te(q){const X=q!==null&&pe[q],oe=q!==null&&pe.null,ue=[...Array.isArray(X)?X:X?[X]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return D(ue)(q)}}function D(pe){return $=pe,O=0,pe.length===0?z:P(pe[O])}function P(pe){return Te;function Te(q){return C=T(),U=pe,pe.partial||(u.currentConstruct=pe),pe.name&&u.parser.constructs.disable.null.includes(pe.name)?ve():pe.tokenize.call(R?Object.assign(Object.create(u),R):u,c,ie,ve)(q)}}function ie(pe){return M(U,C),F}function ve(pe){return C.restore(),++O<$.length?P($[O]):z}}}function E(M,R){M.resolveAll&&!s.includes(M)&&s.push(M),M.resolve&&ar(u.events,R,u.events.length-R,M.resolve(u.events.slice(R),u)),M.resolveTo&&(u.events=M.resolveTo(u.events,u))}function T(){const M=g(),R=u.previous,B=u.currentConstruct,L=u.events.length,F=Array.from(l);return{from:L,restore:z};function z(){r=M,u.previous=R,u.currentConstruct=B,u.events.length=L,l=F,A()}}function A(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function ade(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,s=t.end._bufferIndex;let o;if(n===a)o=[e[n].slice(r,s)];else{if(o=e.slice(n,a),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[a].slice(0,s))}return o}function ide(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
166
|
+
`;break}case-3:{o=`\r
|
|
167
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&a)continue;o=" ";break}default:o=String.fromCharCode(s)}a=s===-2,r.push(o)}return r.join("")}function sde(e){const r={constructs:SM([nde,...(e||{}).extensions||[]]),content:a(wce),defined:[],document:a(kce),flow:a(Fue),lazy:{},string:a(Hue),text:a(Gue)};return r;function a(s){return o;function o(l){return rde(r,s,l)}}}function ode(e){for(;!_M(e););return e}const NE=/[\0\t\n\r]/g;function lde(){let e=1,t="",n=!0,r;return a;function a(s,o,l){const c=[];let u,d,f,h,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(NE.lastIndex=f,u=NE.exec(s),h=u&&u.index!==void 0?u.index:s.length,p=s.charCodeAt(h),!u){t=s.slice(f);break}if(p===10&&f===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<h&&(c.push(s.slice(f,h)),e+=h-f),p){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const cde=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ude(e){return e.replace(cde,dde)}function dde(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),s=a===120||a===88;return kM(n.slice(s?2:1),s?16:10)}return s0(n)||e}const RM={}.hasOwnProperty;function fde(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),hde(n)(ode(sde(n).document().write(lde()(e,t,!0))))}function hde(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ft),autolinkProtocol:T,autolinkEmail:T,atxHeading:s(Ne),blockQuote:s(oe),characterEscape:T,characterReference:T,codeFenced:s(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(ue,o),codeText:s(V,o),codeTextData:T,data:T,codeFlowValue:T,definition:s(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(je),hardBreakEscape:s(ge),hardBreakTrailing:s(ge),htmlFlow:s(ze,o),htmlFlowData:T,htmlText:s(ze,o),htmlTextData:T,image:s(me),label:o,link:s(ft),listItem:s(Ae),listItemValue:h,listOrdered:s(Ge,f),listUnordered:s(Ge),paragraph:s(Ze),reference:P,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Ne),strong:s(yt),thematicBreak:s(bt)},exit:{atxHeading:c(),atxHeadingSequence:w,autolink:c(),autolinkEmail:X,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:pe,characterReference:Te,codeFenced:c(y),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:A,codeIndented:c(v),codeText:c(F),codeTextData:A,data:A,definition:c(),definitionDestinationString:j,definitionLabelString:x,definitionTitleString:S,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c(B),htmlFlowData:A,htmlText:c(L),htmlTextData:A,image:c($),label:U,labelText:O,lineEnding:M,link:c(z),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:C,resourceTitleString:Z,resource:D,setextHeading:c(E),setextHeadingLineSequence:N,setextHeadingText:b,strong:c(),thematicBreak:c()}};MM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(W){let Y={type:"root",children:[]};const se={stack:[Y],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:d,data:n},he=[];let xe=-1;for(;++xe<W.length;)if(W[xe][1].type==="listOrdered"||W[xe][1].type==="listUnordered")if(W[xe][0]==="enter")he.push(xe);else{const Fe=he.pop();xe=a(W,Fe,xe)}for(xe=-1;++xe<W.length;){const Fe=t[W[xe][0]];RM.call(Fe,W[xe][1].type)&&Fe[W[xe][1].type].call(Object.assign({sliceSerialize:W[xe][2].sliceSerialize},se),W[xe][1])}if(se.tokenStack.length>0){const Fe=se.tokenStack[se.tokenStack.length-1];(Fe[1]||EE).call(se,void 0,Fe[0])}for(Y.position={start:ei(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:ei(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe<t.transforms.length;)Y=t.transforms[xe](Y)||Y;return Y}function a(W,Y,se){let he=Y-1,xe=-1,Fe=!1,Rt,xt,zt,rn;for(;++he<=se;){const Pe=W[he];switch(Pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pe[0]==="enter"?xe++:xe--,rn=void 0;break}case"lineEndingBlank":{Pe[0]==="enter"&&(Rt&&!rn&&!xe&&!zt&&(zt=he),rn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:rn=void 0}if(!xe&&Pe[0]==="enter"&&Pe[1].type==="listItemPrefix"||xe===-1&&Pe[0]==="exit"&&(Pe[1].type==="listUnordered"||Pe[1].type==="listOrdered")){if(Rt){let Vn=he;for(xt=void 0;Vn--;){const Ft=W[Vn];if(Ft[1].type==="lineEnding"||Ft[1].type==="lineEndingBlank"){if(Ft[0]==="exit")continue;xt&&(W[xt][1].type="lineEndingBlank",Fe=!0),Ft[1].type="lineEnding",xt=Vn}else if(!(Ft[1].type==="linePrefix"||Ft[1].type==="blockQuotePrefix"||Ft[1].type==="blockQuotePrefixWhitespace"||Ft[1].type==="blockQuoteMarker"||Ft[1].type==="listItemIndent"))break}zt&&(!xt||zt<xt)&&(Rt._spread=!0),Rt.end=Object.assign({},xt?W[xt][1].start:Pe[1].end),W.splice(xt||he,0,["exit",Rt,Pe[2]]),he++,se++}if(Pe[1].type==="listItemPrefix"){const Vn={type:"listItem",_spread:!1,start:Object.assign({},Pe[1].start),end:void 0};Rt=Vn,W.splice(he,0,["enter",Vn,Pe[2]]),he++,se++,zt=void 0,rn=!0}}}return W[Y][1]._spread=Fe,se}function s(W,Y){return se;function se(he){l.call(this,W(he),he),Y&&Y.call(this,he)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(W,Y,se){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([Y,se||void 0]),W.position={start:ei(Y.start),end:void 0}}function c(W){return Y;function Y(se){W&&W.call(this,se),u.call(this,se)}}function u(W,Y){const se=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==W.type&&(Y?Y.call(this,W,he[0]):(he[1]||EE).call(this,W,he[0]));else throw new Error("Cannot close `"+W.type+"` ("+Oc({start:W.start,end:W.end})+"): it’s not open");se.position.end=ei(W.end)}function d(){return i0(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(W){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function p(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=W}function g(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=W}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.value=W.replace(/(\r?\n|\r)$/g,"")}function x(W){const Y=this.resume(),se=this.stack[this.stack.length-1];se.label=Y,se.identifier=Gr(this.sliceSerialize(W)).toLowerCase()}function S(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.title=W}function j(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.url=W}function w(W){const Y=this.stack[this.stack.length-1];if(!Y.depth){const se=this.sliceSerialize(W).length;Y.depth=se}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function N(W){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function T(W){const se=this.stack[this.stack.length-1].children;let he=se[se.length-1];(!he||he.type!=="text")&&(he=An(),he.position={start:ei(W.start),end:void 0},se.push(he)),this.stack.push(he)}function A(W){const Y=this.stack.pop();Y.value+=this.sliceSerialize(W),Y.position.end=ei(W.end)}function M(W){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const se=Y.children[Y.children.length-1];se.position.end=ei(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Y.type)&&(T.call(this,W),A.call(this,W))}function R(){this.data.atHardBreak=!0}function B(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.value=W}function L(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.value=W}function F(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.value=W}function z(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=Y,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function $(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=Y,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function O(W){const Y=this.sliceSerialize(W),se=this.stack[this.stack.length-2];se.label=ude(Y),se.identifier=Gr(Y).toLowerCase()}function U(){const W=this.stack[this.stack.length-1],Y=this.resume(),se=this.stack[this.stack.length-1];if(this.data.inReference=!0,se.type==="link"){const he=W.children;se.children=he}else se.alt=Y}function C(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.url=W}function Z(){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.title=W}function D(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function ie(W){const Y=this.resume(),se=this.stack[this.stack.length-1];se.label=Y,se.identifier=Gr(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function ve(W){this.data.characterReferenceType=W.type}function pe(W){const Y=this.sliceSerialize(W),se=this.data.characterReferenceType;let he;se?(he=kM(Y,se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=s0(Y);const xe=this.stack[this.stack.length-1];xe.value+=he}function Te(W){const Y=this.stack.pop();Y.position.end=ei(W.end)}function q(W){A.call(this,W);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(W)}function X(W){A.call(this,W);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(W)}function oe(){return{type:"blockquote",children:[]}}function ue(){return{type:"code",lang:null,meta:null,value:""}}function V(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function je(){return{type:"emphasis",children:[]}}function Ne(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function ze(){return{type:"html",value:""}}function me(){return{type:"image",title:null,url:"",alt:null}}function ft(){return{type:"link",title:null,url:"",children:[]}}function Ge(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Ae(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function yt(){return{type:"strong",children:[]}}function An(){return{type:"text",value:""}}function bt(){return{type:"thematicBreak"}}}function ei(e){return{line:e.line,column:e.column,offset:e.offset}}function MM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?MM(e,r):pde(e,r)}}function pde(e,t){let n;for(n in t)if(RM.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function EE(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Oc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Oc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Oc({start:t.start,end:t.end})+") is still open")}function mde(e){const t=this;t.parser=n;function n(r){return fde(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function gde(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 vde(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
168
|
+
`}]}function yde(e,t){const n=t.value?t.value+`
|
|
169
|
+
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function bde(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xde(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wde(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=El(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function Sde(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 kde(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function IM(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),s=a[0];s&&s.type==="text"?s.value="["+s.value:a.unshift({type:"text",value:"["});const o=a[a.length-1];return o&&o.type==="text"?o.value+=r:a.push({type:"text",value:r}),a}function jde(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return IM(e,t);const a={src:El(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const s={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,s),e.applyData(t,s)}function Nde(e,t){const n={src:El(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 r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Ede(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function _de(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return IM(e,t);const a={href:El(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const s={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Ade(e,t){const n={href:El(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Cde(e,t,n){const r=e.all(t),a=n?Tde(n):$M(t),s={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.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:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(a||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
170
|
+
`}),d.type==="element"&&d.tagName==="p"&&!a?o.push(...d.children):o.push(d)}const c=r[r.length-1];c&&(a||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
171
|
+
`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function Tde(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=$M(n[r])}return t}function $M(e){const t=e.spread;return t??e.children.length>1}function Ode(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const o=r[a];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function Pde(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rde(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Mde(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ide(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),a.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=t0(t.children[1]),c=mM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),a.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,s),e.applyData(t,s)}function $de(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const f=t.children[c],h={},p=o?o[c]:void 0;p&&(h.align=p);let g={type:"element",tagName:s,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function Lde(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const _E=9,AE=32;function Dde(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const s=[];for(;r;)s.push(CE(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return s.push(CE(t.slice(a),a>0,!1)),s.join("")}function CE(e,t,n){let r=0,a=e.length;if(t){let s=e.codePointAt(r);for(;s===_E||s===AE;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(a-1);for(;s===_E||s===AE;)a--,s=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function Bde(e,t){const n={type:"text",value:Dde(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zde(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Fde={blockquote:gde,break:vde,code:yde,delete:bde,emphasis:xde,footnoteReference:wde,heading:Sde,html:kde,imageReference:jde,image:Nde,inlineCode:Ede,linkReference:_de,link:Ade,listItem:Cde,list:Ode,paragraph:Pde,root:Rde,strong:Mde,table:Ide,tableCell:Lde,tableRow:$de,text:Bde,thematicBreak:zde,toml:Yd,yaml:Yd,definition:Yd,footnoteDefinition:Yd};function Yd(){}const LM=-1,pm=0,Rc=1,Xh=2,l0=3,c0=4,u0=5,d0=6,DM=7,BM=8,zM=typeof self=="object"?self:globalThis,TE=(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 zM[e](t)},Ude=(e,t)=>{const n=(a,s)=>(e.set(s,a),a),r=a=>{if(e.has(a))return e.get(a);const[s,o]=t[a];switch(s){case pm:case LM:return n(o,a);case Rc:{const l=n([],a);for(const c of o)l.push(r(c));return l}case Xh:{const l=n({},a);for(const[c,u]of o)l[r(c)]=r(u);return l}case l0:return n(new Date(o),a);case c0:{const{source:l,flags:c}=o;return n(new RegExp(l,c),a)}case u0:{const l=n(new Map,a);for(const[c,u]of o)l.set(r(c),r(u));return l}case d0:{const l=n(new Set,a);for(const c of o)l.add(r(c));return l}case DM:{const{name:l,message:c}=o;return n(typeof zM[l]=="function"?TE(l,c):new Error(c),a)}case BM:return n(BigInt(o),a);case"BigInt":return n(Object(BigInt(o)),a);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(TE(s,o),a)};return r},OE=e=>Ude(new Map,e)(0),Xi="",{toString:Wde}={},{keys:Hde}=Object,lc=e=>{const t=typeof e;if(t!=="object"||!e)return[pm,t];const n=Wde.call(e).slice(8,-1);switch(n){case"Array":return[Rc,Xi];case"Object":return[Xh,Xi];case"Date":return[l0,Xi];case"RegExp":return[c0,Xi];case"Map":return[u0,Xi];case"Set":return[d0,Xi];case"DataView":return[Rc,n]}return n.includes("Array")?[Rc,n]:e instanceof Error?[DM,e.name||"Error"]:[Xh,n]},Xd=([e,t])=>e===pm&&(t==="function"||t==="symbol"),Gde=(e,t,n,r)=>{const a=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=lc(o);switch(l){case pm:{let d=o;switch(c){case"bigint":l=BM,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return a([LM],o)}return a([l,d],o)}case Rc:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),a([c,[...h]],o)}const d=[],f=a([l,d],o);for(const h of o)d.push(s(h));return f}case Xh:{if(c)switch(c){case"BigInt":return a([c,o.toString()],o);case"Boolean":case"Number":case"String":return a([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=a([l,d],o);for(const h of Hde(o))(e||!Xd(lc(o[h])))&&d.push([s(h),s(o[h])]);return f}case l0:return a([l,isNaN(o.getTime())?Xi:o.toISOString()],o);case c0:{const{source:d,flags:f}=o;return a([l,{source:d,flags:f}],o)}case u0:{const d=[],f=a([l,d],o);for(const[h,p]of o)(e||!(Xd(lc(h))||Xd(lc(p))))&&d.push([s(h),s(p)]);return f}case d0:{const d=[],f=a([l,d],o);for(const h of o)(e||!Xd(lc(h)))&&d.push(s(h));return f}}const{message:u}=o;return a([l,{name:c,message:u}],o)};return s},PE=(e,{json:t,lossy:n}={})=>{const r=[];return Gde(!(t||n),!!t,new Map,r)(e),r},Qh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?OE(PE(e,t)):structuredClone(e):(e,t)=>OE(PE(e,t));function qde(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 Kde(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Vde(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||qde,r=e.options.footnoteBackLabel||Kde,a=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=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=El(f.toLowerCase());let p=0;const g=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++p<=m;){g.length>0&&g.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,p);typeof x=="string"&&(x={type:"text",value:x}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else d.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,v),l.push(v)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Qh(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
172
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
173
|
+
`}]}}const td=function(e){if(e==null)return Zde;if(typeof e=="function")return mm(e);if(typeof e=="object")return Array.isArray(e)?Yde(e):Xde(e);if(typeof e=="string")return Qde(e);throw new Error("Expected function, string, or object as test")};function Yde(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=td(e[n]);return mm(r);function r(...a){let s=-1;for(;++s<t.length;)if(t[s].apply(this,a))return!0;return!1}}function Xde(e){const t=e;return mm(n);function n(r){const a=r;let s;for(s in e)if(a[s]!==t[s])return!1;return!0}}function Qde(e){return mm(t);function t(n){return n&&n.type===e}}function mm(e){return t;function t(n,r,a){return!!(Jde(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function Zde(){return!0}function Jde(e){return e!==null&&typeof e=="object"&&"type"in e}const FM=[],efe=!0,Mb=!1,tfe="skip";function UM(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const s=td(a),o=r?-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=FM,g,m,y;if((!t||s(c,u,d[d.length-1]||void 0))&&(p=nfe(n(c,d)),p[0]===Mb))return p;if("children"in c&&c.children){const v=c;if(v.children&&p[0]!==tfe)for(m=(r?v.children.length:-1)+o,y=d.concat(v);m>-1&&m<v.children.length;){const x=v.children[m];if(g=l(x,m,y)(),g[0]===Mb)return g;m=typeof g[1]=="number"?g[1]:m+o}}return p}}}function nfe(e){return Array.isArray(e)?e:typeof e=="number"?[efe,e]:e==null?FM:[e]}function gm(e,t,n,r){let a,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,a=n):(s=t,o=n,a=r),UM(e,s,l,a);function l(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return o(c,f,d)}}const Ib={}.hasOwnProperty,rfe={};function afe(e,t){const n=t||rfe,r=new Map,a=new Map,s=new Map,o={...Fde,...n.handlers},l={all:u,applyData:sfe,definitionById:r,footnoteById:a,footnoteCounts:s,footnoteOrder:[],handlers:o,one:c,options:n,patch:ife,wrap:lfe};return gm(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:a,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(Ib.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:m,...y}=d,v=Qh(y);return v.children=l.all(d),v}return Qh(d)}return(l.options.unknownHandler||ofe)(l,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const g=l.one(h[p],d);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=RE(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=RE(m.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function ife(e,t){e.position&&(t.position=Kle(e))}function sfe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Qh(s)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function ofe(e,t){const n=t.data||{},r="value"in t&&!(Ib.call(n,"hProperties")||Ib.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lfe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
174
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
175
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
176
|
+
`}),n}function RE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ME(e,t){const n=afe(e,t),r=n.one(e,void 0),a=Vde(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&s.children.push({type:"text",value:`
|
|
177
|
+
`},a),s}function cfe(e,t){return e&&"run"in e?async function(n,r){const a=ME(n,{file:r,...t});await e.run(a,r)}:function(n,r){return ME(n,{file:r,...e||t})}}function IE(e){if(e)throw e}var xf=Object.prototype.hasOwnProperty,WM=Object.prototype.toString,$E=Object.defineProperty,LE=Object.getOwnPropertyDescriptor,DE=function(t){return typeof Array.isArray=="function"?Array.isArray(t):WM.call(t)==="[object Array]"},BE=function(t){if(!t||WM.call(t)!=="[object Object]")return!1;var n=xf.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&xf.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||xf.call(t,a)},zE=function(t,n){$E&&n.name==="__proto__"?$E(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},FE=function(t,n){if(n==="__proto__")if(xf.call(t,n)){if(LE)return LE(t,n).value}else return;return t[n]},ufe=function e(){var t,n,r,a,s,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=FE(l,n),a=FE(t,n),l!==a&&(d&&a&&(BE(a)||(s=DE(a)))?(s?(s=!1,o=r&&DE(r)?r:[]):o=r&&BE(r)?r:{},zE(l,{name:n,newValue:e(d,o,a)})):typeof a<"u"&&zE(l,{name:n,newValue:a}));return l};const zg=Qe(ufe);function $b(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 dfe(){const e=[],t={run:n,use:r};return t;function n(...a){let s=-1;const o=a.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...a);function l(c,...u){const d=e[++s];let f=-1;if(c){o(c);return}for(;++f<a.length;)(u[f]===null||u[f]===void 0)&&(u[f]=a[f]);a=u,d?ffe(d,l)(...u):o(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function ffe(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(a);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return a(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,a):c instanceof Error?a(c):s(c))}function a(o,...l){n||(n=!0,t(o,...l))}function s(o){a(null,o)}}const ea={basename:hfe,dirname:pfe,extname:mfe,join:gfe,sep:"/"};function hfe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nd(e);let n=0,r=-1,a=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(s){n=a+1;break}}else r<0&&(s=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(s){n=a+1;break}}else o<0&&(s=!0,o=a+1),l>-1&&(e.codePointAt(a)===t.codePointAt(l--)?l<0&&(r=a):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function pfe(e){if(nd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function mfe(e){nd(e);let t=e.length,n=-1,r=0,a=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?a<0?a=t:s!==1&&(s=1):a>-1&&(s=-1)}return a<0||n<0||s===0||s===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function gfe(...e){let t=-1,n;for(;++t<e.length;)nd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":vfe(n)}function vfe(e){nd(e);const t=e.codePointAt(0)===47;let n=yfe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yfe(e,t){let n="",r=0,a=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(a===o-1||s===1))if(a!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),a=o,s=0;continue}}else if(n.length>0){n="",r=0,a=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,o):n=e.slice(a+1,o),r=o-a-1;a=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function nd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const bfe={cwd:xfe};function xfe(){return"/"}function Lb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function wfe(e){if(typeof e=="string")e=new URL(e);else if(!Lb(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 Sfe(e)}function Sfe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Fg=["history","path","basename","stem","extname","dirname"];class HM{constructor(t){let n;t?Lb(t)?n={path:t}:typeof t=="string"||kfe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":bfe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Fg.length;){const s=Fg[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let a;for(a in n)Fg.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ea.basename(this.path):void 0}set basename(t){Wg(t,"basename"),Ug(t,"basename"),this.path=ea.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ea.dirname(this.path):void 0}set dirname(t){UE(this.basename,"dirname"),this.path=ea.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ea.extname(this.path):void 0}set extname(t){if(Ug(t,"extname"),UE(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=ea.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Lb(t)&&(t=wfe(t)),Wg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ea.basename(this.path,this.extname):void 0}set stem(t){Wg(t,"stem"),Ug(t,"stem"),this.path=ea.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new _n(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ug(e,t){if(e&&e.includes(ea.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ea.sep+"`")}function Wg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function UE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function kfe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jfe=function(e){const r=this.constructor.prototype,a=r[e],s=function(){return a.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Nfe={}.hasOwnProperty;class f0 extends jfe{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=dfe()}copy(){const t=new f0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(zg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(qg("data",this.frozen),this.namespace[t]=n,this):Nfe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(qg("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,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Qd(t),r=this.parser||this.Parser;return Hg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Hg("process",this.parser||this.Parser),Gg("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(s,o){const l=Qd(t),c=r.parse(l);r.run(c,l,function(d,f,h){if(d||!f||!h)return u(d);const p=f,g=r.stringify(p,h);Afe(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?o(d):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Hg("processSync",this.parser||this.Parser),Gg("processSync",this.compiler||this.Compiler),this.process(t,a),HE("processSync","process",n),r;function a(s,o){n=!0,IE(s),r=o}}run(t,n,r){WE(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,l){const c=Qd(n);a.run(t,c,u);function u(d,f,h){const p=f||t;d?l(d):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,a;return this.run(t,n,s),HE("runSync","run",r),a;function s(o,l){IE(o),a=l,r=!0}}stringify(t,n){this.freeze();const r=Qd(n),a=this.compiler||this.Compiler;return Gg("stringify",a),WE(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(qg("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(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&&(a.settings=zg(!0,a.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[p,...g]=d;const m=r[h][1];$b(m)&&$b(p)&&(p=zg(!0,m,p)),r[h]=[u,p,...g]}}}}const Efe=new f0().freeze();function Hg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qg(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 WE(e){if(!$b(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function HE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Qd(e){return _fe(e)?e:new HM(e)}function _fe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Afe(e){return typeof e=="string"||Cfe(e)}function Cfe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Tfe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",GE=[],qE={allowDangerousHtml:!0},Ofe=/^(https?|ircs?|mailto|xmpp)$/i,Pfe=[{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 Rfe(e){const t=Mfe(e),n=Ife(e);return $fe(t.runSync(t.parse(n),n),e)}function Mfe(e){const t=e.rehypePlugins||GE,n=e.remarkPlugins||GE,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qE}:qE;return Efe().use(mde).use(n).use(cfe,r).use(t)}function Ife(e){const t=e.children||"",n=new HM;return typeof t=="string"&&(n.value=t),n}function $fe(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||Lfe;for(const d of Pfe)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Tfe+d.id,void 0);return gm(e,u),Zle(e,{Fragment:i.Fragment,components:a,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in Lg)if(Object.hasOwn(Lg,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],m=Lg[p];(m===null||m.includes(d.tagName))&&(d.properties[p]=c(String(g||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(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 Lfe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||Ofe.test(e.slice(0,t))?e:""}function KE(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function Dfe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Bfe(e,t,n){const a=td((n||{}).ignore||[]),s=zfe(t);let o=-1;for(;++o<s.length;)UM(e,"text",l);function l(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],g=h?h.children:void 0;if(a(p,g?g.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=s[o][0],p=s[o][1];let g=0;const y=f.children.indexOf(u);let v=!1,x=[];h.lastIndex=0;let S=h.exec(u.value);for(;S;){const j=S.index,w={index:S.index,input:S.input,stack:[...d,u]};let b=p(...S,w);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?h.lastIndex=j+1:(g!==j&&x.push({type:"text",value:u.value.slice(g,j)}),Array.isArray(b)?x.push(...b):b&&x.push(b),g=j+S[0].length,v=!0),!h.global)break;S=h.exec(u.value)}return v?(g<u.value.length&&x.push({type:"text",value:u.value.slice(g)}),f.children.splice(y,1,...x)):x=[u],y+x.length}}function zfe(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 r=-1;for(;++r<n.length;){const a=n[r];t.push([Ffe(a[0]),Ufe(a[1])])}return t}function Ffe(e){return typeof e=="string"?new RegExp(Dfe(e),"g"):e}function Ufe(e){return typeof e=="function"?e:function(){return e}}const Kg="phrasing",Vg=["autolink","link","image","label"];function Wfe(){return{transforms:[Xfe],enter:{literalAutolink:Gfe,literalAutolinkEmail:Yg,literalAutolinkHttp:Yg,literalAutolinkWww:Yg},exit:{literalAutolink:Yfe,literalAutolinkEmail:Vfe,literalAutolinkHttp:qfe,literalAutolinkWww:Kfe}}}function Hfe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Kg,notInConstruct:Vg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Kg,notInConstruct:Vg},{character:":",before:"[ps]",after:"\\/",inConstruct:Kg,notInConstruct:Vg}]}}function Gfe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Yg(e){this.config.enter.autolinkProtocol.call(this,e)}function qfe(e){this.config.exit.autolinkProtocol.call(this,e)}function Kfe(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 Vfe(e){this.config.exit.autolinkEmail.call(this,e)}function Yfe(e){this.exit(e)}function Xfe(e){Bfe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Qfe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Zfe]],{ignore:["link","linkReference"]})}function Qfe(e,t,n,r,a){let s="";if(!GM(a)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Jfe(n)))return!1;const o=ehe(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function Zfe(e,t,n,r){return!GM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Jfe(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 ehe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=KE(e,"(");let s=KE(e,")");for(;r!==-1&&a>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function GM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Es(n)||fm(n))&&(!t||n!==47)}qM.peek=che;function the(){this.buffer()}function nhe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rhe(){this.buffer()}function ahe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ihe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function she(e){this.exit(e)}function ohe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function lhe(e){this.exit(e)}function che(){return"["}function qM(e,t,n,r){const a=n.createTracker(r);let s=a.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=a.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=a.move("]"),s}function uhe(){return{enter:{gfmFootnoteCallString:the,gfmFootnoteCall:nhe,gfmFootnoteDefinitionLabelString:rhe,gfmFootnoteDefinition:ahe},exit:{gfmFootnoteCallString:ihe,gfmFootnoteCall:she,gfmFootnoteDefinitionLabelString:ohe,gfmFootnoteDefinition:lhe}}}function dhe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:qM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,s,o){const l=s.createTracker(o);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
|
|
178
|
+
`:" ")+s.indentLines(s.containerFlow(r,l.current()),t?KM:fhe))),u(),c}}function fhe(e,t,n){return t===0?e:KM(e,t,n)}function KM(e,t,n){return(n?"":" ")+e}const hhe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];VM.peek=yhe;function phe(){return{canContainEols:["delete"],enter:{strikethrough:ghe},exit:{strikethrough:vhe}}}function mhe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:hhe}],handlers:{delete:VM}}}function ghe(e){this.enter({type:"delete",children:[]},e)}function vhe(e){this.exit(e)}function VM(e,t,n,r){const a=n.createTracker(r),s=n.enter("strikethrough");let o=a.move("~~");return o+=n.containerPhrasing(e,{...a.current(),before:o,after:"~"}),o+=a.move("~~"),s(),o}function yhe(){return"~"}function bhe(e){return e.length}function xhe(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||bhe,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++d<e.length;){const m=[],y=[];let v=-1;for(e[d].length>u&&(u=e[d].length);++v<e[d].length;){const x=whe(e[d][v]);if(n.alignDelimiters!==!1){const S=a(x);y[v]=S,(c[v]===void 0||S>c[v])&&(c[v]=S)}m.push(x)}o[d]=m,l[d]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=VE(r[f]);else{const m=VE(r);for(;++f<u;)s[f]=m}f=-1;const h=[],p=[];for(;++f<u;){const m=s[f];let y="",v="";m===99?(y=":",v=":"):m===108?y=":":m===114&&(v=":");let x=n.alignDelimiters===!1?1:Math.max(1,c[f]-y.length-v.length);const S=y+"-".repeat(x)+v;n.alignDelimiters!==!1&&(x=y.length+x+v.length,x>c[f]&&(c[f]=x),p[f]=x),h[f]=S}o.splice(1,0,h),l.splice(1,0,p),d=-1;const g=[];for(;++d<o.length;){const m=o[d],y=l[d];f=-1;const v=[];for(;++f<u;){const x=m[f]||"";let S="",j="";if(n.alignDelimiters!==!1){const w=c[f]-(y[f]||0),b=s[f];b===114?S=" ".repeat(w):b===99?w%2?(S=" ".repeat(w/2+.5),j=" ".repeat(w/2-.5)):(S=" ".repeat(w/2),j=S):j=" ".repeat(w)}n.delimiterStart!==!1&&!f&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||f)&&v.push(" "),n.alignDelimiters!==!1&&v.push(S),v.push(x),n.alignDelimiters!==!1&&v.push(j),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&v.push("|")}g.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return g.join(`
|
|
179
|
+
`)}function whe(e){return e==null?"":String(e)}function VE(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}function She(e,t,n,r){const a=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),khe);return a(),o}function khe(e,t,n){return">"+(n?"":" ")+e}function jhe(e,t){return YE(e,t.inConstruct,!0)&&!YE(e,t.notInConstruct,!1)}function YE(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function XE(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
180
|
+
`&&jhe(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
181
|
+
`}function Nhe(e,t){const n=String(e);let r=n.indexOf(t),a=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++s>o&&(o=s):s=1,a=r+t.length,r=n.indexOf(t,a);return o}function Ehe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function _he(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 Ahe(e,t,n,r){const a=_he(n),s=e.value||"",o=a==="`"?"GraveAccent":"Tilde";if(Ehe(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,Che);return f(),h}const l=n.createTracker(r),c=a.repeat(Math.max(Nhe(s,a)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:`
|
|
182
|
+
`,encode:["`"],...l.current()})),f()}return d+=l.move(`
|
|
183
|
+
`),s&&(d+=l.move(s+`
|
|
184
|
+
`)),d+=l.move(c),u(),d}function Che(e,t,n){return(n?"":" ")+e}function h0(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 The(e,t,n,r){const a=h0(n),s=a==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);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?" ":`
|
|
185
|
+
`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+a),u+=c.move(n.safe(e.title,{before:u,after:a,...c.current()})),u+=c.move(a),l()),o(),u}function Ohe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Lu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Zh(e,t,n){const r=sl(e),a=sl(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}YM.peek=Phe;function YM(e,t,n,r){const a=Ohe(n),s=n.enter("emphasis"),o=n.createTracker(r),l=o.move(a);let c=o.move(n.containerPhrasing(e,{after:a,before:l,...o.current()}));const u=c.charCodeAt(0),d=Zh(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(c=Lu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Zh(r.after.charCodeAt(0),f,a);h.inside&&(c=c.slice(0,-1)+Lu(f));const p=o.move(a);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function Phe(e,t,n){return n.options.emphasis||"*"}function Rhe(e,t){let n=!1;return gm(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Mb}),!!((!e.depth||e.depth<3)&&i0(e)&&(t.options.setext||n))}function Mhe(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(Rhe(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
|
|
186
|
+
`,after:`
|
|
187
|
+
`});return f(),d(),h+`
|
|
188
|
+
`+(a===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
189
|
+
`))+1))}const o="#".repeat(a),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
190
|
+
`,...s.current()});return/^[\t ]/.test(u)&&(u=Lu(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}XM.peek=Ihe;function XM(e){return e.value||""}function Ihe(){return"<"}QM.peek=$he;function QM(e,t,n,r){const a=h0(n),s=a==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);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${s}`),u+=c.move(" "+a),u+=c.move(n.safe(e.title,{before:u,after:a,...c.current()})),u+=c.move(a),l()),u+=c.move(")"),o(),u}function $he(){return"!"}ZM.peek=Lhe;function ZM(e,t,n,r){const a=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),a==="full"||!u||u!==f?c+=l.move(f+"]"):a==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Lhe(){return"!"}JM.peek=Dhe;function JM(e,t,n){let r=e.value||"",a="`",s=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],l=n.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return a+r+a}function Dhe(){return"`"}function eI(e,t){const n=i0(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))}tI.peek=Bhe;function tI(e,t,n,r){const a=h0(n),s=a==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(eI(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+a),u+=o.move(n.safe(e.title,{before:u,after:a,...o.current()})),u+=o.move(a),c()),u+=o.move(")"),l(),u}function Bhe(e,t,n){return eI(e,n)?"<":"["}nI.peek=zhe;function nI(e,t,n,r){const a=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),a==="full"||!u||u!==f?c+=l.move(f+"]"):a==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function zhe(){return"["}function p0(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 Fhe(e){const t=p0(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 Uhe(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 rI(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 Whe(e,t,n,r){const a=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?Uhe(n):p0(n);const l=e.ordered?o==="."?")":".":Fhe(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&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),rI(n)===o&&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&&(o=l),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,a(),u}function Hhe(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 Ghe(e,t,n,r){const a=Hhe(n);let s=n.bulletCurrent||p0(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(o-s.length)),l.shift(o);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(o))+f:(p?s:s+" ".repeat(o-s.length))+f}}function qhe(e,t,n,r){const a=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),a(),o}const Khe=td(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Vhe(e,t,n,r){return(e.children.some(function(o){return Khe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Yhe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aI.peek=Xhe;function aI(e,t,n,r){const a=Yhe(n),s=n.enter("strong"),o=n.createTracker(r),l=o.move(a+a);let c=o.move(n.containerPhrasing(e,{after:a,before:l,...o.current()}));const u=c.charCodeAt(0),d=Zh(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(c=Lu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Zh(r.after.charCodeAt(0),f,a);h.inside&&(c=c.slice(0,-1)+Lu(f));const p=o.move(a+a);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function Xhe(e,t,n){return n.options.strong||"*"}function Qhe(e,t,n,r){return n.safe(e.value,r)}function Zhe(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 Jhe(e,t,n){const r=(rI(n)+(n.options.ruleSpaces?" ":"")).repeat(Zhe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const iI={blockquote:She,break:XE,code:Ahe,definition:The,emphasis:YM,hardBreak:XE,heading:Mhe,html:XM,image:QM,imageReference:ZM,inlineCode:JM,link:tI,linkReference:nI,list:Whe,listItem:Ghe,paragraph:qhe,root:Vhe,strong:aI,text:Qhe,thematicBreak:Jhe};function epe(){return{enter:{table:tpe,tableData:QE,tableHeader:QE,tableRow:rpe},exit:{codeText:ape,table:npe,tableData:Xg,tableHeader:Xg,tableRow:Xg}}}function tpe(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 npe(e){this.exit(e),this.data.inTable=void 0}function rpe(e){this.enter({type:"tableRow",children:[]},e)}function Xg(e){this.exit(e)}function QE(e){this.enter({type:"tableCell",children:[]},e)}function ape(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ipe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ipe(e,t){return t==="|"?t:e}function spe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
191
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:c,tableRow:l}};function o(p,g,m,y){return u(d(p,m,y),p.align)}function l(p,g,m,y){const v=f(p,m,y),x=u([v]);return x.slice(0,x.indexOf(`
|
|
192
|
+
`))}function c(p,g,m,y){const v=m.enter("tableCell"),x=m.enter("phrasing"),S=m.containerPhrasing(p,{...y,before:s,after:s});return x(),v(),S}function u(p,g){return xhe(p,{align:g,alignDelimiters:r,padding:n,stringLength:a})}function d(p,g,m){const y=p.children;let v=-1;const x=[],S=g.enter("table");for(;++v<y.length;)x[v]=f(y[v],g,m);return S(),x}function f(p,g,m){const y=p.children;let v=-1;const x=[],S=g.enter("tableRow");for(;++v<y.length;)x[v]=c(y[v],p,g,m);return S(),x}function h(p,g,m){let y=iI.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function ope(){return{exit:{taskListCheckValueChecked:ZE,taskListCheckValueUnchecked:ZE,paragraph:cpe}}}function lpe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:upe}}}function ZE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function cpe(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 r=n.children[0];if(r&&r.type==="text"){const a=t.children;let s=-1,o;for(;++s<a.length;){const l=a[s];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function upe(e,t,n,r){const a=e.children[0],s=typeof e.checked=="boolean"&&a&&a.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);s&&l.move(o);let c=iI.listItem(e,t,n,{...r,...l.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+o}}function dpe(){return[Wfe(),uhe(),phe(),epe(),ope()]}function fpe(e){return{extensions:[Hfe(),dhe(e),mhe(),spe(e),lpe()]}}const hpe={tokenize:bpe,partial:!0},sI={tokenize:xpe,partial:!0},oI={tokenize:wpe,partial:!0},lI={tokenize:Spe,partial:!0},ppe={tokenize:kpe,partial:!0},cI={name:"wwwAutolink",tokenize:vpe,previous:dI},uI={name:"protocolAutolink",tokenize:ype,previous:fI},Ga={name:"emailAutolink",tokenize:gpe,previous:hI},fa={};function mpe(){return{text:fa}}let Wi=48;for(;Wi<123;)fa[Wi]=Ga,Wi++,Wi===58?Wi=65:Wi===91&&(Wi=97);fa[43]=Ga;fa[45]=Ga;fa[46]=Ga;fa[95]=Ga;fa[72]=[Ga,uI];fa[104]=[Ga,uI];fa[87]=[Ga,cI];fa[119]=[Ga,cI];function gpe(e,t,n){const r=this;let a,s;return o;function o(f){return!Db(f)||!hI.call(r,r.previous)||m0(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return Db(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(ppe,d,u)(f):f===45||f===95||Nn(f)?(s=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),a=!0,c}function d(f){return s&&a&&Rn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function vpe(e,t,n){const r=this;return a;function a(o){return o!==87&&o!==119||!dI.call(r,r.previous)||m0(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(hpe,e.attempt(sI,e.attempt(oI,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function ype(e,t,n){const r=this;let a="",s=!1;return o;function o(f){return(f===72||f===104)&&fI.call(r,r.previous)&&!m0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(Rn(f)&&a.length<5)return a+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const h=a.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),s?u:(s=!0,c)):n(f)}function u(f){return f===null||Yh(f)||st(f)||Es(f)||fm(f)?n(f):e.attempt(sI,e.attempt(oI,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function bpe(e,t,n){let r=0;return a;function a(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),a):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function xpe(e,t,n){let r,a,s;return o;function o(u){return u===46||u===95?e.check(lI,c,l)(u):u===null||st(u)||Es(u)||u!==45&&fm(u)?c(u):(s=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(a=r,r=void 0),e.consume(u),o}function c(u){return a||r||!s?n(u):t(u)}}function wpe(e,t){let n=0,r=0;return a;function a(o){return o===40?(n++,e.consume(o),a):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(lI,t,s)(o):o===null||st(o)||Es(o)?t(o):(e.consume(o),a)}function s(o){return o===41&&r++,e.consume(o),a}}function Spe(e,t,n){return r;function r(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),r):l===38?(e.consume(l),s):l===93?(e.consume(l),a):l===60||l===null||st(l)||Es(l)?t(l):n(l)}function a(l){return l===null||l===40||l===91||st(l)||Es(l)?t(l):r(l)}function s(l){return Rn(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):Rn(l)?(e.consume(l),o):n(l)}}function kpe(e,t,n){return r;function r(s){return e.consume(s),a}function a(s){return Nn(s)?n(s):t(s)}}function dI(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||st(e)}function fI(e){return!Rn(e)}function hI(e){return!(e===47||Db(e))}function Db(e){return e===43||e===45||e===46||e===95||Nn(e)}function m0(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const jpe={tokenize:Ppe,partial:!0};function Npe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Cpe,continuation:{tokenize:Tpe},exit:Ope}},text:{91:{name:"gfmFootnoteCall",tokenize:Ape},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Epe,resolveTo:_pe}}}}function Epe(e,t,n){const r=this;let a=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;a--;){const c=r.events[a][1];if(c.type==="labelImage"){o=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(!o||!o._balanced)return n(c);const u=Gr(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function _pe(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 r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function Ape(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;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(s>999||f===93&&!o||f===null||f===91||st(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return a.includes(Gr(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return st(f)||(o=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function Cpe(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(o>999||g===93&&!l||g===null||g===91||st(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=Gr(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return st(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),a.includes(s)||a.push(s),We(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function Tpe(e,t,n){return e.check(ed,t,e.attempt(jpe,t,n))}function Ope(e){e.exit("gfmFootnoteDefinition")}function Ppe(e,t,n){const r=this;return We(e,a,"gfmFootnoteDefinitionIndent",5);function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function Rpe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let u=c;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[c][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[c][1].end)},f={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[c][1].start)},h=[["enter",d,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",f,l]],p=l.parser.constructs.insideSpan.null;p&&ar(h,h.length,0,hm(p,o.slice(u+1,c),l)),ar(h,h.length,0,[["exit",f,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),ar(o,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function s(o,l,c){const u=this.previous,d=this.events;let f=0;return h;function h(g){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(g):(o.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const m=sl(u);if(g===126)return f>1?c(g):(o.consume(g),f++,p);if(f<2&&!n)return c(g);const y=o.exit("strikethroughSequenceTemporary"),v=sl(g);return y._open=!v||v===2&&!!m,y._close=!m||m===2&&!!v,l(g)}}}class Mpe{constructor(){this.map=[]}add(t,n,r){Ipe(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const s of a)t.push(s);a=r.pop()}this.map.length=0}}function Ipe(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function $pe(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Lpe(){return{flow:{null:{name:"table",tokenize:Dpe,resolveAll:Bpe}}}}function Dpe(e,t,n){const r=this;let a=0,s=0,o;return l;function l(A){let M=r.events.length-1;for(;M>-1;){const L=r.events[M][1].type;if(L==="lineEnding"||L==="linePrefix")M--;else break}const R=M>-1?r.events[M][1].type:null,B=R==="tableHead"||R==="tableRow"?b:c;return B===b&&r.parser.lazy[r.now().line]?n(A):B(A)}function c(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(o=!0,s+=1),d(A)}function d(A){return A===null?n(A):Ee(A)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),p):n(A):De(A)?We(e,d,"whitespace")(A):(s+=1,o&&(o=!1,a+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(A)))}function f(A){return A===null||A===124||st(A)?(e.exit("data"),d(A)):(e.consume(A),A===92?h:f)}function h(A){return A===92||A===124?(e.consume(A),f):f(A)}function p(A){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(A):(e.enter("tableDelimiterRow"),o=!1,De(A)?We(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):g(A))}function g(A){return A===45||A===58?y(A):A===124?(o=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),m):w(A)}function m(A){return De(A)?We(e,y,"whitespace")(A):y(A)}function y(A){return A===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),v):A===45?(s+=1,v(A)):A===null||Ee(A)?j(A):w(A)}function v(A){return A===45?(e.enter("tableDelimiterFiller"),x(A)):w(A)}function x(A){return A===45?(e.consume(A),x):A===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(A))}function S(A){return De(A)?We(e,j,"whitespace")(A):j(A)}function j(A){return A===124?g(A):A===null||Ee(A)?!o||a!==s?w(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):w(A)}function w(A){return n(A)}function b(A){return e.enter("tableRow"),N(A)}function N(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),N):A===null||Ee(A)?(e.exit("tableRow"),t(A)):De(A)?We(e,N,"whitespace")(A):(e.enter("data"),E(A))}function E(A){return A===null||A===124||st(A)?(e.exit("data"),N(A)):(e.consume(A),A===92?T:E)}function T(A){return A===92||A===124?(e.consume(A),E):E(A)}}function Bpe(e,t){let n=-1,r=!0,a=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new Mpe;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(JE(h,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,t]])),a=g.type==="tableDelimiterRow"?2:d?3:1):a&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],f=Zd(h,t,s,a,void 0,f),s=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=Zd(h,t,s,a,void 0,f)),s=o,o=[s[1],n,0,0])):g.type==="tableHead"?(l=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,s[1]!==0?(o[0]=o[1],f=Zd(h,t,s,a,n,f)):o[1]!==0&&(f=Zd(h,t,o,a,n,f)),a=0):a&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&JE(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=$pe(t.events,n))}return e}function Zd(e,t,n,r,a,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(s.end=Object.assign({},Js(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const c=Js(t.events,n[1]);if(s={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Js(t.events,n[2]),d=Js(t.events,n[3]),f={type:l,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==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 g=n[2]+1,m=n[3]-n[2]-1;e.add(g,m,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return a!==void 0&&(s.end=Object.assign({},Js(t.events,a)),e.add(a,0,[["exit",s,t]]),s=void 0),s}function JE(e,t,n,r,a){const s=[],o=Js(t.events,n);a&&(a.end=Object.assign({},o),s.push(["exit",a,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Js(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const zpe={name:"tasklistCheck",tokenize:Upe};function Fpe(){return{text:{91:zpe}}}function Upe(e,t,n){const r=this;return a;function a(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return st(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Ee(c)?t(c):De(c)?e.check({tokenize:Wpe},t,n)(c):n(c)}}function Wpe(e,t,n){return We(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function Hpe(e){return SM([mpe(),Npe(),Rpe(e),Lpe(),Fpe()])}const Gpe={};function qpe(e){const t=this,n=e||Gpe,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(Hpe(n)),s.push(dpe()),o.push(fpe(n))}const e_=function(e,t,n){const r=td(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(r(e.children[t],t,e))return e.children[t]},Is=function(e){if(e==null)return Ype;if(typeof e=="string")return Vpe(e);if(typeof e=="object")return Kpe(e);if(typeof e=="function")return g0(e);throw new Error("Expected function, string, or array as `test`")};function Kpe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Is(e[n]);return g0(r);function r(...a){let s=-1;for(;++s<t.length;)if(t[s].apply(this,a))return!0;return!1}}function Vpe(e){return g0(t);function t(n){return n.tagName===e}}function g0(e){return t;function t(n,r,a){return!!(Xpe(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function Ype(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Xpe(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const t_=/\n/g,n_=/[\t ]+/g,Bb=Is("br"),r_=Is(ame),Qpe=Is("p"),a_=Is("tr"),Zpe=Is(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",rme,ime]),pI=Is(["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 Jpe(e,t){const n=t||{},r="children"in e?e.children:[],a=pI(e),s=vI(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...gI(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)o.push(...mI(r[l],e,{whitespace:s,breakBefore:l?void 0:a,breakAfter:l<r.length-1?Bb(r[l+1]):a}));const c=[];let u;for(l=-1;++l<o.length;){const d=o[l];typeof d=="number"?u!==void 0&&d>u&&(u=d):d&&(u!==void 0&&u>-1&&c.push(`
|
|
193
|
+
`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function mI(e,t,n){return e.type==="element"?eme(e,t,n):e.type==="text"?n.whitespace==="normal"?gI(e,n):tme(e):[]}function eme(e,t,n){const r=vI(e,n),a=e.children||[];let s=-1,o=[];if(Zpe(e))return o;let l,c;for(Bb(e)||a_(e)&&e_(t,e,a_)?c=`
|
|
194
|
+
`:Qpe(e)?(l=2,c=2):pI(e)&&(l=1,c=1);++s<a.length;)o=o.concat(mI(a[s],e,{whitespace:r,breakBefore:s?void 0:l,breakAfter:s<a.length-1?Bb(a[s+1]):c}));return r_(e)&&e_(t,e,r_)&&o.push(" "),l&&o.unshift(l),c&&o.push(c),o}function gI(e,t){const n=String(e.value),r=[],a=[];let s=0;for(;s<=n.length;){t_.lastIndex=s;const c=t_.exec(n),u=c&&"index"in c?c.index:n.length;r.push(nme(n.slice(s,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),s=u+1}let o=-1,l;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(a.push(r[o]),l=void 0):r[o]?(typeof l=="number"&&a.push(l),a.push(r[o]),l=0):(o===0||o===r.length-1)&&a.push(0);return a}function tme(e){return[String(e.value)]}function nme(e,t,n){const r=[];let a=0,s;for(;a<e.length;){n_.lastIndex=a;const o=n_.exec(e);s=o?o.index:e.length,!a&&!s&&o&&!t&&r.push(""),a!==s&&r.push(e.slice(a,s)),a=o?s+o[0].length:s}return a!==s&&!n&&r.push(""),r.join(" ")}function vI(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 rme(e){return!!(e.properties||{}).hidden}function ame(e){return e.tagName==="td"||e.tagName==="th"}function ime(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function sme(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(a)+"[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(a)+e.IDENT_RE,relevance:0},p=t.optional(a)+e.IDENT_RE+"\\s*\\(",g=["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"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["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"],v=["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"],j={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},w={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},b=[w,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:b.concat([{begin:/\(/,end:/\)/,keywords:j,contains:b.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,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:j,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:j,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:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(N,E,w,b,[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:j,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function ome(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=sme(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function lme(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={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,a]};a.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}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],v={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["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"],w=["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:m,literal:y,built_in:[...x,...S,"set","shopt",...j,...w]},contains:[p,e.SHEBANG(),g,f,s,o,v,l,c,u,d,n]}}function cme(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(a)+"[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(a)+e.IDENT_RE,relevance:0},p=t.optional(a)+e.IDENT_RE+"\\s*\\(",y={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"},v=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:v.concat([{begin:/\(/,end:/\)/,keywords:y,contains:v.concat(["self"]),relevance:0}]),relevance:0},S={begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:y,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:y,disableAutodetect:!0,illegal:"</",contains:[].concat(x,S,v,[f,{begin:e.IDENT_RE+"::",keywords:y},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:y}}}function ume(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(a)+"[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(a)+e.IDENT_RE,relevance:0},p=t.optional(a)+e.IDENT_RE+"\\s*\\(",g=["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"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["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"],v=["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"],j={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},w={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},b=[w,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:b.concat([{begin:/\(/,end:/\)/,keywords:j,contains:b.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,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:j,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:j,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:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(N,E,w,b,[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:j,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function dme(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"],r=["default","false","null","true"],a=["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"],s=["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"],o={keyword:a.concat(s),built_in:t,literal:r},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:o},p=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},y=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[m,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[y,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const v={variants:[u,m,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},S=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",j={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,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"}},v,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,x,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,x,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:"("+S+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[v,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},j]}}const fme=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_-]*/}}),hme=["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"],pme=["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"],mme=[...hme,...pme],gme=["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(),vme=["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(),yme=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),bme=["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 xme(e){const t=e.regex,n=fme(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[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,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+vme.join("|")+")"},{begin:":(:)?("+yme.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+bme.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:gme.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+mme.join("|")+")\\b"}]}}function wme(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 Sme(e){const s={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:s,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:s,illegal:/["']/}]}]}}function kme(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 jme(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[r,s,a,o,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:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:h,className:"attr",starts:{end:/$/,contains:[r,l,s,a,o,n]}}]}}var eo="[0-9](_*[0-9])*",Jd=`\\.(${eo})`,ef="[0-9a-fA-F](_*[0-9a-fA-F])*",i_={className:"number",variants:[{begin:`(\\b(${eo})((${Jd})|\\.)?|(${Jd}))[eE][+-]?(${eo})[fFdD]?\\b`},{begin:`\\b(${eo})((${Jd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Jd})[fFdD]?\\b`},{begin:`\\b(${eo})[fFdD]\\b`},{begin:`\\b0[xX]((${ef})\\.?|(${ef})?\\.(${ef}))[pP][+-]?(${eo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ef})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function yI(e,t,n){return n===-1?"":e.replace(t,r=>yI(e,t,n-1))}function Nme(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+yI("(?:<"+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:["(?:"+r+"\\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,i_,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},i_,u]}}const s_="[A-Za-z$_][0-9A-Za-z$_]*",Eme=["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"],_me=["true","false","null","undefined","NaN","Infinity"],bI=["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"],xI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],wI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ame=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Cme=[].concat(wI,bI,xI);function Tme(e){const t=e.regex,n=(O,{after:U})=>{const C="</"+O[0].slice(1);return O.input.indexOf(C,U)!==-1},r=s_,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const C=O[0].length+O.index,Z=O.input[C];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:C})||U.ignoreMatch());let D;const P=O.input.substring(C);if(D=P.match(/^\s*=/)){U.ignoreMatch();return}if((D=P.match(/^\s+extends\s+/))&&D.index===0){U.ignoreMatch();return}}},l={$pattern:s_,keyword:Eme,literal:_me,built_in:Cme,"variable.language":Ame},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,{match:/\$\d+/},f];h.contains=S.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(S)});const j=[].concat(x,h.contains),w=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:w},N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={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:{_:[...bI,...xI]}},T={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,R([...wI,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:E},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),T,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,x,{match:/\$\d+/},f,E,{scope:"attr",match:r+t.lookahead(":"),relevance:0},$,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:z,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:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},B,M,N,F,{match:/\$[(.]/}]}}const Ome="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",Pme={scope:"number",match:Ome,relevance:0};function Rme(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,Pme,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var to="[0-9](_*[0-9])*",tf=`\\.(${to})`,nf="[0-9a-fA-F](_*[0-9a-fA-F])*",Mme={className:"number",variants:[{begin:`(\\b(${to})((${tf})|\\.)?|(${tf}))[eE][+-]?(${to})[fFdD]?\\b`},{begin:`\\b(${to})((${tf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${tf})[fFdD]?\\b`},{begin:`\\b(${to})[fFdD]\\b`},{begin:`\\b0[xX]((${nf})\\.?|(${nf})?\\.(${nf}))[pP][+-]?(${to})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${nf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ime(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+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,a]}]};a.contains.push(o);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(o,{className:"string"}),"self"]}]},u=Mme,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,r,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,o,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]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
195
|
+
`},u]}}const $me=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_-]*/}}),Lme=["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"],Dme=["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"],Bme=[...Lme,...Dme],zme=["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(),SI=["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(),kI=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Fme=["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(),Ume=SI.concat(kI).sort().reverse();function Wme(e){const t=$me(e),n=Ume,r="and or not only",a="[\\w-]+",s="("+a+"|@\\{"+a+"\\})",o=[],l=[],c=function(S){return{className:"string",begin:"~?"+S+".*?"+S}},u=function(S,j,w){return{className:S,begin:j,relevance:w}},d={$pattern:/[a-z-]+/,keyword:r,attribute:zme.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","@@?"+a,10),u("variable","@\\{"+a+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:o}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Fme.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},m={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}},y={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:h}},v={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,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","@\\{"+a+"\\}"),{begin:"\\b("+Bme.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+SI.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+kI.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:a+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[v]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,y,x,g,v,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function Hme(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},a=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],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:a.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:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function Gme(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]},r={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]},a={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={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,r,a,s,o]}}function qme(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},a={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}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={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(v=>{v.contains=v.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,s,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},a,r,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Kme(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 Vme(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"],r=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},o={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,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(m,y,v="\\1")=>{const x=v==="\\1"?v:t.concat(v,y);return t.concat(t.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,v,r)},p=(m,y,v)=>t.concat(t.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,v,r),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{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 s.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:g}}function Yme(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},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":(L,F)=>{F.data._beginMatch=L[1]||L[2]},"on:end":(L,F)=>{F.data._beginMatch!==L[1]&&F.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
|
|
196
|
+
]`,g={scope:"string",variants:[d,u,f,h]},m={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},y=["false","null","true"],v=["__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"],x=["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"],j={keyword:v,literal:(L=>{const F=[];return L.forEach(z=>{F.push(z),z.toLowerCase()===z?F.push(z.toUpperCase()):F.push(z.toLowerCase())}),F})(y),built_in:x},w=L=>L.map(F=>F.replace(/\|\d+$/,"")),b={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",w(x).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},N=t.concat(r,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{1:"title.class",3:"variable.constant"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},T={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},A={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[T,o,E,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,b]},M={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",w(v).join("\\b|"),"|",w(x).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[A]};A.contains.push(M);const R=[T,E,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,b],B={begin:t.concat(/#\[\s*\\?/,t.either(a,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...R]},...R,{scope:"meta",variants:[{match:a},{match:s}]}]};return{case_insensitive:!1,keywords:j,contains:[B,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/},o,M,E,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},b,{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:j,contains:["self",B,o,E,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m]}]},{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]},g,m]}}function Xme(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 Qme(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Zme(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["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:r,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})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,m,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,m,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{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:[m,v,f]}]}}function Jme(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function ege(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=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]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=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:[a,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function tge(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(r,/(::\w+)*/),o={"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:o},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])*",g={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"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},b=[f,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:o},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{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=b,m.contains=b;const A=[{begin:/^\s*=>/,starts:{end:"$",contains:b}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:b}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(A).concat(u).concat(b)}}function nge(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),a=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,t.lookahead(/\s*\(/))},o="([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_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:d}},{className:"punctuation",begin:"->"},s]}}const rge=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_-]*/}}),age=["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"],ige=["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"],sge=[...age,...ige],oge=["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(),lge=["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(),cge=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),uge=["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 dge(e){const t=rge(e),n=cge,r=lge,a="@[a-z-]+",s="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("+sge.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+uge.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:a,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:oge.join(" ")},contains:[{begin:a,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 fge(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function hge(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["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,g=[...u,...c].filter(w=>!d.includes(w)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function x(w){return t.concat(/\b/,t.either(...w.map(b=>b.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:x(h),relevance:0};function j(w,{exceptions:b,when:N}={}){const E=N;return b=b||[],w.map(T=>T.match(/\|\d+$/)||b.includes(T)?T:E(T)?`${T}|0`:T)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(g,{when:w=>w.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:x(o)},S,v,m,r,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function jI(e){return e?typeof e=="string"?e:e.source:null}function cc(e){return nt("(?=",e,")")}function nt(...e){return e.map(n=>jI(n)).join("")}function pge(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function On(...e){return"("+(pge(e).capture?"":"?:")+e.map(r=>jI(r)).join("|")+")"}const v0=e=>nt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),mge=["Protocol","Type"].map(v0),o_=["init","self"].map(v0),gge=["Any","Self"],Qg=["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"],l_=["false","nil","true"],vge=["assignment","associativity","higherThan","left","lowerThan","none","right"],yge=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],c_=["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"],NI=On(/[/=\-+!*%<>&|^~?]/,/[\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]/),EI=On(NI,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Zg=nt(NI,EI,"*"),_I=On(/[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]/),Jh=On(_I,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Zr=nt(_I,Jh,"*"),rf=nt(/[A-Z]/,Jh,"*"),bge=["attached","autoclosure",nt(/convention\(/,On("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,Zr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],xge=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function wge(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],a={match:[/\./,On(...mge,...o_)],className:{2:"keyword"}},s={match:nt(/\./,On(...Qg)),relevance:0},o=Qg.filter(ge=>typeof ge=="string").concat(["_|0"]),l=Qg.filter(ge=>typeof ge!="string").concat(gge).map(v0),c={variants:[{className:"keyword",match:On(...l,...o_)}]},u={$pattern:On(/\b\w+/,/#\w+/),keyword:o.concat(yge),literal:l_},d=[a,s,c],f={match:nt(/\./,On(...c_)),relevance:0},h={className:"built_in",match:nt(/\b/,On(...c_),/(?=\()/)},p=[f,h],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:Zg},{match:`\\.(\\.|${EI})+`}]},y=[g,m],v="([0-9]_*)+",x="([0-9a-fA-F]_*)+",S={className:"number",relevance:0,variants:[{match:`\\b(${v})(\\.(${v}))?([eE][+-]?(${v}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${v}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},j=(ge="")=>({className:"subst",variants:[{match:nt(/\\/,ge,/[0\\tnr"']/)},{match:nt(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),w=(ge="")=>({className:"subst",match:nt(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),b=(ge="")=>({className:"subst",label:"interpol",begin:nt(/\\/,ge,/\(/),end:/\)/}),N=(ge="")=>({begin:nt(ge,/"""/),end:nt(/"""/,ge),contains:[j(ge),w(ge),b(ge)]}),E=(ge="")=>({begin:nt(ge,/"/),end:nt(/"/,ge),contains:[j(ge),b(ge)]}),T={className:"string",variants:[N(),N("#"),N("##"),N("###"),E(),E("#"),E("##"),E("###")]},A=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],M={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:A},R=ge=>{const ze=nt(ge,/\//),me=nt(/\//,ge);return{begin:ze,end:me,contains:[...A,{scope:"comment",begin:`#(?!.*${me})`,end:/$/}]}},B={scope:"regexp",variants:[R("###"),R("##"),R("#"),M]},L={match:nt(/`/,Zr,/`/)},F={className:"variable",match:/\$\d+/},z={className:"variable",match:`\\$${Jh}+`},$=[L,F,z],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:xge,contains:[...y,S,T]}]}},U={scope:"keyword",match:nt(/@/,On(...bge),cc(On(/\(/,/\s+/)))},C={scope:"meta",match:nt(/@/,Zr)},Z=[O,U,C],D={match:cc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:nt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Jh,"+")},{className:"type",match:rf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,cc(rf)),relevance:0}]},P={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...Z,g,D]};D.contains.push(P);const ie={match:nt(Zr,/\s*:/),keywords:"_|0",relevance:0},ve={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ie,...r,B,...d,...p,...y,S,T,...$,...Z,D]},pe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,D]},Te={begin:On(cc(nt(Zr,/\s*:/)),cc(nt(Zr,/\s+/,Zr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Zr}]},q={begin:/\(/,end:/\)/,keywords:u,contains:[Te,...r,...d,...y,S,T,...Z,D,ve],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,On(L.match,Zr,Zg)],className:{1:"keyword",3:"title.function"},contains:[pe,q,t],illegal:[/\[/,/%/]},oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[pe,q,t],illegal:/\[|%/},ue={match:[/operator/,/\s+/,Zg],className:{1:"keyword",3:"title"}},V={begin:[/precedencegroup/,/\s+/,rf],className:{1:"keyword",3:"title"},contains:[D],keywords:[...vge,...l_],end:/}/},_e={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},je={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ne={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Zr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[pe,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:rf},...d],relevance:0}]};for(const ge of T.variants){const ze=ge.contains.find(ft=>ft.label==="interpol");ze.keywords=u;const me=[...d,...p,...y,S,T,...$];ze.contains=[...me,{begin:/\(/,end:/\)/,contains:["self",...me]}]}return{name:"Swift",keywords:u,contains:[...r,X,oe,_e,je,Ne,ue,V,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},B,...d,...p,...y,S,T,...$,...Z,D,ve]}}const ep="[A-Za-z$_][0-9A-Za-z$_]*",AI=["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"],CI=["true","false","null","undefined","NaN","Infinity"],TI=["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"],OI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],PI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],RI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],MI=[].concat(PI,TI,OI);function Sge(e){const t=e.regex,n=(O,{after:U})=>{const C="</"+O[0].slice(1);return O.input.indexOf(C,U)!==-1},r=ep,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const C=O[0].length+O.index,Z=O.input[C];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:C})||U.ignoreMatch());let D;const P=O.input.substring(C);if(D=P.match(/^\s*=/)){U.ignoreMatch();return}if((D=P.match(/^\s+extends\s+/))&&D.index===0){U.ignoreMatch();return}}},l={$pattern:ep,keyword:AI,literal:CI,built_in:MI,"variable.language":RI},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,{match:/\$\d+/},f];h.contains=S.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(S)});const j=[].concat(x,h.contains),w=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:w},N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={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:{_:[...TI,...OI]}},T={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,R([...PI,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:E},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),T,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,x,{match:/\$\d+/},f,E,{scope:"attr",match:r+t.lookahead(":"),relevance:0},$,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:z,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:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},B,M,N,F,{match:/\$[(.]/}]}}function kge(e){const t=e.regex,n=Sge(e),r=ep,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},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:ep,keyword:AI.concat(c),literal:CI,built_in:MI.concat(a),"variable.language":RI},d={className:"meta",begin:"@"+r},f=(m,y,v)=>{const x=m.contains.findIndex(S=>S.label===y);if(x===-1)throw new Error("can not find mode to replace");m.contains.splice(x,1,v)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(m=>m.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,o,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function jge(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\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(s,a),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,a),/ +/,t.either(o,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,r,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 Nge(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["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"],a={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={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:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,a,e.QUOTE_STRING_MODE,c,u,l]}}function Ege(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{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:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{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:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{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 _ge(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},l=e.inherit(o,{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},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{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},g,m,s,o],v=[...y];return v.pop(),v.push(l),p.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}const Age={arduino:ome,bash:lme,c:cme,cpp:ume,csharp:dme,css:xme,diff:wme,go:Sme,graphql:kme,ini:jme,java:Nme,javascript:Tme,json:Rme,kotlin:Ime,less:Wme,lua:Hme,makefile:Gme,markdown:qme,objectivec:Kme,perl:Vme,php:Yme,"php-template":Xme,plaintext:Qme,python:Zme,"python-repl":Jme,r:ege,ruby:tge,rust:nge,scss:dge,shell:fge,sql:hge,swift:wge,typescript:kge,vbnet:jge,wasm:Nge,xml:Ege,yaml:_ge};function II(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],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&II(n)}),e}class u_{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function $I(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function hi(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const a in r)n[a]=r[a]}),n}const Cge="</span>",d_=e=>!!e.scope,Tge=(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((r,a)=>`${r}${"_".repeat(a+1)}`)].join(" ")}return`${t}${e}`};class Oge{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=$I(t)}openNode(t){if(!d_(t))return;const n=Tge(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){d_(t)&&(this.buffer+=Cge)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const f_=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class y0{constructor(){this.rootNode=f_(),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=f_({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(r=>this._walk(t,r)),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=>{y0._collapse(n)}))}}class Pge extends y0{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Oge(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Du(e){return e?typeof e=="string"?e:e.source:null}function LI(e){return $s("(?=",e,")")}function Rge(e){return $s("(?:",e,")*")}function Mge(e){return $s("(?:",e,")?")}function $s(...e){return e.map(n=>Du(n)).join("")}function Ige(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function b0(...e){return"("+(Ige(e).capture?"":"?:")+e.map(r=>Du(r)).join("|")+")"}function DI(e){return new RegExp(e.toString()+"|").exec("").length-1}function $ge(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Lge=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function x0(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const a=n;let s=Du(r),o="";for(;s.length>0;){const l=Lge.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+a):(o+=l[0],l[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}const Dge=/\b\B/,BI="[a-zA-Z]\\w*",w0="[a-zA-Z_]\\w*",zI="\\b\\d+(\\.\\d+)?",FI="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",UI="\\b(0b[01]+)",Bge="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",zge=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=$s(t,/.*\b/,e.binary,/\b.*/)),hi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Bu={begin:"\\\\[\\s\\S]",relevance:0},Fge={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Bu]},Uge={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Bu]},Wge={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/},vm=function(e,t,n={}){const r=hi({scope:"comment",begin:e,end:t,contains:[]},n);r.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 a=b0("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 r.contains.push({begin:$s(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Hge=vm("//","$"),Gge=vm("/\\*","\\*/"),qge=vm("#","$"),Kge={scope:"number",begin:zI,relevance:0},Vge={scope:"number",begin:FI,relevance:0},Yge={scope:"number",begin:UI,relevance:0},Xge={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Bu,{begin:/\[/,end:/\]/,relevance:0,contains:[Bu]}]},Qge={scope:"title",begin:BI,relevance:0},Zge={scope:"title",begin:w0,relevance:0},Jge={begin:"\\.\\s*"+w0,relevance:0},eve=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 af=Object.freeze({__proto__:null,APOS_STRING_MODE:Fge,BACKSLASH_ESCAPE:Bu,BINARY_NUMBER_MODE:Yge,BINARY_NUMBER_RE:UI,COMMENT:vm,C_BLOCK_COMMENT_MODE:Gge,C_LINE_COMMENT_MODE:Hge,C_NUMBER_MODE:Vge,C_NUMBER_RE:FI,END_SAME_AS_BEGIN:eve,HASH_COMMENT_MODE:qge,IDENT_RE:BI,MATCH_NOTHING_RE:Dge,METHOD_GUARD:Jge,NUMBER_MODE:Kge,NUMBER_RE:zI,PHRASAL_WORDS_MODE:Wge,QUOTE_STRING_MODE:Uge,REGEXP_MODE:Xge,RE_STARTERS_RE:Bge,SHEBANG:zge,TITLE_MODE:Qge,UNDERSCORE_IDENT_RE:w0,UNDERSCORE_TITLE_MODE:Zge});function tve(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function nve(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function rve(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=tve,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ave(e,t){Array.isArray(e.illegal)&&(e.illegal=b0(...e.illegal))}function ive(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 sve(e,t){e.relevance===void 0&&(e.relevance=1)}const ove=(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(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=$s(n.beforeMatch,LI(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},lve=["of","and","for","in","not","or","if","then","parent","list","value"],cve="keyword";function WI(e,t,n=cve){const r=Object.create(null);return typeof e=="string"?a(n,e.split(" ")):Array.isArray(e)?a(n,e):Object.keys(e).forEach(function(s){Object.assign(r,WI(e[s],t,s))}),r;function a(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");r[c[0]]=[s,uve(c[0],c[1])]})}}function uve(e,t){return t?Number(t):dve(e)?0:1}function dve(e){return lve.includes(e.toLowerCase())}const h_={},ms=e=>{console.error(e)},p_=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Zs=(e,t)=>{h_[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),h_[`${e}/${t}`]=!0)},tp=new Error;function HI(e,t,{key:n}){let r=0;const a=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+r]=a[l],s[l+r]=!0,r+=DI(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function fve(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ms("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),tp;if(typeof e.beginScope!="object"||e.beginScope===null)throw ms("beginScope must be object"),tp;HI(e,e.begin,{key:"beginScope"}),e.begin=x0(e.begin,{joinWith:""})}}function hve(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ms("skip, excludeEnd, returnEnd not compatible with endScope: {}"),tp;if(typeof e.endScope!="object"||e.endScope===null)throw ms("endScope must be object"),tp;HI(e,e.end,{key:"endScope"}),e.end=x0(e.end,{joinWith:""})}}function pve(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function mve(e){pve(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),fve(e),hve(e)}function gve(e){function t(o,l){return new RegExp(Du(o),"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+=DI(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(x0(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 r{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 a(o){const l=new r;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[nve,ive,mve,ove].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[rve,ave,sve].forEach(d=>d(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=WI(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=Du(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return vve(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.starts,l),c.matcher=a(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=hi(e.classNameAliases||{}),s(e)}function GI(e){return e?e.endsWithParent||GI(e.starts):!1}function vve(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return hi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:GI(e)?hi(e,{starts:e.starts?hi(e.starts):null}):Object.isFrozen(e)?hi(e):e}var yve="11.11.2";class bve extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Jg=$I,m_=hi,g_=Symbol("nomatch"),xve=7,qI=function(e){const t=Object.create(null),n=Object.create(null),r=[];let a=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={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:Pge};function c(z){return l.noHighlightRe.test(z)}function u(z){let $=z.className+" ";$+=z.parentNode?z.parentNode.className:"";const O=l.languageDetectRe.exec($);if(O){const U=E(O[1]);return U||(p_(s.replace("{}",O[1])),p_("Falling back to no-highlight mode for this block.",z)),U?O[1]:"no-highlight"}return $.split(/\s+/).find(U=>c(U)||E(U))}function d(z,$,O){let U="",C="";typeof $=="object"?(U=z,O=$.ignoreIllegals,C=$.language):(Zs("10.7.0","highlight(lang, code, ...args) has been deprecated."),Zs("10.7.0",`Please use highlight(code, options) instead.
|
|
197
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),C=z,U=$),O===void 0&&(O=!0);const Z={code:U,language:C};L("before:highlight",Z);const D=Z.result?Z.result:f(Z.language,Z.code,O);return D.code=Z.code,L("after:highlight",D),D}function f(z,$,O,U){const C=Object.create(null);function Z(W,Y){return W.keywords[Y]}function D(){if(!me.keywords){Ge.addText(Ae);return}let W=0;me.keywordPatternRe.lastIndex=0;let Y=me.keywordPatternRe.exec(Ae),se="";for(;Y;){se+=Ae.substring(W,Y.index);const he=Ne.case_insensitive?Y[0].toLowerCase():Y[0],xe=Z(me,he);if(xe){const[Fe,Rt]=xe;if(Ge.addText(se),se="",C[he]=(C[he]||0)+1,C[he]<=xve&&(Ze+=Rt),Fe.startsWith("_"))se+=Y[0];else{const xt=Ne.classNameAliases[Fe]||Fe;ve(Y[0],xt)}}else se+=Y[0];W=me.keywordPatternRe.lastIndex,Y=me.keywordPatternRe.exec(Ae)}se+=Ae.substring(W),Ge.addText(se)}function P(){if(Ae==="")return;let W=null;if(typeof me.subLanguage=="string"){if(!t[me.subLanguage]){Ge.addText(Ae);return}W=f(me.subLanguage,Ae,!0,ft[me.subLanguage]),ft[me.subLanguage]=W._top}else W=p(Ae,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(Ze+=W.relevance),Ge.__addSublanguage(W._emitter,W.language)}function ie(){me.subLanguage!=null?P():D(),Ae=""}function ve(W,Y){W!==""&&(Ge.startScope(Y),Ge.addText(W),Ge.endScope())}function pe(W,Y){let se=1;const he=Y.length-1;for(;se<=he;){if(!W._emit[se]){se++;continue}const xe=Ne.classNameAliases[W[se]]||W[se],Fe=Y[se];xe?ve(Fe,xe):(Ae=Fe,D(),Ae=""),se++}}function Te(W,Y){return W.scope&&typeof W.scope=="string"&&Ge.openNode(Ne.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(ve(Ae,Ne.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Ae=""):W.beginScope._multi&&(pe(W.beginScope,Y),Ae="")),me=Object.create(W,{parent:{value:me}}),me}function q(W,Y,se){let he=$ge(W.endRe,se);if(he){if(W["on:end"]){const xe=new u_(W);W["on:end"](Y,xe),xe.isMatchIgnored&&(he=!1)}if(he){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return q(W.parent,Y,se)}function X(W){return me.matcher.regexIndex===0?(Ae+=W[0],1):(bt=!0,0)}function oe(W){const Y=W[0],se=W.rule,he=new u_(se),xe=[se.__beforeBegin,se["on:begin"]];for(const Fe of xe)if(Fe&&(Fe(W,he),he.isMatchIgnored))return X(Y);return se.skip?Ae+=Y:(se.excludeBegin&&(Ae+=Y),ie(),!se.returnBegin&&!se.excludeBegin&&(Ae=Y)),Te(se,W),se.returnBegin?0:Y.length}function ue(W){const Y=W[0],se=$.substring(W.index),he=q(me,W,se);if(!he)return g_;const xe=me;me.endScope&&me.endScope._wrap?(ie(),ve(Y,me.endScope._wrap)):me.endScope&&me.endScope._multi?(ie(),pe(me.endScope,W)):xe.skip?Ae+=Y:(xe.returnEnd||xe.excludeEnd||(Ae+=Y),ie(),xe.excludeEnd&&(Ae=Y));do me.scope&&Ge.closeNode(),!me.skip&&!me.subLanguage&&(Ze+=me.relevance),me=me.parent;while(me!==he.parent);return he.starts&&Te(he.starts,W),xe.returnEnd?0:Y.length}function V(){const W=[];for(let Y=me;Y!==Ne;Y=Y.parent)Y.scope&&W.unshift(Y.scope);W.forEach(Y=>Ge.openNode(Y))}let _e={};function je(W,Y){const se=Y&&Y[0];if(Ae+=W,se==null)return ie(),0;if(_e.type==="begin"&&Y.type==="end"&&_e.index===Y.index&&se===""){if(Ae+=$.slice(Y.index,Y.index+1),!a){const he=new Error(`0 width match regex (${z})`);throw he.languageName=z,he.badRule=_e.rule,he}return 1}if(_e=Y,Y.type==="begin")return oe(Y);if(Y.type==="illegal"&&!O){const he=new Error('Illegal lexeme "'+se+'" for mode "'+(me.scope||"<unnamed>")+'"');throw he.mode=me,he}else if(Y.type==="end"){const he=ue(Y);if(he!==g_)return he}if(Y.type==="illegal"&&se==="")return Y.index===$.length||(Ae+=`
|
|
198
|
+
`),1;if(An>1e5&&An>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ae+=se,se.length}const Ne=E(z);if(!Ne)throw ms(s.replace("{}",z)),new Error('Unknown language: "'+z+'"');const ge=gve(Ne);let ze="",me=U||ge;const ft={},Ge=new l.__emitter(l);V();let Ae="",Ze=0,yt=0,An=0,bt=!1;try{if(Ne.__emitTokens)Ne.__emitTokens($,Ge);else{for(me.matcher.considerAll();;){An++,bt?bt=!1:me.matcher.considerAll(),me.matcher.lastIndex=yt;const W=me.matcher.exec($);if(!W)break;const Y=$.substring(yt,W.index),se=je(Y,W);yt=W.index+se}je($.substring(yt))}return Ge.finalize(),ze=Ge.toHTML(),{language:z,value:ze,relevance:Ze,illegal:!1,_emitter:Ge,_top:me}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:z,value:Jg($),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:yt,context:$.slice(yt-100,yt+100),mode:W.mode,resultSoFar:ze},_emitter:Ge};if(a)return{language:z,value:Jg($),illegal:!1,relevance:0,errorRaised:W,_emitter:Ge,_top:me};throw W}}function h(z){const $={value:Jg(z),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return $._emitter.addText(z),$}function p(z,$){$=$||l.languages||Object.keys(t);const O=h(z),U=$.filter(E).filter(A).map(ie=>f(ie,z,!1));U.unshift(O);const C=U.sort((ie,ve)=>{if(ie.relevance!==ve.relevance)return ve.relevance-ie.relevance;if(ie.language&&ve.language){if(E(ie.language).supersetOf===ve.language)return 1;if(E(ve.language).supersetOf===ie.language)return-1}return 0}),[Z,D]=C,P=Z;return P.secondBest=D,P}function g(z,$,O){const U=$&&n[$]||O;z.classList.add("hljs"),z.classList.add(`language-${U}`)}function m(z){let $=null;const O=u(z);if(c(O))return;if(L("before:highlightElement",{el:z,language:O}),z.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",z);return}if(z.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(z)),l.throwUnescapedHTML))throw new bve("One of your code blocks includes unescaped HTML.",z.innerHTML);$=z;const U=$.textContent,C=O?d(U,{language:O,ignoreIllegals:!0}):p(U);z.innerHTML=C.value,z.dataset.highlighted="yes",g(z,O,C.language),z.result={language:C.language,re:C.relevance,relevance:C.relevance},C.secondBest&&(z.secondBest={language:C.secondBest.language,relevance:C.secondBest.relevance}),L("after:highlightElement",{el:z,result:C,text:U})}function y(z){l=m_(l,z)}const v=()=>{j(),Zs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){j(),Zs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function j(){function z(){j()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",z,!1),S=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function w(z,$){let O=null;try{O=$(e)}catch(U){if(ms("Language definition for '{}' could not be registered.".replace("{}",z)),a)ms(U);else throw U;O=o}O.name||(O.name=z),t[z]=O,O.rawDefinition=$.bind(null,e),O.aliases&&T(O.aliases,{languageName:z})}function b(z){delete t[z];for(const $ of Object.keys(n))n[$]===z&&delete n[$]}function N(){return Object.keys(t)}function E(z){return z=(z||"").toLowerCase(),t[z]||t[n[z]]}function T(z,{languageName:$}){typeof z=="string"&&(z=[z]),z.forEach(O=>{n[O.toLowerCase()]=$})}function A(z){const $=E(z);return $&&!$.disableAutodetect}function M(z){z["before:highlightBlock"]&&!z["before:highlightElement"]&&(z["before:highlightElement"]=$=>{z["before:highlightBlock"](Object.assign({block:$.el},$))}),z["after:highlightBlock"]&&!z["after:highlightElement"]&&(z["after:highlightElement"]=$=>{z["after:highlightBlock"](Object.assign({block:$.el},$))})}function R(z){M(z),r.push(z)}function B(z){const $=r.indexOf(z);$!==-1&&r.splice($,1)}function L(z,$){const O=z;r.forEach(function(U){U[O]&&U[O]($)})}function F(z){return Zs("10.7.0","highlightBlock will be removed entirely in v12.0"),Zs("10.7.0","Please use highlightElement now."),m(z)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:j,highlightElement:m,highlightBlock:F,configure:y,initHighlighting:v,initHighlightingOnLoad:x,registerLanguage:w,unregisterLanguage:b,listLanguages:N,getLanguage:E,registerAliases:T,autoDetection:A,inherit:m_,addPlugin:R,removePlugin:B}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString=yve,e.regex={concat:$s,lookahead:LI,either:b0,optional:Mge,anyNumberOfTimes:Rge};for(const z in af)typeof af[z]=="object"&&II(af[z]);return Object.assign(e,af),e},ol=qI({});ol.newInstance=()=>qI({});var wve=ol;ol.HighlightJS=ol;ol.default=ol;const Sve=Qe(wve),v_={},kve="hljs-";function jve(e){const t=Sve.newInstance();return e&&s(e),{highlight:n,highlightAuto:r,listLanguages:a,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||v_,h=typeof f.prefix=="string"?f.prefix:kve;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Nve,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 g=p._emitter.root,m=g.data;return m.language=p.language,m.relevance=p.relevance,g}function r(c,u){const f=(u||v_).subset||a();let h=-1,p=0,g;for(;++h<f.length;){const m=f[h];if(!t.getLanguage(m))continue;const y=n(m,c,u);y.data&&y.data.relevance!==void 0&&y.data.relevance>p&&(p=y.data.relevance,g=y)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function a(){return t.listLanguages()}function s(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 o(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 Nve{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],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],a=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:a}):r.children.push(...a)}openNode(t){const n=this,r=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),a=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};a.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Eve={};function _ve(e){const t=e||Eve,n=t.aliases,r=t.detect||!1,a=t.languages||Age,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=jve(a);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){gm(d,"element",function(h,p,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=Ave(h);if(m===!1||!m&&!r||m&&s&&s.includes(m))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const y=Jpe(h,{whitespace:"pre"});let v;try{v=m?u.highlight(m,y,{prefix:o}):u.highlightAuto(y,{prefix:o,subset:l})}catch(x){const S=x;if(m&&/Unknown language/.test(S.message)){f.message("Cannot highlight as `"+m+"`, it’s not registered",{ancestors:[g,h],cause:S,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw S}!m&&v.data&&v.data.language&&h.properties.className.push("language-"+v.data.language),v.children.length>0&&(h.children=v.children)})}}function Ave(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const a=String(t[n]);if(a==="no-highlight"||a==="nohighlight")return!1;!r&&a.slice(0,5)==="lang-"&&(r=a.slice(5)),!r&&a.slice(0,9)==="language-"&&(r=a.slice(9))}return r}const np="[A-Za-z$_][0-9A-Za-z$_]*",KI=["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"],VI=["true","false","null","undefined","NaN","Infinity"],YI=["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"],XI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],QI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ZI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],JI=[].concat(QI,YI,XI);function Cve(e){const t=e.regex,n=(O,{after:U})=>{const C="</"+O[0].slice(1);return O.input.indexOf(C,U)!==-1},r=np,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const C=O[0].length+O.index,Z=O.input[C];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:C})||U.ignoreMatch());let D;const P=O.input.substring(C);if(D=P.match(/^\s*=/)){U.ignoreMatch();return}if((D=P.match(/^\s+extends\s+/))&&D.index===0){U.ignoreMatch();return}}},l={$pattern:np,keyword:KI,literal:VI,built_in:JI,"variable.language":ZI},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,{match:/\$\d+/},f];h.contains=S.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(S)});const j=[].concat(x,h.contains),w=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:w},N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={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:{_:[...YI,...XI]}},T={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,R([...QI,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:E},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),T,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,x,{match:/\$\d+/},f,E,{scope:"attr",match:r+t.lookahead(":"),relevance:0},$,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:z,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:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},B,M,N,F,{match:/\$[(.]/}]}}function y_(e){const t=e.regex,n=Cve(e),r=np,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},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:np,keyword:KI.concat(c),literal:VI,built_in:JI.concat(a),"variable.language":ZI},d={className:"meta",begin:"@"+r},f=(m,y,v)=>{const x=m.contains.findIndex(S=>S.label===y);if(x===-1)throw new Error("can not find mode to replace");m.contains.splice(x,1,v)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(m=>m.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,o,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}const b_="[A-Za-z$_][0-9A-Za-z$_]*",Tve=["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"],Ove=["true","false","null","undefined","NaN","Infinity"],e$=["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"],t$=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],n$=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Pve=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],Rve=[].concat(n$,e$,t$);function x_(e){const t=e.regex,n=(O,{after:U})=>{const C="</"+O[0].slice(1);return O.input.indexOf(C,U)!==-1},r=b_,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const C=O[0].length+O.index,Z=O.input[C];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:C})||U.ignoreMatch());let D;const P=O.input.substring(C);if(D=P.match(/^\s*=/)){U.ignoreMatch();return}if((D=P.match(/^\s+extends\s+/))&&D.index===0){U.ignoreMatch();return}}},l={$pattern:b_,keyword:Tve,literal:Ove,built_in:Rve,"variable.language":Pve},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,{match:/\$\d+/},f];h.contains=S.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(S)});const j=[].concat(x,h.contains),w=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:w},N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},E={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:{_:[...e$,...t$]}},T={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,R([...n$,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:E},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),T,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,x,{match:/\$\d+/},f,E,{scope:"attr",match:r+t.lookahead(":"),relevance:0},$,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:z,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:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},B,M,N,F,{match:/\$[(.]/}]}}const Mve="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",Ive={scope:"number",match:Mve,relevance:0};function $ve(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,Ive,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Lve(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={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,a]};a.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}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],v={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["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"],w=["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:m,literal:y,built_in:[...x,...S,"set","shopt",...j,...w]},contains:[p,e.SHEBANG(),g,f,s,o,v,l,c,u,d,n]}}function w_(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function S_(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","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","sentinel","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:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,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:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,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})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,m,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,m,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{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:[m,v,f]}]}}function k_(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},a={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}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={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(v=>{v.contains=v.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,s,r,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},a,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function j_(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},l=e.inherit(o,{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},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{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},g,m,s,o],v=[...y];return v.pop(),v.push(l),p.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}function Dve(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 Bve(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["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,g=[...u,...c].filter(w=>!d.includes(w)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function x(w){return t.concat(/\b/,t.either(...w.map(b=>b.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:x(h),relevance:0};function j(w,{exceptions:b,when:N}={}){const E=N;return b=b||[],w.map(T=>T.match(/\|\d+$/)||b.includes(T)?T:E(T)?`${T}|0`:T)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(g,{when:w=>w.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:x(o)},S,v,m,r,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function N_(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{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:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{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:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{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"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{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}]}]}}const zve=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,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},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_-]*/}}),Fve=["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"],Uve=["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"],Wve=[...Fve,...Uve],Hve=["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(),Gve=["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(),qve=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Kve=["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","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","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 Vve(e){const t=e.regex,n=zve(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[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,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Gve.join("|")+")"},{begin:":(:)?("+qve.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Kve.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Hve.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Wve.join("|")+")\\b"}]}}function E_(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}const Yve={ts:y_,typescript:y_,js:x_,javascript:x_,json:$ve,bash:Lve,shell:w_,sh:w_,python:S_,py:S_,markdown:k_,md:k_,yaml:j_,yml:j_,diff:Dve,sql:Bve,html:N_,xml:N_,css:Vve,text:E_,plaintext:E_};function r$(e){if(e==null)return"";const t=e;return typeof t.value=="string"?t.value:Array.isArray(t.children)?t.children.map(r$).join(""):""}function Xve({lang:e,code:t,children:n}){const[r,a]=k.useState(!1),s=async()=>{var o;try{await((o=navigator.clipboard)==null?void 0:o.writeText(t)),a(!0),setTimeout(()=>a(!1),1500)}catch{}};return i.jsxs("div",{className:"md-code-block",children:[i.jsxs("div",{className:"md-code-head",children:[i.jsx("span",{className:"md-code-lang",children:e}),i.jsx("button",{type:"button",className:"md-code-copy",onClick:()=>void s(),children:r?"✓ Copied":"⧉ Copy"})]}),i.jsx("pre",{className:"md-code-pre",children:i.jsx("code",{children:n})})]})}function Qve({node:e,children:t}){var o,l,c,u;const n=(o=e==null?void 0:e.children)==null?void 0:o[0],a=((u=(Array.isArray((l=n==null?void 0:n.properties)==null?void 0:l.className)?(c=n==null?void 0:n.properties)==null?void 0:c.className:[]).find(d=>typeof d=="string"&&d.startsWith("language-")))==null?void 0:u.slice(9))??"text",s=k.useMemo(()=>r$(n),[n]);return i.jsx(Xve,{lang:a,code:s,children:t})}function __({text:e}){const t=k.useMemo(()=>({h1:({node:n,...r})=>i.jsx("h1",{className:"md-heading md-h1",...r}),h2:({node:n,...r})=>i.jsx("h2",{className:"md-heading md-h2",...r}),h3:({node:n,...r})=>i.jsx("h3",{className:"md-heading md-h3",...r}),h4:({node:n,...r})=>i.jsx("h4",{className:"md-heading md-h4",...r}),h5:({node:n,...r})=>i.jsx("h5",{className:"md-heading md-h5",...r}),h6:({node:n,...r})=>i.jsx("h6",{className:"md-heading md-h6",...r}),p:({node:n,...r})=>i.jsx("p",{className:"md-para",...r}),ul:({node:n,...r})=>i.jsx("ul",{className:"md-list md-ul",...r}),ol:({node:n,...r})=>i.jsx("ol",{className:"md-list md-ol",...r}),blockquote:({node:n,...r})=>i.jsx("blockquote",{className:"md-quote",...r}),hr:({node:n,...r})=>i.jsx("hr",{className:"md-hr",...r}),table:({node:n,...r})=>i.jsx("table",{className:"md-table",...r}),a:({node:n,...r})=>i.jsx("a",{target:"_blank",rel:"noreferrer",...r}),pre:Qve}),[]);return i.jsx("div",{className:"md-root",children:i.jsx(Rfe,{remarkPlugins:[qpe],rehypePlugins:[[_ve,{languages:Yve}]],components:t,children:e??""})})}const A_=/```([\w+-]*)\n([\s\S]*?)```/g;function Zve(e){if(!e.trim())return[];const t=[];let n=null;for(const r of e.split(`
|
|
199
|
+
`))r.startsWith("diff --git ")?(n&&t.push(n),n={path:r.split(" b/").slice(1).join(" b/").replace(/^b\//,""),body:r}):n&&(n.body+=`
|
|
200
|
+
${r}`);return n&&t.push(n),t}function Jve(e){return/(^|\n)\s*(PASS|FAIL|✅|❌|✗|✓|\bok\b)/i.test(e)||/\b\d+\s+(passed|failed)\b/i.test(e)||/(tests?|build|suite|checks?)\s+(passed|failed|complete|green|red|ok)/i.test(e)||/(exit code|process exited|finished with)/i.test(e)}function eye(e){return/(^|\n)\s*(FAIL|❌|✗)/i.test(e)||/\bfailed\b/i.test(e)?"fail":/(^|\n)\s*(PASS|✅|✓)/i.test(e)||/\bpassed\b/i.test(e)?"pass":"unknown"}function tye(e){for(const t of e.split(`
|
|
201
|
+
`)){const n=t.trim();if(n)return n.length>80?`${n.slice(0,77)}…`:n}return"Command output"}const C_=/https?:\/\/[^\s)\]}"'<>]+/i,T_=/(🚀|deploy(?:ed|ment|ing)?|live at|published|available at|open the)/i;function nye(e){return e.replace(/[.,;:!?]+$/,"")}function rye(e){const t=e.split(`
|
|
202
|
+
`),n=[],r=new Set;for(let a=0;a<t.length;a+=1){const s=t[a];let o=s.match(T_);!o&&a+1<t.length&&/deploy(?:ed|ment|ing)?:\s*$/i.test(s.trim())&&(o=t[a+1].match(T_));const l=s.match(C_)||(a+1<t.length?t[a+1].match(C_):null);if(!o||!l)continue;const c=nye(l[0]);r.has(c)||(r.add(c),n.push({url:c,title:s.trim().slice(0,80)||"Deployment"}))}return n}function O_(e){const t=[],n=[],r=[];A_.lastIndex=0;let a;for(;(a=A_.exec(e))!==null;){const s=(a[1]||"").toLowerCase(),o=a[2];if(s==="diff"||o.includes("diff --git ")){const l=Zve(o);l.length>0&&t.push({files:l,summary:`${l.length} file${l.length===1?"":"s"} changed`})}else Jve(o)&&n.push({verdict:eye(o),title:tye(o),body:o})}for(const s of rye(e))r.push(s);return{diffs:t,results:n,deploys:r}}const aye=/\x1b(?:\[[0-9;?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-Z\\-_])/g;function P_(e){return e?e.replace(aye,""):""}const R_=3e5,iye=2e3,sye=/\.(pdf|docx|xlsx|pptx)$/i,oye=/\.(png|jpe?g|gif|webp|bmp|tiff?)$/i,lye=/\.(txt|md|markdown|text|log|csv|tsv|json|xml|yaml|yml|html?|htaccess|css|js|mjs|cjs|jsx|ts|tsx|py|rb|go|rs|java|kt|c|h|cpp|cs|php|sh|bash|zsh|sql|ini|toml|cfg|conf|env)$/i;function cye(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function uye(e,t){const n=t.includes(0),r=t.length===0?1:t.reduce((a,s)=>s===9||s===10||s===13||s>=32&&s<127||s>=128?a+1:a,0)/t.length;return!n&&r>.9?{how:"text"}:sye.test(e)?{how:"binary"}:lye.test(e)?{how:"text"}:oye.test(e)?{how:"unsupported",reason:`"${e}" is an image, and this composer only sends text and documents. Save it into the project folder and ask me to describe it — I can read images from there.`}:{how:"unsupported",reason:`"${e}" is not a text file and not a document type I can read. Attach a PDF, DOCX, XLSX, PPTX, or a text/CSV/JSON/Markdown file — or put the file in the project folder and ask me to read it.`}}function dye(e){const t=["pending","running","done","blocked"].includes(e.status);return{id:e.id,description:e.description,status:t?e.status:"pending"}}function fye(e){return e==="read_file"||e==="glob"||e==="list_dir"?"📖":e==="edit_file"||e==="write_file"?"✏️":e==="run_terminal"||e==="run_cli"?"⚙️":e==="web_search"||e==="read_page"?"🌐":e==="delegate"||e==="spawn_subagents"?"👥":e==="ask_user"?"🤔":"🔧"}const hye={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error"};function gc({diff:e,selectable:t=!1,onCommitAccepted:n,lockedHint:r}){const[a,s]=k.useState(null),o=new Set(a??e.files.map(d=>d.path)),l=d=>{s(f=>{const h=f??e.files.map(p=>p.path);return h.includes(d)?h.filter(p=>p!==d):[...h,d]})},c=e.files.reduce((d,f)=>{var h;return d+(((h=f.body.match(/^\+/gm))==null?void 0:h.length)??0)},0),u=e.files.reduce((d,f)=>{var h;return d+(((h=f.body.match(/^-/gm))==null?void 0:h.length)??0)},0);return i.jsxs("div",{className:"chat-diff-card",children:[i.jsxs("div",{className:"chat-diff-head",children:[i.jsx("span",{className:"chat-diff-icon",children:"🔧"}),i.jsx("span",{className:"chat-diff-title",children:"git diff"}),i.jsxs("span",{className:"chat-diff-meta",children:[e.files.length," file",e.files.length===1?"":"s"," · +",c," −",u]})]}),i.jsx("div",{className:"chat-diff-files",children:e.files.map(d=>{const f=o.has(d.path);return i.jsxs("details",{className:`chat-diff-file${f?"":" chat-diff-file-rejected"}`,open:e.files.length===1,children:[i.jsxs("summary",{className:"chat-diff-file-path",children:[t?i.jsx("button",{type:"button",className:`chat-diff-toggle${f?" chat-diff-toggle-on":""}`,title:f?"Accepted — click to reject":"Rejected — click to accept",onClick:h=>{h.preventDefault(),h.stopPropagation(),l(d.path)},children:f?"✓":"✗"}):null,d.path]}),i.jsx("pre",{className:"chat-diff-body",children:d.body.split(`
|
|
203
|
+
`).map((h,p)=>{const g=h.startsWith("+")?"diff-add":h.startsWith("-")?"diff-del":h.startsWith("@@")?"diff-hunk":"";return i.jsx("div",{className:`chat-diff-line ${g}`,children:h||" "},p)})})]},d.path)})}),t&&n?i.jsxs("div",{className:"chat-diff-actions",children:[i.jsxs("button",{className:"admin-refresh-btn",type:"button",disabled:o.size===0,onClick:()=>n([...o]),children:["Commit accepted (",o.size,")"]}),i.jsx("span",{className:"admin-hint",children:"Only accepted files are committed — the agent re-confirms with a question card."})]}):r?i.jsx("div",{className:"chat-diff-actions",children:i.jsxs("span",{className:"admin-hint chat-diff-locked",children:["🔒 ",r]})}):null]})}function S0({text:e,label:t}){const[n,r]=k.useState(!1),a=async()=>{var s;try{await((s=navigator.clipboard)==null?void 0:s.writeText(e)),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return i.jsx("button",{type:"button",className:"chat-card-copy",title:`Copy ${t}`,onClick:()=>void a(),children:n?"✓ Copied":"⧉ Copy"})}function pye({result:e}){const t=e.verdict==="pass"?"✅":e.verdict==="fail"?"❌":"📋";return i.jsxs("div",{className:`chat-result-card chat-result-${e.verdict}`,children:[i.jsxs("div",{className:"chat-result-head",children:[i.jsx("span",{className:"chat-result-icon",children:t}),i.jsx("span",{className:"chat-result-title",children:e.title}),i.jsx("span",{className:"chat-result-meta",children:e.verdict}),i.jsx(S0,{text:e.body,label:"result output"})]}),i.jsx("pre",{className:"chat-result-body",children:e.body})]})}function mye({deploy:e}){return i.jsxs("div",{className:"chat-deploy-card",children:[i.jsxs("div",{className:"chat-deploy-head",children:[i.jsx("span",{className:"chat-deploy-icon",children:"🚀"}),i.jsx("span",{className:"chat-deploy-title",children:e.title||"Deployment"}),i.jsx(S0,{text:e.url,label:"deployment URL"})]}),i.jsx("a",{className:"chat-deploy-url",href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.url})]})}function gye({children:e}){const t=k.useRef(null),n=r=>{if(!t.current)return;const a=Array.from(t.current.querySelectorAll("[data-artifact-card]"));if(a.length===0)return;const s=a.indexOf(document.activeElement);let o=-1;r.key==="ArrowDown"?o=s+1>=a.length?0:s+1:r.key==="ArrowUp"?o=s-1<0?a.length-1:s-1:r.key==="Home"?o=0:r.key==="End"&&(o=a.length-1),o>=0&&o!==s&&(r.preventDefault(),a[o].focus())};return i.jsx("div",{className:"chat-artifacts",ref:t,role:"group","aria-label":"Artifacts",onKeyDown:n,children:e})}function vye({task:e,onCancel:t}){const n=e.status==="running",r=e.logs.map(a=>P_(a.text)).join(`
|
|
204
|
+
`);return i.jsxs("div",{className:`chat-task-card${n?" chat-task-running":e.status==="done"?" chat-task-ok":" chat-task-err"}`,children:[i.jsxs("div",{className:"chat-task-head",children:[i.jsx("span",{className:"chat-task-icon",children:"⚙️"}),i.jsx("code",{className:"chat-task-cmd",children:e.command}),i.jsx("span",{className:"chat-task-status",title:e.status,children:hye[e.status]}),!n&&e.exitCode!==null?i.jsxs("span",{className:"chat-task-exit",children:["exit ",e.exitCode]}):null,!n&&e.durationMs!==null?i.jsxs("span",{className:"chat-task-dur",children:[e.durationMs,"ms"]}):null,r?i.jsx(S0,{text:r,label:"task output"}):null,n&&t?i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:t,children:"⏹ Cancel"}):null]}),i.jsx("pre",{className:"chat-task-logs",role:"log",children:e.logs.length>0?e.logs.map((a,s)=>{const o=e.logs[s-1],l=o&&o.stream!==a.stream,c=P_(a.text)||" ";return i.jsxs("div",{children:[l?i.jsx("div",{className:`chat-task-log-sep chat-task-log-sep-${a.stream}`,"aria-hidden":"true",children:a.stream}):null,i.jsx("div",{className:`chat-task-log chat-task-log-${a.stream}`,children:c})]},s)}):i.jsx("div",{className:"admin-hint",children:n?"Waiting for output…":"(no output)"})})]})}function M_({draft:e,onAccept:t,onReject:n,onEdit:r}){const a=e.status??"pending",s=e.markdown.split(`
|
|
205
|
+
`),o=s.findIndex(c=>c.startsWith("# "))>=0?s.findIndex(c=>c.startsWith("# ")):0,l=s.slice(o,o+14).join(`
|
|
206
|
+
`);return i.jsxs("div",{className:`chat-draft-card${a==="saved"?" chat-draft-saved":""}${a==="rejected"?" chat-draft-rejected":""}`,children:[i.jsxs("div",{className:"chat-draft-head",children:[i.jsx("span",{className:"chat-draft-icon",children:"🧠"}),i.jsxs("span",{className:"chat-draft-title",children:["New skill draft: ",e.name]}),i.jsx("span",{className:"chat-draft-meta",children:"pending your review"})]}),i.jsx("p",{className:"chat-draft-desc",children:e.description}),i.jsx("pre",{className:"chat-draft-body",children:l}),a==="saving"?i.jsx("div",{className:"admin-hint",children:"Saving…"}):a==="saved"?i.jsx("div",{className:"admin-hint",children:"✅ Saved — the skill is live: load it in chat or see it in the Agent Hub Skills tab."}):a==="rejected"?i.jsx("div",{className:"admin-hint",children:"🗑️ Rejected — the draft was discarded, nothing was saved."}):i.jsxs("div",{className:"chat-draft-actions",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>t(e.name),children:"✅ Accept"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>r(e.name),children:"✏️ Edit"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>n(e.name),children:"↩ Reject"})]})]})}function yye({request:e,onSave:t}){const[n,r]=k.useState({}),[a,s]=k.useState(!1),o=e.missing.every(u=>{var d;return(d=n[u])==null?void 0:d.trim()}),l=e.missing.filter(u=>e.persisted[u]),c=e.missing.filter(u=>!e.persisted[u]);return i.jsxs("div",{className:"chat-secret-card",children:[i.jsxs("div",{className:"chat-secret-head",children:[i.jsx("span",{className:"chat-secret-icon",children:"🔐"}),i.jsxs("span",{className:"chat-secret-title",children:[e.skillName," needs environment variables"]})]}),l.length>0?i.jsxs("div",{className:"chat-secret-persisted",children:["Already configured: ",l.map(u=>i.jsx("code",{children:u},u)).join(", ")]}):null,c.length>0&&!a?i.jsxs("div",{className:"chat-secret-fields",children:[c.map(u=>i.jsxs("div",{className:"chat-secret-row",children:[i.jsxs("label",{className:"chat-secret-label",htmlFor:`secret-${u}`,children:[u,":"]}),i.jsx("input",{id:`secret-${u}`,className:"chat-secret-input",type:"password",placeholder:`Enter ${u} value…`,value:n[u]??"",onChange:d=>r(f=>({...f,[u]:d.target.value}))})]},u)),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!o,onClick:()=>{t(n),s(!0)},children:"💾 Save to ~/.buff/.env"})]}):a?i.jsx("div",{className:"admin-hint",children:"✅ Saved — the skill will pick up these values on next load."}):i.jsx("div",{className:"admin-hint",children:"All required env vars are already configured."})]})}function bye({result:e}){const[t,n]=k.useState(!1),r=e.success?"✅":"❌",a=e.success?"Success":`Failed (exit ${e.exitCode})`,s=e.success?"chat-exec-success":"chat-exec-failure",o=new Date(e.timestamp).toLocaleTimeString();return i.jsxs("div",{className:`chat-exec-card ${s}`,children:[i.jsxs("div",{className:"chat-exec-head",onClick:()=>n(!t),style:{cursor:"pointer"},children:[i.jsx("span",{className:"chat-exec-icon",children:"📜"}),i.jsx("span",{className:"chat-exec-title",children:e.skillName}),i.jsxs("span",{className:"chat-exec-status",children:[r," ",a]}),i.jsxs("span",{className:"chat-exec-meta",children:[e.runtime," · ",e.durationMs,"ms · ",o]}),i.jsx("span",{className:"chat-exec-expand",children:t?"▼":"▶"})]}),t&&i.jsxs("div",{className:"chat-exec-body",children:[e.stdout&&i.jsxs("div",{className:"chat-exec-section",children:[i.jsx("div",{className:"chat-exec-section-title",children:"stdout"}),i.jsx("pre",{className:"chat-exec-output",children:e.stdout})]}),e.stderr&&i.jsxs("div",{className:"chat-exec-section chat-exec-stderr",children:[i.jsx("div",{className:"chat-exec-section-title",children:"stderr"}),i.jsx("pre",{className:"chat-exec-output",children:e.stderr})]}),i.jsxs("div",{className:"chat-exec-details",children:[i.jsxs("span",{children:["Runtime: ",e.runtime]}),i.jsxs("span",{children:["Exit code: ",e.exitCode]}),i.jsxs("span",{children:["Duration: ",e.durationMs,"ms"]})]})]})]})}function xye(e){return e==="done"?"✅":e==="running"?"🔄":e==="blocked"?"⛔":"⬜"}function I_({plan:e}){const t=e.steps.filter(n=>n.status==="done").length;return i.jsxs("div",{className:"chat-plan-card",children:[i.jsxs("div",{className:"chat-plan-head",children:[i.jsx("span",{className:"chat-plan-icon",children:"🗂️"}),i.jsx("span",{className:"chat-plan-goal",children:e.goal}),i.jsxs("span",{className:"chat-plan-count",children:[t,"/",e.steps.length," done"]})]}),i.jsx("div",{className:"chat-plan-steps",children:e.steps.map(n=>i.jsxs("div",{className:`chat-plan-step chat-plan-step-${n.status}`,children:[i.jsx("span",{className:"chat-plan-step-icon",children:xye(n.status)}),i.jsx("span",{className:"chat-plan-step-text",children:n.description}),i.jsx("span",{className:"chat-plan-step-status",children:n.status})]},n.id))})]})}function $_({tools:e,live:t}){return!e||e.length===0?null:i.jsx("div",{className:`chat-tool-cards${t?" chat-tool-cards-live":""}`,children:e.map(n=>{const r=n.phase==="started"||n.ok===void 0,a=n.ok===!1;return i.jsxs("div",{className:`chat-tool-card${r?" chat-tool-running":a?" chat-tool-err":" chat-tool-ok"}`,children:[i.jsxs("div",{className:"chat-tool-head",children:[i.jsx("span",{className:"chat-tool-icon",children:fye(n.tool)}),i.jsx("span",{className:"chat-tool-name",children:n.tool}),n.args?i.jsx("code",{className:"chat-tool-args",children:n.args}):null,i.jsx("span",{className:"chat-tool-status",title:r?"running":a?"failed":"done",children:r?"⏳":a?"✗":"✓"}),n.durationMs!==void 0&&!r?i.jsxs("span",{className:"chat-tool-dur",children:[n.durationMs,"ms"]}):null]}),n.error||n.result?i.jsxs("details",{className:"chat-tool-detail",children:[i.jsx("summary",{children:a?"Error":"Result"}),i.jsx("pre",{className:"chat-tool-body",children:n.error||n.result})]}):null]},n.id)})})}function wye(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function L_({findings:e}){return!e||e.length===0?null:i.jsx("div",{className:"chat-finding-cards",children:e.map((t,n)=>{const r=wye(t),a=t.verdict==="CONFIRMED"&&r.length>0;return i.jsxs("div",{className:`chat-finding-card ${a?"chat-finding-confirmed":"chat-finding-plausible"}`,children:[i.jsxs("div",{className:"chat-finding-head",children:[i.jsx("span",{className:"chat-finding-icon","aria-hidden":"true",children:a?"✅":"🔎"}),i.jsx("span",{className:"chat-finding-claim",children:t.claim}),i.jsx("span",{className:`chat-finding-verdict ${a?"chat-finding-verdict-ok":"chat-finding-verdict-guess"}`,title:a?"a check was performed and is shown below":"reasoned, not verified",children:a?"CONFIRMED":"PLAUSIBLE"})]}),t.outcome?i.jsx("div",{className:"chat-finding-outcome",children:t.outcome}):null,r.length>0?i.jsx("ul",{className:"chat-finding-evidence",children:r.map((s,o)=>i.jsxs("li",{children:[i.jsx("span",{className:"chat-finding-kind",children:s.kind}),i.jsx("code",{className:"chat-finding-ref",children:s.ref}),s.detail?i.jsxs("span",{className:"chat-finding-detail",children:["(",s.detail,")"]}):null]},o))}):i.jsx("div",{className:"chat-finding-noevidence",children:"no evidence — reported as PLAUSIBLE, not verified"}),t.source?i.jsxs("div",{className:"chat-finding-source",children:["source: ",t.source]}):null]},`${n}-${t.claim}`)})})}function Sye({worktree:e}){return i.jsxs("div",{className:"chat-worktree-card",children:[i.jsxs("div",{className:"chat-worktree-head",children:[i.jsx("span",{className:"chat-worktree-icon","aria-hidden":"true",children:"🌿"}),i.jsx("span",{className:"chat-worktree-title",children:"Ran in an isolated worktree"}),i.jsx("span",{className:`chat-worktree-state ${e.removed?"chat-worktree-gone":"chat-worktree-kept"}`,children:e.removed?"removed":"kept"})]}),i.jsxs("div",{className:"chat-worktree-meta",children:[i.jsx("code",{className:"chat-worktree-dir",title:e.dir,children:e.dir}),i.jsxs("span",{className:"admin-hint",children:["base ",e.base.slice(0,7)]})]}),i.jsx("div",{className:"chat-worktree-note admin-hint",children:e.removed?"the diff below is what is left of it — nothing was written into the project tree":"the directory above is still on disk"}),i.jsx(gc,{diff:e.diff.payload})]})}function kye({resume:e}){return i.jsxs("div",{className:"chat-resume-card",children:[i.jsxs("div",{className:"chat-resume-head",children:[i.jsx("span",{className:"chat-resume-icon","aria-hidden":"true",children:"↩️"}),i.jsx("span",{className:"chat-resume-title",children:"Resumed a recorded run"}),i.jsx("span",{className:`chat-resume-state ${e.saved?"chat-resume-saved":"chat-resume-unsaved"}`,title:e.saved?"the record was written back, so a later resume can replay this run":"the record could NOT be written — a later resume will replay nothing from this run",children:e.saved?"recorded":"not recorded"})]}),i.jsxs("div",{className:"chat-resume-meta",children:[i.jsxs("span",{children:[e.replayed," step",e.replayed===1?"":"s"," replayed"]}),i.jsxs("span",{children:[e.modelCalls," model call",e.modelCalls===1?"":"s"," made"]}),typeof e.callsAvoided=="number"&&e.callsAvoided>0&&i.jsxs("span",{className:"chat-resume-saved-calls",title:"model calls the resume did not re-pay for",children:[e.callsAvoided," model call",e.callsAvoided===1?"":"s"," saved"]}),i.jsx("code",{className:"chat-resume-id",title:"the checkpoint record this run used",children:e.id})]}),i.jsx("div",{className:"chat-resume-note",children:e.notice})]})}function ev(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`chat-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function jye(e,t){const n=t.trim().toLowerCase(),r=n?e.filter(u=>`${u.title} ${u.preview} ${u.firstUser}`.toLowerCase().includes(n)):e,a=[],s=new Date,o=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),l=864e5,c=[{label:"Today",match:u=>u>=o},{label:"Yesterday",match:u=>u>=o-l&&u<o},{label:"This week",match:u=>u>=o-7*l&&u<o-l},{label:"Older",match:()=>!0}];for(const u of c){const d=r.filter(f=>u.match(f.updatedAt));d.length>0&&a.push({label:u.label,items:d})}return a}function D_(){var Us,Ws,Bl,dd,fd;const[e,t]=k.useState(null),[n,r]=k.useState([]),[a,s]=k.useState(""),[o,l]=k.useState(!1),[c,u]=k.useState(""),[d,f]=k.useState(null),[h,p]=k.useState(!1),[g,m]=k.useState(!1),[y,v]=k.useState(!1),[x,S]=k.useState(""),[j,w]=k.useState(null),[b,N]=k.useState([]),[E,T]=k.useState([]),[A,M]=k.useState(null),[R,B]=k.useState(null),[L,F]=k.useState(null),[z,$]=k.useState([]),[O,U]=k.useState([]),[C,Z]=k.useState([]),[D,P]=k.useState(null),ie=k.useRef([]),ve=k.useRef([]),pe=k.useRef(null),Te=k.useRef(null),q=k.useRef(null),X=k.useRef([]),[oe,ue]=k.useState(""),V=k.useRef(""),_e=k.useRef(null),[je,Ne]=k.useState(null),ge=k.useRef(ev()),ze=k.useRef(""),[me,ft]=k.useState([]),[Ge,Ae]=k.useState(!0),[Ze,yt]=k.useState(""),[An,bt]=k.useState(null),[W,Y]=k.useState(""),[se,he]=k.useState([]),[xe,Fe]=k.useState(null),[Rt,xt]=k.useState(!1),zt=k.useRef(null),rn=k.useRef(null),[Pe,Vn]=k.useState(null),[Ft,an]=k.useState(null),[Cr,Cn]=k.useState([]),[sn,Tr]=k.useState(""),[ha,qa]=k.useState(""),[pa,Ka]=k.useState(!1),[gn,ma]=k.useState(""),[on,Va]=k.useState([]),[Di,Ls]=k.useState(null),[Ds,ga]=k.useState(!1),[Or,_l]=k.useState([]),[Al,Bs]=k.useState([]),[Vr,Bi]=k.useState(""),H=k.useRef(null),ne=k.useRef(null),Me=k.useRef(null),Oe=k.useRef(null),[ot,va]=k.useState(null),[cr,Cl]=k.useState(new Set),[Ya,Tl]=k.useState("");k.useEffect(()=>{Q.fetchAdminAuthStatus().then(I=>{t(I?{configured:I.configured,authenticated:I.authenticated,role:I.role??null}:{configured:!1,authenticated:!1,role:null})})},[]),k.useEffect(()=>{var I,te;try{(te=(I=Me.current)==null?void 0:I.scrollTo)==null||te.call(I,{top:Me.current.scrollHeight})}catch{}},[n,o,b]),k.useEffect(()=>()=>{var I;(I=ne.current)==null||I.call(ne),ne.current=null},[]);const Ol=k.useCallback(async I=>{var ke,Pr;(ke=ne.current)==null||ke.call(ne),ne.current=null;const te=await Q.getChatSession(I);if(!te)return;ge.current=I,r(te.turns.map(Wt=>({role:Wt.role,content:Wt.content,...Wt.role==="assistant"?{followups:[],artifacts:O_(Wt.content)}:{}}))),N([]),ie.current=[],T([]),ve.current=[],M(null),pe.current=null,B(null),Te.current=null,F(null),q.current=null,$([]),X.current=[],V.current="",ue(""),Ne(null),u(""),w(null),P(null),va(null),Ae(!0);const ee=te.projectPath;if(ee){if(an(ee),(Pe==null?void 0:Pe.path)===ee)return;(Pr=Oe.current)==null||Pr.call(Oe,ee)}else an(null)},[Pe]),Tn=k.useCallback(()=>{var I;(I=ne.current)==null||I.call(ne),ne.current=null,ge.current=ev(),an(null),r([]),N([]),ie.current=[],T([]),ve.current=[],M(null),pe.current=null,B(null),Te.current=null,F(null),q.current=null,$([]),X.current=[],V.current="",ue(""),Ne(null),u(""),w(null),P(null),va(null),he([]),Fe(null),s(""),Ae(!0)},[]),ya=k.useCallback(I=>{he(te=>[...te,I].slice(-10))},[]),zs=k.useCallback(I=>{he(te=>te.filter((ee,ke)=>ke!==I))},[]),Pl=k.useCallback(async I=>{if(!I)return;if(I.size>R_){u(`Attachment "${I.name}" is too large (max ${Math.round(R_/1024)} KB).`);return}const te=new Uint8Array(await I.slice(0,8192).arrayBuffer()),ee=uye(I.name,te);if(ee.how==="unsupported"){u(ee.reason);return}if(ee.how==="binary"){const Pr=new Uint8Array(await I.arrayBuffer());ya({name:I.name,content:cye(Pr),kind:"file",encoding:"base64"});return}const ke=await I.text();ya({name:I.name,content:ke,kind:"file",encoding:"text"})},[ya]),rd=k.useCallback(I=>{const te=I.currentTarget,ee=I.clipboardData.getData("text")||"";ee.length>=iye&&(rn.current={start:te.selectionStart,end:te.selectionEnd},Fe({text:ee}))},[]),Xa=k.useCallback(()=>{const I=xe;if(!I)return;const te=rn.current;s(ee=>te?ee.slice(0,te.start)+ee.slice(te.end):ee),ya({name:"pasted-text.txt",content:I.text,kind:"paste",encoding:"text"}),Fe(null),rn.current=null},[xe,ya]),Rl=k.useCallback(I=>{bt(I.id),Y(I.title==="(untitled conversation)"?"":I.title)},[]),ba=k.useCallback(async I=>{const te=await Q.renameChatSession(I,W);te.ok?ft(ee=>ee.map(ke=>ke.id===I?{...ke,title:W.trim()||ke.title}:ke)):u(te.error||"Could not rename the session."),bt(null),Y("")},[W]),Ml=k.useCallback(async I=>{const te=await Q.deleteChatSession(I);te.ok?(ft(ee=>ee.filter(ke=>ke.id!==I)),ge.current===I&&Tn()):u(te.error||"Could not delete the session.")},[Tn]),Qa=(e==null?void 0:e.authenticated)===!0&&(e.role==="admin"||e.role==="operator");k.useEffect(()=>{Qa&&(Q.listChatSessions().then(I=>{Array.isArray(I)&&ft(I)}),Q.listProjects().then(I=>{Array.isArray(I)&&Cn(I)}))},[Qa]);const ur=k.useCallback(async I=>{const te=I.trim();if(!te)return;qa("");const ee=await Q.attachProject(te);if(ee.ok&&ee.project){Vn(ee.project),Tr("");const ke=await Q.listProjects();Array.isArray(ke)&&Cn(ke)}else qa(ee.error||"Could not attach that directory.")},[]);Oe.current=ur;const dr=k.useCallback(async I=>{Ka(!0),ga(!0),Bi("");const te=await Q.browseDirectories(I,{showDrives:!I});te.ok&&(ma(te.path),Va(te.entries),Ls(te.parent),te.drives&&_l(te.drives),te.breadcrumbs&&Bs(te.breadcrumbs)),ga(!1)},[]),Il=k.useCallback(async I=>{ga(!0),Bi("");const te=await Q.browseDirectories(I);te.ok&&(ma(te.path),Va(te.entries),Ls(te.parent),te.breadcrumbs&&Bs(te.breadcrumbs)),ga(!1)},[]),$l=k.useCallback(async()=>{if(!gn)return;const I=await Q.browseDirectories(gn);I.ok&&Va(I.entries)},[gn]);k.useEffect(()=>Q.onChatRetryEvent(te=>{if(te.sessionId!==ge.current){Q.listChatSessions().then(ee=>{Array.isArray(ee)&&ft(ee)});return}r(ee=>[...ee,{role:"assistant",content:te.content}]),te.kind==="answer"&&Ne(null)}),[]),k.useEffect(()=>(pa&&gn&&(H.current=setInterval(()=>{$l()},5e3)),()=>{H.current&&clearInterval(H.current)}),[pa,gn,$l]);const Fs=k.useCallback(async()=>{if(typeof window<"u"&&"showDirectoryPicker"in window)try{const ee=(await window.showDirectoryPicker({mode:"read"})).name;if(!ee){dr();return}qa(""),l(!0);const ke=await Q.resolveFolder(ee);l(!1),ke.ok&&ke.path?(Tr(ke.path),ur(ke.path)):qa('Folder "'+ee+'" found — selecting it now. If this is wrong, type the full path below.');return}catch(te){if((te==null?void 0:te.name)==="AbortError")return}dr()},[dr,ur]),lt=k.useCallback(async(I,te)=>{var Yr,Yn;const ee=I.trim(),ke=Array.isArray(te)?te:se,Pr=!Array.isArray(te)&&(te==null?void 0:te.skipResolve)===!0;if(!ee&&ke.length===0||o)return;if(u(""),w(null),N([]),ie.current=[],T([]),ve.current=[],M(null),pe.current=null,B(null),Te.current=null,F(null),q.current=null,$([]),X.current=[],r(we=>[...we,{role:"user",content:ee,attachments:ke.length>0?ke:void 0}]),s(""),he([]),Fe(null),ze.current=ee||`[${ke.length} attachment(s)]`,l(!0),Ae(!1),!Pr){const ct=((await Q.chatResolve(ee)).matches??[])[0]??null;if(ct&&ct.command&&!ct.ambiguous&&ct.score>=.6){P({ask:ee,top:ct}),l(!1);return}if(ct&&ct.ambiguous&&!D){P({ask:ee,top:ct}),l(!1);return}}const Wt=ge.current,Dn=new AbortController;_e.current=Dn,Ne(null),(Yr=ne.current)==null||Yr.call(ne),ne.current=Q.subscribeChat(Wt,{onToken:we=>{V.current+=we,ue(V.current)},onProgress:we=>{ie.current=[...ie.current,we],N(ie.current)},onQuestion:we=>{va(we),Cl(new Set)},onTool:we=>{const Ue=[...ve.current],ct=Ue.findIndex(ln=>ln.id===we.id),Mt={id:we.id,tool:we.tool,phase:we.phase,args:we.args,ok:we.ok,result:we.result,error:we.error,durationMs:we.durationMs};ct>=0?Ue[ct]=Mt:Ue.push(Mt),ve.current=Ue,T(Ue)},onPlan:we=>{const Ue={goal:we.goal,steps:we.steps.map(dye),revision:we.revision};pe.current=Ue,M(Ue)},onDiff:we=>{const Ue={files:we.files,summary:we.summary};Te.current=Ue,B(Ue)},onSkillDraft:we=>{const Ue={name:we.name,description:we.description,markdown:we.markdown,updatedAt:we.updatedAt,status:"pending"};q.current=Ue,F(Ue)},onFinding:we=>{X.current=[...X.current,we],$(X.current)},onSecretRequest:we=>{U(Ue=>{const ct=Ue.findIndex(Mt=>Mt.skillName===we.skillName);if(ct>=0){const Mt=[...Ue];return Mt[ct]=we,Mt}return[...Ue,we]})},onExecutionResult:we=>{Z(Ue=>[...Ue,we])}});const kt=await Q.chatSend(Wt,ee||`(see ${ke.length} attachment${ke.length===1?"":"s"})`,{projectPath:Pe==null?void 0:Pe.path,attachments:ke.map(we=>({name:we.name,content:we.content,kind:we.kind,encoding:we.encoding??"text"})),...h?{worktree:!0,keepWorktree:g}:{},...y?{resume:x.trim()||!0}:{}},Dn.signal);if(_e.current=null,(Yn=ne.current)==null||Yn.call(ne),ne.current=null,V.current="",ue(""),kt.ok){w(kt.generationFailed?null:`${kt.provider??"provider"}${kt.model?` / ${kt.model}`:" (auto-routed)"}`),Ne(kt.generationFailed&&!kt.retryQueued&&!kt.refused?ee:null);const we=kt.content||"(the agent produced no text — try rephrasing)";r(Ue=>[...Ue,{role:"assistant",content:we,error:kt.generationFailed,followups:kt.followups,steps:ie.current,tools:ve.current,plan:pe.current,diff:Te.current,draft:q.current,findings:kt.findings??X.current,worktree:kt.worktree,resume:kt.resume,refused:kt.refused,needsProject:kt.needsProject,artifacts:O_(we)}])}else Dn.signal.aborted?(u(""),Ne(null)):kt.unauthorized?(t(we=>we&&{...we,authenticated:!1}),u("Session expired — log in again to chat.")):(u(kt.error||"The agent could not answer — check that a provider API key is set for the dashboard process."),Ne(ee));l(!1),Ae(!0)},[o,Pe,se,h,g,y,x]),ad=k.useCallback(()=>{var I;(I=_e.current)==null||I.abort()},[]),Ut=k.useCallback(async()=>{f(null);const I=await Q.chatSupportBundle(ge.current);f(I.ok?{kind:"ok",text:"Support bundle downloaded — attach it to your bug report."}:{kind:"err",text:I.error||"Could not build the support bundle."})},[]),Ll=k.useCallback(async I=>{F(ee=>ee&&{...ee,status:"saving"});const te=await Q.skillDraftAccept(I);F(ee=>ee&&{...ee,status:te.ok?"saved":"error"}),te.ok||u(te.error||"Could not accept the draft.")},[]),id=k.useCallback(async I=>{const te=await Q.skillDraftReject(I);te.ok?F(ee=>ee&&{...ee,status:"rejected"}):u(te.error||"Could not reject the draft.")},[]),sd=k.useCallback(I=>{lt(`Revise the skill draft "${I}" — improve it per your best judgment and present it again.`)},[lt]),ym=k.useCallback(async I=>{const te=await Q.saveSecrets(I);if(!te.ok){u(te.error||"Could not save secrets.");return}const ee=te.refused??[];ee.length>0&&u(ee.map(ke=>ke.reason==="provider-credential"?`${ke.name} is a provider credential — set it up as a provider, skills never receive it.`:`${ke.name} was not saved (${ke.reason}).`).join(" "))},[]),zi=k.useCallback(async I=>{const ke=((await Q.chatResolve(I)).matches??[])[0]??null;if(!(ke!=null&&ke.command)){P(null);return}P(null),l(!0);const Pr=ke.command.split(/\s+/),Wt=await Q.startTask(Pr,6e4);if(!Wt.ok||!Wt.task){u(Wt.error||"The command could not be started."),l(!1);return}const Dn=Wt.task.id,kt={id:Dn,command:ke.command,status:Wt.task.status,exitCode:Wt.task.exitCode,durationMs:Wt.task.durationMs,logs:Wt.task.logs??[]};r(ct=>[...ct,{role:"assistant",content:"",task:kt}]);const Yr=ct=>r(Mt=>Mt.map(ln=>ln.task&&ln.task.id===Dn?{...ln,task:{...ln.task,...ct}}:ln));let Yn=null;Yn=Q.subscribeTask(Dn,{onLog:ct=>r(Mt=>Mt.map(ln=>ln.task&&ln.task.id===Dn?{...ln,task:{...ln.task,logs:[...ln.task.logs,ct]}}:ln)),onStatus:ct=>{Yr({status:ct}),ct!=="running"&&(Q.getTask(Dn).then(Mt=>{Mt!=null&&Mt.task&&Yr({exitCode:Mt.task.exitCode,durationMs:Mt.task.durationMs,logs:Mt.task.logs??[]})}),Yn==null||Yn(),l(!1))}});const we=await Q.getTask(Dn);we!=null&&we.task&&Yr({status:we.task.status,exitCode:we.task.exitCode,durationMs:we.task.durationMs,logs:we.task.logs??[]});const Ue=await Q.getTask(Dn);Ue!=null&&Ue.task&&Ue.task.status!=="running"&&(Yn==null||Yn(),Yr({status:Ue.task.status,exitCode:Ue.task.exitCode,durationMs:Ue.task.durationMs,logs:Ue.task.logs??[]}),l(!1))},[]),bm=k.useCallback(I=>{P(null),lt(I,{skipResolve:!0})},[lt]),od=k.useCallback(I=>{if(I.length===0)return;const te=Pe?` in the attached project ${Pe.path}`:"";lt(`Commit exactly these files that I accepted on the diff card (and nothing else)${te}: ${I.join(", ")}. Show me a short confirmation before finishing.`)},[lt,Pe]),xm=k.useCallback(async I=>{await Q.cancelTask(I)},[]),fr=k.useCallback(async I=>{const te=ot;if(!te)return;va(null),Tl(""),Cl(new Set);const ee=await Q.chatRespond(ge.current,te.questionId,I);ee.ok||u(ee.error||"The question could not be answered — try sending your message again.")},[ot]),ld=k.useCallback(()=>{if(!ot)return;const I=Ya.trim(),te=ot.multiSelect?[...cr]:[...cr][0];ot.multiSelect?fr({index:[...cr],...I?{custom:I}:{}}):fr(I?{index:-1,custom:I}:te!==void 0?{index:te}:{index:-1})},[ot,cr,Ya,fr]),cd=k.useCallback(()=>{ot&&fr({index:-1})},[ot,fr]),wm=k.useCallback(I=>{Cl(te=>{const ee=new Set(te);return ot!=null&&ot.multiSelect?ee.has(I)?ee.delete(I):ee.add(I):(ee.clear(),ee.add(I)),ee})},[ot]),ud=k.useCallback(async()=>{var te;(te=ne.current)==null||te.call(ne),ne.current=null,ge.current=ev(),r([]),N([]),ie.current=[],T([]),ve.current=[],M(null),pe.current=null,B(null),Te.current=null,F(null),q.current=null,$([]),X.current=[],V.current="",ue(""),Ne(null),u(""),w(null),P(null),va(null);const I=await Q.listChatSessions();Array.isArray(I)&&ft(I)},[]),Dl=((Us=[...n].reverse().find(I=>{var te;return I.role==="assistant"&&!I.error&&(((te=I.followups)==null?void 0:te.length)??0)>0}))==null?void 0:Us.followups)??[];return i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"💬",title:"Chat with the agent",actions:i.jsxs("div",{className:"chat-head-actions",children:[j?i.jsx("span",{className:"admin-hint",children:j}):null,i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void ud(),disabled:o||n.length===0,children:"🗑 New conversation"})]})}),e!=null&&e.authenticated?Qa?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"chat-project-bar",children:Pe?i.jsxs("div",{className:"chat-project-attached",children:[i.jsx("span",{className:"chat-project-icon",children:"📁"}),i.jsx("span",{className:"chat-project-name",children:Pe.name}),i.jsxs("span",{className:"chat-project-meta",children:[Pe.fileCount," files · ",Pe.symbolCount," symbols",Pe.truncated?" · truncated map":""]}),i.jsx("span",{className:"chat-project-path",title:Pe.path,children:Pe.path}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>Vn(null),children:"✕ detach"})]}):i.jsxs("div",{className:"chat-project-pick",children:[i.jsx("span",{className:"chat-project-icon",children:"📁"}),i.jsx("span",{className:"chat-project-hint",children:"Select Project Folder"}),Cr.find(I=>I.kind==="cwd")?i.jsxs("span",{className:"chat-project-cwd",title:"Working directory used when no folder is attached",children:["⚙️ ",Cr.find(I=>I.kind==="cwd").path]}):null,Cr.length>0?i.jsx("span",{className:"chat-project-chips",children:Cr.filter(I=>I.kind!=="cwd").slice(0,3).map(I=>i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void ur(I.path),children:I.name},I.path))}):null,i.jsx("input",{className:"chat-project-input",value:sn,onChange:I=>Tr(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),ur(sn))},placeholder:"or type a path, e.g. ~/code/my-app",disabled:o}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void ur(sn),disabled:o||!sn.trim(),children:"Attach"}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void Fs(),title:"Pick a project folder using your system's folder picker (Finder / Explorer)",children:"🗂️ Browse"}),ha?i.jsx("span",{className:"chat-project-error",children:ha}):null,pa?i.jsxs("div",{className:"chat-browse-popover",children:[i.jsxs("div",{className:"chat-browse-head",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>Ka(!1),title:"Close",children:"✕"}),i.jsx("div",{className:"chat-browse-breadcrumbs",children:Or.length>0&&!gn?i.jsx("span",{className:"admin-hint",children:"Select a drive or home folder:"}):i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void dr(),children:"🏠"}),Al.map((I,te)=>i.jsxs("span",{children:[i.jsx("span",{className:"chat-breadcrumb-sep",children:"/"}),i.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void Il(I.path),children:I.name})]},I.path))]})})]}),Or.length>0&&!gn?i.jsx("div",{className:"chat-browse-drives",children:Or.map(I=>i.jsx("button",{type:"button",className:"chat-browse-drive",onClick:()=>void Il(I.path),children:I.name},I.path))}):null,on.length>5?i.jsx("div",{className:"chat-browse-search",children:i.jsx("input",{type:"text",className:"chat-browse-filter",placeholder:"🔍 Filter folders…",value:Vr,onChange:I=>Bi(I.target.value),autoFocus:!0})}):null,i.jsx("div",{className:"chat-browse-list",children:Ds?i.jsx("span",{className:"admin-hint",children:"Loading…"}):on.length===0?i.jsx("span",{className:"admin-hint",children:"No subdirectories found"}):on.filter(I=>!Vr||I.name.toLowerCase().includes(Vr.toLowerCase())).map(I=>i.jsxs("button",{type:"button",className:"chat-browse-entry",onClick:()=>void Il(I.path),children:[i.jsx("span",{className:"chat-browse-entry-icon",children:"📁"}),i.jsx("span",{className:"chat-browse-entry-name",children:I.name}),I.modified?i.jsx("span",{className:"chat-browse-entry-date",children:new Date(I.modified).toLocaleDateString()}):null]},I.path))}),i.jsxs("div",{className:"chat-browse-foot",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void $l(),title:"Refresh folder list",children:"🔄"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>{Ka(!1),ur(gn)},disabled:!gn,children:"📁 Select this folder"})]})]}):null]})}),Ft&&(!Pe||Pe.path!==Ft)?i.jsxs("div",{className:"chat-session-project-banner",children:[i.jsxs("span",{children:["⚠️ This conversation was working in ",i.jsx("code",{children:Ft})]}),Pe?i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void ur(Ft),children:"📁 Switch to it"}):i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void ur(Ft),children:"📁 Attach it"})]}):null,i.jsxs("div",{className:"chat-layout",children:[Ge?i.jsxs("div",{className:"chat-sidebar",children:[i.jsxs("div",{className:"chat-sidebar-head",children:[i.jsx("span",{children:"📁 Sessions"}),i.jsxs("div",{className:"chat-sidebar-head-actions",children:[i.jsx("button",{type:"button",className:"chat-mini-action",title:"New chat",onClick:Tn,children:"+ New"}),i.jsx("button",{type:"button",className:"chat-mini-action",title:"Collapse history",onClick:()=>Ae(!1),children:"▸"})]})]}),i.jsx("input",{className:"chat-session-search",placeholder:"Search conversations…",value:Ze,onChange:I=>yt(I.target.value)}),me.length===0?i.jsx("div",{className:"chat-sidebar-empty",children:"No past conversations yet."}):i.jsx("div",{className:"chat-sidebar-list",children:jye(me,Ze).map(({label:I,items:te})=>i.jsxs("div",{className:"chat-session-group",children:[i.jsx("div",{className:"chat-session-group-label",children:I}),te.map(ee=>i.jsx("div",{className:`chat-session-item${ee.id===ge.current?" chat-session-active":""}`,children:An===ee.id?i.jsxs("div",{className:"chat-session-rename",children:[i.jsx("input",{autoFocus:!0,value:W,onChange:ke=>Y(ke.target.value),onKeyDown:ke=>{ke.key==="Enter"&&ba(ee.id),ke.key==="Escape"&&bt(null)},placeholder:"Session title"}),i.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>void ba(ee.id),children:"✓"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"chat-session-main",onClick:()=>void Ol(ee.id),title:ee.preview||ee.title,children:[i.jsx("span",{className:"chat-session-title",children:ee.title}),i.jsx("span",{className:"chat-session-preview",children:ee.firstUser||ee.preview}),i.jsxs("span",{className:"chat-session-meta",children:[ee.projectPath?`📁 ${ee.projectPath.split("/").pop()} · `:"",ee.turnCount," msg",ee.turnCount===1?"":"s"," · ",new Date(ee.updatedAt).toLocaleString()]})]}),i.jsxs("span",{className:"chat-session-actions",children:[i.jsx("button",{type:"button",className:"chat-mini-action",title:"Rename",onClick:()=>Rl(ee),children:"✏️"}),i.jsx("button",{type:"button",className:"chat-mini-action",title:"Delete",onClick:()=>void Ml(ee.id),children:"🗑"})]})]})},ee.id))]},I))})]}):i.jsx("div",{className:"chat-rail",children:i.jsx("button",{type:"button",className:"chat-rail-btn",onClick:()=>Ae(!0),title:"Show history",children:"📁"})}),i.jsxs("div",{className:"chat-main",children:[i.jsxs("div",{className:"chat-thread",ref:Me,role:"log","aria-live":"polite",children:[n.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("p",{className:"empty-state-title",children:"Say anything — the agent decides what to do (answer, fix code, plan, run the pipeline)."}),i.jsxs("div",{className:"empty-state-chips",children:[i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void lt("what's the state of this project?"),children:"📋 assess this project"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void lt("run the test suite"),children:"🧪 run the tests"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void lt("stop the gateway"),children:"⏹ stop the gateway"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void lt("load the code-assessment skill and assess this project"),children:"🧠 load the code-assessment skill"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void lt("learn the workflow I just did as a skill"),children:"📚 learn a workflow as a skill"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void lt("publish the current version"),children:"🚀 publish the release"})]})]}):n.map((I,te)=>i.jsxs("div",{className:`chat-bubble chat-${I.role}${I.error?" chat-error":""}`,children:[i.jsx("div",{className:"chat-bubble-role",children:I.role==="user"?"You":"🤖 Agent"}),I.role==="assistant"?i.jsx("div",{className:"chat-bubble-text",children:i.jsx(__,{text:I.content})}):i.jsx("div",{className:"chat-bubble-text",children:I.content}),I.role==="user"&&I.attachments&&I.attachments.length>0?i.jsxs("details",{className:"chat-steps",open:I.attachments.length===1,children:[i.jsxs("summary",{children:["📎 ",I.attachments.length," attachment",I.attachments.length===1?"":"s",":"," ",I.attachments.map(ee=>ee.name).join(", ")]}),I.attachments.map((ee,ke)=>i.jsxs("div",{className:"chat-attach-content",children:[i.jsxs("div",{className:"admin-hint",children:[ee.name," — ",gt(ee.content.length)," chars"]}),i.jsx("pre",{children:ee.content})]},ke))]}):null,I.role==="assistant"&&I.diff?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:["Changes: ",I.diff.summary]}),i.jsx(gc,{diff:I.diff,selectable:!0,onCommitAccepted:od})]}):null,I.role==="assistant"&&I.artifacts&&(I.artifacts.diffs.length>0||I.artifacts.results.length>0||I.artifacts.deploys.length>0)?i.jsxs(gye,{children:[I.artifacts.diffs.map((ee,ke)=>i.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Diff: ${ee.summary}`,className:"chat-artifact-item",children:Pe?i.jsx(gc,{diff:ee,selectable:!0,onCommitAccepted:od}):i.jsx(gc,{diff:ee,lockedHint:"Attach a project to review and commit these changes."})},`diff-${ke}`)),I.artifacts.results.map((ee,ke)=>i.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Result: ${ee.title}`,className:"chat-artifact-item",children:i.jsx(pye,{result:ee})},`result-${ke}`)),I.artifacts.deploys.map((ee,ke)=>i.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Deployment: ${ee.url}`,className:"chat-artifact-item",children:i.jsx(mye,{deploy:ee})},`deploy-${ke}`))]}):null,I.role==="assistant"&&I.task?i.jsx(vye,{task:I.task,onCancel:I.task.status==="running"?()=>void xm(I.task.id):void 0}):null,I.role==="assistant"&&I.draft?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:["Skill draft: ",I.draft.name]}),i.jsx(M_,{draft:I.draft,onAccept:Ll,onReject:id,onEdit:sd})]}):null,I.role==="assistant"&&I.plan?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:["Plan: ",I.plan.goal]}),i.jsx(I_,{plan:I.plan})]}):null,I.role==="assistant"&&I.refused?i.jsx("div",{className:"chat-refused-line",children:"⛔ This turn did not run — the isolation it asked for could not be made. Nothing was written, and the reason is above."}):null,I.role==="assistant"&&I.needsProject?i.jsx("div",{className:"chat-refused-line",children:"📁 Nothing was run — attach a project folder above, then send the message again."}):null,I.role==="assistant"&&I.worktree?i.jsx(Sye,{worktree:I.worktree}):null,I.role==="assistant"&&I.resume?i.jsx(kye,{resume:I.resume}):null,I.role==="assistant"&&I.findings&&I.findings.length>0?i.jsx(L_,{findings:I.findings}):null,I.role==="assistant"&&I.tools&&I.tools.length>0?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:[I.tools.length," tool call",I.tools.length===1?"":"s"]}),i.jsx($_,{tools:I.tools})]}):null,I.role==="assistant"&&I.steps&&I.steps.length>0?i.jsxs("details",{className:"chat-steps",children:[i.jsxs("summary",{children:[I.steps.length," step",I.steps.length===1?"":"s"]}),i.jsx("div",{className:"chat-step-line",children:I.steps.map((ee,ke)=>i.jsx("div",{children:ee.trim()},ke))})]}):null]},te)),o?i.jsxs("div",{className:"chat-bubble chat-assistant",children:[i.jsx("div",{className:"chat-bubble-role",children:"🤖 Agent"}),A?i.jsx(I_,{plan:A}):null,R?i.jsx(gc,{diff:R}):null,h&&o?i.jsx("div",{className:"chat-resume-line",children:"🌿 this turn is running in its own git worktree — the diff arrives with the answer"}):null,y&&o?i.jsx("div",{className:"chat-resume-line",children:"↩️ this turn is replaying the recorded steps of this ask that are unchanged — the count arrives with the answer"}):null,z.length>0?i.jsx(L_,{findings:z}):null,L?i.jsx(M_,{draft:L,onAccept:Ll,onReject:id,onEdit:sd}):null,O.map(I=>i.jsx(yye,{request:I,onSave:ym},I.skillName)),C.map((I,te)=>i.jsx(bye,{result:I},`${I.skillName}-${te}`)),i.jsx($_,{tools:E,live:!0}),oe?i.jsx("div",{className:"chat-bubble-text chat-streaming",children:i.jsx(__,{text:oe})}):null,i.jsx("div",{className:"chat-working",children:b.length>0?i.jsx("span",{className:"chat-working-lines",children:b.map((I,te)=>i.jsx("div",{className:"chat-step-line",children:I.trim()},te))}):i.jsxs(i.Fragment,{children:["💭 thinking… ",i.jsx("span",{className:"chat-dots"})]})})]}):null]}),c?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:c}):null,d?i.jsx("div",{className:`admin-row-msg${d.kind==="err"?" admin-row-msg-err":""}`,children:d.text}):null,je&&!o?i.jsxs("div",{className:"chat-retry-row",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void lt(je),children:"↻ Retry"}),i.jsx("span",{className:"admin-hint",children:"Re-send the last message — the turn failed."})]}):null,D&&!o?i.jsx("div",{className:"chat-resolve-card",children:(Ws=D.top)!=null&&Ws.ambiguous&&((Bl=D.top.options)!=null&&Bl.length)?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"chat-resolve-head",children:[i.jsx("strong",{children:"🤔 Which do you mean?"}),' — "',D.ask,'" maps to more than one action.']}),i.jsx("div",{className:"chat-resolve-options",children:D.top.options.map(I=>i.jsxs("button",{className:"chat-chip",type:"button",onClick:()=>void lt(I.command),children:[I.summary," — ",i.jsx("code",{children:I.command})]},I.command))}),i.jsx("div",{className:"chat-resolve-foot",children:i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{P(null)},children:"✕ Not that — ask the agent"})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"chat-resolve-head",children:[i.jsx("strong",{children:"⚡ Run this command?"}),' — "',D.ask,'"']}),i.jsx("div",{className:"chat-resolve-cmd",children:i.jsx("code",{children:(dd=D.top)==null?void 0:dd.command})}),(fd=D.top)!=null&&fd.confirmation?i.jsx("div",{className:"admin-hint",children:"⚠ This changes running services/state."}):null,i.jsxs("div",{className:"chat-resolve-foot",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void zi(D.ask),children:"▶ Run"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>bm(D.ask),children:"✕ No — ask the agent"})]})]})}):null,ot?i.jsxs("div",{className:"chat-resolve-card chat-question-card",children:[i.jsx("div",{className:"chat-resolve-head",children:i.jsxs("strong",{children:["🤔 ",ot.question]})}),i.jsx("div",{className:"chat-resolve-options",children:ot.choices.map((I,te)=>i.jsxs("button",{type:"button",className:`chat-chip${cr.has(te)?" chat-chip-selected":""}`,onClick:()=>wm(te),children:[I.label,I.description?i.jsxs("span",{className:"admin-hint",children:[" — ",I.description]}):null]},`${I.label}-${te}`))}),i.jsx("input",{className:"chat-question-custom",type:"text",placeholder:"✏️ Or type your own answer…",value:Ya,onChange:I=>Tl(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),ld())}}),i.jsxs("div",{className:"chat-resolve-foot",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:ld,children:Ya.trim()?"Send answer":ot.multiSelect?"Submit":"Choose"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:cd,children:"Skip — best judgment"})]})]}):null,Dl.length>0&&!o?i.jsxs("div",{className:"chat-followups",children:[i.jsx("span",{className:"admin-hint",children:"Next steps:"}),Dl.map((I,te)=>i.jsx("button",{className:"chat-chip",type:"button",onClick:()=>void lt(I.prompt),children:I.label||I.prompt},te))]}):null,i.jsxs("form",{className:`chat-composer${Rt?" chat-composer-drag":""}`,onSubmit:I=>{I.preventDefault(),lt(a)},onDragOver:I=>{I.preventDefault(),xt(!0)},onDragLeave:()=>xt(!1),onDrop:I=>{var ee;I.preventDefault(),xt(!1);const te=Array.from(((ee=I.dataTransfer)==null?void 0:ee.files)??[]);for(const ke of te.slice(0,10))Pl(ke)},children:[xe?i.jsxs("div",{className:"chat-paste-offer",children:[i.jsxs("span",{className:"admin-hint",children:["📄 You pasted ",gt(xe.text.length)," characters. Attach it as a file instead?"]}),i.jsx("button",{type:"button",className:"chat-chip",onClick:Xa,children:"Attach as text"}),i.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>{Fe(null),rn.current=null},children:"Keep inline"})]}):null,se.length>0?i.jsx("div",{className:"chat-attach-row",children:se.map((I,te)=>i.jsxs("span",{className:"chat-attach-chip",title:I.encoding==="base64"?`${I.name} (${gt(I.content.length)} base64 chars — read on the server)`:`${I.name} (${gt(I.content.length)} chars)`,children:["📎 ",I.name,i.jsx("span",{className:"admin-hint",children:I.encoding==="base64"?`${Math.round(I.content.length*3/4096)} KB`:`${gt(I.content.length)}c`}),i.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>zs(te),children:"✕"})]},`${I.name}-${te}`))}):null,i.jsxs("div",{className:"chat-input-row",children:[i.jsx("input",{ref:zt,type:"file",accept:".pdf,.docx,.xlsx,.pptx,.txt,.md,.markdown,.text,.log,.csv,.tsv,.json,.xml,.yaml,.yml,.html,.htm,text/*",style:{display:"none"},onChange:I=>{var ee;const te=(ee=I.target.files)==null?void 0:ee[0];te&&Pl(te),I.target.value=""}}),i.jsx("button",{type:"button",className:"chat-attach-btn",title:"Attach a file (up to 300 KB): PDF, DOCX, XLSX, PPTX or text — documents are read on the server",disabled:o||se.length>=10,onClick:()=>{var I;return(I=zt.current)==null?void 0:I.click()},children:"📎"}),i.jsx("button",{type:"button",className:"chat-attach-btn","aria-label":"Download support bundle",title:"Download a support bundle for this chat: the session debug log (which backend served each turn) plus the conversation. Needs NUVIRA_DEBUG_LOG=1 in the dashboard process.",onClick:()=>void Ut(),children:"🐞"}),i.jsxs("button",{type:"button",className:`chat-attach-btn${h?" chat-attach-btn-on":""}`,"aria-label":"Run turns in an isolated git worktree","aria-pressed":h,title:h?"Turns run in their own git worktree and report the diff — click to run in the project tree again":"Run turns in their own git worktree of the attached project, and report the diff against the base commit. Refuses rather than running in your tree when the directory cannot be isolated. Needs an attached project (or the server's own git working directory).",onClick:()=>{p(I=>!I),f(null)},children:["🌿",h?" isolated":" isolate"]}),i.jsxs("button",{type:"button",className:`chat-attach-btn${y?" chat-attach-btn-on":""}`,"aria-label":"Replay this ask's recorded steps instead of paying for them again","aria-pressed":y,title:y?"Recorded steps whose input is unchanged are replayed instead of paid for — click to run fresh again":"Replay the steps of an earlier run of this same ask whose input is unchanged, instead of paying for them again. The record is keyed by the ask and the directory; name a checkpoint id below to resume a specific one. A step whose input CHANGED is paid for again.",onClick:()=>{v(I=>!I),f(null)},children:["↩️",y?" resuming":" resume"]}),y?i.jsx("input",{className:"chat-resume-input",value:x,onChange:I=>S(I.target.value),placeholder:"checkpoint id (blank = this ask's record)",title:"Resume this specific checkpoint record. Blank resumes the record for this ask in this directory.","aria-label":"Checkpoint id to resume",disabled:o}):null,h?i.jsxs("button",{type:"button",className:`chat-attach-btn${g?" chat-attach-btn-on":""}`,"aria-pressed":g,title:g?"The worktree is KEPT after the turn so you can look inside it":"The worktree is measured and removed after each turn",onClick:()=>m(I=>!I),children:["📌",g?" keep":" drop"]}):null,i.jsx("textarea",{className:"chat-input-box",value:a,onChange:I=>s(I.target.value),onPaste:rd,onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey?(I.preventDefault(),lt(a)):I.key==="ArrowUp"&&a===""&&ze.current&&(I.preventDefault(),s(ze.current))},placeholder:"Message the agent… (Enter to send · Shift+Enter for a new line · ↑ recalls last · 📎 attach a file or paste a large document)",disabled:o,maxLength:8e3,rows:1,autoFocus:!0}),o?i.jsx("button",{className:"admin-mini-btn chat-cancel-btn",type:"button",onClick:ad,children:"⏹ Cancel"}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||!a.trim()&&se.length===0,children:o?"⏳ Working…":"➤ Send"})]})]}),i.jsxs("p",{className:"admin-hint",children:["Each message runs the full agent loop in the dashboard process (same engine as"," ",i.jsx("code",{children:'buff chat "<prompt>"'}),") — the provider API keys must be configured in the dashboard process. Clarifications (",i.jsx("code",{children:"ask_user"}),") appear as a question card here — choose an answer or skip (best judgment)."]})]})]})]}):i.jsx("div",{className:"admin-login-hint",children:i.jsx("p",{children:"Your role can view the dashboard but not chat (requires admin or operator)."})}):i.jsxs("div",{className:"admin-login-hint",children:[i.jsx("p",{children:"Log in (admin or operator) to chat with the agent. Configure the dashboard admin credential first if this is a fresh setup."}),(e==null?void 0:e.configured)===!1?i.jsxs("p",{className:"admin-hint",children:["Run ",i.jsx("code",{children:"buff dashboard"})," once, or set ",i.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," / ",i.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"}),"."]}):null]})]})}const Nye={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error"};function a$({presets:e,customPlaceholder:t,timeoutMs:n=3e5,hint:r}){const[a,s]=k.useState(null),[o,l]=k.useState(!1),[c,u]=k.useState(""),[d,f]=k.useState(""),[h,p]=k.useState(null),[g,m]=k.useState([]),y=k.useRef(null),v=k.useRef(null);k.useEffect(()=>{Q.fetchAdminAuthStatus().then(w=>{s(w?{authenticated:w.authenticated,role:w.role??null}:{authenticated:!1,role:null})})},[]),k.useEffect(()=>{var w,b;try{(b=(w=y.current)==null?void 0:w.scrollIntoView)==null||b.call(w,{block:"end"})}catch{}},[g]),k.useEffect(()=>()=>{var w;(w=v.current)==null||w.call(v)},[]);const x=(a==null?void 0:a.authenticated)===!0&&(a.role==="admin"||a.role==="operator"),S=k.useCallback(async(w,b)=>{var A;if(o)return;l(!0),u(""),m([]);const N=await Q.startTask(w,b??n);if(!N.ok||!N.task){u(N.error||"Could not start the command."),l(!1);return}const E=N.task;p(E);const T=await Q.getTask(E.id);T!=null&&T.task&&m(T.task.logs.map(M=>({stream:M.stream,text:M.text}))),(A=v.current)==null||A.call(v),v.current=Q.subscribeTask(E.id,{onLog:M=>m(R=>[...R,{stream:M.stream,text:M.text}]),onStatus:M=>{p(R=>R&&{...R,status:M}),M!=="running"&&l(!1)}})},[o,n]),j=k.useCallback(async()=>{h&&await Q.cancelTask(h.id)},[h]);return i.jsxs("div",{className:"ops-console",children:[a!=null&&a.authenticated?x?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"ops-presets",children:e.map(w=>i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void S(w.args,w.timeoutMs),disabled:o,children:w.label},w.label))}),i.jsxs("div",{className:"ops-custom-row",children:[i.jsx("input",{type:"text",value:d,onChange:w=>f(w.target.value),placeholder:t,disabled:o,maxLength:160}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void S(d.trim().split(/\s+/)),disabled:o||!d.trim(),children:"Run"})]}),r?i.jsx("p",{className:"admin-hint",children:r}):null]}):i.jsx("div",{className:"admin-login-hint",children:"Your role can view but not run commands (requires admin or operator)."}):i.jsx("div",{className:"admin-login-hint",children:"Log in (admin or operator) to run commands."}),c?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:c}):null,h?i.jsxs("div",{className:"ops-console-box",children:[i.jsxs("div",{className:"ops-console-head",children:[i.jsxs("span",{children:[h.command," · ",i.jsx("span",{className:h.status==="running"?"task-status-running":"",children:Nye[h.status]})]}),h.status==="running"?i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void j(),children:"⏹ Cancel"}):null]}),i.jsxs("pre",{className:"ops-console",role:"log",children:[g.length>0?g.map((w,b)=>i.jsx("div",{children:w.text},b)):i.jsx("div",{className:"admin-hint",children:"Waiting for output…"}),i.jsx("div",{ref:y})]})]}):null]})}const Eye=[{label:"⚡ Quick smoke",args:["eval","run","--tasks","quick","--format","text"]},{label:"⏱ Medium suite",args:["eval","run","--tasks","medium","--format","text"]},{label:"🐢 Slow suite",args:["eval","run","--tasks","slow","--format","text"]},{label:"🏆 M2B parity",args:["eval","run","--suite","m2b","--format","text"]},{label:"📦 Full suite",args:["eval","run","--suite","full","--format","text"]}];function B_(e){return typeof e!="number"?"—":`${Math.round(e*100)}%`}function _ye(e){return new Date(e).toLocaleString()}function Aye({data:e}){var n;const t=((n=e==null?void 0:e.evals)==null?void 0:n.runs)??[];return i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"🏆",title:"Evals — run buff eval from the GUI"}),i.jsx(a$,{presets:Eye,customPlaceholder:"e.g. eval run --tasks my-task --provider groq --model llama",timeoutMs:9e5,hint:i.jsxs(i.Fragment,{children:["Runs the real ",i.jsx("code",{children:"buff eval run"})," as an isolated process — same engine, same ledger, same results as the CLI. Long suites can take minutes; you can cancel mid-run."]})}),i.jsx("h2",{className:"section-subtitle",children:"📜 Past runs (auto-refreshes)"}),t.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Started"}),i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Model"}),i.jsx("th",{children:"Tasks"}),i.jsx("th",{children:"Pass"}),i.jsx("th",{children:"Completion"}),i.jsx("th",{children:"Composite"}),i.jsx("th",{children:"Cost"})]})}),i.jsx("tbody",{children:t.map(r=>i.jsxs("tr",{children:[i.jsx("td",{children:_ye(r.startedAt)}),i.jsx("td",{className:"admin-provider-type",children:r.provider}),i.jsx("td",{children:r.model}),i.jsx("td",{children:r.summary.totalTasks}),i.jsxs("td",{children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),i.jsx("td",{children:B_(r.summary.completionRate)}),i.jsx("td",{children:B_(r.summary.avgCompositeScore)}),i.jsxs("td",{children:["$",(r.summary.totalCostUsd??0).toFixed(4)]})]},r.id))})]})}):i.jsx("div",{className:"empty-state",children:"No eval runs yet — start one above (or `buff eval run` from the CLI)."})]})}const Cye=[{label:"🌐 Gateway status",args:["gateway","status"]},{label:"📮 Delivery ledger",args:["gateway","delivery"]},{label:"▶️ Start gateway (foreground)",args:["gateway","start","--no-events"],timeoutMs:0},{label:"⏰ Cron jobs",args:["admin","cron","list"]}];function Tye(){return i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"🌐",title:"Gateway ops — run buff gateway from the GUI"}),i.jsx(a$,{presets:Cye,customPlaceholder:"e.g. admin cron run nightly or gateway alias add ops email:team@example.com",timeoutMs:3e5,hint:i.jsxs(i.Fragment,{children:["Each command runs as the real CLI in an isolated process (the P1 task runner) — the same engine as your terminal. ",i.jsx("code",{children:"gateway start"})," runs in the foreground ",i.jsx("strong",{children:"with no timeout"}),": it keeps running even after you switch tabs (the process lives on the dashboard server, not the page) and streams platform events until you press ",i.jsx("strong",{children:"Cancel"}),". The delivery ledger also has its own view in"," ",i.jsx("strong",{children:"Agent Hub → Channels"}),"."]})})]})}const tv={telegram:{icon:"✈️",category:"Chat",steps:["Open Telegram and search for @BotFather","Send /newbot and follow the prompts",'Give your bot a name (e.g. "My Agent Bot")','Give your bot a username ending in "bot"',"BotFather gives you a token — paste it in Step 2","Open your bot in Telegram and send /start"],testTarget:"telegram:"},discord:{icon:"🎮",category:"Chat",steps:["Go to discord.com/developers/applications",'Click "New Application" and give it a name','Go to Bot tab and click "Add Bot"',"Copy the bot token",'Enable "Message Content Intent"',"Invite bot to your server (OAuth2 URL generator)"],testTarget:"discord:"},slack:{icon:"💬",category:"Chat",steps:["Go to api.slack.com/apps","Create New App from scratch","Add Bot Token Scopes: chat:write, im:read, im:write","Install to workspace","Copy the Bot User OAuth Token (xoxb-...)"],testTarget:"slack:"},whatsapp:{icon:"📱",category:"Chat",steps:["Run: buff whatsapp pair (or from Gateway tab)","Scan the QR code with WhatsApp","Pairing completes automatically"],testTarget:""},whatsapp_cloud:{icon:"☁️",category:"Chat",steps:["Go to developers.facebook.com","Set up WhatsApp Cloud API","Copy token + Phone ID"],testTarget:"whatsapp_cloud:"},email:{icon:"📧",category:"Chat",steps:["Get SMTP credentials (Gmail, SendGrid, etc.)","For Gmail: use App Password at smtp.gmail.com:587","Paste SMTP host + user below"],testTarget:""},signal:{icon:"🔒",category:"Chat",steps:["Run signal-cli-rest-api Docker container","Register a Signal account","Paste account number below"],testTarget:""},dingtalk:{icon:"🔔",category:"Webhooks",steps:["Open DingTalk and create a group","Add custom robot and copy webhook URL","Paste URL below"],testTarget:""},feishu:{icon:"🐦",category:"Webhooks",steps:["Open Feishu and create a bot","Copy webhook URL and paste below"],testTarget:""},wecom:{icon:"🏢",category:"Webhooks",steps:["Open WeCom and create a group bot","Copy webhook URL and paste below"],testTarget:""},mattermost:{icon:"📋",category:"Webhooks",steps:["Open Mattermost, go to Integrations","Create incoming webhook and copy URL"],testTarget:""},matrix:{icon:"🔗",category:"Chat",steps:["Get your Matrix homeserver URL","Create a bot user and get access token","Paste URL + token below"],testTarget:""},webhook:{icon:"🪝",category:"Webhooks",steps:["Enter your webhook URL","The agent sends outbound webhooks to this URL"],testTarget:""},bluebubbles:{icon:"💙",category:"Chat",steps:["Set up BlueBubbles server","Copy server URL + password"],testTarget:""},ntfy:{icon:"📢",category:"Notifications",steps:["Choose an ntfy topic (or use ntfy.sh)","Paste the topic below"],testTarget:""},teams:{icon:"👥",category:"Webhooks",steps:["Open Microsoft Teams, go to channel","Connectors, Incoming Webhook, create","Copy webhook URL"],testTarget:""},google_chat:{icon:"💬",category:"Webhooks",steps:["Open Google Chat, space settings","Create webhook and copy URL"],testTarget:""},weixin:{icon:"🔴",category:"Chat",steps:["Get Weixin iLink bot token","Paste token below"],testTarget:""},sms:{icon:"📲",category:"Chat",steps:["Get Twilio account SID + auth token","Register a phone number","Paste credentials below"],testTarget:""},irc:{icon:"💻",category:"Chat",steps:["Choose an IRC server (e.g. irc.libera.chat)","Set nickname + channel and paste below"],testTarget:""},simplex:{icon:"📨",category:"Chat",steps:["Run local simplex-chat daemon","Paste WebSocket URL (ws://127.0.0.1:5225)"],testTarget:""},homeassistant:{icon:"🏠",category:"IoT",steps:["Open Home Assistant Profile","Create long-lived access token and paste below"],testTarget:""}};function Oye(){const[e,t]=k.useState(null),[n,r]=k.useState("all"),[a,s]=k.useState(null),[o,l]=k.useState(0),[c,u]=k.useState({}),[d,f]=k.useState(!1),[h,p]=k.useState(null),[g,m]=k.useState({status:"idle"}),[y,v]=k.useState(""),[x,S]=k.useState("Hello from agent-nuvira!"),[j,w]=k.useState(!1),[b,N]=k.useState(null),E=k.useRef(!0),T=k.useCallback(async()=>{const O=await Q.getPlatformConfigs();E.current&&t(O)},[]);k.useEffect(()=>(T(),()=>{E.current=!1}),[T]);const A=O=>{s(O),l(0),u(Object.fromEntries(O.envVars.map(C=>[C.varName,C.value]))),p(null),m({status:"idle"});const U=tv[O.platform];v((U==null?void 0:U.testTarget)??""),S("Hello from agent-nuvira!"),N(null)},M=async()=>{if(!a)return;m({status:"checking"});const O=await Q.verifyPlatformConfig(a.platform,c);O.ok?(m({status:"ok",info:O.info}),p({kind:"ok",text:"Verified! "+(O.info?"Connected as "+O.info+".":"Token is valid.")})):(m({status:"err",error:O.error}),p({kind:"err",text:O.error||"Verification failed."}))},R=async()=>{if(!a)return;f(!0),p(null);const O=await Q.setPlatformConfig(a.platform,c);f(!1),O.ok?(p({kind:"ok",text:"Token saved! Verifying..."}),T(),l(2),M()):p({kind:"err",text:O.error||"Save failed."})},B=async()=>{if(!a||!y)return;w(!0),N(null);const O=await Q.sendChannelMessage(y,x);w(!1),O.ok?N({kind:"ok",text:"Message sent via "+O.platform+"! Check your "+a.label+" app."}):N({kind:"err",text:O.error||"Send failed. Make sure the gateway is running (Gateway tab)."})};if(e===null)return i.jsx("div",{className:"empty-state",children:"Loading platforms..."});const L=e.filter(O=>O.configured).length,F=e.filter(O=>n==="configured"?O.configured:n==="unconfigured"?!O.configured:!0),z=a?tv[a.platform]:null;function $(O){return o===O?"wizard-step-dot active":"wizard-step-dot"}return i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"🌐",title:"Platforms — Messaging Gateway Onboarding"}),i.jsxs("div",{className:"platforms-summary",children:[i.jsxs("div",{className:"platforms-summary-stat",children:[i.jsx("span",{className:"platforms-summary-number",children:L}),i.jsx("span",{className:"platforms-summary-label",children:"configured"})]}),i.jsxs("div",{className:"platforms-summary-stat",children:[i.jsx("span",{className:"platforms-summary-number",children:e.length-L}),i.jsx("span",{className:"platforms-summary-label",children:"available"})]}),i.jsx("div",{className:"platforms-summary-filters",children:["all","configured","unconfigured"].map(O=>i.jsx("button",{type:"button",className:n===O?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>r(O),children:O==="all"?"All":O==="configured"?"Configured":"Not set up"},O))})]}),i.jsx("div",{className:"platforms-grid",children:F.map(O=>{const U=tv[O.platform];return i.jsxs("div",{className:O.configured?"platform-card configured":"platform-card",children:[i.jsxs("div",{className:"platform-card-head",children:[i.jsx("span",{className:"platform-card-icon",children:(U==null?void 0:U.icon)??"🔌"}),i.jsxs("div",{className:"platform-card-info",children:[i.jsx("span",{className:"platform-card-name",children:O.label}),i.jsx("span",{className:"platform-card-category",children:(U==null?void 0:U.category)??"Platform"})]}),i.jsx("span",{className:O.configured?"status-dot connected":"status-dot reconnecting"})]}),i.jsx("div",{className:"platform-card-vars",children:O.envVars.map(C=>i.jsxs("span",{className:C.set?"platform-var-chip set":"platform-var-chip",children:[C.varName," ",C.set?"done":"--"]},C.varName))}),i.jsxs("div",{className:"platform-card-actions",children:[O.configured?i.jsx("span",{className:"platform-card-badge",children:"Active"}):i.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>A(O),children:"Setup"}),O.setupUrl?i.jsx("a",{href:O.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Docs"}):null]}),!O.configured&&O.setupHint?i.jsx("div",{className:"platform-card-hint",children:O.setupHint}):null]},O.platform)})}),i.jsxs("div",{className:"platforms-cli-hint",children:[i.jsx("span",{className:"admin-hint",children:"Prefer the terminal? "}),i.jsx("code",{children:"buff gateway setup telegram"}),i.jsx("span",{className:"admin-hint",children:" — same wizard from your CLI"})]}),a&&z?i.jsx("div",{className:"wizard-overlay",onClick:()=>s(null),children:i.jsxs("div",{className:"wizard-modal",onClick:O=>O.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:z.icon}),i.jsxs("span",{className:"wizard-title",children:["Getting Started: ",a.label]}),i.jsxs("div",{className:"wizard-steps-indicator",children:[i.jsx("span",{className:$(0),children:"1"}),i.jsx("span",{className:$(1),children:"2"}),i.jsx("span",{className:$(2),children:"3"})]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>s(null),children:"X"})]}),i.jsxs("div",{className:"wizard-body",children:[o===0&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"wizard-section-title",children:["Step 1: Create your bot on ",a.label]}),i.jsx("ol",{className:"wizard-steps",children:z.steps.map((O,U)=>i.jsx("li",{children:O},U))}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>l(1),children:"I have my token — Step 2"}),a.setupUrl?i.jsx("a",{href:a.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Open docs"}):null]})]}),o===1&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"Step 2: Paste your token"}),a.envVars.map(O=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:O.prompt}),i.jsx("input",{type:O.secret?"password":"text",value:c[O.varName]??"",onChange:U=>u(C=>({...C,[O.varName]:U.target.value})),placeholder:O.secret?"paste your token here":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},O.varName)),h?i.jsx("div",{className:h.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:h.text}):null,i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(0),children:"Back"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void R(),disabled:d,children:d?"Saving...":"Save & Verify"})]})]}),o===2&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"Step 3: Verify and test"}),g.status==="checking"&&i.jsx("div",{className:"wizard-verify-status",children:"Verifying token..."}),g.status==="ok"&&i.jsxs("div",{className:"wizard-verify-status ok",children:["Connected as ",g.info]}),g.status==="err"&&i.jsx("div",{className:"wizard-verify-status err",children:g.error}),g.status==="idle"&&(h==null?void 0:h.kind)==="ok"&&i.jsx("div",{className:"wizard-verify-status ok",children:h.text}),y&&i.jsxs("div",{className:"wizard-test-section",children:[i.jsx("p",{className:"wizard-section-title",children:"Send a test message:"}),i.jsx("div",{className:"wizard-test-row",children:i.jsx("input",{className:"wizard-test-input",value:y,onChange:O=>v(O.target.value),placeholder:"telegram:YOUR_CHAT_ID"})}),i.jsxs("div",{className:"wizard-test-row",children:[i.jsx("input",{className:"wizard-test-input",value:x,onChange:O=>S(O.target.value),placeholder:"Hello from agent-nuvira!"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void B(),disabled:j||!y,children:j?"Sending...":"Send test"})]}),b?i.jsx("div",{className:b.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:b.text}):null]}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(1),children:"Edit token"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>s(null),children:"Done"})]}),!y&&i.jsxs("p",{className:"wizard-hint",children:["Token saved! Start the gateway from the Gateway tab, then send a message from your ",a.label," app."]})]})]})]})}):null]})}const Pye=[{value:"us-east-1",label:"us-east-1 (N. Virginia) — most models"},{value:"us-west-2",label:"us-west-2 (Oregon) — most models"},{value:"eu-west-1",label:"eu-west-1 (Ireland) — EU coverage"},{value:"ap-southeast-1",label:"ap-southeast-1 (Singapore)"},{value:"ap-northeast-1",label:"ap-northeast-1 (Tokyo)"}],z_=[{name:"Anthropic Claude",models:["claude-haiku-4.5","claude-sonnet-4.6","claude-fable-5","claude-opus-4.6"],checked:!0},{name:"Meta Llama",models:["llama3-1-8b","llama3-1-70b","llama3-3-70b","llama4-scout","llama4-maverick"],checked:!0},{name:"Mistral AI",models:["mistral-large-3","devstral-2","ministral-3"],checked:!1},{name:"DeepSeek",models:["deepseek-v3.2","deepseek-r1"],checked:!1},{name:"Amazon Nova",models:["nova-pro","nova-lite"],checked:!1},{name:"OpenAI on Bedrock",models:["gpt-5.6-terra","gpt-oss-120b"],checked:!1},{name:"Qwen",models:["qwen3-coder-next","qwen3-32b"],checked:!1},{name:"Google Gemma",models:["gemma-3-12b"],checked:!1},{name:"xAI",models:["grok-4.6"],checked:!1}];function Rye({canWrite:e,sessionExpired:t}){const[n,r]=k.useState(null),[a,s]=k.useState(null),[o,l]=k.useState(!1),[c,u]=k.useState("overview"),d=k.useRef(!0),[f,h]=k.useState("bearer"),[p,g]=k.useState(""),[m,y]=k.useState(""),[v,x]=k.useState(""),[S,j]=k.useState("us-east-1"),[w,b]=k.useState(z_.filter(L=>L.checked).map(L=>L.name)),[N,E]=k.useState(!1),[T,A]=k.useState(null),M=k.useCallback(async()=>{const L=await Q.getBedrockStatus();d.current&&r(L)},[]);k.useEffect(()=>(M(),()=>{d.current=!1}),[M]);const R=async()=>{l(!0),s(null);try{const L=await Q.probeBedrock((n==null?void 0:n.region)||"us-east-1");if(!d.current)return;L.ok&&L.models&&(s(L.models),u("test"))}catch{}finally{d.current&&l(!1)}},B=async()=>{E(!0),A(null);try{const L={BEDROCK_REGION:S};f==="bearer"&&p?L.AWS_BEARER_TOKEN=p:f==="iam"&&(m&&(L.AWS_ACCESS_KEY_ID=m),v&&(L.AWS_SECRET_ACCESS_KEY=v));const F=await Q.setupBedrock(L);if(!d.current)return;F.ok?(A({kind:"ok",text:"✅ Configuration saved! Running connectivity test…"}),u("overview"),await M(),setTimeout(()=>void R(),500)):A({kind:"err",text:F.error||"Save failed"})}catch{d.current&&A({kind:"err",text:"Could not reach the dashboard server."})}finally{d.current&&E(!1)}};return n===null?i.jsx("div",{className:"empty-state",children:"Loading Bedrock status…"}):i.jsxs("div",{className:"bedrock-onboarding",children:[i.jsx($e,{icon:"🟠",title:"AWS Bedrock"}),i.jsxs("p",{className:"admin-subtitle",children:["Bedrock gives you access to Claude, Llama, Mistral, DeepSeek, and more — all through a single AWS account. Unlike other providers, Bedrock requires a ",i.jsx("strong",{children:"region"}),", ",i.jsx("strong",{children:"AWS credentials"}),", and explicit ",i.jsx("strong",{children:"model access approval"}),"."]}),T?i.jsx("div",{className:`admin-row-msg${T.kind==="ok"?"":" admin-row-msg-err"}`,children:T.text}):null,i.jsxs("div",{className:"bedrock-status-bar",children:[i.jsxs("div",{className:"bedrock-status-item",children:[i.jsx("span",{className:`status-dot ${n.configured?"connected":"reconnecting"}`}),i.jsx("span",{children:n.configured?"Configured":"Not configured"})]}),i.jsxs("div",{className:"bedrock-status-item",children:[i.jsx("span",{className:"bedrock-status-label",children:"Region:"}),i.jsx("code",{children:n.region})]}),i.jsxs("div",{className:"bedrock-status-item",children:[i.jsx("span",{className:"bedrock-status-label",children:"Auth:"}),i.jsx("code",{children:n.authMethod==="bearer"?"API Key":n.authMethod==="iam"?"IAM":"None"})]}),i.jsxs("div",{className:"bedrock-status-actions",children:[e?i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>u(c==="setup"?"overview":"setup"),children:c==="setup"?"✕ Cancel":"⚙ Setup Wizard"}):null,n.configured?i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void R(),disabled:o,children:o?"⏳ Probing…":"🔍 Test Models"}):null]})]}),c==="setup"&&i.jsxs("div",{className:"bedrock-setup-wizard",children:[i.jsx("h2",{className:"section-subtitle",children:"🚀 Bedrock Setup Wizard"}),i.jsxs("div",{className:"bedrock-wizard-step",children:[i.jsx("h4",{children:"Step 1: Authentication"}),i.jsxs("div",{className:"bedrock-auth-options",children:[i.jsxs("label",{className:`bedrock-auth-option ${f==="bearer"?"selected":""}`,children:[i.jsx("input",{type:"radio",name:"authMethod",checked:f==="bearer",onChange:()=>h("bearer")}),i.jsxs("div",{children:[i.jsx("strong",{children:"Bedrock API Key"}),i.jsx("span",{children:"Simpler — get from Bedrock → Settings → API keys"})]})]}),i.jsxs("label",{className:`bedrock-auth-option ${f==="iam"?"selected":""}`,children:[i.jsx("input",{type:"radio",name:"authMethod",checked:f==="iam",onChange:()=>h("iam")}),i.jsxs("div",{children:[i.jsx("strong",{children:"IAM Credentials"}),i.jsx("span",{children:"Full AWS SDK auth — AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY"})]})]})]}),f==="bearer"?i.jsxs("div",{className:"bedrock-wizard-fields",children:[i.jsxs("div",{className:"bedrock-setup-hint",children:[i.jsx("strong",{children:"How to get a Bedrock API key:"}),i.jsxs("ol",{children:[i.jsxs("li",{children:["Open ",i.jsx("a",{href:"https://console.aws.amazon.com/bedrock/",target:"_blank",rel:"noopener noreferrer",children:"AWS Bedrock Console"})]}),i.jsxs("li",{children:["Go to ",i.jsx("strong",{children:"Settings"})," → ",i.jsx("strong",{children:"API keys"})]}),i.jsx("li",{children:"Create a new key and paste it below"})]})]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Bedrock API Key (Bearer token)"}),i.jsx("input",{type:"password",value:p,onChange:L=>g(L.target.value),placeholder:"••••••••••••",autoComplete:"off",spellCheck:!1})]})]}):i.jsxs("div",{className:"bedrock-wizard-fields",children:[i.jsxs("div",{className:"bedrock-setup-hint",children:[i.jsx("strong",{children:"IAM credentials"})," give full AWS SDK access. Create an IAM user with Bedrock permissions."]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"AWS_ACCESS_KEY_ID"}),i.jsx("input",{type:"text",value:m,onChange:L=>y(L.target.value),placeholder:"AKIA...",autoComplete:"off",spellCheck:!1})]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"AWS_SECRET_ACCESS_KEY"}),i.jsx("input",{type:"password",value:v,onChange:L=>x(L.target.value),placeholder:"••••••••••••",autoComplete:"off",spellCheck:!1})]})]})]}),i.jsxs("div",{className:"bedrock-wizard-step",children:[i.jsx("h4",{children:"Step 2: AWS Region"}),i.jsxs("p",{className:"admin-hint",children:["Models vary by region. ",i.jsx("strong",{children:"us-east-1"})," and ",i.jsx("strong",{children:"us-west-2"})," have the most models. ⚠️ Do NOT use eu-north-1 unless models are explicitly enabled there."]}),i.jsx("select",{className:"bedrock-region-select",value:S,onChange:L=>j(L.target.value),children:Pye.map(L=>i.jsx("option",{value:L.value,children:L.label},L.value))})]}),i.jsxs("div",{className:"bedrock-wizard-step",children:[i.jsx("h4",{children:"Step 3: Model Access"}),i.jsx("p",{className:"admin-hint",children:"Bedrock requires you to request access for each model family."}),i.jsx("div",{className:"bedrock-model-access-hint",children:i.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${S}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"📖 Open Model Access in AWS Console"})}),i.jsx("div",{className:"bedrock-family-grid",children:z_.map(L=>i.jsxs("label",{className:`bedrock-family-card ${w.includes(L.name)?"selected":""}`,children:[i.jsx("input",{type:"checkbox",checked:w.includes(L.name),onChange:F=>{F.target.checked?b(z=>[...z,L.name]):b(z=>z.filter($=>$!==L.name))}}),i.jsxs("div",{children:[i.jsx("strong",{children:L.name}),i.jsxs("span",{children:[L.models.length," model(s)"]})]})]},L.name))}),i.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"In the AWS Console, select the families above and submit. Approval is usually instant for Anthropic and Meta models."})]}),i.jsxs("div",{className:"bedrock-wizard-actions",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void B(),disabled:N||f==="bearer"&&!p||f==="iam"&&(!m||!v),children:N?"⏳ Saving…":"💾 Save & Test"}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),children:"Cancel"})]})]}),c==="test"&&a&&i.jsxs("div",{className:"bedrock-probe-results",children:[i.jsxs("h2",{className:"section-subtitle",children:["🔍 Model Probe Results (",n.region,")"]}),i.jsx("div",{className:"bedrock-probe-grid",children:a.map(L=>i.jsxs("div",{className:`bedrock-probe-card bedrock-probe-${L.status}`,children:[i.jsx("span",{className:"bedrock-probe-icon",children:L.status==="accessible"?"✅":L.status==="permission-denied"?"🔒":L.status==="not-found"?"⚫":"❌"}),i.jsx("span",{className:"bedrock-probe-id",children:L.modelId}),i.jsx("span",{className:"bedrock-probe-status",children:L.status==="accessible"?"Ready":L.status==="permission-denied"?`Need access (HTTP ${L.httpStatus})`:L.status==="not-found"?"Not in this region":"Error"})]},L.modelId))}),a.some(L=>L.status==="permission-denied")&&i.jsxs("div",{className:"bedrock-probe-action",children:[i.jsxs("p",{children:["Some models exist in ",n.region," but access is not approved."]}),i.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${n.region}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"🔓 Request Model Access in AWS Console →"})]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),style:{marginTop:12},children:"← Back"})]}),!n.configured&&c==="overview"&&i.jsxs("div",{className:"bedrock-getting-started",children:[i.jsx("h2",{className:"section-subtitle",children:"📋 Getting Started with Bedrock"}),i.jsxs("div",{className:"bedrock-steps",children:[i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"1"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Create an AWS account"})," (or use existing)",i.jsxs("span",{children:["New to AWS? Sign up at ",i.jsx("a",{href:"https://aws.amazon.com/",target:"_blank",rel:"noopener noreferrer",children:"aws.amazon.com"})]})]})]}),i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"2"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Get Bedrock API key"}),i.jsx("span",{children:"Bedrock → Settings → API keys → Create key"})]})]}),i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"3"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Request model access"}),i.jsx("span",{children:"Bedrock → Model access → Select Claude, Llama, etc. → Submit"})]})]}),i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"4"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Configure in this wizard"}),i.jsx("span",{children:'Click "Setup Wizard" above to enter your credentials'})]})]})]})]}),n.configured&&c==="overview"&&!a&&i.jsx("div",{className:"bedrock-quick-status",children:i.jsxs("p",{className:"admin-hint",children:["Bedrock is configured. Click ",i.jsx("strong",{children:"🔍 Test Models"})," to verify connectivity and discover which models are accessible in ",n.region,"."]})})]})}const nv=["whatsapp","whatsapp_cloud","telegram","signal","slack","discord","email"];function Mye(){const[e,t]=k.useState([]),[n,r]=k.useState(!0),[a,s]=k.useState("all"),[o,l]=k.useState(null),[c,u]=k.useState(""),[d,f]=k.useState(""),[h,p]=k.useState(null),[g,m]=k.useState({}),[y,v]=k.useState({}),[x,S]=k.useState({}),[j,w]=k.useState(null),[b,N]=k.useState(!1),[E,T]=k.useState(!1),[A,M]=k.useState(!1),[R,B]=k.useState(12e4),L=k.useCallback(async()=>{r(!0);const q=await Q.getContacts();q.ok&&q.contacts&&t(q.contacts);const X=await Q.gatewayPolicies();if(X.ok&&X.policies){const oe={};for(const ue of nv){const V=X.policies[ue];V&&(oe[ue]={...V.outboundSenders!==void 0?{outboundSenders:V.outboundSenders}:{},...V.requireApprovedTarget!==void 0?{requireApprovedTarget:V.requireApprovedTarget}:{}})}m(oe),v(oe)}T(X.askUserWait===!0),M(X.askUserWait===!0),typeof X.askUserTimeoutMs=="number"&&B(X.askUserTimeoutMs),r(!1)},[]);k.useEffect(()=>{L()},[L]);const F=e.filter(q=>a==="all"||q.status===a),z=async q=>{p(null);const X=await Q.approveContact(q.platform,q.name);p(X.ok?{kind:"ok",text:`✅ ${q.name} approved.`}:{kind:"err",text:X.error||"Failed."}),L()},$=async q=>{p(null);const X=await Q.rejectContact(q.platform,q.name);p(X.ok?{kind:"ok",text:`🚫 ${q.name} rejected.`}:{kind:"err",text:X.error||"Failed."}),L()},O=async q=>{p(null);const X=await Q.deleteContact(q.platform,q.name);p(X.ok?{kind:"ok",text:`🗑️ ${q.name} deleted.`}:{kind:"err",text:X.error||"Failed."}),L()},U=async()=>{if(!o)return;p(null);const q=await Q.updateContact(o.platform,o.id,{name:c,phone:d});p(q.ok?{kind:"ok",text:`✅ ${c} updated.`}:{kind:"err",text:q.error||"Failed."}),l(null),L()},C=q=>q==="approved"?i.jsx("span",{className:"contact-status-badge approved",children:"✅ Approved"}):q==="pending"?i.jsx("span",{className:"contact-status-badge pending",children:"⏳ Pending"}):i.jsx("span",{className:"contact-status-badge rejected",children:"🚫 Rejected"}),Z=q=>({telegram:"✈️",whatsapp:"📱",whatsapp_cloud:"📱",email:"📧",slack:"💬",discord:"🎮"})[q]||"🔌",D=q=>q?new Date(q).toLocaleString():"—",P=q=>{const X=(x[q]??"").trim();X&&(m(oe=>{var _e;const ue={...oe[q]??{}},V=ue.outboundSenders??((_e=y[q])==null?void 0:_e.outboundSenders)??[];return V.some(je=>je.toLowerCase()===X.toLowerCase())||(ue.outboundSenders=[...V,X]),{...oe,[q]:ue}}),S(oe=>({...oe,[q]:""})))},ie=(q,X)=>{m(oe=>{var _e;const ue={...oe[q]??{}},V=ue.outboundSenders??((_e=y[q])==null?void 0:_e.outboundSenders)??[];return ue.outboundSenders=V.filter(je=>je.toLowerCase()!==X.toLowerCase()),{...oe,[q]:ue}})},ve=q=>{m(X=>{const oe={...X[q]??{}};return oe.requireApprovedTarget=oe.requireApprovedTarget!==!0,{...X,[q]:oe}})},pe=q=>{m(X=>{const oe={...X[q]??{}};return delete oe.outboundSenders,{...X,[q]:oe}})},Te=async()=>{N(!0),w(null);const q={};for(const ue of nv){const V=g[ue]??{},_e=y[ue]??{};(JSON.stringify(V.outboundSenders??null)!==JSON.stringify(_e.outboundSenders??null)||!!V.requireApprovedTarget!=!!_e.requireApprovedTarget)&&(q[ue]={...V.outboundSenders!==void 0?{outboundSenders:V.outboundSenders}:{outboundSenders:null},requireApprovedTarget:!!V.requireApprovedTarget})}const X=E!==A;if(Object.keys(q).length===0&&!X){N(!1),w({kind:"ok",text:"No changes to save."});return}const oe=await Q.saveGatewayPolicies(q,void 0,void 0,{wait:E,timeoutMs:R});oe.ok?(w({kind:"ok",text:"✅ Send authority saved."}),L()):w({kind:"err",text:oe.error||"Failed to save send authority."}),N(!1)};return i.jsxs("div",{className:"panel contacts-page",children:[i.jsx($e,{icon:"📇",title:"Contacts — Outbound Messaging Directory",description:"Manage who the bot can send messages to. Users auto-register on first Telegram message."}),h&&i.jsxs("div",{className:`admin-row-msg ${h.kind==="err"?"admin-row-msg-err":""}`,children:[h.text,i.jsx("button",{className:"admin-mini-btn",onClick:()=>p(null),children:"✕"})]}),i.jsxs("div",{className:"contacts-filters",children:[["all","approved","pending","rejected"].map(q=>i.jsx("button",{type:"button",className:a===q?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>s(q),children:q==="all"?`All (${e.length})`:q==="approved"?`✅ Approved (${e.filter(X=>X.status==="approved").length})`:q==="pending"?`⏳ Pending (${e.filter(X=>X.status==="pending").length})`:`🚫 Rejected (${e.filter(X=>X.status==="rejected").length})`},q)),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void L(),children:"🔄 Refresh"})]}),n?i.jsx("div",{className:"empty-state",children:"Loading contacts..."}):F.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsxs("p",{children:["No contacts",a!=="all"?` with status "${a}"`:"","."]}),i.jsx("p",{className:"admin-hint",children:'Contacts auto-register when users message the bot on Telegram. They appear here as "Pending" until you approve them.'})]}):i.jsx("div",{className:"contacts-table-wrapper",children:i.jsxs("table",{className:"contacts-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"Name"}),i.jsx("th",{children:"ID"}),i.jsx("th",{children:"Phone"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Registered"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:F.map(q=>i.jsxs("tr",{className:`contact-row status-${q.status}`,children:[i.jsxs("td",{children:[Z(q.platform)," ",q.platform]}),i.jsx("td",{className:"contact-name",children:q.name}),i.jsx("td",{className:"contact-id",children:i.jsx("code",{children:q.id})}),i.jsx("td",{className:"contact-phone",children:q.phone||"—"}),i.jsx("td",{children:C(q.status)}),i.jsx("td",{className:"contact-date",children:D(q.registeredAt||q.addedAt)}),i.jsxs("td",{className:"contact-actions",children:[q.status!=="approved"&&i.jsx("button",{className:"admin-mini-btn contact-approve-btn",onClick:()=>void z(q),children:"✅ Approve"}),q.status!=="rejected"&&i.jsx("button",{className:"admin-mini-btn contact-reject-btn",onClick:()=>void $(q),children:"🚫 Reject"}),i.jsx("button",{className:"admin-mini-btn",onClick:()=>{l(q),u(q.name),f(q.phone||"")},children:"✏️ Edit"}),i.jsx("button",{className:"admin-mini-btn contact-delete-btn",onClick:()=>void O(q),children:"🗑️"})]})]},`${q.platform}:${q.id}`))})]})}),i.jsxs("div",{className:"panel-header",style:{marginTop:28},children:[i.jsx("h2",{children:"🔐 Send authority — who may message others"}),i.jsxs("p",{className:"admin-hint",children:["Controls who can ask the agent to send a message to ",i.jsx("strong",{children:"someone else"})," through the gateway (e.g. “send this poem to my brother on WhatsApp”). This is separate from a contact’s approval status above, which only gates sending ",i.jsx("em",{children:"to"})," that person. Left empty, a platform ",i.jsx("strong",{children:"inherits"})," its allowed-users list (open). Add ",i.jsx("code",{children:"Allow-All"})," to allow everyone, or list specific senders to restrict it."]})]}),j&&i.jsxs("div",{className:`admin-row-msg ${j.kind==="err"?"admin-row-msg-err":""}`,children:[j.text,i.jsx("button",{className:"admin-mini-btn",onClick:()=>w(null),children:"✕"})]}),i.jsx("div",{className:"hub-permissions",children:nv.map(q=>{const X=g[q]??{},oe=X.outboundSenders??[],ue=X.outboundSenders===void 0;return i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("span",{className:"hub-chip",children:[Z(q)," ",q]}),ue?i.jsx("span",{className:"hub-chip",children:"open"}):i.jsx("span",{className:"hub-chip",children:"restricted"})]}),i.jsx("div",{className:"hub-alias-list",children:ue?i.jsx("span",{className:"admin-hint",children:"Open — anyone who can trigger the agent may send to others."}):oe.length===0?i.jsx("span",{className:"admin-hint",children:"(empty — nobody may send to others)"}):oe.map(V=>i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:V}),i.jsx("button",{className:"admin-refresh-btn",disabled:b,onClick:()=>ie(q,V),children:"✕"})]},`sa-${q}-${V}`))}),i.jsxs("div",{className:"hub-send-form",children:[i.jsx("input",{type:"text","aria-label":`Allowed sender for ${q}`,value:x[q]??"",onChange:V=>S(_e=>({..._e,[q]:V.target.value})),placeholder:"sender id, or Allow-All",disabled:b}),i.jsx("button",{className:"admin-refresh-btn",disabled:b||!(x[q]??"").trim(),onClick:()=>P(q),children:"+ Sender"}),ue?null:i.jsx("button",{className:"admin-refresh-btn",disabled:b,onClick:()=>pe(q),children:"↺ Reset to open"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[i.jsx("input",{type:"checkbox",checked:!!X.requireApprovedTarget,disabled:b,onChange:()=>ve(q)}),i.jsx("span",{className:"admin-hint",children:"Require approved recipients"})]})]},`sa-${q}`)})}),i.jsxs("div",{className:"hub-card",style:{marginTop:16},children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsx("span",{className:"hub-chip",children:"🧠 Clarifying questions"}),E?i.jsx("span",{className:"hub-chip",children:"wait for reply"}):i.jsx("span",{className:"hub-chip",children:"assume option 1"}),E!==A?i.jsx("span",{className:"hub-chip",children:"· unsaved"}):null]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[i.jsx("input",{type:"checkbox",checked:E,disabled:b,onChange:()=>T(q=>!q)}),i.jsxs("span",{className:"admin-hint",children:["When the agent asks a question on a channel, ",i.jsx("strong",{children:"wait for the sender's reply"})," before acting. Off (default): the question is sent and the ",i.jsx("em",{children:"first"})," option is assumed immediately — so a reply typed afterwards arrives too late to change anything."]})]}),E?i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[i.jsx("span",{className:"admin-hint",children:"Reply window (seconds)"}),i.jsx("input",{type:"number",min:5,max:600,value:Math.round(R/1e3),disabled:b,onChange:q=>B(Math.max(5,Math.min(600,Number(q.target.value)||120))*1e3),style:{width:90}}),i.jsx("span",{className:"admin-hint",children:"then the first option is used, and the timeout is logged."})]}):null]}),i.jsx("div",{style:{marginTop:12},children:i.jsx("button",{className:"admin-refresh-btn",disabled:b,onClick:()=>void Te(),children:"💾 Save send authority"})}),o&&i.jsx("div",{className:"wizard-overlay",onClick:()=>l(null),children:i.jsxs("div",{className:"wizard-modal",onClick:q=>q.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:"✏️"}),i.jsxs("span",{className:"wizard-title",children:["Edit Contact: ",o.name]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"✕"})]}),i.jsxs("div",{className:"wizard-body",children:[i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Name"}),i.jsx("input",{type:"text",value:c,onChange:q=>u(q.target.value)})]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Phone (optional, for flexible lookup)"}),i.jsx("input",{type:"text",value:d,onChange:q=>f(q.target.value),placeholder:"+918800123456"})]}),i.jsxs("p",{className:"admin-hint",children:["Platform: ",i.jsx("strong",{children:o.platform})," | ID: ",i.jsx("code",{children:o.id})]}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"Cancel"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void U(),children:"Save"})]})]})]})})]})}const F_=["proven-dead","proof-expired","parked","never-verified"];function To(e){if(e<=0)return"never";const t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),a=Math.floor(r/24);return a>30?`${a}d ago`:a>0?`${a}d ${r%24}h ago`:r>0?`${r}h ${n%60}m ago`:n>0?`${n}m ago`:`${t}s ago`}function Iye(e){if(e<=0)return"never";const t=(Date.now()-e)/(24*60*60*1e3);return t<1?`${(t*24).toFixed(1)}h`:`${t.toFixed(2)}d`}function $ye({entry:e}){const t=Date.now(),n=t-e.lastProbedAt,r=t-e.lastVerifiedAt,a=t-e.lastUsedAt,s=Math.min(100,n/(30*24*60*60*1e3)*100),o=e.lastVerifiedAt>0?Math.min(100,r/(30*24*60*60*1e3)*100):-1,l=e.lastUsedAt>0?Math.min(100,a/(30*24*60*60*1e3)*100):-1;return i.jsxs("div",{className:"timeline-bar-container",children:[i.jsx("div",{className:"timeline-bar",title:`Last probed: ${To(n)}`,children:i.jsx("div",{className:"timeline-bar-fill probe",style:{width:`${s}%`}})}),o>=0&&i.jsx("div",{className:"timeline-bar small",title:`Last verified: ${To(r)}`,children:i.jsx("div",{className:"timeline-bar-fill verify",style:{width:`${o}%`}})}),l>=0&&i.jsx("div",{className:"timeline-bar small",title:`Last used: ${To(a)}`,children:i.jsx("div",{className:"timeline-bar-fill use",style:{width:`${l}%`}})})]})}function U_(e){return{fontSize:11,padding:"2px 8px",borderRadius:4,background:`${e}20`,color:e,border:`1px solid ${e}40`,whiteSpace:"nowrap"}}function Lye(){const[e,t]=k.useState(null),[n,r]=k.useState(!0),[a,s]=k.useState(null),[o,l]=k.useState("all"),[c,u]=k.useState("provider"),d=k.useRef(!0),f=k.useCallback(async()=>{try{const $=await fetch("/api/model-timeline");if(!$.ok)throw new Error("Failed to fetch timeline data");const O=await $.json();d.current&&(t(O),s(null))}catch($){d.current&&s($ instanceof Error?$.message:"Failed to load timeline")}finally{d.current&&r(!1)}},[]),[h,p]=k.useState(null),[g,m]=k.useState(10),[y,v]=k.useState(!1),[x,S]=k.useState(null),j=k.useRef(!1),w=k.useCallback(async()=>{const $=await Q.fetchVerifyBacklog();if(!d.current)return;p($);const O=($==null?void 0:$.status)==="running";j.current&&!O&&f(),j.current=O},[f]);k.useEffect(()=>{d.current=!0,f(),w();const $=setInterval(()=>void f(),3e4);return()=>{d.current=!1,clearInterval($)}},[f,w]);const b=(h==null?void 0:h.status)==="running";k.useEffect(()=>{if(!b)return;const $=setInterval(()=>void w(),1e3);return()=>clearInterval($)},[b,w]);const N=k.useCallback(async()=>{v(!0),S(null);const $=await Q.startVerifyBacklog(g);if(d.current){if($.state&&p($.state),!$.ok){const O=$.refusal??$.error??"Could not start the run.";S({text:O,kind:$.refusal?"info":"error"})}v(!1)}},[g]);if(n)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"📅",title:"Model Discovery Timeline"}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Loading timeline..."})]})]});if(a)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"📅",title:"Model Discovery Timeline"}),i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:a})]});if(e&&!e.counts)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"📅",title:"Model Discovery Timeline"}),i.jsxs("div",{className:"admin-row-msg admin-row-msg-err",children:["This dashboard server predates the reachability view. Restart it (",i.jsx("code",{children:"nuvira dashboard stop"}),", then start it again) and reload this page."]})]});const E=(e==null?void 0:e.entries)??[],T=e==null?void 0:e.counts,A=e==null?void 0:e.reachabilityCopy,M=e==null?void 0:e.freshnessCopy,R=T?F_.reduce(($,O)=>$+(T[O]??0),0):0,B=E.filter($=>o==="routable"?$.reachability==="routable":o==="not-routable"?$.reachability!=="routable":!0),L=[...B].sort(($,O)=>c==="provider"?$.provider.localeCompare(O.provider)||$.model.localeCompare(O.model):O.lastProbedAt-$.lastProbedAt),F=new Map;for(const $ of L){const O=F.get($.provider);O?O.push($):F.set($.provider,[$])}const z=$=>({background:$?"var(--accent-green)":"var(--bg-hover)",border:`1px solid ${$?"var(--accent-green)":"var(--border)"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"});return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"📅",title:"Model Discovery Timeline"}),i.jsxs("p",{className:"section-description",children:["The registry's age profile: when each tracked model was last probed, last ",i.jsx("em",{children:"verified"}),", and last used — and which ones routing can actually reach. The Models page answers “is it usable right now”; this one answers “what is ageing out”."]}),i.jsxs("div",{className:"stats-grid",style:{marginBottom:8},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:(e==null?void 0:e.totalModels)??0}),i.jsx("div",{className:"stat-label",children:"Tracked models"})]}),i.jsxs("div",{className:"stat-card",style:{borderColor:"var(--accent-green)"},children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-green)"},children:(T==null?void 0:T.routable)??0}),i.jsx("div",{className:"stat-label",children:"Routable now"})]}),i.jsxs("div",{className:"stat-card",style:{borderColor:"var(--border-hover)"},children:[i.jsx("div",{className:"stat-value",style:{color:"var(--text-secondary)"},children:R}),i.jsx("div",{className:"stat-label",children:"Not routable"})]})]}),T?i.jsx("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginBottom:14,fontSize:11},children:F_.map($=>{const O=A==null?void 0:A[$];return i.jsxs("span",{title:O==null?void 0:O.blurb,children:[i.jsx("span",{style:{color:(O==null?void 0:O.color)??"var(--text-secondary)"},children:"■"})," ",i.jsxs("span",{style:{color:"var(--text-secondary)"},children:[(O==null?void 0:O.label)??$,": ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:T[$]??0})]})]},$)})}):null,h?i.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8,padding:"12px 14px",marginBottom:16},"data-testid":"verify-backlog-panel",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[i.jsx("span",{style:{fontWeight:600,color:"var(--text-primary)"},children:"Work the backlog down"}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)",flex:1,minWidth:260},children:["Each check is a real 1-token generation against one of your provider keys — not a listing lookup. A never-verified model is an ",i.jsx("em",{children:"unknown"}),", not a broken one: a check either proves it routable or marks it proven dead. Runs are bounded and one at a time."]}),i.jsxs("label",{style:{fontSize:11,color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:6},children:["How many",i.jsx("input",{type:"number",min:1,max:h.maxCount??25,value:g,disabled:y||b,"aria-label":"how many models to verify",onChange:$=>m(Number($.target.value)),style:{width:64,background:"var(--bg-primary)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:4,padding:"3px 6px",fontSize:12}})]}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:y||b||!(g>0),onClick:()=>void N(),style:{background:"var(--accent-green)",border:"1px solid var(--accent-green)",padding:"4px 12px",fontSize:12,cursor:y||b?"default":"pointer"},"data-testid":"verify-backlog-start",children:b?"⏳ Verifying…":y?"Starting…":`▶ Verify next ${g} now`})]}),b?i.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-progress",children:["Probing"," ",i.jsx("code",{children:h.current?`${h.current.provider}/${h.current.model}`:"…"})," ","— ",h.processed,"/",h.planned," done · ",h.verified," verified · ",h.unavailable," proven dead"]}):null,!b&&h.status==="done"?i.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-summary",children:["✅ ",h.verified," verified · ⛔ ",h.unavailable," proven unavailable · ⚠️ ",h.errored," errored · ⏭"," ",h.skipped," skipped",h.remaining!==null?` — ${h.remaining} still never verified`:""]}):null,(h.results??[]).length>0?i.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:8},children:(h.results??[]).map($=>i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)"},title:$.outcome==="verified"?"Proven routable — a 1-token call succeeded":$.outcome==="unavailable"?"Proven dead — the provider refused it (403/404), re-probing will not help":$.outcome==="skipped"?"Skipped — verified recently enough":"Errored — transient, still unknown, will be retried next run",children:[$.outcome==="verified"?"✅":$.outcome==="unavailable"?"⛔":$.outcome==="skipped"?"⏭":"⚠️"," ",i.jsxs("code",{children:[$.provider,"/",$.model]})]},`${$.provider}:${$.model}`))}):null,x?i.jsx("div",{className:`env-var-notice${x.kind==="error"?" env-var-notice-error":""}`,"data-testid":"verify-backlog-message",children:x.text}):h.status==="idle"&&h.refusal?i.jsx("div",{className:"env-var-notice","data-testid":"verify-backlog-message",children:h.refusal}):null]}):null,i.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:[i.jsx("div",{style:{display:"flex",gap:4},children:["all","routable","not-routable"].map($=>i.jsx("button",{className:`admin-refresh-btn ${o===$?"active":""}`,onClick:()=>l($),style:z(o===$),children:$==="all"?"All":$==="routable"?"Routable":"Not routable"},$))}),i.jsx("div",{style:{display:"flex",gap:4},children:["provider","lastProbed"].map($=>i.jsxs("button",{className:`admin-refresh-btn ${c===$?"active":""}`,onClick:()=>u($),style:z(c===$),children:["Sort: ",$==="lastProbed"?"Last seen":"Provider"]},$))}),i.jsx("button",{className:"admin-refresh-btn",onClick:()=>void f(),style:{background:"var(--bg-hover)",border:"1px solid var(--border)",padding:"4px 12px",fontSize:12,cursor:"pointer"},children:"🔄 Refresh"})]}),i.jsxs("div",{style:{display:"flex",gap:16,marginBottom:4,fontSize:11,color:"var(--text-secondary)",flexWrap:"wrap"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-blue)"},children:"■"})," Probe (last seen in the provider's catalog)"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"■"})," Verified (last success)"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"■"})," Used (last invocation)"]})]}),i.jsxs("div",{style:{marginBottom:12,fontSize:11,color:"var(--text-secondary)"},children:[i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Fresh"})," means the provider still lists it."," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Routable"})," means a turn has been proven to work on it within"," ",(e==null?void 0:e.freshDays)??7," days. A fresh model that was never verified is an unknown, not a failure — background spot-checks work through those a few at a time."]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from(F.entries()).map(([$,O])=>{const U=O.filter(C=>C.reachability==="routable").length;return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:8,border:"1px solid var(--border)",overflow:"hidden"},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:16},children:$==="groq"?"⚡":$==="gemini"?"🌀":$==="local"?"💻":"🤖"}),i.jsx("span",{style:{fontWeight:600,color:"var(--text-primary)"},children:$}),i.jsxs("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:["(",O.length," shown · ",U," routable)"]})]}),i.jsx("div",{style:{padding:"8px 14px"},children:O.map(C=>{const Z=Date.now(),D=A==null?void 0:A[C.reachability],P=M==null?void 0:M[C.freshness],ie=(D==null?void 0:D.color)??"var(--text-secondary)";return i.jsxs("div",{"data-testid":`timeline-row-${C.provider}-${C.model}`,style:{display:"flex",alignItems:"center",gap:12,padding:"6px 0",borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.model}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-secondary)",display:"flex",gap:12,flexWrap:"wrap"},children:[i.jsxs("span",{children:["Probed: ",To(Z-C.lastProbedAt)]}),i.jsxs("span",{children:["Verified: ",C.lastVerifiedAt>0?To(Z-C.lastVerifiedAt):"never"]}),C.lastUsedAt>0&&i.jsxs("span",{children:["Used: ",To(Z-C.lastUsedAt)]}),C.latencyMs!==void 0&&i.jsxs("span",{children:[C.latencyMs,"ms"]}),C.errorRate>0&&i.jsxs("span",{style:{color:C.errorRate>.5?"var(--accent-red)":"var(--accent-yellow)"},children:["err ",(C.errorRate*100).toFixed(0),"%"]}),C.daysSinceVerify!==null&&C.daysSinceVerify>7&&i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:["proof ",Iye(C.lastVerifiedAt)," old"]})]})]}),i.jsx($ye,{entry:C}),P&&i.jsx("span",{style:U_(P.color),title:P.blurb,children:P.label}),i.jsx("span",{style:U_(ie),title:(D==null?void 0:D.blurb)??C.reachability,"data-testid":`reachability-${C.provider}-${C.model}`,children:((D==null?void 0:D.label)??C.reachability).toUpperCase()})]},C.model)})})]},$)})}),B.length===0&&i.jsx("div",{style:{textAlign:"center",padding:"40px 20px",color:"var(--text-secondary)"},children:o==="routable"&&E.length>0?"No model is routable right now — every tracked model is unverified, parked, expired or dead. The Models page shows what each provider would offer live.":"No models match the current filter"})]})}function W_(e){const t=Math.max(0,Math.round((Date.now()-e)/6e4));if(t<1)return"just now";if(t<60)return`${t}m ago`;const n=Math.round(t/60);return n<24?`${n}h ago`:`${Math.round(n/24)}d ago`}function H_(e){return(e||"").split(/[\\/]/).filter(Boolean).slice(-2).join("/")||e}function Dye(){const[e,t]=k.useState(null),[n,r]=k.useState(!1),[a,s]=k.useState(!1),[o,l]=k.useState(null),c=k.useCallback(async()=>{const p=await Q.fetchContinuity();t(p),r(!0)},[]);k.useEffect(()=>{let p=!0;return Q.fetchContinuity().then(g=>{p&&(t(g),r(!0))}),()=>{p=!1}},[]);const u=k.useCallback(async(p,g)=>{s(!0),l(null);const m=await Q.clearContinuity(p,g);m.ok?l(`Removed ${m.removed??0} record(s).`):l(m.error||"Could not clear that."),await c(),s(!1)},[c]);if(!n)return i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"🔗 Continuity"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading continuity data…"})})]});const d=e===null,f=(e==null?void 0:e.sessions)??[],h=(e==null?void 0:e.recall)??[];return i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"🔗 Continuity"}),i.jsx("p",{className:"memory-namespace-note",children:"The conversation snapshots that let a crashed or killed turn be resumed, and the index of past asks used for semantic recall. Both are history — they never decide that work is done. Turn the switches on or off on the Process Environment page."}),d?i.jsxs("p",{className:"memory-namespace-note",children:["Continuity data is unavailable — this dashboard server has no ",i.jsx("code",{children:"/api/continuity"})," endpoint."]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"memory-backend",children:["Session store: ",i.jsx("code",{children:e.toggles.sessionStore?"ON":"OFF"})," · ","Semantic recall: ",i.jsx("code",{children:e.toggles.sessionRecall?"ON":"OFF"})]}),o?i.jsx("div",{className:"env-var-notice",children:o}):null,i.jsxs("h3",{className:"section-subtitle",children:["Stored sessions (",f.length,")"]}),f.length===0?i.jsx("p",{className:"memory-namespace-note",children:"No session snapshots yet."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"memory-list",children:f.map(p=>i.jsxs("div",{className:"memory-item",children:[i.jsxs("span",{className:"memory-project",children:[p.open?"↩️ OPEN":"✓ closed"," · ",p.goal]}),i.jsxs("span",{className:"memory-count",children:[H_(p.cwd)," · ",p.steps," step(s) · ",W_(p.savedAt)]}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a,"aria-label":`Forget session ${p.goal}`,onClick:()=>void u("session",p.id),children:"🗑️ Forget"})]},p.id))}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a||f.length===0,onClick:()=>void u("sessions"),children:"🗑️ Forget all sessions"})]}),i.jsxs("h3",{className:"section-subtitle",children:["Recalled past asks (",h.length,")"]}),h.length===0?i.jsx("p",{className:"memory-namespace-note",children:"Nothing indexed for recall yet."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"memory-list",children:h.map(p=>i.jsxs("div",{className:"memory-item",children:[i.jsxs("span",{className:"memory-project",children:[p.outcome,": ",p.goal]}),i.jsxs("span",{className:"memory-count",children:[H_(p.projectPath)," · ",W_(p.savedAt)]}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a,"aria-label":`Forget recall entry ${p.goal}`,onClick:()=>void u("recall-entry",p.id),children:"🗑️ Forget"})]},p.id))}),i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:a||h.length===0,onClick:()=>void u("recall"),children:"🗑️ Forget all recall entries"})]})]})]})}function Hi(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function Bye(e){return e==null?"0%":(e*100).toFixed(1)+"%"}const G_={"faiss-native":"native FAISS","faiss-ivf":"FAISS-style IVF-flat ANN",json:"exact flat cosine (JSON)"};function zye({data:e}){var l,c;if(!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"💾",title:"Memory Store"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading memory data..."})})]});const{memory:t,health:n}=e,r=Object.entries(t.byFingerprint||{}).sort(([,u],[,d])=>d-u),a=Object.entries(((l=t.facts)==null?void 0:l.byProject)||{}).sort(([,u],[,d])=>d-u),s=[...t.vectorNamespaces||[]].sort((u,d)=>d.entries-u.entries),o=t.recall||{total:0,today:0,last7d:0};return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"💾",title:"Memory Store"}),i.jsxs("div",{className:"stats-grid mini",children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Hi(t.total)}),i.jsx("div",{className:"stat-label",children:"Trajectories"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Bye(t.avgScore)}),i.jsx("div",{className:"stat-label",children:"Avg Score"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Hi((c=t.facts)==null?void 0:c.total)}),i.jsx("div",{className:"stat-label",children:"Facts"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Hi(o.total)}),i.jsx("div",{className:"stat-label",children:"Recall Hits"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Hi(n==null?void 0:n.patterns)}),i.jsx("div",{className:"stat-label",children:"Coding Patterns"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Hi(n==null?void 0:n.feedback)}),i.jsx("div",{className:"stat-label",children:"Feedback Ratings"})]})]}),i.jsxs("p",{className:"memory-backend",children:["Memory tier: ",i.jsx("code",{children:t.backend||"local"})," · ","Vector index: ",i.jsx("code",{children:t.vectorBackend||"unknown"}),t.vectorBackend&&G_[t.vectorBackend]?` (${G_[t.vectorBackend]})`:"",o.last7d>0?` · ${Hi(o.last7d)} recall(s) this week, ${Hi(o.today)} today`:" · no recalls yet"]}),i.jsx(Dye,{}),r.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"By Project Type"}),i.jsx("div",{className:"memory-list",children:r.map(([u,d])=>i.jsxs("div",{className:"memory-item",children:[i.jsx("span",{className:"memory-project",children:u}),i.jsxs("span",{className:"memory-count",children:[d," trajectory(ies)"]})]},u))})]}),a.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Facts by Project"}),i.jsx("div",{className:"memory-list",children:a.map(([u,d])=>i.jsxs("div",{className:"memory-item",children:[i.jsx("span",{className:"memory-project",children:u}),i.jsxs("span",{className:"memory-count",children:[d," fact(s)"]})]},u))})]}),s.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Vector Index by Namespace"}),i.jsxs("p",{className:"memory-namespace-note",children:["Each namespace is its own index file. ",i.jsx("code",{children:"default"})," holds only successful trajectories and indexed sessions — facts, repo chunks and the model registry have their own namespaces — so a small ",i.jsx("code",{children:"default"})," count is corpus size, not a broken index."]}),i.jsx("div",{className:"memory-list",children:s.map(u=>i.jsxs("div",{className:"memory-item",children:[i.jsx("span",{className:"memory-project",children:u.name}),i.jsxs("span",{className:"memory-count",children:[u.entries," vector(s)"]})]},u.name))})]})]})}function Fye(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Uye({data:e}){if(!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"📝",title:"Conversation History"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading history..."})})]});const{history:t}=e,n=t.recent||[];return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"📝",title:"Conversation History"}),i.jsx("div",{className:"history-stats",children:i.jsxs("span",{className:"history-count",children:["Total: ",i.jsx("strong",{children:t.total})," sessions"]})}),i.jsx("div",{className:"history-list",children:n.length===0?i.jsx("div",{className:"empty-state",children:"No conversations recorded yet."}):n.map(r=>i.jsxs("div",{className:"history-item",children:[i.jsx("div",{className:"history-summary",children:r.summary||"Untitled"}),i.jsxs("div",{className:"history-meta",children:[i.jsxs("span",{children:["📅 ",Fye(r.startedAt)]}),i.jsxs("span",{children:["🤖 ",r.provider||"--"]}),i.jsxs("span",{children:["💬 ",r.messageCount||0," msgs"]}),r.tags&&r.tags.length>0&&i.jsxs("span",{children:["🏷️ ",r.tags.map(a=>i.jsx("span",{className:"history-tag",children:a},a))]})]})]},r.id))})]})}function Wye({onFetch:e,onClear:t,onExport:n}){const[r,a]=k.useState([]),[s,o]=k.useState(!1),[l,c]=k.useState(""),[u,d]=k.useState(""),[f,h]=k.useState(null),[p,g]=k.useState(null);k.useEffect(()=>{m()},[l,u]);const m=async()=>{o(!0);try{const j=await e({skillName:l||void 0,status:u||void 0,limit:100});a(j);const w=j.length,b=j.filter(T=>T.status==="success").length,N=j.filter(T=>T.status==="failure").length,E=w>0?Math.round(j.reduce((T,A)=>T+A.durationMs,0)/w):0;g({total:w,success:b,failure:N,avgDuration:E})}catch(j){console.error("Failed to fetch execution history:",j)}finally{o(!1)}},y=async j=>{if(n)try{const w=await n(j),b=new Blob([w],{type:j==="json"?"application/json":"text/csv"}),N=URL.createObjectURL(b),E=document.createElement("a");E.href=N,E.download=`execution-history.${j}`,E.click(),URL.revokeObjectURL(N)}catch(w){console.error("Failed to export history:",w)}},v=async()=>{if(t&&confirm("Are you sure you want to clear all execution history?"))try{await t(),a([]),g(null)}catch(j){console.error("Failed to clear history:",j)}},x=j=>{switch(j){case"success":return"✅";case"failure":return"❌";case"timeout":return"⏰";case"rejected":return"🚫";case"error":return"💥";default:return"❓"}},S=j=>{switch(j){case"python":return"🐍";case"node":return"🟢";case"shell":return"🖥️";case"ruby":return"💎";case"go":return"🔵";case"rust":return"🦀";default:return"📜"}};return i.jsxs("div",{className:"execution-history",children:[i.jsx($e,{icon:"📜",title:"Execution History",actions:i.jsxs("div",{className:"execution-history-actions",children:[i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>y("json"),children:"📥 Export JSON"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>y("csv"),children:"📥 Export CSV"}),t&&i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:v,children:"🗑️ Clear"})]})}),p&&i.jsxs("div",{className:"execution-history-stats",children:[i.jsxs("div",{className:"stat-item",children:[i.jsx("span",{className:"stat-value",children:p.total}),i.jsx("span",{className:"stat-label",children:"Total"})]}),i.jsxs("div",{className:"stat-item stat-success",children:[i.jsx("span",{className:"stat-value",children:p.success}),i.jsx("span",{className:"stat-label",children:"Success"})]}),i.jsxs("div",{className:"stat-item stat-failure",children:[i.jsx("span",{className:"stat-value",children:p.failure}),i.jsx("span",{className:"stat-label",children:"Failed"})]}),i.jsxs("div",{className:"stat-item",children:[i.jsxs("span",{className:"stat-value",children:[p.avgDuration,"ms"]}),i.jsx("span",{className:"stat-label",children:"Avg Duration"})]})]}),i.jsxs("div",{className:"execution-history-filters",children:[i.jsx("input",{className:"env-var-input",type:"text","aria-label":"Filter by skill name",placeholder:"Filter by skill name...",value:l,onChange:j=>c(j.target.value)}),i.jsxs("select",{className:"env-var-input","aria-label":"Filter by status",value:u,onChange:j=>d(j.target.value),children:[i.jsx("option",{value:"",children:"All statuses"}),i.jsx("option",{value:"success",children:"Success"}),i.jsx("option",{value:"failure",children:"Failure"}),i.jsx("option",{value:"timeout",children:"Timeout"}),i.jsx("option",{value:"rejected",children:"Rejected"}),i.jsx("option",{value:"error",children:"Error"})]})]}),i.jsx("div",{className:"execution-history-list",children:s?i.jsx("div",{className:"execution-history-empty",children:"Loading..."}):r.length===0?i.jsx("div",{className:"execution-history-empty",children:"No execution history found. Execute a skill to see results here."}):r.map(j=>i.jsxs("div",{className:`execution-history-entry ${j.status}`,onClick:()=>h((f==null?void 0:f.id)===j.id?null:j),children:[i.jsxs("div",{className:"entry-header",children:[i.jsx("span",{className:"entry-icon",children:x(j.status)}),i.jsx("span",{className:"entry-skill",children:j.skillName}),i.jsxs("span",{className:"entry-runtime",children:[S(j.runtime)," ",j.runtime]}),i.jsxs("span",{className:"entry-duration",children:[j.durationMs,"ms"]}),i.jsx("span",{className:"entry-time",children:new Date(j.timestamp).toLocaleString()}),i.jsx("span",{className:"entry-expand",children:(f==null?void 0:f.id)===j.id?"▼":"▶"})]}),(f==null?void 0:f.id)===j.id&&i.jsxs("div",{className:"entry-details",children:[i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Status:"}),i.jsx("span",{className:"detail-value",children:j.status})]}),i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Runtime:"}),i.jsx("span",{className:"detail-value",children:j.runtime})]}),i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Duration:"}),i.jsxs("span",{className:"detail-value",children:[j.durationMs,"ms"]})]}),j.exitCode!==void 0&&i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Exit Code:"}),i.jsx("span",{className:"detail-value",children:j.exitCode})]}),j.error&&i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Error:"}),i.jsx("span",{className:"detail-value entry-error",children:j.error})]}),j.command&&i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Command:"}),i.jsx("code",{className:"detail-value",children:j.command})]})]})]},j.id))})]})}function Hye({envVars:e,onSave:t,onDelete:n,onTest:r,readOnly:a=!1}){const[s,o]=k.useState(null),[l,c]=k.useState(""),[u,d]=k.useState(!1),[f,h]=k.useState(""),[p,g]=k.useState(""),[m,y]=k.useState(null),[v,x]=k.useState({}),S=[...e].sort((N,E)=>N.requiredBy&&!E.requiredBy?-1:!N.requiredBy&&E.requiredBy?1:N.name.localeCompare(E.name)),j=N=>{t(N,l),o(null),c("")},w=()=>{f&&p&&(t(f,p),h(""),g(""),d(!1))},b=async N=>{if(r){y(N);try{const E=await r(N);x(T=>({...T,[N]:E}))}catch{x(E=>({...E,[N]:!1}))}finally{y(null)}}};return i.jsxs("div",{className:"env-var-editor",children:[i.jsxs("div",{className:"env-var-header",children:[i.jsx("h2",{className:"env-var-title",children:"🔐 Environment Variables"}),!a&&i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>d(!u),children:u?"✕ Cancel":"+ Add Variable"})]}),u&&!a&&i.jsxs("div",{className:"env-var-add-form",children:[i.jsx("input",{className:"env-var-input",type:"text",placeholder:"Variable name (e.g., MY_API_KEY)",value:f,onChange:N=>h(N.target.value)}),i.jsx("input",{className:"env-var-input",type:"password",placeholder:"Value",value:p,onChange:N=>g(N.target.value)}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!f||!p,onClick:w,children:"💾 Save"})]}),i.jsx("div",{className:"env-var-list",children:S.length===0?i.jsx("div",{className:"env-var-empty",children:"No environment variables configured. Add one to get started."}):S.map(N=>i.jsxs("div",{className:`env-var-row ${N.isSet?"env-var-set":"env-var-missing"} ${N.isProviderCredential?"env-var-blocked":""}`,children:[i.jsxs("div",{className:"env-var-row-header",children:[i.jsxs("span",{className:"env-var-name",children:[N.name,N.requiredBy&&i.jsxs("span",{className:"env-var-required-badge",children:["required by ",N.requiredBy]}),N.isProviderCredential&&i.jsx("span",{className:"env-var-blocked-badge",children:"🔒 provider credential (blocked)"})]}),i.jsx("span",{className:"env-var-status",children:N.isSet?"✅ Set":"❌ Not set"})]}),N.description&&i.jsx("div",{className:"env-var-description",children:N.description}),s===N.name?i.jsxs("div",{className:"env-var-edit",children:[i.jsx("input",{className:"env-var-input",type:"password",value:l,onChange:E=>c(E.target.value),placeholder:"Enter new value..."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>j(N.name),children:"💾 Save"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>o(null),children:"Cancel"})]}):i.jsxs("div",{className:"env-var-actions",children:[!a&&!N.isProviderCredential&&i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{o(N.name),c("")},children:"✏️ Edit"}),r&&i.jsx("button",{className:"admin-mini-btn",type:"button",disabled:m===N.name,onClick:()=>b(N.name),children:m===N.name?"⏳ Testing...":"🧪 Test"}),!a&&i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:()=>n(N.name),children:"🗑️ Delete"}),v[N.name]!==void 0&&i.jsx("span",{className:`env-var-test-result ${v[N.name]?"env-var-test-pass":"env-var-test-fail"}`,children:v[N.name]?"✅ Valid":"❌ Invalid"})]})]},N.name))}),i.jsx("div",{className:"env-var-help",children:i.jsxs("p",{children:[i.jsx("strong",{children:"Tip:"})," Environment variables are stored in ",i.jsx("code",{children:"~/.nuvira/.env"})," and injected into skill executions. Provider credentials (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) are automatically blocked from skill execution for security."]})})]})}function Gye(){const[e,t]=k.useState({configured:!1,authenticated:!1,role:null}),[n,r]=k.useState([]),[a,s]=k.useState(!0),[o,l]=k.useState(null),[c,u]=k.useState(null),d=e.authenticated&&(e.role==="admin"||e.role==="operator"),f=k.useCallback(async()=>{s(!0);const m=await Q.fetchSkillEnv();r(m),s(!1)},[]);k.useEffect(()=>{Q.fetchAdminAuthStatus().then(m=>{t(m?{configured:m.configured,authenticated:m.authenticated,role:m.role??null}:{configured:!1,authenticated:!1,role:null})}),f()},[f]);const h=k.useCallback(async(m,y)=>{var S;l(null),u(null);const v=await Q.saveSecrets({[m]:y}),x=(S=v.refused)==null?void 0:S.find(j=>j.name===m);!v.ok||x?l(x?qye(m,x.reason):v.error||`Could not save ${m}.`):u(`Saved ${m}.`),await f()},[f]),p=k.useCallback(async m=>{l(null),u(null);const y=await Q.deleteSkillEnvVar(m);y.ok?u(y.removed?`Deleted ${m}.`:`${m} was not stored in the env file.`):l(y.error||`Could not delete ${m}.`),await f()},[f]),g=k.useCallback(async m=>{const y=await Q.testSkillEnvVar(m);return y.ok?(l(null),u(y.detail||`${m}: ${y.usable?"usable by skills":"not usable by skills"}`),y.usable===!0):(l(y.error||`Could not test ${m}.`),!1)},[]);return i.jsxs("div",{children:[i.jsx($e,{icon:"🔐",title:"Skill Environment Variables"}),i.jsxs("div",{className:"env-var-header",children:[i.jsx("span",{className:"env-var-title",children:"Values are masked; only names and set/unset state are shown."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void f(),children:"↻ Refresh"})]}),i.jsxs("div",{className:"admin-hint",children:["Secrets here are injected into skill executions that declare them (",i.jsx("code",{children:"required_environment_variables"}),"). Provider credentials are listed but locked — they belong to provider setup, and skills never receive them."]}),e.authenticated?null:i.jsx("div",{className:"admin-hint",children:e.configured?"Log in to view or edit skill secrets.":"Set up an admin account to manage skill secrets."}),e.authenticated&&!d?i.jsx("div",{className:"admin-hint",children:"Read-only — admins and operators can change these values."}):null,o?i.jsx("div",{className:"env-var-notice env-var-notice-error",children:o}):null,c?i.jsx("div",{className:"env-var-notice",children:c}):null,a?i.jsx("div",{className:"loading-state",children:"Loading…"}):i.jsx(Hye,{envVars:n,onSave:(m,y)=>void h(m,y),onDelete:m=>void p(m),onTest:g,readOnly:!d})]})}function qye(e,t){switch(t){case"provider-credential":return`${e} is a provider credential — configure it in provider setup instead. Skills never receive it.`;case"invalid-name":return`${e} is not a valid environment variable name.`;case"write-failed":return`${e} could not be written to the env file.`;default:return`${e} was not saved (${t}).`}}const Kye=[{id:"turn",title:"Turn behaviour",blurb:"How each turn runs. Unset means nobody has asked for anything, which is not the same as asking for no."},{id:"observability",title:"Observability",blurb:"What a run records about itself. Both are off by default and off unless asked for."},{id:"hooks",title:"Tool hooks",blurb:"A command run around every tool call, with the call on stdin as JSON. For a phase, a value here REPLACES the hooks declared in tools.hooks."}];function Vye(){const[e,t]=k.useState({configured:!1,authenticated:!1,role:null}),[n,r]=k.useState([]),[a,s]=k.useState(!0),[o,l]=k.useState(null),[c,u]=k.useState(null),[d,f]=k.useState({}),[h,p]=k.useState(null),g=e.authenticated&&(e.role==="admin"||e.role==="operator"),m=k.useCallback(async()=>{s(!0),r(await Q.fetchProcessEnv()),s(!1)},[]);k.useEffect(()=>{Q.fetchAdminAuthStatus().then(x=>{t(x?{configured:x.configured,authenticated:x.authenticated,role:x.role??null}:{configured:!1,authenticated:!1,role:null})}),m()},[m]);const y=k.useCallback(async(x,S)=>{p(x),l(null),u(null);const j=await Q.saveProcessEnvVar(x,S);if(!j.ok||!j.row)l(j.error||`Could not set ${x}.`);else{const w=j.row;r(b=>b.map(N=>N.name===w.name?w:N)),f(b=>({...b,[x]:""})),u(`${x} = ${w.fileValue}. Takes effect on the next turn; the dashboard picked it up immediately.`)}p(null)},[]),v=k.useCallback(async x=>{p(x),l(null),u(null);const S=await Q.deleteProcessEnvVar(x);if(!S.ok||!S.row)l(S.error||`Could not unset ${x}.`);else{const j=S.row;r(w=>w.map(b=>b.name===j.name?j:b)),f(w=>({...w,[x]:""})),u(S.removed?`${x} removed from the env file. ${j.unsetMeans}`:`${x} had no line in the env file. ${j.unsetMeans}`)}p(null)},[]);return i.jsxs("div",{children:[i.jsx($e,{icon:"🌱",title:"Process Environment"}),i.jsxs("div",{className:"env-var-header",children:[i.jsx("span",{className:"env-var-title",children:"These are the switches Agent-Nuvira reads for how a run behaves. Values are written to the credential env file and are not masked — do not put a secret in a hook command."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void m(),children:"↻ Refresh"})]}),i.jsxs("div",{className:"admin-hint",children:["A value exported in your shell ",i.jsx("strong",{children:"wins over this file"}),", for the dashboard and for every CLI run in that shell. A row that says ",i.jsx("em",{children:"shell value wins"})," is reporting exactly that, and writes here will not change it."]}),e.authenticated?null:i.jsx("div",{className:"admin-hint",children:e.configured?"Log in to view or change the process environment.":"Set up an admin account to change the process environment."}),e.authenticated&&!g?i.jsx("div",{className:"admin-hint",children:"Read-only — admins and operators can change these values."}):null,o?i.jsx("div",{className:"env-var-notice env-var-notice-error",children:o}):null,c?i.jsx("div",{className:"env-var-notice",children:c}):null,a?i.jsx("div",{className:"loading-state",children:"Loading…"}):Kye.map(x=>{const S=n.filter(j=>j.group===x.id);return S.length===0?null:i.jsxs("section",{className:"process-env-group",children:[i.jsx("h3",{className:"process-env-group-title",children:x.title}),i.jsx("p",{className:"process-env-group-blurb",children:x.blurb}),i.jsx("div",{className:"env-var-list",children:S.map(j=>i.jsx(Yye,{row:j,draft:d[j.name]??"",busy:h===j.name,readOnly:!g,onDraft:w=>f(b=>({...b,[j.name]:w})),onSet:w=>void y(j.name,w),onUnset:()=>void v(j.name)},j.name))})]},x.id)})]})}function Yye({row:e,draft:t,busy:n,readOnly:r,onDraft:a,onSet:s,onUnset:o}){const l=e.state==="on",c=e.state!=="unset",u=f=>`admin-mini-btn${f?" process-env-active":""}`,d=e.kind==="flag"&&e.fileValue!==null&&e.fileValue!=="1"&&e.fileValue!=="0"?e.fileValue:null;return i.jsxs("div",{className:`env-var-row ${c?"env-var-set":"env-var-missing"}`,"data-testid":`process-env-row-${e.name}`,children:[i.jsxs("div",{className:"env-var-row-header",children:[i.jsxs("span",{className:"env-var-name",children:[e.name,e.shadowed?i.jsxs("span",{className:"env-var-blocked-badge",children:["⚠️ shell value wins: ",e.processValue]}):null]}),i.jsxs("span",{className:"env-var-status",children:[e.kind==="flag"?l?"✅ On":c?"⭕ Off":"➖ Unset":c?"✅ Set":"➖ Unset",d?` (${d})`:""]})]}),i.jsxs("div",{className:"env-var-description",children:[i.jsx("strong",{children:e.label})," — ",e.description]}),i.jsxs("div",{className:"env-var-description",children:["Unset: ",e.unsetMeans]}),e.cliEquivalent?i.jsxs("div",{className:"env-var-description",children:["Same switch: ",i.jsx("code",{children:e.cliEquivalent})]}):null,e.warning?i.jsxs("div",{className:"env-var-warning",children:["⚠️ ",e.warning]}):null,r?null:i.jsxs("div",{className:"env-var-actions",children:[e.kind==="flag"?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:u(l),type:"button",disabled:n,onClick:()=>s("1"),children:"On"}),i.jsx("button",{className:u(c&&!l),type:"button",disabled:n,onClick:()=>s("0"),children:"Off"}),i.jsx("button",{className:u(!c),type:"button",disabled:n,onClick:o,children:"Unset"})]}):null,e.kind==="text"||e.acceptsValue?i.jsxs(i.Fragment,{children:[i.jsx("input",{className:"env-var-input",type:"text",value:t,placeholder:e.placeholder,disabled:n,onChange:f=>a(f.target.value),"aria-label":`${e.name} value`}),i.jsxs("button",{className:"admin-mini-btn",type:"button",disabled:n||t.trim()==="",onClick:()=>s(t),children:["💾 ",e.valueLabel??"Save"]})]}):null,e.kind==="text"?i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:n,onClick:o,children:"🗑️ Unset"}):null]})]})}function Xye(){const[e,t]=k.useState(null),[n,r]=k.useState(!1),[a,s]=k.useState("--"),[o,l]=k.useState(!1),c=k.useCallback(f=>{t(f),s(new Date().toLocaleTimeString())},[]),u=k.useCallback(f=>{r(f)},[]),d=k.useCallback(async()=>{l(!0);try{const f=await Q.fetchAll();f&&c(f)}finally{l(!1)}},[c]);return k.useEffect(()=>{Q.fetchAll().then(p=>{p&&c(p)});const f=Q.subscribe(c),h=Q.onConnectionChange(u);return Q.connect(),()=>{f(),h(),Q.disconnect()}},[c,u]),i.jsx(eB,{connected:n,lastUpdated:a,onRefresh:d,refreshing:o,children:i.jsxs(j2,{children:[i.jsx(Je,{path:"/",element:i.jsx(D_,{})}),i.jsx(Je,{path:"/overview",element:i.jsx(Mie,{data:e,onRefresh:d,refreshing:o})}),i.jsx(Je,{path:"/chat",element:i.jsx(US,{to:"/",replace:!0})}),i.jsx(Je,{path:"/dag",element:i.jsx(Gie,{data:e})}),i.jsx(Je,{path:"/costs",element:i.jsx(Kie,{data:e})}),i.jsx(Je,{path:"/benchmarks",element:i.jsx(Yie,{data:e})}),i.jsx(Je,{path:"/models",element:i.jsx(Ise,{})}),i.jsx(Je,{path:"/models/timeline",element:i.jsx(Lye,{})}),i.jsx(Je,{path:"/routing",element:i.jsx(goe,{data:e})}),i.jsx(Je,{path:"/requests",element:i.jsx(boe,{data:e})}),i.jsx(Je,{path:"/traces",element:i.jsx(Toe,{})}),i.jsx(Je,{path:"/hub",element:i.jsx(Koe,{})}),i.jsx(Je,{path:"/tasks",element:i.jsx(tle,{})}),i.jsx(Je,{path:"/chat",element:i.jsx(D_,{})}),i.jsx(Je,{path:"/evals",element:i.jsx(Aye,{data:e})}),i.jsx(Je,{path:"/platforms",element:i.jsx(Oye,{})}),i.jsx(Je,{path:"/bedrock",element:i.jsx(Rye,{canWrite:!0,sessionExpired:f=>console.error(f)})}),i.jsx(Je,{path:"/contacts",element:i.jsx(Mye,{})}),i.jsx(Je,{path:"/gateway",element:i.jsx(Tye,{})}),i.jsx(Je,{path:"/env",element:i.jsx(Gye,{})}),i.jsx(Je,{path:"/process-env",element:i.jsx(Vye,{})}),i.jsx(Je,{path:"/memory",element:i.jsx(zye,{data:e})}),i.jsx(Je,{path:"/history",element:i.jsx(Uye,{data:e})}),i.jsx(Je,{path:"/executions",element:i.jsx(Wye,{onFetch:f=>Q.fetchExecutionAudit(f)})}),i.jsx(Je,{path:"/system",element:i.jsx(Jie,{data:e,connected:n,lastUpdated:a})}),i.jsx(Je,{path:"/admin",element:i.jsx($oe,{})}),i.jsx(Je,{path:"/help",element:i.jsx(Iie,{})}),i.jsx(Je,{path:"*",element:i.jsx(US,{to:"/",replace:!0})})]})})}Bx(bT());aT(document.getElementById("root")).render(i.jsx(k.StrictMode,{children:i.jsx(P2,{children:i.jsx(Xye,{})})}));
|
|
207
|
+
//# sourceMappingURL=index-Beportyl.js.map
|