agent-nuvira 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/.agents/skills/code-assessment/SKILL.md +10 -1
  2. package/.agents/skills/index.json +1 -1
  3. package/README.md +42 -1
  4. package/dist/cli/cli-program.d.ts.map +1 -1
  5. package/dist/cli/cli-program.js +6 -2
  6. package/dist/cli/cli-program.js.map +1 -1
  7. package/dist/cli/commands.d.ts +2 -1
  8. package/dist/cli/commands.d.ts.map +1 -1
  9. package/dist/cli/commands.js +3 -2
  10. package/dist/cli/commands.js.map +1 -1
  11. package/dist/cli/config.js +2 -2
  12. package/dist/cli/config.js.map +1 -1
  13. package/dist/cli/dashboard.d.ts +26 -0
  14. package/dist/cli/dashboard.d.ts.map +1 -1
  15. package/dist/cli/dashboard.js +123 -3
  16. package/dist/cli/dashboard.js.map +1 -1
  17. package/dist/cli/intent.d.ts +1 -1
  18. package/dist/cli/intent.js +2 -2
  19. package/dist/cli/intent.js.map +1 -1
  20. package/dist/cli/loop-executor.d.ts +7 -0
  21. package/dist/cli/loop-executor.d.ts.map +1 -1
  22. package/dist/cli/loop-executor.js +1 -0
  23. package/dist/cli/loop-executor.js.map +1 -1
  24. package/dist/cli/process-control.d.ts +15 -0
  25. package/dist/cli/process-control.d.ts.map +1 -1
  26. package/dist/cli/process-control.js +38 -14
  27. package/dist/cli/process-control.js.map +1 -1
  28. package/dist/forwarded.d.ts +2 -0
  29. package/dist/forwarded.d.ts.map +1 -0
  30. package/dist/forwarded.js +2 -0
  31. package/dist/forwarded.js.map +1 -0
  32. package/dist/inference/tool-call-utils.d.ts +44 -0
  33. package/dist/inference/tool-call-utils.d.ts.map +1 -1
  34. package/dist/inference/tool-call-utils.js +126 -4
  35. package/dist/inference/tool-call-utils.js.map +1 -1
  36. package/dist/learning/autonomy-policy.d.ts +6 -0
  37. package/dist/learning/autonomy-policy.d.ts.map +1 -1
  38. package/dist/learning/autonomy-policy.js +75 -23
  39. package/dist/learning/autonomy-policy.js.map +1 -1
  40. package/dist/learning/eval-framework.d.ts +24 -0
  41. package/dist/learning/eval-framework.d.ts.map +1 -1
  42. package/dist/learning/eval-framework.js +291 -0
  43. package/dist/learning/eval-framework.js.map +1 -1
  44. package/dist/learning/intent-envelope.d.ts +162 -0
  45. package/dist/learning/intent-envelope.d.ts.map +1 -0
  46. package/dist/learning/intent-envelope.js +235 -0
  47. package/dist/learning/intent-envelope.js.map +1 -0
  48. package/dist/learning/reasoning-trace.d.ts +1 -1
  49. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  50. package/dist/learning/reasoning-trace.js.map +1 -1
  51. package/dist/learning/run-trace.d.ts +164 -0
  52. package/dist/learning/run-trace.d.ts.map +1 -0
  53. package/dist/learning/run-trace.js +342 -0
  54. package/dist/learning/run-trace.js.map +1 -0
  55. package/dist/learning/skill-store.d.ts.map +1 -1
  56. package/dist/learning/skill-store.js +5 -1
  57. package/dist/learning/skill-store.js.map +1 -1
  58. package/dist/learning/skill-types.d.ts +14 -0
  59. package/dist/learning/skill-types.d.ts.map +1 -1
  60. package/dist/learning/skill-types.js +19 -0
  61. package/dist/learning/skill-types.js.map +1 -1
  62. package/dist/resources/command-manifest.json +10 -10
  63. package/dist/skills/bundled-skills.d.ts.map +1 -1
  64. package/dist/skills/bundled-skills.js +13 -2
  65. package/dist/skills/bundled-skills.js.map +1 -1
  66. package/dist/tools/coding-tools.d.ts.map +1 -1
  67. package/dist/tools/coding-tools.js +33 -8
  68. package/dist/tools/coding-tools.js.map +1 -1
  69. package/dist/tools/edit-verification.d.ts +78 -0
  70. package/dist/tools/edit-verification.d.ts.map +1 -1
  71. package/dist/tools/edit-verification.js +213 -16
  72. package/dist/tools/edit-verification.js.map +1 -1
  73. package/dist/tools/registry.d.ts +31 -2
  74. package/dist/tools/registry.d.ts.map +1 -1
  75. package/dist/tools/registry.js +44 -5
  76. package/dist/tools/registry.js.map +1 -1
  77. package/dist/tools/run-cli.d.ts.map +1 -1
  78. package/dist/tools/run-cli.js +15 -2
  79. package/dist/tools/run-cli.js.map +1 -1
  80. package/dist/tools/run-terminal.d.ts.map +1 -1
  81. package/dist/tools/run-terminal.js +23 -4
  82. package/dist/tools/run-terminal.js.map +1 -1
  83. package/dist/tools/skill-tool.d.ts.map +1 -1
  84. package/dist/tools/skill-tool.js +5 -0
  85. package/dist/tools/skill-tool.js.map +1 -1
  86. package/dist/tools/tool-loop.d.ts +28 -1
  87. package/dist/tools/tool-loop.d.ts.map +1 -1
  88. package/dist/tools/tool-loop.js +261 -14
  89. package/dist/tools/tool-loop.js.map +1 -1
  90. package/dist/web-dashboard/chat-console.d.ts +5 -0
  91. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  92. package/dist/web-dashboard/chat-console.js +32 -3
  93. package/dist/web-dashboard/chat-console.js.map +1 -1
  94. package/dist/web-dashboard/server.d.ts +46 -0
  95. package/dist/web-dashboard/server.d.ts.map +1 -1
  96. package/dist/web-dashboard/server.js +115 -1
  97. package/dist/web-dashboard/server.js.map +1 -1
  98. package/dist/web-dashboard/src/admin-auth.d.ts +49 -2
  99. package/dist/web-dashboard/src/admin-auth.d.ts.map +1 -1
  100. package/dist/web-dashboard/src/admin-auth.js +64 -3
  101. package/dist/web-dashboard/src/admin-auth.js.map +1 -1
  102. package/dist/web-dashboard/src/types.d.ts +41 -0
  103. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  104. package/package.json +5 -2
  105. package/src/web-dashboard/public/assets/index-CjvoBhlz.js +207 -0
  106. package/src/web-dashboard/public/assets/index-CjvoBhlz.js.map +1 -0
  107. package/src/web-dashboard/public/index.html +1 -1
  108. package/src/web-dashboard/public/assets/index-kCUkORm7.js +0 -207
  109. package/src/web-dashboard/public/assets/index-kCUkORm7.js.map +0 -1
@@ -0,0 +1,207 @@
1
+ var l2=Object.defineProperty;var c2=(e,t,n)=>t in e?l2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $r=(e,t,n)=>c2(e,typeof t!="symbol"?t+"":t,n);function u2(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rj={exports:{}},jh={},ij={exports:{}},ze={};/**
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 pu=Symbol.for("react.element"),d2=Symbol.for("react.portal"),f2=Symbol.for("react.fragment"),h2=Symbol.for("react.strict_mode"),p2=Symbol.for("react.profiler"),m2=Symbol.for("react.provider"),g2=Symbol.for("react.context"),y2=Symbol.for("react.forward_ref"),v2=Symbol.for("react.suspense"),b2=Symbol.for("react.memo"),x2=Symbol.for("react.lazy"),Q0=Symbol.iterator;function w2(e){return e===null||typeof e!="object"?null:(e=Q0&&e[Q0]||e["@@iterator"],typeof e=="function"?e:null)}var aj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sj=Object.assign,oj={};function Ho(e,t,n){this.props=e,this.context=t,this.refs=oj,this.updater=n||aj}Ho.prototype.isReactComponent={};Ho.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")};Ho.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lj(){}lj.prototype=Ho.prototype;function lb(e,t,n){this.props=e,this.context=t,this.refs=oj,this.updater=n||aj}var cb=lb.prototype=new lj;cb.constructor=lb;sj(cb,Ho.prototype);cb.isPureReactComponent=!0;var J0=Array.isArray,cj=Object.prototype.hasOwnProperty,ub={current:null},uj={key:!0,ref:!0,__self:!0,__source:!0};function dj(e,t,n){var r,i={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)cj.call(t,r)&&!uj.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:pu,type:e,key:a,ref:o,props:i,_owner:ub.current}}function S2(e,t){return{$$typeof:pu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function db(e){return typeof e=="object"&&e!==null&&e.$$typeof===pu}function k2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ew=/\/+/g;function Vp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?k2(""+e.key):t.toString(36)}function Cd(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case pu:case d2:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Vp(o,0):r,J0(i)?(n="",e!=null&&(n=e.replace(ew,"$&/")+"/"),Cd(i,t,n,"",function(u){return u})):i!=null&&(db(i)&&(i=S2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(ew,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",J0(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+Vp(a,l);o+=Cd(a,t,n,c,i)}else if(c=w2(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+Vp(a,l++),o+=Cd(a,t,n,c,i);else if(a==="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 Du(e,t,n){if(e==null)return e;var r=[],i=0;return Cd(e,r,"","",function(a){return t.call(n,a,i++)}),r}function E2(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 Nn={current:null},Od={transition:null},_2={ReactCurrentDispatcher:Nn,ReactCurrentBatchConfig:Od,ReactCurrentOwner:ub};function fj(){throw Error("act(...) is not supported in production builds of React.")}ze.Children={map:Du,forEach:function(e,t,n){Du(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Du(e,function(){t++}),t},toArray:function(e){return Du(e,function(t){return t})||[]},only:function(e){if(!db(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ze.Component=Ho;ze.Fragment=f2;ze.Profiler=p2;ze.PureComponent=lb;ze.StrictMode=h2;ze.Suspense=v2;ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_2;ze.act=fj;ze.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=sj({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=ub.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)cj.call(t,c)&&!uj.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:pu,type:e.type,key:i,ref:a,props:r,_owner:o}};ze.createContext=function(e){return e={$$typeof:g2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:m2,_context:e},e.Consumer=e};ze.createElement=dj;ze.createFactory=function(e){var t=dj.bind(null,e);return t.type=e,t};ze.createRef=function(){return{current:null}};ze.forwardRef=function(e){return{$$typeof:y2,render:e}};ze.isValidElement=db;ze.lazy=function(e){return{$$typeof:x2,_payload:{_status:-1,_result:e},_init:E2}};ze.memo=function(e,t){return{$$typeof:b2,type:e,compare:t===void 0?null:t}};ze.startTransition=function(e){var t=Od.transition;Od.transition={};try{e()}finally{Od.transition=t}};ze.unstable_act=fj;ze.useCallback=function(e,t){return Nn.current.useCallback(e,t)};ze.useContext=function(e){return Nn.current.useContext(e)};ze.useDebugValue=function(){};ze.useDeferredValue=function(e){return Nn.current.useDeferredValue(e)};ze.useEffect=function(e,t){return Nn.current.useEffect(e,t)};ze.useId=function(){return Nn.current.useId()};ze.useImperativeHandle=function(e,t,n){return Nn.current.useImperativeHandle(e,t,n)};ze.useInsertionEffect=function(e,t){return Nn.current.useInsertionEffect(e,t)};ze.useLayoutEffect=function(e,t){return Nn.current.useLayoutEffect(e,t)};ze.useMemo=function(e,t){return Nn.current.useMemo(e,t)};ze.useReducer=function(e,t,n){return Nn.current.useReducer(e,t,n)};ze.useRef=function(e){return Nn.current.useRef(e)};ze.useState=function(e){return Nn.current.useState(e)};ze.useSyncExternalStore=function(e,t,n){return Nn.current.useSyncExternalStore(e,t,n)};ze.useTransition=function(){return Nn.current.useTransition()};ze.version="18.3.1";ij.exports=ze;var E=ij.exports;const H=Ze(E),N2=u2({__proto__:null,default:H},[E]);/**
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 j2=E,A2=Symbol.for("react.element"),T2=Symbol.for("react.fragment"),C2=Object.prototype.hasOwnProperty,O2=j2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,P2={key:!0,ref:!0,__self:!0,__source:!0};function hj(e,t,n){var r,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)C2.call(t,r)&&!P2.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:A2,type:e,key:a,ref:o,props:i,_owner:O2.current}}jh.Fragment=T2;jh.jsx=hj;jh.jsxs=hj;rj.exports=jh;var s=rj.exports,pj={exports:{}},Qn={},mj={exports:{}},gj={};/**
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,F){var A=O.length;O.push(F);e:for(;0<A;){var Z=A-1>>>1,L=O[Z];if(0<i(L,F))O[Z]=F,O[A]=L,A=Z;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var F=O[0],A=O.pop();if(A!==F){O[0]=A;e:for(var Z=0,L=O.length,P=L>>>1;Z<P;){var ce=2*(Z+1)-1,we=O[ce],pe=ce+1,Pe=O[pe];if(0>i(we,A))pe<L&&0>i(Pe,we)?(O[Z]=Pe,O[pe]=A,Z=pe):(O[Z]=we,O[ce]=A,Z=ce);else if(pe<L&&0>i(Pe,A))O[Z]=Pe,O[pe]=A,Z=pe;else break e}}return F}function i(O,F){var A=O.sortIndex-F.sortIndex;return A!==0?A:O.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.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,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=O)r(u),F.sortIndex=F.expirationTime,t(c,F);else break;F=n(u)}}function k(O){if(m=!1,x(O),!g)if(n(c)!==null)g=!0,D(S);else{var F=n(u);F!==null&&U(k,F.startTime-O)}}function S(O,F){g=!1,m&&(m=!1,y(N),N=-1),p=!0;var A=h;try{for(x(F),f=n(c);f!==null&&(!(f.expirationTime>F)||O&&!I());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var L=Z(f.expirationTime<=F);F=e.unstable_now(),typeof L=="function"?f.callback=L:f===n(c)&&r(c),x(F)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var ce=n(u);ce!==null&&U(k,ce.startTime-F),P=!1}return P}finally{f=null,h=A,p=!1}}var w=!1,_=null,N=-1,C=5,T=-1;function I(){return!(e.unstable_now()-T<C)}function M(){if(_!==null){var O=e.unstable_now();T=O;var F=!0;try{F=_(!0,O)}finally{F?$():(w=!1,_=null)}}else w=!1}var $;if(typeof b=="function")$=function(){b(M)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,z=R.port2;R.port1.onmessage=M,$=function(){z.postMessage(null)}}else $=function(){v(M,0)};function D(O){_=O,w||(w=!0,$())}function U(O,F){N=v(function(){O(e.unstable_now())},F)}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,D(S))},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"):C=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 F=3;break;default:F=h}var A=h;h=F;try{return O()}finally{h=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,F){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var A=h;h=O;try{return F()}finally{h=A}},e.unstable_scheduleCallback=function(O,F,A){var Z=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?Z+A:Z):A=Z,O){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=A+L,O={id:d++,callback:F,priorityLevel:O,startTime:A,expirationTime:L,sortIndex:-1},A>Z?(O.sortIndex=A,t(u,O),n(c)===null&&O===n(u)&&(m?(y(N),N=-1):m=!0,U(k,A-Z))):(O.sortIndex=L,t(c,O),g||p||(g=!0,D(S))),O},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(O){var F=h;return function(){var A=h;h=F;try{return O.apply(this,arguments)}finally{h=A}}}})(gj);mj.exports=gj;var M2=mj.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 R2=E,Xn=M2;function ie(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 yj=new Set,cc={};function fs(e,t){ho(e,t),ho(e+"Capture",t)}function ho(e,t){for(cc[e]=t,e=0;e<t.length;e++)yj.add(t[e])}var yi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ag=Object.prototype.hasOwnProperty,I2=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,tw={},nw={};function $2(e){return Ag.call(nw,e)?!0:Ag.call(tw,e)?!1:I2.test(e)?nw[e]=!0:(tw[e]=!0,!1)}function L2(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 D2(e,t,n,r){if(t===null||typeof t>"u"||L2(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 jn(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var sn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){sn[e]=new jn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];sn[t]=new jn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){sn[e]=new jn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){sn[e]=new jn(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){sn[e]=new jn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){sn[e]=new jn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){sn[e]=new jn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){sn[e]=new jn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){sn[e]=new jn(e,5,!1,e.toLowerCase(),null,!1,!1)});var fb=/[\-:]([a-z])/g;function hb(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(fb,hb);sn[t]=new jn(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(fb,hb);sn[t]=new jn(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(fb,hb);sn[t]=new jn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){sn[e]=new jn(e,1,!1,e.toLowerCase(),null,!1,!1)});sn.xlinkHref=new jn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){sn[e]=new jn(e,1,!1,e.toLowerCase(),null,!0,!0)});function pb(e,t,n,r){var i=sn.hasOwnProperty(t)?sn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(D2(t,n,i,r)&&(n=null),r||i===null?$2(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ei=R2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Bu=Symbol.for("react.element"),Bs=Symbol.for("react.portal"),zs=Symbol.for("react.fragment"),mb=Symbol.for("react.strict_mode"),Tg=Symbol.for("react.profiler"),vj=Symbol.for("react.provider"),bj=Symbol.for("react.context"),gb=Symbol.for("react.forward_ref"),Cg=Symbol.for("react.suspense"),Og=Symbol.for("react.suspense_list"),yb=Symbol.for("react.memo"),zi=Symbol.for("react.lazy"),xj=Symbol.for("react.offscreen"),rw=Symbol.iterator;function bl(e){return e===null||typeof e!="object"?null:(e=rw&&e[rw]||e["@@iterator"],typeof e=="function"?e:null)}var _t=Object.assign,Yp;function Fl(e){if(Yp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Yp=t&&t[1]||""}return`
34
+ `+Yp+e}var Xp=!1;function Zp(e,t){if(!e||Xp)return"";Xp=!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 i=u.stack.split(`
35
+ `),a=r.stack.split(`
36
+ `),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var c=`
37
+ `+i[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{Xp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fl(e):""}function B2(e){switch(e.tag){case 5:return Fl(e.type);case 16:return Fl("Lazy");case 13:return Fl("Suspense");case 19:return Fl("SuspenseList");case 0:case 2:case 15:return e=Zp(e.type,!1),e;case 11:return e=Zp(e.type.render,!1),e;case 1:return e=Zp(e.type,!0),e;default:return""}}function Pg(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 zs:return"Fragment";case Bs:return"Portal";case Tg:return"Profiler";case mb:return"StrictMode";case Cg:return"Suspense";case Og:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bj:return(e.displayName||"Context")+".Consumer";case vj:return(e._context.displayName||"Context")+".Provider";case gb: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:Pg(e.type)||"Memo";case zi:t=e._payload,e=e._init;try{return Pg(e(t))}catch{}}return null}function z2(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 Pg(t);case 8:return t===mb?"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 ua(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function F2(e){var t=wj(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 i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.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 zu(e){e._valueTracker||(e._valueTracker=F2(e))}function Sj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=wj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Gd(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 Mg(e,t){var n=t.checked;return _t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function iw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ua(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 kj(e,t){t=t.checked,t!=null&&pb(e,"checked",t,!1)}function Rg(e,t){kj(e,t);var n=ua(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")?Ig(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ig(e,t.type,ua(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function aw(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 Ig(e,t,n){(t!=="number"||Gd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ul=Array.isArray;function no(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ua(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function $g(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ie(91));return _t({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function sw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ie(92));if(Ul(n)){if(1<n.length)throw Error(ie(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ua(n)}}function Ej(e,t){var n=ua(t.value),r=ua(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 ow(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function _j(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 Lg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?_j(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fu,Nj=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fu=Fu||document.createElement("div"),Fu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function uc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ql={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},U2=["Webkit","ms","Moz","O"];Object.keys(ql).forEach(function(e){U2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ql[t]=ql[e]})});function jj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ql.hasOwnProperty(e)&&ql[e]?(""+t).trim():t+"px"}function Aj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=jj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var W2=_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 Dg(e,t){if(t){if(W2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function Bg(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 zg=null;function vb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fg=null,ro=null,io=null;function lw(e){if(e=yu(e)){if(typeof Fg!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=Ph(t),Fg(e.stateNode,e.type,t))}}function Tj(e){ro?io?io.push(e):io=[e]:ro=e}function Cj(){if(ro){var e=ro,t=io;if(io=ro=null,lw(e),t)for(e=0;e<t.length;e++)lw(t[e])}}function Oj(e,t){return e(t)}function Pj(){}var Qp=!1;function Mj(e,t,n){if(Qp)return e(t,n);Qp=!0;try{return Oj(e,t,n)}finally{Qp=!1,(ro!==null||io!==null)&&(Pj(),Cj())}}function dc(e,t){var n=e.stateNode;if(n===null)return null;var r=Ph(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(ie(231,t,typeof n));return n}var Ug=!1;if(yi)try{var xl={};Object.defineProperty(xl,"passive",{get:function(){Ug=!0}}),window.addEventListener("test",xl,xl),window.removeEventListener("test",xl,xl)}catch{Ug=!1}function H2(e,t,n,r,i,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Kl=!1,qd=null,Kd=!1,Wg=null,G2={onError:function(e){Kl=!0,qd=e}};function q2(e,t,n,r,i,a,o,l,c){Kl=!1,qd=null,H2.apply(G2,arguments)}function K2(e,t,n,r,i,a,o,l,c){if(q2.apply(this,arguments),Kl){if(Kl){var u=qd;Kl=!1,qd=null}else throw Error(ie(198));Kd||(Kd=!0,Wg=u)}}function hs(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 Rj(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 cw(e){if(hs(e)!==e)throw Error(ie(188))}function V2(e){var t=e.alternate;if(!t){if(t=hs(e),t===null)throw Error(ie(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return cw(i),e;if(a===r)return cw(i),t;a=a.sibling}throw Error(ie(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o)throw Error(ie(189))}}if(n.alternate!==r)throw Error(ie(190))}if(n.tag!==3)throw Error(ie(188));return n.stateNode.current===n?e:t}function Ij(e){return e=V2(e),e!==null?$j(e):null}function $j(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=$j(e);if(t!==null)return t;e=e.sibling}return null}var Lj=Xn.unstable_scheduleCallback,uw=Xn.unstable_cancelCallback,Y2=Xn.unstable_shouldYield,X2=Xn.unstable_requestPaint,Tt=Xn.unstable_now,Z2=Xn.unstable_getCurrentPriorityLevel,bb=Xn.unstable_ImmediatePriority,Dj=Xn.unstable_UserBlockingPriority,Vd=Xn.unstable_NormalPriority,Q2=Xn.unstable_LowPriority,Bj=Xn.unstable_IdlePriority,Ah=null,qr=null;function J2(e){if(qr&&typeof qr.onCommitFiberRoot=="function")try{qr.onCommitFiberRoot(Ah,e,void 0,(e.current.flags&128)===128)}catch{}}var jr=Math.clz32?Math.clz32:nI,eI=Math.log,tI=Math.LN2;function nI(e){return e>>>=0,e===0?32:31-(eI(e)/tI|0)|0}var Uu=64,Wu=4194304;function Wl(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 Yd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=Wl(l):(a&=o,a!==0&&(r=Wl(a)))}else o=n&~i,o!==0?r=Wl(o):a!==0&&(r=Wl(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&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-jr(t),i=1<<n,r|=e[n],t&=~i;return r}function rI(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 iI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-jr(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&r)&&(i[o]=rI(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Hg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zj(){var e=Uu;return Uu<<=1,!(Uu&4194240)&&(Uu=64),e}function Jp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jr(t),e[t]=n}function aI(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 i=31-jr(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function xb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-jr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var et=0;function Fj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Uj,wb,Wj,Hj,Gj,Gg=!1,Hu=[],Ji=null,ea=null,ta=null,fc=new Map,hc=new Map,Wi=[],sI="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 dw(e,t){switch(e){case"focusin":case"focusout":Ji=null;break;case"dragenter":case"dragleave":ea=null;break;case"mouseover":case"mouseout":ta=null;break;case"pointerover":case"pointerout":fc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hc.delete(t.pointerId)}}function wl(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=yu(t),t!==null&&wb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function oI(e,t,n,r,i){switch(t){case"focusin":return Ji=wl(Ji,e,t,n,r,i),!0;case"dragenter":return ea=wl(ea,e,t,n,r,i),!0;case"mouseover":return ta=wl(ta,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return fc.set(a,wl(fc.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,hc.set(a,wl(hc.get(a)||null,e,t,n,r,i)),!0}return!1}function qj(e){var t=Ba(e.target);if(t!==null){var n=hs(t);if(n!==null){if(t=n.tag,t===13){if(t=Rj(n),t!==null){e.blockedOn=t,Gj(e.priority,function(){Wj(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 Pd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=qg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);zg=r,n.target.dispatchEvent(r),zg=null}else return t=yu(n),t!==null&&wb(t),e.blockedOn=n,!1;t.shift()}return!0}function fw(e,t,n){Pd(e)&&n.delete(t)}function lI(){Gg=!1,Ji!==null&&Pd(Ji)&&(Ji=null),ea!==null&&Pd(ea)&&(ea=null),ta!==null&&Pd(ta)&&(ta=null),fc.forEach(fw),hc.forEach(fw)}function Sl(e,t){e.blockedOn===t&&(e.blockedOn=null,Gg||(Gg=!0,Xn.unstable_scheduleCallback(Xn.unstable_NormalPriority,lI)))}function pc(e){function t(i){return Sl(i,e)}if(0<Hu.length){Sl(Hu[0],e);for(var n=1;n<Hu.length;n++){var r=Hu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ji!==null&&Sl(Ji,e),ea!==null&&Sl(ea,e),ta!==null&&Sl(ta,e),fc.forEach(t),hc.forEach(t),n=0;n<Wi.length;n++)r=Wi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Wi.length&&(n=Wi[0],n.blockedOn===null);)qj(n),n.blockedOn===null&&Wi.shift()}var ao=Ei.ReactCurrentBatchConfig,Xd=!0;function cI(e,t,n,r){var i=et,a=ao.transition;ao.transition=null;try{et=1,Sb(e,t,n,r)}finally{et=i,ao.transition=a}}function uI(e,t,n,r){var i=et,a=ao.transition;ao.transition=null;try{et=4,Sb(e,t,n,r)}finally{et=i,ao.transition=a}}function Sb(e,t,n,r){if(Xd){var i=qg(e,t,n,r);if(i===null)cm(e,t,r,Zd,n),dw(e,r);else if(oI(i,e,t,n,r))r.stopPropagation();else if(dw(e,r),t&4&&-1<sI.indexOf(e)){for(;i!==null;){var a=yu(i);if(a!==null&&Uj(a),a=qg(e,t,n,r),a===null&&cm(e,t,r,Zd,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else cm(e,t,r,null,n)}}var Zd=null;function qg(e,t,n,r){if(Zd=null,e=vb(r),e=Ba(e),e!==null)if(t=hs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Rj(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 Zd=e,null}function Kj(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(Z2()){case bb:return 1;case Dj:return 4;case Vd:case Q2:return 16;case Bj:return 536870912;default:return 16}default:return 16}}var Vi=null,kb=null,Md=null;function Vj(){if(Md)return Md;var e,t=kb,n=t.length,r,i="value"in Vi?Vi.value:Vi.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Md=i.slice(e,1<r?1-r:void 0)}function Rd(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 Gu(){return!0}function hw(){return!1}function Jn(e){function t(n,r,i,a,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Gu:hw,this.isPropagationStopped=hw,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=Gu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Gu)},persist:function(){},isPersistent:Gu}),t}var Go={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Eb=Jn(Go),gu=_t({},Go,{view:0,detail:0}),dI=Jn(gu),em,tm,kl,Th=_t({},gu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_b,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!==kl&&(kl&&e.type==="mousemove"?(em=e.screenX-kl.screenX,tm=e.screenY-kl.screenY):tm=em=0,kl=e),em)},movementY:function(e){return"movementY"in e?e.movementY:tm}}),pw=Jn(Th),fI=_t({},Th,{dataTransfer:0}),hI=Jn(fI),pI=_t({},gu,{relatedTarget:0}),nm=Jn(pI),mI=_t({},Go,{animationName:0,elapsedTime:0,pseudoElement:0}),gI=Jn(mI),yI=_t({},Go,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vI=Jn(yI),bI=_t({},Go,{data:0}),mw=Jn(bI),xI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wI={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"},SI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=SI[e])?!!t[e]:!1}function _b(){return kI}var EI=_t({},gu,{key:function(e){if(e.key){var t=xI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_b,charCode:function(e){return e.type==="keypress"?Rd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_I=Jn(EI),NI=_t({},Th,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gw=Jn(NI),jI=_t({},gu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_b}),AI=Jn(jI),TI=_t({},Go,{propertyName:0,elapsedTime:0,pseudoElement:0}),CI=Jn(TI),OI=_t({},Th,{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}),PI=Jn(OI),MI=[9,13,27,32],Nb=yi&&"CompositionEvent"in window,Vl=null;yi&&"documentMode"in document&&(Vl=document.documentMode);var RI=yi&&"TextEvent"in window&&!Vl,Yj=yi&&(!Nb||Vl&&8<Vl&&11>=Vl),yw=" ",vw=!1;function Xj(e,t){switch(e){case"keyup":return MI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fs=!1;function II(e,t){switch(e){case"compositionend":return Zj(t);case"keypress":return t.which!==32?null:(vw=!0,yw);case"textInput":return e=t.data,e===yw&&vw?null:e;default:return null}}function $I(e,t){if(Fs)return e==="compositionend"||!Nb&&Xj(e,t)?(e=Vj(),Md=kb=Vi=null,Fs=!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 Yj&&t.locale!=="ko"?null:t.data;default:return null}}var LI={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 bw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!LI[e.type]:t==="textarea"}function Qj(e,t,n,r){Tj(r),t=Qd(t,"onChange"),0<t.length&&(n=new Eb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yl=null,mc=null;function DI(e){cA(e,0)}function Ch(e){var t=Hs(e);if(Sj(t))return e}function BI(e,t){if(e==="change")return t}var Jj=!1;if(yi){var rm;if(yi){var im="oninput"in document;if(!im){var xw=document.createElement("div");xw.setAttribute("oninput","return;"),im=typeof xw.oninput=="function"}rm=im}else rm=!1;Jj=rm&&(!document.documentMode||9<document.documentMode)}function ww(){Yl&&(Yl.detachEvent("onpropertychange",eA),mc=Yl=null)}function eA(e){if(e.propertyName==="value"&&Ch(mc)){var t=[];Qj(t,mc,e,vb(e)),Mj(DI,t)}}function zI(e,t,n){e==="focusin"?(ww(),Yl=t,mc=n,Yl.attachEvent("onpropertychange",eA)):e==="focusout"&&ww()}function FI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ch(mc)}function UI(e,t){if(e==="click")return Ch(t)}function WI(e,t){if(e==="input"||e==="change")return Ch(t)}function HI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pr=typeof Object.is=="function"?Object.is:HI;function gc(e,t){if(Pr(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 i=n[r];if(!Ag.call(t,i)||!Pr(e[i],t[i]))return!1}return!0}function Sw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kw(e,t){var n=Sw(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=Sw(n)}}function tA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nA(){for(var e=window,t=Gd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gd(e.document)}return t}function jb(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 GI(e){var t=nA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&tA(n.ownerDocument.documentElement,n)){if(r!==null&&jb(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 i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=kw(n,a);var o=kw(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>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 qI=yi&&"documentMode"in document&&11>=document.documentMode,Us=null,Kg=null,Xl=null,Vg=!1;function Ew(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vg||Us==null||Us!==Gd(r)||(r=Us,"selectionStart"in r&&jb(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}),Xl&&gc(Xl,r)||(Xl=r,r=Qd(Kg,"onSelect"),0<r.length&&(t=new Eb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Us)))}function qu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ws={animationend:qu("Animation","AnimationEnd"),animationiteration:qu("Animation","AnimationIteration"),animationstart:qu("Animation","AnimationStart"),transitionend:qu("Transition","TransitionEnd")},am={},rA={};yi&&(rA=document.createElement("div").style,"AnimationEvent"in window||(delete Ws.animationend.animation,delete Ws.animationiteration.animation,delete Ws.animationstart.animation),"TransitionEvent"in window||delete Ws.transitionend.transition);function Oh(e){if(am[e])return am[e];if(!Ws[e])return e;var t=Ws[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in rA)return am[e]=t[n];return e}var iA=Oh("animationend"),aA=Oh("animationiteration"),sA=Oh("animationstart"),oA=Oh("transitionend"),lA=new Map,_w="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ha(e,t){lA.set(e,t),fs(t,[e])}for(var sm=0;sm<_w.length;sm++){var om=_w[sm],KI=om.toLowerCase(),VI=om[0].toUpperCase()+om.slice(1);ha(KI,"on"+VI)}ha(iA,"onAnimationEnd");ha(aA,"onAnimationIteration");ha(sA,"onAnimationStart");ha("dblclick","onDoubleClick");ha("focusin","onFocus");ha("focusout","onBlur");ha(oA,"onTransitionEnd");ho("onMouseEnter",["mouseout","mouseover"]);ho("onMouseLeave",["mouseout","mouseover"]);ho("onPointerEnter",["pointerout","pointerover"]);ho("onPointerLeave",["pointerout","pointerover"]);fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fs("onBeforeInput",["compositionend","keypress","textInput","paste"]);fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),YI=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hl));function Nw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,K2(r,t,void 0,e),e.currentTarget=null}function cA(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=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!==a&&i.isPropagationStopped())break e;Nw(i,l,u),a=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;Nw(i,l,u),a=c}}}if(Kd)throw e=Wg,Kd=!1,Wg=null,e}function pt(e,t){var n=t[Jg];n===void 0&&(n=t[Jg]=new Set);var r=e+"__bubble";n.has(r)||(uA(t,e,2,!1),n.add(r))}function lm(e,t,n){var r=0;t&&(r|=4),uA(n,e,r,t)}var Ku="_reactListening"+Math.random().toString(36).slice(2);function yc(e){if(!e[Ku]){e[Ku]=!0,yj.forEach(function(n){n!=="selectionchange"&&(YI.has(n)||lm(n,!1,e),lm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ku]||(t[Ku]=!0,lm("selectionchange",!1,t))}}function uA(e,t,n,r){switch(Kj(t)){case 1:var i=cI;break;case 4:i=uI;break;default:i=Sb}n=i.bind(null,t,n,e),i=void 0,!Ug||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function cm(e,t,n,r,i){var a=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===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;l!==null;){if(o=Ba(l),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue e}l=l.parentNode}}r=r.return}Mj(function(){var u=a,d=vb(n),f=[];e:{var h=lA.get(e);if(h!==void 0){var p=Eb,g=e;switch(e){case"keypress":if(Rd(n)===0)break e;case"keydown":case"keyup":p=_I;break;case"focusin":g="focus",p=nm;break;case"focusout":g="blur",p=nm;break;case"beforeblur":case"afterblur":p=nm;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=pw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=hI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=AI;break;case iA:case aA:case sA:p=gI;break;case oA:p=CI;break;case"scroll":p=dI;break;case"wheel":p=PI;break;case"copy":case"cut":case"paste":p=vI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=gw}var m=(t&4)!==0,v=!m&&e==="scroll",y=m?h!==null?h+"Capture":null:h;m=[];for(var b=u,x;b!==null;){x=b;var k=x.stateNode;if(x.tag===5&&k!==null&&(x=k,y!==null&&(k=dc(b,y),k!=null&&m.push(vc(b,k,x)))),v)break;b=b.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!==zg&&(g=n.relatedTarget||n.fromElement)&&(Ba(g)||g[vi]))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?Ba(g):null,g!==null&&(v=hs(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(m=pw,k="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(m=gw,k="onPointerLeave",y="onPointerEnter",b="pointer"),v=p==null?h:Hs(p),x=g==null?h:Hs(g),h=new m(k,b+"leave",p,n,d),h.target=v,h.relatedTarget=x,k=null,Ba(d)===u&&(m=new m(y,b+"enter",g,n,d),m.target=x,m.relatedTarget=v,k=m),v=k,p&&g)t:{for(m=p,y=g,b=0,x=m;x;x=As(x))b++;for(x=0,k=y;k;k=As(k))x++;for(;0<b-x;)m=As(m),b--;for(;0<x-b;)y=As(y),x--;for(;b--;){if(m===y||y!==null&&m===y.alternate)break t;m=As(m),y=As(y)}m=null}else m=null;p!==null&&jw(f,h,p,m,!1),g!==null&&v!==null&&jw(f,v,g,m,!0)}}e:{if(h=u?Hs(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=BI;else if(bw(h))if(Jj)S=WI;else{S=FI;var w=zI}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=UI);if(S&&(S=S(e,u))){Qj(f,S,n,d);break e}w&&w(e,h,u),e==="focusout"&&(w=h._wrapperState)&&w.controlled&&h.type==="number"&&Ig(h,"number",h.value)}switch(w=u?Hs(u):window,e){case"focusin":(bw(w)||w.contentEditable==="true")&&(Us=w,Kg=u,Xl=null);break;case"focusout":Xl=Kg=Us=null;break;case"mousedown":Vg=!0;break;case"contextmenu":case"mouseup":case"dragend":Vg=!1,Ew(f,n,d);break;case"selectionchange":if(qI)break;case"keydown":case"keyup":Ew(f,n,d)}var _;if(Nb)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Fs?Xj(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(Yj&&n.locale!=="ko"&&(Fs||N!=="onCompositionStart"?N==="onCompositionEnd"&&Fs&&(_=Vj()):(Vi=d,kb="value"in Vi?Vi.value:Vi.textContent,Fs=!0)),w=Qd(u,N),0<w.length&&(N=new mw(N,e,null,n,d),f.push({event:N,listeners:w}),_?N.data=_:(_=Zj(n),_!==null&&(N.data=_)))),(_=RI?II(e,n):$I(e,n))&&(u=Qd(u,"onBeforeInput"),0<u.length&&(d=new mw("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=_))}cA(f,t)})}function vc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Qd(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=dc(e,n),a!=null&&r.unshift(vc(e,a,i)),a=dc(e,t),a!=null&&r.push(vc(e,a,i))),e=e.return}return r}function As(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function jw(e,t,n,r,i){for(var a=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,i?(c=dc(n,a),c!=null&&o.unshift(vc(n,c,l))):i||(c=dc(n,a),c!=null&&o.push(vc(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var XI=/\r\n?/g,ZI=/\u0000|\uFFFD/g;function Aw(e){return(typeof e=="string"?e:""+e).replace(XI,`
38
+ `).replace(ZI,"")}function Vu(e,t,n){if(t=Aw(t),Aw(e)!==t&&n)throw Error(ie(425))}function Jd(){}var Yg=null,Xg=null;function Zg(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 Qg=typeof setTimeout=="function"?setTimeout:void 0,QI=typeof clearTimeout=="function"?clearTimeout:void 0,Tw=typeof Promise=="function"?Promise:void 0,JI=typeof queueMicrotask=="function"?queueMicrotask:typeof Tw<"u"?function(e){return Tw.resolve(null).then(e).catch(e$)}:Qg;function e$(e){setTimeout(function(){throw e})}function um(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),pc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);pc(t)}function na(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 Cw(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 qo=Math.random().toString(36).slice(2),Ur="__reactFiber$"+qo,bc="__reactProps$"+qo,vi="__reactContainer$"+qo,Jg="__reactEvents$"+qo,t$="__reactListeners$"+qo,n$="__reactHandles$"+qo;function Ba(e){var t=e[Ur];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vi]||n[Ur]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cw(e);e!==null;){if(n=e[Ur])return n;e=Cw(e)}return t}e=n,n=e.parentNode}return null}function yu(e){return e=e[Ur]||e[vi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Hs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ie(33))}function Ph(e){return e[bc]||null}var ey=[],Gs=-1;function pa(e){return{current:e}}function yt(e){0>Gs||(e.current=ey[Gs],ey[Gs]=null,Gs--)}function ut(e,t){Gs++,ey[Gs]=e.current,e.current=t}var da={},vn=pa(da),$n=pa(!1),ts=da;function po(e,t){var n=e.type.contextTypes;if(!n)return da;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ln(e){return e=e.childContextTypes,e!=null}function ef(){yt($n),yt(vn)}function Ow(e,t,n){if(vn.current!==da)throw Error(ie(168));ut(vn,t),ut($n,n)}function dA(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ie(108,z2(e)||"Unknown",i));return _t({},n,r)}function tf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||da,ts=vn.current,ut(vn,e),ut($n,$n.current),!0}function Pw(e,t,n){var r=e.stateNode;if(!r)throw Error(ie(169));n?(e=dA(e,t,ts),r.__reactInternalMemoizedMergedChildContext=e,yt($n),yt(vn),ut(vn,e)):yt($n),ut($n,n)}var oi=null,Mh=!1,dm=!1;function fA(e){oi===null?oi=[e]:oi.push(e)}function r$(e){Mh=!0,fA(e)}function ma(){if(!dm&&oi!==null){dm=!0;var e=0,t=et;try{var n=oi;for(et=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}oi=null,Mh=!1}catch(i){throw oi!==null&&(oi=oi.slice(e+1)),Lj(bb,ma),i}finally{et=t,dm=!1}}return null}var qs=[],Ks=0,nf=null,rf=0,rr=[],ir=0,ns=null,li=1,ci="";function Ca(e,t){qs[Ks++]=rf,qs[Ks++]=nf,nf=e,rf=t}function hA(e,t,n){rr[ir++]=li,rr[ir++]=ci,rr[ir++]=ns,ns=e;var r=li;e=ci;var i=32-jr(r)-1;r&=~(1<<i),n+=1;var a=32-jr(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,li=1<<32-jr(t)+i|n<<i|r,ci=a+e}else li=1<<a|n<<i|r,ci=e}function Ab(e){e.return!==null&&(Ca(e,1),hA(e,1,0))}function Tb(e){for(;e===nf;)nf=qs[--Ks],qs[Ks]=null,rf=qs[--Ks],qs[Ks]=null;for(;e===ns;)ns=rr[--ir],rr[ir]=null,ci=rr[--ir],rr[ir]=null,li=rr[--ir],rr[ir]=null}var Vn=null,Kn=null,bt=!1,Er=null;function pA(e,t){var n=sr(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 Mw(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,Vn=e,Kn=na(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Vn=e,Kn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ns!==null?{id:li,overflow:ci}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=sr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Vn=e,Kn=null,!0):!1;default:return!1}}function ty(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ny(e){if(bt){var t=Kn;if(t){var n=t;if(!Mw(e,t)){if(ty(e))throw Error(ie(418));t=na(n.nextSibling);var r=Vn;t&&Mw(e,t)?pA(r,n):(e.flags=e.flags&-4097|2,bt=!1,Vn=e)}}else{if(ty(e))throw Error(ie(418));e.flags=e.flags&-4097|2,bt=!1,Vn=e}}}function Rw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Vn=e}function Yu(e){if(e!==Vn)return!1;if(!bt)return Rw(e),bt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Zg(e.type,e.memoizedProps)),t&&(t=Kn)){if(ty(e))throw mA(),Error(ie(418));for(;t;)pA(e,t),t=na(t.nextSibling)}if(Rw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ie(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Kn=na(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Kn=null}}else Kn=Vn?na(e.stateNode.nextSibling):null;return!0}function mA(){for(var e=Kn;e;)e=na(e.nextSibling)}function mo(){Kn=Vn=null,bt=!1}function Cb(e){Er===null?Er=[e]:Er.push(e)}var i$=Ei.ReactCurrentBatchConfig;function El(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(ie(309));var r=n.stateNode}if(!r)throw Error(ie(147,e));var i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(ie(284));if(!n._owner)throw Error(ie(290,e))}return e}function Xu(e,t){throw e=Object.prototype.toString.call(t),Error(ie(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Iw(e){var t=e._init;return t(e._payload)}function gA(e){function t(y,b){if(e){var x=y.deletions;x===null?(y.deletions=[b],y.flags|=16):x.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function i(y,b){return y=sa(y,b),y.index=0,y.sibling=null,y}function a(y,b,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<b?(y.flags|=2,b):x):(y.flags|=2,b)):(y.flags|=1048576,b)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,x,k){return b===null||b.tag!==6?(b=vm(x,y.mode,k),b.return=y,b):(b=i(b,x),b.return=y,b)}function c(y,b,x,k){var S=x.type;return S===zs?d(y,b,x.props.children,k,x.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===zi&&Iw(S)===b.type)?(k=i(b,x.props),k.ref=El(y,b,x),k.return=y,k):(k=Fd(x.type,x.key,x.props,null,y.mode,k),k.ref=El(y,b,x),k.return=y,k)}function u(y,b,x,k){return b===null||b.tag!==4||b.stateNode.containerInfo!==x.containerInfo||b.stateNode.implementation!==x.implementation?(b=bm(x,y.mode,k),b.return=y,b):(b=i(b,x.children||[]),b.return=y,b)}function d(y,b,x,k,S){return b===null||b.tag!==7?(b=Va(x,y.mode,k,S),b.return=y,b):(b=i(b,x),b.return=y,b)}function f(y,b,x){if(typeof b=="string"&&b!==""||typeof b=="number")return b=vm(""+b,y.mode,x),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Bu:return x=Fd(b.type,b.key,b.props,null,y.mode,x),x.ref=El(y,null,b),x.return=y,x;case Bs:return b=bm(b,y.mode,x),b.return=y,b;case zi:var k=b._init;return f(y,k(b._payload),x)}if(Ul(b)||bl(b))return b=Va(b,y.mode,x,null),b.return=y,b;Xu(y,b)}return null}function h(y,b,x,k){var S=b!==null?b.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return S!==null?null:l(y,b,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Bu:return x.key===S?c(y,b,x,k):null;case Bs:return x.key===S?u(y,b,x,k):null;case zi:return S=x._init,h(y,b,S(x._payload),k)}if(Ul(x)||bl(x))return S!==null?null:d(y,b,x,k,null);Xu(y,x)}return null}function p(y,b,x,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return y=y.get(x)||null,l(b,y,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Bu:return y=y.get(k.key===null?x:k.key)||null,c(b,y,k,S);case Bs:return y=y.get(k.key===null?x:k.key)||null,u(b,y,k,S);case zi:var w=k._init;return p(y,b,x,w(k._payload),S)}if(Ul(k)||bl(k))return y=y.get(x)||null,d(b,y,k,S,null);Xu(b,k)}return null}function g(y,b,x,k){for(var S=null,w=null,_=b,N=b=0,C=null;_!==null&&N<x.length;N++){_.index>N?(C=_,_=null):C=_.sibling;var T=h(y,_,x[N],k);if(T===null){_===null&&(_=C);break}e&&_&&T.alternate===null&&t(y,_),b=a(T,b,N),w===null?S=T:w.sibling=T,w=T,_=C}if(N===x.length)return n(y,_),bt&&Ca(y,N),S;if(_===null){for(;N<x.length;N++)_=f(y,x[N],k),_!==null&&(b=a(_,b,N),w===null?S=_:w.sibling=_,w=_);return bt&&Ca(y,N),S}for(_=r(y,_);N<x.length;N++)C=p(_,y,N,x[N],k),C!==null&&(e&&C.alternate!==null&&_.delete(C.key===null?N:C.key),b=a(C,b,N),w===null?S=C:w.sibling=C,w=C);return e&&_.forEach(function(I){return t(y,I)}),bt&&Ca(y,N),S}function m(y,b,x,k){var S=bl(x);if(typeof S!="function")throw Error(ie(150));if(x=S.call(x),x==null)throw Error(ie(151));for(var w=S=null,_=b,N=b=0,C=null,T=x.next();_!==null&&!T.done;N++,T=x.next()){_.index>N?(C=_,_=null):C=_.sibling;var I=h(y,_,T.value,k);if(I===null){_===null&&(_=C);break}e&&_&&I.alternate===null&&t(y,_),b=a(I,b,N),w===null?S=I:w.sibling=I,w=I,_=C}if(T.done)return n(y,_),bt&&Ca(y,N),S;if(_===null){for(;!T.done;N++,T=x.next())T=f(y,T.value,k),T!==null&&(b=a(T,b,N),w===null?S=T:w.sibling=T,w=T);return bt&&Ca(y,N),S}for(_=r(y,_);!T.done;N++,T=x.next())T=p(_,y,N,T.value,k),T!==null&&(e&&T.alternate!==null&&_.delete(T.key===null?N:T.key),b=a(T,b,N),w===null?S=T:w.sibling=T,w=T);return e&&_.forEach(function(M){return t(y,M)}),bt&&Ca(y,N),S}function v(y,b,x,k){if(typeof x=="object"&&x!==null&&x.type===zs&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Bu:e:{for(var S=x.key,w=b;w!==null;){if(w.key===S){if(S=x.type,S===zs){if(w.tag===7){n(y,w.sibling),b=i(w,x.props.children),b.return=y,y=b;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===zi&&Iw(S)===w.type){n(y,w.sibling),b=i(w,x.props),b.ref=El(y,w,x),b.return=y,y=b;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===zs?(b=Va(x.props.children,y.mode,k,x.key),b.return=y,y=b):(k=Fd(x.type,x.key,x.props,null,y.mode,k),k.ref=El(y,b,x),k.return=y,y=k)}return o(y);case Bs:e:{for(w=x.key;b!==null;){if(b.key===w)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=i(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=bm(x,y.mode,k),b.return=y,y=b}return o(y);case zi:return w=x._init,v(y,b,w(x._payload),k)}if(Ul(x))return g(y,b,x,k);if(bl(x))return m(y,b,x,k);Xu(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=i(b,x),b.return=y,y=b):(n(y,b),b=vm(x,y.mode,k),b.return=y,y=b),o(y)):n(y,b)}return v}var go=gA(!0),yA=gA(!1),af=pa(null),sf=null,Vs=null,Ob=null;function Pb(){Ob=Vs=sf=null}function Mb(e){var t=af.current;yt(af),e._currentValue=t}function ry(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 so(e,t){sf=e,Ob=Vs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Rn=!0),e.firstContext=null)}function ur(e){var t=e._currentValue;if(Ob!==e)if(e={context:e,memoizedValue:t,next:null},Vs===null){if(sf===null)throw Error(ie(308));Vs=e,sf.dependencies={lanes:0,firstContext:e}}else Vs=Vs.next=e;return t}var za=null;function Rb(e){za===null?za=[e]:za.push(e)}function vA(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Rb(t)):(n.next=i.next,i.next=n),t.interleaved=n,bi(e,r)}function bi(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 Fi=!1;function Ib(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bA(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 hi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ge&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,bi(e,n)}return i=r.interleaved,i===null?(t.next=t,Rb(r)):(t.next=i.next,i.next=t),r.interleaved=t,bi(e,n)}function Id(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,xb(e,n)}}function $w(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function of(e,t,n,r){var i=e.updateQueue;Fi=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=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(a!==null){var f=i.baseState;o=0,d=u=c=null,l=a;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:Fi=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.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=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);is|=o,e.lanes=o,e.memoizedState=f}}function Lw(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ie(191,i));i.call(r)}}}var vu={},Kr=pa(vu),xc=pa(vu),wc=pa(vu);function Fa(e){if(e===vu)throw Error(ie(174));return e}function $b(e,t){switch(ut(wc,t),ut(xc,e),ut(Kr,vu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Lg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Lg(t,e)}yt(Kr),ut(Kr,t)}function yo(){yt(Kr),yt(xc),yt(wc)}function xA(e){Fa(wc.current);var t=Fa(Kr.current),n=Lg(t,e.type);t!==n&&(ut(xc,e),ut(Kr,n))}function Lb(e){xc.current===e&&(yt(Kr),yt(xc))}var St=pa(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 Db(){for(var e=0;e<fm.length;e++)fm[e]._workInProgressVersionPrimary=null;fm.length=0}var $d=Ei.ReactCurrentDispatcher,hm=Ei.ReactCurrentBatchConfig,rs=0,kt=null,zt=null,Vt=null,cf=!1,Zl=!1,Sc=0,a$=0;function ln(){throw Error(ie(321))}function Bb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pr(e[n],t[n]))return!1;return!0}function zb(e,t,n,r,i,a){if(rs=a,kt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$d.current=e===null||e.memoizedState===null?c$:u$,e=n(r,i),Zl){a=0;do{if(Zl=!1,Sc=0,25<=a)throw Error(ie(301));a+=1,Vt=zt=null,t.updateQueue=null,$d.current=d$,e=n(r,i)}while(Zl)}if($d.current=uf,t=zt!==null&&zt.next!==null,rs=0,Vt=zt=kt=null,cf=!1,t)throw Error(ie(300));return e}function Fb(){var e=Sc!==0;return Sc=0,e}function zr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?kt.memoizedState=Vt=e:Vt=Vt.next=e,Vt}function dr(){if(zt===null){var e=kt.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var t=Vt===null?kt.memoizedState:Vt.next;if(t!==null)Vt=t,zt=e;else{if(e===null)throw Error(ie(310));zt=e,e={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},Vt===null?kt.memoizedState=Vt=e:Vt=Vt.next=e}return Vt}function kc(e,t){return typeof t=="function"?t(e):t}function pm(e){var t=dr(),n=t.queue;if(n===null)throw Error(ie(311));n.lastRenderedReducer=e;var r=zt,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((rs&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,kt.lanes|=d,is|=d}u=u.next}while(u!==null&&u!==a);c===null?o=r:c.next=l,Pr(r,t.memoizedState)||(Rn=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,kt.lanes|=a,is|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function mm(e){var t=dr(),n=t.queue;if(n===null)throw Error(ie(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Pr(a,t.memoizedState)||(Rn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function wA(){}function SA(e,t){var n=kt,r=dr(),i=t(),a=!Pr(r.memoizedState,i);if(a&&(r.memoizedState=i,Rn=!0),r=r.queue,Ub(_A.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Vt!==null&&Vt.memoizedState.tag&1){if(n.flags|=2048,Ec(9,EA.bind(null,n,r,i,t),void 0,null),Xt===null)throw Error(ie(349));rs&30||kA(n,t,i)}return i}function kA(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=kt.updateQueue,t===null?(t={lastEffect:null,stores:null},kt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function EA(e,t,n,r){t.value=n,t.getSnapshot=r,NA(t)&&jA(e)}function _A(e,t,n){return n(function(){NA(t)&&jA(e)})}function NA(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pr(e,n)}catch{return!0}}function jA(e){var t=bi(e,1);t!==null&&Ar(t,e,1,-1)}function Dw(e){var t=zr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kc,lastRenderedState:e},t.queue=e,e=e.dispatch=l$.bind(null,kt,e),[t.memoizedState,e]}function Ec(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=kt.updateQueue,t===null?(t={lastEffect:null,stores:null},kt.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 AA(){return dr().memoizedState}function Ld(e,t,n,r){var i=zr();kt.flags|=e,i.memoizedState=Ec(1|t,n,void 0,r===void 0?null:r)}function Rh(e,t,n,r){var i=dr();r=r===void 0?null:r;var a=void 0;if(zt!==null){var o=zt.memoizedState;if(a=o.destroy,r!==null&&Bb(r,o.deps)){i.memoizedState=Ec(t,n,a,r);return}}kt.flags|=e,i.memoizedState=Ec(1|t,n,a,r)}function Bw(e,t){return Ld(8390656,8,e,t)}function Ub(e,t){return Rh(2048,8,e,t)}function TA(e,t){return Rh(4,2,e,t)}function CA(e,t){return Rh(4,4,e,t)}function OA(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 PA(e,t,n){return n=n!=null?n.concat([e]):null,Rh(4,4,OA.bind(null,t,e),n)}function Wb(){}function MA(e,t){var n=dr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function RA(e,t){var n=dr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bb(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function IA(e,t,n){return rs&21?(Pr(n,t)||(n=zj(),kt.lanes|=n,is|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Rn=!0),e.memoizedState=n)}function s$(e,t){var n=et;et=n!==0&&4>n?n:4,e(!0);var r=hm.transition;hm.transition={};try{e(!1),t()}finally{et=n,hm.transition=r}}function $A(){return dr().memoizedState}function o$(e,t,n){var r=aa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},LA(e))DA(t,n);else if(n=vA(e,t,n,r),n!==null){var i=_n();Ar(n,e,r,i),BA(n,t,r)}}function l$(e,t,n){var r=aa(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(LA(e))DA(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,Pr(l,o)){var c=t.interleaved;c===null?(i.next=i,Rb(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=vA(e,t,i,r),n!==null&&(i=_n(),Ar(n,e,r,i),BA(n,t,r))}}function LA(e){var t=e.alternate;return e===kt||t!==null&&t===kt}function DA(e,t){Zl=cf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function BA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xb(e,n)}}var uf={readContext:ur,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useInsertionEffect:ln,useLayoutEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useMutableSource:ln,useSyncExternalStore:ln,useId:ln,unstable_isNewReconciler:!1},c$={readContext:ur,useCallback:function(e,t){return zr().memoizedState=[e,t===void 0?null:t],e},useContext:ur,useEffect:Bw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ld(4194308,4,OA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ld(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ld(4,2,e,t)},useMemo:function(e,t){var n=zr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=zr();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=o$.bind(null,kt,e),[r.memoizedState,e]},useRef:function(e){var t=zr();return e={current:e},t.memoizedState=e},useState:Dw,useDebugValue:Wb,useDeferredValue:function(e){return zr().memoizedState=e},useTransition:function(){var e=Dw(!1),t=e[0];return e=s$.bind(null,e[1]),zr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=kt,i=zr();if(bt){if(n===void 0)throw Error(ie(407));n=n()}else{if(n=t(),Xt===null)throw Error(ie(349));rs&30||kA(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Bw(_A.bind(null,r,a,e),[e]),r.flags|=2048,Ec(9,EA.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=zr(),t=Xt.identifierPrefix;if(bt){var n=ci,r=li;n=(r&~(1<<32-jr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Sc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=a$++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},u$={readContext:ur,useCallback:MA,useContext:ur,useEffect:Ub,useImperativeHandle:PA,useInsertionEffect:TA,useLayoutEffect:CA,useMemo:RA,useReducer:pm,useRef:AA,useState:function(){return pm(kc)},useDebugValue:Wb,useDeferredValue:function(e){var t=dr();return IA(t,zt.memoizedState,e)},useTransition:function(){var e=pm(kc)[0],t=dr().memoizedState;return[e,t]},useMutableSource:wA,useSyncExternalStore:SA,useId:$A,unstable_isNewReconciler:!1},d$={readContext:ur,useCallback:MA,useContext:ur,useEffect:Ub,useImperativeHandle:PA,useInsertionEffect:TA,useLayoutEffect:CA,useMemo:RA,useReducer:mm,useRef:AA,useState:function(){return mm(kc)},useDebugValue:Wb,useDeferredValue:function(e){var t=dr();return zt===null?t.memoizedState=e:IA(t,zt.memoizedState,e)},useTransition:function(){var e=mm(kc)[0],t=dr().memoizedState;return[e,t]},useMutableSource:wA,useSyncExternalStore:SA,useId:$A,unstable_isNewReconciler:!1};function wr(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 iy(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 Ih={isMounted:function(e){return(e=e._reactInternals)?hs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_n(),i=aa(e),a=hi(r,i);a.payload=t,n!=null&&(a.callback=n),t=ra(e,a,i),t!==null&&(Ar(t,e,i,r),Id(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_n(),i=aa(e),a=hi(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ra(e,a,i),t!==null&&(Ar(t,e,i,r),Id(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_n(),r=aa(e),i=hi(n,r);i.tag=2,t!=null&&(i.callback=t),t=ra(e,i,r),t!==null&&(Ar(t,e,r,n),Id(t,e,r))}};function zw(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!gc(n,r)||!gc(i,a):!0}function zA(e,t,n){var r=!1,i=da,a=t.contextType;return typeof a=="object"&&a!==null?a=ur(a):(i=Ln(t)?ts:vn.current,r=t.contextTypes,a=(r=r!=null)?po(e,i):da),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ih,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Fw(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&&Ih.enqueueReplaceState(t,t.state,null)}function ay(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ib(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=ur(a):(a=Ln(t)?ts:vn.current,i.context=po(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(iy(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Ih.enqueueReplaceState(i,i.state,null),of(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function vo(e,t){try{var n="",r=t;do n+=B2(r),r=r.return;while(r);var i=n}catch(a){i=`
39
+ Error generating stack: `+a.message+`
40
+ `+a.stack}return{value:e,source:t,stack:i,digest:null}}function gm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function sy(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var f$=typeof WeakMap=="function"?WeakMap:Map;function FA(e,t,n){n=hi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ff||(ff=!0,gy=r),sy(e,t)},n}function UA(e,t,n){n=hi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){sy(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){sy(e,t),typeof r!="function"&&(ia===null?ia=new Set([this]):ia.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Uw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new f$;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=N$.bind(null,e,t,n),t.then(e,e))}function Ww(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 Hw(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=hi(-1,1),t.tag=2,ra(n,t,1))),n.lanes|=1),e)}var h$=Ei.ReactCurrentOwner,Rn=!1;function Sn(e,t,n,r){t.child=e===null?yA(t,null,n,r):go(t,e.child,n,r)}function Gw(e,t,n,r,i){n=n.render;var a=t.ref;return so(t,i),r=zb(e,t,n,r,a,i),n=Fb(),e!==null&&!Rn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,xi(e,t,i)):(bt&&n&&Ab(t),t.flags|=1,Sn(e,t,r,i),t.child)}function qw(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!Zb(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,WA(e,t,a,r,i)):(e=Fd(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:gc,n(o,r)&&e.ref===t.ref)return xi(e,t,i)}return t.flags|=1,e=sa(a,r),e.ref=t.ref,e.return=t,t.child=e}function WA(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(gc(a,r)&&e.ref===t.ref)if(Rn=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Rn=!0);else return t.lanes=e.lanes,xi(e,t,i)}return oy(e,t,n,r,i)}function HA(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(Xs,Hn),Hn|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(Xs,Hn),Hn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,ut(Xs,Hn),Hn|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,ut(Xs,Hn),Hn|=r;return Sn(e,t,i,n),t.child}function GA(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function oy(e,t,n,r,i){var a=Ln(n)?ts:vn.current;return a=po(t,a),so(t,i),n=zb(e,t,n,r,a,i),r=Fb(),e!==null&&!Rn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,xi(e,t,i)):(bt&&r&&Ab(t),t.flags|=1,Sn(e,t,n,i),t.child)}function Kw(e,t,n,r,i){if(Ln(n)){var a=!0;tf(t)}else a=!1;if(so(t,i),t.stateNode===null)Dd(e,t),zA(t,n,r),ay(t,n,r,i),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=ur(u):(u=Ln(n)?ts:vn.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)&&Fw(t,o,r,u),Fi=!1;var h=t.memoizedState;o.state=h,of(t,r,o,i),c=t.memoizedState,l!==r||h!==c||$n.current||Fi?(typeof d=="function"&&(iy(t,n,d,r),c=t.memoizedState),(l=Fi||zw(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,bA(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:wr(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=ur(c):(c=Ln(n)?ts:vn.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)&&Fw(t,o,r,c),Fi=!1,h=t.memoizedState,o.state=h,of(t,r,o,i);var g=t.memoizedState;l!==f||h!==g||$n.current||Fi?(typeof p=="function"&&(iy(t,n,p,r),g=t.memoizedState),(u=Fi||zw(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 ly(e,t,n,r,a,i)}function ly(e,t,n,r,i,a){GA(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Pw(t,n,!1),xi(e,t,a);r=t.stateNode,h$.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=go(t,e.child,null,a),t.child=go(t,null,l,a)):Sn(e,t,l,a),t.memoizedState=r.state,i&&Pw(t,n,!0),t.child}function qA(e){var t=e.stateNode;t.pendingContext?Ow(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ow(e,t.context,!1),$b(e,t.containerInfo)}function Vw(e,t,n,r,i){return mo(),Cb(i),t.flags|=256,Sn(e,t,n,r),t.child}var cy={dehydrated:null,treeContext:null,retryLane:0};function uy(e){return{baseLanes:e,cachePool:null,transitions:null}}function KA(e,t,n){var r=t.pendingProps,i=St.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ut(St,i&1),e===null)return ny(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,a?(r=t.mode,a=t.child,o={mode:"hidden",children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Dh(o,r,0,null),e=Va(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=uy(n),t.memoizedState=cy,e):Hb(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return p$(e,t,o,r,l,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=sa(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=sa(l,a):(a=Va(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?uy(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=cy,r}return a=e.child,e=a.sibling,r=sa(a,{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 Hb(e,t){return t=Dh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zu(e,t,n,r){return r!==null&&Cb(r),go(t,e.child,null,n),e=Hb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function p$(e,t,n,r,i,a,o){if(n)return t.flags&256?(t.flags&=-257,r=gm(Error(ie(422))),Zu(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Dh({mode:"visible",children:r.children},i,0,null),a=Va(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&go(t,e.child,null,o),t.child.memoizedState=uy(o),t.memoizedState=cy,a);if(!(t.mode&1))return Zu(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(ie(419)),r=gm(a,r,void 0),Zu(e,t,o,r)}if(l=(o&e.childLanes)!==0,Rn||l){if(r=Xt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,bi(e,i),Ar(r,e,i,-1))}return Xb(),r=gm(Error(ie(421))),Zu(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=j$.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Kn=na(i.nextSibling),Vn=t,bt=!0,Er=null,e!==null&&(rr[ir++]=li,rr[ir++]=ci,rr[ir++]=ns,li=e.id,ci=e.overflow,ns=t),t=Hb(t,r.children),t.flags|=4096,t)}function Yw(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ry(e.return,t,n)}function ym(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function VA(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Sn(e,t,r.children,n),r=St.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&&Yw(e,n,t);else if(e.tag===19)Yw(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(ut(St,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&lf(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ym(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&lf(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ym(t,!0,n,null,a);break;case"together":ym(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Dd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function xi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),is|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ie(153));if(t.child!==null){for(e=t.child,n=sa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=sa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function m$(e,t,n){switch(t.tag){case 3:qA(t),mo();break;case 5:xA(t);break;case 1:Ln(t.type)&&tf(t);break;case 4:$b(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ut(af,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ut(St,St.current&1),t.flags|=128,null):n&t.child.childLanes?KA(e,t,n):(ut(St,St.current&1),e=xi(e,t,n),e!==null?e.sibling:null);ut(St,St.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return VA(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ut(St,St.current),r)break;return null;case 22:case 23:return t.lanes=0,HA(e,t,n)}return xi(e,t,n)}var YA,dy,XA,ZA;YA=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}};dy=function(){};XA=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Fa(Kr.current);var a=null;switch(n){case"input":i=Mg(e,i),r=Mg(e,r),a=[];break;case"select":i=_t({},i,{value:void 0}),r=_t({},r,{value:void 0}),a=[];break;case"textarea":i=$g(e,i),r=$g(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Jd)}Dg(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(cc.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(l=i!=null?i[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||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(cc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&pt("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};ZA=function(e,t,n,r){n!==r&&(t.flags|=4)};function _l(e,t){if(!bt)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 cn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function g$(e,t,n){var r=t.pendingProps;switch(Tb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(t),null;case 1:return Ln(t.type)&&ef(),cn(t),null;case 3:return r=t.stateNode,yo(),yt($n),yt(vn),Db(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Yu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Er!==null&&(by(Er),Er=null))),dy(e,t),cn(t),null;case 5:Lb(t);var i=Fa(wc.current);if(n=t.type,e!==null&&t.stateNode!=null)XA(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ie(166));return cn(t),null}if(e=Fa(Kr.current),Yu(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Ur]=t,r[bc]=a,e=(t.mode&1)!==0,n){case"dialog":pt("cancel",r),pt("close",r);break;case"iframe":case"object":case"embed":pt("load",r);break;case"video":case"audio":for(i=0;i<Hl.length;i++)pt(Hl[i],r);break;case"source":pt("error",r);break;case"img":case"image":case"link":pt("error",r),pt("load",r);break;case"details":pt("toggle",r);break;case"input":iw(r,a),pt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},pt("invalid",r);break;case"textarea":sw(r,a),pt("invalid",r)}Dg(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?r.textContent!==l&&(a.suppressHydrationWarning!==!0&&Vu(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Vu(r.textContent,l,e),i=["children",""+l]):cc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&pt("scroll",r)}switch(n){case"input":zu(r),aw(r,a,!0);break;case"textarea":zu(r),ow(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Jd)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=_j(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[Ur]=t,e[bc]=r,YA(e,t,!1,!1),t.stateNode=e;e:{switch(o=Bg(n,r),n){case"dialog":pt("cancel",e),pt("close",e),i=r;break;case"iframe":case"object":case"embed":pt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Hl.length;i++)pt(Hl[i],e);i=r;break;case"source":pt("error",e),i=r;break;case"img":case"image":case"link":pt("error",e),pt("load",e),i=r;break;case"details":pt("toggle",e),i=r;break;case"input":iw(e,r),i=Mg(e,r),pt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=_t({},r,{value:void 0}),pt("invalid",e);break;case"textarea":sw(e,r),i=$g(e,r),pt("invalid",e);break;default:i=r}Dg(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Aj(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Nj(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&uc(e,c):typeof c=="number"&&uc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(cc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&pt("scroll",e):c!=null&&pb(e,a,c,o))}switch(n){case"input":zu(e),aw(e,r,!1);break;case"textarea":zu(e),ow(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ua(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?no(e,!!r.multiple,a,!1):r.defaultValue!=null&&no(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Jd)}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 cn(t),null;case 6:if(e&&t.stateNode!=null)ZA(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ie(166));if(n=Fa(wc.current),Fa(Kr.current),Yu(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ur]=t,(a=r.nodeValue!==n)&&(e=Vn,e!==null))switch(e.tag){case 3:Vu(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vu(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ur]=t,t.stateNode=r}return cn(t),null;case 13:if(yt(St),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(bt&&Kn!==null&&t.mode&1&&!(t.flags&128))mA(),mo(),t.flags|=98560,a=!1;else if(a=Yu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(ie(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ie(317));a[Ur]=t}else mo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;cn(t),a=!1}else Er!==null&&(by(Er),Er=null),a=!0;if(!a)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||St.current&1?Ft===0&&(Ft=3):Xb())),t.updateQueue!==null&&(t.flags|=4),cn(t),null);case 4:return yo(),dy(e,t),e===null&&yc(t.stateNode.containerInfo),cn(t),null;case 10:return Mb(t.type._context),cn(t),null;case 17:return Ln(t.type)&&ef(),cn(t),null;case 19:if(yt(St),a=t.memoizedState,a===null)return cn(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)_l(a,!1);else{if(Ft!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=lf(e),o!==null){for(t.flags|=128,_l(a,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ut(St,St.current&1|2),t.child}e=e.sibling}a.tail!==null&&Tt()>bo&&(t.flags|=128,r=!0,_l(a,!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),_l(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!bt)return cn(t),null}else 2*Tt()-a.renderingStartTime>bo&&n!==1073741824&&(t.flags|=128,r=!0,_l(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Tt(),t.sibling=null,n=St.current,ut(St,r?n&1|2:n&1),t):(cn(t),null);case 22:case 23:return Yb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Hn&1073741824&&(cn(t),t.subtreeFlags&6&&(t.flags|=8192)):cn(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function y$(e,t){switch(Tb(t),t.tag){case 1:return Ln(t.type)&&ef(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yo(),yt($n),yt(vn),Db(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lb(t),null;case 13:if(yt(St),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));mo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return yt(St),null;case 4:return yo(),null;case 10:return Mb(t.type._context),null;case 22:case 23:return Yb(),null;case 24:return null;default:return null}}var Qu=!1,pn=!1,v$=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Ys(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){jt(e,t,r)}else n.current=null}function fy(e,t,n){try{n()}catch(r){jt(e,t,r)}}var Xw=!1;function b$(e,t){if(Yg=Xd,e=nA(),jb(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 i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.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||i!==0&&f.nodeType!==3||(l=o+i),f!==a||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===i&&(l=o),h===a&&++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(Xg={focusedElem:e,selectionRange:n},Xd=!1,ge=t;ge!==null;)if(t=ge,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ge=e;else for(;ge!==null;){t=ge;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,v=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:wr(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(k){jt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,ge=e;break}ge=t.return}return g=Xw,Xw=!1,g}function Ql(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&fy(t,n,a)}i=i.next}while(i!==r)}}function $h(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 hy(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 QA(e){var t=e.alternate;t!==null&&(e.alternate=null,QA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ur],delete t[bc],delete t[Jg],delete t[t$],delete t[n$])),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 JA(e){return e.tag===5||e.tag===3||e.tag===4}function Zw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||JA(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 py(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=Jd));else if(r!==4&&(e=e.child,e!==null))for(py(e,t,n),e=e.sibling;e!==null;)py(e,t,n),e=e.sibling}function my(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(my(e,t,n),e=e.sibling;e!==null;)my(e,t,n),e=e.sibling}var nn=null,Sr=!1;function $i(e,t,n){for(n=n.child;n!==null;)eT(e,t,n),n=n.sibling}function eT(e,t,n){if(qr&&typeof qr.onCommitFiberUnmount=="function")try{qr.onCommitFiberUnmount(Ah,n)}catch{}switch(n.tag){case 5:pn||Ys(n,t);case 6:var r=nn,i=Sr;nn=null,$i(e,t,n),nn=r,Sr=i,nn!==null&&(Sr?(e=nn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):nn.removeChild(n.stateNode));break;case 18:nn!==null&&(Sr?(e=nn,n=n.stateNode,e.nodeType===8?um(e.parentNode,n):e.nodeType===1&&um(e,n),pc(e)):um(nn,n.stateNode));break;case 4:r=nn,i=Sr,nn=n.stateNode.containerInfo,Sr=!0,$i(e,t,n),nn=r,Sr=i;break;case 0:case 11:case 14:case 15:if(!pn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&fy(n,t,o),i=i.next}while(i!==r)}$i(e,t,n);break;case 1:if(!pn&&(Ys(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){jt(n,t,l)}$i(e,t,n);break;case 21:$i(e,t,n);break;case 22:n.mode&1?(pn=(r=pn)||n.memoizedState!==null,$i(e,t,n),pn=r):$i(e,t,n);break;default:$i(e,t,n)}}function Qw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new v$),t.forEach(function(r){var i=A$.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function br(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:nn=l.stateNode,Sr=!1;break e;case 3:nn=l.stateNode.containerInfo,Sr=!0;break e;case 4:nn=l.stateNode.containerInfo,Sr=!0;break e}l=l.return}if(nn===null)throw Error(ie(160));eT(a,o,i),nn=null,Sr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){jt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)tT(t,e),t=t.sibling}function tT(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(br(t,e),Lr(e),r&4){try{Ql(3,e,e.return),$h(3,e)}catch(m){jt(e,e.return,m)}try{Ql(5,e,e.return)}catch(m){jt(e,e.return,m)}}break;case 1:br(t,e),Lr(e),r&512&&n!==null&&Ys(n,n.return);break;case 5:if(br(t,e),Lr(e),r&512&&n!==null&&Ys(n,n.return),e.flags&32){var i=e.stateNode;try{uc(i,"")}catch(m){jt(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&kj(i,a),Bg(l,o);var u=Bg(l,a);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?Aj(i,f):d==="dangerouslySetInnerHTML"?Nj(i,f):d==="children"?uc(i,f):pb(i,d,f,u)}switch(l){case"input":Rg(i,a);break;case"textarea":Ej(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?no(i,!!a.multiple,p,!1):h!==!!a.multiple&&(a.defaultValue!=null?no(i,!!a.multiple,a.defaultValue,!0):no(i,!!a.multiple,a.multiple?[]:"",!1))}i[bc]=a}catch(m){jt(e,e.return,m)}}break;case 6:if(br(t,e),Lr(e),r&4){if(e.stateNode===null)throw Error(ie(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){jt(e,e.return,m)}}break;case 3:if(br(t,e),Lr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{pc(t.containerInfo)}catch(m){jt(e,e.return,m)}break;case 4:br(t,e),Lr(e);break;case 13:br(t,e),Lr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Kb=Tt())),r&4&&Qw(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(pn=(u=pn)||d,br(t,e),pn=u):br(t,e),Lr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ge=e,d=e.child;d!==null;){for(f=ge=d;ge!==null;){switch(h=ge,p=h.child,h.tag){case 0:case 11:case 14:case 15:Ql(4,h,h.return);break;case 1:Ys(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){jt(r,n,m)}}break;case 5:Ys(h,h.return);break;case 22:if(h.memoizedState!==null){e1(f);continue}}p!==null?(p.return=h,ge=p):e1(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=jj("display",o))}catch(m){jt(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){jt(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:br(t,e),Lr(e),r&4&&Qw(e);break;case 21:break;default:br(t,e),Lr(e)}}function Lr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(JA(n)){var r=n;break e}n=n.return}throw Error(ie(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(uc(i,""),r.flags&=-33);var a=Zw(e);my(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Zw(e);py(e,l,o);break;default:throw Error(ie(161))}}catch(c){jt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function x$(e,t,n){ge=e,nT(e)}function nT(e,t,n){for(var r=(e.mode&1)!==0;ge!==null;){var i=ge,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Qu;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||pn;l=Qu;var u=pn;if(Qu=o,(pn=c)&&!u)for(ge=i;ge!==null;)o=ge,c=o.child,o.tag===22&&o.memoizedState!==null?t1(i):c!==null?(c.return=o,ge=c):t1(i);for(;a!==null;)ge=a,nT(a),a=a.sibling;ge=i,Qu=l,pn=u}Jw(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,ge=a):Jw(e)}}function Jw(e){for(;ge!==null;){var t=ge;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pn||$h(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!pn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:wr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Lw(t,a,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}Lw(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&&pc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ie(163))}pn||t.flags&512&&hy(t)}catch(h){jt(t,t.return,h)}}if(t===e){ge=null;break}if(n=t.sibling,n!==null){n.return=t.return,ge=n;break}ge=t.return}}function e1(e){for(;ge!==null;){var t=ge;if(t===e){ge=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ge=n;break}ge=t.return}}function t1(e){for(;ge!==null;){var t=ge;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{$h(4,t)}catch(c){jt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){jt(t,i,c)}}var a=t.return;try{hy(t)}catch(c){jt(t,a,c)}break;case 5:var o=t.return;try{hy(t)}catch(c){jt(t,o,c)}}}catch(c){jt(t,t.return,c)}if(t===e){ge=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ge=l;break}ge=t.return}}var w$=Math.ceil,df=Ei.ReactCurrentDispatcher,Gb=Ei.ReactCurrentOwner,lr=Ei.ReactCurrentBatchConfig,Ge=0,Xt=null,Rt=null,an=0,Hn=0,Xs=pa(0),Ft=0,_c=null,is=0,Lh=0,qb=0,Jl=null,Mn=null,Kb=0,bo=1/0,ai=null,ff=!1,gy=null,ia=null,Ju=!1,Yi=null,hf=0,ec=0,yy=null,Bd=-1,zd=0;function _n(){return Ge&6?Tt():Bd!==-1?Bd:Bd=Tt()}function aa(e){return e.mode&1?Ge&2&&an!==0?an&-an:i$.transition!==null?(zd===0&&(zd=zj()),zd):(e=et,e!==0||(e=window.event,e=e===void 0?16:Kj(e.type)),e):1}function Ar(e,t,n,r){if(50<ec)throw ec=0,yy=null,Error(ie(185));mu(e,n,r),(!(Ge&2)||e!==Xt)&&(e===Xt&&(!(Ge&2)&&(Lh|=n),Ft===4&&Hi(e,an)),Dn(e,r),n===1&&Ge===0&&!(t.mode&1)&&(bo=Tt()+500,Mh&&ma()))}function Dn(e,t){var n=e.callbackNode;iI(e,t);var r=Yd(e,e===Xt?an:0);if(r===0)n!==null&&uw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&uw(n),t===1)e.tag===0?r$(n1.bind(null,e)):fA(n1.bind(null,e)),JI(function(){!(Ge&6)&&ma()}),n=null;else{switch(Fj(r)){case 1:n=bb;break;case 4:n=Dj;break;case 16:n=Vd;break;case 536870912:n=Bj;break;default:n=Vd}n=uT(n,rT.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function rT(e,t){if(Bd=-1,zd=0,Ge&6)throw Error(ie(327));var n=e.callbackNode;if(oo()&&e.callbackNode!==n)return null;var r=Yd(e,e===Xt?an:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=pf(e,r);else{t=r;var i=Ge;Ge|=2;var a=aT();(Xt!==e||an!==t)&&(ai=null,bo=Tt()+500,Ka(e,t));do try{E$();break}catch(l){iT(e,l)}while(!0);Pb(),df.current=a,Ge=i,Rt!==null?t=0:(Xt=null,an=0,t=Ft)}if(t!==0){if(t===2&&(i=Hg(e),i!==0&&(r=i,t=vy(e,i))),t===1)throw n=_c,Ka(e,0),Hi(e,r),Dn(e,Tt()),n;if(t===6)Hi(e,r);else{if(i=e.current.alternate,!(r&30)&&!S$(i)&&(t=pf(e,r),t===2&&(a=Hg(e),a!==0&&(r=a,t=vy(e,a))),t===1))throw n=_c,Ka(e,0),Hi(e,r),Dn(e,Tt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ie(345));case 2:Oa(e,Mn,ai);break;case 3:if(Hi(e,r),(r&130023424)===r&&(t=Kb+500-Tt(),10<t)){if(Yd(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){_n(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Qg(Oa.bind(null,e,Mn,ai),t);break}Oa(e,Mn,ai);break;case 4:if(Hi(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-jr(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=Tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*w$(r/1960))-r,10<r){e.timeoutHandle=Qg(Oa.bind(null,e,Mn,ai),r);break}Oa(e,Mn,ai);break;case 5:Oa(e,Mn,ai);break;default:throw Error(ie(329))}}}return Dn(e,Tt()),e.callbackNode===n?rT.bind(null,e):null}function vy(e,t){var n=Jl;return e.current.memoizedState.isDehydrated&&(Ka(e,t).flags|=256),e=pf(e,t),e!==2&&(t=Mn,Mn=n,t!==null&&by(t)),e}function by(e){Mn===null?Mn=e:Mn.push.apply(Mn,e)}function S$(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 i=n[r],a=i.getSnapshot;i=i.value;try{if(!Pr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Hi(e,t){for(t&=~qb,t&=~Lh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-jr(t),r=1<<n;e[n]=-1,t&=~r}}function n1(e){if(Ge&6)throw Error(ie(327));oo();var t=Yd(e,0);if(!(t&1))return Dn(e,Tt()),null;var n=pf(e,t);if(e.tag!==0&&n===2){var r=Hg(e);r!==0&&(t=r,n=vy(e,r))}if(n===1)throw n=_c,Ka(e,0),Hi(e,t),Dn(e,Tt()),n;if(n===6)throw Error(ie(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Oa(e,Mn,ai),Dn(e,Tt()),null}function Vb(e,t){var n=Ge;Ge|=1;try{return e(t)}finally{Ge=n,Ge===0&&(bo=Tt()+500,Mh&&ma())}}function as(e){Yi!==null&&Yi.tag===0&&!(Ge&6)&&oo();var t=Ge;Ge|=1;var n=lr.transition,r=et;try{if(lr.transition=null,et=1,e)return e()}finally{et=r,lr.transition=n,Ge=t,!(Ge&6)&&ma()}}function Yb(){Hn=Xs.current,yt(Xs)}function Ka(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,QI(n)),Rt!==null)for(n=Rt.return;n!==null;){var r=n;switch(Tb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ef();break;case 3:yo(),yt($n),yt(vn),Db();break;case 5:Lb(r);break;case 4:yo();break;case 13:yt(St);break;case 19:yt(St);break;case 10:Mb(r.type._context);break;case 22:case 23:Yb()}n=n.return}if(Xt=e,Rt=e=sa(e.current,null),an=Hn=t,Ft=0,_c=null,qb=Lh=is=0,Mn=Jl=null,za!==null){for(t=0;t<za.length;t++)if(n=za[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}za=null}return e}function iT(e,t){do{var n=Rt;try{if(Pb(),$d.current=uf,cf){for(var r=kt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}cf=!1}if(rs=0,Vt=zt=kt=null,Zl=!1,Sc=0,Gb.current=null,n===null||n.return===null){Ft=1,_c=t,Rt=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=an,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=Ww(o);if(p!==null){p.flags&=-257,Hw(p,o,l,a,t),p.mode&1&&Uw(a,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)){Uw(a,u,t),Xb();break e}c=Error(ie(426))}}else if(bt&&l.mode&1){var v=Ww(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),Hw(v,o,l,a,t),Cb(vo(c,l));break e}}a=c=vo(c,l),Ft!==4&&(Ft=2),Jl===null?Jl=[a]:Jl.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=FA(a,c,t);$w(a,y);break e;case 1:l=c;var b=a.type,x=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ia===null||!ia.has(x)))){a.flags|=65536,t&=-t,a.lanes|=t;var k=UA(a,l,t);$w(a,k);break e}}a=a.return}while(a!==null)}oT(n)}catch(S){t=S,Rt===n&&n!==null&&(Rt=n=n.return);continue}break}while(!0)}function aT(){var e=df.current;return df.current=uf,e===null?uf:e}function Xb(){(Ft===0||Ft===3||Ft===2)&&(Ft=4),Xt===null||!(is&268435455)&&!(Lh&268435455)||Hi(Xt,an)}function pf(e,t){var n=Ge;Ge|=2;var r=aT();(Xt!==e||an!==t)&&(ai=null,Ka(e,t));do try{k$();break}catch(i){iT(e,i)}while(!0);if(Pb(),Ge=n,df.current=r,Rt!==null)throw Error(ie(261));return Xt=null,an=0,Ft}function k$(){for(;Rt!==null;)sT(Rt)}function E$(){for(;Rt!==null&&!Y2();)sT(Rt)}function sT(e){var t=cT(e.alternate,e,Hn);e.memoizedProps=e.pendingProps,t===null?oT(e):Rt=t,Gb.current=null}function oT(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=y$(n,t),n!==null){n.flags&=32767,Rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ft=6,Rt=null;return}}else if(n=g$(n,t,Hn),n!==null){Rt=n;return}if(t=t.sibling,t!==null){Rt=t;return}Rt=t=e}while(t!==null);Ft===0&&(Ft=5)}function Oa(e,t,n){var r=et,i=lr.transition;try{lr.transition=null,et=1,_$(e,t,n,r)}finally{lr.transition=i,et=r}return null}function _$(e,t,n,r){do oo();while(Yi!==null);if(Ge&6)throw Error(ie(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ie(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(aI(e,a),e===Xt&&(Rt=Xt=null,an=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ju||(Ju=!0,uT(Vd,function(){return oo(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=lr.transition,lr.transition=null;var o=et;et=1;var l=Ge;Ge|=4,Gb.current=null,b$(e,n),tT(n,e),GI(Xg),Xd=!!Yg,Xg=Yg=null,e.current=n,x$(n),X2(),Ge=l,et=o,lr.transition=a}else e.current=n;if(Ju&&(Ju=!1,Yi=e,hf=i),a=e.pendingLanes,a===0&&(ia=null),J2(n.stateNode),Dn(e,Tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(ff)throw ff=!1,e=gy,gy=null,e;return hf&1&&e.tag!==0&&oo(),a=e.pendingLanes,a&1?e===yy?ec++:(ec=0,yy=e):ec=0,ma(),null}function oo(){if(Yi!==null){var e=Fj(hf),t=lr.transition,n=et;try{if(lr.transition=null,et=16>e?16:e,Yi===null)var r=!1;else{if(e=Yi,Yi=null,hf=0,Ge&6)throw Error(ie(331));var i=Ge;for(Ge|=4,ge=e.current;ge!==null;){var a=ge,o=a.child;if(ge.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ge=u;ge!==null;){var d=ge;switch(d.tag){case 0:case 11:case 15:Ql(8,d,a)}var f=d.child;if(f!==null)f.return=d,ge=f;else for(;ge!==null;){d=ge;var h=d.sibling,p=d.return;if(QA(d),d===u){ge=null;break}if(h!==null){h.return=p,ge=h;break}ge=p}}}var g=a.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(m!==null)}}ge=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,ge=o;else e:for(;ge!==null;){if(a=ge,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ql(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,ge=y;break e}ge=a.return}}var b=e.current;for(ge=b;ge!==null;){o=ge;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,ge=x;else e:for(o=b;ge!==null;){if(l=ge,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:$h(9,l)}}catch(S){jt(l,l.return,S)}if(l===o){ge=null;break e}var k=l.sibling;if(k!==null){k.return=l.return,ge=k;break e}ge=l.return}}if(Ge=i,ma(),qr&&typeof qr.onPostCommitFiberRoot=="function")try{qr.onPostCommitFiberRoot(Ah,e)}catch{}r=!0}return r}finally{et=n,lr.transition=t}}return!1}function r1(e,t,n){t=vo(n,t),t=FA(e,t,1),e=ra(e,t,1),t=_n(),e!==null&&(mu(e,1,t),Dn(e,t))}function jt(e,t,n){if(e.tag===3)r1(e,e,n);else for(;t!==null;){if(t.tag===3){r1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ia===null||!ia.has(r))){e=vo(n,e),e=UA(t,e,1),t=ra(t,e,1),e=_n(),t!==null&&(mu(t,1,e),Dn(t,e));break}}t=t.return}}function N$(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_n(),e.pingedLanes|=e.suspendedLanes&n,Xt===e&&(an&n)===n&&(Ft===4||Ft===3&&(an&130023424)===an&&500>Tt()-Kb?Ka(e,0):qb|=n),Dn(e,t)}function lT(e,t){t===0&&(e.mode&1?(t=Wu,Wu<<=1,!(Wu&130023424)&&(Wu=4194304)):t=1);var n=_n();e=bi(e,t),e!==null&&(mu(e,t,n),Dn(e,n))}function j$(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),lT(e,n)}function A$(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ie(314))}r!==null&&r.delete(t),lT(e,n)}var cT;cT=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$n.current)Rn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Rn=!1,m$(e,t,n);Rn=!!(e.flags&131072)}else Rn=!1,bt&&t.flags&1048576&&hA(t,rf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dd(e,t),e=t.pendingProps;var i=po(t,vn.current);so(t,n),i=zb(null,t,r,e,i,n);var a=Fb();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ln(r)?(a=!0,tf(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ib(t),i.updater=Ih,t.stateNode=i,i._reactInternals=t,ay(t,r,e,n),t=ly(null,t,r,!0,a,n)):(t.tag=0,bt&&a&&Ab(t),Sn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Dd(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=C$(r),e=wr(r,e),i){case 0:t=oy(null,t,r,e,n);break e;case 1:t=Kw(null,t,r,e,n);break e;case 11:t=Gw(null,t,r,e,n);break e;case 14:t=qw(null,t,r,wr(r.type,e),n);break e}throw Error(ie(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:wr(r,i),oy(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:wr(r,i),Kw(e,t,r,i,n);case 3:e:{if(qA(t),e===null)throw Error(ie(387));r=t.pendingProps,a=t.memoizedState,i=a.element,bA(e,t),of(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=vo(Error(ie(423)),t),t=Vw(e,t,r,n,i);break e}else if(r!==i){i=vo(Error(ie(424)),t),t=Vw(e,t,r,n,i);break e}else for(Kn=na(t.stateNode.containerInfo.firstChild),Vn=t,bt=!0,Er=null,n=yA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(mo(),r===i){t=xi(e,t,n);break e}Sn(e,t,r,n)}t=t.child}return t;case 5:return xA(t),e===null&&ny(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Zg(r,i)?o=null:a!==null&&Zg(r,a)&&(t.flags|=32),GA(e,t),Sn(e,t,o,n),t.child;case 6:return e===null&&ny(t),null;case 13:return KA(e,t,n);case 4:return $b(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=go(t,null,r,n):Sn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:wr(r,i),Gw(e,t,r,i,n);case 7:return Sn(e,t,t.pendingProps,n),t.child;case 8:return Sn(e,t,t.pendingProps.children,n),t.child;case 12:return Sn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,ut(af,r._currentValue),r._currentValue=o,a!==null)if(Pr(a.value,o)){if(a.children===i.children&&!$n.current){t=xi(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=hi(-1,n&-n),c.tag=2;var u=a.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}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ry(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(ie(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),ry(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Sn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,so(t,n),i=ur(i),r=r(i),t.flags|=1,Sn(e,t,r,n),t.child;case 14:return r=t.type,i=wr(r,t.pendingProps),i=wr(r.type,i),qw(e,t,r,i,n);case 15:return WA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:wr(r,i),Dd(e,t),t.tag=1,Ln(r)?(e=!0,tf(t)):e=!1,so(t,n),zA(t,r,i),ay(t,r,i,n),ly(null,t,r,!0,e,n);case 19:return VA(e,t,n);case 22:return HA(e,t,n)}throw Error(ie(156,t.tag))};function uT(e,t){return Lj(e,t)}function T$(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 sr(e,t,n,r){return new T$(e,t,n,r)}function Zb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function C$(e){if(typeof e=="function")return Zb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gb)return 11;if(e===yb)return 14}return 2}function sa(e,t){var n=e.alternate;return n===null?(n=sr(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 Fd(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")Zb(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case zs:return Va(n.children,i,a,t);case mb:o=8,i|=8;break;case Tg:return e=sr(12,n,t,i|2),e.elementType=Tg,e.lanes=a,e;case Cg:return e=sr(13,n,t,i),e.elementType=Cg,e.lanes=a,e;case Og:return e=sr(19,n,t,i),e.elementType=Og,e.lanes=a,e;case xj:return Dh(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case vj:o=10;break e;case bj:o=9;break e;case gb:o=11;break e;case yb:o=14;break e;case zi:o=16,r=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=sr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Va(e,t,n,r){return e=sr(7,e,r,t),e.lanes=n,e}function Dh(e,t,n,r){return e=sr(22,e,r,t),e.elementType=xj,e.lanes=n,e.stateNode={isHidden:!1},e}function vm(e,t,n){return e=sr(6,e,null,t),e.lanes=n,e}function bm(e,t,n){return t=sr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function O$(e,t,n,r,i){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=Jp(0),this.expirationTimes=Jp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Qb(e,t,n,r,i,a,o,l,c){return e=new O$(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=sr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ib(a),e}function P$(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Bs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function dT(e){if(!e)return da;e=e._reactInternals;e:{if(hs(e)!==e||e.tag!==1)throw Error(ie(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ln(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ie(171))}if(e.tag===1){var n=e.type;if(Ln(n))return dA(e,n,t)}return t}function fT(e,t,n,r,i,a,o,l,c){return e=Qb(n,r,!0,e,i,a,o,l,c),e.context=dT(null),n=e.current,r=_n(),i=aa(n),a=hi(r,i),a.callback=t??null,ra(n,a,i),e.current.lanes=i,mu(e,i,r),Dn(e,r),e}function Bh(e,t,n,r){var i=t.current,a=_n(),o=aa(i);return n=dT(n),t.context===null?t.context=n:t.pendingContext=n,t=hi(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ra(i,t,o),e!==null&&(Ar(e,i,o,a),Id(e,i,o)),o}function mf(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 i1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jb(e,t){i1(e,t),(e=e.alternate)&&i1(e,t)}function M$(){return null}var hT=typeof reportError=="function"?reportError:function(e){console.error(e)};function ex(e){this._internalRoot=e}zh.prototype.render=ex.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ie(409));Bh(e,t,null,null)};zh.prototype.unmount=ex.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;as(function(){Bh(null,e,null,null)}),t[vi]=null}};function zh(e){this._internalRoot=e}zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wi.length&&t!==0&&t<Wi[n].priority;n++);Wi.splice(n,0,e),n===0&&qj(e)}};function tx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function a1(){}function R$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=mf(o);a.call(u)}}var o=fT(t,r,e,0,null,!1,!1,"",a1);return e._reactRootContainer=o,e[vi]=o.current,yc(e.nodeType===8?e.parentNode:e),as(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=mf(c);l.call(u)}}var c=Qb(e,0,!1,null,null,!1,!1,"",a1);return e._reactRootContainer=c,e[vi]=c.current,yc(e.nodeType===8?e.parentNode:e),as(function(){Bh(t,c,n,r)}),c}function Uh(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var c=mf(o);l.call(c)}}Bh(t,o,e,i)}else o=R$(n,t,e,i,r);return mf(o)}Uj=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Wl(t.pendingLanes);n!==0&&(xb(t,n|1),Dn(t,Tt()),!(Ge&6)&&(bo=Tt()+500,ma()))}break;case 13:as(function(){var r=bi(e,1);if(r!==null){var i=_n();Ar(r,e,1,i)}}),Jb(e,1)}};wb=function(e){if(e.tag===13){var t=bi(e,134217728);if(t!==null){var n=_n();Ar(t,e,134217728,n)}Jb(e,134217728)}};Wj=function(e){if(e.tag===13){var t=aa(e),n=bi(e,t);if(n!==null){var r=_n();Ar(n,e,t,r)}Jb(e,t)}};Hj=function(){return et};Gj=function(e,t){var n=et;try{return et=e,t()}finally{et=n}};Fg=function(e,t,n){switch(t){case"input":if(Rg(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 i=Ph(r);if(!i)throw Error(ie(90));Sj(r),Rg(r,i)}}}break;case"textarea":Ej(e,n);break;case"select":t=n.value,t!=null&&no(e,!!n.multiple,t,!1)}};Oj=Vb;Pj=as;var I$={usingClientEntryPoint:!1,Events:[yu,Hs,Ph,Tj,Cj,Vb]},Nl={findFiberByHostInstance:Ba,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$$={bundleType:Nl.bundleType,version:Nl.version,rendererPackageName:Nl.rendererPackageName,rendererConfig:Nl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ei.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ij(e),e===null?null:e.stateNode},findFiberByHostInstance:Nl.findFiberByHostInstance||M$,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 ed=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ed.isDisabled&&ed.supportsFiber)try{Ah=ed.inject($$),qr=ed}catch{}}Qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I$;Qn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tx(t))throw Error(ie(200));return P$(e,t,null,n)};Qn.createRoot=function(e,t){if(!tx(e))throw Error(ie(299));var n=!1,r="",i=hT;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Qb(e,1,!1,null,null,n,!1,r,i),e[vi]=t.current,yc(e.nodeType===8?e.parentNode:e),new ex(t)};Qn.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(ie(188)):(e=Object.keys(e).join(","),Error(ie(268,e)));return e=Ij(t),e=e===null?null:e.stateNode,e};Qn.flushSync=function(e){return as(e)};Qn.hydrate=function(e,t,n){if(!Fh(t))throw Error(ie(200));return Uh(null,e,t,!0,n)};Qn.hydrateRoot=function(e,t,n){if(!tx(e))throw Error(ie(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=hT;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=fT(t,null,e,1,n??null,i,!1,a,o),e[vi]=t.current,yc(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new zh(t)};Qn.render=function(e,t,n){if(!Fh(t))throw Error(ie(200));return Uh(null,e,t,!1,n)};Qn.unmountComponentAtNode=function(e){if(!Fh(e))throw Error(ie(40));return e._reactRootContainer?(as(function(){Uh(null,null,e,!1,function(){e._reactRootContainer=null,e[vi]=null})}),!0):!1};Qn.unstable_batchedUpdates=Vb;Qn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Fh(n))throw Error(ie(200));if(e==null||e._reactInternals===void 0)throw Error(ie(38));return Uh(e,t,n,!1,r)};Qn.version="18.3.1-next-f1338f8080-20240426";function pT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pT)}catch(e){console.error(e)}}pT(),pj.exports=Qn;var L$=pj.exports,mT,s1=L$;mT=s1.createRoot,s1.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 Nc(){return Nc=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},Nc.apply(null,arguments)}var Xi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Xi||(Xi={}));const o1="popstate";function D$(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:o,hash:l}=r.location;return xy("",{pathname:a,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:gf(i)}return z$(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function B$(){return Math.random().toString(36).substr(2,8)}function l1(e,t){return{usr:e.state,key:e.key,idx:t}}function xy(e,t,n,r){return n===void 0&&(n=null),Nc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ko(t):t,{state:n,key:t&&t.key||r||B$()})}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 Ko(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 z$(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=Xi.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Nc({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Xi.Pop;let v=d(),y=v==null?null:v-u;u=v,c&&c({action:l,location:m.location,delta:y})}function h(v,y){l=Xi.Push;let b=xy(m.location,v,y);u=d()+1;let x=l1(b,u),k=m.createHref(b);try{o.pushState(x,"",k)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(k)}a&&c&&c({action:l,location:m.location,delta:1})}function p(v,y){l=Xi.Replace;let b=xy(m.location,v,y);u=d();let x=l1(b,u),k=m.createHref(b);o.replaceState(x,"",k),a&&c&&c({action:l,location:m.location,delta:0})}function g(v){let y=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof v=="string"?v:gf(v);return b=b.replace(/ $/,"%20"),Et(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let m={get action(){return l},get location(){return e(i,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(o1,f),c=v,()=>{i.removeEventListener(o1,f),c=null}},createHref(v){return t(i,v)},createURL:g,encodeLocation(v){let y=g(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(v){return o.go(v)}};return m}var c1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(c1||(c1={}));function F$(e,t,n){return n===void 0&&(n="/"),U$(e,t,n)}function U$(e,t,n,r){let i=typeof t=="string"?Ko(t):t,a=xo(i.pathname||"/",n);if(a==null)return null;let o=gT(e);W$(o);let l=null,c=eL(a);for(let u=0;l==null&&u<o.length;++u)l=Q$(o[u],c);return l}function gT(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};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=oa([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Et(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),gT(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:X$(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of yT(a.path))i(a,o,c)}),t}function yT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=yT(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function W$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Z$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const H$=/^:[\w-]+$/,G$=3,q$=2,K$=1,V$=10,Y$=-2,u1=e=>e==="*";function X$(e,t){let n=e.split("/"),r=n.length;return n.some(u1)&&(r+=Y$),t&&(r+=q$),n.filter(i=>!u1(i)).reduce((i,a)=>i+(H$.test(a)?G$:a===""?K$:V$),r)}function Z$(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Q$(e,t,n){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=wy({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:oa([a,f.pathname]),pathnameBase:aL(oa([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=oa([a,f.pathnameBase]))}return o}function wy(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=J$(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=l[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=l[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function J$(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),nx(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function eL(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nx(!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 xo(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 tL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nL=e=>tL.test(e);function rL(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ko(e):e,a;if(n)if(nL(n))a=n;else{if(n.includes("//")){let o=n;n=vT(n),nx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=d1(n.substring(1),"/"):a=d1(n,t)}else a=t;return{pathname:a,search:sL(r),hash:oL(i)}}function d1(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function xm(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 iL(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function rx(e,t){let n=iL(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ix(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ko(e):(i=Nc({},e),Et(!i.pathname||!i.pathname.includes("?"),xm("?","pathname","search",i)),Et(!i.pathname||!i.pathname.includes("#"),xm("#","pathname","hash",i)),Et(!i.search||!i.search.includes("#"),xm("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.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;i.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=rL(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const vT=e=>e.replace(/\/\/+/g,"/"),oa=e=>vT(e.join("/")),aL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function lL(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const bT=["post","put","patch","delete"];new Set(bT);const cL=["get",...bT];new Set(cL);/**
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 jc(){return jc=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},jc.apply(null,arguments)}const Wh=E.createContext(null),xT=E.createContext(null),_i=E.createContext(null),Hh=E.createContext(null),ga=E.createContext({outlet:null,matches:[],isDataRoute:!1}),wT=E.createContext(null);function uL(e,t){let{relative:n}=t===void 0?{}:t;Vo()||Et(!1);let{basename:r,navigator:i}=E.useContext(_i),{hash:a,pathname:o,search:l}=Gh(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:oa([r,o])),i.createHref({pathname:c,search:l,hash:a})}function Vo(){return E.useContext(Hh)!=null}function Yo(){return Vo()||Et(!1),E.useContext(Hh).location}function ST(e){E.useContext(_i).static||E.useLayoutEffect(e)}function kT(){let{isDataRoute:e}=E.useContext(ga);return e?kL():dL()}function dL(){Vo()||Et(!1);let e=E.useContext(Wh),{basename:t,future:n,navigator:r}=E.useContext(_i),{matches:i}=E.useContext(ga),{pathname:a}=Yo(),o=JSON.stringify(rx(i,n.v7_relativeSplatPath)),l=E.useRef(!1);return ST(()=>{l.current=!0}),E.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=ix(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:oa([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}function Gh(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=E.useContext(_i),{matches:i}=E.useContext(ga),{pathname:a}=Yo(),o=JSON.stringify(rx(i,r.v7_relativeSplatPath));return E.useMemo(()=>ix(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function fL(e,t){return hL(e,t)}function hL(e,t,n,r){Vo()||Et(!1);let{navigator:i}=E.useContext(_i),{matches:a}=E.useContext(ga),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Yo(),d;if(t){var f;let v=typeof t=="string"?Ko(t):t;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||Et(!1),d=v}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let v=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=F$(e,{pathname:p}),m=vL(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:oa([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:oa([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,r);return t&&m?E.createElement(Hh.Provider,{value:{location:jc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Xi.Pop}},m):m}function pL(){let e=SL(),t=lL(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},t),n?E.createElement("pre",{style:i},n):null,null)}const mL=E.createElement(pL,null);class gL extends E.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?E.createElement(ga.Provider,{value:this.props.routeContext},E.createElement(wT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function yL(e){let{routeContext:t,match:n,children:r}=e,i=E.useContext(Wh);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(ga.Provider,{value:t},r)}function vL(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(i=n)==null?void 0:i.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,v=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||mL,c&&(u<0&&h===0?(EL("route-fallback"),g=!0,v=null):u===h&&(g=!0,v=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),b=()=>{let x;return p?x=m:g?x=v:f.route.Component?x=E.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,E.createElement(yL,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?E.createElement(gL,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var ET=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ET||{}),_T=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}(_T||{});function bL(e){let t=E.useContext(Wh);return t||Et(!1),t}function xL(e){let t=E.useContext(xT);return t||Et(!1),t}function wL(e){let t=E.useContext(ga);return t||Et(!1),t}function NT(e){let t=wL(),n=t.matches[t.matches.length-1];return n.route.id||Et(!1),n.route.id}function SL(){var e;let t=E.useContext(wT),n=xL(),r=NT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function kL(){let{router:e}=bL(ET.UseNavigateStable),t=NT(_T.UseNavigateStable),n=E.useRef(!1);return ST(()=>{n.current=!0}),E.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,jc({fromRouteId:t},a)))},[e,t])}const f1={};function EL(e,t,n){f1[e]||(f1[e]=!0)}function _L(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function h1(e){let{to:t,replace:n,state:r,relative:i}=e;Vo()||Et(!1);let{future:a,static:o}=E.useContext(_i),{matches:l}=E.useContext(ga),{pathname:c}=Yo(),u=kT(),d=ix(t,rx(l,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return E.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function at(e){Et(!1)}function NL(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Xi.Pop,navigator:a,static:o=!1,future:l}=e;Vo()&&Et(!1);let c=t.replace(/^\/*/,"/"),u=E.useMemo(()=>({basename:c,navigator:a,static:o,future:jc({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=Ko(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=E.useMemo(()=>{let v=xo(d,c);return v==null?null:{location:{pathname:v,search:f,hash:h,state:p,key:g},navigationType:i}},[c,d,f,h,p,g,i]);return m==null?null:E.createElement(_i.Provider,{value:u},E.createElement(Hh.Provider,{children:n,value:m}))}function jL(e){let{children:t,location:n}=e;return fL(Sy(t),n)}new Promise(()=>{});function Sy(e,t){t===void 0&&(t=[]);let n=[];return E.Children.forEach(e,(r,i)=>{if(!E.isValidElement(r))return;let a=[...t,i];if(r.type===E.Fragment){n.push.apply(n,Sy(r.props.children,a));return}r.type!==at&&Et(!1),!r.props.index||!r.props.children||Et(!1);let o={id:r.props.id||a.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=Sy(r.props.children,a)),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 yf(){return yf=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},yf.apply(null,arguments)}function jT(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 AL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function TL(e,t){return e.button===0&&(!t||t==="_self")&&!AL(e)}const CL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],OL=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],PL="6";try{window.__reactRouterVersion=PL}catch{}const ML=E.createContext({isTransitioning:!1}),RL="startTransition",p1=N2[RL];function IL(e){let{basename:t,children:n,future:r,window:i}=e,a=E.useRef();a.current==null&&(a.current=D$({window:i,v5Compat:!0}));let o=a.current,[l,c]=E.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=E.useCallback(f=>{u&&p1?p1(()=>c(f)):c(f)},[c,u]);return E.useLayoutEffect(()=>o.listen(d),[o,d]),E.useEffect(()=>_L(r),[r]),E.createElement(NL,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const $L=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ky=E.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=jT(t,CL),{basename:p}=E.useContext(_i),g,m=!1;if(typeof u=="string"&&LL.test(u)&&(g=u,$L))try{let x=new URL(window.location.href),k=u.startsWith("//")?new URL(x.protocol+u):new URL(u),S=xo(k.pathname,p);k.origin===x.origin&&S!=null?u=S+k.search+k.hash:m=!0}catch{}let v=uL(u,{relative:i}),y=zL(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(x){r&&r(x),x.defaultPrevented||y(x)}return E.createElement("a",yf({},h,{href:g||v,onClick:m||a?r:b,ref:n,target:c}))}),DL=E.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=jT(t,OL),h=Gh(c,{relative:f.relative}),p=Yo(),g=E.useContext(xT),{navigator:m,basename:v}=E.useContext(_i),y=g!=null&&FL(h)&&u===!0,b=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,x=p.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(x=x.toLowerCase(),k=k?k.toLowerCase():null,b=b.toLowerCase()),k&&v&&(k=xo(k,v)||k);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let w=x===b||!o&&x.startsWith(b)&&x.charAt(S)==="/",_=k!=null&&(k===b||!o&&k.startsWith(b)&&k.charAt(b.length)==="/"),N={isActive:w,isPending:_,isTransitioning:y},C=w?r:void 0,T;typeof a=="function"?T=a(N):T=[a,w?"active":null,_?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let I=typeof l=="function"?l(N):l;return E.createElement(ky,yf({},f,{"aria-current":C,className:T,ref:n,style:I,to:c,viewTransition:u}),typeof d=="function"?d(N):d)});var Ey;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ey||(Ey={}));var m1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(m1||(m1={}));function BL(e){let t=E.useContext(Wh);return t||Et(!1),t}function zL(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=kT(),u=Yo(),d=Gh(e,{relative:o});return E.useCallback(f=>{if(TL(f,n)){f.preventDefault();let h=r!==void 0?r:gf(u)===gf(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,a,o,l])}function FL(e,t){t===void 0&&(t={});let n=E.useContext(ML);n==null&&Et(!1);let{basename:r}=BL(Ey.useViewTransitionState),i=Gh(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=xo(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=xo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return wy(i.pathname,o)!=null||wy(i.pathname,a)!=null}async function si(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 Zs="buff-dashboard-admin-token";function AT(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{}return null}const _y=new Map;function UL(){const e=AT();if(e)try{const t=e.getItem(Zs);if(t)return t}catch{}return _y.get(Zs)??null}function WL(e){const t=AT();if(t)try{e?t.setItem(Zs,e):t.removeItem(Zs);return}catch{}e?_y.set(Zs,e):_y.delete(Zs)}function un(){return UL()}function wm(e){WL(e)}function Dr(){const e=un();return e?{Authorization:`Bearer ${e}`}:{}}class HL{constructor(t=""){$r(this,"sse",null);$r(this,"listeners",new Set);$r(this,"connectionListeners",new Set);$r(this,"dagListeners",new Set);$r(this,"typingListeners",new Set);$r(this,"chatRetryListeners",new Set);$r(this,"reconnectTimer",null);$r(this,"baseUrl");$r(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 si(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(),i=await fetch(`${this.baseUrl}/api/executions${r?`?${r}`:""}`,{signal:AbortSignal.timeout(8e3)}),a=await si(i);return(a==null?void 0:a.entries)??[]}catch{return[]}}async fetchTraces(){try{const t=await fetch(`${this.baseUrl}/api/traces`,{signal:AbortSignal.timeout(8e3)}),n=await si(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 si(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 si(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 si(n);return r&&Array.isArray(r.steps)?r:null}catch{return null}}async sendAdminRequest(t,n,r){try{const i=un(),a=await fetch(`${this.baseUrl}${t}`,{method:n,headers:{"Content-Type":"application/json",...i?{Authorization:`Bearer ${i}`}:{}},body:r!==void 0?JSON.stringify(r):void 0,signal:AbortSignal.timeout(15e3)}),o=a.headers.get("content-type")||"";let l=null;if(o.includes("application/json")||o.includes("text/json"))try{l=await a.json()}catch{l=null}return{status:a.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 i=r.data??{};return r.status===200&&i.ok?{ok:!0}:{ok:!1,error:i.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 i=await this.sendAdminRequest("/api/admin/users","POST",{user:t,password:n,role:r});if(!i)return{ok:!1,error:"Could not reach the dashboard server."};const a=i.data??{};return i.status===200&&a.ok?a:{ok:!1,error:a.error||"Failed to add user.",forbidden:i.status===403,unauthorized:i.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 i=r.data??{};return r.status===200&&typeof i.token=="string"?(wm(i.token),{ok:!0,user:i.user,token:i.token}):{ok:!1,error:i.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 i=r.data??{};return r.status===200&&typeof i.token=="string"?(wm(i.token),{ok:!0,user:i.user,token:i.token}):{ok:!1,error:i.error||"Login failed.",unauthorized:r.status===401}}async adminLogout(){await this.sendAdminRequest("/api/admin/logout","POST"),wm(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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.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 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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.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:Dr()})).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",...Dr()},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",...Dr()},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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.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,i){const a={policies:t};Array.isArray(n)&&(a.statusRecipients=n),Array.isArray(r)&&(a.contacts=r),i&&(a.askUserWait=i.wait,typeof i.timeoutMs=="number"&&(a.askUserTimeoutMs=i.timeoutMs));const o=await this.sendAdminRequest("/api/admin/gateway/policies","PUT",a);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(),i=await this.sendAdminRequest(`/api/admin/gateway/conversations${r?`?${r}`:""}`,"GET");if(!i)return{ok:!1,error:"Could not reach the dashboard server."};const a=i.data??{};return i.status===200&&a.ok?{ok:!0,conversations:a.conversations,total:a.total,hasMore:a.hasMore}:{ok:!1,error:a.error||"Failed to load conversations.",unauthorized:i.status===401,forbidden:i.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 i=r.data??{};return r.status===200&&i.ok?{ok:!0}:{ok:!1,error:i.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 i=r.data??{};return r.status===200&&i.ok?{ok:!0}:{ok:!1,error:i.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,i;try{const a=un(),o=await fetch(`${this.baseUrl}/api/admin/gateway/conversations/export`,{method:"POST",headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},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=((i=(r=o.headers.get("content-disposition"))==null?void 0:r.match(/filename="(.+)"/))==null?void 0:i[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(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}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 i=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:"update",platform:t,id:n,...r});if(!i)return{ok:!1,error:"Could not reach the dashboard server."};const a=i.data??{};return i.status===200&&a.ok?a:{ok:!1,error:a.error||"Update failed."}}async contactAction(t,n,r){const i=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:t,platform:n,nameOrId:r});if(!i)return{ok:!1,error:"Could not reach the dashboard server."};const a=i.data??{};return i.status===200&&a.ok?a:{ok:!1,error:a.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 i=r.data??{};return r.status===200&&i.ok?i:{ok:!1,error:i.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 i=r.data??{};return{ok:i.ok??!1,info:i.info,error:i.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 i=r.data??{};return r.status===200&&i.ok&&i.task?i:{ok:!1,error:i.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(),i=new EventSource(`${this.baseUrl}/api/tasks/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return i.addEventListener("log",a=>{var o;try{(o=n.onLog)==null||o.call(n,JSON.parse(a.data))}catch{}}),i.addEventListener("status",a=>{var o;try{const l=JSON.parse(a.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),()=>i.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",i=>{var a;try{const o=JSON.parse(i.data);o.qr&&((a=t.onQr)==null||a.call(t,o.qr))}catch{}}),r.addEventListener("code",i=>{var a;try{const o=JSON.parse(i.data);o.code&&((a=t.onCode)==null||a.call(t,o.code))}catch{}}),r.addEventListener("status",i=>{var a;try{(a=t.onStatus)==null||a.call(t,JSON.parse(i.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)}),i=await r.json();return r.status===200&&i.ok&&Array.isArray(i.matches)?{ok:!0,matches:i.matches}:{ok:!1,matches:[],error:typeof i.error=="string"?i.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)}),i=await r.json();return r.status===200&&i.ok&&i.project?{ok:!0,project:i.project}:{ok:!1,error:typeof i.error=="string"?i.error:"Attach failed."}}catch{return{ok:!1,error:"Could not reach the dashboard server."}}}async browseDirectories(t,n){const r=un();try{const i=new URLSearchParams;t&&i.set("path",t),n!=null&&n.showDrives&&i.set("showDrives","1");const a=i.toString()?`?${i.toString()}`:"",o=await fetch(`${this.baseUrl}/api/browse${a}`,{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 i=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)}),a=await i.json();return i.status===200&&a.ok&&a.path?{ok:!0,path:a.path}:{ok:!1,path:"",error:typeof a.error=="string"?a.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)}),i=await r.json();return r.status===200&&i.ok?{ok:!0}:{ok:!1,error:i.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 i=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)}),a=await i.json();return i.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.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)}),i=await r.json();return r.status===200&&i.ok&&i.session?i.session:null}catch{return null}}async chatSend(t,n,r,i){const a=un();try{const o=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},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}),signal:i?AbortSignal.any([AbortSignal.timeout(3e5),i]):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}:{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."}}subscribeChat(t,n){const r=un(),i=new EventSource(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return i.addEventListener("progress",a=>{var o;try{const l=JSON.parse(a.data);l.line&&((o=n.onProgress)==null||o.call(n,l.line))}catch{}}),i.addEventListener("status",a=>{var o;try{const l=JSON.parse(a.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),i.addEventListener("token",a=>{var o;try{const l=JSON.parse(a.data);typeof l.text=="string"&&l.text.length>0&&((o=n.onToken)==null||o.call(n,l.text))}catch{}}),i.addEventListener("tool",a=>{var o;try{const l=JSON.parse(a.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{}}),i.addEventListener("plan",a=>{var o;try{const l=JSON.parse(a.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{}}),i.addEventListener("diff",a=>{var o;try{const l=JSON.parse(a.data);Array.isArray(l.files)&&((o=n.onDiff)==null||o.call(n,{files:l.files,summary:l.summary??""}))}catch{}}),i.addEventListener("skill_draft",a=>{var o;try{const l=JSON.parse(a.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{}}),i.addEventListener("secret_request",a=>{var o;try{const l=JSON.parse(a.data);l.skillName&&Array.isArray(l.missing)&&((o=n.onSecretRequest)==null||o.call(n,{skillName:l.skillName,missing:l.missing,persisted:l.persisted??{}}))}catch{}}),i.addEventListener("execution_result",a=>{var o;try{const l=JSON.parse(a.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{}}),i.addEventListener("question",a=>{var o;try{const l=JSON.parse(a.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{}}),()=>i.close()}async chatRespond(t,n,r={}){try{const a=await(await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/respond`,{method:"POST",headers:{"Content-Type":"application/json",...Dr()},body:JSON.stringify({questionId:n,...r})})).json();return{ok:a.ok===!0,error:a.error}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}}async skillDraftAccept(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/drafts/${encodeURIComponent(t)}/accept`,{method:"POST",headers:{...Dr()}})).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:{...Dr()}})).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",...Dr()},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:{...Dr()}}),n=await si(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",...Dr()},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",...Dr()},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)}}}}const ee=new HL,GL=[{path:"/",label:"Chat",icon:"💬"},{path:"/overview",label:"Overview",icon:"📊"},{path:"/dag",label:"Execution",icon:"🔀"},{path:"/tasks",label:"Tasks",icon:"🚀"},{path:"/evals",label:"Evals",icon:"🏆"},{path:"/platforms",label:"Platforms",icon:"🌐"},{path:"/contacts",label:"Contacts",icon:"📇"},{path:"/gateway",label:"Gateway",icon:"📡"},{path:"/models",label:"Models",icon:"🧠"},{path:"/models/timeline",label:"Timeline",icon:"📅"},{path:"/routing",label:"Routing",icon:"🤖"},{path:"/requests",label:"Requests",icon:"📨"},{path:"/hub",label:"Agent Hub",icon:"🧰"},{path:"/traces",label:"Traces",icon:"🔍"},{path:"/env",label:"Environment",icon:"🔐"},{path:"/memory",label:"Memory",icon:"💾"},{path:"/executions",label:"Executions",icon:"📜"},{path:"/history",label:"History",icon:"📝"},{path:"/costs",label:"Costs",icon:"💰"},{path:"/benchmarks",label:"Benchmarks",icon:"📈"},{path:"/system",label:"System",icon:"⚙️"},{path:"/admin",label:"Admin",icon:"🛠️"}];function qL({children:e,connected:t,lastUpdated:n}){const r=t?"connected":"reconnecting",i=t?"Connected":"Reconnecting...";return s.jsxs("div",{className:"layout",children:[s.jsxs("nav",{className:"nav",children:[s.jsxs("div",{className:"nav-header",children:[s.jsx("span",{className:"nav-logo",children:"🤖"}),s.jsx("span",{className:"nav-title",children:"Agent-Nuvira"})]}),s.jsx("div",{className:"nav-links",children:GL.map(a=>s.jsxs(DL,{to:a.path,end:a.path==="/",className:({isActive:o})=>`nav-link${o?" active":""}`,children:[a.icon," ",a.label]},a.path))}),s.jsxs("div",{className:"nav-footer",children:[s.jsx("span",{className:`status-dot ${r}`}),s.jsx("span",{className:"status-text",children:i}),s.jsx("span",{className:"last-updated",children:n})]})]}),s.jsx("main",{className:"main",children:e})]})}function TT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=TT(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="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=TT(e))&&(r&&(r+=" "),r+=t);return r}var KL=Array.isArray,Bn=KL,VL=typeof Ki=="object"&&Ki&&Ki.Object===Object&&Ki,CT=VL,YL=CT,XL=typeof self=="object"&&self&&self.Object===Object&&self,ZL=YL||XL||Function("return this")(),Qr=ZL,QL=Qr,JL=QL.Symbol,bu=JL,g1=bu,OT=Object.prototype,eD=OT.hasOwnProperty,tD=OT.toString,jl=g1?g1.toStringTag:void 0;function nD(e){var t=eD.call(e,jl),n=e[jl];try{e[jl]=void 0;var r=!0}catch{}var i=tD.call(e);return r&&(t?e[jl]=n:delete e[jl]),i}var rD=nD,iD=Object.prototype,aD=iD.toString;function sD(e){return aD.call(e)}var oD=sD,y1=bu,lD=rD,cD=oD,uD="[object Null]",dD="[object Undefined]",v1=y1?y1.toStringTag:void 0;function fD(e){return e==null?e===void 0?dD:uD:v1&&v1 in Object(e)?lD(e):cD(e)}var Ni=fD;function hD(e){return e!=null&&typeof e=="object"}var ji=hD,pD=Ni,mD=ji,gD="[object Symbol]";function yD(e){return typeof e=="symbol"||mD(e)&&pD(e)==gD}var Xo=yD,vD=Bn,bD=Xo,xD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wD=/^\w*$/;function SD(e,t){if(vD(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||bD(e)?!0:wD.test(e)||!xD.test(e)||t!=null&&e in Object(t)}var ax=SD;function kD(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ya=kD;const Zo=Ze(ya);var ED=Ni,_D=ya,ND="[object AsyncFunction]",jD="[object Function]",AD="[object GeneratorFunction]",TD="[object Proxy]";function CD(e){if(!_D(e))return!1;var t=ED(e);return t==jD||t==AD||t==ND||t==TD}var sx=CD;const De=Ze(sx);var OD=Qr,PD=OD["__core-js_shared__"],MD=PD,Sm=MD,b1=function(){var e=/[^.]+$/.exec(Sm&&Sm.keys&&Sm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function RD(e){return!!b1&&b1 in e}var ID=RD,$D=Function.prototype,LD=$D.toString;function DD(e){if(e!=null){try{return LD.call(e)}catch{}try{return e+""}catch{}}return""}var PT=DD,BD=sx,zD=ID,FD=ya,UD=PT,WD=/[\\^$.*+?()[\]{}|]/g,HD=/^\[object .+?Constructor\]$/,GD=Function.prototype,qD=Object.prototype,KD=GD.toString,VD=qD.hasOwnProperty,YD=RegExp("^"+KD.call(VD).replace(WD,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function XD(e){if(!FD(e)||zD(e))return!1;var t=BD(e)?YD:HD;return t.test(UD(e))}var ZD=XD;function QD(e,t){return e==null?void 0:e[t]}var JD=QD,eB=ZD,tB=JD;function nB(e,t){var n=tB(e,t);return eB(n)?n:void 0}var ps=nB,rB=ps,iB=rB(Object,"create"),qh=iB,x1=qh;function aB(){this.__data__=x1?x1(null):{},this.size=0}var sB=aB;function oB(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var lB=oB,cB=qh,uB="__lodash_hash_undefined__",dB=Object.prototype,fB=dB.hasOwnProperty;function hB(e){var t=this.__data__;if(cB){var n=t[e];return n===uB?void 0:n}return fB.call(t,e)?t[e]:void 0}var pB=hB,mB=qh,gB=Object.prototype,yB=gB.hasOwnProperty;function vB(e){var t=this.__data__;return mB?t[e]!==void 0:yB.call(t,e)}var bB=vB,xB=qh,wB="__lodash_hash_undefined__";function SB(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=xB&&t===void 0?wB:t,this}var kB=SB,EB=sB,_B=lB,NB=pB,jB=bB,AB=kB;function Qo(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])}}Qo.prototype.clear=EB;Qo.prototype.delete=_B;Qo.prototype.get=NB;Qo.prototype.has=jB;Qo.prototype.set=AB;var TB=Qo;function CB(){this.__data__=[],this.size=0}var OB=CB;function PB(e,t){return e===t||e!==e&&t!==t}var ox=PB,MB=ox;function RB(e,t){for(var n=e.length;n--;)if(MB(e[n][0],t))return n;return-1}var Kh=RB,IB=Kh,$B=Array.prototype,LB=$B.splice;function DB(e){var t=this.__data__,n=IB(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():LB.call(t,n,1),--this.size,!0}var BB=DB,zB=Kh;function FB(e){var t=this.__data__,n=zB(t,e);return n<0?void 0:t[n][1]}var UB=FB,WB=Kh;function HB(e){return WB(this.__data__,e)>-1}var GB=HB,qB=Kh;function KB(e,t){var n=this.__data__,r=qB(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var VB=KB,YB=OB,XB=BB,ZB=UB,QB=GB,JB=VB;function Jo(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])}}Jo.prototype.clear=YB;Jo.prototype.delete=XB;Jo.prototype.get=ZB;Jo.prototype.has=QB;Jo.prototype.set=JB;var Vh=Jo,ez=ps,tz=Qr,nz=ez(tz,"Map"),lx=nz,w1=TB,rz=Vh,iz=lx;function az(){this.size=0,this.__data__={hash:new w1,map:new(iz||rz),string:new w1}}var sz=az;function oz(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var lz=oz,cz=lz;function uz(e,t){var n=e.__data__;return cz(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Yh=uz,dz=Yh;function fz(e){var t=dz(this,e).delete(e);return this.size-=t?1:0,t}var hz=fz,pz=Yh;function mz(e){return pz(this,e).get(e)}var gz=mz,yz=Yh;function vz(e){return yz(this,e).has(e)}var bz=vz,xz=Yh;function wz(e,t){var n=xz(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var Sz=wz,kz=sz,Ez=hz,_z=gz,Nz=bz,jz=Sz;function el(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])}}el.prototype.clear=kz;el.prototype.delete=Ez;el.prototype.get=_z;el.prototype.has=Nz;el.prototype.set=jz;var cx=el,MT=cx,Az="Expected a function";function ux(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Az);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(ux.Cache||MT),n}ux.Cache=MT;var RT=ux;const Tz=Ze(RT);var Cz=RT,Oz=500;function Pz(e){var t=Cz(e,function(r){return n.size===Oz&&n.clear(),r}),n=t.cache;return t}var Mz=Pz,Rz=Mz,Iz=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$z=/\\(\\)?/g,Lz=Rz(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Iz,function(n,r,i,a){t.push(i?a.replace($z,"$1"):r||n)}),t}),Dz=Lz;function Bz(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var dx=Bz,S1=bu,zz=dx,Fz=Bn,Uz=Xo,k1=S1?S1.prototype:void 0,E1=k1?k1.toString:void 0;function IT(e){if(typeof e=="string")return e;if(Fz(e))return zz(e,IT)+"";if(Uz(e))return E1?E1.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Wz=IT,Hz=Wz;function Gz(e){return e==null?"":Hz(e)}var $T=Gz,qz=Bn,Kz=ax,Vz=Dz,Yz=$T;function Xz(e,t){return qz(e)?e:Kz(e,t)?[e]:Vz(Yz(e))}var LT=Xz,Zz=Xo;function Qz(e){if(typeof e=="string"||Zz(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Xh=Qz,Jz=LT,e3=Xh;function t3(e,t){t=Jz(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[e3(t[n++])];return n&&n==r?e:void 0}var fx=t3,n3=fx;function r3(e,t,n){var r=e==null?void 0:n3(e,t);return r===void 0?n:r}var DT=r3;const cr=Ze(DT);function i3(e){return e==null}var a3=i3;const Ye=Ze(a3);var s3=Ni,o3=Bn,l3=ji,c3="[object String]";function u3(e){return typeof e=="string"||!o3(e)&&l3(e)&&s3(e)==c3}var d3=u3;const ss=Ze(d3);var BT={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 hx=Symbol.for("react.element"),px=Symbol.for("react.portal"),Zh=Symbol.for("react.fragment"),Qh=Symbol.for("react.strict_mode"),Jh=Symbol.for("react.profiler"),ep=Symbol.for("react.provider"),tp=Symbol.for("react.context"),f3=Symbol.for("react.server_context"),np=Symbol.for("react.forward_ref"),rp=Symbol.for("react.suspense"),ip=Symbol.for("react.suspense_list"),ap=Symbol.for("react.memo"),sp=Symbol.for("react.lazy"),h3=Symbol.for("react.offscreen"),zT;zT=Symbol.for("react.module.reference");function hr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case hx:switch(e=e.type,e){case Zh:case Jh:case Qh:case rp:case ip:return e;default:switch(e=e&&e.$$typeof,e){case f3:case tp:case np:case sp:case ap:case ep:return e;default:return t}}case px:return t}}}tt.ContextConsumer=tp;tt.ContextProvider=ep;tt.Element=hx;tt.ForwardRef=np;tt.Fragment=Zh;tt.Lazy=sp;tt.Memo=ap;tt.Portal=px;tt.Profiler=Jh;tt.StrictMode=Qh;tt.Suspense=rp;tt.SuspenseList=ip;tt.isAsyncMode=function(){return!1};tt.isConcurrentMode=function(){return!1};tt.isContextConsumer=function(e){return hr(e)===tp};tt.isContextProvider=function(e){return hr(e)===ep};tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===hx};tt.isForwardRef=function(e){return hr(e)===np};tt.isFragment=function(e){return hr(e)===Zh};tt.isLazy=function(e){return hr(e)===sp};tt.isMemo=function(e){return hr(e)===ap};tt.isPortal=function(e){return hr(e)===px};tt.isProfiler=function(e){return hr(e)===Jh};tt.isStrictMode=function(e){return hr(e)===Qh};tt.isSuspense=function(e){return hr(e)===rp};tt.isSuspenseList=function(e){return hr(e)===ip};tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Zh||e===Jh||e===Qh||e===rp||e===ip||e===h3||typeof e=="object"&&e!==null&&(e.$$typeof===sp||e.$$typeof===ap||e.$$typeof===ep||e.$$typeof===tp||e.$$typeof===np||e.$$typeof===zT||e.getModuleId!==void 0)};tt.typeOf=hr;BT.exports=tt;var p3=BT.exports,m3=Ni,g3=ji,y3="[object Number]";function v3(e){return typeof e=="number"||g3(e)&&m3(e)==y3}var FT=v3;const b3=Ze(FT);var x3=FT;function w3(e){return x3(e)&&e!=+e}var S3=w3;const xu=Ze(S3);var Nr=function(t){return t===0?0:t>0?1:-1},Ua=function(t){return ss(t)&&t.indexOf("%")===t.length-1},ue=function(t){return b3(t)&&!xu(t)},k3=function(t){return Ye(t)},Ut=function(t){return ue(t)||ss(t)},E3=0,op=function(t){var n=++E3;return"".concat(t||"").concat(n)},os=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ue(t)&&!ss(t))return r;var a;if(Ua(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return xu(a)&&(a=r),i&&a>n&&(a=n),a},Gi=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},_3=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},Ts=function(t,n){return ue(t)&&ue(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):cr(r,t))===n})}var N3=function(t,n){return ue(t)&&ue(n)?t-n:ss(t)&&ss(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function lo(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 jy(e){"@babel/helpers - typeof";return jy=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},jy(e)}var j3=["viewBox","children"],A3=["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"],_1=["points","pathLength"],km={svg:j3,polygon:_1,polyline:_1},mx=["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(E.isValidElement(t)&&(r=t.props),!Zo(r))return null;var i={};return Object.keys(r).forEach(function(a){mx.includes(a)&&(i[a]=n||function(o){return r[a](r,o)})}),i},T3=function(t,n,r){return function(i){return t(n,r,i),null}},bf=function(t,n,r){if(!Zo(t)||jy(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var o=t[a];mx.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=T3(o,n,r))}),i},C3=["children"],O3=["children"];function N1(e,t){if(e==null)return{};var n=P3(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function P3(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 j1={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"},pi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},A1=null,Em=null,gx=function e(t){if(t===A1&&Array.isArray(Em))return Em;var n=[];return E.Children.forEach(t,function(r){Ye(r)||(p3.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Em=n,A1=t,n};function Tr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return pi(i)}):r=[pi(t)],gx(e).forEach(function(i){var a=cr(i,"type.displayName")||cr(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Gn(e,t){var n=Tr(e,t);return n&&n[0]}var T1=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!ue(r)||r<=0||!ue(i)||i<=0)},M3=["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"],R3=function(t){return t&&t.type&&ss(t.type)&&M3.indexOf(t.type)>=0},I3=function(t,n,r,i){var a,o=(a=km==null?void 0:km[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!De(t)&&(i&&o.includes(n)||A3.includes(n))||r&&mx.includes(n)},Ke=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(E.isValidElement(t)&&(i=t.props),!Zo(i))return null;var a={};return Object.keys(i).forEach(function(o){var l;I3((l=i)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=i[o])}),a},Ay=function e(t,n){if(t===n)return!0;var r=E.Children.count(t);if(r!==E.Children.count(n))return!1;if(r===0)return!0;if(r===1)return C1(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],o=n[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!C1(a,o))return!1}return!0},C1=function(t,n){if(Ye(t)&&Ye(n))return!0;if(!Ye(t)&&!Ye(n)){var r=t.props||{},i=r.children,a=N1(r,C3),o=n.props||{},l=o.children,c=N1(o,O3);return i&&l?lo(a,c)&&Ay(i,l):!i&&!l?lo(a,c):!1}return!1},O1=function(t,n){var r=[],i={};return gx(t).forEach(function(a,o){if(R3(a))r.push(a);else if(a){var l=pi(a.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!i[l])){var f=u(a,l,o);r.push(f),i[l]=!0}}}),r},$3=function(t){var n=t&&t.type;return n&&j1[n]?j1[n]:null},L3=function(t,n){return gx(n).indexOf(t)},D3=["children","width","height","viewBox","className","style","title","desc"];function Ty(){return Ty=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},Ty.apply(this,arguments)}function B3(e,t){if(e==null)return{};var n=z3(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function z3(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 Cy(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=B3(e,D3),d=i||{width:n,height:r,x:0,y:0},f=Ve("recharts-surface",a);return H.createElement("svg",Ty({},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)}),H.createElement("title",null,l),H.createElement("desc",null,c),t)}var F3=["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 U3(e,t){if(e==null)return{};var n=W3(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function W3(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 Yt=H.forwardRef(function(e,t){var n=e.children,r=e.className,i=U3(e,F3),a=Ve("recharts-layer",r);return H.createElement("g",Oy({className:a},Ke(i,!0),{ref:t}),n)}),mi=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a]};function H3(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var G3=H3,q3=G3;function K3(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:q3(e,t,n)}var V3=K3,Y3="\\ud800-\\udfff",X3="\\u0300-\\u036f",Z3="\\ufe20-\\ufe2f",Q3="\\u20d0-\\u20ff",J3=X3+Z3+Q3,eF="\\ufe0e\\ufe0f",tF="\\u200d",nF=RegExp("["+tF+Y3+J3+eF+"]");function rF(e){return nF.test(e)}var UT=rF;function iF(e){return e.split("")}var aF=iF,WT="\\ud800-\\udfff",sF="\\u0300-\\u036f",oF="\\ufe20-\\ufe2f",lF="\\u20d0-\\u20ff",cF=sF+oF+lF,uF="\\ufe0e\\ufe0f",dF="["+WT+"]",Py="["+cF+"]",My="\\ud83c[\\udffb-\\udfff]",fF="(?:"+Py+"|"+My+")",HT="[^"+WT+"]",GT="(?:\\ud83c[\\udde6-\\uddff]){2}",qT="[\\ud800-\\udbff][\\udc00-\\udfff]",hF="\\u200d",KT=fF+"?",VT="["+uF+"]?",pF="(?:"+hF+"(?:"+[HT,GT,qT].join("|")+")"+VT+KT+")*",mF=VT+KT+pF,gF="(?:"+[HT+Py+"?",Py,GT,qT,dF].join("|")+")",yF=RegExp(My+"(?="+My+")|"+gF+mF,"g");function vF(e){return e.match(yF)||[]}var bF=vF,xF=aF,wF=UT,SF=bF;function kF(e){return wF(e)?SF(e):xF(e)}var EF=kF,_F=V3,NF=UT,jF=EF,AF=$T;function TF(e){return function(t){t=AF(t);var n=NF(t)?jF(t):void 0,r=n?n[0]:t.charAt(0),i=n?_F(n,1).join(""):t.slice(1);return r[e]()+i}}var CF=TF,OF=CF,PF=OF("toUpperCase"),MF=PF;const lp=Ze(MF);function ct(e){return function(){return e}}const YT=Math.cos,xf=Math.sin,Mr=Math.sqrt,wf=Math.PI,cp=2*wf,Ry=Math.PI,Iy=2*Ry,Pa=1e-6,RF=Iy-Pa;function XT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function IF(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return XT;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class $F{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?XT:IF(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,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,u=i-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>Pa)if(!(Math.abs(f*c-u*d)>Pa)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-o,g=i-l,m=c*c+u*u,v=p*p+g*g,y=Math.sqrt(m),b=Math.sqrt(h),x=a*Math.tan((Ry-Math.acos((m+h-v)/(2*y*b)))/2),k=x/b,S=x/y;Math.abs(k-1)>Pa&&this._append`L${t+k*d},${n+k*f}`,this._append`A${a},${a},0,0,${+(f*p>d*g)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=t+l,d=n+c,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Pa||Math.abs(this._y1-d)>Pa)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%Iy+Iy),h>RF?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>Pa&&this._append`A${r},${r},0,${+(h>=Ry)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function yx(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 $F(t)}function vx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ZT(e){this._context=e}ZT.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 up(e){return new ZT(e)}function QT(e){return e[0]}function JT(e){return e[1]}function eC(e,t){var n=ct(!0),r=null,i=up,a=null,o=yx(l);e=typeof e=="function"?e:e===void 0?QT:ct(e),t=typeof t=="function"?t:t===void 0?JT:ct(t);function l(c){var u,d=(c=vx(c)).length,f,h=!1,p;for(r==null&&(a=i(p=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,c),+t(f,u,c));if(p)return a=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ct(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ct(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ct(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function td(e,t,n){var r=null,i=ct(!0),a=null,o=up,l=null,c=yx(u);e=typeof e=="function"?e:e===void 0?QT:ct(+e),t=typeof t=="function"?t:ct(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?JT:ct(+n);function u(f){var h,p,g,m=(f=vx(f)).length,v,y=!1,b,x=new Array(m),k=new Array(m);for(a==null&&(l=o(b=c())),h=0;h<=m;++h){if(!(h<m&&i(v=f[h],h,f))===y)if(y=!y)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=p;--g)l.point(x[g],k[g]);l.lineEnd(),l.areaEnd()}y&&(x[h]=+e(v,h,f),k[h]=+t(v,h,f),l.point(r?+r(v,h,f):x[h],n?+n(v,h,f):k[h]))}if(b)return l=null,b+""||null}function d(){return eC().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ct(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ct(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ct(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ct(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ct(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ct(+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?(i=typeof f=="function"?f:ct(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class tC{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 LF(e){return new tC(e,!0)}function DF(e){return new tC(e,!1)}const bx={draw(e,t){const n=Mr(t/wf);e.moveTo(n,0),e.arc(0,0,n,0,cp)}},BF={draw(e,t){const n=Mr(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()}},nC=Mr(1/3),zF=nC*2,FF={draw(e,t){const n=Mr(t/zF),r=n*nC;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},UF={draw(e,t){const n=Mr(t),r=-n/2;e.rect(r,r,n,n)}},WF=.8908130915292852,rC=xf(wf/10)/xf(7*wf/10),HF=xf(cp/10)*rC,GF=-YT(cp/10)*rC,qF={draw(e,t){const n=Mr(t*WF),r=HF*n,i=GF*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=cp*a/5,l=YT(o),c=xf(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},_m=Mr(3),KF={draw(e,t){const n=-Mr(t/(_m*3));e.moveTo(0,n*2),e.lineTo(-_m*n,-n),e.lineTo(_m*n,-n),e.closePath()}},er=-.5,tr=Mr(3)/2,$y=1/Mr(12),VF=($y/2+1)*3,YF={draw(e,t){const n=Mr(t/VF),r=n/2,i=n*$y,a=r,o=n*$y+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(er*r-tr*i,tr*r+er*i),e.lineTo(er*a-tr*o,tr*a+er*o),e.lineTo(er*l-tr*c,tr*l+er*c),e.lineTo(er*r+tr*i,er*i-tr*r),e.lineTo(er*a+tr*o,er*o-tr*a),e.lineTo(er*l+tr*c,er*c-tr*l),e.closePath()}};function XF(e,t){let n=null,r=yx(i);e=typeof e=="function"?e:ct(e||bx),t=typeof t=="function"?t:ct(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:ct(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ct(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Sf(){}function kf(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 iC(e){this._context=e}iC.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:kf(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:kf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ZF(e){return new iC(e)}function aC(e){this._context=e}aC.prototype={areaStart:Sf,areaEnd:Sf,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:kf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function QF(e){return new aC(e)}function sC(e){this._context=e}sC.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:kf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JF(e){return new sC(e)}function oC(e){this._context=e}oC.prototype={areaStart:Sf,areaEnd:Sf,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 e6(e){return new oC(e)}function P1(e){return e<0?-1:1}function M1(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),l=(a*i+o*r)/(r+i);return(P1(a)+P1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function R1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Nm(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,o-l*n,a,o)}function Ef(e){this._context=e}Ef.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:Nm(this,this._t0,R1(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,Nm(this,R1(this,n=M1(this,e,t)),n);break;default:Nm(this,this._t0,n=M1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function lC(e){this._context=new cC(e)}(lC.prototype=Object.create(Ef.prototype)).point=function(e,t){Ef.prototype.point.call(this,t,e)};function cC(e){this._context=e}cC.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,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function t6(e){return new Ef(e)}function n6(e){return new lC(e)}function uC(e){this._context=e}uC.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=I1(e),i=I1(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],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 I1(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function r6(e){return new uC(e)}function dp(e,t){this._context=e,this._t=t}dp.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 i6(e){return new dp(e,.5)}function a6(e){return new dp(e,0)}function s6(e){return new dp(e,1)}function wo(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,l=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Ly(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function o6(e,t){return e[t]}function l6(e){const t=[];return t.key=e,t}function c6(){var e=ct([]),t=Ly,n=wo,r=o6;function i(a){var o=Array.from(e.apply(this,arguments),l6),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,a)]).data=f;for(l=0,d=vx(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ct(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:ct(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Ly:typeof a=="function"?a:ct(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??wo,i):n},i}function u6(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}wo(e,t)}}function d6(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,l=0;o<i;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}wo(e,t)}}function f6(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++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]],v=m[r][1]||0,y=m[r-1][1]||0;p+=v-y}c+=f,u+=p*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,wo(e,t)}}function Ac(e){"@babel/helpers - typeof";return Ac=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},Ac(e)}var h6=["type","size","sizeType"];function Dy(){return Dy=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},Dy.apply(this,arguments)}function $1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function L1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$1(Object(n),!0).forEach(function(r){p6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p6(e,t,n){return t=m6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m6(e){var t=g6(e,"string");return Ac(t)=="symbol"?t:t+""}function g6(e,t){if(Ac(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ac(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function y6(e,t){if(e==null)return{};var n=v6(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function v6(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 dC={symbolCircle:bx,symbolCross:BF,symbolDiamond:FF,symbolSquare:UF,symbolStar:qF,symbolTriangle:KF,symbolWye:YF},b6=Math.PI/180,x6=function(t){var n="symbol".concat(lp(t));return dC[n]||bx},w6=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 i=18*b6;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),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}},S6=function(t,n){dC["symbol".concat(lp(t))]=n},xx=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,a=i===void 0?64:i,o=t.sizeType,l=o===void 0?"area":o,c=y6(t,h6),u=L1(L1({},c),{},{type:r,size:a,sizeType:l}),d=function(){var v=x6(r),y=XF().type(v).size(w6(a,l,r));return y()},f=u.className,h=u.cx,p=u.cy,g=Ke(u,!0);return h===+h&&p===+p&&a===+a?H.createElement("path",Dy({},g,{className:Ve("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};xx.registerSymbol=S6;function So(e){"@babel/helpers - typeof";return So=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},So(e)}function By(){return By=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},By.apply(this,arguments)}function D1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function k6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D1(Object(n),!0).forEach(function(r){Tc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _6(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,hC(r.key),r)}}function N6(e,t,n){return t&&_6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function j6(e,t,n){return t=_f(t),A6(e,fC()?Reflect.construct(t,n||[],_f(e).constructor):t.apply(e,n))}function A6(e,t){if(t&&(So(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T6(e)}function T6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fC=function(){return!!e})()}function _f(e){return _f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_f(e)}function C6(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&&zy(e,t)}function zy(e,t){return zy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},zy(e,t)}function Tc(e,t,n){return t=hC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hC(e){var t=O6(e,"string");return So(t)=="symbol"?t:t+""}function O6(e,t){if(So(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(So(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var nr=32,wx=function(e){function t(){return E6(this,t),j6(this,t,arguments)}return C6(t,e),N6(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=nr/2,o=nr/6,l=nr/3,c=r.inactive?i:r.color;if(r.type==="plainline")return H.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:nr,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return H.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
76
+ A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,`
77
+ H`).concat(nr,"M").concat(2*l,",").concat(a,`
78
+ A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return H.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(nr/8,"h").concat(nr,"v").concat(nr*3/4,"h").concat(-nr,"z"),className:"recharts-legend-icon"});if(H.isValidElement(r.legendIcon)){var u=k6({},r);return delete u.legendIcon,H.cloneElement(r.legendIcon,u)}return H.createElement(xx,{fill:c,cx:a,cy:a,size:nr,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,a=i.payload,o=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:nr,height:nr},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(p,g){var m=p.formatter||c,v=Ve(Tc(Tc({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var y=De(p.value)?null:p.value;mi(!De(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 b=p.inactive?u:p.color;return H.createElement("li",By({className:v,style:f,key:"legend-item-".concat(g)},bf(r.props,p,g)),H.createElement(Cy,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),H.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},m?m(y,p,g):y))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,o=r.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return H.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(E.PureComponent);Tc(wx,"displayName","Legend");Tc(wx,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var P6=Vh;function M6(){this.__data__=new P6,this.size=0}var R6=M6;function I6(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var $6=I6;function L6(e){return this.__data__.get(e)}var D6=L6;function B6(e){return this.__data__.has(e)}var z6=B6,F6=Vh,U6=lx,W6=cx,H6=200;function G6(e,t){var n=this.__data__;if(n instanceof F6){var r=n.__data__;if(!U6||r.length<H6-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new W6(r)}return n.set(e,t),this.size=n.size,this}var q6=G6,K6=Vh,V6=R6,Y6=$6,X6=D6,Z6=z6,Q6=q6;function tl(e){var t=this.__data__=new K6(e);this.size=t.size}tl.prototype.clear=V6;tl.prototype.delete=Y6;tl.prototype.get=X6;tl.prototype.has=Z6;tl.prototype.set=Q6;var pC=tl,J6="__lodash_hash_undefined__";function e4(e){return this.__data__.set(e,J6),this}var t4=e4;function n4(e){return this.__data__.has(e)}var r4=n4,i4=cx,a4=t4,s4=r4;function Nf(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new i4;++t<n;)this.add(e[t])}Nf.prototype.add=Nf.prototype.push=a4;Nf.prototype.has=s4;var mC=Nf;function o4(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 gC=o4;function l4(e,t){return e.has(t)}var yC=l4,c4=mC,u4=gC,d4=yC,f4=1,h4=2;function p4(e,t,n,r,i,a){var o=n&f4,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=n&h4?new c4:void 0;for(a.set(e,t),a.set(t,e);++f<l;){var g=e[f],m=t[f];if(r)var v=o?r(m,g,f,t,e,a):r(g,m,f,e,t,a);if(v!==void 0){if(v)continue;h=!1;break}if(p){if(!u4(t,function(y,b){if(!d4(p,b)&&(g===y||i(g,y,n,r,a)))return p.push(b)})){h=!1;break}}else if(!(g===m||i(g,m,n,r,a))){h=!1;break}}return a.delete(e),a.delete(t),h}var vC=p4,m4=Qr,g4=m4.Uint8Array,y4=g4;function v4(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var b4=v4;function x4(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Sx=x4,B1=bu,z1=y4,w4=ox,S4=vC,k4=b4,E4=Sx,_4=1,N4=2,j4="[object Boolean]",A4="[object Date]",T4="[object Error]",C4="[object Map]",O4="[object Number]",P4="[object RegExp]",M4="[object Set]",R4="[object String]",I4="[object Symbol]",$4="[object ArrayBuffer]",L4="[object DataView]",F1=B1?B1.prototype:void 0,jm=F1?F1.valueOf:void 0;function D4(e,t,n,r,i,a,o){switch(n){case L4:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case $4:return!(e.byteLength!=t.byteLength||!a(new z1(e),new z1(t)));case j4:case A4:case O4:return w4(+e,+t);case T4:return e.name==t.name&&e.message==t.message;case P4:case R4:return e==t+"";case C4:var l=k4;case M4:var c=r&_4;if(l||(l=E4),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=N4,o.set(e,t);var d=S4(l(e),l(t),r,i,a,o);return o.delete(e),d;case I4:if(jm)return jm.call(e)==jm.call(t)}return!1}var B4=D4;function z4(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var bC=z4,F4=bC,U4=Bn;function W4(e,t,n){var r=t(e);return U4(e)?r:F4(r,n(e))}var H4=W4;function G4(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}var q4=G4;function K4(){return[]}var V4=K4,Y4=q4,X4=V4,Z4=Object.prototype,Q4=Z4.propertyIsEnumerable,U1=Object.getOwnPropertySymbols,J4=U1?function(e){return e==null?[]:(e=Object(e),Y4(U1(e),function(t){return Q4.call(e,t)}))}:X4,eU=J4;function tU(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var nU=tU,rU=Ni,iU=ji,aU="[object Arguments]";function sU(e){return iU(e)&&rU(e)==aU}var oU=sU,W1=oU,lU=ji,xC=Object.prototype,cU=xC.hasOwnProperty,uU=xC.propertyIsEnumerable,dU=W1(function(){return arguments}())?W1:function(e){return lU(e)&&cU.call(e,"callee")&&!uU.call(e,"callee")},kx=dU,jf={exports:{}};function fU(){return!1}var hU=fU;jf.exports;(function(e,t){var n=Qr,r=hU,i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===i,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(jf,jf.exports);var wC=jf.exports,pU=9007199254740991,mU=/^(?:0|[1-9]\d*)$/;function gU(e,t){var n=typeof e;return t=t??pU,!!t&&(n=="number"||n!="symbol"&&mU.test(e))&&e>-1&&e%1==0&&e<t}var Ex=gU,yU=9007199254740991;function vU(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yU}var _x=vU,bU=Ni,xU=_x,wU=ji,SU="[object Arguments]",kU="[object Array]",EU="[object Boolean]",_U="[object Date]",NU="[object Error]",jU="[object Function]",AU="[object Map]",TU="[object Number]",CU="[object Object]",OU="[object RegExp]",PU="[object Set]",MU="[object String]",RU="[object WeakMap]",IU="[object ArrayBuffer]",$U="[object DataView]",LU="[object Float32Array]",DU="[object Float64Array]",BU="[object Int8Array]",zU="[object Int16Array]",FU="[object Int32Array]",UU="[object Uint8Array]",WU="[object Uint8ClampedArray]",HU="[object Uint16Array]",GU="[object Uint32Array]",mt={};mt[LU]=mt[DU]=mt[BU]=mt[zU]=mt[FU]=mt[UU]=mt[WU]=mt[HU]=mt[GU]=!0;mt[SU]=mt[kU]=mt[IU]=mt[EU]=mt[$U]=mt[_U]=mt[NU]=mt[jU]=mt[AU]=mt[TU]=mt[CU]=mt[OU]=mt[PU]=mt[MU]=mt[RU]=!1;function qU(e){return wU(e)&&xU(e.length)&&!!mt[bU(e)]}var KU=qU;function VU(e){return function(t){return e(t)}}var SC=VU,Af={exports:{}};Af.exports;(function(e,t){var n=CT,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,o=a&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(Af,Af.exports);var YU=Af.exports,XU=KU,ZU=SC,H1=YU,G1=H1&&H1.isTypedArray,QU=G1?ZU(G1):XU,kC=QU,JU=nU,e9=kx,t9=Bn,n9=wC,r9=Ex,i9=kC,a9=Object.prototype,s9=a9.hasOwnProperty;function o9(e,t){var n=t9(e),r=!n&&e9(e),i=!n&&!r&&n9(e),a=!n&&!r&&!i&&i9(e),o=n||r||i||a,l=o?JU(e.length,String):[],c=l.length;for(var u in e)(t||s9.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||r9(u,c)))&&l.push(u);return l}var l9=o9,c9=Object.prototype;function u9(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||c9;return e===n}var d9=u9;function f9(e,t){return function(n){return e(t(n))}}var EC=f9,h9=EC,p9=h9(Object.keys,Object),m9=p9,g9=d9,y9=m9,v9=Object.prototype,b9=v9.hasOwnProperty;function x9(e){if(!g9(e))return y9(e);var t=[];for(var n in Object(e))b9.call(e,n)&&n!="constructor"&&t.push(n);return t}var w9=x9,S9=sx,k9=_x;function E9(e){return e!=null&&k9(e.length)&&!S9(e)}var wu=E9,_9=l9,N9=w9,j9=wu;function A9(e){return j9(e)?_9(e):N9(e)}var fp=A9,T9=H4,C9=eU,O9=fp;function P9(e){return T9(e,O9,C9)}var M9=P9,q1=M9,R9=1,I9=Object.prototype,$9=I9.hasOwnProperty;function L9(e,t,n,r,i,a){var o=n&R9,l=q1(e),c=l.length,u=q1(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:$9.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=o;++f<c;){h=l[f];var y=e[h],b=t[h];if(r)var x=o?r(b,y,h,t,e,a):r(y,b,h,e,t,a);if(!(x===void 0?y===b||i(y,b,n,r,a):x)){m=!1;break}v||(v=h=="constructor")}if(m&&!v){var k=e.constructor,S=t.constructor;k!=S&&"constructor"in e&&"constructor"in t&&!(typeof k=="function"&&k instanceof k&&typeof S=="function"&&S instanceof S)&&(m=!1)}return a.delete(e),a.delete(t),m}var D9=L9,B9=ps,z9=Qr,F9=B9(z9,"DataView"),U9=F9,W9=ps,H9=Qr,G9=W9(H9,"Promise"),q9=G9,K9=ps,V9=Qr,Y9=K9(V9,"Set"),_C=Y9,X9=ps,Z9=Qr,Q9=X9(Z9,"WeakMap"),J9=Q9,Fy=U9,Uy=lx,Wy=q9,Hy=_C,Gy=J9,NC=Ni,nl=PT,K1="[object Map]",e8="[object Object]",V1="[object Promise]",Y1="[object Set]",X1="[object WeakMap]",Z1="[object DataView]",t8=nl(Fy),n8=nl(Uy),r8=nl(Wy),i8=nl(Hy),a8=nl(Gy),Ma=NC;(Fy&&Ma(new Fy(new ArrayBuffer(1)))!=Z1||Uy&&Ma(new Uy)!=K1||Wy&&Ma(Wy.resolve())!=V1||Hy&&Ma(new Hy)!=Y1||Gy&&Ma(new Gy)!=X1)&&(Ma=function(e){var t=NC(e),n=t==e8?e.constructor:void 0,r=n?nl(n):"";if(r)switch(r){case t8:return Z1;case n8:return K1;case r8:return V1;case i8:return Y1;case a8:return X1}return t});var s8=Ma,Am=pC,o8=vC,l8=B4,c8=D9,Q1=s8,J1=Bn,eS=wC,u8=kC,d8=1,tS="[object Arguments]",nS="[object Array]",nd="[object Object]",f8=Object.prototype,rS=f8.hasOwnProperty;function h8(e,t,n,r,i,a){var o=J1(e),l=J1(t),c=o?nS:Q1(e),u=l?nS:Q1(t);c=c==tS?nd:c,u=u==tS?nd:u;var d=c==nd,f=u==nd,h=c==u;if(h&&eS(e)){if(!eS(t))return!1;o=!0,d=!1}if(h&&!d)return a||(a=new Am),o||u8(e)?o8(e,t,n,r,i,a):l8(e,t,c,n,r,i,a);if(!(n&d8)){var p=d&&rS.call(e,"__wrapped__"),g=f&&rS.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,v=g?t.value():t;return a||(a=new Am),i(m,v,n,r,a)}}return h?(a||(a=new Am),c8(e,t,n,r,i,a)):!1}var p8=h8,m8=p8,iS=ji;function jC(e,t,n,r,i){return e===t?!0:e==null||t==null||!iS(e)&&!iS(t)?e!==e&&t!==t:m8(e,t,n,r,jC,i)}var Nx=jC,g8=pC,y8=Nx,v8=1,b8=2;function x8(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var l=n[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=n[i];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 g8;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?y8(d,u,v8|b8,r,f):h))return!1}}return!0}var w8=x8,S8=ya;function k8(e){return e===e&&!S8(e)}var AC=k8,E8=AC,_8=fp;function N8(e){for(var t=_8(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,E8(i)]}return t}var j8=N8;function A8(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var TC=A8,T8=w8,C8=j8,O8=TC;function P8(e){var t=C8(e);return t.length==1&&t[0][2]?O8(t[0][0],t[0][1]):function(n){return n===e||T8(n,e,t)}}var M8=P8;function R8(e,t){return e!=null&&t in Object(e)}var I8=R8,$8=LT,L8=kx,D8=Bn,B8=Ex,z8=_x,F8=Xh;function U8(e,t,n){t=$8(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=F8(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&z8(i)&&B8(o,i)&&(D8(e)||L8(e)))}var W8=U8,H8=I8,G8=W8;function q8(e,t){return e!=null&&G8(e,t,H8)}var K8=q8,V8=Nx,Y8=DT,X8=K8,Z8=ax,Q8=AC,J8=TC,e5=Xh,t5=1,n5=2;function r5(e,t){return Z8(e)&&Q8(t)?J8(e5(e),t):function(n){var r=Y8(n,e);return r===void 0&&r===t?X8(n,e):V8(t,r,t5|n5)}}var i5=r5;function a5(e){return e}var rl=a5;function s5(e){return function(t){return t==null?void 0:t[e]}}var o5=s5,l5=fx;function c5(e){return function(t){return l5(t,e)}}var u5=c5,d5=o5,f5=u5,h5=ax,p5=Xh;function m5(e){return h5(e)?d5(p5(e)):f5(e)}var g5=m5,y5=M8,v5=i5,b5=rl,x5=Bn,w5=g5;function S5(e){return typeof e=="function"?e:e==null?b5:typeof e=="object"?x5(e)?v5(e[0],e[1]):y5(e):w5(e)}var va=S5;function k5(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var CC=k5;function E5(e){return e!==e}var _5=E5;function N5(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var j5=N5,A5=CC,T5=_5,C5=j5;function O5(e,t,n){return t===t?C5(e,t,n):A5(e,T5,n)}var P5=O5,M5=P5;function R5(e,t){var n=e==null?0:e.length;return!!n&&M5(e,t,0)>-1}var I5=R5;function $5(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var L5=$5;function D5(){}var B5=D5,Tm=_C,z5=B5,F5=Sx,U5=1/0,W5=Tm&&1/F5(new Tm([,-0]))[1]==U5?function(e){return new Tm(e)}:z5,H5=W5,G5=mC,q5=I5,K5=L5,V5=yC,Y5=H5,X5=Sx,Z5=200;function Q5(e,t,n){var r=-1,i=q5,a=e.length,o=!0,l=[],c=l;if(n)o=!1,i=K5;else if(a>=Z5){var u=t?null:Y5(e);if(u)return X5(u);o=!1,i=V5,c=new G5}else c=t?[]:l;e:for(;++r<a;){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 i(c,f,n)||(c!==l&&c.push(f),l.push(d))}return l}var J5=Q5,eW=va,tW=J5;function nW(e,t){return e&&e.length?tW(e,eW(t)):[]}var rW=nW;const aS=Ze(rW);function OC(e,t,n){return t===!0?aS(e,n):De(t)?aS(e,t):e}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)}var iW=["ref"];function sS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sS(Object(n),!0).forEach(function(r){hp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oS(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,MC(r.key),r)}}function sW(e,t,n){return t&&oS(e.prototype,t),n&&oS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oW(e,t,n){return t=Tf(t),lW(e,PC()?Reflect.construct(t,n||[],Tf(e).constructor):t.apply(e,n))}function lW(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 cW(e)}function cW(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PC=function(){return!!e})()}function Tf(e){return Tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tf(e)}function uW(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&&qy(e,t)}function qy(e,t){return qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},qy(e,t)}function hp(e,t,n){return t=MC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MC(e){var t=dW(e,"string");return ko(t)=="symbol"?t:t+""}function dW(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)}function fW(e,t){if(e==null)return{};var n=hW(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hW(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 pW(e){return e.value}function mW(e,t){if(H.isValidElement(e))return H.cloneElement(e,t);if(typeof e=="function")return H.createElement(e,t);t.ref;var n=fW(t,iW);return H.createElement(wx,n)}var lS=1,Ya=function(e){function t(){var n;aW(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=oW(this,t,[].concat(i)),hp(n,"lastBoundingBox",{width:-1,height:-1}),n}return uW(t,e),sW(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,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>lS||Math.abs(i.height-this.lastBoundingBox.height)>lS)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(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?ii({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,o=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="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 ii(ii({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,o=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,f=ii(ii({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return H.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},mW(a,ii(ii({},this.props),{},{payload:OC(d,u,pW)})))}}],[{key:"getWithHeight",value:function(r,i){var a=ii(ii({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&ue(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}])}(E.PureComponent);hp(Ya,"displayName","Legend");hp(Ya,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var cS=bu,gW=kx,yW=Bn,uS=cS?cS.isConcatSpreadable:void 0;function vW(e){return yW(e)||gW(e)||!!(uS&&e&&e[uS])}var bW=vW,xW=bC,wW=bW;function RC(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=wW),i||(i=[]);++a<o;){var l=e[a];t>0&&n(l)?t>1?RC(l,t-1,n,r,i):xW(i,l):r||(i[i.length]=l)}return i}var IC=RC;function SW(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++i];if(n(a[c],c,a)===!1)break}return t}}var kW=SW,EW=kW,_W=EW(),NW=_W,jW=NW,AW=fp;function TW(e,t){return e&&jW(e,t,AW)}var $C=TW,CW=wu;function OW(e,t){return function(n,r){if(n==null)return n;if(!CW(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var PW=OW,MW=$C,RW=PW,IW=RW(MW),jx=IW,$W=jx,LW=wu;function DW(e,t){var n=-1,r=LW(e)?Array(e.length):[];return $W(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var LC=DW;function BW(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var zW=BW,dS=Xo;function FW(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=dS(e),o=t!==void 0,l=t===null,c=t===t,u=dS(t);if(!l&&!u&&!a&&e>t||a&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||l&&n&&i||!o&&i||!c)return-1}return 0}var UW=FW,WW=UW;function HW(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,l=n.length;++r<o;){var c=WW(i[r],a[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var GW=HW,Cm=dx,qW=fx,KW=va,VW=LC,YW=zW,XW=SC,ZW=GW,QW=rl,JW=Bn;function eH(e,t,n){t.length?t=Cm(t,function(a){return JW(a)?function(o){return qW(o,a.length===1?a[0]:a)}:a}):t=[QW];var r=-1;t=Cm(t,XW(KW));var i=VW(e,function(a,o,l){var c=Cm(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return YW(i,function(a,o){return ZW(a,o,n)})}var tH=eH;function nH(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 rH=nH,iH=rH,fS=Math.max;function aH(e,t,n){return t=fS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=fS(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(o),iH(e,this,l)}}var sH=aH;function oH(e){return function(){return e}}var lH=oH,cH=ps,uH=function(){try{var e=cH(Object,"defineProperty");return e({},"",{}),e}catch{}}(),DC=uH,dH=lH,hS=DC,fH=rl,hH=hS?function(e,t){return hS(e,"toString",{configurable:!0,enumerable:!1,value:dH(t),writable:!0})}:fH,pH=hH,mH=800,gH=16,yH=Date.now;function vH(e){var t=0,n=0;return function(){var r=yH(),i=gH-(r-n);if(n=r,i>0){if(++t>=mH)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var bH=vH,xH=pH,wH=bH,SH=wH(xH),kH=SH,EH=rl,_H=sH,NH=kH;function jH(e,t){return NH(_H(e,t,EH),e+"")}var AH=jH,TH=ox,CH=wu,OH=Ex,PH=ya;function MH(e,t,n){if(!PH(n))return!1;var r=typeof t;return(r=="number"?CH(n)&&OH(t,n.length):r=="string"&&t in n)?TH(n[t],e):!1}var pp=MH,RH=IC,IH=tH,$H=AH,pS=pp,LH=$H(function(e,t){if(e==null)return[];var n=t.length;return n>1&&pS(e,t[0],t[1])?t=[]:n>2&&pS(t[0],t[1],t[2])&&(t=[t[0]]),IH(e,RH(t,1),[])}),DH=LH;const Ax=Ze(DH);function Cc(e){"@babel/helpers - typeof";return Cc=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},Cc(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 BH(e,t){return WH(e)||UH(e,t)||FH(e,t)||zH()}function zH(){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 FH(e,t){if(e){if(typeof e=="string")return mS(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 mS(e,t)}}function mS(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 UH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function WH(e){if(Array.isArray(e))return e}function gS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Om(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gS(Object(n),!0).forEach(function(r){HH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HH(e,t,n){return t=GH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GH(e){var t=qH(e,"string");return Cc(t)=="symbol"?t:t+""}function qH(e,t){if(Cc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KH(e){return Array.isArray(e)&&Ut(e[0])&&Ut(e[1])?e.join(" ~ "):e}var VH=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,a=i===void 0?{}:i,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,v=t.labelFormatter,y=t.accessibilityLayer,b=y===void 0?!1:y,x=function(){if(d&&d.length){var M={padding:0,margin:0},$=(h?Ax(d,h):d).map(function(R,z){if(R.type==="none")return null;var D=Om({display:"block",paddingTop:4,paddingBottom:4,color:R.color||"#000"},l),U=R.formatter||f||KH,O=R.value,F=R.name,A=O,Z=F;if(U&&A!=null&&Z!=null){var L=U(O,F,R,z,d);if(Array.isArray(L)){var P=BH(L,2);A=P[0],Z=P[1]}else A=L}return H.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:D},Ut(Z)?H.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,Ut(Z)?H.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,H.createElement("span",{className:"recharts-tooltip-item-value"},A),H.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return H.createElement("ul",{className:"recharts-tooltip-item-list",style:M},$)}return null},k=Om({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),S=Om({margin:0},u),w=!Ye(m),_=w?m:"",N=Ve("recharts-default-tooltip",p),C=Ve("recharts-tooltip-label",g);w&&v&&d!==void 0&&d!==null&&(_=v(m,d));var T=b?{role:"status","aria-live":"assertive"}:{};return H.createElement("div",Ky({className:N,style:k},T),H.createElement("p",{className:C,style:S},H.isValidElement(_)?_:"".concat(_)),x())};function Oc(e){"@babel/helpers - typeof";return Oc=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},Oc(e)}function rd(e,t,n){return t=YH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YH(e){var t=XH(e,"string");return Oc(t)=="symbol"?t:t+""}function XH(e,t){if(Oc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Al="recharts-tooltip-wrapper",ZH={visibility:"hidden"};function QH(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ve(Al,rd(rd(rd(rd({},"".concat(Al,"-right"),ue(n)&&t&&ue(t.x)&&n>=t.x),"".concat(Al,"-left"),ue(n)&&t&&ue(t.x)&&n<t.x),"".concat(Al,"-bottom"),ue(r)&&t&&ue(t.y)&&r>=t.y),"".concat(Al,"-top"),ue(r)&&t&&ue(t.y)&&r<t.y))}function yS(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&ue(a[r]))return a[r];var d=n[r]-l-i,f=n[r]+i;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 JH(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 eG(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=yS({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=yS({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=JH({translateX:d,translateY:f,useTranslate3d:l})):u=ZH,{cssProperties:u,cssClasses:QH({translateX:d,translateY:f,coordinate:n})}}function Eo(e){"@babel/helpers - typeof";return Eo=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},Eo(e)}function vS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vS(Object(n),!0).forEach(function(r){Yy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nG(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,zC(r.key),r)}}function rG(e,t,n){return t&&nG(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function iG(e,t,n){return t=Cf(t),aG(e,BC()?Reflect.construct(t,n||[],Cf(e).constructor):t.apply(e,n))}function aG(e,t){if(t&&(Eo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sG(e)}function sG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BC=function(){return!!e})()}function Cf(e){return Cf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cf(e)}function oG(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&&Vy(e,t)}function Vy(e,t){return Vy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Vy(e,t)}function Yy(e,t,n){return t=zC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zC(e){var t=lG(e,"string");return Eo(t)=="symbol"?t:t+""}function lG(e,t){if(Eo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Eo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var xS=1,cG=function(e){function t(){var n;tG(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=iG(this,t,[].concat(i)),Yy(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Yy(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 oG(t,e),rG(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>xS||Math.abs(r.height-this.state.lastBoundingBox.height)>xS)&&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,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,p=i.offset,g=i.position,m=i.reverseDirection,v=i.useTranslate3d,y=i.viewBox,b=i.wrapperStyle,x=eG({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:y}),k=x.cssClasses,S=x.cssProperties,w=bS(bS({transition:h&&a?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},b);return H.createElement("div",{tabIndex:-1,className:k,style:w,ref:function(N){r.wrapperNode=N}},u)}}])}(E.PureComponent),uG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Su={isSsr:uG()};function _o(e){"@babel/helpers - typeof";return _o=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},_o(e)}function wS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function SS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wS(Object(n),!0).forEach(function(r){Tx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fG(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,UC(r.key),r)}}function hG(e,t,n){return t&&fG(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pG(e,t,n){return t=Of(t),mG(e,FC()?Reflect.construct(t,n||[],Of(e).constructor):t.apply(e,n))}function mG(e,t){if(t&&(_o(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gG(e)}function gG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FC=function(){return!!e})()}function Of(e){return Of=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Of(e)}function yG(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&&Xy(e,t)}function Xy(e,t){return Xy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Xy(e,t)}function Tx(e,t,n){return t=UC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UC(e){var t=vG(e,"string");return _o(t)=="symbol"?t:t+""}function vG(e,t){if(_o(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_o(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function bG(e){return e.dataKey}function xG(e,t){return H.isValidElement(e)?H.cloneElement(e,t):typeof e=="function"?H.createElement(e,t):H.createElement(VH,t)}var hn=function(e){function t(){return dG(this,t),pG(this,t,arguments)}return yG(t,e),hG(t,[{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,f=i.filterNull,h=i.isAnimationActive,p=i.offset,g=i.payload,m=i.payloadUniqBy,v=i.position,y=i.reverseDirection,b=i.useTranslate3d,x=i.viewBox,k=i.wrapperStyle,S=g??[];f&&S.length&&(S=OC(g.filter(function(_){return _.value!=null&&(_.hide!==!0||r.props.includeHidden)}),m,bG));var w=S.length>0;return H.createElement(cG,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:w,offset:p,position:v,reverseDirection:y,useTranslate3d:b,viewBox:x,wrapperStyle:k},xG(u,SS(SS({},this.props),{},{payload:S})))}}])}(E.PureComponent);Tx(hn,"displayName","Tooltip");Tx(hn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Su.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 wG=Qr,SG=function(){return wG.Date.now()},kG=SG,EG=/\s/;function _G(e){for(var t=e.length;t--&&EG.test(e.charAt(t)););return t}var NG=_G,jG=NG,AG=/^\s+/;function TG(e){return e&&e.slice(0,jG(e)+1).replace(AG,"")}var CG=TG,OG=CG,kS=ya,PG=Xo,ES=NaN,MG=/^[-+]0x[0-9a-f]+$/i,RG=/^0b[01]+$/i,IG=/^0o[0-7]+$/i,$G=parseInt;function LG(e){if(typeof e=="number")return e;if(PG(e))return ES;if(kS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=kS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=OG(e);var n=RG.test(e);return n||IG.test(e)?$G(e.slice(2),n?2:8):MG.test(e)?ES:+e}var WC=LG,DG=ya,Pm=kG,_S=WC,BG="Expected a function",zG=Math.max,FG=Math.min;function UG(e,t,n){var r,i,a,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(BG);t=_S(t)||0,DG(n)&&(d=!!n.leading,f="maxWait"in n,a=f?zG(_S(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(w){var _=r,N=i;return r=i=void 0,u=w,o=e.apply(N,_),o}function g(w){return u=w,l=setTimeout(y,t),d?p(w):o}function m(w){var _=w-c,N=w-u,C=t-_;return f?FG(C,a-N):C}function v(w){var _=w-c,N=w-u;return c===void 0||_>=t||_<0||f&&N>=a}function y(){var w=Pm();if(v(w))return b(w);l=setTimeout(y,m(w))}function b(w){return l=void 0,h&&r?p(w):(r=i=void 0,o)}function x(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function k(){return l===void 0?o:b(Pm())}function S(){var w=Pm(),_=v(w);if(r=arguments,i=this,c=w,_){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(y,t),p(c)}return l===void 0&&(l=setTimeout(y,t)),o}return S.cancel=x,S.flush=k,S}var WG=UG,HG=WG,GG=ya,qG="Expected a function";function KG(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(qG);return GG(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),HG(e,t,{leading:r,maxWait:t,trailing:i})}var VG=KG;const HC=Ze(VG);function Pc(e){"@babel/helpers - typeof";return Pc=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},Pc(e)}function NS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function id(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NS(Object(n),!0).forEach(function(r){YG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YG(e,t,n){return t=XG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XG(e){var t=ZG(e,"string");return Pc(t)=="symbol"?t:t+""}function ZG(e,t){if(Pc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QG(e,t){return nq(e)||tq(e,t)||eq(e,t)||JG()}function JG(){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 eq(e,t){if(e){if(typeof e=="string")return jS(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 jS(e,t)}}function jS(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 tq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function nq(e){if(Array.isArray(e))return e}var $a=E.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,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,v=e.id,y=e.className,b=e.onResize,x=e.style,k=x===void 0?{}:x,S=E.useRef(null),w=E.useRef();w.current=b,E.useImperativeHandle(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),S.current},configurable:!0})});var _=E.useState({containerWidth:i.width,containerHeight:i.height}),N=QG(_,2),C=N[0],T=N[1],I=E.useCallback(function($,R){T(function(z){var D=Math.round($),U=Math.round(R);return z.containerWidth===D&&z.containerHeight===U?z:{containerWidth:D,containerHeight:U}})},[]);E.useEffect(function(){var $=function(F){var A,Z=F[0].contentRect,L=Z.width,P=Z.height;I(L,P),(A=w.current)===null||A===void 0||A.call(w,L,P)};m>0&&($=HC($,m,{trailing:!0,leading:!1}));var R=new ResizeObserver($),z=S.current.getBoundingClientRect(),D=z.width,U=z.height;return I(D,U),R.observe(S.current),function(){R.disconnect()}},[I,m]);var M=E.useMemo(function(){var $=C.containerWidth,R=C.containerHeight;if($<0||R<0)return null;mi(Ua(o)||Ua(c),`The width(%s) and height(%s) are both fixed numbers,
81
+ maybe you don't need to use a ResponsiveContainer.`,o,c),mi(!n||n>0,"The aspect(%s) must be greater than zero.",n);var z=Ua(o)?$:o,D=Ua(c)?R:c;n&&n>0&&(z?D=z/n:D&&(z=D*n),h&&D>h&&(D=h)),mi(z>0||D>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.`,z,D,o,c,d,f,n);var U=!Array.isArray(p)&&pi(p.type).endsWith("Chart");return H.Children.map(p,function(O){return H.isValidElement(O)?E.cloneElement(O,id({width:z,height:D},U?{style:id({height:"100%",width:"100%",maxHeight:D,maxWidth:z},O.props.style)}:{})):O})},[n,p,c,h,f,d,C,o]);return H.createElement("div",{id:v?"".concat(v):void 0,className:Ve("recharts-responsive-container",y),style:id(id({},k),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:S},M)}),Mc=function(t){return null};Mc.displayName="Cell";function Rc(e){"@babel/helpers - typeof";return Rc=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},Rc(e)}function AS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AS(Object(n),!0).forEach(function(r){rq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rq(e,t,n){return t=iq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iq(e){var t=aq(e,"string");return Rc(t)=="symbol"?t:t+""}function aq(e,t){if(Rc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Cs={widthCache:{},cacheCount:0},sq=2e3,oq={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},TS="recharts_measurement_span";function lq(e){var t=Zy({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var tc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Su.isSsr)return{width:0,height:0};var r=lq(n),i=JSON.stringify({text:t,copyStyle:r});if(Cs.widthCache[i])return Cs.widthCache[i];try{var a=document.getElementById(TS);a||(a=document.createElement("span"),a.setAttribute("id",TS),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Zy(Zy({},oq),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Cs.widthCache[i]=c,++Cs.cacheCount>sq&&(Cs.cacheCount=0,Cs.widthCache={}),c}catch{return{width:0,height:0}}},cq=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Ic(e){"@babel/helpers - typeof";return Ic=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},Ic(e)}function Pf(e,t){return hq(e)||fq(e,t)||dq(e,t)||uq()}function uq(){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 dq(e,t){if(e){if(typeof e=="string")return CS(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 CS(e,t)}}function CS(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 fq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function hq(e){if(Array.isArray(e))return e}function pq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OS(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,gq(r.key),r)}}function mq(e,t,n){return t&&OS(e.prototype,t),n&&OS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gq(e){var t=yq(e,"string");return Ic(t)=="symbol"?t:t+""}function yq(e,t){if(Ic(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ic(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var PS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,MS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,vq=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,bq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,GC={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},xq=Object.keys(GC),Qs="NaN";function wq(e,t){return e*GC[t]}var ad=function(){function e(t,n){pq(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!vq.test(n)&&(this.num=NaN,this.unit=""),xq.includes(n)&&(this.num=wq(t,n),this.unit="px")}return mq(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,i=(r=bq.exec(n))!==null&&r!==void 0?r:[],a=Pf(i,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function qC(e){if(e.includes(Qs))return Qs;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=PS.exec(t))!==null&&n!==void 0?n:[],i=Pf(r,4),a=i[1],o=i[2],l=i[3],c=ad.parse(a??""),u=ad.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return Qs;t=t.replace(PS,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=MS.exec(t))!==null&&f!==void 0?f:[],p=Pf(h,4),g=p[1],m=p[2],v=p[3],y=ad.parse(g??""),b=ad.parse(v??""),x=m==="+"?y.add(b):y.subtract(b);if(x.isNaN())return Qs;t=t.replace(MS,x.toString())}return t}var RS=/\(([^()]*)\)/;function Sq(e){for(var t=e;t.includes("(");){var n=RS.exec(t),r=Pf(n,2),i=r[1];t=t.replace(RS,qC(i))}return t}function kq(e){var t=e.replace(/\s+/g,"");return t=Sq(t),t=qC(t),t}function Eq(e){try{return kq(e)}catch{return Qs}}function Mm(e){var t=Eq(e.slice(5,-1));return t===Qs?"":t}var _q=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Nq=["dx","dy","angle","className","breakAll"];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 IS(e,t){if(e==null)return{};var n=jq(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jq(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 $S(e,t){return Oq(e)||Cq(e,t)||Tq(e,t)||Aq()}function Aq(){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 Tq(e,t){if(e){if(typeof e=="string")return LS(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 LS(e,t)}}function LS(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 Cq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Oq(e){if(Array.isArray(e))return e}var KC=/[ \f\n\r\t\v\u2028\u2029]+/,VC=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var a=[];Ye(n)||(r?a=n.toString().split(""):a=n.toString().split(KC));var o=a.map(function(c){return{word:c,width:tc(c,i).width}}),l=r?0:tc(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},Pq=function(t,n,r,i,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=ue(o),f=l,h=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(D,U){var O=U.word,F=U.width,A=D[D.length-1];if(A&&(i==null||a||A.width+F+r<Number(i)))A.words.push(O),A.width+=F+r;else{var Z={words:[O],width:F};D.push(Z)}return D},[])},p=h(n),g=function(z){return z.reduce(function(D,U){return D.width>U.width?D:U})};if(!d)return p;for(var m="…",v=function(z){var D=f.slice(0,z),U=VC({breakAll:u,style:c,children:D+m}).wordsWithComputedWidth,O=h(U),F=O.length>o||g(O).width>Number(i);return[F,O]},y=0,b=f.length-1,x=0,k;y<=b&&x<=f.length-1;){var S=Math.floor((y+b)/2),w=S-1,_=v(w),N=$S(_,2),C=N[0],T=N[1],I=v(S),M=$S(I,1),$=M[0];if(!C&&!$&&(y=S+1),C&&$&&(b=S-1),!C&&$){k=T;break}x++}return k||p},DS=function(t){var n=Ye(t)?[]:t.toString().split(KC);return[{words:n}]},Mq=function(t){var n=t.width,r=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!Su.isSsr){var c,u,d=VC({breakAll:o,children:i,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return DS(i);return Pq({breakAll:o,children:i,maxLines:l,style:a},c,u,n,r)}return DS(i)},BS="#808080",Mf=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,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,v=t.fill,y=v===void 0?BS:v,b=IS(t,_q),x=E.useMemo(function(){return Mq({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:f,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,f,b.style,b.width]),k=b.dx,S=b.dy,w=b.angle,_=b.className,N=b.breakAll,C=IS(b,Nq);if(!Ut(r)||!Ut(a))return null;var T=r+(ue(k)?k:0),I=a+(ue(S)?S:0),M;switch(m){case"start":M=Mm("calc(".concat(u,")"));break;case"middle":M=Mm("calc(".concat((x.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:M=Mm("calc(".concat(x.length-1," * -").concat(l,")"));break}var $=[];if(f){var R=x[0].width,z=b.width;$.push("scale(".concat((ue(z)?z/R:1)/R,")"))}return w&&$.push("rotate(".concat(w,", ").concat(T,", ").concat(I,")")),$.length&&(C.transform=$.join(" ")),H.createElement("text",Qy({},Ke(C,!0),{x:T,y:I,className:Ve("recharts-text",_),textAnchor:p,fill:y.includes("url")?BS:y}),x.map(function(D,U){var O=D.words.join(N?"":" ");return H.createElement("tspan",{x:T,dy:U===0?M:l,key:"".concat(O,"-").concat(U)},O)}))};function la(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Rq(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Cx(e){let t,n,r;e.length!==2?(t=la,n=(l,c)=>la(e(l),c),r=(l,c)=>e(l)-c):(t=e===la||e===Rq?e:Iq,n=e,r=e);function i(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 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 o(l,c,u=0,d=l.length){const f=i(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:o,right:a}}function Iq(){return 0}function YC(e){return e===null?NaN:+e}function*$q(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Lq=Cx(la),ku=Lq.right;Cx(YC).center;class zS extends Map{constructor(t,n=zq){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(FS(this,t))}has(t){return super.has(FS(this,t))}set(t,n){return super.set(Dq(this,t),n)}delete(t){return super.delete(Bq(this,t))}}function FS({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Dq({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Bq({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function zq(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Fq(e=la){if(e===la)return XC;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 XC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Uq=Math.sqrt(50),Wq=Math.sqrt(10),Hq=Math.sqrt(2);function Rf(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Uq?10:a>=Wq?5:a>=Hq?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/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,i)*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?Rf(e,t,n*2):[l,c,u]}function Jy(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?Rf(t,e,n):Rf(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)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;else if(o<0)for(let u=0;u<l;++u)c[u]=(i+u)/-o;else for(let u=0;u<l;++u)c[u]=(i+u)*o;return c}function ev(e,t,n){return t=+t,e=+e,n=+n,Rf(e,t,n)[2]}function tv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?ev(t,e,n):ev(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function US(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function WS(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function ZC(e,t,n=0,r=1/0,i){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(i=i===void 0?XC:Fq(i);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));ZC(e,t,p,g,i)}const a=e[t];let o=n,l=r;for(Tl(e,n,t),i(e[r],a)>0&&Tl(e,n,r);o<l;){for(Tl(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?Tl(e,n,l):(++l,Tl(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Tl(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Gq(e,t,n){if(e=Float64Array.from($q(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return WS(e);if(t>=1)return US(e);var r,i=(r-1)*t,a=Math.floor(i),o=US(ZC(e,a).subarray(0,a+1)),l=WS(e.subarray(a+1));return o+(l-o)*(i-a)}}function qq(e,t,n=YC){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,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(i-a)}}function Kq(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function pr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ai(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 nv=Symbol("implicit");function Ox(){var e=new zS,t=[],n=[],r=nv;function i(a){let o=e.get(a);if(o===void 0){if(r!==nv)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new zS;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Ox(t,n).unknown(r)},pr.apply(i,arguments),i}function $c(){var e=Ox().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=i<r,g=p?i:r,m=p?r:i;a=(m-g)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),g+=(m-g-a*(h-c))*d,o=a*(1-c),l&&(g=Math.round(g),o=Math.round(o));var v=Kq(h).map(function(y){return g+a*y});return n(p?v.reverse():v)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},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 $c(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(d)},pr.apply(f(),arguments)}function QC(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return QC(t())},e}function nc(){return QC($c.apply(null,arguments).paddingInner(1))}function Px(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function JC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Eu(){}var Lc=.7,If=1/Lc,co="\\s*([+-]?\\d+)\\s*",Dc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Vq=/^#([0-9a-f]{3,8})$/,Yq=new RegExp(`^rgb\\(${co},${co},${co}\\)$`),Xq=new RegExp(`^rgb\\(${Vr},${Vr},${Vr}\\)$`),Zq=new RegExp(`^rgba\\(${co},${co},${co},${Dc}\\)$`),Qq=new RegExp(`^rgba\\(${Vr},${Vr},${Vr},${Dc}\\)$`),Jq=new RegExp(`^hsl\\(${Dc},${Vr},${Vr}\\)$`),eK=new RegExp(`^hsla\\(${Dc},${Vr},${Vr},${Dc}\\)$`),HS={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Px(Eu,Bc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:GS,formatHex:GS,formatHex8:tK,formatHsl:nK,formatRgb:qS,toString:qS});function GS(){return this.rgb().formatHex()}function tK(){return this.rgb().formatHex8()}function nK(){return eO(this).formatHsl()}function qS(){return this.rgb().formatRgb()}function Bc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Vq.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?KS(t):n===3?new In(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?sd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?sd(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=Yq.exec(e))?new In(t[1],t[2],t[3],1):(t=Xq.exec(e))?new In(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Zq.exec(e))?sd(t[1],t[2],t[3],t[4]):(t=Qq.exec(e))?sd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Jq.exec(e))?XS(t[1],t[2]/100,t[3]/100,1):(t=eK.exec(e))?XS(t[1],t[2]/100,t[3]/100,t[4]):HS.hasOwnProperty(e)?KS(HS[e]):e==="transparent"?new In(NaN,NaN,NaN,0):null}function KS(e){return new In(e>>16&255,e>>8&255,e&255,1)}function sd(e,t,n,r){return r<=0&&(e=t=n=NaN),new In(e,t,n,r)}function rK(e){return e instanceof Eu||(e=Bc(e)),e?(e=e.rgb(),new In(e.r,e.g,e.b,e.opacity)):new In}function rv(e,t,n,r){return arguments.length===1?rK(e):new In(e,t,n,r??1)}function In(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Px(In,rv,JC(Eu,{brighter(e){return e=e==null?If:Math.pow(If,e),new In(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lc:Math.pow(Lc,e),new In(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new In(Xa(this.r),Xa(this.g),Xa(this.b),$f(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:VS,formatHex:VS,formatHex8:iK,formatRgb:YS,toString:YS}));function VS(){return`#${Wa(this.r)}${Wa(this.g)}${Wa(this.b)}`}function iK(){return`#${Wa(this.r)}${Wa(this.g)}${Wa(this.b)}${Wa((isNaN(this.opacity)?1:this.opacity)*255)}`}function YS(){const e=$f(this.opacity);return`${e===1?"rgb(":"rgba("}${Xa(this.r)}, ${Xa(this.g)}, ${Xa(this.b)}${e===1?")":`, ${e})`}`}function $f(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wa(e){return e=Xa(e),(e<16?"0":"")+e.toString(16)}function XS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _r(e,t,n,r)}function eO(e){if(e instanceof _r)return new _r(e.h,e.s,e.l,e.opacity);if(e instanceof Eu||(e=Bc(e)),!e)return new _r;if(e instanceof _r)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+i:2-a-i,o*=60):l=c>0&&c<1?0:o,new _r(o,l,c,e.opacity)}function aK(e,t,n,r){return arguments.length===1?eO(e):new _r(e,t,n,r??1)}function _r(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Px(_r,aK,JC(Eu,{brighter(e){return e=e==null?If:Math.pow(If,e),new _r(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lc:Math.pow(Lc,e),new _r(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,i=2*n-r;return new In(Rm(e>=240?e-240:e+120,i,r),Rm(e,i,r),Rm(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _r(ZS(this.h),od(this.s),od(this.l),$f(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=$f(this.opacity);return`${e===1?"hsl(":"hsla("}${ZS(this.h)}, ${od(this.s)*100}%, ${od(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZS(e){return e=(e||0)%360,e<0?e+360:e}function od(e){return Math.max(0,Math.min(1,e||0))}function Rm(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 Mx=e=>()=>e;function sK(e,t){return function(n){return e+n*t}}function oK(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 lK(e){return(e=+e)==1?tO:function(t,n){return n-t?oK(t,n,e):Mx(isNaN(t)?n:t)}}function tO(e,t){var n=t-e;return n?sK(e,n):Mx(isNaN(e)?t:e)}const QS=function e(t){var n=lK(t);function r(i,a){var o=n((i=rv(i)).r,(a=rv(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=tO(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function cK(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function uK(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function dK(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=il(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=i[o](l);return a}}function fK(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Lf(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function hK(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=il(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var iv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Im=new RegExp(iv.source,"g");function pK(e){return function(){return e}}function mK(e){return function(t){return e(t)+""}}function gK(e,t){var n=iv.lastIndex=Im.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=iv.exec(e))&&(i=Im.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:Lf(r,i)})),n=Im.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?mK(c[0].x):pK(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 il(e,t){var n=typeof t,r;return t==null||n==="boolean"?Mx(t):(n==="number"?Lf:n==="string"?(r=Bc(t))?(t=r,QS):gK:t instanceof Bc?QS:t instanceof Date?fK:uK(t)?cK:Array.isArray(t)?dK:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?hK:Lf)(e,t)}function Rx(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function yK(e,t){t===void 0&&(t=e,e=il);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function vK(e){return function(){return e}}function Df(e){return+e}var JS=[0,1];function En(e){return e}function av(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:vK(isNaN(t)?NaN:.5)}function bK(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function xK(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=av(i,r),a=n(o,a)):(r=av(r,i),a=n(a,o)),function(l){return a(r(l))}}function wK(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=av(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=ku(e,l,1,r)-1;return a[c](i[c](l))}}function _u(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function mp(){var e=JS,t=JS,n=il,r,i,a,o=En,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==En&&(o=bK(e[0],e[h-1])),l=h>2?wK:xK,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(i((u||(u=l(t,e.map(r),Lf)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Df),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=Rx,d()},f.clamp=function(h){return arguments.length?(o=h?!0:En,d()):o!==En},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return r=h,i=p,d()}}function Ix(){return mp()(En,En)}function SK(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Bf(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 No(e){return e=Bf(Math.abs(e)),e?e[1]:NaN}function kK(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function EK(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var _K=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zc(e){if(!(t=_K.exec(e)))throw new Error("invalid format: "+e);var t;return new $x({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]})}zc.prototype=$x.prototype;function $x(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+""}$x.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 NK(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var zf;function jK(e,t){var n=Bf(e,t);if(!n)return zf=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(zf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Bf(e,Math.max(0,t+a-1))[0]}function ek(e,t){var n=Bf(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const tk={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:SK,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)=>ek(e*100,t),r:ek,s:jK,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function nk(e){return e}var rk=Array.prototype.map,ik=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function AK(e){var t=e.grouping===void 0||e.thousands===void 0?nk:kK(rk.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?nk:EK(rk.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=zc(f);var p=f.fill,g=f.align,m=f.sign,v=f.symbol,y=f.zero,b=f.width,x=f.comma,k=f.precision,S=f.trim,w=f.type;w==="n"?(x=!0,w="g"):tk[w]||(k===void 0&&(k=12),S=!0,w="g"),(y||p==="0"&&g==="=")&&(y=!0,p="0",g="=");var _=(h&&h.prefix!==void 0?h.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),N=(v==="$"?r:/[%p]/.test(w)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),C=tk[w],T=/[defgprs%]/.test(w);k=k===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function I(M){var $=_,R=N,z,D,U;if(w==="c")R=C(M)+R,M="";else{M=+M;var O=M<0||1/M<0;if(M=isNaN(M)?c:C(Math.abs(M),k),S&&(M=NK(M)),O&&+M==0&&m!=="+"&&(O=!1),$=(O?m==="("?m:l:m==="-"||m==="("?"":m)+$,R=(w==="s"&&!isNaN(M)&&zf!==void 0?ik[8+zf/3]:"")+R+(O&&m==="("?")":""),T){for(z=-1,D=M.length;++z<D;)if(U=M.charCodeAt(z),48>U||U>57){R=(U===46?i+M.slice(z+1):M.slice(z))+R,M=M.slice(0,z);break}}}x&&!y&&(M=t(M,1/0));var F=$.length+M.length+R.length,A=F<b?new Array(b-F+1).join(p):"";switch(x&&y&&(M=t(A+M,A.length?b-R.length:1/0),A=""),g){case"<":M=$+M+R+A;break;case"=":M=$+A+M+R;break;case"^":M=A.slice(0,F=A.length>>1)+$+M+R+A.slice(F);break;default:M=A+$+M+R;break}return a(M)}return I.toString=function(){return f+""},I}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(No(h)/3)))*3,g=Math.pow(10,-p),m=u((f=zc(f),f.type="f",f),{suffix:ik[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:d}}var ld,Lx,nO;TK({thousands:",",grouping:[3],currency:["$",""]});function TK(e){return ld=AK(e),Lx=ld.format,nO=ld.formatPrefix,ld}function CK(e){return Math.max(0,-No(Math.abs(e)))}function OK(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(No(t)/3)))*3-No(Math.abs(e)))}function PK(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,No(t)-No(e))+1}function rO(e,t,n,r){var i=tv(e,t,n),a;switch(r=zc(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=OK(i,o))&&(r.precision=a),nO(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=PK(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=CK(i))&&(r.precision=a-(r.type==="%")*2);break}}return Lx(r)}function ba(e){var t=e.domain;return e.ticks=function(n){var r=t();return Jy(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return rO(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],l=r[a],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=i,i=a,a=u);d-- >0;){if(u=ev(o,l,n),u===c)return r[i]=o,r[a]=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 Ff(){var e=Ix();return e.copy=function(){return _u(e,Ff())},pr.apply(e,arguments),ba(e)}function iO(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,Df),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return iO(e).unknown(t)},e=arguments.length?Array.from(e,Df):[0,1],ba(n)}function aO(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function ak(e){return Math.log(e)}function sk(e){return Math.exp(e)}function MK(e){return-Math.log(-e)}function RK(e){return-Math.exp(-e)}function IK(e){return isFinite(e)?+("1e"+e):e<0?0:e}function $K(e){return e===10?IK:e===Math.E?Math.exp:t=>Math.pow(e,t)}function LK(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 ok(e){return(t,n)=>-e(-t,n)}function Dx(e){const t=e(ak,sk),n=t.domain;let r=10,i,a;function o(){return i=LK(r),a=$K(r),n()[0]<0?(i=ok(i),a=ok(a),e(MK,RK)):e(ak,sk),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=i(u),p=i(d),g,m;const v=l==null?10:+l;let y=[];if(!(r%1)&&p-h<v){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/a(-h):g*a(h),!(m<u)){if(m>d)break;y.push(m)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(m=h>0?g/a(-h):g*a(h),!(m<u)){if(m>d)break;y.push(m)}y.length*2<v&&(y=Jy(u,d,v))}else y=Jy(h,p,Math.min(p-h,v)).map(a);return f?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=zc(c)).precision==null&&(c.trim=!0),c=Lx(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(i(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(aO(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function sO(){const e=Dx(mp()).domain([1,10]);return e.copy=()=>_u(e,sO()).base(e.base()),pr.apply(e,arguments),e}function lk(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ck(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Bx(e){var t=1,n=e(lk(t),ck(t));return n.constant=function(r){return arguments.length?e(lk(t=+r),ck(t)):t},ba(n)}function oO(){var e=Bx(mp());return e.copy=function(){return _u(e,oO()).constant(e.constant())},pr.apply(e,arguments)}function uk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function DK(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function BK(e){return e<0?-e*e:e*e}function zx(e){var t=e(En,En),n=1;function r(){return n===1?e(En,En):n===.5?e(DK,BK):e(uk(n),uk(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ba(t)}function Fx(){var e=zx(mp());return e.copy=function(){return _u(e,Fx()).exponent(e.exponent())},pr.apply(e,arguments),e}function zK(){return Fx.apply(null,arguments).exponent(.5)}function dk(e){return Math.sign(e)*e*e}function FK(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function lO(){var e=Ix(),t=[0,1],n=!1,r;function i(a){var o=FK(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(dk(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Df)).map(dk)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return lO(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},pr.apply(i,arguments),ba(i)}function cO(){var e=[],t=[],n=[],r;function i(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=qq(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[ku(n,o)]}return a.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]]},a.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(la),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return cO().domain(e).range(t).unknown(r)},pr.apply(a,arguments)}function uO(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[ku(r,c,0,n)]:a}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=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var u=i.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&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return uO().domain([e,t]).range(i).unknown(a)},pr.apply(ba(o),arguments)}function dO(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[ku(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return dO().domain(e).range(t).unknown(n)},pr.apply(i,arguments)}const $m=new Date,Lm=new Date;function Wt(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o<l-a?o:l},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},i.filter=a=>Wt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>($m.setTime(+a),Lm.setTime(+o),e($m),e(Lm),Math.floor(n($m,Lm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Uf=Wt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Uf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Uf);Uf.range;const ui=1e3,or=ui*60,di=or*60,wi=di*24,Ux=wi*7,fk=wi*30,Dm=wi*365,Ha=Wt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ui)},(e,t)=>(t-e)/ui,e=>e.getUTCSeconds());Ha.range;const Wx=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ui)},(e,t)=>{e.setTime(+e+t*or)},(e,t)=>(t-e)/or,e=>e.getMinutes());Wx.range;const Hx=Wt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*or)},(e,t)=>(t-e)/or,e=>e.getUTCMinutes());Hx.range;const Gx=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ui-e.getMinutes()*or)},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,e=>e.getHours());Gx.range;const qx=Wt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,e=>e.getUTCHours());qx.range;const Nu=Wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*or)/wi,e=>e.getDate()-1);Nu.range;const gp=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wi,e=>e.getUTCDate()-1);gp.range;const fO=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wi,e=>Math.floor(e/wi));fO.range;function ms(e){return Wt(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())*or)/Ux)}const yp=ms(0),Wf=ms(1),UK=ms(2),WK=ms(3),jo=ms(4),HK=ms(5),GK=ms(6);yp.range;Wf.range;UK.range;WK.range;jo.range;HK.range;GK.range;function gs(e){return Wt(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)/Ux)}const vp=gs(0),Hf=gs(1),qK=gs(2),KK=gs(3),Ao=gs(4),VK=gs(5),YK=gs(6);vp.range;Hf.range;qK.range;KK.range;Ao.range;VK.range;YK.range;const Kx=Wt(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());Kx.range;const Vx=Wt(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());Vx.range;const Si=Wt(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());Si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)});Si.range;const ki=Wt(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());ki.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)});ki.range;function hO(e,t,n,r,i,a){const o=[[Ha,1,ui],[Ha,5,5*ui],[Ha,15,15*ui],[Ha,30,30*ui],[a,1,or],[a,5,5*or],[a,15,15*or],[a,30,30*or],[i,1,di],[i,3,3*di],[i,6,6*di],[i,12,12*di],[r,1,wi],[r,2,2*wi],[n,1,Ux],[t,1,fk],[t,3,3*fk],[e,1,Dm]];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=Cx(([,,v])=>v).right(o,h);if(p===o.length)return e.every(tv(u/Dm,d/Dm,f));if(p===0)return Uf.every(Math.max(tv(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[XK,ZK]=hO(ki,Vx,vp,fO,qx,Hx),[QK,JK]=hO(Si,Kx,yp,Nu,Gx,Wx);function Bm(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 zm(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 Cl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function e7(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=Ol(i),d=Pl(i),f=Ol(a),h=Pl(a),p=Ol(o),g=Pl(o),m=Ol(l),v=Pl(l),y=Ol(c),b=Pl(c),x={a:U,A:O,b:F,B:A,c:null,d:vk,e:vk,f:k7,g:M7,G:I7,H:x7,I:w7,j:S7,L:pO,m:E7,M:_7,p:Z,q:L,Q:wk,s:Sk,S:N7,u:j7,U:A7,V:T7,w:C7,W:O7,x:null,X:null,y:P7,Y:R7,Z:$7,"%":xk},k={a:P,A:ce,b:we,B:pe,c:null,d:bk,e:bk,f:z7,g:X7,G:Q7,H:L7,I:D7,j:B7,L:gO,m:F7,M:U7,p:Pe,q:G,Q:wk,s:Sk,S:W7,u:H7,U:G7,V:q7,w:K7,W:V7,x:null,X:null,y:Y7,Y:Z7,Z:J7,"%":xk},S={a:T,A:I,b:M,B:$,c:R,d:gk,e:gk,f:g7,g:mk,G:pk,H:yk,I:yk,j:f7,L:m7,m:d7,M:h7,p:C,q:u7,Q:v7,s:b7,S:p7,u:a7,U:s7,V:o7,w:i7,W:l7,x:z,X:D,y:mk,Y:pk,Z:c7,"%":y7};x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),k.x=w(n,k),k.X=w(r,k),k.c=w(t,k);function w(X,ae){return function(le){var Y=[],_e=-1,Ee=0,je=X.length,ve,$e,fe;for(le instanceof Date||(le=new Date(+le));++_e<je;)X.charCodeAt(_e)===37&&(Y.push(X.slice(Ee,_e)),($e=hk[ve=X.charAt(++_e)])!=null?ve=X.charAt(++_e):$e=ve==="e"?" ":"0",(fe=ae[ve])&&(ve=fe(le,$e)),Y.push(ve),Ee=_e+1);return Y.push(X.slice(Ee,_e)),Y.join("")}}function _(X,ae){return function(le){var Y=Cl(1900,void 0,1),_e=N(Y,X,le+="",0),Ee,je;if(_e!=le.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(ae&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(Ee=zm(Cl(Y.y,0,1)),je=Ee.getUTCDay(),Ee=je>4||je===0?Hf.ceil(Ee):Hf(Ee),Ee=gp.offset(Ee,(Y.V-1)*7),Y.y=Ee.getUTCFullYear(),Y.m=Ee.getUTCMonth(),Y.d=Ee.getUTCDate()+(Y.w+6)%7):(Ee=Bm(Cl(Y.y,0,1)),je=Ee.getDay(),Ee=je>4||je===0?Wf.ceil(Ee):Wf(Ee),Ee=Nu.offset(Ee,(Y.V-1)*7),Y.y=Ee.getFullYear(),Y.m=Ee.getMonth(),Y.d=Ee.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),je="Z"in Y?zm(Cl(Y.y,0,1)).getUTCDay():Bm(Cl(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(je+5)%7:Y.w+Y.U*7-(je+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,zm(Y)):Bm(Y)}}function N(X,ae,le,Y){for(var _e=0,Ee=ae.length,je=le.length,ve,$e;_e<Ee;){if(Y>=je)return-1;if(ve=ae.charCodeAt(_e++),ve===37){if(ve=ae.charAt(_e++),$e=S[ve in hk?ae.charAt(_e++):ve],!$e||(Y=$e(X,le,Y))<0)return-1}else if(ve!=le.charCodeAt(Y++))return-1}return Y}function C(X,ae,le){var Y=u.exec(ae.slice(le));return Y?(X.p=d.get(Y[0].toLowerCase()),le+Y[0].length):-1}function T(X,ae,le){var Y=p.exec(ae.slice(le));return Y?(X.w=g.get(Y[0].toLowerCase()),le+Y[0].length):-1}function I(X,ae,le){var Y=f.exec(ae.slice(le));return Y?(X.w=h.get(Y[0].toLowerCase()),le+Y[0].length):-1}function M(X,ae,le){var Y=y.exec(ae.slice(le));return Y?(X.m=b.get(Y[0].toLowerCase()),le+Y[0].length):-1}function $(X,ae,le){var Y=m.exec(ae.slice(le));return Y?(X.m=v.get(Y[0].toLowerCase()),le+Y[0].length):-1}function R(X,ae,le){return N(X,t,ae,le)}function z(X,ae,le){return N(X,n,ae,le)}function D(X,ae,le){return N(X,r,ae,le)}function U(X){return o[X.getDay()]}function O(X){return a[X.getDay()]}function F(X){return c[X.getMonth()]}function A(X){return l[X.getMonth()]}function Z(X){return i[+(X.getHours()>=12)]}function L(X){return 1+~~(X.getMonth()/3)}function P(X){return o[X.getUTCDay()]}function ce(X){return a[X.getUTCDay()]}function we(X){return c[X.getUTCMonth()]}function pe(X){return l[X.getUTCMonth()]}function Pe(X){return i[+(X.getUTCHours()>=12)]}function G(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var ae=w(X+="",x);return ae.toString=function(){return X},ae},parse:function(X){var ae=_(X+="",!1);return ae.toString=function(){return X},ae},utcFormat:function(X){var ae=w(X+="",k);return ae.toString=function(){return X},ae},utcParse:function(X){var ae=_(X+="",!0);return ae.toString=function(){return X},ae}}}var hk={"-":"",_:" ",0:"0"},Zt=/^\s*\d+/,t7=/^%/,n7=/[\\^$*+?|[\]().{}]/g;function qe(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function r7(e){return e.replace(n7,"\\$&")}function Ol(e){return new RegExp("^(?:"+e.map(r7).join("|")+")","i")}function Pl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function i7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function a7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function s7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function o7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function l7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function pk(e,t,n){var r=Zt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function mk(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function c7(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 u7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function d7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function gk(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function f7(e,t,n){var r=Zt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function yk(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function h7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function p7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function m7(e,t,n){var r=Zt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function g7(e,t,n){var r=Zt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function y7(e,t,n){var r=t7.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function v7(e,t,n){var r=Zt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function b7(e,t,n){var r=Zt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function vk(e,t){return qe(e.getDate(),t,2)}function x7(e,t){return qe(e.getHours(),t,2)}function w7(e,t){return qe(e.getHours()%12||12,t,2)}function S7(e,t){return qe(1+Nu.count(Si(e),e),t,3)}function pO(e,t){return qe(e.getMilliseconds(),t,3)}function k7(e,t){return pO(e,t)+"000"}function E7(e,t){return qe(e.getMonth()+1,t,2)}function _7(e,t){return qe(e.getMinutes(),t,2)}function N7(e,t){return qe(e.getSeconds(),t,2)}function j7(e){var t=e.getDay();return t===0?7:t}function A7(e,t){return qe(yp.count(Si(e)-1,e),t,2)}function mO(e){var t=e.getDay();return t>=4||t===0?jo(e):jo.ceil(e)}function T7(e,t){return e=mO(e),qe(jo.count(Si(e),e)+(Si(e).getDay()===4),t,2)}function C7(e){return e.getDay()}function O7(e,t){return qe(Wf.count(Si(e)-1,e),t,2)}function P7(e,t){return qe(e.getFullYear()%100,t,2)}function M7(e,t){return e=mO(e),qe(e.getFullYear()%100,t,2)}function R7(e,t){return qe(e.getFullYear()%1e4,t,4)}function I7(e,t){var n=e.getDay();return e=n>=4||n===0?jo(e):jo.ceil(e),qe(e.getFullYear()%1e4,t,4)}function $7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+qe(t/60|0,"0",2)+qe(t%60,"0",2)}function bk(e,t){return qe(e.getUTCDate(),t,2)}function L7(e,t){return qe(e.getUTCHours(),t,2)}function D7(e,t){return qe(e.getUTCHours()%12||12,t,2)}function B7(e,t){return qe(1+gp.count(ki(e),e),t,3)}function gO(e,t){return qe(e.getUTCMilliseconds(),t,3)}function z7(e,t){return gO(e,t)+"000"}function F7(e,t){return qe(e.getUTCMonth()+1,t,2)}function U7(e,t){return qe(e.getUTCMinutes(),t,2)}function W7(e,t){return qe(e.getUTCSeconds(),t,2)}function H7(e){var t=e.getUTCDay();return t===0?7:t}function G7(e,t){return qe(vp.count(ki(e)-1,e),t,2)}function yO(e){var t=e.getUTCDay();return t>=4||t===0?Ao(e):Ao.ceil(e)}function q7(e,t){return e=yO(e),qe(Ao.count(ki(e),e)+(ki(e).getUTCDay()===4),t,2)}function K7(e){return e.getUTCDay()}function V7(e,t){return qe(Hf.count(ki(e)-1,e),t,2)}function Y7(e,t){return qe(e.getUTCFullYear()%100,t,2)}function X7(e,t){return e=yO(e),qe(e.getUTCFullYear()%100,t,2)}function Z7(e,t){return qe(e.getUTCFullYear()%1e4,t,4)}function Q7(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ao(e):Ao.ceil(e),qe(e.getUTCFullYear()%1e4,t,4)}function J7(){return"+0000"}function xk(){return"%"}function wk(e){return+e}function Sk(e){return Math.floor(+e/1e3)}var Os,vO,bO;eV({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 eV(e){return Os=e7(e),vO=Os.format,Os.parse,bO=Os.utcFormat,Os.utcParse,Os}function tV(e){return new Date(e)}function nV(e){return e instanceof Date?+e:+new Date(+e)}function Yx(e,t,n,r,i,a,o,l,c,u){var d=Ix(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),v=u("%I %p"),y=u("%a %d"),b=u("%b %d"),x=u("%B"),k=u("%Y");function S(w){return(c(w)<w?p:l(w)<w?g:o(w)<w?m:a(w)<w?v:r(w)<w?i(w)<w?y:b:n(w)<w?x:k)(w)}return d.invert=function(w){return new Date(f(w))},d.domain=function(w){return arguments.length?h(Array.from(w,nV)):h().map(tV)},d.ticks=function(w){var _=h();return e(_[0],_[_.length-1],w??10)},d.tickFormat=function(w,_){return _==null?S:u(_)},d.nice=function(w){var _=h();return(!w||typeof w.range!="function")&&(w=t(_[0],_[_.length-1],w??10)),w?h(aO(_,w)):d},d.copy=function(){return _u(d,Yx(e,t,n,r,i,a,o,l,c,u))},d}function rV(){return pr.apply(Yx(QK,JK,Si,Kx,yp,Nu,Gx,Wx,Ha,vO).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function iV(){return pr.apply(Yx(XK,ZK,ki,Vx,vp,gp,qx,Hx,Ha,bO).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function bp(){var e=0,t=1,n,r,i,a,o=En,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(i===0?.5:(f=(a(f)-n)*i,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),i=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(il),u.rangeRound=d(Rx),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),u}}function xa(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function xO(){var e=ba(bp()(En));return e.copy=function(){return xa(e,xO())},Ai.apply(e,arguments)}function wO(){var e=Dx(bp()).domain([1,10]);return e.copy=function(){return xa(e,wO()).base(e.base())},Ai.apply(e,arguments)}function SO(){var e=Bx(bp());return e.copy=function(){return xa(e,SO()).constant(e.constant())},Ai.apply(e,arguments)}function Xx(){var e=zx(bp());return e.copy=function(){return xa(e,Xx()).exponent(e.exponent())},Ai.apply(e,arguments)}function aV(){return Xx.apply(null,arguments).exponent(.5)}function kO(){var e=[],t=En;function n(r){if(r!=null&&!isNaN(r=+r))return t((ku(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(la),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>Gq(e,a/r))},n.copy=function(){return kO(t).domain(e)},Ai.apply(n,arguments)}function xp(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,u=En,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-a)*(r*m<r*a?l:c),u(f?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,n]=m,i=d(e=+e),a=d(t=+t),o=d(n=+n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-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(v){var y,b,x;return arguments.length?([y,b,x]=v,u=yK(m,[y,b,x]),p):[u(0),u(.5),u(1)]}}return p.range=g(il),p.rangeRound=g(Rx),p.unknown=function(m){return arguments.length?(h=m,p):h},function(m){return d=m,i=m(e),a=m(t),o=m(n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function EO(){var e=ba(xp()(En));return e.copy=function(){return xa(e,EO())},Ai.apply(e,arguments)}function _O(){var e=Dx(xp()).domain([.1,1,10]);return e.copy=function(){return xa(e,_O()).base(e.base())},Ai.apply(e,arguments)}function NO(){var e=Bx(xp());return e.copy=function(){return xa(e,NO()).constant(e.constant())},Ai.apply(e,arguments)}function Zx(){var e=zx(xp());return e.copy=function(){return xa(e,Zx()).exponent(e.exponent())},Ai.apply(e,arguments)}function sV(){return Zx.apply(null,arguments).exponent(.5)}const kk=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:$c,scaleDiverging:EO,scaleDivergingLog:_O,scaleDivergingPow:Zx,scaleDivergingSqrt:sV,scaleDivergingSymlog:NO,scaleIdentity:iO,scaleImplicit:nv,scaleLinear:Ff,scaleLog:sO,scaleOrdinal:Ox,scalePoint:nc,scalePow:Fx,scaleQuantile:cO,scaleQuantize:uO,scaleRadial:lO,scaleSequential:xO,scaleSequentialLog:wO,scaleSequentialPow:Xx,scaleSequentialQuantile:kO,scaleSequentialSqrt:aV,scaleSequentialSymlog:SO,scaleSqrt:zK,scaleSymlog:oO,scaleThreshold:dO,scaleTime:rV,scaleUtc:iV,tickFormat:rO},Symbol.toStringTag,{value:"Module"}));var oV=Xo;function lV(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(l===void 0?o===o&&!oV(o):n(o,l)))var l=o,c=a}return c}var jO=lV;function cV(e,t){return e>t}var uV=cV,dV=jO,fV=uV,hV=rl;function pV(e){return e&&e.length?dV(e,hV,fV):void 0}var mV=pV;const wp=Ze(mV);function gV(e,t){return e<t}var yV=gV,vV=jO,bV=yV,xV=rl;function wV(e){return e&&e.length?vV(e,xV,bV):void 0}var SV=wV;const Sp=Ze(SV);var kV=dx,EV=va,_V=LC,NV=Bn;function jV(e,t){var n=NV(e)?kV:_V;return n(e,EV(t))}var AV=jV,TV=IC,CV=AV;function OV(e,t){return TV(CV(e,t),1)}var PV=OV;const MV=Ze(PV);var RV=Nx;function IV(e,t){return RV(e,t)}var $V=IV;const Qx=Ze($V);var al=1e9,LV={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},e0,xt=!0,fr="[DecimalError] ",Za=fr+"Invalid argument: ",Jx=fr+"Exponent out of range: ",sl=Math.floor,Ra=Math.pow,DV=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,qn,Kt=1e7,gt=7,AO=9007199254740991,Gf=sl(AO/gt),ye={};ye.absoluteValue=ye.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ye.comparedTo=ye.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};ye.decimalPlaces=ye.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*gt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ye.dividedBy=ye.div=function(e){return gi(this,new this.constructor(e))};ye.dividedToIntegerBy=ye.idiv=function(e){var t=this,n=t.constructor;return ot(gi(t,new n(e),0,1),n.precision)};ye.equals=ye.eq=function(e){return!this.cmp(e)};ye.exponent=function(){return It(this)};ye.greaterThan=ye.gt=function(e){return this.cmp(e)>0};ye.greaterThanOrEqualTo=ye.gte=function(e){return this.cmp(e)>=0};ye.isInteger=ye.isint=function(){return this.e>this.d.length-2};ye.isNegative=ye.isneg=function(){return this.s<0};ye.isPositive=ye.ispos=function(){return this.s>0};ye.isZero=function(){return this.s===0};ye.lessThan=ye.lt=function(e){return this.cmp(e)<0};ye.lessThanOrEqualTo=ye.lte=function(e){return this.cmp(e)<1};ye.logarithm=ye.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(qn))throw Error(fr+"NaN");if(n.s<1)throw Error(fr+(n.s?"NaN":"-Infinity"));return n.eq(qn)?new r(0):(xt=!1,t=gi(Fc(n,a),Fc(e,a),a),xt=!0,ot(t,i))};ye.minus=ye.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?OO(t,e):TO(t,(e.s=-e.s,e))};ye.modulo=ye.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(fr+"NaN");return n.s?(xt=!1,t=gi(n,e,0,1).times(e),xt=!0,n.minus(t)):ot(new r(n),i)};ye.naturalExponential=ye.exp=function(){return CO(this)};ye.naturalLogarithm=ye.ln=function(){return Fc(this)};ye.negated=ye.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ye.plus=ye.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?TO(t,e):OO(t,(e.s=-e.s,e))};ye.precision=ye.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Za+e);if(t=It(i)+1,r=i.d.length-1,n=r*gt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ye.squareRoot=ye.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(fr+"NaN")}for(e=It(l),xt=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Gr(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=sl((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(a=r,r=a.plus(gi(l,a,o+2)).times(.5),Gr(a.d).slice(0,o)===(t=Gr(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ot(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return xt=!0,ot(r,n)};ye.times=ye.mul=function(e){var t,n,r,i,a,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&&(a=h,h=p,p=a,o=c,c=u,u=o),a=[],o=c+u,r=o;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+p[r]*h[i-r-1]+t,a[i--]=l%Kt|0,t=l/Kt|0;a[i]=(a[i]+t)%Kt|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,xt?ot(e,f.precision):e};ye.toDecimalPlaces=ye.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Xr(e,0,al),t===void 0?t=r.rounding:Xr(t,0,8),ot(n,e+It(n)+1,t))};ye.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ls(r,!0):(Xr(e,0,al),t===void 0?t=i.rounding:Xr(t,0,8),r=ot(new i(r),e+1,t),n=ls(r,!0,e+1)),n};ye.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?ls(i):(Xr(e,0,al),t===void 0?t=a.rounding:Xr(t,0,8),r=ot(new a(i),e+It(i)+1,t),n=ls(r.abs(),!1,e+It(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ye.toInteger=ye.toint=function(){var e=this,t=e.constructor;return ot(new t(e),It(e)+1,t.rounding)};ye.toNumber=function(){return+this};ye.toPower=ye.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(qn);if(l=new c(l),!l.s){if(e.s<1)throw Error(fr+"Infinity");return l}if(l.eq(qn))return l;if(r=c.precision,e.eq(qn))return ot(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=AO){for(i=new c(qn),t=Math.ceil(r/gt+4),xt=!1;n%2&&(i=i.times(l),_k(i.d,t)),n=sl(n/2),n!==0;)l=l.times(l),_k(l.d,t);return xt=!0,e.s<0?new c(qn).div(i):ot(i,r)}}else if(a<0)throw Error(fr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,xt=!1,i=e.times(Fc(l,r+u)),xt=!0,i=CO(i),i.s=a,i};ye.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=It(i),r=ls(i,n<=a.toExpNeg||n>=a.toExpPos)):(Xr(e,1,al),t===void 0?t=a.rounding:Xr(t,0,8),i=ot(new a(i),e,t),n=It(i),r=ls(i,e<=n||n<=a.toExpNeg,e)),r};ye.toSignificantDigits=ye.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Xr(e,1,al),t===void 0?t=r.rounding:Xr(t,0,8)),ot(new r(n),e,t)};ye.toString=ye.valueOf=ye.val=ye.toJSON=ye[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=It(e),n=e.constructor;return ls(e,t<=n.toExpNeg||t>=n.toExpPos)};function TO(e,t){var n,r,i,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),xt?ot(t,f):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,i=o,l=c.length),o=Math.ceil(f/gt),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Kt|0,c[a]%=Kt;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,xt?ot(t,f):t}function Xr(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Za+e)}function Gr(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=gt-r.length,n&&(a+=Ui(n)),a+=r;o=e[t],r=o+"",n=gt-r.length,n&&(a+=Ui(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var gi=function(){function e(r,i){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+o,r[l]=a%Kt|0,o=a/Kt|0;return o&&r.unshift(o),r}function t(r,i,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*Kt+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,c,u,d,f,h,p,g,m,v,y,b,x,k,S,w,_,N,C=r.constructor,T=r.s==i.s?1:-1,I=r.d,M=i.d;if(!r.s)return new C(r);if(!i.s)throw Error(fr+"Division by zero");for(c=r.e-i.e,_=M.length,S=I.length,p=new C(T),g=p.d=[],u=0;M[u]==(I[u]||0);)++u;if(M[u]>(I[u]||0)&&--c,a==null?b=a=C.precision:o?b=a+(It(r)-It(i))+1:b=a,b<0)return new C(0);if(b=b/gt+2|0,u=0,_==1)for(d=0,M=M[0],b++;(u<S||d)&&b--;u++)x=d*Kt+(I[u]||0),g[u]=x/M|0,d=x%M|0;else{for(d=Kt/(M[0]+1)|0,d>1&&(M=e(M,d),I=e(I,d),_=M.length,S=I.length),k=_,m=I.slice(0,_),v=m.length;v<_;)m[v++]=0;N=M.slice(),N.unshift(0),w=M[0],M[1]>=Kt/2&&++w;do d=0,l=t(M,m,_,v),l<0?(y=m[0],_!=v&&(y=y*Kt+(m[1]||0)),d=y/w|0,d>1?(d>=Kt&&(d=Kt-1),f=e(M,d),h=f.length,v=m.length,l=t(f,m,h,v),l==1&&(d--,n(f,_<h?N:M,h))):(d==0&&(l=d=1),f=M.slice()),h=f.length,h<v&&f.unshift(0),n(m,f,v),l==-1&&(v=m.length,l=t(M,m,_,v),l<1&&(d++,n(m,_<v?N:M,v))),v=m.length):l===0&&(d++,m=[0]),g[u++]=d,l&&m[0]?m[v++]=I[k]||0:(m=[I[k]],v=1);while((k++<S||m[0]!==void 0)&&b--)}return g[0]||g.shift(),p.e=c,ot(p,o?a+It(p)+1:a)}}();function CO(e,t){var n,r,i,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(It(e)>16)throw Error(Jx+It(e));if(!e.s)return new d(qn);for(xt=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Ra(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(qn),d.precision=l;;){if(i=ot(i.times(e),l),n=n.times(++c),o=a.plus(gi(i,n,l)),Gr(o.d).slice(0,l)===Gr(a.d).slice(0,l)){for(;u--;)a=ot(a.times(a),l);return d.precision=f,t==null?(xt=!0,ot(a,f)):a}a=o}}function It(e){for(var t=e.e*gt,n=e.d[0];n>=10;n/=10)t++;return t}function Fm(e,t,n){if(t>e.LN10.sd())throw xt=!0,n&&(e.precision=n),Error(fr+"LN10 precision limit exceeded");return ot(new e(e.LN10),t)}function Ui(e){for(var t="";e--;)t+="0";return t}function Fc(e,t){var n,r,i,a,o,l,c,u,d,f=1,h=10,p=e,g=p.d,m=p.constructor,v=m.precision;if(p.s<1)throw Error(fr+(p.s?"NaN":"-Infinity"));if(p.eq(qn))return new m(0);if(t==null?(xt=!1,u=v):u=t,p.eq(10))return t==null&&(xt=!0),Fm(m,u);if(u+=h,m.precision=u,n=Gr(g),r=n.charAt(0),a=It(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=Gr(p.d),r=n.charAt(0),f++;a=It(p),r>1?(p=new m("0."+n),a++):p=new m(r+"."+n.slice(1))}else return c=Fm(m,u+2,v).times(a+""),p=Fc(new m(r+"."+n.slice(1)),u-h).plus(c),m.precision=v,t==null?(xt=!0,ot(p,v)):p;for(l=o=p=gi(p.minus(qn),p.plus(qn),u),d=ot(p.times(p),u),i=3;;){if(o=ot(o.times(d),u),c=l.plus(gi(o,new m(i),u)),Gr(c.d).slice(0,u)===Gr(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(Fm(m,u+2,v).times(a+""))),l=gi(l,new m(f),u),m.precision=v,t==null?(xt=!0,ot(l,v)):l;l=c,i+=2}}function Ek(e,t){var n,r,i;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(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=sl(n/gt),e.d=[],r=(n+1)%gt,n<0&&(r+=gt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=gt;r<i;)e.d.push(+t.slice(r,r+=gt));t=t.slice(r),r=gt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),xt&&(e.e>Gf||e.e<-Gf))throw Error(Jx+n)}else e.s=0,e.e=0,e.d=[0];return e}function ot(e,t,n){var r,i,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=gt,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/gt),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=gt,i=r-gt+o}if(n!==void 0&&(a=Ra(10,o-i-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?u/Ra(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=It(e),f.length=1,t=t-a-1,f[0]=Ra(10,(gt-t%gt)%gt),e.e=sl(-t/gt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=Ra(10,gt-r),f[d]=i>0?(u/Ra(10,o-i)%Ra(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Kt&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Kt)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(xt&&(e.e>Gf||e.e<-Gf))throw Error(Jx+It(e));return e}function OO(e,t){var n,r,i,a,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),xt?ot(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),i=Math.max(Math.ceil(p/gt),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,d=i<l,d&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>o;){if(c[--i]<f[i]){for(a=i;a&&c[--a]===0;)c[a]=Kt-1;--c[a],c[i]+=Kt}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,xt?ot(t,p):t):new h(0)}function ls(e,t,n){var r,i=It(e),a=Gr(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ui(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ui(-i-1)+a,n&&(r=n-o)>0&&(a+=Ui(r))):i>=o?(a+=Ui(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Ui(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Ui(r))),e.s<0?"-"+a:a}function _k(e,t){if(e.length>t)return e.length=t,!0}function PO(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Za+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Ek(o,a.toString())}else if(typeof a!="string")throw Error(Za+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,DV.test(a))Ek(o,a);else throw Error(Za+a)}if(i.prototype=ye,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=PO,i.config=i.set=BV,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 i.config(e),i}function BV(e){if(!e||typeof e!="object")throw Error(fr+"Object expected");var t,n,r,i=["precision",1,al,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(sl(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Za+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Za+n+": "+r);return this}var e0=PO(LV);qn=new e0(1);const rt=e0;function zV(e){return HV(e)||WV(e)||UV(e)||FV()}function FV(){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 UV(e,t){if(e){if(typeof e=="string")return sv(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 sv(e,t)}}function WV(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function HV(e){if(Array.isArray(e))return sv(e)}function sv(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 GV=function(t){return t},MO={},RO=function(t){return t===MO},Nk=function(t){return function n(){return arguments.length===0||arguments.length===1&&RO(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},qV=function e(t,n){return t===1?n:Nk(function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i.filter(function(l){return l!==MO}).length;return o>=t?n.apply(void 0,i):e(t-o,Nk(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=i.map(function(f){return RO(f)?c.shift():f});return n.apply(void 0,zV(d).concat(c))}))})},kp=function(t){return qV(t.length,t)},ov=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},KV=kp(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),VV=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return GV;var i=n.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},lv=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},IO=function(t){var n=null,r=null;return function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n&&a.every(function(l,c){return l===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function YV(e){var t;return e===0?t=1:t=Math.floor(new rt(e).abs().log(10).toNumber())+1,t}function XV(e,t,n){for(var r=new rt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var ZV=kp(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),QV=kp(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),JV=kp(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Ep={rangeStep:XV,getDigitCount:YV,interpolateNumber:ZV,uninterpolateNumber:QV,uninterpolateTruncation:JV};function cv(e){return nY(e)||tY(e)||$O(e)||eY()}function eY(){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 tY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function nY(e){if(Array.isArray(e))return uv(e)}function Uc(e,t){return aY(e)||iY(e,t)||$O(e,t)||rY()}function rY(){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 $O(e,t){if(e){if(typeof e=="string")return uv(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 uv(e,t)}}function uv(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 iY(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=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){i=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function aY(e){if(Array.isArray(e))return e}function LO(e){var t=Uc(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function DO(e,t,n){if(e.lte(0))return new rt(0);var r=Ep.getDigitCount(e.toNumber()),i=new rt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new rt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?c:new rt(Math.ceil(c))}function sY(e,t,n){var r=1,i=new rt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new rt(10).pow(Ep.getDigitCount(e)-1),i=new rt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new rt(Math.floor(e)))}else e===0?i=new rt(Math.floor((t-1)/2)):n||(i=new rt(Math.floor(e)));var o=Math.floor((t-1)/2),l=VV(KV(function(c){return i.add(new rt(c-o).mul(r)).toNumber()}),ov);return l(0,t)}function BO(e,t,n,r){var i=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 a=DO(new rt(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new rt(0):(o=new rt(e).add(t).div(2),o=o.sub(new rt(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new rt(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?BO(e,t,n,r,i+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new rt(l).mul(a)),tickMax:o.add(new rt(c).mul(a))})}function oY(e){var t=Uc(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),l=LO([n,r]),c=Uc(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(cv(ov(0,i-1).map(function(){return 1/0}))):[].concat(cv(ov(0,i-1).map(function(){return-1/0})),[d]);return n>r?lv(f):f}if(u===d)return sY(u,i,a);var h=BO(u,d,o,a),p=h.step,g=h.tickMin,m=h.tickMax,v=Ep.rangeStep(g,m.add(new rt(.1).mul(p)),p);return n>r?lv(v):v}function lY(e,t){var n=Uc(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=LO([r,i]),l=Uc(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,i];if(c===u)return[c];var d=Math.max(t,2),f=DO(new rt(u).sub(c).div(d-1),a,0),h=[].concat(cv(Ep.rangeStep(new rt(c),new rt(u).sub(new rt(.99).mul(f)),f)),[u]);return r>i?lv(h):h}var cY=IO(oY),uY=IO(lY),dY="Invariant failed";function cs(e,t){throw new Error(dY)}var fY=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function To(e){"@babel/helpers - typeof";return To=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},To(e)}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)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qf.apply(this,arguments)}function hY(e,t){return yY(e)||gY(e,t)||mY(e,t)||pY()}function pY(){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 mY(e,t){if(e){if(typeof e=="string")return jk(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 jk(e,t)}}function jk(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 gY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function yY(e){if(Array.isArray(e))return e}function vY(e,t){if(e==null)return{};var n=bY(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bY(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 xY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wY(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,UO(r.key),r)}}function SY(e,t,n){return t&&wY(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function kY(e,t,n){return t=Kf(t),EY(e,zO()?Reflect.construct(t,n||[],Kf(e).constructor):t.apply(e,n))}function EY(e,t){if(t&&(To(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _Y(e)}function _Y(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zO=function(){return!!e})()}function Kf(e){return Kf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Kf(e)}function NY(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&&dv(e,t)}function dv(e,t){return dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dv(e,t)}function FO(e,t,n){return t=UO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UO(e){var t=jY(e,"string");return To(t)=="symbol"?t:t+""}function jY(e,t){if(To(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(To(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var _p=function(e){function t(){return xY(this,t),kY(this,t,arguments)}return NY(t,e),SY(t,[{key:"render",value:function(){var r=this.props,i=r.offset,a=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,h=vY(r,fY),p=Ke(h,!1);this.props.direction==="x"&&d.type!=="number"&&cs();var g=c.map(function(m){var v=u(m,l),y=v.x,b=v.y,x=v.value,k=v.errorVal;if(!k)return null;var S=[],w,_;if(Array.isArray(k)){var N=hY(k,2);w=N[0],_=N[1]}else w=_=k;if(a==="vertical"){var C=d.scale,T=b+i,I=T+o,M=T-o,$=C(x-w),R=C(x+_);S.push({x1:R,y1:I,x2:R,y2:M}),S.push({x1:$,y1:T,x2:R,y2:T}),S.push({x1:$,y1:I,x2:$,y2:M})}else if(a==="horizontal"){var z=f.scale,D=y+i,U=D-o,O=D+o,F=z(x-w),A=z(x+_);S.push({x1:U,y1:A,x2:O,y2:A}),S.push({x1:D,y1:F,x2:D,y2:A}),S.push({x1:U,y1:F,x2:O,y2:F})}return H.createElement(Yt,qf({className:"recharts-errorBar",key:"bar-".concat(S.map(function(Z){return"".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))},p),S.map(function(Z){return H.createElement("line",qf({},Z,{key:"line-".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))}))});return H.createElement(Yt,{className:"recharts-errorBars"},g)}}])}(H.Component);FO(_p,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});FO(_p,"displayName","ErrorBar");function Wc(e){"@babel/helpers - typeof";return Wc=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},Wc(e)}function Ak(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Na(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ak(Object(n),!0).forEach(function(r){AY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ak(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AY(e,t,n){return t=TY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TY(e){var t=CY(e,"string");return Wc(t)=="symbol"?t:t+""}function CY(e,t){if(Wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WO=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,o=Gn(n,Ya);if(!o)return null;var l=Ya.defaultProps,c=l!==void 0?Na(Na({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:a==="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?Na(Na({},h),f.props):{},g=p.dataKey,m=p.name,v=p.legendType,y=p.hide;return{inactive:y,dataKey:g,type:c.iconType||v||"square",color:t0(f),value:m||g,payload:p}}),Na(Na(Na({},c),Ya.getWithHeight(o,i)),{},{payload:u,item:o})};function Hc(e){"@babel/helpers - typeof";return Hc=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},Hc(e)}function Tk(e){return RY(e)||MY(e)||PY(e)||OY()}function OY(){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 PY(e,t){if(e){if(typeof e=="string")return fv(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 fv(e,t)}}function MY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RY(e){if(Array.isArray(e))return fv(e)}function fv(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=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ck(Object(n),!0).forEach(function(r){uo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ck(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uo(e,t,n){return t=IY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IY(e){var t=$Y(e,"string");return Hc(t)=="symbol"?t:t+""}function $Y(e,t){if(Hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zr(e,t,n){return Ye(e)||Ye(t)?n:Ut(t)?cr(e,t,n):De(t)?t(e):n}function rc(e,t,n,r){var i=MV(e,function(l){return Zr(l,t)});if(n==="number"){var a=i.filter(function(l){return ue(l)||parseFloat(l)});return a.length?[Sp(a),wp(a)]:[1/0,-1/0]}var o=r?i.filter(function(l){return!Ye(l)}):i;return o.map(function(l){return Ut(l)||l instanceof Date?l:""})}var LY=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=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(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<l;u++){var d=u>0?i[u-1].coordinate:i[l-1].coordinate,f=i[u].coordinate,h=u>=l-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(Nr(f-d)!==Nr(h-f)){var g=[];if(Nr(h-f)===Nr(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 v=h+c[1]-c[0];g[0]=Math.min(f,(v+f)/2),g[1]=Math.max(f,(v+f)/2)}var y=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>y[0]&&t<=y[1]||t>=g[0]&&t<=g[1]){o=i[u].index;break}}else{var b=Math.min(d,h),x=Math.max(d,h);if(t>(b+f)/2&&t<=(x+f)/2){o=i[u].index;break}}}else for(var k=0;k<l;k++)if(k===0&&t<=(r[k].coordinate+r[k+1].coordinate)/2||k>0&&k<l-1&&t>(r[k].coordinate+r[k-1].coordinate)/2&&t<=(r[k].coordinate+r[k+1].coordinate)/2||k===l-1&&t>(r[k].coordinate+r[k-1].coordinate)/2){o=r[k].index;break}return o},t0=function(t){var n,r=t,i=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},DY=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var g=d[f[h]],m=g.items,v=g.cateAxisId,y=m.filter(function(_){return pi(_.type).indexOf("Bar")>=0});if(y&&y.length){var b=y[0].type.defaultProps,x=b!==void 0?At(At({},b),y[0].props):y[0].props,k=x.barSize,S=x[v];o[S]||(o[S]=[]);var w=Ye(k)?n:k;o[S].push({item:y[0],stackList:y.slice(1),barSize:Ye(w)?void 0:os(w,r,0)})}}return o},BY=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=os(n,i,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/c,g=o.reduce(function(k,S){return k+S.barSize||0},0);g+=(c-1)*u,g>=i&&(g-=(c-1)*u,u=0),g>=i&&p>0&&(h=!0,p*=.9,g=c*p);var m=(i-g)/2>>0,v={offset:m-u,size:0};d=o.reduce(function(k,S){var w={item:S.item,position:{offset:v.offset+v.size+u,size:h?p:S.barSize}},_=[].concat(Tk(k),[w]);return v=_[_.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(N){_.push({item:N,position:v})}),_},f)}else{var y=os(r,i,0,!0);i-2*y-(c-1)*u<=0&&(u=0);var b=(i-2*y-(c-1)*u)/c;b>1&&(b>>=0);var x=l===+l?Math.min(b,l):b;d=o.reduce(function(k,S,w){var _=[].concat(Tk(k),[{item:S.item,position:{offset:y+(b+u)*w+(b-x)/2,size:x}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(N){_.push({item:N,position:_[_.length-1].position})}),_},f)}return d},zY=function(t,n,r,i){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=WO({children:a,legendWidth:c});if(u){var d=i||{},f=d.width,h=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&ue(t[p]))return At(At({},t),{},uo({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&ue(t[g]))return At(At({},t),{},uo({},g,t[g]+(h||0)))}return t},FY=function(t,n,r){return Ye(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},HO=function(t,n,r,i,a){var o=n.props.children,l=Tr(o,_p).filter(function(u){return FY(i,a,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=Zr(d,r);if(Ye(f))return u;var h=Array.isArray(f)?[Sp(f),wp(f)]:[f,f],p=c.reduce(function(g,m){var v=Zr(d,m,0),y=h[0]-Math.abs(Array.isArray(v)?v[0]:v),b=h[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(y,g[0]),Math.max(b,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},UY=function(t,n,r,i,a){var o=n.map(function(l){return HO(t,l,r,a,i)}).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},GO=function(t,n,r,i,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&HO(t,c,u,i)||rc(t,u,r,a)});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},[])},qO=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},KO=function(t,n,r,i){if(i)return t.map(function(c){return c.coordinate});var a,o,l=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(o=!0),c.coordinate});return a||l.push(n),o||l.push(r),l},fi=function(t,n,r){if(!t)return null;var i=t.scale,a=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&o==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Nr(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return d.filter(function(f){return!xu(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:a?a[f]:f,index:h,offset:u}})},Um=new WeakMap,cd=function(t,n){if(typeof n!="function")return t;Um.has(t)||Um.set(t,new WeakMap);var r=Um.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},WY=function(t,n,r){var i=t.scale,a=t.type,o=t.layout,l=t.axisType;if(i==="auto")return o==="radial"&&l==="radiusAxis"?{scale:$c(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:Ff(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:nc(),realScaleType:"point"}:a==="category"?{scale:$c(),realScaleType:"band"}:{scale:Ff(),realScaleType:"linear"};if(ss(i)){var c="scale".concat(lp(i));return{scale:(kk[c]||nc)(),realScaleType:kk[c]?c:"point"}}return De(i)?{scale:i}:{scale:nc(),realScaleType:"point"}},Ok=1e-4,HY=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),a=Math.min(i[0],i[1])-Ok,o=Math.max(i[0],i[1])+Ok,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},GY=function(t,n){if(!t)return null;for(var r=0,i=t.length;r<i;r++)if(t[r].item===n)return t[r].position;return null},qY=function(t,n){if(!n||n.length!==2||!ue(n[0])||!ue(n[1]))return t;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!ue(t[0])||t[0]<r)&&(a[0]=r),(!ue(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},KY=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,o=0,l=0;l<n;++l){var c=xu(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},VY=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,o=0;o<n;++o){var l=xu(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},YY={sign:KY,expand:u6,none:wo,silhouette:d6,wiggle:f6,positive:VY},XY=function(t,n,r){var i=n.map(function(l){return l.props.dataKey}),a=YY[r],o=c6().keys(i).value(function(l,c){return+Zr(l,c,0)}).order(Ly).offset(a);return o(t)},ZY=function(t,n,r,i,a,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?At(At({},h.type.defaultProps),h.props):h.props,m=g.stackId,v=g.hide;if(v)return f;var y=g[r],b=f[y]||{hasStack:!1,stackGroups:{}};if(Ut(m)){var x=b.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};x.items.push(h),b.hasStack=!0,b.stackGroups[m]=x}else b.stackGroups[op("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return At(At({},f),{},uo({},y,b))},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,v){var y=p.stackGroups[v];return At(At({},m),{},uo({},v,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:XY(t,y.items,a)}))},g)}return At(At({},f),{},uo({},h,p))},d)},QY=function(t,n){var r=n.realScaleType,i=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=cY(u,a,l);return t.domain([Sp(d),wp(d)]),{niceTicks:d}}if(a&&i==="number"){var f=t.domain(),h=uY(f,a,l);return{niceTicks:h}}return null},Pk=function(t){var n=t.axis,r=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+i:null;var c=Zr(o,n.dataKey,n.domain[l]);return Ye(c)?null:n.scale(c)-a/2+i},JY=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return i<=0&&a>=0?0:a<0?a:i}return r[0]},eX=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Ut(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},tX=function(t){return t.reduce(function(n,r){return[Sp(r.concat([n[0]]).filter(ue)),wp(r.concat([n[1]]).filter(ue))]},[1/0,-1/0])},VO=function(t,n,r){return Object.keys(t).reduce(function(i,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var f=tX(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],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},Mk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Rk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,hv=function(t,n,r){if(De(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(ue(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(Mk.test(t[0])){var a=+Mk.exec(t[0])[1];i[0]=n[0]-a}else De(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(ue(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(Rk.test(t[1])){var o=+Rk.exec(t[1])[1];i[1]=n[1]+o}else De(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},Vf=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var a=Ax(n,function(f){return f.coordinate}),o=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},Ik=function(t,n,r){return!t||!t.length||Qx(t,cr(r,"type.defaultProps.domain"))?n:t},YO=function(t,n){var r=t.type.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,i=r.dataKey,a=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return At(At({},Ke(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:a||i,color:t0(t),value:Zr(n,i),type:c,payload:n,chartType:u,hide:d})};function Gc(e){"@babel/helpers - typeof";return Gc=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},Gc(e)}function $k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$k(Object(n),!0).forEach(function(r){nX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$k(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nX(e,t,n){return t=rX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rX(e){var t=iX(e,"string");return Gc(t)=="symbol"?t:t+""}function iX(e,t){if(Gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yf=Math.PI/180,aX=function(t){return t*180/Math.PI},rn=function(t,n,r,i){return{x:t+Math.cos(-Yf*i)*r,y:n+Math.sin(-Yf*i)*r}},sX=function(t,n){var r=t.x,i=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-o,2))},oX=function(t,n){var r=t.x,i=t.y,a=n.cx,o=n.cy,l=sX({x:r,y:i},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return i>o&&(u=2*Math.PI-u),{radius:l,angle:aX(u),angleInRadian:u}},lX=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return{startAngle:n-o*360,endAngle:r-o*360}},cX=function(t,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),o=Math.floor(i/360),l=Math.min(a,o);return t+l*360},Dk=function(t,n){var r=t.x,i=t.y,a=oX({x:r,y:i},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=lX(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?Lk(Lk({},n),{},{radius:o,angle:cX(p,n)}):null};function qc(e){"@babel/helpers - typeof";return qc=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},qc(e)}var uX=["offset"];function dX(e){return mX(e)||pX(e)||hX(e)||fX()}function fX(){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 hX(e,t){if(e){if(typeof e=="string")return pv(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 pv(e,t)}}function pX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mX(e){if(Array.isArray(e))return pv(e)}function pv(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 gX(e,t){if(e==null)return{};var n=yX(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yX(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 Bk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bk(Object(n),!0).forEach(function(r){vX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vX(e,t,n){return t=bX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bX(e){var t=xX(e,"string");return qc(t)=="symbol"?t:t+""}function xX(e,t){if(qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kc(){return Kc=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},Kc.apply(this,arguments)}var wX=function(t){var n=t.value,r=t.formatter,i=Ye(t.children)?n:t.children;return De(r)?r(i):i},SX=function(t,n){var r=Nr(n-t),i=Math.min(Math.abs(n-t),360);return r*i},kX=function(t,n,r){var i=t.position,a=t.viewBox,o=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,g=c.endAngle,m=c.clockWise,v=(f+h)/2,y=SX(p,g),b=y>=0?1:-1,x,k;i==="insideStart"?(x=p+b*o,k=m):i==="insideEnd"?(x=g-b*o,k=!m):i==="end"&&(x=g+b*o,k=m),k=y<=0?k:!k;var S=rn(u,d,v,x),w=rn(u,d,v,x+(k?1:-1)*359),_="M".concat(S.x,",").concat(S.y,`
93
+ A`).concat(v,",").concat(v,",0,1,").concat(k?0:1,`,
94
+ `).concat(w.x,",").concat(w.y),N=Ye(t.id)?op("recharts-radial-line-"):t.id;return H.createElement("text",Kc({},r,{dominantBaseline:"central",className:Ve("recharts-radial-bar-label",l)}),H.createElement("defs",null,H.createElement("path",{id:N,d:_})),H.createElement("textPath",{xlinkHref:"#".concat(N)},n))},EX=function(t){var n=t.viewBox,r=t.offset,i=t.position,a=n,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,h=(d+f)/2;if(i==="outside"){var p=rn(o,l,u+r,h),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var v=(c+u)/2,y=rn(o,l,v,h),b=y.x,x=y.y;return{x:b,y:x,textAnchor:"middle",verticalAnchor:"middle"}},_X=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*i,p=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,v=m*i,y=m>0?"end":"start",b=m>0?"start":"end";if(a==="top"){var x={x:l+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:p};return Bt(Bt({},x),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var k={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:g};return Bt(Bt({},k),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var S={x:l-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return Bt(Bt({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(a==="right"){var w={x:l+u+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Bt(Bt({},w),r?{width:Math.max(r.x+r.width-w.x,0),height:d}:{})}var _=r?{width:u,height:d}:{};return a==="insideLeft"?Bt({x:l+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},_):a==="insideRight"?Bt({x:l+u-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},_):a==="insideTop"?Bt({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},_):a==="insideBottom"?Bt({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},_):a==="insideTopLeft"?Bt({x:l+v,y:c+h,textAnchor:b,verticalAnchor:g},_):a==="insideTopRight"?Bt({x:l+u-v,y:c+h,textAnchor:y,verticalAnchor:g},_):a==="insideBottomLeft"?Bt({x:l+v,y:c+d-h,textAnchor:b,verticalAnchor:p},_):a==="insideBottomRight"?Bt({x:l+u-v,y:c+d-h,textAnchor:y,verticalAnchor:p},_):Zo(a)&&(ue(a.x)||Ua(a.x))&&(ue(a.y)||Ua(a.y))?Bt({x:l+os(a.x,u),y:c+os(a.y,d),textAnchor:"end",verticalAnchor:"end"},_):Bt({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},_)},NX=function(t){return"cx"in t&&ue(t.cx)};function mn(e){var t=e.offset,n=t===void 0?5:t,r=gX(e,uX),i=Bt({offset:n},r),a=i.viewBox,o=i.position,l=i.value,c=i.children,u=i.content,d=i.className,f=d===void 0?"":d,h=i.textBreakAll;if(!a||Ye(l)&&Ye(c)&&!E.isValidElement(u)&&!De(u))return null;if(E.isValidElement(u))return E.cloneElement(u,i);var p;if(De(u)){if(p=E.createElement(u,i),E.isValidElement(p))return p}else p=wX(i);var g=NX(a),m=Ke(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return kX(i,p,m);var v=g?EX(i):_X(i);return H.createElement(Mf,Kc({className:Ve("recharts-label",f)},m,v,{breakAll:h}),p)}mn.displayName="Label";var XO=function(t){var n=t.cx,r=t.cy,i=t.angle,a=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,v=t.height,y=t.clockWise,b=t.labelViewBox;if(b)return b;if(ue(m)&&ue(v)){if(ue(f)&&ue(h))return{x:f,y:h,width:m,height:v};if(ue(p)&&ue(g))return{x:p,y:g,width:m,height:v}}return ue(f)&&ue(h)?{x:f,y:h,width:0,height:0}:ue(n)&&ue(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:y}:t.viewBox?t.viewBox:{}},jX=function(t,n){return t?t===!0?H.createElement(mn,{key:"label-implicit",viewBox:n}):Ut(t)?H.createElement(mn,{key:"label-implicit",viewBox:n,value:t}):E.isValidElement(t)?t.type===mn?E.cloneElement(t,{key:"label-implicit",viewBox:n}):H.createElement(mn,{key:"label-implicit",content:t,viewBox:n}):De(t)?H.createElement(mn,{key:"label-implicit",content:t,viewBox:n}):Zo(t)?H.createElement(mn,Kc({viewBox:n},t,{key:"label-implicit"})):null:null},AX=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 i=t.children,a=XO(t),o=Tr(i,mn).map(function(c,u){return E.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=jX(t.label,n||a);return[l].concat(dX(o))};mn.parseViewBox=XO;mn.renderCallByParent=AX;function TX(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var CX=TX;const OX=Ze(CX);function Vc(e){"@babel/helpers - typeof";return Vc=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},Vc(e)}var PX=["valueAccessor"],MX=["data","dataKey","clockWise","id","textBreakAll"];function RX(e){return DX(e)||LX(e)||$X(e)||IX()}function IX(){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 $X(e,t){if(e){if(typeof e=="string")return mv(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 mv(e,t)}}function LX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function DX(e){if(Array.isArray(e))return mv(e)}function mv(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 Xf(){return Xf=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},Xf.apply(this,arguments)}function zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fk(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){BX(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 BX(e,t,n){return t=zX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zX(e){var t=FX(e,"string");return Vc(t)=="symbol"?t:t+""}function FX(e,t){if(Vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Uk(e,t){if(e==null)return{};var n=UX(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UX(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 WX=function(t){return Array.isArray(t.value)?OX(t.value):t.value};function Qa(e){var t=e.valueAccessor,n=t===void 0?WX:t,r=Uk(e,PX),i=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=Uk(r,MX);return!i||!i.length?null:H.createElement(Yt,{className:"recharts-label-list"},i.map(function(d,f){var h=Ye(a)?n(d,f):Zr(d&&d.payload,a),p=Ye(l)?{}:{id:"".concat(l,"-").concat(f)};return H.createElement(mn,Xf({},Ke(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:mn.parseViewBox(Ye(o)?d:Fk(Fk({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Qa.displayName="LabelList";function HX(e,t){return e?e===!0?H.createElement(Qa,{key:"labelList-implicit",data:t}):H.isValidElement(e)||De(e)?H.createElement(Qa,{key:"labelList-implicit",data:t,content:e}):Zo(e)?H.createElement(Qa,Xf({data:t},e,{key:"labelList-implicit"})):null:null}function GX(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,i=Tr(r,Qa).map(function(o,l){return E.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return i;var a=HX(e.label,t);return[a].concat(RX(i))}Qa.renderCallByParent=GX;function Yc(e){"@babel/helpers - typeof";return Yc=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},Yc(e)}function gv(){return gv=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},gv.apply(this,arguments)}function Wk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wk(Object(n),!0).forEach(function(r){qX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qX(e,t,n){return t=KX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KX(e){var t=VX(e,"string");return Yc(t)=="symbol"?t:t+""}function VX(e,t){if(Yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var YX=function(t,n){var r=Nr(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},ud=function(t){var n=t.cx,r=t.cy,i=t.radius,a=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+i,f=Math.asin(c/d)/Yf,h=u?a:a+o*f,p=rn(n,r,d,h),g=rn(n,r,i,h),m=u?a-o*f:a,v=rn(n,r,d*Math.cos(f*Yf),m);return{center:p,circleTangency:g,lineTangency:v,theta:f}},ZO=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=YX(o,l),u=o+c,d=rn(n,r,a,o),f=rn(n,r,a,u),h="M ".concat(d.x,",").concat(d.y,`
96
+ A `).concat(a,",").concat(a,`,0,
97
+ `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
98
+ `).concat(f.x,",").concat(f.y,`
99
+ `);if(i>0){var p=rn(n,r,i,o),g=rn(n,r,i,u);h+="L ".concat(g.x,",").concat(g.y,`
100
+ A `).concat(i,",").concat(i,`,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},XX=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Nr(d-u),h=ud({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,m=h.theta,v=ud({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),y=v.circleTangency,b=v.lineTangency,x=v.theta,k=c?Math.abs(u-d):Math.abs(u-d)-m-x;if(k<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
+ `):ZO({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d});var S="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(a,",").concat(a,",0,").concat(+(k>180),",").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
108
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(b.x,",").concat(b.y,`
109
+ `);if(i>0){var w=ud({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=w.circleTangency,N=w.lineTangency,C=w.theta,T=ud({cx:n,cy:r,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),I=T.circleTangency,M=T.lineTangency,$=T.theta,R=c?Math.abs(u-d):Math.abs(u-d)-C-$;if(R<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(M.x,",").concat(M.y,`
110
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(I.x,",").concat(I.y,`
111
+ A`).concat(i,",").concat(i,",0,").concat(+(R>180),",").concat(+(f>0),",").concat(_.x,",").concat(_.y,`
112
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(N.x,",").concat(N.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},ZX={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},QO=function(t){var n=Hk(Hk({},ZX),t),r=n.cx,i=n.cy,a=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<a||d===f)return null;var p=Ve("recharts-sector",h),g=o-a,m=os(l,g,0,!0),v;return m>0&&Math.abs(d-f)<360?v=XX({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):v=ZO({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),H.createElement("path",gv({},Ke(n,!0),{className:p,d:v,role:"img"}))};function Xc(e){"@babel/helpers - typeof";return Xc=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},Xc(e)}function yv(){return yv=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},yv.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(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qk(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){QX(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 QX(e,t,n){return t=JX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JX(e){var t=eZ(e,"string");return Xc(t)=="symbol"?t:t+""}function eZ(e,t){if(Xc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kk={curveBasisClosed:QF,curveBasisOpen:JF,curveBasis:ZF,curveBumpX:LF,curveBumpY:DF,curveLinearClosed:e6,curveLinear:up,curveMonotoneX:t6,curveMonotoneY:n6,curveNatural:r6,curveStep:i6,curveStepAfter:s6,curveStepBefore:a6},dd=function(t){return t.x===+t.x&&t.y===+t.y},Ml=function(t){return t.x},Rl=function(t){return t.y},tZ=function(t,n){if(De(t))return t;var r="curve".concat(lp(t));return(r==="curveMonotone"||r==="curveBump")&&n?Kk["".concat(r).concat(n==="vertical"?"Y":"X")]:Kk[r]||up},nZ=function(t){var n=t.type,r=n===void 0?"linear":n,i=t.points,a=i===void 0?[]:i,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=tZ(r,l),f=u?a.filter(function(m){return dd(m)}):a,h;if(Array.isArray(o)){var p=u?o.filter(function(m){return dd(m)}):o,g=f.map(function(m,v){return qk(qk({},m),{},{base:p[v]})});return l==="vertical"?h=td().y(Rl).x1(Ml).x0(function(m){return m.base.x}):h=td().x(Ml).y1(Rl).y0(function(m){return m.base.y}),h.defined(dd).curve(d),h(g)}return l==="vertical"&&ue(o)?h=td().y(Rl).x1(Ml).x0(o):ue(o)?h=td().x(Ml).y1(Rl).y0(o):h=eC().x(Ml).y(Rl),h.defined(dd).curve(d),h(f)},Vk=function(t){var n=t.className,r=t.points,i=t.path,a=t.pathRef;if((!r||!r.length)&&!i)return null;var o=r&&r.length?nZ(t):i;return E.createElement("path",yv({},Ke(t,!1),vf(t),{className:Ve("recharts-curve",n),d:o,ref:a}))},JO={exports:{}},rZ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",iZ=rZ,aZ=iZ;function eP(){}function tP(){}tP.resetWarningCache=eP;var sZ=function(){function e(r,i,a,o,l,c){if(c!==aZ){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:tP,resetWarningCache:eP};return n.PropTypes=n,n};JO.exports=sZ();var oZ=JO.exports;const Xe=Ze(oZ),{getOwnPropertyNames:lZ,getOwnPropertySymbols:cZ}=Object,{hasOwnProperty:uZ}=Object.prototype;function Wm(e,t){return function(r,i,a){return e(r,i,a)&&t(r,i,a)}}function fd(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:a}=i,o=a.get(n),l=a.get(r);if(o&&l)return o===r&&l===n;a.set(n,r),a.set(r,n);const c=e(n,r,i);return a.delete(n),a.delete(r),c}}function dZ(e){return e!=null?e[Symbol.toStringTag]:void 0}function Yk(e){return lZ(e).concat(cZ(e))}const fZ=Object.hasOwn||((e,t)=>uZ.call(e,t));function ys(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const hZ="__v",pZ="__o",mZ="_owner",{getOwnPropertyDescriptor:Xk,keys:Zk}=Object;function gZ(e,t){return e.byteLength===t.byteLength&&Zf(new Uint8Array(e),new Uint8Array(t))}function yZ(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 vZ(e,t){return e.byteLength===t.byteLength&&Zf(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function bZ(e,t){return ys(e.getTime(),t.getTime())}function xZ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function wZ(e,t){return e===t}function Qk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),a=e.entries();let o,l,c=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(i[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=i[f]=!0;break}f++}if(!d)return!1;c++}return!0}const SZ=ys;function kZ(e,t,n){const r=Zk(e);let i=r.length;if(Zk(t).length!==i)return!1;for(;i-- >0;)if(!nP(e,t,n,r[i]))return!1;return!0}function Il(e,t,n){const r=Yk(e);let i=r.length;if(Yk(t).length!==i)return!1;let a,o,l;for(;i-- >0;)if(a=r[i],!nP(e,t,n,a)||(o=Xk(e,a),l=Xk(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function EZ(e,t){return ys(e.valueOf(),t.valueOf())}function _Z(e,t){return e.source===t.source&&e.flags===t.flags}function Jk(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),a=e.values();let o,l;for(;(o=a.next())&&!o.done;){const c=t.values();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(!i[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function Zf(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 NZ(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 nP(e,t,n,r){return(r===mZ||r===pZ||r===hZ)&&(e.$$typeof||t.$$typeof)?!0:fZ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const jZ="[object ArrayBuffer]",AZ="[object Arguments]",TZ="[object Boolean]",CZ="[object DataView]",OZ="[object Date]",PZ="[object Error]",MZ="[object Map]",RZ="[object Number]",IZ="[object Object]",$Z="[object RegExp]",LZ="[object Set]",DZ="[object String]",BZ={"[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},zZ="[object URL]",FZ=Object.prototype.toString;function UZ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:g}){return function(v,y,b){if(v===y)return!0;if(v==null||y==null)return!1;const x=typeof v;if(x!==typeof y)return!1;if(x!=="object")return x==="number"?l(v,y,b):x==="function"?a(v,y,b):!1;const k=v.constructor;if(k!==y.constructor)return!1;if(k===Object)return c(v,y,b);if(Array.isArray(v))return t(v,y,b);if(k===Date)return r(v,y,b);if(k===RegExp)return d(v,y,b);if(k===Map)return o(v,y,b);if(k===Set)return f(v,y,b);const S=FZ.call(v);if(S===OZ)return r(v,y,b);if(S===$Z)return d(v,y,b);if(S===MZ)return o(v,y,b);if(S===LZ)return f(v,y,b);if(S===IZ)return typeof v.then!="function"&&typeof y.then!="function"&&c(v,y,b);if(S===zZ)return p(v,y,b);if(S===PZ)return i(v,y,b);if(S===AZ)return c(v,y,b);if(BZ[S])return h(v,y,b);if(S===jZ)return e(v,y,b);if(S===CZ)return n(v,y,b);if(S===TZ||S===RZ||S===DZ)return u(v,y,b);if(g){let w=g[S];if(!w){const _=dZ(v);_&&(w=g[_])}if(w)return w(v,y,b)}return!1}}function WZ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:gZ,areArraysEqual:n?Il:yZ,areDataViewsEqual:vZ,areDatesEqual:bZ,areErrorsEqual:xZ,areFunctionsEqual:wZ,areMapsEqual:n?Wm(Qk,Il):Qk,areNumbersEqual:SZ,areObjectsEqual:n?Il:kZ,arePrimitiveWrappersEqual:EZ,areRegExpsEqual:_Z,areSetsEqual:n?Wm(Jk,Il):Jk,areTypedArraysEqual:n?Wm(Zf,Il):Zf,areUrlsEqual:NZ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=fd(r.areArraysEqual),a=fd(r.areMapsEqual),o=fd(r.areObjectsEqual),l=fd(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:l})}return r}function HZ(e){return function(t,n,r,i,a,o,l){return e(t,n,l)}}function GZ({circular:e,comparator:t,createState:n,equals:r,strict:i}){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:i})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const a={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,c){return t(l,c,a)}}const qZ=wa();wa({strict:!0});wa({circular:!0});wa({circular:!0,strict:!0});wa({createInternalComparator:()=>ys});wa({strict:!0,createInternalComparator:()=>ys});wa({circular:!0,createInternalComparator:()=>ys});wa({circular:!0,createInternalComparator:()=>ys,strict:!0});function wa(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=WZ(e),o=UZ(a),l=n?n(o):HZ(o);return GZ({circular:t,comparator:o,createState:r,equals:l,strict:i})}function KZ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function eE(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>t?(e(a),n=-1):KZ(i)};requestAnimationFrame(r)}function vv(e){"@babel/helpers - typeof";return vv=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},vv(e)}function VZ(e){return QZ(e)||ZZ(e)||XZ(e)||YZ()}function YZ(){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 XZ(e,t){if(e){if(typeof e=="string")return tE(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 tE(e,t)}}function tE(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 ZZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function QZ(e){if(Array.isArray(e))return e}function JZ(){var e={},t=function(){return null},n=!1,r=function i(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var o=a,l=VZ(o),c=l[0],u=l.slice(1);if(typeof c=="number"){eE(i.bind(null,u),c);return}i(c),eE(i.bind(null,u));return}vv(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function Zc(e){"@babel/helpers - typeof";return Zc=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},Zc(e)}function nE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nE(Object(n),!0).forEach(function(r){rP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rP(e,t,n){return t=eQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eQ(e){var t=tQ(e,"string");return Zc(t)==="symbol"?t:String(t)}function tQ(e,t){if(Zc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nQ=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},rQ=function(t){return t},iQ=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},ic=function(t,n){return Object.keys(n).reduce(function(r,i){return rE(rE({},r),{},rP({},i,t(i,n[i])))},{})},iE=function(t,n,r){return t.map(function(i){return"".concat(iQ(i)," ").concat(n,"ms ").concat(r)}).join(",")};function aQ(e,t){return lQ(e)||oQ(e,t)||iP(e,t)||sQ()}function sQ(){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 oQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function lQ(e){if(Array.isArray(e))return e}function cQ(e){return fQ(e)||dQ(e)||iP(e)||uQ()}function uQ(){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 iP(e,t){if(e){if(typeof e=="string")return bv(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 bv(e,t)}}function dQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fQ(e){if(Array.isArray(e))return bv(e)}function bv(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 Qf=1e-4,aP=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},sP=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},aE=function(t,n){return function(r){var i=aP(t,n);return sP(i,r)}},hQ=function(t,n){return function(r){var i=aP(t,n),a=[].concat(cQ(i.map(function(o,l){return o*l}).slice(1)),[0]);return sP(a,r)}},sE=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],a=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,a=0,o=1,l=1;break;case"ease":i=.25,a=.1,o=.25,l=1;break;case"ease-in":i=.42,a=0,o=1,l=1;break;case"ease-out":i=.42,a=0,o=.58,l=1;break;case"ease-in-out":i=0,a=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(v){return parseFloat(v)}),d=aQ(u,4);i=d[0],a=d[1],o=d[2],l=d[3]}}}var f=aE(i,o),h=aE(a,l),p=hQ(i,o),g=function(y){return y>1?1:y<0?0:y},m=function(y){for(var b=y>1?1:y,x=b,k=0;k<8;++k){var S=f(x)-b,w=p(x);if(Math.abs(S-b)<Qf||w<Qf)return h(x);x=g(x-S/w)}return h(x)};return m.isStepper=!1,m},pQ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var p=-(d-f)*r,g=h*a,m=h+(p-g)*l/1e3,v=h*l/1e3+d;return Math.abs(v-f)<Qf&&Math.abs(m)<Qf?[f,0]:[v,m]};return c.isStepper=!0,c.dt=l,c},mQ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return sE(i);case"spring":return pQ();default:if(i.split("(")[0]==="cubic-bezier")return sE(i)}return typeof i=="function"?i:null};function Qc(e){"@babel/helpers - typeof";return Qc=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},Qc(e)}function oE(e){return vQ(e)||yQ(e)||oP(e)||gQ()}function gQ(){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 yQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vQ(e){if(Array.isArray(e))return wv(e)}function lE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lE(Object(n),!0).forEach(function(r){xv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xv(e,t,n){return t=bQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bQ(e){var t=xQ(e,"string");return Qc(t)==="symbol"?t:String(t)}function xQ(e,t){if(Qc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wQ(e,t){return EQ(e)||kQ(e,t)||oP(e,t)||SQ()}function SQ(){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 oP(e,t){if(e){if(typeof e=="string")return wv(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 wv(e,t)}}function wv(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 kQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function EQ(e){if(Array.isArray(e))return e}var Jf=function(t,n,r){return t+(n-t)*r},Sv=function(t){var n=t.from,r=t.to;return n!==r},_Q=function e(t,n,r){var i=ic(function(a,o){if(Sv(o)){var l=t(o.from,o.to,o.velocity),c=wQ(l,2),u=c[0],d=c[1];return tn(tn({},o),{},{from:u,velocity:d})}return o},n);return r<1?ic(function(a,o){return Sv(o)?tn(tn({},o),{},{velocity:Jf(o.velocity,i[a].velocity,r),from:Jf(o.from,i[a].from,r)}):o},n):e(t,i,r-1)};const NQ=function(e,t,n,r,i){var a=nQ(e,t),o=a.reduce(function(v,y){return tn(tn({},v),{},xv({},y,[e[y],t[y]]))},{}),l=a.reduce(function(v,y){return tn(tn({},v),{},xv({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return ic(function(y,b){return b.from},l)},p=function(){return!Object.values(l).filter(Sv).length},g=function(y){u||(u=y);var b=y-u,x=b/n.dt;l=_Q(n,l,x),i(tn(tn(tn({},e),t),h())),u=y,p()||(c=requestAnimationFrame(f))},m=function(y){d||(d=y);var b=(y-d)/r,x=ic(function(S,w){return Jf.apply(void 0,oE(w).concat([n(b)]))},o);if(i(tn(tn(tn({},e),t),x)),b<1)c=requestAnimationFrame(f);else{var k=ic(function(S,w){return Jf.apply(void 0,oE(w).concat([n(1)]))},o);i(tn(tn(tn({},e),t),k))}};return f=n.isStepper?g:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function Co(e){"@babel/helpers - typeof";return Co=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},Co(e)}var jQ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function AQ(e,t){if(e==null)return{};var n=TQ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TQ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Hm(e){return MQ(e)||PQ(e)||OQ(e)||CQ()}function CQ(){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 OQ(e,t){if(e){if(typeof e=="string")return kv(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 kv(e,t)}}function PQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MQ(e){if(Array.isArray(e))return kv(e)}function kv(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 cE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cE(Object(n),!0).forEach(function(r){Gl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gl(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 RQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IQ(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 $Q(e,t,n){return t&&IQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lP(e){var t=LQ(e,"string");return Co(t)==="symbol"?t:String(t)}function LQ(e,t){if(Co(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Co(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DQ(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&&Ev(e,t)}function Ev(e,t){return Ev=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Ev(e,t)}function BQ(e){var t=zQ();return function(){var r=eh(e),i;if(t){var a=eh(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return _v(this,i)}}function _v(e,t){if(t&&(Co(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nv(e)}function Nv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zQ(){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 eh(e){return eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},eh(e)}var fa=function(e){DQ(n,e);var t=BQ(n);function n(r,i){var a;RQ(this,n),a=t.call(this,r,i);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Nv(a)),a.changeStyle=a.changeStyle.bind(Nv(a)),!l||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),_v(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},_v(a);a.state={style:c?Gl({},c,u):u}}else a.state={style:{}};return a}return $Q(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,h=this.state.style;if(l){if(!o){var p={style:c?Gl({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(qZ(i.to,d)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?f:i.to;if(this.state&&h){var v={style:c?Gl({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(v)}this.runAnimation(xr(xr({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,l=i.to,c=i.duration,u=i.easing,d=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,p=NQ(o,l,mQ(u),c,this.changeStyle),g=function(){a.stopJSAnimation=p()};this.manager.start([h,d,g,c,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,l=i.begin,c=i.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,v,y){if(y===0)return m;var b=v.duration,x=v.easing,k=x===void 0?"ease":x,S=v.style,w=v.properties,_=v.onAnimationEnd,N=y>0?o[y-1]:v,C=w||Object.keys(S);if(typeof k=="function"||k==="spring")return[].concat(Hm(m),[a.runJSAnimation.bind(a,{from:N.style,to:S,duration:b,easing:k}),b]);var T=iE(C,b,k),I=xr(xr(xr({},N.style),S),{},{transition:T});return[].concat(Hm(m),[I,b,_]).filter(rQ)};return this.manager.start([c].concat(Hm(o.reduce(p,[d,Math.max(h,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=JZ());var a=i.begin,o=i.duration,l=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,p=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=l?Gl({},l,c):c,v=iE(Object.keys(m),o,u);g.start([d,a,xr(xr({},m),{},{transition:v}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=AQ(i,jQ),u=E.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var f=function(p){var g=p.props,m=g.style,v=m===void 0?{}:m,y=g.className,b=E.cloneElement(p,xr(xr({},c),{},{style:xr(xr({},v),d),className:y}));return b};return u===1?f(E.Children.only(a)):H.createElement("div",null,E.Children.map(a,function(h){return f(h)}))}}]),n}(E.PureComponent);fa.displayName="Animate";fa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};fa.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 Jc(e){"@babel/helpers - typeof";return Jc=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},Jc(e)}function th(){return th=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},th.apply(this,arguments)}function FQ(e,t){return GQ(e)||HQ(e,t)||WQ(e,t)||UQ()}function UQ(){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 WQ(e,t){if(e){if(typeof e=="string")return uE(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 uE(e,t)}}function uE(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 HQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function GQ(e){if(Array.isArray(e))return e}function dE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dE(Object(n),!0).forEach(function(r){qQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qQ(e,t,n){return t=KQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KQ(e){var t=VQ(e,"string");return Jc(t)=="symbol"?t:t+""}function VQ(e,t){if(Jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hE=function(t,n,r,i,a){var o=Math.min(Math.abs(r)/2,Math.abs(i)/2),l=i>=0?1:-1,c=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,d;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=a[h]>o?o:a[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+i-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+i)),d+="L ".concat(t+c*f[3],",").concat(n+i),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
122
+ `).concat(t,",").concat(n+i-l*f[3])),d+="Z"}else if(o>0&&a===+a&&a>0){var g=Math.min(o,a);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+i-l*g,`
127
+ A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r-c*g,",").concat(n+i,`
128
+ L `).concat(t+c*g,",").concat(n+i,`
129
+ A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(n+i-l*g," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return d},YQ=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,a=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return r>=u&&r<=d&&i>=f&&i<=h}return!1},XQ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},n0=function(t){var n=fE(fE({},XQ),t),r=E.useRef(),i=E.useState(-1),a=FQ(i,2),o=a[0],l=a[1];E.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var k=r.current.getTotalLength();k&&l(k)}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,v=n.animationBegin,y=n.isAnimationActive,b=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var x=Ve("recharts-rectangle",p);return b?H.createElement(fa,{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:b},function(k){var S=k.width,w=k.height,_=k.x,N=k.y;return H.createElement(fa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,isActive:y,easing:g},H.createElement("path",th({},Ke(n,!0),{className:x,d:hE(_,N,S,w,h),ref:r})))}):H.createElement("path",th({},Ke(n,!0),{className:x,d:hE(c,u,d,f,h)}))};function jv(){return jv=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},jv.apply(this,arguments)}var cP=function(t){var n=t.cx,r=t.cy,i=t.r,a=t.className,o=Ve("recharts-dot",a);return n===+n&&r===+r&&i===+i?E.createElement("circle",jv({},Ke(t,!1),vf(t),{className:o,cx:n,cy:r,r:i})):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 ZQ=["x","y","top","left","width","height","className"];function Av(){return Av=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},Av.apply(this,arguments)}function pE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function QQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pE(Object(n),!0).forEach(function(r){JQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JQ(e,t,n){return t=eJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eJ(e){var t=tJ(e,"string");return eu(t)=="symbol"?t:t+""}function tJ(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 nJ(e,t){if(e==null)return{};var n=rJ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rJ(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 iJ=function(t,n,r,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},aJ=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,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=nJ(t,ZQ),v=QQ({x:r,y:a,top:l,left:u,width:f,height:p},m);return!ue(r)||!ue(a)||!ue(f)||!ue(p)||!ue(l)||!ue(u)?null:H.createElement("path",Av({},Ke(v,!0),{className:Ve("recharts-cross",g),d:iJ(r,a,f,p,l,u)}))},sJ=EC,oJ=sJ(Object.getPrototypeOf,Object),lJ=oJ,cJ=Ni,uJ=lJ,dJ=ji,fJ="[object Object]",hJ=Function.prototype,pJ=Object.prototype,uP=hJ.toString,mJ=pJ.hasOwnProperty,gJ=uP.call(Object);function yJ(e){if(!dJ(e)||cJ(e)!=fJ)return!1;var t=uJ(e);if(t===null)return!0;var n=mJ.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&uP.call(n)==gJ}var vJ=yJ;const bJ=Ze(vJ);var xJ=Ni,wJ=ji,SJ="[object Boolean]";function kJ(e){return e===!0||e===!1||wJ(e)&&xJ(e)==SJ}var EJ=kJ;const _J=Ze(EJ);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 nh(){return nh=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},nh.apply(this,arguments)}function NJ(e,t){return CJ(e)||TJ(e,t)||AJ(e,t)||jJ()}function jJ(){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 AJ(e,t){if(e){if(typeof e=="string")return mE(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 mE(e,t)}}function mE(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 TJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function CJ(e){if(Array.isArray(e))return e}function gE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gE(Object(n),!0).forEach(function(r){OJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OJ(e,t,n){return t=PJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PJ(e){var t=MJ(e,"string");return tu(t)=="symbol"?t:t+""}function MJ(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 vE=function(t,n,r,i,a){var o=r-i,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+a),l+="L ".concat(t+r-o/2-i,",").concat(n+a),l+="L ".concat(t,",").concat(n," Z"),l},RJ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},IJ=function(t){var n=yE(yE({},RJ),t),r=E.useRef(),i=E.useState(-1),a=NJ(i,2),o=a[0],l=a[1];E.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var x=r.current.getTotalLength();x&&l(x)}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,v=n.animationBegin,y=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var b=Ve("recharts-trapezoid",p);return y?H.createElement(fa,{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:y},function(x){var k=x.upperWidth,S=x.lowerWidth,w=x.height,_=x.x,N=x.y;return H.createElement(fa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,easing:g},H.createElement("path",nh({},Ke(n,!0),{className:b,d:vE(_,N,k,S,w),ref:r})))}):H.createElement("g",null,H.createElement("path",nh({},Ke(n,!0),{className:b,d:vE(c,u,d,f,h)})))},$J=["option","shapeType","propTransformer","activeClassName","isActive"];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 LJ(e,t){if(e==null)return{};var n=DJ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DJ(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 bE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?bE(Object(n),!0).forEach(function(r){BJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BJ(e,t,n){return t=zJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zJ(e){var t=FJ(e,"string");return nu(t)=="symbol"?t:t+""}function FJ(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 UJ(e,t){return rh(rh({},t),e)}function WJ(e,t){return e==="symbols"}function xE(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return H.createElement(n0,n);case"trapezoid":return H.createElement(IJ,n);case"sector":return H.createElement(QO,n);case"symbols":if(WJ(t))return H.createElement(xx,n);break;default:return null}}function HJ(e){return E.isValidElement(e)?e.props:e}function GJ(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?UJ:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=LJ(e,$J),u;if(E.isValidElement(t))u=E.cloneElement(t,rh(rh({},c),HJ(t)));else if(De(t))u=t(c);else if(bJ(t)&&!_J(t)){var d=i(t,c);u=H.createElement(xE,{shapeType:n,elementProps:d})}else{var f=c;u=H.createElement(xE,{shapeType:n,elementProps:f})}return l?H.createElement(Yt,{className:o},u):u}function Np(e,t){return t!=null&&"trapezoids"in e.props}function jp(e,t){return t!=null&&"sectors"in e.props}function ru(e,t){return t!=null&&"points"in e.props}function qJ(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&a}function KJ(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function VJ(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function YJ(e,t){var n;return Np(e,t)?n=qJ:jp(e,t)?n=KJ:ru(e,t)&&(n=VJ),n}function XJ(e,t){var n;return Np(e,t)?n="trapezoids":jp(e,t)?n="sectors":ru(e,t)&&(n="points"),n}function ZJ(e,t){if(Np(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(jp(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 ru(e,t)?t.payload:{}}function QJ(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=XJ(n,t),a=ZJ(n,t),o=r.filter(function(c,u){var d=Qx(a,c),f=n.props[i].filter(function(g){var m=YJ(n,t);return m(g,t)}),h=n.props[i].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=r.indexOf(o[o.length-1]);return l}var JJ=Math.ceil,eee=Math.max;function tee(e,t,n,r){for(var i=-1,a=eee(JJ((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}var nee=tee,ree=WC,wE=1/0,iee=17976931348623157e292;function aee(e){if(!e)return e===0?e:0;if(e=ree(e),e===wE||e===-wE){var t=e<0?-1:1;return t*iee}return e===e?e:0}var dP=aee,see=nee,oee=pp,Gm=dP;function lee(e){return function(t,n,r){return r&&typeof r!="number"&&oee(t,n,r)&&(n=r=void 0),t=Gm(t),n===void 0?(n=t,t=0):n=Gm(n),r=r===void 0?t<n?1:-1:Gm(r),see(t,n,r,e)}}var cee=lee,uee=cee,dee=uee(),fee=dee;const ih=Ze(fee);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 SE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SE(Object(n),!0).forEach(function(r){fP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fP(e,t,n){return t=hee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hee(e){var t=pee(e,"string");return iu(t)=="symbol"?t:t+""}function pee(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)}var mee=["Webkit","Moz","O","ms"],gee=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=mee.reduce(function(a,o){return kE(kE({},a),{},fP({},o+r,n))},{});return i[t]=n,i};function Oo(e){"@babel/helpers - typeof";return Oo=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},Oo(e)}function ah(){return ah=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},ah.apply(this,arguments)}function EE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EE(Object(n),!0).forEach(function(r){Wn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _E(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,pP(r.key),r)}}function vee(e,t,n){return t&&_E(e.prototype,t),n&&_E(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bee(e,t,n){return t=sh(t),xee(e,hP()?Reflect.construct(t,n||[],sh(e).constructor):t.apply(e,n))}function xee(e,t){if(t&&(Oo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wee(e)}function wee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hP=function(){return!!e})()}function sh(e){return sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sh(e)}function See(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&&Tv(e,t)}function Tv(e,t){return Tv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Tv(e,t)}function Wn(e,t,n){return t=pP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pP(e){var t=kee(e,"string");return Oo(t)=="symbol"?t:t+""}function kee(e,t){if(Oo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Eee=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,a=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=nc().domain(ih(0,c)).range([a,a+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(i),scale:u,scaleValues:d}},NE=function(t){return t.changedTouches&&!!t.changedTouches.length},Po=function(e){function t(n){var r;return yee(this,t),r=bee(this,t,[n]),Wn(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),Wn(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),Wn(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,o=i.onDragEnd,l=i.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Wn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Wn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Wn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Wn(r,"handleSlideDragStart",function(i){var a=NE(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return See(t,e),vee(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(i,a),h=Math.max(i,a),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 i=this.props,a=i.data,o=i.tickFormatter,l=i.dataKey,c=Zr(a[r],l,r);return De(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 i=this.state,a=i.slideMoveStartX,o=i.startX,l=i.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-a;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 v=this.getIndex({startX:o+m,endX:l+m});(v.startIndex!==h||v.endIndex!==p)&&g&&g(v),this.setState({startX:o+m,endX:l+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=NE(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,l=i.endX,c=i.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,v=d.data,y={startX:this.state.startX,endX:this.state.endX},b=r.pageX-a;b>0?b=Math.min(b,f+h-p-u):b<0&&(b=Math.max(b,f-u)),y[o]=u+b;var x=this.getIndex(y),k=x.startIndex,S=x.endIndex,w=function(){var N=v.length-1;return o==="startX"&&(l>c?k%m===0:S%m===0)||l<c&&S===N||o==="endX"&&(l>c?S%m===0:k%m===0)||l>c&&S===N};this.setState(Wn(Wn({},o,u+b),"brushMoveStartX",r.pageX),function(){g&&w()&&g(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[i],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var p=l[h];i==="startX"&&p>=u||i==="endX"&&p<=c||this.setState(Wn({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return H.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=E.Children.only(u);return f?H.cloneElement(f,{x:i,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var a,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,v=c.endIndex,y=Math.max(r,this.props.x),b=qm(qm({},Ke(this.props,!1)),{},{x:y,y:u,width:d,height:f}),x=p||"Min value: ".concat((a=g[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=g[v])===null||o===void 0?void 0:o.name);return H.createElement(Yt,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,b))}},{key:"renderSlide",value:function(r,i){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,i)+u,f=Math.max(Math.abs(i-r)-u,0);return H.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,i=r.startIndex,a=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 H.createElement(Yt,{className:"recharts-brush-texts"},H.createElement(Mf,ah({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},g),this.getTextOfTick(i)),H.createElement(Mf,ah({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:o+l/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=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,v=h.isSlideMoving,y=h.isTravellerMoving,b=h.isTravellerFocused;if(!i||!i.length||!ue(l)||!ue(c)||!ue(u)||!ue(d)||u<=0||d<=0)return null;var x=Ve("recharts-brush",a),k=H.Children.count(o)===1,S=gee("userSelect","none");return H.createElement(Yt,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),k&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||v||y||b||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return H.createElement(H.Fragment,null,H.createElement("rect",{x:i,y:a,width:o,height:l,fill:c,stroke:"none"}),H.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),H.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return H.isValidElement(r)?a=H.cloneElement(r,i):De(r)?a=r(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return qm({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?Eee({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+o-c]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>i?l=c:o=c}return i>=r[l]?l:o}}])}(E.PureComponent);Wn(Po,"displayName","Brush");Wn(Po,"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 _ee=jx;function Nee(e,t){var n;return _ee(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}var jee=Nee,Aee=gC,Tee=va,Cee=jee,Oee=Bn,Pee=pp;function Mee(e,t,n){var r=Oee(e)?Aee:Cee;return n&&Pee(e,t,n)&&(t=void 0),r(e,Tee(t))}var Ree=Mee;const Iee=Ze(Ree);var Yr=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},jE=DC;function $ee(e,t,n){t=="__proto__"&&jE?jE(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Lee=$ee,Dee=Lee,Bee=$C,zee=va;function Fee(e,t){var n={};return t=zee(t),Bee(e,function(r,i,a){Dee(n,i,t(r,i,a))}),n}var Uee=Fee;const Wee=Ze(Uee);function Hee(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 Gee=Hee,qee=jx;function Kee(e,t){var n=!0;return qee(e,function(r,i,a){return n=!!t(r,i,a),n}),n}var Vee=Kee,Yee=Gee,Xee=Vee,Zee=va,Qee=Bn,Jee=pp;function ete(e,t,n){var r=Qee(e)?Yee:Xee;return n&&Jee(e,t,n)&&(t=void 0),r(e,Zee(t))}var tte=ete;const mP=Ze(tte);var nte=["x","y"];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 Cv(){return Cv=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},Cv.apply(this,arguments)}function AE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AE(Object(n),!0).forEach(function(r){rte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rte(e,t,n){return t=ite(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ite(e){var t=ate(e,"string");return au(t)=="symbol"?t:t+""}function ate(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 ste(e,t){if(e==null)return{};var n=ote(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ote(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 lte(e,t){var n=e.x,r=e.y,i=ste(e,nte),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||i.height),d=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return $l($l($l($l($l({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function TE(e){return H.createElement(GJ,Cv({shapeType:"rectangle",propTransformer:lte,activeClassName:"recharts-active-bar"},e))}var cte=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var a=ue(r)||k3(r);return a?t(r,i):(a||cs(),n)}},ute=["value","background"],gP;function Mo(e){"@babel/helpers - typeof";return Mo=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},Mo(e)}function dte(e,t){if(e==null)return{};var n=fte(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fte(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 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 CE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?CE(Object(n),!0).forEach(function(r){Zi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OE(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,vP(r.key),r)}}function pte(e,t,n){return t&&OE(e.prototype,t),n&&OE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mte(e,t,n){return t=lh(t),gte(e,yP()?Reflect.construct(t,n||[],lh(e).constructor):t.apply(e,n))}function gte(e,t){if(t&&(Mo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yte(e)}function yte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yP=function(){return!!e})()}function lh(e){return lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lh(e)}function vte(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&&Ov(e,t)}function Ov(e,t){return Ov=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Ov(e,t)}function Zi(e,t,n){return t=vP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vP(e){var t=bte(e,"string");return Mo(t)=="symbol"?t:t+""}function bte(e,t){if(Mo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var fn=function(e){function t(){var n;hte(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=mte(this,t,[].concat(i)),Zi(n,"state",{isAnimationFinished:!1}),Zi(n,"id",op("recharts-bar-")),Zi(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Zi(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return vte(t,e),pte(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,a=this.props,o=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=Ke(this.props,!1);return r&&r.map(function(f,h){var p=h===c,g=p?u:o,m=Pt(Pt(Pt({},d),f),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return H.createElement(Yt,oh({className:"recharts-bar-rectangle"},bf(i.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)}),H.createElement(TE,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,a=i.data,o=i.layout,l=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,f=i.animationId,h=this.state.prevData;return H.createElement(fa,{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=a.map(function(v,y){var b=h&&h[y];if(b){var x=Ts(b.x,v.x),k=Ts(b.y,v.y),S=Ts(b.width,v.width),w=Ts(b.height,v.height);return Pt(Pt({},v),{},{x:x(g),y:k(g),width:S(g),height:w(g)})}if(o==="horizontal"){var _=Ts(0,v.height),N=_(g);return Pt(Pt({},v),{},{y:v.y+v.height-N,height:N})}var C=Ts(0,v.width),T=C(g);return Pt(Pt({},v),{},{width:T})});return H.createElement(Yt,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,a=r.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!Qx(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,a=i.data,o=i.dataKey,l=i.activeIndex,c=Ke(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,h=dte(u,ute);if(!f)return null;var p=Pt(Pt(Pt(Pt(Pt({},h),{},{fill:"#eee"},f),c),bf(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return H.createElement(TE,oh({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=Tr(d,_p);if(!f)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,p=function(v,y){var b=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:b,errorVal:Zr(v,y)}},g={clipPath:r?"url(#clipPath-".concat(i,")"):null};return H.createElement(Yt,g,f.map(function(m){return H.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,a=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(i||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=Ve("recharts-bar",o),b=l&&l.allowDataOverflow,x=c&&c.allowDataOverflow,k=b||x,S=Ye(m)?this.id:m;return H.createElement(Yt,{className:y},b||x?H.createElement("defs",null,H.createElement("clipPath",{id:"clipPath-".concat(S)},H.createElement("rect",{x:b?u:u-f/2,y:x?d:d-h/2,width:b?f:f*2,height:x?h:h*2}))):null,H.createElement(Yt,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,S),(!p||v)&&Qa.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(E.PureComponent);gP=fn;Zi(fn,"displayName","Bar");Zi(fn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Su.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Zi(fn,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=GY(r,n);if(!p)return null;var g=t.layout,m=n.type.defaultProps,v=m!==void 0?Pt(Pt({},m),n.props):n.props,y=v.dataKey,b=v.children,x=v.minPointSize,k=g==="horizontal"?o:a,S=u?k.scale.domain():null,w=JY({numericAxis:k}),_=Tr(b,Mc),N=f.map(function(C,T){var I,M,$,R,z,D;u?I=qY(u[d+T],S):(I=Zr(C,y),Array.isArray(I)||(I=[w,I]));var U=cte(x,gP.defaultProps.minPointSize)(I[1],T);if(g==="horizontal"){var O,F=[o.scale(I[0]),o.scale(I[1])],A=F[0],Z=F[1];M=Pk({axis:a,ticks:l,bandSize:i,offset:p.offset,entry:C,index:T}),$=(O=Z??A)!==null&&O!==void 0?O:void 0,R=p.size;var L=A-Z;if(z=Number.isNaN(L)?0:L,D={x:M,y:o.y,width:R,height:o.height},Math.abs(U)>0&&Math.abs(z)<Math.abs(U)){var P=Nr(z||U)*(Math.abs(U)-Math.abs(z));$-=P,z+=P}}else{var ce=[a.scale(I[0]),a.scale(I[1])],we=ce[0],pe=ce[1];if(M=we,$=Pk({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:C,index:T}),R=pe-we,z=p.size,D={x:a.x,y:$,width:a.width,height:z},Math.abs(U)>0&&Math.abs(R)<Math.abs(U)){var Pe=Nr(R||U)*(Math.abs(U)-Math.abs(R));R+=Pe}}return Pt(Pt(Pt({},C),{},{x:M,y:$,width:R,height:z,value:u?I:I[1],payload:C,background:D},_&&_[T]&&_[T].props),{},{tooltipPayload:[YO(n,C)],tooltipPosition:{x:M+R/2,y:$+z/2}})});return Pt({data:N,layout:g},h)});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 xte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PE(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,bP(r.key),r)}}function wte(e,t,n){return t&&PE(e.prototype,t),n&&PE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ME(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ME(Object(n),!0).forEach(function(r){Ap(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ME(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ap(e,t,n){return t=bP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bP(e){var t=Ste(e,"string");return su(t)=="symbol"?t:t+""}function Ste(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 kte=function(t,n,r,i,a){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=!!Gn(u,fn);return d.reduce(function(p,g){var m=n[g],v=m.orientation,y=m.domain,b=m.padding,x=b===void 0?{}:b,k=m.mirror,S=m.reversed,w="".concat(v).concat(k?"Mirror":""),_,N,C,T,I;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var M=y[1]-y[0],$=1/0,R=m.categoricalDomain.sort(N3);if(R.forEach(function(ce,we){we>0&&($=Math.min((ce||0)-(R[we-1]||0),$))}),Number.isFinite($)){var z=$/M,D=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(_=z*D/2),m.padding==="no-gap"){var U=os(t.barCategoryGap,z*D),O=z*D/2;_=O-U-(O-U)/D*U}}}i==="xAxis"?N=[r.left+(x.left||0)+(_||0),r.left+r.width-(x.right||0)-(_||0)]:i==="yAxis"?N=c==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(_||0),r.top+r.height-(x.bottom||0)-(_||0)]:N=m.range,S&&(N=[N[1],N[0]]);var F=WY(m,a,h),A=F.scale,Z=F.realScaleType;A.domain(y).range(N),HY(A);var L=QY(A,kr(kr({},m),{},{realScaleType:Z}));i==="xAxis"?(I=v==="top"&&!k||v==="bottom"&&k,C=r.left,T=f[w]-I*m.height):i==="yAxis"&&(I=v==="left"&&!k||v==="right"&&k,C=f[w]-I*m.width,T=r.top);var P=kr(kr(kr({},m),L),{},{realScaleType:Z,x:C,y:T,scale:A,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return P.bandSize=Vf(P,L),!m.hide&&i==="xAxis"?f[w]+=(I?-1:1)*P.height:m.hide||(f[w]+=(I?-1:1)*P.width),kr(kr({},p),{},Ap({},g,P))},{})},xP=function(t,n){var r=t.x,i=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(i,o),width:Math.abs(a-r),height:Math.abs(o-i)}},Ete=function(t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2;return xP({x:n,y:r},{x:i,y:a})},wP=function(){function e(t){xte(this,e),this.scale=t}return wte(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]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){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(i){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(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();Ap(wP,"EPS",1e-4);var r0=function(t){var n=Object.keys(t).reduce(function(r,i){return kr(kr({},r),{},Ap({},i,wP.create(t[i])))},{});return kr(kr({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return Wee(i,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return mP(i,function(a,o){return n[o].isInRange(a)})}})};function _te(e){return(e%180+180)%180}var Nte=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=_te(i),o=a*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)},jte=va,Ate=wu,Tte=fp;function Cte(e){return function(t,n,r){var i=Object(t);if(!Ate(t)){var a=jte(n);t=Tte(t),n=function(l){return a(i[l],l,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var Ote=Cte,Pte=dP;function Mte(e){var t=Pte(e),n=t%1;return t===t?n?t-n:t:0}var Rte=Mte,Ite=CC,$te=va,Lte=Rte,Dte=Math.max;function Bte(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Lte(n);return i<0&&(i=Dte(r+i,0)),Ite(e,$te(t),i)}var zte=Bte,Fte=Ote,Ute=zte,Wte=Fte(Ute),Hte=Wte;const Gte=Ze(Hte);var qte=Tz(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("")}),i0=E.createContext(void 0),a0=E.createContext(void 0),SP=E.createContext(void 0),kP=E.createContext({}),EP=E.createContext(void 0),_P=E.createContext(0),NP=E.createContext(0),RE=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=qte(a);return H.createElement(i0.Provider,{value:r},H.createElement(a0.Provider,{value:i},H.createElement(kP.Provider,{value:a},H.createElement(SP.Provider,{value:d},H.createElement(EP.Provider,{value:o},H.createElement(_P.Provider,{value:u},H.createElement(NP.Provider,{value:c},l)))))))},Kte=function(){return E.useContext(EP)},jP=function(t){var n=E.useContext(i0);n==null&&cs();var r=n[t];return r==null&&cs(),r},Vte=function(){var t=E.useContext(i0);return Gi(t)},Yte=function(){var t=E.useContext(a0),n=Gte(t,function(r){return mP(r.domain,Number.isFinite)});return n||Gi(t)},AP=function(t){var n=E.useContext(a0);n==null&&cs();var r=n[t];return r==null&&cs(),r},Xte=function(){var t=E.useContext(SP);return t},Zte=function(){return E.useContext(kP)},s0=function(){return E.useContext(NP)},o0=function(){return E.useContext(_P)};function Ro(e){"@babel/helpers - typeof";return Ro=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},Ro(e)}function Qte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jte(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,CP(r.key),r)}}function ene(e,t,n){return t&&Jte(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tne(e,t,n){return t=ch(t),nne(e,TP()?Reflect.construct(t,n||[],ch(e).constructor):t.apply(e,n))}function nne(e,t){if(t&&(Ro(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rne(e)}function rne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TP=function(){return!!e})()}function ch(e){return ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ch(e)}function ine(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&&Pv(e,t)}function Pv(e,t){return Pv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Pv(e,t)}function IE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IE(Object(n),!0).forEach(function(r){l0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l0(e,t,n){return t=CP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CP(e){var t=ane(e,"string");return Ro(t)=="symbol"?t:t+""}function ane(e,t){if(Ro(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ro(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function sne(e,t){return une(e)||cne(e,t)||lne(e,t)||one()}function one(){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 lne(e,t){if(e){if(typeof e=="string")return LE(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 LE(e,t)}}function LE(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 cne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function une(e){if(Array.isArray(e))return e}function Mv(){return Mv=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},Mv.apply(this,arguments)}var dne=function(t,n){var r;return H.isValidElement(t)?r=H.cloneElement(t,n):De(t)?r=t(n):r=H.createElement("line",Mv({},n,{className:"recharts-reference-line-line"})),r},fne=function(t,n,r,i,a,o,l,c,u){var d=a.x,f=a.y,h=a.width,p=a.height;if(r){var g=u.y,m=t.y.apply(g,{position:o});if(Yr(u,"discard")&&!t.y.isInRange(m))return null;var v=[{x:d+h,y:m},{x:d,y:m}];return c==="left"?v.reverse():v}if(n){var y=u.x,b=t.x.apply(y,{position:o});if(Yr(u,"discard")&&!t.x.isInRange(b))return null;var x=[{x:b,y:f+p},{x:b,y:f}];return l==="top"?x.reverse():x}if(i){var k=u.segment,S=k.map(function(w){return t.apply(w,{position:o})});return Yr(u,"discard")&&Iee(S,function(w){return!t.isInRange(w)})?null:S}return null};function hne(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=Kte(),d=jP(i),f=AP(a),h=Xte();if(!u||!h)return null;mi(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=r0({x:d.scale,y:f.scale}),g=Ut(t),m=Ut(n),v=r&&r.length===2,y=fne(p,g,m,v,h,e.position,d.orientation,f.orientation,e);if(!y)return null;var b=sne(y,2),x=b[0],k=x.x,S=x.y,w=b[1],_=w.x,N=w.y,C=Yr(e,"hidden")?"url(#".concat(u,")"):void 0,T=$E($E({clipPath:C},Ke(e,!0)),{},{x1:k,y1:S,x2:_,y2:N});return H.createElement(Yt,{className:Ve("recharts-reference-line",l)},dne(o,T),mn.renderCallByParent(e,Ete({x1:k,y1:S,x2:_,y2:N})))}var c0=function(e){function t(){return Qte(this,t),tne(this,t,arguments)}return ine(t,e),ene(t,[{key:"render",value:function(){return H.createElement(hne,this.props)}}])}(H.Component);l0(c0,"displayName","ReferenceLine");l0(c0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Rv(){return Rv=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},Rv.apply(this,arguments)}function Io(e){"@babel/helpers - typeof";return Io=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},Io(e)}function DE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DE(Object(n),!0).forEach(function(r){Tp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mne(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,PP(r.key),r)}}function gne(e,t,n){return t&&mne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yne(e,t,n){return t=uh(t),vne(e,OP()?Reflect.construct(t,n||[],uh(e).constructor):t.apply(e,n))}function vne(e,t){if(t&&(Io(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bne(e)}function bne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OP=function(){return!!e})()}function uh(e){return uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},uh(e)}function xne(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&&Iv(e,t)}function Iv(e,t){return Iv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Iv(e,t)}function Tp(e,t,n){return t=PP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PP(e){var t=wne(e,"string");return Io(t)=="symbol"?t:t+""}function wne(e,t){if(Io(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Io(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Sne=function(t){var n=t.x,r=t.y,i=t.xAxis,a=t.yAxis,o=r0({x:i.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return Yr(t,"discard")&&!o.isInRange(l)?null:l},Cp=function(e){function t(){return pne(this,t),yne(this,t,arguments)}return xne(t,e),gne(t,[{key:"render",value:function(){var r=this.props,i=r.x,a=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=Ut(i),d=Ut(a);if(mi(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=Sne(this.props);if(!f)return null;var h=f.x,p=f.y,g=this.props,m=g.shape,v=g.className,y=Yr(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=BE(BE({clipPath:y},Ke(this.props,!0)),{},{cx:h,cy:p});return H.createElement(Yt,{className:Ve("recharts-reference-dot",v)},t.renderDot(m,b),mn.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(H.Component);Tp(Cp,"displayName","ReferenceDot");Tp(Cp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Tp(Cp,"renderDot",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):De(e)?n=e(t):n=H.createElement(cP,Rv({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function $v(){return $v=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},$v.apply(this,arguments)}function $o(e){"@babel/helpers - typeof";return $o=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},$o(e)}function zE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function FE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zE(Object(n),!0).forEach(function(r){Op(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ene(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,RP(r.key),r)}}function _ne(e,t,n){return t&&Ene(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nne(e,t,n){return t=dh(t),jne(e,MP()?Reflect.construct(t,n||[],dh(e).constructor):t.apply(e,n))}function jne(e,t){if(t&&($o(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ane(e)}function Ane(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MP=function(){return!!e})()}function dh(e){return dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dh(e)}function Tne(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&&Lv(e,t)}function Lv(e,t){return Lv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Lv(e,t)}function Op(e,t,n){return t=RP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RP(e){var t=Cne(e,"string");return $o(t)=="symbol"?t:t+""}function Cne(e,t){if($o(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($o(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var One=function(t,n,r,i,a){var o=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,f=a.yAxis;if(!d||!f)return null;var h=r0({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:i?h.y.apply(u,{position:"end"}):h.y.rangeMax};return Yr(a,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:xP(p,g)},Pp=function(e){function t(){return kne(this,t),Nne(this,t,arguments)}return Tne(t,e),_ne(t,[{key:"render",value:function(){var r=this.props,i=r.x1,a=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;mi(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Ut(i),h=Ut(a),p=Ut(o),g=Ut(l),m=this.props.shape;if(!f&&!h&&!p&&!g&&!m)return null;var v=One(f,h,p,g,this.props);if(!v&&!m)return null;var y=Yr(this.props,"hidden")?"url(#".concat(d,")"):void 0;return H.createElement(Yt,{className:Ve("recharts-reference-area",c)},t.renderRect(m,FE(FE({clipPath:y},Ke(this.props,!0)),v)),mn.renderCallByParent(this.props,v))}}])}(H.Component);Op(Pp,"displayName","ReferenceArea");Op(Pp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Op(Pp,"renderRect",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):De(e)?n=e(t):n=H.createElement(n0,$v({},t,{className:"recharts-reference-area-rect"})),n});function IP(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function Pne(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Nte(r,n)}function Mne(e,t,n){var r=n==="width",i=e.x,a=e.y,o=e.width,l=e.height;return t===1?{start:r?i:a,end:r?i+o:a+l}:{start:r?i+o:a+l,end:r?i:a}}function fh(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function Rne(e,t){return IP(e,t+1)}function Ine(e,t,n,r,i){for(var a=(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:IP(r,u)};var m=c,v,y=function(){return v===void 0&&(v=n(g,m)),v},b=g.coordinate,x=c===0||fh(e,b,y,d,l);x||(c=0,d=o,u+=1),x&&(d=b+e*(y()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}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 UE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?UE(Object(n),!0).forEach(function(r){$ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ne(e,t,n){return t=Lne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lne(e){var t=Dne(e,"string");return ou(t)=="symbol"?t:t+""}function Dne(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 Bne(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(h){var p=a[h],g,m=function(){return g===void 0&&(g=n(p,h)),g};if(h===o-1){var v=e*(p.coordinate+e*m()/2-c);a[h]=p=dn(dn({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate})}else a[h]=p=dn(dn({},p),{},{tickCoord:p.coordinate});var y=fh(e,p.tickCoord,m,l,c);y&&(c=p.tickCoord-e*(m()/2+i),a[h]=dn(dn({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function zne(e,t,n,r,i,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=dn(dn({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=fh(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+i),o[l-1]=dn(dn({},d),{},{isShow:!0}))}for(var g=a?l-1:l,m=function(b){var x=o[b],k,S=function(){return k===void 0&&(k=n(x,b)),k};if(b===0){var w=e*(x.coordinate-e*S()/2-c);o[b]=x=dn(dn({},x),{},{tickCoord:w<0?x.coordinate-w*e:x.coordinate})}else o[b]=x=dn(dn({},x),{},{tickCoord:x.coordinate});var _=fh(e,x.tickCoord,S,c,u);_&&(c=x.tickCoord+e*(S()/2+i),o[b]=dn(dn({},x),{},{isShow:!0}))},v=0;v<g;v++)m(v);return o}function u0(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!i||!i.length||!r)return[];if(ue(c)||Su.isSsr)return Rne(i,typeof c=="number"&&ue(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=d&&p==="width"?tc(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(x,k){var S=De(u)?u(x.value,k):x.value;return p==="width"?Pne(tc(S,{fontSize:t,letterSpacing:n}),g,f):tc(S,{fontSize:t,letterSpacing:n})[p]},v=i.length>=2?Nr(i[1].coordinate-i[0].coordinate):1,y=Mne(a,v,p);return c==="equidistantPreserveStart"?Ine(v,y,m,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=zne(v,y,m,i,o,c==="preserveStartEnd"):h=Bne(v,y,m,i,o),h.filter(function(b){return b.isShow}))}var Fne=["viewBox"],Une=["viewBox"],Wne=["ticks"];function Lo(e){"@babel/helpers - typeof";return Lo=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},Lo(e)}function Js(){return Js=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},Js.apply(this,arguments)}function WE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WE(Object(n),!0).forEach(function(r){d0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Km(e,t){if(e==null)return{};var n=Hne(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Hne(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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HE(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 qne(e,t,n){return t&&HE(e.prototype,t),n&&HE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kne(e,t,n){return t=hh(t),Vne(e,$P()?Reflect.construct(t,n||[],hh(e).constructor):t.apply(e,n))}function Vne(e,t){if(t&&(Lo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yne(e)}function Yne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($P=function(){return!!e})()}function hh(e){return hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hh(e)}function Xne(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&&Dv(e,t)}function Dv(e,t){return Dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Dv(e,t)}function d0(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=Zne(e,"string");return Lo(t)=="symbol"?t:t+""}function Zne(e,t){if(Lo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ol=function(e){function t(n){var r;return Gne(this,t),r=Kne(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Xne(t,e),qne(t,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,o=Km(r,Fne),l=this.props,c=l.viewBox,u=Km(l,Une);return!lo(a,c)||!lo(o,u)||!lo(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.x,o=i.y,l=i.width,c=i.height,u=i.orientation,d=i.tickSize,f=i.mirror,h=i.tickMargin,p,g,m,v,y,b,x=f?-1:1,k=r.tickSize||d,S=ue(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=g=r.coordinate,v=o+ +!f*c,m=v-x*k,b=m-x*h,y=S;break;case"left":m=v=r.coordinate,g=a+ +!f*l,p=g-x*k,y=p-x*h,b=S;break;case"right":m=v=r.coordinate,g=a+ +f*l,p=g+x*k,y=p+x*h,b=S;break;default:p=g=r.coordinate,v=o+ +f*c,m=v+x*k,b=m+x*h,y=S;break}return{line:{x1:p,y1:m,x2:g,y2:v},tick:{x:y,y:b}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=Dt(Dt(Dt({},Ke(this.props,!1)),Ke(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Dt(Dt({},f),{},{x1:i,y1:a+h*l,x2:i+o,y2:a+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=Dt(Dt({},f),{},{x1:i+p*o,y1:a,x2:i+p*o,y2:a+l})}return H.createElement("line",Js({},f,{className:Ve("recharts-cartesian-axis-line",cr(d,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=u0(Dt(Dt({},this.props),{},{ticks:r}),i,a),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),v=Ke(this.props,!1),y=Ke(d,!1),b=Dt(Dt({},v),{},{fill:"none"},Ke(c,!1)),x=p.map(function(k,S){var w=o.getTickLineCoord(k),_=w.line,N=w.tick,C=Dt(Dt(Dt(Dt({textAnchor:g,verticalAnchor:m},v),{},{stroke:"none",fill:u},y),N),{},{index:S,payload:k,visibleTicksCount:p.length,tickFormatter:f});return H.createElement(Yt,Js({className:"recharts-cartesian-axis-tick",key:"tick-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},bf(o.props,k,S)),c&&H.createElement("line",Js({},b,_,{className:Ve("recharts-cartesian-axis-tick-line",cr(c,"className"))})),d&&t.renderTickItem(d,C,"".concat(De(f)?f(k.value,S):k.value).concat(h||"")))});return H.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,o=i.width,l=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var f=this.props,h=f.ticks,p=Km(f,Wne),g=h;return De(c)&&(g=h&&h.length>0?c(this.props):c(p)),o<=0||l<=0||!g||!g.length?null:H.createElement(Yt,{className:Ve("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),mn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var o,l=Ve(i.className,"recharts-cartesian-axis-tick-value");return H.isValidElement(r)?o=H.cloneElement(r,Dt(Dt({},i),{},{className:l})):De(r)?o=r(Dt(Dt({},i),{},{className:l})):o=H.createElement(Mf,Js({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(E.Component);d0(ol,"displayName","CartesianAxis");d0(ol,"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 Qne=["x1","y1","x2","y2","key"],Jne=["offset"];function us(e){"@babel/helpers - typeof";return us=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},us(e)}function GE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).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?GE(Object(n),!0).forEach(function(r){ere(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ere(e,t,n){return t=tre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tre(e){var t=nre(e,"string");return us(t)=="symbol"?t:t+""}function nre(e,t){if(us(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(us(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ga(){return Ga=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},Ga.apply(this,arguments)}function qE(e,t){if(e==null)return{};var n=rre(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rre(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 ire=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return H.createElement("rect",{x:i,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function DP(e,t){var n;if(H.isValidElement(e))n=H.cloneElement(e,t);else if(De(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,o=t.y2,l=t.key,c=qE(t,Qne),u=Ke(c,!1);u.offset;var d=qE(u,Jne);n=H.createElement("line",Ga({},d,{x1:r,y1:i,x2:a,y2:o,fill:"none",key:l}))}return n}function are(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,c){var u=gn(gn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return DP(i,u)});return H.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function sre(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,c){var u=gn(gn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return DP(i,u)});return H.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function ore(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=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+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?i+o-h:d[p+1]-h;if(m<=0)return null;var v=p%t.length;return H.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:m,width:a,stroke:"none",fill:t[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return H.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function lre(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=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+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+l-h:d[p+1]-h;if(m<=0)return null;var v=p%r.length;return H.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:c,stroke:"none",fill:r[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return H.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var cre=function(t,n){var r=t.xAxis,i=t.width,a=t.height,o=t.offset;return KO(u0(gn(gn(gn({},ol.defaultProps),r),{},{ticks:fi(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,n)},ure=function(t,n){var r=t.yAxis,i=t.width,a=t.height,o=t.offset;return KO(u0(gn(gn(gn({},ol.defaultProps),r),{},{ticks:fi(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,n)},Ps={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function qi(e){var t,n,r,i,a,o,l=s0(),c=o0(),u=Zte(),d=gn(gn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ps.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Ps.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Ps.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Ps.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Ps.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Ps.verticalFill,x:ue(e.x)?e.x:u.left,y:ue(e.y)?e.y:u.top,width:ue(e.width)?e.width:u.width,height:ue(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,v=d.horizontalValues,y=d.verticalValues,b=Vte(),x=Yte();if(!ue(p)||p<=0||!ue(g)||g<=0||!ue(f)||f!==+f||!ue(h)||h!==+h)return null;var k=d.verticalCoordinatesGenerator||cre,S=d.horizontalCoordinatesGenerator||ure,w=d.horizontalPoints,_=d.verticalPoints;if((!w||!w.length)&&De(S)){var N=v&&v.length,C=S({yAxis:x?gn(gn({},x),{},{ticks:N?v:x.ticks}):void 0,width:l,height:c,offset:u},N?!0:m);mi(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(us(C),"]")),Array.isArray(C)&&(w=C)}if((!_||!_.length)&&De(k)){var T=y&&y.length,I=k({xAxis:b?gn(gn({},b),{},{ticks:T?y:b.ticks}):void 0,width:l,height:c,offset:u},T?!0:m);mi(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(us(I),"]")),Array.isArray(I)&&(_=I)}return H.createElement("g",{className:"recharts-cartesian-grid"},H.createElement(ire,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),H.createElement(are,Ga({},d,{offset:u,horizontalPoints:w,xAxis:b,yAxis:x})),H.createElement(sre,Ga({},d,{offset:u,verticalPoints:_,xAxis:b,yAxis:x})),H.createElement(ore,Ga({},d,{horizontalPoints:w})),H.createElement(lre,Ga({},d,{verticalPoints:_})))}qi.displayName="CartesianGrid";function Do(e){"@babel/helpers - typeof";return Do=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},Do(e)}function dre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fre(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,FP(r.key),r)}}function hre(e,t,n){return t&&fre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pre(e,t,n){return t=ph(t),mre(e,BP()?Reflect.construct(t,n||[],ph(e).constructor):t.apply(e,n))}function mre(e,t){if(t&&(Do(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gre(e)}function gre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BP=function(){return!!e})()}function ph(e){return ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ph(e)}function yre(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&&Bv(e,t)}function Bv(e,t){return Bv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Bv(e,t)}function zP(e,t,n){return t=FP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FP(e){var t=vre(e,"string");return Do(t)=="symbol"?t:t+""}function vre(e,t){if(Do(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Do(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function zv(){return zv=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},zv.apply(this,arguments)}function bre(e){var t=e.xAxisId,n=s0(),r=o0(),i=jP(t);return i==null?null:E.createElement(ol,zv({},i,{className:Ve("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return fi(o,!0)}}))}var Wr=function(e){function t(){return dre(this,t),pre(this,t,arguments)}return yre(t,e),hre(t,[{key:"render",value:function(){return E.createElement(bre,this.props)}}])}(E.Component);zP(Wr,"displayName","XAxis");zP(Wr,"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 Bo(e){"@babel/helpers - typeof";return Bo=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},Bo(e)}function xre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wre(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,HP(r.key),r)}}function Sre(e,t,n){return t&&wre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function kre(e,t,n){return t=mh(t),Ere(e,UP()?Reflect.construct(t,n||[],mh(e).constructor):t.apply(e,n))}function Ere(e,t){if(t&&(Bo(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 UP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UP=function(){return!!e})()}function mh(e){return mh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mh(e)}function Nre(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&&Fv(e,t)}function Fv(e,t){return Fv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Fv(e,t)}function WP(e,t,n){return t=HP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HP(e){var t=jre(e,"string");return Bo(t)=="symbol"?t:t+""}function jre(e,t){if(Bo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Uv(){return Uv=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},Uv.apply(this,arguments)}var Are=function(t){var n=t.yAxisId,r=s0(),i=o0(),a=AP(n);return a==null?null:E.createElement(ol,Uv({},a,{className:Ve("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(l){return fi(l,!0)}}))},Hr=function(e){function t(){return xre(this,t),kre(this,t,arguments)}return Nre(t,e),Sre(t,[{key:"render",value:function(){return E.createElement(Are,this.props)}}])}(E.Component);WP(Hr,"displayName","YAxis");WP(Hr,"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 KE(e){return Pre(e)||Ore(e)||Cre(e)||Tre()}function Tre(){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 Cre(e,t){if(e){if(typeof e=="string")return Wv(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 Wv(e,t)}}function Ore(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pre(e){if(Array.isArray(e))return Wv(e)}function Wv(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 Hv=function(t,n,r,i,a){var o=Tr(t,c0),l=Tr(t,Cp),c=[].concat(KE(o),KE(l)),u=Tr(t,Pp),d="".concat(i,"Id"),f=i[0],h=n;if(c.length&&(h=c.reduce(function(m,v){if(v.props[d]===r&&Yr(v.props,"extendDomain")&&ue(v.props[f])){var y=v.props[f];return[Math.min(m[0],y),Math.max(m[1],y)]}return m},h)),u.length){var p="".concat(f,"1"),g="".concat(f,"2");h=u.reduce(function(m,v){if(v.props[d]===r&&Yr(v.props,"extendDomain")&&ue(v.props[p])&&ue(v.props[g])){var y=v.props[p],b=v.props[g];return[Math.min(m[0],y,b),Math.max(m[1],y,b)]}return m},h)}return a&&a.length&&(h=a.reduce(function(m,v){return ue(v)?[Math.min(m[0],v),Math.max(m[1],v)]:m},h)),h},GP={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(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 v=this._events[m],y=arguments.length,b,x;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,h),!0;case 5:return v.fn.call(v.context,d,f,h,p),!0;case 6:return v.fn.call(v.context,d,f,h,p,g),!0}for(x=1,b=new Array(y-1);x<y;x++)b[x-1]=arguments[x];v.fn.apply(v.context,b)}else{var k=v.length,S;for(x=0;x<k;x++)switch(v[x].once&&this.removeListener(u,v[x].fn,void 0,!0),y){case 1:v[x].fn.call(v[x].context);break;case 2:v[x].fn.call(v[x].context,d);break;case 3:v[x].fn.call(v[x].context,d,f);break;case 4:v[x].fn.call(v[x].context,d,f,h);break;default:if(!b)for(S=1,b=new Array(y-1);S<y;S++)b[S-1]=arguments[S];v[x].fn.apply(v[x].context,b)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(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,v=[],y=g.length;m<y;m++)(g[m].fn!==d||h&&!g[m].once||f&&g[m].context!==f)&&v.push(g[m]);v.length?this._events[p]=v.length===1?v[0]:v: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})(GP);var Mre=GP.exports;const Rre=Ze(Mre);var Vm=new Rre,Ym="recharts.syncMouseEvents";function lu(e){"@babel/helpers - typeof";return lu=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},lu(e)}function Ire(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $re(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,qP(r.key),r)}}function Lre(e,t,n){return t&&$re(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xm(e,t,n){return t=qP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qP(e){var t=Dre(e,"string");return lu(t)=="symbol"?t:t+""}function Dre(e,t){if(lu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Bre=function(){function e(){Ire(this,e),Xm(this,"activeIndex",0),Xm(this,"coordinateList",[]),Xm(this,"layout","horizontal")}return Lre(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,a=i===void 0?null:i,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=a??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 i=this.container.getBoundingClientRect(),a=i.x,o=i.y,l=i.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=a+c+u,h=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function zre(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&ue(r)&&ue(i))return!0}return!1}function Fre(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function KP(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,o=rn(t,n,r,i),l=rn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function Ure(e,t,n){var r,i,a,o;if(e==="horizontal")r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e==="vertical")i=t.y,o=i,r=n.left,a=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=rn(l,c,u,f),p=rn(l,c,d,f);r=h.x,i=h.y,a=p.x,o=p.y}else return KP(t);return[{x:r,y:i},{x:a,y:o}]}function cu(e){"@babel/helpers - typeof";return cu=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},cu(e)}function VE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VE(Object(n),!0).forEach(function(r){Wre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wre(e,t,n){return t=Hre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hre(e){var t=Gre(e,"string");return cu(t)=="symbol"?t:t+""}function Gre(e,t){if(cu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qre(e){var t,n,r=e.element,i=e.tooltipEventType,a=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||!a||!o||h!=="ScatterChart"&&i!=="axis")return null;var g,m=Vk;if(h==="ScatterChart")g=o,m=aJ;else if(h==="BarChart")g=Fre(f,o,c,d),m=n0;else if(f==="radial"){var v=KP(o),y=v.cx,b=v.cy,x=v.radius,k=v.startAngle,S=v.endAngle;g={cx:y,cy:b,startAngle:k,endAngle:S,innerRadius:x,outerRadius:x},m=QO}else g={points:Ure(f,o,c)},m=Vk;var w=hd(hd(hd(hd({stroke:"#ccc",pointerEvents:"none"},c),g),Ke(p,!1)),{},{payload:l,payloadIndex:u,className:Ve("recharts-tooltip-cursor",p.className)});return E.isValidElement(p)?E.cloneElement(p,w):E.createElement(m,w)}var Kre=["item"],Vre=["children","className","width","height","style","compact","title","desc"];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 eo(){return eo=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},eo.apply(this,arguments)}function YE(e,t){return Zre(e)||Xre(e,t)||YP(e,t)||Yre()}function Yre(){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 Xre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Zre(e){if(Array.isArray(e))return e}function XE(e,t){if(e==null)return{};var n=Qre(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qre(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 eie(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,XP(r.key),r)}}function tie(e,t,n){return t&&eie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nie(e,t,n){return t=gh(t),rie(e,VP()?Reflect.construct(t,n||[],gh(e).constructor):t.apply(e,n))}function rie(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 iie(e)}function iie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VP=function(){return!!e})()}function gh(e){return gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gh(e)}function aie(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&&Gv(e,t)}function Gv(e,t){return Gv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Gv(e,t)}function Fo(e){return lie(e)||oie(e)||YP(e)||sie()}function sie(){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 YP(e,t){if(e){if(typeof e=="string")return qv(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 qv(e,t)}}function oie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lie(e){if(Array.isArray(e))return qv(e)}function qv(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 ZE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZE(Object(n),!0).forEach(function(r){Te(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Te(e,t,n){return t=XP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XP(e){var t=cie(e,"string");return zo(t)=="symbol"?t:t+""}function cie(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(t==="string"?String:Number)(e)}var uie={xAxis:["bottom","top"],yAxis:["left","right"]},die={width:"100%",height:"100%"},ZP={x:0,y:0};function pd(e){return e}var fie=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},hie=function(t,n,r,i){var a=n.find(function(d){return d&&d.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,l=i.radius;return Q(Q(Q({},i),rn(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=i.angle;return Q(Q(Q({},i),rn(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return ZP},Mp=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,a=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Fo(l),Fo(u)):l},[]);return o.length>0?o:t&&t.length&&ue(i)&&ue(a)?t.slice(i,a+1):[]};function QP(e){return e==="number"?[0,"auto"]:void 0}var Kv=function(t,n,r,i){var a=t.graphicalItems,o=t.tooltipAxis,l=Mp(n,t);return r<0||!a||!a.length||r>=l.length?null:a.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,i)}else h=f&&f[r]||l[r];return h?[].concat(Fo(c),[YO(u,h)]):c},[])},QE=function(t,n,r,i){var a=i||{x:t.chartX,y:t.chartY},o=fie(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=LY(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=Kv(t,n,d,f),p=hie(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},pie=function(t,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=qO(d,a);return r.reduce(function(g,m){var v,y=m.type.defaultProps!==void 0?Q(Q({},m.type.defaultProps),m.props):m.props,b=y.type,x=y.dataKey,k=y.allowDataOverflow,S=y.allowDuplicatedCategory,w=y.scale,_=y.ticks,N=y.includeHidden,C=y[o];if(g[C])return g;var T=Mp(t.data,{graphicalItems:i.filter(function(L){var P,ce=o in L.props?L.props[o]:(P=L.type.defaultProps)===null||P===void 0?void 0:P[o];return ce===C}),dataStartIndex:c,dataEndIndex:u}),I=T.length,M,$,R;zre(y.domain,k,b)&&(M=hv(y.domain,null,k),p&&(b==="number"||w!=="auto")&&(R=rc(T,x,"category")));var z=QP(b);if(!M||M.length===0){var D,U=(D=y.domain)!==null&&D!==void 0?D:z;if(x){if(M=rc(T,x,b),b==="category"&&p){var O=_3(M);S&&O?($=M,M=ih(0,I)):S||(M=Ik(U,M,m).reduce(function(L,P){return L.indexOf(P)>=0?L:[].concat(Fo(L),[P])},[]))}else if(b==="category")S?M=M.filter(function(L){return L!==""&&!Ye(L)}):M=Ik(U,M,m).reduce(function(L,P){return L.indexOf(P)>=0||P===""||Ye(P)?L:[].concat(Fo(L),[P])},[]);else if(b==="number"){var F=UY(T,i.filter(function(L){var P,ce,we=o in L.props?L.props[o]:(P=L.type.defaultProps)===null||P===void 0?void 0:P[o],pe="hide"in L.props?L.props.hide:(ce=L.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return we===C&&(N||!pe)}),x,a,d);F&&(M=F)}p&&(b==="number"||w!=="auto")&&(R=rc(T,x,"category"))}else p?M=ih(0,I):l&&l[C]&&l[C].hasStack&&b==="number"?M=h==="expand"?[0,1]:VO(l[C].stackGroups,c,u):M=GO(T,i.filter(function(L){var P=o in L.props?L.props[o]:L.type.defaultProps[o],ce="hide"in L.props?L.props.hide:L.type.defaultProps.hide;return P===C&&(N||!ce)}),b,d,!0);if(b==="number")M=Hv(f,M,C,a,_),U&&(M=hv(U,M,k));else if(b==="category"&&U){var A=U,Z=M.every(function(L){return A.indexOf(L)>=0});Z&&(M=A)}}return Q(Q({},g),{},Te({},C,Q(Q({},y),{},{axisType:a,domain:M,categoricalDomain:R,duplicateDomain:$,originalDomain:(v=y.domain)!==null&&v!==void 0?v:z,isCategorical:p,layout:d})))},{})},mie=function(t,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=Mp(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=qO(d,a),m=-1;return r.reduce(function(v,y){var b=y.type.defaultProps!==void 0?Q(Q({},y.type.defaultProps),y.props):y.props,x=b[o],k=QP("number");if(!v[x]){m++;var S;return g?S=ih(0,p):l&&l[x]&&l[x].hasStack?(S=VO(l[x].stackGroups,c,u),S=Hv(f,S,x,a)):(S=hv(k,GO(h,r.filter(function(w){var _,N,C=o in w.props?w.props[o]:(_=w.type.defaultProps)===null||_===void 0?void 0:_[o],T="hide"in w.props?w.props.hide:(N=w.type.defaultProps)===null||N===void 0?void 0:N.hide;return C===x&&!T}),"number",d),i.defaultProps.allowDataOverflow),S=Hv(f,S,x,a)),Q(Q({},v),{},Te({},x,Q(Q({axisType:a},i.defaultProps),{},{hide:!0,orientation:cr(uie,"".concat(a,".").concat(m%2),null),domain:S,originalDomain:k,isCategorical:g,layout:d})))}return v},{})},gie=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(i,"Id"),h=Tr(d,a),p={};return h&&h.length?p=pie(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=mie(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},yie=function(t){var n=Gi(t),r=fi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Ax(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Vf(n,r)}},JE=function(t){var n=t.children,r=t.defaultShowTooltip,i=Gn(n,Po),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},vie=function(t){return!t||!t.length?!1:t.some(function(n){var r=pi(n&&n.type);return r&&r.indexOf("Bar")>=0})},e_=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"}},bie=function(t,n){var r=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=Gn(f,Po),g=Gn(f,Ya),m=Object.keys(c).reduce(function(S,w){var _=c[w],N=_.orientation;return!_.mirror&&!_.hide?Q(Q({},S),{},Te({},N,S[N]+_.width)):S},{left:h.left||0,right:h.right||0}),v=Object.keys(o).reduce(function(S,w){var _=o[w],N=_.orientation;return!_.mirror&&!_.hide?Q(Q({},S),{},Te({},N,cr(S,"".concat(N))+_.height)):S},{top:h.top||0,bottom:h.bottom||0}),y=Q(Q({},v),m),b=y.bottom;p&&(y.bottom+=p.props.height||Po.defaultProps.height),g&&n&&(y=zY(y,i,r,n));var x=u-y.left-y.right,k=d-y.top-y.bottom;return Q(Q({brushBottom:b},y),{},{width:Math.max(x,0),height:Math.max(k,0)})},xie=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},wie=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(y,b){var x=b.graphicalItems,k=b.stackGroups,S=b.offset,w=b.updateId,_=b.dataStartIndex,N=b.dataEndIndex,C=y.barSize,T=y.layout,I=y.barGap,M=y.barCategoryGap,$=y.maxBarSize,R=e_(T),z=R.numericAxisName,D=R.cateAxisName,U=vie(x),O=[];return x.forEach(function(F,A){var Z=Mp(y.data,{graphicalItems:[F],dataStartIndex:_,dataEndIndex:N}),L=F.type.defaultProps!==void 0?Q(Q({},F.type.defaultProps),F.props):F.props,P=L.dataKey,ce=L.maxBarSize,we=L["".concat(z,"Id")],pe=L["".concat(D,"Id")],Pe={},G=c.reduce(function(Ae,He){var Ie=b["".concat(He.axisType,"Map")],xn=L["".concat(He.axisType,"Id")];Ie&&Ie[xn]||He.axisType==="zAxis"||cs();var $t=Ie[xn];return Q(Q({},Ae),{},Te(Te({},He.axisType,$t),"".concat(He.axisType,"Ticks"),fi($t)))},Pe),X=G[D],ae=G["".concat(D,"Ticks")],le=k&&k[we]&&k[we].hasStack&&eX(F,k[we].stackGroups),Y=pi(F.type).indexOf("Bar")>=0,_e=Vf(X,ae),Ee=[],je=U&&DY({barSize:C,stackGroups:k,totalSize:xie(G,D)});if(Y){var ve,$e,fe=Ye(ce)?$:ce,vt=(ve=($e=Vf(X,ae,!0))!==null&&$e!==void 0?$e:fe)!==null&&ve!==void 0?ve:0;Ee=BY({barGap:I,barCategoryGap:M,bandSize:vt!==_e?vt:_e,sizeList:je[pe],maxBarSize:fe}),vt!==_e&&(Ee=Ee.map(function(Ae){return Q(Q({},Ae),{},{position:Q(Q({},Ae.position),{},{offset:Ae.position.offset-vt/2})})}))}var Le=F&&F.type&&F.type.getComposedData;Le&&O.push({props:Q(Q({},Le(Q(Q({},G),{},{displayedData:Z,props:y,dataKey:P,item:F,bandSize:_e,barPosition:Ee,offset:S,stackedData:le,layout:T,dataStartIndex:_,dataEndIndex:N}))),{},Te(Te(Te({key:F.key||"item-".concat(A)},z,G[z]),D,G[D]),"animationId",w)),childIndex:L3(F,y.children),item:F})}),O},p=function(y,b){var x=y.props,k=y.dataStartIndex,S=y.dataEndIndex,w=y.updateId;if(!T1({props:x}))return null;var _=x.children,N=x.layout,C=x.stackOffset,T=x.data,I=x.reverseStackOrder,M=e_(N),$=M.numericAxisName,R=M.cateAxisName,z=Tr(_,r),D=ZY(T,z,"".concat($,"Id"),"".concat(R,"Id"),C,I),U=c.reduce(function(L,P){var ce="".concat(P.axisType,"Map");return Q(Q({},L),{},Te({},ce,gie(x,Q(Q({},P),{},{graphicalItems:z,stackGroups:P.axisType===$&&D,dataStartIndex:k,dataEndIndex:S}))))},{}),O=bie(Q(Q({},U),{},{props:x,graphicalItems:z}),b==null?void 0:b.legendBBox);Object.keys(U).forEach(function(L){U[L]=d(x,U[L],O,L.replace("Map",""),n)});var F=U["".concat(R,"Map")],A=yie(F),Z=h(x,Q(Q({},U),{},{dataStartIndex:k,dataEndIndex:S,updateId:w,graphicalItems:z,stackGroups:D,offset:O}));return Q(Q({formattedGraphicalItems:Z,graphicalItems:z,offset:O,stackGroups:D},A),U)},g=function(v){function y(b){var x,k,S;return Jre(this,y),S=nie(this,y,[b]),Te(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Te(S,"accessibilityManager",new Bre),Te(S,"handleLegendBBoxUpdate",function(w){if(w){var _=S.state,N=_.dataStartIndex,C=_.dataEndIndex,T=_.updateId;S.setState(Q({legendBBox:w},p({props:S.props,dataStartIndex:N,dataEndIndex:C,updateId:T},Q(Q({},S.state),{},{legendBBox:w}))))}}),Te(S,"handleReceiveSyncEvent",function(w,_,N){if(S.props.syncId===w){if(N===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(_)}}),Te(S,"handleBrushChange",function(w){var _=w.startIndex,N=w.endIndex;if(_!==S.state.dataStartIndex||N!==S.state.dataEndIndex){var C=S.state.updateId;S.setState(function(){return Q({dataStartIndex:_,dataEndIndex:N},p({props:S.props,dataStartIndex:_,dataEndIndex:N,updateId:C},S.state))}),S.triggerSyncEvent({dataStartIndex:_,dataEndIndex:N})}}),Te(S,"handleMouseEnter",function(w){var _=S.getMouseInfo(w);if(_){var N=Q(Q({},_),{},{isTooltipActive:!0});S.setState(N),S.triggerSyncEvent(N);var C=S.props.onMouseEnter;De(C)&&C(N,w)}}),Te(S,"triggeredAfterMouseMove",function(w){var _=S.getMouseInfo(w),N=_?Q(Q({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(N),S.triggerSyncEvent(N);var C=S.props.onMouseMove;De(C)&&C(N,w)}),Te(S,"handleItemMouseEnter",function(w){S.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Te(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Te(S,"handleMouseMove",function(w){w.persist(),S.throttleTriggeredAfterMouseMove(w)}),Te(S,"handleMouseLeave",function(w){S.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};S.setState(_),S.triggerSyncEvent(_);var N=S.props.onMouseLeave;De(N)&&N(_,w)}),Te(S,"handleOuterEvent",function(w){var _=$3(w),N=cr(S.props,"".concat(_));if(_&&De(N)){var C,T;/.*touch.*/i.test(_)?T=S.getMouseInfo(w.changedTouches[0]):T=S.getMouseInfo(w),N((C=T)!==null&&C!==void 0?C:{},w)}}),Te(S,"handleClick",function(w){var _=S.getMouseInfo(w);if(_){var N=Q(Q({},_),{},{isTooltipActive:!0});S.setState(N),S.triggerSyncEvent(N);var C=S.props.onClick;De(C)&&C(N,w)}}),Te(S,"handleMouseDown",function(w){var _=S.props.onMouseDown;if(De(_)){var N=S.getMouseInfo(w);_(N,w)}}),Te(S,"handleMouseUp",function(w){var _=S.props.onMouseUp;if(De(_)){var N=S.getMouseInfo(w);_(N,w)}}),Te(S,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Te(S,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&S.handleMouseDown(w.changedTouches[0])}),Te(S,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&S.handleMouseUp(w.changedTouches[0])}),Te(S,"handleDoubleClick",function(w){var _=S.props.onDoubleClick;if(De(_)){var N=S.getMouseInfo(w);_(N,w)}}),Te(S,"handleContextMenu",function(w){var _=S.props.onContextMenu;if(De(_)){var N=S.getMouseInfo(w);_(N,w)}}),Te(S,"triggerSyncEvent",function(w){S.props.syncId!==void 0&&Vm.emit(Ym,S.props.syncId,w,S.eventEmitterSymbol)}),Te(S,"applySyncEvent",function(w){var _=S.props,N=_.layout,C=_.syncMethod,T=S.state.updateId,I=w.dataStartIndex,M=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)S.setState(Q({dataStartIndex:I,dataEndIndex:M},p({props:S.props,dataStartIndex:I,dataEndIndex:M,updateId:T},S.state)));else if(w.activeTooltipIndex!==void 0){var $=w.chartX,R=w.chartY,z=w.activeTooltipIndex,D=S.state,U=D.offset,O=D.tooltipTicks;if(!U)return;if(typeof C=="function")z=C(O,w);else if(C==="value"){z=-1;for(var F=0;F<O.length;F++)if(O[F].value===w.activeLabel){z=F;break}}var A=Q(Q({},U),{},{x:U.left,y:U.top}),Z=Math.min($,A.x+A.width),L=Math.min(R,A.y+A.height),P=O[z]&&O[z].value,ce=Kv(S.state,S.props.data,z),we=O[z]?{x:N==="horizontal"?O[z].coordinate:Z,y:N==="horizontal"?L:O[z].coordinate}:ZP;S.setState(Q(Q({},w),{},{activeLabel:P,activeCoordinate:we,activePayload:ce,activeTooltipIndex:z}))}else S.setState(w)}),Te(S,"renderCursor",function(w){var _,N=S.state,C=N.isTooltipActive,T=N.activeCoordinate,I=N.activePayload,M=N.offset,$=N.activeTooltipIndex,R=N.tooltipAxisBandSize,z=S.getTooltipEventType(),D=(_=w.props.active)!==null&&_!==void 0?_:C,U=S.props.layout,O=w.key||"_recharts-cursor";return H.createElement(qre,{key:O,activeCoordinate:T,activePayload:I,activeTooltipIndex:$,chartName:n,element:w,isActive:D,layout:U,offset:M,tooltipAxisBandSize:R,tooltipEventType:z})}),Te(S,"renderPolarAxis",function(w,_,N){var C=cr(w,"type.axisType"),T=cr(S.state,"".concat(C,"Map")),I=w.type.defaultProps,M=I!==void 0?Q(Q({},I),w.props):w.props,$=T&&T[M["".concat(C,"Id")]];return E.cloneElement(w,Q(Q({},$),{},{className:Ve(C,$.className),key:w.key||"".concat(_,"-").concat(N),ticks:fi($,!0)}))}),Te(S,"renderPolarGrid",function(w){var _=w.props,N=_.radialLines,C=_.polarAngles,T=_.polarRadius,I=S.state,M=I.radiusAxisMap,$=I.angleAxisMap,R=Gi(M),z=Gi($),D=z.cx,U=z.cy,O=z.innerRadius,F=z.outerRadius;return E.cloneElement(w,{polarAngles:Array.isArray(C)?C:fi(z,!0).map(function(A){return A.coordinate}),polarRadius:Array.isArray(T)?T:fi(R,!0).map(function(A){return A.coordinate}),cx:D,cy:U,innerRadius:O,outerRadius:F,key:w.key||"polar-grid",radialLines:N})}),Te(S,"renderLegend",function(){var w=S.state.formattedGraphicalItems,_=S.props,N=_.children,C=_.width,T=_.height,I=S.props.margin||{},M=C-(I.left||0)-(I.right||0),$=WO({children:N,formattedGraphicalItems:w,legendWidth:M,legendContent:u});if(!$)return null;var R=$.item,z=XE($,Kre);return E.cloneElement(R,Q(Q({},z),{},{chartWidth:C,chartHeight:T,margin:I,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Te(S,"renderTooltip",function(){var w,_=S.props,N=_.children,C=_.accessibilityLayer,T=Gn(N,hn);if(!T)return null;var I=S.state,M=I.isTooltipActive,$=I.activeCoordinate,R=I.activePayload,z=I.activeLabel,D=I.offset,U=(w=T.props.active)!==null&&w!==void 0?w:M;return E.cloneElement(T,{viewBox:Q(Q({},D),{},{x:D.left,y:D.top}),active:U,label:z,payload:U?R:[],coordinate:$,accessibilityLayer:C})}),Te(S,"renderBrush",function(w){var _=S.props,N=_.margin,C=_.data,T=S.state,I=T.offset,M=T.dataStartIndex,$=T.dataEndIndex,R=T.updateId;return E.cloneElement(w,{key:w.key||"_recharts-brush",onChange:cd(S.handleBrushChange,w.props.onChange),data:C,x:ue(w.props.x)?w.props.x:I.left,y:ue(w.props.y)?w.props.y:I.top+I.height+I.brushBottom-(N.bottom||0),width:ue(w.props.width)?w.props.width:I.width,startIndex:M,endIndex:$,updateId:"brush-".concat(R)})}),Te(S,"renderReferenceElement",function(w,_,N){if(!w)return null;var C=S,T=C.clipPathId,I=S.state,M=I.xAxisMap,$=I.yAxisMap,R=I.offset,z=w.type.defaultProps||{},D=w.props,U=D.xAxisId,O=U===void 0?z.xAxisId:U,F=D.yAxisId,A=F===void 0?z.yAxisId:F;return E.cloneElement(w,{key:w.key||"".concat(_,"-").concat(N),xAxis:M[O],yAxis:$[A],viewBox:{x:R.left,y:R.top,width:R.width,height:R.height},clipPathId:T})}),Te(S,"renderActivePoints",function(w){var _=w.item,N=w.activePoint,C=w.basePoint,T=w.childIndex,I=w.isRange,M=[],$=_.props.key,R=_.item.type.defaultProps!==void 0?Q(Q({},_.item.type.defaultProps),_.item.props):_.item.props,z=R.activeDot,D=R.dataKey,U=Q(Q({index:T,dataKey:D,cx:N.x,cy:N.y,r:4,fill:t0(_.item),strokeWidth:2,stroke:"#fff",payload:N.payload,value:N.value},Ke(z,!1)),vf(z));return M.push(y.renderActiveDot(z,U,"".concat($,"-activePoint-").concat(T))),C?M.push(y.renderActiveDot(z,Q(Q({},U),{},{cx:C.x,cy:C.y}),"".concat($,"-basePoint-").concat(T))):I&&M.push(null),M}),Te(S,"renderGraphicChild",function(w,_,N){var C=S.filterFormatItem(w,_,N);if(!C)return null;var T=S.getTooltipEventType(),I=S.state,M=I.isTooltipActive,$=I.tooltipAxis,R=I.activeTooltipIndex,z=I.activeLabel,D=S.props.children,U=Gn(D,hn),O=C.props,F=O.points,A=O.isRange,Z=O.baseLine,L=C.item.type.defaultProps!==void 0?Q(Q({},C.item.type.defaultProps),C.item.props):C.item.props,P=L.activeDot,ce=L.hide,we=L.activeBar,pe=L.activeShape,Pe=!!(!ce&&M&&U&&(P||we||pe)),G={};T!=="axis"&&U&&U.props.trigger==="click"?G={onClick:cd(S.handleItemMouseEnter,w.props.onClick)}:T!=="axis"&&(G={onMouseLeave:cd(S.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:cd(S.handleItemMouseEnter,w.props.onMouseEnter)});var X=E.cloneElement(w,Q(Q({},C.props),G));function ae(He){return typeof $.dataKey=="function"?$.dataKey(He.payload):null}if(Pe)if(R>=0){var le,Y;if($.dataKey&&!$.allowDuplicatedCategory){var _e=typeof $.dataKey=="function"?ae:"payload.".concat($.dataKey.toString());le=Ny(F,_e,z),Y=A&&Z&&Ny(Z,_e,z)}else le=F==null?void 0:F[R],Y=A&&Z&&Z[R];if(pe||we){var Ee=w.props.activeIndex!==void 0?w.props.activeIndex:R;return[E.cloneElement(w,Q(Q(Q({},C.props),G),{},{activeIndex:Ee})),null,null]}if(!Ye(le))return[X].concat(Fo(S.renderActivePoints({item:C,activePoint:le,basePoint:Y,childIndex:R,isRange:A})))}else{var je,ve=(je=S.getItemByXY(S.state.activeCoordinate))!==null&&je!==void 0?je:{graphicalItem:X},$e=ve.graphicalItem,fe=$e.item,vt=fe===void 0?w:fe,Le=$e.childIndex,Ae=Q(Q(Q({},C.props),G),{},{activeIndex:Le});return[E.cloneElement(vt,Ae),null,null]}return A?[X,null,null]:[X,null]}),Te(S,"renderCustomized",function(w,_,N){return E.cloneElement(w,Q(Q({key:"recharts-customized-".concat(N)},S.props),S.state))}),Te(S,"renderMap",{CartesianGrid:{handler:pd,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:pd},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:pd},YAxis:{handler:pd},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:op("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=HC(S.triggeredAfterMouseMove,(k=b.throttleDelay)!==null&&k!==void 0?k:1e3/60),S.state={},S}return aie(y,v),tie(y,[{key:"componentDidMount",value:function(){var x,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,k=x.children,S=x.data,w=x.height,_=x.layout,N=Gn(k,hn);if(N){var C=N.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length-1)){var T=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,I=Kv(this.state,S,C,T),M=this.state.tooltipTicks[C].coordinate,$=(this.state.offset.top+w)/2,R=_==="horizontal",z=R?{x:M,y:$}:{y:M,x:$},D=this.state.formattedGraphicalItems.find(function(O){var F=O.item;return F.type.name==="Scatter"});D&&(z=Q(Q({},z),D.props.points[C].tooltipPosition),I=D.props.points[C].tooltipPayload);var U={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:T,activePayload:I,activeCoordinate:z};this.setState(U),this.renderCursor(N),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var S,w;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(x){Ay([Gn(x.children,hn)],[Gn(this.props.children,hn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Gn(this.props.children,hn);if(x&&typeof x.props.shared=="boolean"){var k=x.props.shared?"axis":"item";return l.indexOf(k)>=0?k:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var k=this.container,S=k.getBoundingClientRect(),w=cq(S),_={chartX:Math.round(x.pageX-w.left),chartY:Math.round(x.pageY-w.top)},N=S.width/k.offsetWidth||1,C=this.inRange(_.chartX,_.chartY,N);if(!C)return null;var T=this.state,I=T.xAxisMap,M=T.yAxisMap,$=this.getTooltipEventType(),R=QE(this.state,this.props.data,this.props.layout,C);if($!=="axis"&&I&&M){var z=Gi(I).scale,D=Gi(M).scale,U=z&&z.invert?z.invert(_.chartX):null,O=D&&D.invert?D.invert(_.chartY):null;return Q(Q({},_),{},{xValue:U,yValue:O},R)}return R?Q(Q({},_),R):null}},{key:"inRange",value:function(x,k){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=x/S,N=k/S;if(w==="horizontal"||w==="vertical"){var C=this.state.offset,T=_>=C.left&&_<=C.left+C.width&&N>=C.top&&N<=C.top+C.height;return T?{x:_,y:N}:null}var I=this.state,M=I.angleAxisMap,$=I.radiusAxisMap;if(M&&$){var R=Gi(M);return Dk({x:_,y:N},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,k=this.getTooltipEventType(),S=Gn(x,hn),w={};S&&k==="axis"&&(S.props.trigger==="click"?w={onClick:this.handleClick}:w={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 _=vf(this.props,this.handleOuterEvent);return Q(Q({},_),w)}},{key:"addListener",value:function(){Vm.on(Ym,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Vm.removeListener(Ym,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,k,S){for(var w=this.state.formattedGraphicalItems,_=0,N=w.length;_<N;_++){var C=w[_];if(C.item===x||C.props.key===x.key||k===pi(C.item.type)&&S===C.childIndex)return C}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,k=this.state.offset,S=k.left,w=k.top,_=k.height,N=k.width;return H.createElement("defs",null,H.createElement("clipPath",{id:x},H.createElement("rect",{x:S,y:w,height:_,width:N})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(k,S){var w=YE(S,2),_=w[0],N=w[1];return Q(Q({},k),{},Te({},_,N.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(k,S){var w=YE(S,2),_=w[0],N=w[1];return Q(Q({},k),{},Te({},_,N.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(x){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(x){var k=this.state,S=k.formattedGraphicalItems,w=k.activeItem;if(S&&S.length)for(var _=0,N=S.length;_<N;_++){var C=S[_],T=C.props,I=C.item,M=I.type.defaultProps!==void 0?Q(Q({},I.type.defaultProps),I.props):I.props,$=pi(I.type);if($==="Bar"){var R=(T.data||[]).find(function(O){return YQ(x,O)});if(R)return{graphicalItem:C,payload:R}}else if($==="RadialBar"){var z=(T.data||[]).find(function(O){return Dk(x,O)});if(z)return{graphicalItem:C,payload:z}}else if(Np(C,w)||jp(C,w)||ru(C,w)){var D=QJ({graphicalItem:C,activeTooltipItem:w,itemData:M.data}),U=M.activeIndex===void 0?D:M.activeIndex;return{graphicalItem:Q(Q({},C),{},{childIndex:U}),payload:ru(C,w)?M.data[D]:C.props.data[D]}}}return null}},{key:"render",value:function(){var x=this;if(!T1(this))return null;var k=this.props,S=k.children,w=k.className,_=k.width,N=k.height,C=k.style,T=k.compact,I=k.title,M=k.desc,$=XE(k,Vre),R=Ke($,!1);if(T)return H.createElement(RE,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement(Cy,eo({},R,{width:_,height:N,title:I,desc:M}),this.renderClipPath(),O1(S,this.renderMap)));if(this.props.accessibilityLayer){var z,D;R.tabIndex=(z=this.props.tabIndex)!==null&&z!==void 0?z:0,R.role=(D=this.props.role)!==null&&D!==void 0?D:"application",R.onKeyDown=function(O){x.accessibilityManager.keyboardEvent(O)},R.onFocus=function(){x.accessibilityManager.focus()}}var U=this.parseEventsOfWrapper();return H.createElement(RE,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement("div",eo({className:Ve("recharts-wrapper",w),style:Q({position:"relative",cursor:"default",width:_,height:N},C)},U,{ref:function(F){x.container=F}}),H.createElement(Cy,eo({},R,{width:_,height:N,title:I,desc:M,style:die}),this.renderClipPath(),O1(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(E.Component);Te(g,"displayName",n),Te(g,"defaultProps",Q({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Te(g,"getDerivedStateFromProps",function(v,y){var b=v.dataKey,x=v.data,k=v.children,S=v.width,w=v.height,_=v.layout,N=v.stackOffset,C=v.margin,T=y.dataStartIndex,I=y.dataEndIndex;if(y.updateId===void 0){var M=JE(v);return Q(Q(Q({},M),{},{updateId:0},p(Q(Q({props:v},M),{},{updateId:0}),y)),{},{prevDataKey:b,prevData:x,prevWidth:S,prevHeight:w,prevLayout:_,prevStackOffset:N,prevMargin:C,prevChildren:k})}if(b!==y.prevDataKey||x!==y.prevData||S!==y.prevWidth||w!==y.prevHeight||_!==y.prevLayout||N!==y.prevStackOffset||!lo(C,y.prevMargin)){var $=JE(v),R={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},z=Q(Q({},QE(y,x,_)),{},{updateId:y.updateId+1}),D=Q(Q(Q({},$),R),z);return Q(Q(Q({},D),p(Q({props:v},D),y)),{},{prevDataKey:b,prevData:x,prevWidth:S,prevHeight:w,prevLayout:_,prevStackOffset:N,prevMargin:C,prevChildren:k})}if(!Ay(k,y.prevChildren)){var U,O,F,A,Z=Gn(k,Po),L=Z&&(U=(O=Z.props)===null||O===void 0?void 0:O.startIndex)!==null&&U!==void 0?U:T,P=Z&&(F=(A=Z.props)===null||A===void 0?void 0:A.endIndex)!==null&&F!==void 0?F:I,ce=L!==T||P!==I,we=!Ye(x),pe=we&&!ce?y.updateId:y.updateId+1;return Q(Q({updateId:pe},p(Q(Q({props:v},y),{},{updateId:pe,dataStartIndex:L,dataEndIndex:P}),y)),{},{prevChildren:k,dataStartIndex:L,dataEndIndex:P})}return null}),Te(g,"renderActiveDot",function(v,y,b){var x;return E.isValidElement(v)?x=E.cloneElement(v,y):De(v)?x=v(y):x=H.createElement(cP,y),H.createElement(Yt,{className:"recharts-active-dot",key:b},x)});var m=E.forwardRef(function(y,b){return H.createElement(g,eo({},y,{ref:b}))});return m.displayName=g.displayName,m},La=wie({chartName:"BarChart",GraphicalChild:fn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Wr},{axisType:"yAxis",AxisComp:Hr}],formatAxisMap:kte});function t_(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Li(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}const Sie={local:"#3fb950",groq:"#58a6ff",gemini:"#bc8cff",nim:"#39d2c0",openrouter:"#d29922"};function kie({data:e}){var u,d,f;if(!e)return s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Connecting to dashboard..."})]});const{cost:t,history:n,benchmarks:r,memory:i,health:a}=e,o=[{icon:"💰",value:t_(t.totalCost),label:"Total Cost"},{icon:"📞",value:Li(t.totalRequests),label:"API Requests"},{icon:"🧠",value:Li(i.total),label:"Trajectories"},{icon:"📝",value:Li(n.total),label:"Chat Sessions"},{icon:"🏆",value:Li(r.totalRuns),label:"Benchmark Runs"},{icon:"📦",value:Li(a.vectors),label:"Vector Entries"}],l=Object.entries(t.byProvider||{}).map(([h,p])=>({name:h,value:p})).sort((h,p)=>p.value-h.value),c=Object.entries(i.byFingerprint||{}).map(([h,p])=>({name:h.length>15?h.slice(0,13)+"..":h,value:p})).sort((h,p)=>p.value-h.value).slice(0,8);return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"📊 System Overview"}),s.jsx("div",{className:"stats-grid",children:o.map(h=>s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon",children:h.icon}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:h.value}),s.jsx("div",{className:"stat-label",children:h.label})]})]},h.label))}),s.jsxs("div",{className:"memory-health-card",children:[s.jsx("h3",{className:"section-subtitle",children:"🧠 Memory Health"}),s.jsxs("div",{className:"memory-health-stats",children:[s.jsxs("div",{className:"memory-health-stat",children:[s.jsx("span",{className:"memory-health-value",children:Li(i.total)}),s.jsx("span",{className:"memory-health-label",children:"Trajectories"})]}),s.jsxs("div",{className:"memory-health-stat",children:[s.jsx("span",{className:"memory-health-value",children:Li(((u=i.facts)==null?void 0:u.total)||0)}),s.jsx("span",{className:"memory-health-label",children:"Facts Learned"})]}),s.jsxs("div",{className:"memory-health-stat",children:[s.jsx("span",{className:"memory-health-value",children:Li(((d=i.recall)==null?void 0:d.last7d)||0)}),s.jsx("span",{className:"memory-health-label",children:"Recalls This Week"})]}),s.jsxs("div",{className:"memory-health-stat",children:[s.jsx("span",{className:"memory-health-value",children:a.patterns||0}),s.jsx("span",{className:"memory-health-label",children:"Coding Patterns"})]})]}),s.jsxs("p",{className:"memory-health-status",children:["Backend: ",s.jsx("code",{children:i.backend||"local"}),(f=i.recall)!=null&&f.last7d?` · ${i.recall.last7d} recall(s) this week`:" · no recalls yet"]})]}),s.jsx("h3",{className:"section-subtitle",children:"💰 Cost by Provider"}),s.jsx("div",{className:"chart-container",children:l.length>0?s.jsx($a,{width:"100%",height:260,children:s.jsxs(La,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(qi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Wr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Hr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:h=>"$"+h.toFixed(4)}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:h=>[t_(h),"Cost"]}),s.jsx(fn,{dataKey:"value",radius:[4,4,0,0],children:l.map(h=>s.jsx(Mc,{fill:Sie[h.name]||"#58a6ff",fillOpacity:.8},h.name))})]})}):s.jsx("div",{className:"empty-state",children:"No cost data yet."})}),s.jsx("h3",{className:"section-subtitle",children:"📊 Trajectories by Project Type"}),s.jsx("div",{className:"chart-container",children:c.length>0?s.jsx($a,{width:"100%",height:260,children:s.jsxs(La,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(qi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Wr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Hr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(fn,{dataKey:"value",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})}):s.jsx("div",{className:"empty-state",children:"No trajectory data yet."})})]})}const n_={planner:"📋","context-gatherer":"📂",writer:"✏️",reviewer:"👁️",tester:"🧪",debugger:"🐛",runner:"▶️",git:"🔀",package:"📦","github-release":"🏷️",security:"🔒",orchestrator:"🎯"},r_={planner:"#58a6ff","context-gatherer":"#39d2c0",writer:"#d29922",reviewer:"#bc8cff",tester:"#3fb950",debugger:"#f85149",runner:"#58a6ff",git:"#f0883e",package:"#db6d28","github-release":"#3fb950",security:"#f85149",orchestrator:"#f0883e"},Zm={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"},i_={pending:{icon:"⏳",label:"Pending"},running:{icon:"▶️",label:"Running"},completed:{icon:"✅",label:"Done"},failed:{icon:"❌",label:"Failed"}},Eie={pending:"#6e7681",running:"#58a6ff",completed:"#3fb950",failed:"#f85149"};function _ie(e){if(!e||e.nodes.length===0)return null;const t=e.nodes.map(a=>a.startedAt||0).filter(Boolean),n=e.nodes.map(a=>a.completedAt||0).filter(Boolean),r=t.length>0?Math.min(...t):Date.now(),i=n.length>0?Math.max(...n):Date.now();return{id:`live-${r}`,goal:e.pipeline||"Active execution",startedAt:r,endedAt:n.length>0?i:void 0,success:e.nodes.length>0&&e.nodes.every(a=>a.status==="completed"),totalDurationMs:Math.max(0,i-r),phases:e.nodes.map(a=>({id:a.id,agentType:a.agentType,status:a.status,description:a.description,complexity:a.complexity,summary:a.summary,startedAt:a.startedAt,completedAt:a.completedAt,durationMs:a.startedAt&&a.completedAt?a.completedAt-a.startedAt:void 0}))}}function Nie(e,t){const n=[],r=new Set,i=_ie(e);i&&(n.push(i),r.add(i.id));for(const a of(t==null?void 0:t.runs)||[])r.has(a.id)||(n.push(a),r.add(a.id));return n}function Di(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 a_(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function jie(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),i=r.reduce((d,f)=>d+f,0),a=i>0?e.map((d,f)=>r[f]>0?r[f]:i/n):e.map(()=>1),o=a.reduce((d,f)=>d+f,0)||1;let l=0;const c=e.map((d,f)=>{const h=a[f]/o,p=l;return l+=h,{...d,start:p,width:h,dur:a[f]}}),u=t>0?t:o;return{laid:c,total:u}}function Aie({runs:e,selectedRunId:t,onSelectRun:n,onScrub:r}){const[i,a]=E.useState(null),o=e.find(_=>_.id===(t??i))??e[0]??null,[l,c]=E.useState(0),[u,d]=E.useState(!1),f=E.useRef(null),h=E.useRef(!1),p=E.useRef(r);E.useEffect(()=>{p.current=r},[r]),E.useEffect(()=>{var _;!o&&e.length>0?a(e[0].id):o&&!e.some(N=>N.id===o.id)&&a(((_=e[0])==null?void 0:_.id)??null)},[e,o]);const{laid:g,total:m}=E.useMemo(()=>jie((o==null?void 0:o.phases)||[],(o==null?void 0:o.totalDurationMs)||0),[o]),v=m>0?Math.min(1,Math.max(0,l/m)):0,y=E.useMemo(()=>{if(m<=0)return null;const _=v*m;return g.find(N=>_>=N.start*m&&_<(N.start+N.width)*m)||null},[g,v,m]);E.useEffect(()=>{var _;(_=p.current)==null||_.call(p,(y==null?void 0:y.id)??null)},[y==null?void 0:y.id]),E.useEffect(()=>{if(!u)return;const _=setInterval(()=>{c(N=>N+m/2e3*50)},50);return()=>clearInterval(_)},[u,m]),E.useEffect(()=>{u&&m>0&&l>=m&&(d(!1),c(0))},[u,m,l]);const b=E.useCallback(_=>{const N=f.current;if(!N||m<=0)return;const C=N.getBoundingClientRect(),T=C.width||1,I=Math.min(1,Math.max(0,(_-C.left)/T));c(I*m)},[m]),x=_=>{h.current=!0,d(!1),b(_.clientX)};if(E.useEffect(()=>{const _=C=>{h.current&&b(C.clientX)},N=()=>{h.current=!1};return window.addEventListener("pointermove",_),window.addEventListener("pointerup",N),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",N)}},[b]),!o)return s.jsx("div",{className:"phase-timeline phase-timeline-empty",children:s.jsx("p",{children:"No pipeline runs yet. Run an agent task to see its phase timeline here."})});const k=o.id.startsWith("live-"),S=o.phases.filter(_=>_.status==="completed").length,w=o.phases.filter(_=>_.status==="failed").length;return s.jsxs("div",{className:"phase-timeline",children:[s.jsxs("div",{className:"phase-timeline-header",children:[s.jsx("div",{className:"phase-timeline-runs",children:e.map(_=>s.jsxs("button",{className:`phase-run-chip ${_.id===o.id?"active":""} ${_.id.startsWith("live-")?"live":""}`,onClick:()=>{a(_.id),c(0),d(!1),n==null||n(_.id)},title:_.goal,children:[_.id.startsWith("live-")&&s.jsx("span",{className:"dag-live-dot"}),_.engine&&s.jsx("span",{className:`phase-run-chip-engine phase-run-chip-engine-${_.engine}`,children:_.engine==="loop"?"🔁":"⬡"}),_.goal.length>32?_.goal.slice(0,30)+"…":_.goal,s.jsx("span",{className:"phase-run-chip-time",children:a_(_.startedAt)})]},_.id))}),s.jsxs("div",{className:"phase-timeline-meta",children:[k&&s.jsx("span",{className:"dag-live-badge",children:"LIVE"}),o.engine&&s.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"}),s.jsxs("span",{className:"phase-meta-item",children:[o.phases.length," steps"]}),s.jsxs("span",{className:"phase-meta-item phase-meta-ok",children:["✅ ",S]}),w>0&&s.jsxs("span",{className:"phase-meta-item phase-meta-bad",children:["❌ ",w]}),o.turnTelemetry&&s.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&&s.jsxs("span",{className:"phase-meta-bad",children:[" (",o.turnTelemetry.erroredToolCount," err)"]})]}),s.jsxs("span",{className:"phase-meta-item",children:["⏱ ",Di(m)]})]})]}),s.jsxs("div",{className:"phase-timeline-controls",children:[s.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"}),s.jsxs("span",{className:"phase-time-label",children:[Di(l)," / ",Di(m)]}),s.jsx("input",{className:"phase-range",type:"range",min:0,max:m||1,step:1,value:Math.min(l,m||1),onChange:_=>{d(!1),c(Number(_.target.value))},"aria-label":"Scrub pipeline timeline"})]}),s.jsxs("div",{className:"phase-track-wrap",children:[s.jsxs("div",{ref:f,className:"phase-track",onPointerDown:x,style:{cursor:"grab"},children:[g.map(_=>{const N=r_[_.agentType]||"#58a6ff",C=Eie[_.status],T=(y==null?void 0:y.id)===_.id;return s.jsxs("button",{className:`phase-block phase-block-${_.status} ${T?"active":""}`,style:{left:`${_.start*100}%`,width:`${Math.max(_.width*100,2)}%`,background:`linear-gradient(180deg, ${N}cc, ${N}66)`,boxShadow:T?`0 0 0 2px ${C}`:void 0},onClick:I=>{I.stopPropagation(),d(!1),c((_.start+_.width/2)*m)},title:`${Zm[_.agentType]||_.agentType}: ${_.description}`,children:[s.jsx("span",{className:"phase-block-icon",children:n_[_.agentType]||"⚙️"}),s.jsx("span",{className:"phase-block-label",children:Zm[_.agentType]||_.agentType})]},_.id)}),s.jsx("div",{className:"phase-caret",style:{left:`${v*100}%`},onPointerDown:_=>{_.stopPropagation(),x(_)},title:`${Di(l)} elapsed`})]}),s.jsxs("div",{className:"phase-ticks",children:[s.jsx("span",{children:"0"}),s.jsx("span",{children:Di(Math.round(m/2))}),s.jsx("span",{children:Di(m)})]})]}),s.jsx("div",{className:"phase-detail",children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"phase-detail-title",children:[s.jsx("span",{className:"phase-detail-icon",children:n_[y.agentType]||"⚙️"}),s.jsx("span",{className:"phase-detail-agent",style:{color:r_[y.agentType]||"#58a6ff"},children:Zm[y.agentType]||y.agentType}),s.jsxs("span",{className:`phase-status-badge phase-status-${y.status}`,children:[i_[y.status].icon," ",i_[y.status].label]})]}),s.jsx("p",{className:"phase-detail-desc",children:y.description}),s.jsxs("div",{className:"phase-detail-meta",children:[s.jsxs("span",{children:["⏱ ",y.durationMs?Di(y.dur):`~${Di(y.dur)}`]}),y.startedAt?s.jsxs("span",{children:["🕐 ",a_(y.startedAt)]}):null,y.complexity?s.jsxs("span",{children:["🎯 ",y.complexity]}):null]}),y.summary&&s.jsx("p",{className:"phase-detail-summary",children:y.summary})]}):s.jsxs("div",{className:"phase-detail-gap",children:[s.jsx("span",{className:"phase-detail-icon",children:"⏳"}),s.jsx("span",{children:"Between steps — waiting for the next agent."})]})})]})}function Qm(e){return e===void 0?"—":`$${e.toFixed(5)}`}function s_(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 Jm(e){return e===void 0?"—":e.toLocaleString("en-US")}function Tie({jobs:e}){const t=E.useMemo(()=>e.filter(u=>u.batchStats.length>0),[e]),[n,r]=E.useState(null);if(t.length===0)return null;const i=t.find(u=>u.id===n)??t[0],a=i.batchStats,o=a.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 s.jsxs("div",{className:"dag-timeline-section","data-testid":"batch-economy",children:[s.jsxs("h3",{className:"section-subtitle",children:["📊 Per-batch cost & latency"," ",s.jsx("span",{className:"timeline-subtitle",children:"— measured, not estimated"})]}),t.length>1&&s.jsx("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:t.slice(0,5).map(u=>s.jsx("button",{type:"button",className:"dag-loop-turn-chip",onClick:()=>r(u.id),style:{cursor:"pointer",opacity:u.id===i.id?1:.55,fontWeight:u.id===i.id?600:400},children:u.progressLine??u.goal.slice(0,40)},u.id))}),s.jsxs("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:[s.jsxs("span",{className:"dag-loop-turn-chip",children:[i.kind==="long-form"?"📖":"🛠️"," ",i.status]}),s.jsxs("span",{className:"dag-loop-turn-chip",children:[i.progress,"% done"]}),s.jsxs("span",{className:"dag-loop-turn-chip",children:[i.batches," batch",i.batches===1?"":"es"]}),s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[Jm(i.tokens)," tokens · ",Qm(i.costUsd)]}),i.stopReason&&s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["stopped: ",i.stopReason]})]}),s.jsx("div",{className:"dag-table-wrapper",children:s.jsxs("table",{className:"dag-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Batch"}),s.jsx("th",{children:"Done"}),s.jsx("th",{children:"Tokens"}),s.jsx("th",{children:"Cost"}),s.jsx("th",{children:"Time"})]})}),s.jsxs("tbody",{children:[a.map(u=>s.jsxs("tr",{children:[s.jsx("td",{children:u.index}),s.jsx("td",{children:`${Math.round(u.progress)}%`}),s.jsx("td",{children:Jm(u.tokens)}),s.jsx("td",{children:Qm(u.costUsd)}),s.jsx("td",{children:s_(u.durationMs)})]},u.index)),a.some(u=>u.error)&&s.jsx("tr",{children:s.jsxs("td",{colSpan:5,style:{opacity:.75},children:["✗ failures:"," ",a.filter(u=>u.error).map(u=>`#${u.index} ${u.error}`).join(" · ")]})}),s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("strong",{children:"total"})}),s.jsx("td",{children:s.jsx("strong",{children:`${i.progress}%`})}),s.jsx("td",{children:s.jsx("strong",{children:Jm(i.tokens)})}),s.jsx("td",{children:s.jsx("strong",{children:Qm(i.costUsd)})}),s.jsx("td",{children:s.jsx("strong",{children:c===void 0?"—":`~${s_(c)} avg`})})]})]})]})})]})}const o_={planner:"📋","context-gatherer":"📂",writer:"✏️",reviewer:"👁️",tester:"🧪",debugger:"🐛",runner:"▶️",git:"🔀",package:"📦","github-release":"🏷️",security:"🔒",orchestrator:"🎯"},eg={planner:"#58a6ff","context-gatherer":"#39d2c0",writer:"#d29922",reviewer:"#bc8cff",tester:"#3fb950",debugger:"#f85149",runner:"#58a6ff",git:"#f0883e",package:"#db6d28","github-release":"#3fb950",security:"#f85149",orchestrator:"#f0883e"},Cie={pending:{bg:"#1a1f2e",stroke:"#30363d",text:"#6e7681"},running:{bg:"rgba(88, 166, 255, 0.12)",stroke:"#58a6ff",text:"#58a6ff"},completed:{bg:"rgba(63, 185, 80, 0.12)",stroke:"#3fb950",text:"#3fb950"},failed:{bg:"rgba(248, 81, 73, 0.12)",stroke:"#f85149",text:"#f85149"}},l_={pending:"⏳ Pending",running:"▶️ Running",completed:"✅ Done",failed:"❌ Failed"},Ms={trivial:{icon:"🟢",color:"#3fb950"},simple:{icon:"🔵",color:"#58a6ff"},moderate:{icon:"🟡",color:"#d29922"},complex:{icon:"🟠",color:"#f0883e"},critical:{icon:"🔴",color:"#f85149"}},tg={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 Oie(e,t,n=160,r=68,i=40,a=24,o=40){if(e.length===0)return{layoutNodes:[],svgW:400,svgH:200};const l=new Map,c=new Set;function u(v){if(l.has(v))return l.get(v);if(c.has(v))return 0;c.add(v);const y=t.filter(k=>k.to===v);if(y.length===0)return l.set(v,0),0;const x=Math.max(...y.map(k=>u(k.from)))+1;return l.set(v,x),x}for(const v of e)u(v.id);const d=new Map;for(const v of e){const y=l.get(v.id)??0;d.has(y)||d.set(y,[]),d.get(y).push(v)}const f=Math.max(...d.keys()),h=Math.max(...Array.from(d.values()).map(v=>v.length)),p=(f+1)*(n+i)+o*2-i,g=Math.max(h,1)*(r+a)+o*2-a,m=[];for(const v of e){const y=l.get(v.id)??0,b=d.get(y),x=b.indexOf(v),k=b.length,S=k*(r+a)-a,w=g/2-S/2;m.push({...v,x:o+y*(n+i),y:w+x*(r+a),w:n,h:r,step:y,totalInStep:k,indexInStep:x})}return{layoutNodes:m,svgW:p,svgH:g}}function ng(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 c_(e){return e?new Date(e).toLocaleTimeString("en-US",{minute:"2-digit",second:"2-digit"}):""}function Pie({memoryTotal:e}){return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"🔀 Agent Execution DAG"}),s.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."}),s.jsxs("div",{className:"dag-empty",children:[s.jsx("div",{className:"dag-empty-icon",children:"🔀"}),s.jsx("h3",{children:"No Active Pipeline"}),s.jsx("p",{children:"Run an agent task to see the execution pipeline appear here in real time."}),e!==void 0&&e>0&&s.jsxs("p",{className:"dag-empty-hint",children:[s.jsx("code",{children:e})," past executions are stored in memory."]})]})]})}function Mie({data:e}){var A,Z;const t=e==null?void 0:e.dag,n=(A=e==null?void 0:e.memory)==null?void 0:A.total,[r,i]=E.useState(null),[a,o]=E.useState(null),[l,c]=E.useState(void 0),[u,d]=E.useState(void 0),[f,h]=E.useState(void 0);E.useEffect(()=>ee.onDAGEvent(P=>{i(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,v=r?f:(t==null?void 0:t.loopTurn)??f,y=E.useMemo(()=>Nie(p,e==null?void 0:e.pipelineRuns),[p,e==null?void 0:e.pipelineRuns]),b=L=>{o(L)},x=!!(p&&(p.nodes.length>0||p.active)),k=y.length>0,S=!!v,w=((Z=e==null?void 0:e.unattendedJobs)==null?void 0:Z.jobs)??[],_=w.some(L=>L.batchStats.length>0);if(!x&&!k&&!S&&!_)return s.jsx(Pie,{memoryTotal:n});const{nodes:N,edges:C,pipeline:T,active:I}=p??{nodes:[],edges:[],pipeline:null,active:!1},{layoutNodes:M,svgW:$,svgH:R}=Oie(N,C),z=N.filter(L=>L.status==="running").length,D=N.filter(L=>L.status==="completed").length,U=N.filter(L=>L.status==="failed").length,O=N.filter(L=>L.status==="pending").length,F=N.length;return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"🔀 Agent Execution DAG"}),k&&s.jsxs("div",{className:"dag-timeline-section",children:[s.jsxs("h3",{className:"section-subtitle",children:["⏱ Run Timeline ",s.jsx("span",{className:"timeline-subtitle",children:"— scrub to replay · click a run to switch"})]}),s.jsx(Aie,{runs:y,onScrub:b})]}),s.jsx(Tie,{jobs:w}),v&&s.jsxs("div",{className:"dag-loop-turn-card","data-testid":"dag-loop-turn-card",children:[s.jsxs("div",{className:"dag-loop-turn-header",children:[s.jsx("span",{className:"dag-loop-turn-icon",children:"🔁"}),s.jsxs("span",{className:"dag-loop-turn-title",children:["Loop turn — ",v.title||"chat turn"]}),v.active&&s.jsx("span",{className:"dag-loop-turn-live",children:"● recording"})]}),s.jsxs("div",{className:"dag-loop-turn-meta",children:[s.jsxs("span",{className:"dag-loop-turn-chip",children:["🔧 ",v.toolCallCount," tool call",v.toolCallCount===1?"":"s"]}),v.erroredToolCount>0&&s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:["❌ ",v.erroredToolCount," errored"]}),v.provider&&s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[v.provider,v.model?` · ${v.model}`:""]}),typeof v.startedAt=="number"&&s.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["⏱ ",ng(v.startedAt,v.endedAt)]}),v.bounded&&s.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"⛔ bounded"}),v.generationFailed&&s.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"💀 generation failed"}),v.cancelled&&s.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:"✖ cancelled"})]}),v.toolCalls.length>0&&s.jsx("div",{className:"dag-loop-turn-tools",children:v.toolCalls.slice(-12).map((L,P)=>s.jsxs("span",{className:`dag-loop-tool ${L.ok===!1?"dag-loop-tool-error":""}`,title:L.error||`${L.tool}${L.durationMs!==void 0?` · ${L.durationMs}ms`:""}`,children:[L.ok===!1?"❌":"✓"," ",L.tool]},`${L.tool}-${P}`))})]}),x&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`dag-status-bar ${I?"active":""}`,children:[s.jsxs("div",{className:"dag-pipeline-name",children:[I&&s.jsx("span",{className:"dag-live-dot"}),T||"Execution Pipeline"]}),s.jsxs("div",{className:"dag-pipeline-meta",children:[I&&s.jsx("span",{className:"dag-live-badge",children:"LIVE"}),g&&s.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"}),s.jsxs("span",{className:"dag-step-count",children:[F," steps"]}),z>0&&s.jsxs("span",{className:"dag-running-badge",children:["▶ ",z," running"]}),O>0&&s.jsxs("span",{className:"dag-pending-badge",children:["⏳ ",O," pending"]}),s.jsxs("span",{className:"dag-completed-badge",children:["✅ ",D," done"]}),U>0&&s.jsxs("span",{className:"dag-failed-badge",children:["❌ ",U," failed"]})]})]}),s.jsx("div",{className:"dag-container",children:s.jsxs("svg",{width:$,height:R,viewBox:`0 0 ${$} ${R}`,children:[s.jsxs("defs",{children:[C.map(L=>s.jsx("marker",{id:`arrow-${L.from}-${L.to}`,markerWidth:"8",markerHeight:"6",refX:"8",refY:"3",orient:"auto",children:s.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:"#58a6ff"})},`arrow-${L.from}-${L.to}`)),s.jsxs("filter",{id:"glow",children:[s.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),s.jsxs("feMerge",{children:[s.jsx("feMergeNode",{in:"coloredBlur"}),s.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),C.map(L=>{const P=M.find(Y=>Y.id===L.from),ce=M.find(Y=>Y.id===L.to);if(!P||!ce)return null;const we=P.x+P.w,pe=P.y+P.h/2,Pe=ce.x,G=ce.y+ce.h/2,X=(we+Pe)/2,ae=ce.status,le=ae==="failed"?"#f85149":ae==="running"?"#58a6ff":ae==="completed"?"#3fb950":"#30363d";return s.jsx("g",{children:s.jsx("path",{d:`M ${we} ${pe} C ${X} ${pe}, ${X} ${G}, ${Pe} ${G}`,fill:"none",stroke:le,strokeWidth:ae==="pending"?1.5:2.5,strokeOpacity:ae==="pending"?.3:.8,markerEnd:`url(#arrow-${L.from}-${L.to})`,className:"dag-edge"})},`edge-${L.from}-${L.to}`)}),M.map(L=>{const P=Cie[L.status];eg[L.agentType];const ce=o_[L.agentType]||"⚙️",we=tg[L.agentType]||L.agentType,pe=a===L.id,Pe=L.status==="running";return s.jsxs("g",{onClick:()=>o(pe?null:L.id),style:{cursor:"pointer"},className:"dag-node-group",children:[pe&&s.jsx("rect",{x:L.x-4,y:L.y-4,width:L.w+8,height:L.h+8,rx:10,ry:10,fill:"none",stroke:"#58a6ff",strokeWidth:2,strokeOpacity:.5}),s.jsx("rect",{x:L.x,y:L.y,width:L.w,height:L.h,rx:8,ry:8,fill:P.bg,stroke:P.stroke,strokeWidth:Pe?2.5:1.5,strokeOpacity:.9,className:Pe?"dag-node-running":"",filter:Pe?"url(#glow)":void 0}),s.jsxs("text",{x:L.x+10,y:L.y+22,fill:"#e6edf3",fontSize:10,fontWeight:600,children:[ce," ",we]}),s.jsx("text",{x:L.x+L.w-10,y:L.y+22,textAnchor:"end",fill:P.text,fontSize:9,fontWeight:500,children:l_[L.status]}),s.jsx("text",{x:L.x+10,y:L.y+40,fill:"#8b949e",fontSize:9,children:L.description.length>28?L.description.slice(0,26)+"..":L.description}),L.complexity&&Ms[L.complexity]&&s.jsxs("text",{x:L.x+10,y:L.y+54,fill:Ms[L.complexity].color,fontSize:8,fontWeight:600,children:[Ms[L.complexity].icon," ",L.complexity]}),s.jsx("text",{x:L.x+10,y:L.y+56,fill:"#6e7681",fontSize:8,children:ng(L.startedAt,L.completedAt)}),s.jsx("text",{x:L.x+L.w-10,y:L.y+56,textAnchor:"end",fill:"#6e7681",fontSize:8,children:c_(L.startedAt||L.completedAt)}),(L.status==="failed"||pe)&&L.summary&&s.jsx("foreignObject",{x:Math.max(10,L.x-80),y:L.y+L.h+6,width:L.w+160,height:36,children:s.jsx("div",{className:"dag-node-summary",style:{color:L.status==="failed"?"#f85149":"#8b949e",fontSize:"10px",lineHeight:1.4,background:"rgba(13,17,23,0.9)",padding:"4px 8px",borderRadius:"4px",border:`1px solid ${L.status==="failed"?"rgba(248,81,73,0.3)":"rgba(48,54,61,0.5)"}`,maxHeight:"32px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:L.summary})})]},`node-${L.id}`)})]})}),s.jsx("h3",{className:"section-subtitle",children:"Step Details"}),s.jsx("div",{className:"dag-table-wrapper",children:s.jsxs("table",{className:"dag-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Step"}),s.jsx("th",{children:"Agent"}),s.jsx("th",{children:"Complexity"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Duration"}),s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Summary"})]})}),s.jsx("tbody",{children:M.map(L=>s.jsxs("tr",{className:`dag-row dag-row-${L.status}`,children:[s.jsx("td",{className:"dag-cell-step",children:L.step}),s.jsxs("td",{className:"dag-cell-agent",children:[s.jsx("span",{className:"dag-agent-dot",style:{background:eg[L.agentType]||"#58a6ff"}}),tg[L.agentType]||L.agentType]}),s.jsx("td",{className:"dag-cell-complexity",children:L.complexity&&Ms[L.complexity]?s.jsxs("span",{style:{color:Ms[L.complexity].color,fontSize:12},children:[Ms[L.complexity].icon," ",L.complexity]}):s.jsx("span",{style:{color:"#6e7681",fontSize:12},children:"—"})}),s.jsx("td",{className:`dag-cell-status dag-status-${L.status}`,children:l_[L.status]}),s.jsx("td",{className:"dag-cell-duration",children:ng(L.startedAt,L.completedAt)}),s.jsx("td",{className:"dag-cell-time",children:c_(L.startedAt||L.completedAt)}),s.jsx("td",{className:"dag-cell-summary",children:L.summary||L.description||"--"})]},L.id))})]})}),s.jsx("h3",{className:"section-subtitle",children:"Agent Types"}),s.jsxs("div",{className:"dag-legend",children:[Object.entries(o_).map(([L,P])=>s.jsxs("div",{className:"legend-item",children:[s.jsx("span",{className:"legend-dot",style:{background:eg[L]||"#58a6ff"}}),s.jsx("span",{className:"legend-icon",children:P}),s.jsx("span",{className:"legend-label",children:tg[L]||L})]},L)),s.jsxs("div",{className:"legend-item",children:[s.jsx("span",{className:"legend-dot",style:{background:"transparent",border:"2px dashed #58a6ff"}}),s.jsx("span",{className:"legend-icon",children:"⚡"}),s.jsx("span",{className:"legend-label",children:"Live node"})]})]})]})]})}function Rs(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Ll(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function Rie(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Iie({data:e}){if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading cost data..."})});const{cost:t}=e,n=Object.entries(t.byProvider||{}).sort(([,a],[,o])=>o-a),r=Object.entries(t.byModel||{}).sort(([,a],[,o])=>o-a).slice(0,10),i=n.reduce((a,[,o])=>a+o,0);return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"💰 Cost Tracking"}),s.jsxs("div",{className:"cost-summary",children:[s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"Total Spent"}),s.jsx("span",{className:"cost-amount",children:Rs(t.totalCost)})]}),s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"Total Tokens"}),s.jsx("span",{className:"cost-amount",children:Ll(t.totalTokens)})]}),s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"Total Requests"}),s.jsx("span",{className:"cost-amount",children:Ll(t.totalRequests)})]})]}),s.jsxs("div",{className:"cost-summary cost-summary-sub",children:[s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"📏 Measured (exact wire tokens)"}),s.jsx("span",{className:"cost-amount",children:Rs(t.measuredCost)}),s.jsxs("span",{className:"cost-label",children:[Ll(t.measuredCalls)," calls"]})]}),s.jsxs("div",{className:"cost-total",children:[s.jsx("span",{className:"cost-label",children:"📐 Estimated (length-based)"}),s.jsx("span",{className:"cost-amount",children:Rs(t.estimatedCost)}),s.jsxs("span",{className:"cost-label",children:[Ll(t.estimatedCalls)," calls"]})]})]}),s.jsx("h3",{className:"section-subtitle",children:"By Provider"}),s.jsx("div",{className:"cost-list",children:n.length===0?s.jsx("div",{className:"empty-state",children:"No costs recorded yet."}):n.map(([a,o])=>{const l=i>0?(o/i*100).toFixed(1):"0";return s.jsxs("div",{className:"cost-row",children:[s.jsx("span",{className:"cost-row-name",children:a}),s.jsx("div",{className:"cost-row-bar",children:s.jsx("div",{className:"cost-row-fill",style:{width:`${l}%`}})}),s.jsx("span",{className:"cost-row-value",children:Rs(o)})]},a)})}),s.jsx("h3",{className:"section-subtitle",children:"By Model"}),s.jsx("div",{className:"cost-list",children:r.length===0?s.jsx("div",{className:"empty-state",children:"No model costs recorded yet."}):r.map(([a,o])=>{const l=i>0?(o/i*100).toFixed(1):"0",c=a.length>30?a.slice(0,28)+"..":a;return s.jsxs("div",{className:"cost-row",children:[s.jsx("span",{className:"cost-row-name",children:c}),s.jsx("div",{className:"cost-row-bar",children:s.jsx("div",{className:"cost-row-fill",style:{width:`${l}%`}})}),s.jsx("span",{className:"cost-row-value",children:Rs(o)})]},a)})}),s.jsx("h3",{className:"section-subtitle",children:"Recent Requests"}),s.jsx("div",{className:"request-list",children:!t.recent||t.recent.length===0?s.jsx("div",{className:"empty-state",children:"No requests recorded yet."}):t.recent.slice(0,30).map((a,o)=>s.jsxs("div",{className:"request-row",children:[s.jsx("span",{className:"request-time",children:Rie(a.timestamp)}),s.jsx("span",{className:"request-provider",children:a.provider||"--"}),s.jsx("span",{className:"request-model",children:a.model||"--"}),s.jsx("span",{className:"request-cost",children:Rs(a.costUsd)}),s.jsxs("span",{className:"request-tokens",children:[Ll(a.totalTokens)," tok"]})]},o))})]})}function $ie(e){return e==null?"$0.00":"$"+e.toFixed(6)}function md(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function Lie({data:e}){if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading benchmark data..."})});const{benchmarks:t,evals:n}=e,r=t.latest,i=t.runs||[],a=(n==null?void 0:n.runs)||[],o=(n==null?void 0:n.latest)||null,l=a.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=i.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 s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"📈 Benchmark Results"}),s.jsx("div",{className:"benchmark-latest",children:r?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"benchmark-header",children:[s.jsx("strong",{children:"Latest Run:"})," ",r.provider,"/",r.model]}),s.jsxs("div",{className:"benchmark-stats",children:[s.jsxs("div",{className:"benchmark-stat pass",children:[s.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),s.jsx("div",{className:"benchmark-stat-label",children:"Passed"})]}),s.jsxs("div",{className:"benchmark-stat quality",children:[s.jsx("div",{className:"benchmark-stat-value",children:md(r.summary.avgQualityScore)}),s.jsx("div",{className:"benchmark-stat-label",children:"Quality"})]}),s.jsxs("div",{className:"benchmark-stat latency",children:[s.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.medianLatencyMs,"ms"]}),s.jsx("div",{className:"benchmark-stat-label",children:"Latency"})]}),s.jsxs("div",{className:"benchmark-stat fail",children:[s.jsx("div",{className:"benchmark-stat-value",children:$ie(r.summary.totalCostUsd)}),s.jsx("div",{className:"benchmark-stat-label",children:"Cost"})]})]})]}):s.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",s.jsx("code",{children:"buff benchmark"})," to start."]})}),c.length>1&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"Pass Rate by Model"}),s.jsx("div",{className:"chart-container",children:s.jsx($a,{width:"100%",height:260,children:s.jsxs(La,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(qi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Wr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Hr,{domain:[0,100],tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"%"}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Pass Rate"]}),s.jsx(fn,{dataKey:"passRate",radius:[4,4,0,0],children:c.map((u,d)=>s.jsx(Mc,{fill:u.passRate>=80?"#3fb950":u.passRate>=50?"#d29922":"#f85149",fillOpacity:.8},d))})]})})}),s.jsx("h3",{className:"section-subtitle",children:"Latency by Model"}),s.jsx("div",{className:"chart-container",children:s.jsx($a,{width:"100%",height:260,children:s.jsxs(La,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(qi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Wr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Hr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"ms"}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"ms","Latency"]}),s.jsx(fn,{dataKey:"latency",fill:"#d29922",radius:[4,4,0,0],fillOpacity:.8})]})})}),s.jsx("h3",{className:"section-subtitle",children:"Cost by Model"}),s.jsx("div",{className:"chart-container",children:s.jsx($a,{width:"100%",height:260,children:s.jsxs(La,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(qi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Wr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Hr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>"$"+u.toFixed(6)}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>["$"+u.toFixed(6),"Cost"]}),s.jsx(fn,{dataKey:"cost",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})})})]}),s.jsx("h2",{className:"section-title",style:{marginTop:32},children:"🎯 Agent Evaluation"}),s.jsx("p",{className:"section-hint",style:{color:"#8b949e",fontSize:12,marginBottom:16},children:"End-to-end coding tasks run through the full agent pipeline — measures if the agent is actually improving."}),s.jsx("div",{className:"benchmark-latest",children:o?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"benchmark-header",children:[s.jsx("strong",{children:"Latest Eval Run:"})," ",o.provider,"/",o.model]}),s.jsxs("div",{className:"benchmark-stats",children:[s.jsxs("div",{className:"benchmark-stat pass",children:[s.jsxs("div",{className:"benchmark-stat-value",children:[o.summary.tasksPassed,"/",o.summary.totalTasks]}),s.jsx("div",{className:"benchmark-stat-label",children:"Tests Passed"})]}),s.jsxs("div",{className:"benchmark-stat quality",children:[s.jsx("div",{className:"benchmark-stat-value",children:md(o.summary.avgCompositeScore)}),s.jsx("div",{className:"benchmark-stat-label",children:"Composite Score"})]}),s.jsxs("div",{className:"benchmark-stat latency",children:[s.jsx("div",{className:"benchmark-stat-value",children:md(o.summary.recoveryRate)}),s.jsx("div",{className:"benchmark-stat-label",children:"Recovery Rate"})]}),s.jsxs("div",{className:"benchmark-stat fail",children:[s.jsx("div",{className:"benchmark-stat-value",children:o.summary.totalRollbacks}),s.jsx("div",{className:"benchmark-stat-label",children:"Rollbacks"})]}),s.jsxs("div",{className:"benchmark-stat deps",children:[s.jsx("div",{className:"benchmark-stat-value",children:md(o.summary.dependencyInstallRate)}),s.jsx("div",{className:"benchmark-stat-label",children:"Deps Installed"})]})]})]}):s.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",s.jsx("code",{children:"buff eval run"})," to measure the agent end-to-end."]})}),l.length>1&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"Composite Score by Model"}),s.jsx("div",{className:"chart-container",children:s.jsx($a,{width:"100%",height:260,children:s.jsxs(La,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(qi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Wr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Hr,{domain:[0,100],tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"%"}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Composite Score"]}),s.jsx(fn,{dataKey:"score",radius:[4,4,0,0],children:l.map((u,d)=>s.jsx(Mc,{fill:u.score>=80?"#3fb950":u.score>=50?"#d29922":"#f85149",fillOpacity:.8},d))})]})})}),s.jsx("h3",{className:"section-subtitle",children:"Metric Breakdown (completion / tests / recovery / token efficiency)"}),s.jsx("div",{className:"chart-container",children:s.jsx($a,{width:"100%",height:260,children:s.jsxs(La,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(qi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Wr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Hr,{domain:[0,100],tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"%"}),s.jsx(hn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(Ya,{wrapperStyle:{color:"#8b949e"}}),s.jsx(fn,{dataKey:"completion",name:"Completion",fill:"#3fb950",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(fn,{dataKey:"tests",name:"Tests",fill:"#58a6ff",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(fn,{dataKey:"recovery",name:"Recovery",fill:"#d29922",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(fn,{dataKey:"efficiency",name:"Token Eff.",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})})})]}),s.jsx("h3",{className:"section-subtitle",children:"Eval Run History"}),s.jsx("div",{className:"benchmark-list",children:a.length===0?s.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",s.jsx("code",{children:"buff eval run"})," to start."]}):a.map(u=>{const d=Math.round(u.summary.avgCompositeScore*100),f=d>=80?"high":d>=50?"medium":"low";return s.jsxs("div",{className:"benchmark-item",children:[s.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),s.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),s.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})}),s.jsx("h3",{className:"section-subtitle",children:"Run History"}),s.jsx("div",{className:"benchmark-list",children:i.length===0?s.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",s.jsx("code",{children:"buff benchmark"})," to start."]}):i.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 s.jsxs("div",{className:"benchmark-item",children:[s.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),s.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),s.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})})]})}function rg(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function Die({data:e}){if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading system data..."})});const{health:t,serverTime:n}=e;return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"⚙️ System Health"}),s.jsxs("div",{className:"health-grid",children:[s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"💾"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Memory Directory"}),s.jsx("div",{className:"health-path",children:t.memoryDir||"~/.buff/memory/"})]})]}),s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"📝"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Coding Patterns"}),s.jsx("div",{className:"health-value",children:rg(t.patterns)})]})]}),s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"👍"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"User Feedback"}),s.jsxs("div",{className:"health-value",children:[rg(t.feedback)," ratings"]})]})]}),s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"🧠"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Vector Index"}),s.jsxs("div",{className:"health-value",children:[rg(t.vectors)," entries"]})]})]})]}),s.jsx("h3",{className:"section-subtitle",children:"Server Info"}),s.jsxs("div",{className:"server-info",children:[s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Status"}),s.jsx("span",{className:"info-value",children:"● Connected"})]}),s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Last Updated"}),s.jsx("span",{className:"info-value",children:n?new Date(n).toLocaleString():"--"})]}),s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Data Directory"}),s.jsx("span",{className:"info-value",children:t.memoryDir||"~/.buff/memory/"})]})]})]})}const Bie=new Set(["local","lmstudio","vllm"]),zie=new Set([]),yh={available:{bg:"#0a2e1a",text:"#3fb950",dot:"#3fb950",cardBorder:"#3fb950",cardBg:"#0d2818"},limited:{bg:"#2d1f00",text:"#d29922",dot:"#d29922",cardBorder:"#d29922",cardBg:"#1f1700"},unavailable:{bg:"#2d0f0f",text:"#f85149",dot:"#f85149",cardBorder:"#f85149",cardBg:"#1f0a0a"}},Fie=[3,4,5],JP=12e3,u_=[300,700],Uie=6e4,Wie=5e3;function Hie(e){return new Promise(t=>setTimeout(t,e))}async function eM(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{return await fetch(e,{signal:n.signal})}finally{clearTimeout(r)}}function tM(e){return e instanceof TypeError||e instanceof Error&&e.name==="AbortError"}async function Gie(e){let t=null,n=!1;for(let r=0;;r++){try{const i=await eM("/api/models",JP);if(!i.ok)t=i.status;else{const a=await si(i);if(a&&Array.isArray(a.providers))return a;throw new Error("Model health endpoint returned an unexpected response — is the dashboard server up to date?")}}catch(i){if(!tM(i))throw i;n=!0,e==null||e()}if(r>=u_.length)throw new Error(n?"Dashboard server unreachable — is it still running? Retrying automatically…":`Model health endpoint failed (HTTP ${t})`);await Hie(u_[r])}}async function qie(e){for(let t=0;;t++)try{const n=await eM("/api/model-registry",JP);return n.ok?await si(n):null}catch(n){if(!tM(n)||t>=1)return null;e==null||e()}}function Kie(e){return e==="available"?"Available":e==="limited"?"Limited":"Unavailable"}function Vie(e){return e==="available"?"Ready":e==="limited"?"Limited":"Down"}function nM(e){return{local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣",openai:"🤖",anthropic:"🔮",mistral:"🌀",cohere:"🧠",together:"🟢",deepinfra:"🌐",fireworks:"🎆",perplexity:"❓",azure:"🔵",anyscale:"🔷",lmstudio:"🎨",vllm:"⚡"}[e]||"🔌"}function f0(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 d_({status:e,label:t}){const n=yh[e];return s.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:[s.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:n.dot}}),t]})}function Yie({onRefresh:e,loading:t}){return s.jsxs("div",{className:"stats-grid mini",style:{marginBottom:16},children:[s.jsx("button",{onClick:e,disabled:t,className:"stat-card",style:{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,border:"1px solid #30363d",justifyContent:"center",fontSize:13},children:t?"⏳ Testing...":"🔄 Refresh Status"}),s.jsx("div",{className:"stat-card",style:{border:"1px solid #30363d"},children:s.jsx("div",{style:{fontSize:13,color:"#8b949e",textAlign:"center",width:"100%"},children:"Tests all configured providers and their API keys in real time"})})]})}function Xie({data:e}){const t=e.totalModels;if(t===0)return null;const n=e.available||0,r=e.limited||0,i=e.unavailable||0;return s.jsxs("div",{style:{marginBottom:16},children:[s.jsxs("div",{style:{background:"#0d1117",borderRadius:8,overflow:"hidden",height:10,display:"flex",border:"1px solid #21262d"},children:[n>0&&s.jsx("div",{style:{width:`${n/t*100}%`,background:"#3fb950",transition:"width 0.5s"},title:`${n} available`}),r>0&&s.jsx("div",{style:{width:`${r/t*100}%`,background:"#d29922",transition:"width 0.5s"},title:`${r} limited`}),i>0&&s.jsx("div",{style:{width:`${i/t*100}%`,background:"#f85149",transition:"width 0.5s"},title:`${i} unavailable`})]}),s.jsxs("div",{style:{display:"flex",gap:16,marginTop:6,fontSize:12,color:"#8b949e"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#3fb950"},children:"●"})," Ready"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#d29922"},children:"●"})," Limited"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#f85149"},children:"●"})," Unavailable"]})]}),typeof e.routable=="number"&&s.jsxs("div",{style:{marginTop:6,fontSize:12,color:"#8b949e",lineHeight:1.5},children:[s.jsx("strong",{style:{color:"#e6edf3"},children:t})," listed by providers ·"," ",s.jsx("strong",{style:{color:e.routable>0?"#3fb950":"#d29922"},children:e.routable})," ","routable right now (verified, un-parked, not stale)",typeof e.registryTotal=="number"&&e.registryTotal>0&&s.jsxs(s.Fragment,{children:[" ","· registry tracks"," ",s.jsx("strong",{style:{color:"#e6edf3"},children:e.registryVerified??0})," of"," ",s.jsx("strong",{style:{color:"#e6edf3"},children:e.registryTotal})," verified"]})]})]})}function gd({provider:e}){const[t,n]=E.useState(!1),r=yh[e.overallStatus].text,i={available:e.models.filter(a=>a.status==="available").length,limited:e.models.filter(a=>a.status==="limited").length,unavailable:e.models.filter(a=>a.status==="unavailable").length};return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[s.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[s.jsx("span",{style:{fontSize:24},children:e.icon}),s.jsxs("div",{style:{flex:1},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[s.jsx("span",{style:{fontSize:16,fontWeight:600,color:"#e6edf3"},children:e.providerLabel}),s.jsx(d_,{status:e.overallStatus,label:Kie(e.overallStatus)})]}),s.jsxs("div",{style:{fontSize:13,color:"#8b949e"},children:[e.models.length," model",e.models.length!==1?"s":"",i.available>0&&s.jsxs("span",{style:{color:"#3fb950"},children:[" · ",i.available," ready"]}),i.limited>0&&s.jsxs("span",{style:{color:"#d29922"},children:[" · ",i.limited," limited"]}),i.unavailable>0&&s.jsxs("span",{style:{color:"#f85149"},children:[" · ",i.unavailable," unavailable"]})]})]}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e",textAlign:"right"},children:[s.jsx("div",{style:{marginBottom:2,color:e.apiConfigured?"#3fb950":"#f85149"},children:e.apiConfigured?"✅ Key set":"❌ No key"}),s.jsx("div",{style:{color:e.apiAccessible?"#3fb950":"#f85149"},children:e.apiAccessible?"✅ Connected":"❌ Offline"})]}),s.jsx("span",{style:{color:"#8b949e",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{padding:"10px 18px",background:"#0d1117",fontSize:13,color:"#8b949e",display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:8,borderTop:"1px solid #21262d"},children:[s.jsx("span",{children:e.notes}),e.freeTierInfo&&s.jsxs("span",{style:{color:"#d29922"},children:["🎁 ",e.freeTierInfo]})]}),s.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid #21262d"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Model"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Status"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Quota"}),s.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Details"})]})}),s.jsx("tbody",{children:e.models.map((a,o)=>s.jsxs("tr",{style:{borderBottom:o<e.models.length-1?"1px solid #21262d":"none",background:a.status==="unavailable"?"#0d1117":"transparent"},children:[s.jsxs("td",{style:{padding:"8px 18px",color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:yh[a.status].dot,marginRight:8}}),a.name]}),s.jsx("td",{style:{padding:"8px 12px"},children:s.jsx(d_,{status:a.status,label:Vie(a.status)})}),s.jsx("td",{style:{padding:"8px 12px",color:"#8b949e",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:a.rateLimitRemaining!==void 0?a.rateLimitTotal?`${a.rateLimitRemaining}/${a.rateLimitTotal}`:`${a.rateLimitRemaining} left`:"—"}),s.jsx("td",{style:{padding:"8px 18px",color:"#8b949e",fontSize:12},children:a.statusReason})]},a.id))})]})})]})]})}function rM(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 Zie(e){return e==="verified"?{text:"#3fb950",bg:"#0a2e1a",dot:"#3fb950"}:e==="unavailable"?{text:"#f85149",bg:"#2d0f0f",dot:"#f85149"}:{text:"#8b949e",bg:"#21262d",dot:"#8b949e"}}function Qie({rate:e}){const t=Math.round(e*100);return s.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:"#21122e",border:"1px solid #bc8cff",color:"#bc8cff"},children:["⏸ flaky ",t,"%"]})}function Jie({tokens:e}){const t=e>=1048576?`${(e/1048576).toFixed(1).replace(/\.0$/,"")}M`:e>=1024?`${(e/1024).toFixed(0)}K`:`${e}`;return s.jsxs("span",{title:`⏳ context window ${e.toLocaleString()} 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:"#0a1e2e",border:"1px solid #58a6ff",color:"#58a6ff"},children:["⏳ ",t]})}function eae({history:e}){if(!e||e.length<2)return null;const t=46,n=14,r=1.5,i=Math.max(.01,...e.map(d=>d.rate)),a=e.map((d,f)=>{const h=r+f/(e.length-1)*(t-r*2),p=n-r-d.rate/i*(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 s.jsxs("svg",{width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:{marginLeft:8,verticalAlign:"middle",cursor:"default"},"aria-label":"Flakiness trend",children:[s.jsx("title",{children:c?`Flakiness healing — ${u}% now, trending down (clean successes decay the signal)`:`Flakiness climbing — ${u}% now (recent mid-stream interruptions)`}),s.jsx("polyline",{points:a,fill:"none",stroke:"#bc8cff",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),s.jsx("circle",{cx:t-r,cy:n-r-l/i*(n-r*2),r:2,fill:c?"#3fb950":"#bc8cff"})]})}function tae({entry:e}){const t=Zie(e.status),n=e.remainingTokens>=0?`${e.remainingTokens.toLocaleString()} left`:"unlimited";return s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"8px 12px",color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[s.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&&s.jsx(Qie,{rate:e.partialRate??0}),e.partialHistory&&e.partialHistory.length>=2&&s.jsx(eae,{history:e.partialHistory}),e.parked&&s.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,background:"#2d1616",border:"1px solid #f85149",color:"#f85149"},children:"⏸ parked"}),e.measuredSamples?s.jsxs("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"#0a2e1a",border:"1px solid #3fb950",color:"#3fb950"},children:["📏 ",e.measuredInputTokens,"→",e.measuredOutputTokens," tok"]}):s.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"#21262d",border:"1px solid #8b949e",color:"#8b949e"},children:"📐 est"}),e.contextWindowTokens&&s.jsx(Jie,{tokens:e.contextWindowTokens})]}),s.jsx("td",{style:{padding:"8px 12px"},children:s.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"})}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:e.remainingTokens>=0&&e.remainingTokens<=100?"#d29922":"#8b949e"},children:n}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"#8b949e",fontSize:12,whiteSpace:"nowrap"},children:e.resetsInMs>0?rM(e.resetsInMs):"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"#8b949e",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.latencyMs!==void 0?`${e.latencyMs}ms`:"—"}),s.jsx("td",{style:{padding:"8px 12px",color:"#6e7681",fontSize:11,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.lastError||(e.source?`learned via ${e.source}`:"")})]})}function nae({provider:e}){const[t,n]=E.useState(!1),r=e.verified>0?"#3fb950":e.unavailable>0?"#f85149":"#8b949e";return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[s.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[s.jsx("span",{style:{fontSize:24},children:nM(e.provider)}),s.jsxs("div",{style:{flex:1},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[s.jsx("span",{style:{fontSize:16,fontWeight:600,color:"#e6edf3"},children:f0(e.provider)}),s.jsx("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:e.parked>0?"#2d1616":"#12291a",border:`1px solid ${e.parked>0?"#f85149":"#238636"}`,color:e.parked>0?"#f85149":"#3fb950"},children:e.parked>0?`${e.parked} parked`:"routable"}),(e.flaky??0)>0&&s.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:"#21122e",border:"1px solid #bc8cff",color:"#bc8cff"},children:["⏸ ",e.flaky," flaky"]})]}),s.jsxs("div",{style:{fontSize:13,color:"#8b949e"},children:[e.verified," verified · ",e.unverified," unverified · ",e.unavailable," unavailable"]})]}),s.jsx("span",{style:{color:"#8b949e",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&s.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid #21262d"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Model"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Availability"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Tokens left"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Resets in"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Latency"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Reason / Source"})]})}),s.jsx("tbody",{children:e.models.map(i=>s.jsx(tae,{entry:i},i.model))})]})})]})}function rae(e){if(!e)return null;const t=Object.entries(e.consecutive).filter(([,n])=>n>0);return t.length===0?null:s.jsxs("div",{style:{background:"rgba(210, 153, 34, 0.08)",border:"1px solid #9e6a03",borderRadius:10,padding:"10px 14px",marginBottom:14,fontSize:12,color:"#d29922",display:"flex",gap:10,alignItems:"flex-start"},children:[s.jsx("span",{style:{fontSize:15,lineHeight:"18px"},children:"🧹"}),s.jsxs("div",{children:[s.jsx("div",{style:{fontWeight:600,color:"#e3b341",marginBottom:2},children:"Key hygiene in progress"}),s.jsx("div",{children:t.map(([n,r])=>s.jsxs("span",{style:{display:"inline-block",marginRight:12},children:[s.jsx("code",{style:{color:"#e6edf3"},children:n})," ",r,"/",e.threshold," consecutive auth failures",r>=e.threshold?" — key auto-cleared 🚫":" — key will be auto-cleared at the threshold"]},n))}),s.jsxs("div",{style:{marginTop:4,color:"#9e6a03"},children:["After ",e.threshold," consecutive 401/403s the invalid key is removed from config; run"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff config set providers.<provider>.apiKey <real-key>"})," to re-enable."]})]})]})}function iae({data:e}){return e.enabled?s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",style:{marginTop:36},children:"📦 Model Availability Registry — the store routing reads"}),s.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 ",s.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."]}),s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"📦"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:e.total}),s.jsx("div",{className:"stat-label",children:"Tracked models"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"✅"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#3fb950"},children:e.verified}),s.jsx("div",{className:"stat-label",children:"Verified"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"◌"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#8b949e"},children:e.unverified}),s.jsx("div",{className:"stat-label",children:"Unverified"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⛔"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#f85149"},children:e.unavailable}),s.jsx("div",{className:"stat-label",children:"Unavailable"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⏸"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#d29922"},children:e.parked}),s.jsx("div",{className:"stat-label",children:"Quota-parked"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⏸"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#bc8cff"},children:e.flaky??0}),s.jsx("div",{className:"stat-label",children:"Flaky mid-stream"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🗑️"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#8b949e"},children:e.deletedLocal??0}),s.jsx("div",{className:"stat-label",children:"Deleted locally"})]})]})]}),rae(e.keyHygiene),e.providers.map(t=>s.jsx(nae,{provider:t},t.provider)),s.jsx("div",{style:{textAlign:"center",fontSize:12,color:"#484f58",marginTop:12},children:"Backend snapshot · auto-refreshes every 60s"})]}):s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px dashed #30363d",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[s.jsx("div",{style:{fontSize:24,marginBottom:8},children:"📦"}),s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3",marginBottom:4},children:"Model Availability Registry"}),s.jsxs("div",{style:{fontSize:12,color:"#6e7681"},children:["No registry data yet — run ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff models refresh"})," or use Auto routing; the registry learns from real usage and probes."]})]})}const aae={chat:"💬",execute:"⚙️",plan:"🗺️",edit:"✏️",skill:"🧩",learn:"📚",ci:"🔁",doctor:"🩺",probe:"🔭","spot-check":"🧪",telemetry:"📡",usage:"🧮"};function sae(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 oae(e){return aae[e]||"🎯"}function lae(e){return e?new Date(e).toLocaleDateString()+" "+new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"—"}function qa({provider:e,model:t,reason:n,killed:r,transient:i,partial:a,streamedChunks:o}){const l=r===!0,c=i===!0,u=a===!0,d=u?"#bc8cff":c?"#d29922":l?"#f85149":"#3fb950",f=u?"#21122e":c?"#2d1f00":l?"#2d0f0f":"#0a2e1a";return s.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:[s.jsx("span",{style:{opacity:.85},children:u?"⏸":c?"~":l?"✗":"✓"}),e,"/",t.length>30?t.slice(0,27)+"…":t,(l||u)&&n&&s.jsxs("span",{style:{color:`${d}99`,fontSize:10,fontWeight:400},children:["· ",n]})]})}function cae(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,i)=>n[r.outcome]-n[i.outcome]||i.at-r.at)}function uae(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 dae({timeline:e}){const[t,n]=E.useState(()=>uae(e||[])),[r,i]=E.useState(!1),a=E.useRef(null),o=E.useRef(!1),l=(e==null?void 0:e.length)??0,c=Math.max(0,Math.min(t,l-1));E.useEffect(()=>{n(m=>Math.min(m,Math.max(0,l-1)))},[l]);const u=E.useCallback(m=>{const v=a.current;if(!v||l<=0)return;const y=v.getBoundingClientRect(),b=y.width||1,x=Math.min(1,Math.max(0,(m-y.left)/b));n(Math.min(l-1,Math.floor(x*l)))},[l]),d=m=>{o.current=!0,i(!1),u(m.clientX)};if(E.useEffect(()=>{const m=y=>{o.current&&u(y.clientX)},v=()=>{o.current=!1};return window.addEventListener("pointermove",m),window.addEventListener("pointerup",v),()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v)}},[u]),E.useEffect(()=>{if(!r||l<=1)return;const m=setInterval(()=>{n(v=>Math.min(l-1,v+1))},300);return()=>clearInterval(m)},[r,l]),E.useEffect(()=>{r&&l>1&&t>=l-1&&(i(!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?cae(p.events||[]):[];return s.jsxs("div",{style:{marginTop:12,paddingTop:10,borderTop:"1px solid #21262d"},children:[s.jsxs("div",{style:{fontSize:11,fontWeight:600,color:"#8b949e",marginBottom:8,textTransform:"uppercase",letterSpacing:.4,display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[s.jsxs("span",{children:["📈 Learned from real usage — last ",l," days"]}),s.jsx("span",{style:{fontWeight:400,color:"#6e7681",letterSpacing:0},children:"— drag across days · click a day · play to sweep"})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[s.jsx("button",{onClick:()=>{r?i(!1):(t>=l-1&&n(0),i(!0))},disabled:l<=1,"aria-label":r?"Pause scrub":"Play scrub",style:{background:"#21262d",border:`1px solid ${r?"#f85149":"#30363d"}`,color:"#e6edf3",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"}),s.jsxs("span",{style:{fontSize:11,color:"#8b949e",whiteSpace:"nowrap"},children:[h(p.day)," · ✓ ",p.verified," · ✗ ",p.killed,p.transient>0?` · ~ ${p.transient}`:"",p.partial>0?` · ⏸ ${p.partial}`:""]}),s.jsx("input",{type:"range",min:0,max:Math.max(0,l-1),step:1,value:c,onChange:m=>{i(!1),n(Number(m.target.value))},"aria-label":"Scrub action timeline",style:{flex:1,accentColor:"#58a6ff",cursor:"pointer",minWidth:80}})]}),s.jsx("div",{ref:a,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,v)=>{const y=m.verified+m.killed+m.transient+(m.partial||0),b=m.verified/f*56,x=m.killed/f*56,k=m.transient/f*56,S=(m.partial||0)/f*56,w=v===c;return s.jsxs("div",{onClick:()=>{i(!1),n(v)},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:[s.jsxs("div",{style:{position:"relative",width:"100%",borderRadius:3,overflow:w?"visible":"hidden",background:y===0?"#21262d":"transparent",height:y===0?4:56,display:"flex",flexDirection:"column-reverse",boxShadow:w?"0 0 0 1.5px #58a6ff":void 0,opacity:y===0?.5:1,transition:"box-shadow 0.15s"},children:[w&&s.jsx("div",{style:{position:"absolute",top:-3,bottom:-3,width:2,left:"50%",transform:"translateX(-50%)",background:"#58a6ff",borderRadius:2,pointerEvents:"none",boxShadow:"0 0 8px #58a6ff88",zIndex:1}}),m.verified>0&&s.jsx("div",{style:{height:b,background:"#3fb950",minHeight:3}}),m.killed>0&&s.jsx("div",{style:{height:x,background:"#f85149",minHeight:3}}),m.transient>0&&s.jsx("div",{style:{height:k,background:"#d29922",minHeight:3}}),m.partial>0&&s.jsx("div",{style:{height:S,background:"#bc8cff",minHeight:3}})]}),s.jsx("div",{style:{fontSize:9,color:w?"#58a6ff":"#6e7681",marginTop:4,whiteSpace:"nowrap",fontWeight:w?700:400},children:h(m.day)})]},m.day)})}),s.jsxs("div",{style:{display:"flex",gap:14,marginTop:6,fontSize:11,color:"#8b949e"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#3fb950"},children:"■"})," verified"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#f85149"},children:"■"})," killed"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#d29922"},children:"■"})," transient"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#bc8cff"},children:"■"})," partial"]})]}),s.jsxs("div",{style:{marginTop:10,background:"#161b22",border:"1px solid #21262d",borderRadius:8,padding:"10px 12px"},children:[s.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"#e6edf3",marginBottom:6},children:[h(p.day)," ",s.jsx("span",{style:{color:"#8b949e",fontWeight:400},children:"— what this action learned that day"})]}),g.length===0?s.jsx("div",{style:{fontSize:12,color:"#6e7681"},children:"No learning recorded that day — nothing verified, killed, or partial."}):s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:g.map(m=>m.outcome==="unavailable"?s.jsx(qa,{provider:m.provider,model:m.model,reason:m.errorType,killed:!0},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="verified"?s.jsx(qa,{provider:m.provider,model:m.model},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="partial"?s.jsx(qa,{provider:m.provider,model:m.model,reason:m.errorType,partial:!0,streamedChunks:m.streamedChunks},`${m.provider}|${m.model}|${m.outcome}`):s.jsx(qa,{provider:m.provider,model:m.model,reason:m.errorType,transient:!0},`${m.provider}|${m.model}|${m.outcome}`))})]})]})}function fae({entry:e}){var i,a;const[t,n]=E.useState(!0),r=(e.partial||0)>0?"#bc8cff":e.killed>0?"#f85149":e.verified>0?"#3fb950":"#d29922";return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:`1px solid ${r}33`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[s.jsxs("div",{onClick:()=>n(!t),style:{padding:"12px 16px",cursor:"pointer",display:"flex",alignItems:"center",gap:12,userSelect:"none"},children:[s.jsx("span",{style:{fontSize:20},children:oae(e.action)}),s.jsxs("div",{style:{flex:1},children:[s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3",marginBottom:2},children:sae(e.action)}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e",display:"flex",gap:14,flexWrap:"wrap"},children:[s.jsxs("span",{children:[s.jsxs("span",{style:{color:"#3fb950"},children:["✓ ",e.verified]})," verified"]}),s.jsxs("span",{children:[s.jsxs("span",{style:{color:"#f85149"},children:["✗ ",e.killed]})," killed"]}),e.transient>0&&s.jsxs("span",{children:[s.jsxs("span",{style:{color:"#d29922"},children:["~ ",e.transient]})," transient"]}),(e.partial||0)>0&&s.jsxs("span",{children:[s.jsxs("span",{style:{color:"#bc8cff"},children:["⏸ ",e.partial]})," partial"]})]})]}),s.jsx("span",{style:{color:"#8b949e",fontSize:16,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"})]}),t&&s.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid #21262d",background:"#0d1117"},children:[e.killedModels.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#f85149",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"⛔ Killed — skipped predictively by routing"}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.killedModels.map(o=>s.jsx(qa,{provider:o.provider,model:o.model,reason:o.reason,killed:!0},`${o.provider}|${o.model}`))})]}),e.verifiedModels.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#3fb950",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"✅ Verified — trusted by routing"}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.verifiedModels.map(o=>s.jsx(qa,{provider:o.provider,model:o.model},`${o.provider}|${o.model}`))})]}),(((i=e.partialModels)==null?void 0:i.length)||0)>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{fontSize:11,fontWeight:600,color:"#bc8cff",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"⏸ Partial — mid-stream interruption (flaky provider, deprioritized)"}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.partialModels.map(o=>s.jsx(qa,{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&&(((a=e.partialModels)==null?void 0:a.length)||0)===0&&s.jsx("div",{style:{fontSize:12,color:"#6e7681"},children:"Only transient failures — health decayed, no model flipped."}),s.jsx(dae,{timeline:e.timeline})]})]})}function hae({registry:e}){const t=e.actionTelemetry;return t?t.enabled?s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",style:{marginTop:36},children:"🎓 Learned from real usage — per action"}),s.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 ",s.jsx("span",{style:{color:"#3fb950"},children:"verified"})," (routable) or"," ",s.jsx("span",{style:{color:"#f85149"},children:"killed"})," (predictively skipped) — the exact feed that turns “fail gemini → fail nim → local” into “straight to local”."]}),s.jsxs("div",{className:"stats-grid mini",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"📊"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:t.total}),s.jsx("div",{className:"stat-label",children:"Telemetry events"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🎯"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:t.actions.length}),s.jsx("div",{className:"stat-label",children:"Actions learning"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⏱️"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{fontSize:15},children:lae(t.updatedAt)}),s.jsx("div",{className:"stat-label",children:"Last update"})]})]}),t.synthetic>0&&s.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:[s.jsx("span",{className:"stat-icon",children:"🧪"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#d29922"},children:t.synthetic}),s.jsx("div",{className:"stat-label",children:"Test-origin, excluded"})]})]})]}),t.actions.map(n=>s.jsx(fae,{entry:n},n.action)),s.jsx("div",{style:{textAlign:"center",fontSize:12,color:"#484f58",marginTop:12},children:"All actions share one health store — a provider killed by any action is skipped by all others"})]}):s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px dashed #30363d",padding:"18px 24px",marginTop:24,textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,marginBottom:6},children:"🎓"}),s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",marginBottom:4},children:"Learned from real usage — per action"}),s.jsxs("div",{style:{fontSize:12,color:"#6e7681",lineHeight:1.5},children:["No per-action telemetry yet. As you use ",s.jsx("strong",{style:{color:"#8b949e"},children:"chat"}),","," ",s.jsx("strong",{style:{color:"#8b949e"},children:"execute"}),", ",s.jsx("strong",{style:{color:"#8b949e"},children:"plan"}),", and ",s.jsx("strong",{style:{color:"#8b949e"},children:"edit"}),", each action's verified / killed provider × model combos appear here — showing exactly what routing learned from real usage."]})]}):null}function yd({icon:e,title:t,count:n}){return n===0?null:s.jsxs("h3",{style:{fontSize:15,fontWeight:600,color:"#e6edf3",margin:"24px 0 12px 0",display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{children:e})," ",t,s.jsx("span",{style:{fontSize:12,color:"#8b949e",fontWeight:400,background:"#161b22",padding:"1px 8px",borderRadius:8},children:n})]})}function pae({value:e,onChange:t,totalCount:n}){return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[s.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"center",background:"#161b22",borderRadius:8,border:"1px solid #30363d",transition:"border-color 0.2s"},children:[s.jsx("span",{style:{position:"absolute",left:12,fontSize:14,color:"#6e7681",pointerEvents:"none"},children:"🔍"}),s.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:"#e6edf3",fontSize:13,outline:"none",fontFamily:"inherit"},onFocus:r=>{r.currentTarget.parentElement.style.borderColor="#58a6ff"},onBlur:r=>{r.currentTarget.parentElement.style.borderColor="#30363d"}}),e&&s.jsx("button",{onClick:()=>t(""),style:{background:"none",border:"none",color:"#6e7681",cursor:"pointer",padding:"8px 12px",fontSize:14,lineHeight:1},children:"✕"})]}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e",whiteSpace:"nowrap"},children:[n," model",n!==1?"s":""]})]})}function mae({value:e,onChange:t}){return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"#8b949e",marginBottom:14},children:[s.jsx("span",{children:"Columns:"}),Fie.map(n=>s.jsx("button",{onClick:()=>t(n),style:{padding:"4px 12px",borderRadius:6,background:e===n?"#1f6feb":"#21262d",color:e===n?"#fff":"#8b949e",border:`1px solid ${e===n?"#1f6feb":"#30363d"}`,cursor:"pointer",fontSize:12,fontWeight:e===n?600:400,transition:"all 0.15s"},children:n},n))]})}function gae({model:e,provider:t}){const n=yh[e.status],r=e.rateLimitRemaining!==void 0?e.rateLimitTotal?`${e.rateLimitRemaining} / ${e.rateLimitTotal}`:`${e.rateLimitRemaining} left`:"—";return s.jsx("td",{style:{padding:10,verticalAlign:"top"},children:s.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:i=>{i.currentTarget.style.borderColor=n.cardBorder,i.currentTarget.style.boxShadow=`0 2px 10px ${n.cardBorder}22`},onMouseLeave:i=>{i.currentTarget.style.borderColor=`${n.cardBorder}44`,i.currentTarget.style.boxShadow="none"},children:[s.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:3,background:n.cardBorder,opacity:.6}}),s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",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}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e"},children:[nM(t)," ",f0(t)]}),s.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:[s.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:n.dot}}),e.status==="available"?"Available":e.status==="limited"?"Limited":"Unavailable"]}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681"},children:[s.jsx("span",{style:{color:"#8b949e"},children:"Tokens:"})," ",s.jsx("span",{style:{color:e.rateLimitRemaining!==void 0&&e.rateLimitRemaining<=10?"#d29922":"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace",fontWeight:500},children:r})]}),e.routable===!1&&s.jsx("div",{style:{fontSize:10,color:"#d29922",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&&s.jsx("div",{style:{fontSize:10,color:"#6e7681",lineHeight:1.3,marginTop:1},children:e.registryError.length>60?e.registryError.slice(0,57)+"…":e.registryError}),e.entitlement&&e.entitlement.tier!=="unknown"&&s.jsx("div",{title:e.entitlement.basis,style:{fontSize:10,lineHeight:1.3,marginTop:2,color:e.entitlement.tier==="free"?"#3fb950":"#8b949e"},children:e.entitlement.tier==="free"?"🎁 free":"💸 metered"}),e.status!=="available"&&e.statusReason&&s.jsx("div",{style:{fontSize:10,color:"#6e7681",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&&s.jsxs("div",{style:{fontSize:10,color:"#d29922",lineHeight:1.3,marginTop:4,padding:"3px 6px",borderRadius:4,background:"#2d2200",border:"1px solid #d2992244"},children:["⏳ Resets in ",rM(e.resetsInMs)]})]})})}function yae({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 i=r;if(n.trim()){const l=n.toLowerCase().trim();i=r.filter(({model:c,provider:u})=>c.name.toLowerCase().includes(l)||f0(u).toLowerCase().includes(l)||u.toLowerCase().includes(l))}const a={available:0,limited:1,unavailable:2};i.sort((l,c)=>a[l.model.status]-a[c.model.status]);const o=[];for(let l=0;l<i.length;l+=t)o.push(i.slice(l,l+t));return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",style:{marginTop:36},children:"📋 Model Health Overview"}),s.jsx("p",{className:"section-description",children:"All models across all providers, color-coded by health status. Each cell shows: Model · Provider · Health · Token Remaining."}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsx("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:10,tableLayout:"fixed"},children:s.jsx("tbody",{children:o.length>0?o.map((l,c)=>s.jsxs("tr",{children:[l.map(({model:u,provider:d})=>s.jsx(gae,{model:u,provider:d},`${d}-${u.id}`)),l.length<t&&Array.from({length:t-l.length}).map((u,d)=>s.jsx("td",{style:{padding:10}},`empty-${d}`))]},c)):s.jsx("tr",{children:s.jsxs("td",{colSpan:t,style:{textAlign:"center",padding:40,color:"#6e7681",fontSize:13},children:['No models match your search "',n,'"']})})})})}),n.trim()&&i.length>0&&s.jsxs("div",{style:{textAlign:"right",fontSize:11,color:"#6e7681",marginTop:4},children:["Showing ",i.length," of ",r.length," models"]})]})}function vae(){return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px dashed #30363d",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[s.jsx("div",{style:{fontSize:24,marginBottom:8},children:"🎙️"}),s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3",marginBottom:4},children:"Speech / TTS Provider"}),s.jsxs("div",{style:{fontSize:12,color:"#6e7681"},children:["Speech/TTS provider support coming soon."," ",s.jsx("a",{href:"https://github.com/imdheerajKube/agent-nuvira/issues/new",target:"_blank",rel:"noopener noreferrer",style:{color:"#58a6ff",textDecoration:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.textDecoration="underline"},onMouseLeave:e=>{e.currentTarget.style.textDecoration="none"},children:"Request a provider"})]})]})}function bae(){return s.jsxs("div",{style:{background:"#0d1117",borderRadius:10,padding:14,marginBottom:20,border:"1px solid #21262d",fontSize:13,color:"#8b949e",display:"flex",flexWrap:"wrap",gap:20},children:[s.jsxs("div",{children:[s.jsx("div",{style:{fontWeight:600,color:"#e6edf3",marginBottom:6},children:"Color Coding"}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#3fb950"},children:"●"})," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"Green"})," — Working with rate limit available"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#d29922"},children:"●"})," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"Amber"})," — Slow / low rate limit / needs action"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#f85149"},children:"●"})," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"Red"})," — API key missing / payment needed / unreachable"]})]})]}),s.jsxs("div",{children:[s.jsx("div",{style:{fontWeight:600,color:"#e6edf3",marginBottom:6},children:"Provider Sections"}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,fontSize:12},children:[s.jsxs("span",{children:["✅ ",s.jsx("strong",{children:"Cloud"})," — Online providers with active API keys"]}),s.jsxs("span",{children:["🏠 ",s.jsx("strong",{children:"Local"})," — Locally running inference servers"]}),s.jsxs("span",{children:["⛔ ",s.jsx("strong",{children:"Unavailable"})," — Missing keys or unreachable endpoints"]}),s.jsxs("span",{children:["🎙️ ",s.jsx("strong",{children:"Speech"})," — Text-to-speech / speech-to-text providers (coming)"]})]})]})]})}function xae(){const[e,t]=E.useState(null),[n,r]=E.useState(null),[i,a]=E.useState(!0),[o,l]=E.useState(null),[c,u]=E.useState(4),[d,f]=E.useState(""),h=E.useRef(!0),p=E.useRef(null),g=E.useRef(!1);function m(){p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h.current&&v()},Wie)}async function v(){a(!0),l(null),g.current=!1;try{const[b,x]=await Promise.all([Gie(()=>{g.current=!0}),qie(()=>{g.current=!0})]);if(!h.current)return;t(b),r(x),g.current&&m()}catch(b){if(!h.current)return;l(b instanceof Error&&b.message?b.message:"Failed to fetch model status"),g.current&&m()}finally{h.current&&a(!1)}}E.useEffect(()=>{h.current=!0,v();const b=setInterval(v,Uie);return()=>{h.current=!1,clearInterval(b),p.current&&clearTimeout(p.current)}},[]);function y(b){const x=[],k=[],S=[],w=[],_={available:0,limited:1,unavailable:2};for(const N of b.providers)zie.has(N.provider)?S.push(N):Bie.has(N.provider)?k.push(N):N.overallStatus==="available"?x.push(N):w.push(N);return x.sort((N,C)=>_[N.overallStatus]-_[C.overallStatus]),k.sort((N,C)=>_[N.overallStatus]-_[C.overallStatus]),S.sort((N,C)=>_[N.overallStatus]-_[C.overallStatus]),w.sort((N,C)=>_[N.overallStatus]-_[C.overallStatus]),{available:x,local:k,speech:S,unavailable:w}}return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"🧠 Model Provider Status"}),s.jsx("p",{className:"section-description",children:"Real-time health check of all AI providers and their available models. Providers are grouped into sections: Available cloud → Local → Unavailable."}),s.jsx(Yie,{onRefresh:v,loading:i}),s.jsx(bae,{}),i&&!e&&s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Testing all 17 provider connections..."})]}),o&&s.jsxs("div",{className:"empty-state",style:{color:"#f85149",border:"1px solid #f8514944",borderRadius:10,padding:16,marginBottom:16},children:["⚠️ ",o]}),e&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🧠"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:e.totalModels}),s.jsx("div",{className:"stat-label",children:"Total Models"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"✅"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#3fb950"},children:e.available}),s.jsx("div",{className:"stat-label",children:"Available"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🟡"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#d29922"},children:e.limited}),s.jsx("div",{className:"stat-label",children:"Limited"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🔴"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:"#f85149"},children:e.unavailable}),s.jsx("div",{className:"stat-label",children:"Unavailable"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🔌"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:e.providers.length}),s.jsx("div",{className:"stat-label",children:"Providers"})]})]})]}),s.jsx(Xie,{data:e}),(()=>{const{available:b,local:x,speech:k,unavailable:S}=y(e);return s.jsxs(s.Fragment,{children:[s.jsx(yd,{icon:"✅",title:"Available Cloud Providers",count:b.length}),b.map(w=>s.jsx(gd,{provider:w},w.provider)),s.jsx(yd,{icon:"🏠",title:"Local Providers",count:x.length}),x.map(w=>s.jsx(gd,{provider:w},w.provider)),s.jsx(yd,{icon:"⛔",title:"Unavailable Providers",count:S.length}),S.map(w=>s.jsx(gd,{provider:w},w.provider)),s.jsx(yd,{icon:"🎙️",title:"Speech / TTS Providers",count:k.length}),k.map(w=>s.jsx(gd,{provider:w},w.provider))]})})(),s.jsx(pae,{value:d,onChange:f,totalCount:e.providers.reduce((b,x)=>b+x.models.length,0)}),s.jsx(mae,{value:c,onChange:u}),s.jsx(yae,{providers:e.providers,colsPerRow:c,searchQuery:d}),n&&s.jsx(iae,{data:n}),n&&s.jsx(hae,{registry:n}),e&&!n&&s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px dashed #30363d",padding:"14px 20px",marginTop:24,fontSize:12,color:"#8b949e",lineHeight:1.6},children:["📦 Registry & telemetry sections are hidden — this dashboard server did not return model-registry data (it may be an"," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"older version"}),"). Restart the dashboard from the latest install to see them."]}),s.jsx(vae,{}),s.jsxs("div",{style:{textAlign:"center",fontSize:12,color:"#484f58",marginTop:16},children:["Last checked: ",new Date(e.lastChecked).toLocaleTimeString()," · ","Auto-refreshes every 60s"]})]})]})}const wae={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},Sae={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},kae={trivial:"🟢",simple:"🔵",moderate:"🟡",complex:"🟠",critical:"🔴"},iM={trivial:"🟢 trivial",simple:"🔵 simple",moderate:"🟡 moderate",complex:"🟠 complex",critical:"🔴 critical"},Eae={chat:"💬 chat",orchestrator:"🔀 orchestrator",explain:"🔍 explain",benchmark:"📈 benchmark",eval:"🎯 eval"},ja=[{key:"request",icon:"🎯",title:"Request"},{key:"candidates",icon:"⚖️",title:"Candidates"},{key:"exclusions",icon:"🚫",title:"Exclusions"},{key:"pick",icon:"✅",title:"Pick"}],_ae=2400;function ig(e){return wae[e]||"🔌"}function f_(e){return Sae[e]||e}function h0(e){return e&&Eae[e]||e||"unknown"}function Nae(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 h_(e){const t=Math.ceil(e/6e4);return t>=60?`${Math.floor(t/60)}h ${t%60}m`:`${t}m`}const jae=8;function p_(e,t){const n=t.quota,r=n==null?void 0:n.entries.find(a=>a.provider===e);return r!=null&&r.parked?r.resetsInMs>0?`quota exhausted — auto re-enables in ${h_(r.resetsInMs)}`:"quota exhausted — parked":r&&r.cooldownRemaining>0?`circuit-breaker cooldown — ${h_(r.cooldownRemaining)} remaining`:t.providers.some(a=>a.provider===e)?"ranked below the candidate cutoff for this complexity":"not scored for this complexity (no benchmark quality data)"}function Aae(e){var a,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=[],i=[...e.history??[]].sort((c,u)=>(u.timestamp??0)-(c.timestamp??0));for(const c of i.slice(0,jae)){const u=n.get(c.complexity),d=(a=u==null?void 0:u.providers)!=null&&a.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:p_(g,e)})),p=(o=d.find(g=>g.provider===c.provider))==null?void 0:o.reason;r.push({id:c.id,label:`${h0(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:p_(g,e)})),p=u[0];r.push({id:`profile-${c.complexity}`,label:`${iM[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 Tae(e,t){switch(e){case"request":return`A ${t.complexity} task arrives${t.source?` from ${h0(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 Cae({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return s.jsx("div",{style:{flex:1,background:"#0d1117",borderRadius:4,height:6,overflow:"hidden",border:"1px solid #21262d"},children:s.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function Oae({icon:e,title:t,narration:n}){return s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,marginBottom:14},children:[s.jsx("span",{style:{fontSize:20,lineHeight:"24px"},children:e}),s.jsxs("div",{children:[s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3"},children:t}),s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginTop:2},children:n})]})]})}function Pae({routing:e}){const t=E.useMemo(()=>Aae(e),[e]),[n,r]=E.useState(""),[i,a]=E.useState(0),[o,l]=E.useState(!1);if(E.useEffect(()=>{t.length!==0&&(t.some(p=>p.id===n)||(r(t[0].id),a(0)))},[t,n]),E.useEffect(()=>{if(!o||t.length===0)return;const p=setInterval(()=>{a(g=>(g+1)%ja.length)},_ae);return()=>clearInterval(p)},[o,t.length]),t.length===0)return null;const c=t.find(p=>p.id===n)??t[0],u=ja[i],d=()=>{a(p=>(p+ja.length-1)%ja.length),l(!1)},f=()=>{a(p=>(p+1)%ja.length),l(!1)},h=()=>l(p=>!p);return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px solid #21262d",padding:"18px 20px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[s.jsx("span",{style:{fontSize:20},children:"🎬"}),s.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"#e6edf3",margin:0},children:"Why did the router pick this?"}),c.real&&s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#12291a",border:"1px solid #238636",color:"#3fb950"},children:"✓ real decision"})]}),s.jsx("p",{style:{fontSize:12,color:"#8b949e",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."}),s.jsx("select",{"aria-label":"Routing decision to replay",value:n,onChange:p=>{r(p.target.value),a(0),l(!1)},style:{width:"100%",marginBottom:16,padding:"8px 10px",background:"#0d1117",color:"#e6edf3",fontSize:12,border:"1px solid #30363d",borderRadius:8,outline:"none"},children:t.map(p=>s.jsxs("option",{value:p.id,style:{background:"#0d1117",color:"#e6edf3"},children:[p.real?"● ":"○ ",p.label]},p.id))}),s.jsx(Oae,{icon:u.icon,title:`${i+1}. ${u.title}${i>0?` — ${c.complexity}`:""}`,narration:Tae(u.key,c)}),u.key==="request"&&s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"14px 16px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:8},children:[s.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"#161b22",border:"1px solid #30363d",color:"#e6edf3"},children:[kae[c.complexity]||"•"," ",iM[c.complexity]||c.complexity]}),s.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"#161b22",border:"1px solid #30363d",color:"#8b949e"},children:["🤖 ",c.agentType]}),c.source&&s.jsx("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"#161b22",border:"1px solid #30363d",color:"#8b949e"},children:h0(c.source)}),c.timestamp&&s.jsx("span",{style:{fontSize:11,color:"#6e7681",marginLeft:"auto"},children:Nae(c.timestamp)})]}),s.jsx("div",{style:{fontSize:13,color:"#e6edf3"},children:c.task})]}),u.key==="candidates"&&s.jsxs("div",{children:[c.candidates.map((p,g)=>{const m=p.provider===c.winner.split("/")[0];return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:m?"#12291a":"#0d1117",border:`1px solid ${m?"#238636":"#21262d"}`,borderRadius:8,marginBottom:6},children:[s.jsxs("span",{style:{width:18,fontSize:11,color:"#6e7681",textAlign:"right"},children:[g+1,"."]}),s.jsxs("span",{style:{width:104,color:m?"#3fb950":"#e6edf3",fontWeight:m?600:400,whiteSpace:"nowrap",fontSize:12},children:[ig(p.provider)," ",f_(p.provider).split(" ")[0],m&&" 👑"]}),s.jsx(Cae,{value:p.score,color:m?"#3fb950":"#58a6ff"}),s.jsx("span",{style:{width:44,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},children:p.score.toFixed(3)})]},p.provider)}),c.candidates.length>0&&s.jsxs("div",{style:{marginTop:10},children:[s.jsx("div",{style:{fontSize:11,color:"#6e7681",marginBottom:4},children:"Why each ranked where it did"}),c.candidates.map(p=>s.jsxs("div",{style:{fontSize:12,color:"#8b949e",marginBottom:3},children:[s.jsx("span",{style:{color:"#e6edf3"},children:p.provider}),": ",p.reason||"scored"]},p.provider))]})]}),u.key==="exclusions"&&(c.exclusions.length>0?s.jsx("div",{children:c.exclusions.map(p=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:"#0d1117",border:"1px solid #21262d",borderRadius:8,marginBottom:6},children:[s.jsx("span",{style:{fontSize:13},children:"🚫"}),s.jsxs("span",{style:{width:110,color:"#e6edf3",whiteSpace:"nowrap",fontSize:12},children:[ig(p.provider)," ",f_(p.provider).split(" ")[0]]}),s.jsx("span",{style:{flex:1,fontSize:12,color:"#8b949e"},children:p.reason})]},p.provider))}):s.jsx("div",{style:{background:"#0d1117",border:"1px dashed #30363d",borderRadius:10,padding:"14px 16px",color:"#8b949e",fontSize:13},children:"✅ No exclusions — every provider known to the system was scored for this decision."})),u.key==="pick"&&s.jsxs("div",{style:{background:"#12291a",border:"1px solid #238636",borderRadius:10,padding:"16px 18px"},children:[s.jsx("div",{style:{fontSize:12,color:"#3fb950",fontWeight:600,marginBottom:6},children:"🏆 ROUTER PICK"}),s.jsxs("div",{style:{fontSize:16,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace",marginBottom:4},children:[ig(c.winner.split("/")[0])," ",c.winner]}),s.jsxs("div",{style:{fontSize:12,color:"#8b949e",marginBottom:10},children:["composite score ",s.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#3fb950"},children:c.winnerScore.toFixed(3)}),!c.real&&" · profile preview"]}),c.winnerReason&&s.jsxs("div",{style:{fontSize:12,color:"#8b949e",borderTop:"1px solid #23863655",paddingTop:8},children:[s.jsx("span",{style:{color:"#e6edf3"},children:"Why:"})," ",c.winnerReason]})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:16},children:[s.jsx("button",{onClick:d,"aria-label":"Previous step",style:ag,children:"◀"}),s.jsx("button",{onClick:h,"aria-label":o?"Pause playback":"Play playback",style:{...ag,minWidth:84,color:o?"#d29922":"#3fb950"},children:o?"⏸ Pause":"▶ Play"}),s.jsx("button",{onClick:f,"aria-label":"Next step",style:ag,children:"▶"}),s.jsx("div",{style:{display:"flex",gap:6,marginLeft:8},children:ja.map((p,g)=>s.jsx("button",{"aria-label":`Go to step ${g+1}: ${p.title}`,onClick:()=>{a(g),l(!1)},style:{width:22,height:22,borderRadius:11,border:"none",cursor:"pointer",fontSize:10,lineHeight:"22px",padding:0,background:g===i?"#58a6ff":"#21262d",color:g===i?"#0d1117":"#8b949e"},title:p.title,children:p.icon},p.key))}),s.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"#6e7681"},children:["step ",i+1,"/",ja.length]})]})]})}const ag={background:"#21262d",color:"#e6edf3",border:"1px solid #30363d",borderRadius:8,padding:"6px 12px",fontSize:13,cursor:"pointer",transition:"background 0.15s"},Mae={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},Rae={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},aM={trivial:"🟢",simple:"🔵",moderate:"🟡",complex:"🟠",critical:"🔴"};function Cr(e){return Mae[e]||"🔌"}function ca(e){return Rae[e]||e}function vh(e,t=1){return`${(e*100).toFixed(t)}%`}function Iae(e){return`$${e.toFixed(6)}`}function Zn({icon:e,title:t,subtitle:n,children:r}){return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px solid #21262d",padding:"18px 20px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[s.jsx("span",{style:{fontSize:20},children:e}),s.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"#e6edf3",margin:0},children:t})]}),n&&s.jsx("p",{style:{fontSize:12,color:"#8b949e",margin:"2px 0 12px 0"},children:n}),!n&&s.jsx("div",{style:{height:6}}),r]})}function p0({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return s.jsx("div",{style:{flex:1,background:"#0d1117",borderRadius:4,height:6,overflow:"hidden",border:"1px solid #21262d"},children:s.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function to(e,t,n="#8b949e"){return{fontSize:10,padding:"1px 7px",borderRadius:9,background:e,border:`1px solid ${t}`,color:n,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap"}}function $ae(){return s.jsxs("div",{style:{background:"#0d1117",border:"1px dashed #30363d",borderRadius:10,padding:"18px 20px",color:"#8b949e",fontSize:13,textAlign:"center"},children:["📊 No routing data yet — run ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff benchmark"})," to populate provider quality scores, or use Auto routing (",s.jsx("code",{style:{color:"#58a6ff"},children:"buff model switch auto"}),") to build per-agent best-model stats over time."]})}const Lae={chat:"💬 chat",orchestrator:"🔀 orchestrator",explain:"🔍 explain",benchmark:"📈 benchmark",eval:"🎯 eval"},Dae={trivial:"🟢 trivial",simple:"🔵 simple",moderate:"🟡 moderate",complex:"🟠 complex",critical:"🔴 critical"};function sM(e){return Lae[e]||e}function oM(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 m_(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 Bae({label:e,value:t,total:n,color:r}){const i=n>0?t/n*100:0;return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[s.jsx("span",{style:{width:110,color:"#e6edf3",whiteSpace:"nowrap",fontSize:12},children:e}),s.jsx("div",{style:{flex:1,background:"#0d1117",borderRadius:4,height:6,overflow:"hidden",border:"1px solid #21262d"},children:s.jsx("div",{style:{width:`${Math.min(100,i)}%`,background:r,height:"100%",transition:"width 0.4s ease"}})}),s.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},children:t})]})}function zae({usage:e}){if(!e.total)return null;const t=e.total,n=Object.entries(e.byProvider).sort((i,a)=>a[1]-i[1]).slice(0,6),r=Object.entries(e.byModel).sort((i,a)=>a[1]-i[1]).slice(0,5);return s.jsxs(Zn,{icon:"🧮",title:"Routing Usage — actual picks over time",subtitle:"Recorded from live chat, orchestrator runs, explain snapshots, benchmark --routing, and eval --routing",children:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.total}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"total decisions"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:e.last24h>0?"#3fb950":"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.last24h}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"last 24h"})]})]}),s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginBottom:6},children:"By provider"}),n.map(([i,a])=>s.jsx(Bae,{label:`${Cr(i)} ${ca(i).split(" ")[0]}`,value:a,total:t,color:"#58a6ff"},i)),Object.keys(e.bySource).length>0&&s.jsx("div",{style:{marginTop:12,display:"flex",gap:6,flexWrap:"wrap"},children:Object.entries(e.bySource).sort((i,a)=>a[1]-i[1]).map(([i,a])=>s.jsxs("span",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:20,padding:"3px 10px",fontSize:11,color:"#e6edf3"},children:[sM(i)," · ",a]},i))}),r.length>0&&s.jsxs("div",{style:{marginTop:14},children:[s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginBottom:6},children:"Most-picked models"}),r.map(([i,a])=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[s.jsx("span",{style:{flex:1,color:"#e6edf3",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:i,children:i.length>42?i.slice(0,39)+"…":i}),s.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},children:a})]},i))]})]})}function Fae({history:e}){return e.length?s.jsx(Zn,{icon:"🕓",title:"Audit Trail — routing decision timeline",subtitle:"Every explain snapshot (and routing-mode pick) persisted for transparency",children:s.jsx("div",{style:{maxHeight:320,overflowY:"auto",paddingRight:4},children:e.map(t=>s.jsxs("div",{style:{display:"flex",gap:10,padding:"8px 4px",borderBottom:"1px solid #21262d"},children:[s.jsx("div",{style:{width:52,flexShrink:0,fontSize:11,color:"#6e7681",paddingTop:2},children:oM(t.timestamp)}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:sM(t.source)}),s.jsxs("span",{style:{fontSize:12,fontWeight:600,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${t.provider}/${t.model}`,children:[Cr(t.provider)," ",t.provider,"/",t.model.length>26?t.model.slice(0,23)+"…":t.model]}),t.complexity&&s.jsx("span",{style:{fontSize:11,color:"#6e7681"},children:Dae[t.complexity]||t.complexity})]}),s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.task,children:t.task||t.agentType})]})]},t.id))})}):null}function Uae({routing:e}){return e.preference.length?s.jsx(Zn,{icon:"🤖",title:"Auto Router — What the agent would pick",subtitle:"Complexity-weighted scoring across reasoning, speed, cost, privacy, and reliability (real provider pricing)",children:s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Complexity"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Winner"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Score"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"All providers"})]})}),s.jsx("tbody",{children:e.preference.map(t=>s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"10px 12px",color:"#e6edf3",whiteSpace:"nowrap"},children:[aM[t.complexity]||"•"," ",t.complexity]}),s.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:s.jsxs("span",{style:{color:"#3fb950",fontWeight:600},children:[Cr(t.winner.split("/")[0])," ",t.winner]})}),s.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:t.score.toFixed(3)}),s.jsx("td",{style:{padding:"10px 12px",minWidth:300},children:t.providers.map((n,r)=>s.jsxs("div",{style:{marginBottom:5},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsxs("span",{style:{width:16,fontSize:11,color:"#6e7681",textAlign:"right"},children:[r+1,"."]}),s.jsxs("span",{style:{width:90,color:"#e6edf3",whiteSpace:"nowrap",fontSize:12},children:[Cr(n.provider)," ",ca(n.provider).split(" ")[0]]}),s.jsx(p0,{value:n.score,color:r===0?"#3fb950":"#58a6ff"}),s.jsx("span",{style:{width:40,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},children:n.score.toFixed(2)})]}),(n.capabilityFit!==void 0||n.costSource||n.contextUtilization!==void 0)&&s.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingLeft:16,marginTop:2},children:[n.capabilityFit!==void 0&&s.jsxs("span",{style:to("#1c2128","#6e7681"),children:["🎯 fit ",n.capabilityFit,"%"]}),n.costSource==="measured"&&n.costBasis?s.jsxs("span",{style:to("#12291a","#3fb950","#3fb950"),children:["📏 measured ",n.costBasis.inputTokens.toLocaleString(),"→",n.costBasis.outputTokens.toLocaleString()," tok"]}):s.jsx("span",{style:to("#1c2128","#8b949e"),children:"📐 estimated"}),n.contextUtilization!==void 0&&n.contextWindowTokens!==void 0&&s.jsxs("span",{style:to("#1c2128","#58a6ff","#58a6ff"),children:["⏳ ctx ",n.contextUtilization,"% (",n.contextWindowTokens.toLocaleString()," tok)"]})]})]},n.provider))})]},t.complexity))})]})})}):null}function Wae({routing:e}){return e.providers.length?s.jsx(Zn,{icon:"📈",title:"Provider Benchmark Quality",subtitle:"Measured from your own `buff benchmark` runs — blended into Auto routing decisions",children:s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Provider"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Runs"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Avg Quality"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Pass Rate"}),s.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Total Cost"})]})}),s.jsx("tbody",{children:e.providers.map(t=>s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"10px 12px",color:"#e6edf3",whiteSpace:"nowrap"},children:[Cr(t.provider)," ",ca(t.provider)]}),s.jsx("td",{style:{padding:"10px 12px",color:"#8b949e"},children:t.runs}),s.jsx("td",{style:{padding:"10px 12px"},children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx(p0,{value:t.avgQuality,color:"#58a6ff"}),s.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"#8b949e",width:44,textAlign:"right"},children:vh(t.avgQuality)})]})}),s.jsx("td",{style:{padding:"10px 12px",color:t.passRate>=.8?"#3fb950":"#d29922"},children:vh(t.passRate)}),s.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:Iae(t.totalCostUsd)})]},t.provider))})]})})}):null}const g_=["trivial","simple","moderate","complex","critical"];function Hae(e){return e>=.7?"#3fb950":e>=.45?"#d29922":"#f85149"}function Gae({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 s.jsxs(Zn,{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:[s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider"}),g_.map(r=>s.jsxs("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:[aM[r]||"•"," ",r]},r))]})}),s.jsx("tbody",{children:t.map(r=>s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"8px 10px",color:"#e6edf3",whiteSpace:"nowrap"},children:[Cr(r)," ",ca(r).split(" ")[0]]}),g_.map(i=>{var o;const a=(o=e.priors[r])==null?void 0:o[i];return!a||a.alpha===0&&a.beta===0?s.jsx("td",{style:{padding:"8px 10px",textAlign:"center",color:"#6e7681"},children:"·"},i):s.jsxs("td",{style:{padding:"8px 10px",textAlign:"center"},children:[s.jsxs("div",{style:{fontSize:13,fontWeight:600,color:Hae(a.expectedWinRate),fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[(a.expectedWinRate*100).toFixed(0),"%"]}),s.jsxs("div",{style:{fontSize:10,color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["α",a.alpha," β",a.beta]})]},i)})]},r))})]})}),n.length>0&&s.jsxs("div",{style:{marginTop:16},children:[s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginBottom:8},children:"Recent learning history"}),s.jsx("div",{style:{maxHeight:180,overflowY:"auto",paddingRight:4},children:n.map((r,i)=>{const a=r.outcome==="success"?"✅":r.outcome==="escalated"?"🔄":"❌",o=new Date(r.timestamp).toLocaleTimeString();return s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",padding:"5px 4px",borderBottom:"1px solid #21262d"},children:[s.jsx("span",{children:a}),s.jsx("span",{style:{color:"#e6edf3",fontSize:12,width:110,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:r.provider,children:r.provider}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",width:80},children:r.complexity}),s.jsxs("span",{style:{fontSize:11,color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["reward ",r.reward.toFixed(2)]}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",marginLeft:"auto"},children:o})]},i)})})]}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:12},children:["Cold-start Beta(1,1) behaves like the heuristic router until outcomes accumulate. Enable learning with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff config set routing.bandit true"}),"."]})]})}function qae(e,t=1){return`${e>0?"+":""}${(e*100).toFixed(t)}%`}function Kae({state:e}){const t={pass:{bg:"#12291a",border:"#238636",color:"#3fb950",label:"✓ pass"},fail:{bg:"#2d1616",border:"#f85149",color:"#f85149",label:"✗ fail"},neutral:{bg:"#1c2128",border:"#6e7681",color:"#8b949e",label:"○ neutral"}}[e];return s.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 Vae({promotion:e}){if(!e.decisionCount)return null;const t=e.promoted?{icon:"🎖️",label:"Promoted — the bandit beats the heuristic",color:"#3fb950"}:e.sufficient?{icon:"⚠️",label:"Not promoted — the bandit is not (yet) better",color:"#d29922"}:{icon:"⏳",label:"Collecting data — need more diverged decisions",color:"#58a6ff"},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 s.jsxs(Zn,{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:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[s.jsx("span",{style:{fontSize:22},children:t.icon}),s.jsx("span",{style:{fontSize:14,fontWeight:600,color:t.color},children:t.label})]}),s.jsxs("div",{style:{marginBottom:14},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"#8b949e",marginBottom:5},children:[s.jsxs("span",{children:[e.divergedCount," diverged decisions"]}),s.jsxs("span",{children:["need ",e.minDecisions," for a verdict"]})]}),s.jsx("div",{style:{background:"#0d1117",borderRadius:4,height:8,overflow:"hidden",border:"1px solid #21262d"},children:s.jsx("div",{style:{width:`${n}%`,background:e.sufficient?"#3fb950":"#58a6ff",height:"100%",transition:"width 0.4s ease"}})}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:4},children:[e.decisionCount," total decisions logged"]})]}),r.map(i=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"7px 0",borderBottom:"1px solid #21262d"},children:[s.jsx("span",{style:{width:70,fontSize:12,color:"#e6edf3"},children:i.label}),s.jsx("span",{style:{width:92,fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"#8b949e"},children:qae(i.delta)}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",flex:1},children:i.note}),s.jsx(Kae,{state:i.state})]},i.key)),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:12},children:["Run auto-routed tasks with ",s.jsx("code",{style:{color:"#58a6ff"},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 Yae({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 s.jsxs(Zn,{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:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.recordCount.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"learned tasks"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #238636",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.length}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"trusted providers"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #d29922",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#d29922",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n.length}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"still learning"})]})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.providers.map(r=>s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"10px 14px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[s.jsx("span",{children:Cr(r.provider)}),s.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#e6edf3"},children:ca(r.provider)}),r.trusted?s.jsxs("span",{style:to("#3fb95026","#238636","#3fb950"),children:["trusted · ",r.samples," samples"]}):s.jsxs("span",{style:to("#d2992226","#9e6a03","#d29922"),children:[r.samples,"/5 samples"]}),r.model&&s.jsx("span",{style:{fontSize:11,color:"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace",marginLeft:"auto"},children:r.model.length>30?r.model.slice(0,27)+"…":r.model})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[s.jsxs("div",{style:{width:70,fontSize:11,color:"#8b949e"},children:["win ",vh(r.winRate,0)]}),s.jsx(p0,{value:r.winRate,color:r.winRate>=.5?"#3fb950":"#f85149"}),s.jsxs("div",{style:{width:74,fontSize:11,color:"#8b949e",textAlign:"right"},children:["factor ",s.jsxs("span",{style:{color:r.trusted&&r.factor!==1?"#58a6ff":"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[r.factor.toFixed(2),"×"]})]})]})]},r.provider))}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:12},children:["Enabled with ",s.jsx("code",{style:{color:"#58a6ff"},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 Xae({routing:e}){return e.bestModels.length?s.jsx(Zn,{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:s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:10},children:e.bestModels.map(t=>s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",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="#3fb950",n.currentTarget.style.boxShadow="0 2px 10px #3fb95022"},onMouseLeave:n=>{n.currentTarget.style.borderColor="#21262d",n.currentTarget.style.boxShadow="none"},children:[s.jsxs("div",{style:{fontSize:12,color:"#8b949e",marginBottom:4},children:[Cr(t.model.split("/")[0])," ",t.agentType]}),s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",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}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:6},children:[s.jsxs("span",{style:{color:t.successRate>=.8?"#3fb950":"#d29922"},children:[vh(t.successRate,0)," success"]})," · ",t.runs," run",t.runs!==1?"s":""]})]},`${t.agentType}-${t.model}`))})}):null}function Zae({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,i=e.totalCalls??0,a=e.totalRetrievals??0,o=e.totalFailovers??0;return s.jsxs(Zn,{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:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #238636",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"tokens saved"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsxs("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[n.toFixed(1),"%"]}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"avg context reduction"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #d29922",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#d29922",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.repoChunks.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"repo chunks indexed"})]})]}),s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",fontSize:12,color:"#8b949e",marginBottom:14},children:[s.jsxs("span",{children:["📞 ",i," context calls · 🧠 ",a," retrievals used · ⚠️ ",o," failovers (full-context fallback)"]}),e.dimensions>0&&s.jsxs("span",{children:["· ",e.dimensions,"-dim embeddings"]})]}),r&&r.used!==!1&&((l=r.hits)==null?void 0:l.length)>0&&s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 16px",marginBottom:12},children:[s.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"#e6edf3",marginBottom:8},children:["Latest retrieval — ",r.originalTokens.toLocaleString()," → ",r.reducedTokens.toLocaleString()," tokens",s.jsxs("span",{style:{color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" (−",(c=r.pctReduced)==null?void 0:c.toFixed(0),"%)"]})]}),s.jsx("div",{style:{fontSize:11,color:"#8b949e"},children:r.hits.slice(0,5).map(u=>s.jsxs("div",{style:{marginTop:3},children:[s.jsx("span",{style:{color:"#58a6ff"},children:"▸"})," ",u.filePath," ",s.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["(sim ",u.similarity.toFixed(3),")"]})]},u.filePath))})]}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681"},children:["Pre-index your repo with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff retrieval index <dir>"}),", query it with"," ",s.jsx("code",{style:{color:"#58a6ff"},children:'buff retrieval query "<question>"'}),", and see the same stats with"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff retrieval stats"}),"."]})]})}function Qae({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,i=e.freeTokens??t-(e.paidTokens??0),a=e.paidTokens??0,o=e.estimatedSavedUsd??0,l=t>0?i/t*100:0;return s.jsxs(Zn,{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:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"tokens tracked"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"requests"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:r>0?"#d29922":"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"parked"})]})]}),s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:16},children:[s.jsxs("div",{style:{flex:"1 1 200px",background:"#0d1117",borderRadius:10,padding:"12px 16px",border:"1px solid #238636"},children:[s.jsx("div",{style:{fontSize:20,fontWeight:700,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:i.toLocaleString()}),s.jsxs("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:["tokens on free/local · ",l.toFixed(0),"% of usage"]}),s.jsxs("div",{style:{fontSize:12,color:"#3fb950",marginTop:4,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["💰 est. $",o.toFixed(4)," saved"]})]}),s.jsxs("div",{style:{flex:"1 1 200px",background:"#0d1117",borderRadius:10,padding:"12px 16px",border:"1px solid #d29922"},children:[s.jsx("div",{style:{fontSize:20,fontWeight:700,color:a>0?"#d29922":"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:a.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"tokens on paid providers (spend triggered)"}),s.jsxs("div",{style:{fontSize:12,color:a>0?"#d29922":"#8b949e",marginTop:4},children:[e.paidRequests??0," paid request",e.paidRequests===1?"":"s"]})]})]}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider / Model"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Tokens"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Requests"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Resets in"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:"State"})]})}),s.jsx("tbody",{children:e.entries.map(u=>s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"8px 10px",whiteSpace:"nowrap"},children:[s.jsxs("span",{style:{color:"#e6edf3"},children:[Cr(u.provider)," ",ca(u.provider).split(" ")[0]]}),s.jsxs("span",{style:{color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" / ",u.model.length>24?u.model.slice(0,21)+"…":u.model]})]}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:u.tokensConsumed.toLocaleString()}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:u.requests}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"right",color:"#8b949e",whiteSpace:"nowrap"},children:m_(u.resetsInMs)}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"center"},children:u.parked?s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#2d1616",border:"1px solid #f85149",color:"#f85149"},children:"⏸ parked"}):s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#12291a",border:"1px solid #238636",color:"#3fb950"},children:"✓ available"})})]},`${u.provider}|${u.model}`))})]})}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681",marginTop:12},children:["Configure limits with ",s.jsx("code",{style:{color:"#58a6ff"},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&&s.jsxs("div",{style:{marginTop:18},children:[s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",marginBottom:10},children:"🔑 Parked Accounts — multi-account key rotation"}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginBottom:8},children:"Accounts skipped predictively by the failover walk (rate-limit / auth). Fingerprints only — raw keys are never stored."}),s.jsx("div",{style:{maxHeight:180,overflowY:"auto",background:"#0d1117",border:"1px solid #21262d",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"?"#d29922":"#f85149";return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.parkedAccounts.length-1?"1px solid #161b22":"none"},children:[s.jsx("span",{style:{fontSize:13},children:"🔒"}),s.jsxs("span",{style:{width:90,flexShrink:0,fontSize:12,color:"#e6edf3"},children:[Cr(u.provider)," ",ca(u.provider).split(" ")[0]]}),s.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},title:u.accountId,children:["#",u.accountId.slice(0,8)]}),s.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"#161b22",border:`1px solid ${h}`,color:h,textAlign:"center"},children:f}),s.jsx("span",{style:{flex:1}}),s.jsxs("span",{style:{fontSize:11,color:"#6e7681",whiteSpace:"nowrap"},children:["re-admits in ",m_(u.remainingMs)]})]},`${u.provider}-${u.accountId}-${d}`)})})]}),e.events&&e.events.length>0&&s.jsxs("div",{style:{marginTop:18},children:[s.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e6edf3",marginBottom:10},children:"🛟 Failover Timeline — quota management & mid-session swaps"}),s.jsx("div",{style:{maxHeight:220,overflowY:"auto",background:"#0d1117",border:"1px solid #21262d",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"?"#f85149":u.type==="re-enabled"||u.type==="released"?"#3fb950":"#d29922",p=u.type==="parked"?"parked":u.type==="re-enabled"?"re-enabled":u.type==="released"?"released":"failover";return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.events.length-1?"1px solid #161b22":"none"},children:[s.jsx("span",{style:{fontSize:13},children:f}),s.jsx("span",{style:{width:80,flexShrink:0,fontSize:11,padding:"1px 8px",borderRadius:10,background:"#161b22",border:`1px solid ${h}`,color:h,textAlign:"center"},children:p}),s.jsxs("span",{style:{flex:1,fontSize:12,color:"#e6edf3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[Cr(u.provider)," ",ca(u.provider)]}),u.reason&&s.jsx("span",{style:{fontSize:11,color:"#8b949e"},children:u.reason}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",whiteSpace:"nowrap"},children:oM(u.timestamp)})]},`${u.timestamp}-${d}`)})})]})]})}function Ud({ok:e,children:t}){return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,padding:"3px 9px",borderRadius:8,background:e===!1?"#2d1616":"#12291a",border:`1px solid ${e===!1?"#f85149":"#238636"}`,color:e===!1?"#f85149":"#3fb950",whiteSpace:"nowrap"},children:t})}function Jae({governance:e}){var r,i,a,o,l;if(!e.enabled)return s.jsx(Zn,{icon:"⚖️",title:"Admin Governance Policy",subtitle:"Hard-constraint rules the Auto router enforces on every pick",children:s.jsxs("div",{style:{fontSize:13,color:"#8b949e"},children:[s.jsx("span",{style:{color:"#3fb950"},children:"Fully permissive"})," — no governance rules active; any provider × model is eligible.",s.jsxs("div",{style:{marginTop:6,fontSize:12,color:"#6e7681"},children:["Add rules with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin allow <provider>"})," ·"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin deny <provider>"})," ·"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin max-cost <usd>"})]})]})});const t=[];(r=e.allowProviders)!=null&&r.length&&t.push({label:"allow providers",items:e.allowProviders}),(i=e.denyProviders)!=null&&i.length&&t.push({label:"deny providers",items:e.denyProviders,deny:!0}),(a=e.allowModels)!=null&&a.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"),s.jsxs(Zn,{icon:"⚖️",title:"Admin Governance Policy",subtitle:"Hard-constraint rules — violating providers are eliminated, never just scored lower",children:[s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:10},children:[t.map(c=>s.jsxs(Ud,{ok:!c.deny,children:[c.deny?"⛔":"✅"," ",c.label,": ",c.items.join(", ")]},c.label)),n.map(c=>s.jsx(Ud,{children:c},c)),t.length===0&&n.length===0&&s.jsx(Ud,{ok:!1,children:"policy configured but no rules active"})]}),s.jsxs("div",{style:{fontSize:12,color:"#6e7681"},children:["Managed via ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin"})," — the same policy the CLI’s"," ",s.jsx("code",{children:"model explain"})," surfaces as governance-blocked."]})]})}function ese({rbac:e}){const t=n=>n==="admin"?"#d29922":n==="operator"?"#3fb950":"#8b949e";return s.jsxs(Zn,{icon:"🔐",title:"RBAC Identity",subtitle:"Who may write policy — role file ~/.buff/rbac.json",children:[s.jsxs("div",{style:{fontSize:13,marginBottom:10},children:[s.jsx("span",{style:{color:"#c9d1d9"},children:"You are "}),s.jsx("code",{style:{color:"#58a6ff"},children:e.identity}),s.jsx("span",{style:{color:"#8b949e"},children:" as "}),e.role?s.jsx("span",{style:{color:t(e.role),fontWeight:600},children:e.role}):s.jsx("span",{style:{color:"#8b949e"},children:"unassigned"})]}),e.legacy?s.jsxs("div",{style:{fontSize:12,color:"#6e7681"},children:[s.jsx("span",{style:{color:"#3fb950"},children:"Legacy single-user mode"})," — no roles assigned; policy writes are open to every user. Assign roles with"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff admin role add <you> admin"}),"."]}):s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[e.users.map(n=>s.jsxs(Ud,{ok:n.role!=="viewer",children:[n.user," · ",n.role,n.via==="oidc"?" (oidc)":""]},n.user)),s.jsxs("div",{style:{width:"100%",fontSize:12,color:"#6e7681",marginTop:4},children:["Policy ",s.jsx("em",{children:"writes"})," require ",s.jsx("code",{style:{color:"#58a6ff"},children:"admin"}),"; reads are open to every role."]})]})]})}function tse({data:e}){var p,g,m,v,y,b,x,k,S,w;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),i=!!((g=t==null?void 0:t.history)!=null&&g.length),a=!!t&&(((m=t.history)==null?void 0:m.length)??0)>0||!!((v=t==null?void 0:t.preference)!=null&&v.length),o=!!((y=t==null?void 0:t.bandit)!=null&&y.enabled),l=!!((b=t==null?void 0:t.promotion)!=null&&b.decisionCount),c=!!((x=t==null?void 0:t.ml)!=null&&x.enabled)&&(t.ml.recordCount??0)>0,u=!!((k=t==null?void 0:t.quota)!=null&&k.enabled),d=!!((S=t==null?void 0:t.retrieval)!=null&&S.enabled)||!!((w=t==null?void 0:t.retrieval)!=null&&w.repoChunks),f=!!(t!=null&&t.governance),h=!!(t!=null&&t.rbac);return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"🤖 Auto Routing Insights"}),s.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"," ",s.jsx("code",{children:"buff benchmark"})," and use Auto routing to build this up over time."]}),!n&&!r&&!i&&!o&&!l&&!c&&!u&&!d&&!f&&!h?s.jsx($ae,{}):s.jsxs(s.Fragment,{children:[a&&t&&s.jsx(Pae,{routing:t}),f&&t.governance&&s.jsx(Jae,{governance:t.governance}),(t==null?void 0:t.rbac)&&s.jsx(ese,{rbac:t.rbac}),r&&s.jsx(zae,{usage:t.usage}),i&&s.jsx(Fae,{history:t.history}),o&&s.jsx(Gae,{bandit:t.bandit}),l&&s.jsx(Vae,{promotion:t.promotion}),c&&t.ml&&s.jsx(Yae,{ml:t.ml}),u&&s.jsx(Qae,{quota:t.quota}),d&&s.jsx(Zae,{retrieval:t.retrieval}),s.jsx(Uae,{routing:t}),s.jsx(Wae,{routing:t}),s.jsx(Xae,{routing:t})]}),t&&t.providers.length===0&&t.bestModels.length===0&&t.preference.length>0&&s.jsx("div",{style:{fontSize:12,color:"#6e7681",marginTop:4},children:"Auto-router preference is always available (static profiles + real pricing); quality metrics appear once you run benchmarks and agent tasks."})]})}const y_={chat:"💬",execute:"⚙️",plan:"🗺️",edit:"✏️",skill:"🧩",learn:"📚",ci:"🔁",doctor:"🩺",probe:"🔭","spot-check":"🧪",telemetry:"📡",usage:"🧮","ide-chat":"💬","ide-inline":"✍️","ide-execute":"⚙️"};function nse(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 lM(e){return e===0?"#3fb950":e<.2?"#d29922":"#f85149"}function rse({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),i=t.reduce((c,u)=>c+(u.costUsd??0),0),a=t.flatMap(c=>c.latency?[c.latency.avg]:[]),o=a.length>0?Math.round(a.reduce((c,u)=>c+u,0)/a.length):void 0,l=new Set(t.map(c=>c.action)).size;return s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"📨"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:n.toLocaleString()}),s.jsx("div",{className:"stat-label",children:"Requests"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"🎯"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:t.length}),s.jsx("div",{className:"stat-label",children:"provider × model × action groups"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"⚡"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:o!==void 0?"#3fb950":"#8b949e"},children:o!==void 0?`${o}ms`:"—"}),s.jsxs("div",{className:"stat-label",children:["Avg latency",o!==void 0?` (${a.length} groups)`:" (no samples)"]})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"📛"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:lM(n>0?r/n:0)},children:n>0?`${(r/n*100).toFixed(1)}%`:"—"}),s.jsxs("div",{className:"stat-label",children:["Overall error rate (",r.toLocaleString()," failures)"]})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"💰"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:i>0?"#d29922":"#8b949e"},children:i>0?`$${i.toFixed(4)}`:"—"}),s.jsxs("div",{className:"stat-label",children:["Measured cost",l>0?` · ${l} actions`:""]})]})]})]})}function ise({data:e}){const[t,n]=E.useState(""),[r,i]=E.useState("all"),a=e==null?void 0:e.requests,o=E.useMemo(()=>{if(!a)return[];const c=t.trim().toLowerCase();return a.rows.filter(u=>r!=="all"&&u.action!==r?!1:c?`${u.provider} ${u.model} ${u.action}`.toLowerCase().includes(c):!0)},[a,t,r]);if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading requests..."})});if(!a||!a.enabled||a.rows.length===0)return s.jsxs("div",{className:"empty-state",style:{padding:"40px 24px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:28,marginBottom:10},children:"📨"}),s.jsx("h2",{className:"section-title",style:{marginTop:0},children:"Requests — per provider × model × action"}),s.jsxs("p",{className:"section-description",style:{maxWidth:560,margin:"0 auto"},children:["No request telemetry yet. As you use ",s.jsx("strong",{children:"chat"}),", ",s.jsx("strong",{children:"execute"}),","," ",s.jsx("strong",{children:"plan"})," and ",s.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 l=[...new Set(a.rows.map(c=>c.action))].sort();return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"📨 Requests — per provider × model × action"}),s.jsx("p",{className:"section-description",children:"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."}),s.jsx(rse,{data:a}),s.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14,flexWrap:"wrap",alignItems:"center"},children:[s.jsxs("select",{value:r,onChange:c=>i(c.target.value),"aria-label":"Filter by action",style:{background:"#161b22",color:"#e6edf3",border:"1px solid #30363d",borderRadius:8,padding:"8px 10px",fontSize:13,cursor:"pointer"},children:[s.jsx("option",{value:"all",children:"All actions"}),l.map(c=>s.jsxs("option",{value:c,children:[y_[c]||"🎯"," ",c]},c))]}),s.jsxs("div",{style:{flex:1,minWidth:220,position:"relative"},children:[s.jsx("span",{style:{position:"absolute",left:10,top:8,color:"#6e7681",fontSize:13},children:"🔍"}),s.jsx("input",{type:"text",value:t,onChange:c=>n(c.target.value),placeholder:"Search provider, model or action...",style:{width:"100%",padding:"8px 12px 8px 32px",background:"#161b22",border:"1px solid #30363d",borderRadius:8,color:"#e6edf3",fontSize:13,outline:"none"}})]}),s.jsxs("span",{style:{fontSize:12,color:"#8b949e",whiteSpace:"nowrap"},children:[o.length," of ",a.rows.length," groups"]})]}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e",textAlign:"left"},children:[s.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Action"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Provider"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Model"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Requests"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Error rate"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Latency avg"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p50"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p95"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p99"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Measured cost"}),s.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Last seen"})]})}),s.jsx("tbody",{children:o.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:11,style:{padding:28,textAlign:"center",color:"#6e7681"},children:"No request groups match your filter."})}):o.map(c=>{var u;return s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsx("td",{style:{padding:"8px 12px",whiteSpace:"nowrap"},children:s.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:8,background:"#21262d",color:"#c9d1d9",border:"1px solid #30363d"},children:[y_[c.action]||"🎯"," ",c.action]})}),s.jsx("td",{style:{padding:"8px 12px",color:"#e6edf3",whiteSpace:"nowrap"},children:c.provider}),s.jsxs("td",{style:{padding:"8px 12px",color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:c.callIds.length>0?`Correlation ids: ${c.callIds.join(", ")}`:void 0,children:[c.model.length>42?c.model.slice(0,39)+"…":c.model,c.callIds.length>0&&s.jsxs("span",{style:{color:"#6e7681",marginLeft:6},title:c.callIds.join(", "),children:["🔗",c.callIds.length]})]}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:c.requests}),s.jsxs("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:lM(c.errorRate)},children:[(c.errorRate*100).toFixed(1),"%",(c.partials??0)>0&&s.jsxs("span",{title:`⏸ ${c.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:"#21122e",border:"1px solid #bc8cff",color:"#bc8cff"},children:["⏸ ",c.partials]})]}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:vd((u=c.latency)==null?void 0:u.avg)}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:c.latency&&c.latency.samples>=3?vd(c.latency.p50):"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:c.latency&&c.latency.samples>=3?vd(c.latency.p95):"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:c.latency&&c.latency.samples>=3?vd(c.latency.p99):"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:c.costUsd?"#d29922":"#6e7681"},children:c.costUsd!==void 0?`$${c.costUsd.toFixed(4)}`:"—"}),s.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"#6e7681",fontSize:11,whiteSpace:"nowrap"},children:nse(c.lastAt)})]},`${c.action}|${c.provider}|${c.model}`)})})]})}),s.jsx("div",{style:{textAlign:"center",fontSize:12,color:"#484f58",marginTop:12},children:"Auto-refreshes with the dashboard feed · percentile columns need ≥3 latency samples per group"})]})}const ase={local:"💻",groq:"🟢",nim:"🔶",gemini:"🔷",openrouter:"🟣"},sse={planner:"🗺️",writer:"✍️",reviewer:"🔎",tester:"🧪",debugger:"🐛",runner:"🏃","context-gatherer":"📂",memory:"🧠","self-improver":"📈"};function ose(e){return ase[e]||"🔌"}function lse(e){return sse[e]||"🤖"}function cM(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 m0(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 ac(e){return e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function cse(e){var n,r;if(!e)return null;const t={bg:"#0d1117",border:"#30363d"};return e.unverifiedClaim?{text:"⚠️ unverified claim — said it acted, but no tool ran",color:"#d29922",bg:"#3d2c00",border:"#d29922"}:e.unfulfilledPromise?{text:"⚠️ unfulfilled promise — announced an action it never performed",color:"#d29922",bg:"#3d2c00",border:"#d29922"}:e.unverifiedEditClaim?{text:"⚠️ unverified edit claim — asserted a fix, but nothing verified it",color:"#d29922",bg:"#3d2c00",border:"#d29922"}:e.unverifiedEdit?{text:`⚠️ unverified edit — ${((n=e.tools)==null?void 0:n.length)??0} tool(s), no test/typecheck/browser run`,color:"#d29922",bg:"#3d2c00",border:"#d29922"}:e.kind==="acted"?{text:e.delivered?"✅ action performed — message sent":`🔧 acted — ${((r=e.tools)==null?void 0:r.length)??0} tool(s)`,color:"#3fb950",bg:"#0d2818",border:"#238636"}:e.kind==="answered"?{text:"💬 answered — no action taken",color:"#8b949e",...t}:e.kind==="cancelled"?{text:"⏹ cancelled",color:"#8b949e",...t}:{text:"❌ generation failed",color:"#f85149",bg:"#2d0f0f",border:"#f85149"}}function Vv({icon:e,title:t,subtitle:n,children:r}){return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px solid #21262d",padding:"18px 20px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[s.jsx("span",{style:{fontSize:20},children:e}),s.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"#e6edf3",margin:0},children:t})]}),n&&s.jsx("p",{style:{fontSize:12,color:"#8b949e",margin:"2px 0 12px 0"},children:n}),!n&&s.jsx("div",{style:{height:6}}),r]})}function use(){return s.jsxs("div",{style:{background:"#0d1117",border:"1px dashed #30363d",borderRadius:10,padding:"18px 20px",color:"#8b949e",fontSize:13,textAlign:"center"},children:["🔍 No reasoning traces yet — every LLM call in a ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff execute"})," pipeline is recorded to ",s.jsx("code",{style:{color:"#58a6ff"},children:"reasoning-traces.json"}),". Run a pipeline, then replay it here or with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff trace replay <id>"}),"."]})}function dse({step:e}){const[t,n]=E.useState(!1),r=e.success?"#3fb950":"#f85149",i=e.success?"ok":"failed";return s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:8,marginBottom:8,overflow:"hidden"},children:[s.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:[s.jsx("span",{style:{width:26,fontSize:16},children:lse(e.agentType)}),s.jsx("span",{style:{width:130,fontSize:12,fontWeight:600,color:"#e6edf3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:e.agentType,children:e.agentType}),s.jsxs("span",{style:{flex:1,fontSize:12,color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${e.provider}/${e.model}`,children:[ose(e.provider)," ",e.provider,"/",e.model]}),s.jsx("span",{style:{width:70,fontSize:11,color:"#6e7681",textAlign:"right"},children:m0(e.latencyMs)}),s.jsxs("span",{style:{width:86,fontSize:11,color:"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace",textAlign:"right"},children:[ac(e.inputTokens),"→",ac(e.outputTokens)," tok"]}),s.jsx("span",{style:{width:46,fontSize:11,color:r,textAlign:"right"},children:i}),s.jsx("span",{style:{width:22,fontSize:11,textAlign:"right"},children:e.escalated?s.jsx("span",{title:"Repair escalated to a stronger routed model (v1.60.4)",children:"🚀"}):""}),s.jsx("span",{style:{fontSize:11,color:"#6e7681"},children:t?"▾":"▸"})]}),t&&s.jsxs("div",{style:{padding:"0 14px 12px 50px",fontSize:12},children:[e.taskId&&s.jsxs("div",{style:{color:"#6e7681",marginBottom:4},children:["Task: ",s.jsx("span",{style:{color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.taskId})]}),e.description&&s.jsx("div",{style:{color:"#8b949e",marginBottom:6},children:e.description}),e.routing&&s.jsxs("div",{style:{marginBottom:6},children:[s.jsxs("span",{style:{fontSize:10,padding:"1px 8px",borderRadius:10,background:e.escalated?"#3d2c00":"#1c2128",border:e.escalated?"1px solid #d29922":"1px solid #58a6ff",color:e.escalated?"#d29922":"#58a6ff"},children:[e.escalated?"🚀 escalated auto → ":"🤖 auto → ",e.routing.provider,"/",e.routing.model," · score ",e.routing.score.toFixed(3)," · ",e.routing.complexity]}),e.escalated&&s.jsx("div",{style:{color:"#d29922",marginTop:4,fontSize:11},children:"Repair escalated to a stronger routed model (next complexity level)."}),e.routing.explanation&&s.jsx("div",{style:{color:"#6e7681",marginTop:4,fontSize:11},children:e.routing.explanation})]}),e.layers&&s.jsxs("div",{style:{marginBottom:6,fontSize:11,color:"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[s.jsx("span",{style:{color:"#58a6ff"},children:"sys"})," ",e.layers.systemChars,"c/#",e.layers.systemDigest," ·"," ",s.jsx("span",{style:{color:"#7ee787"},children:"ctx"})," ",e.layers.contextChars,"c/#",e.layers.contextDigest," ·"," ",s.jsx("span",{style:{color:"#d29922"},children:"vol"})," ",e.layers.volatileChars,"c/#",e.layers.volatileDigest,s.jsxs("div",{style:{color:"#484f58",marginTop:2},children:["a constant ",s.jsx("span",{style:{color:"#58a6ff"},children:"sys"})," digest across steps ⇒ the stable layer is prompt-cacheable"]})]}),e.error&&s.jsxs("div",{style:{color:"#f85149",marginBottom:6},children:["⚠️ ",e.error.slice(0,300)]}),s.jsxs("div",{style:{color:"#6e7681",margin:"6px 0 3px 0"},children:["Prompt ",s.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["#",e.promptDigest]})," · ",e.promptPreview.length,"+ chars:"]}),s.jsx("pre",{style:{background:"#161b22",border:"1px solid #21262d",borderRadius:6,padding:8,margin:0,color:"#8b949e",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:180,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.promptPreview.slice(0,900)}),s.jsxs("div",{style:{color:"#6e7681",margin:"8px 0 3px 0"},children:["Response (",ac(e.responseLength)," chars):"]}),s.jsx("pre",{style:{background:"#161b22",border:"1px solid #21262d",borderRadius:6,padding:8,margin:0,color:"#c9d1d9",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:240,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.responsePreview.slice(0,1200)})]})]})}function fse({trace:e}){const[t,n]=E.useState(e.steps??null),[r,i]=E.useState(!1);E.useEffect(()=>{if(e.steps){n(e.steps);return}let l=!1;return ee.fetchTraceDetail(e.id).then(c=>{l||(c!=null&&c.steps?n(c.steps):i(!0))}),()=>{l=!0}},[e.id,e.steps]);const a=e.success===!0?"✅":e.success===!1?"❌":"⏳",o=e.success===!0?"success":e.success===!1?"failed":"in progress";return s.jsxs(Vv,{icon:a,title:`${e.id} — ${o}`,subtitle:e.goal,children:[s.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12},children:[s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:["🕓 ",cM(e.startedAt)]}),(()=>{const l=cse(e.outcome);return l?s.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})(),s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:["⏱ ",m0(e.durationMs)]}),s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:["🔢 ",(t==null?void 0:t.length)??"?"," call(s)"]}),t&&t.some(l=>l.escalated)&&s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#3d2c00",border:"1px solid #d29922",color:"#d29922"},children:["🚀 ",t.filter(l=>l.escalated).length," escalated repair(s)"]}),e.totalTokens!==void 0&&s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:["🧮 ",ac(e.totalTokens)," tok"]})]}),e.systemPrompt&&s.jsxs("details",{style:{marginBottom:12},children:[s.jsxs("summary",{style:{cursor:"pointer",fontSize:12,color:"#58a6ff"},children:["🧬 System prompt — stable layer (",e.systemPromptChars??e.systemPrompt.length," chars)"]}),s.jsx("pre",{style:{background:"#161b22",border:"1px solid #21262d",borderRadius:6,padding:10,margin:"8px 0 0 0",color:"#8b949e",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:320,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.systemPrompt})]}),r&&s.jsx("div",{style:{color:"#f85149",fontSize:12,marginBottom:10},children:"Could not load trace steps (trace may have been deleted)."}),t===null&&!r&&s.jsx("div",{style:{color:"#8b949e",fontSize:12},children:"Loading steps…"}),t&&t.length===0&&s.jsx("div",{style:{color:"#8b949e",fontSize:12},children:"No LLM calls recorded in this trace."}),t&&t.map(l=>s.jsx(dse,{step:l},l.seq))]})}function hse({traces:e}){const[t,n]=E.useState(null);return t?s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:()=>n(null),style:{background:"#21262d",border:"1px solid #30363d",color:"#e6edf3",borderRadius:8,padding:"6px 14px",fontSize:12,cursor:"pointer",marginBottom:12},children:"← Back to traces"}),s.jsx(fse,{trace:t})]}):s.jsx("div",{children:e.map(r=>{const i=r.success===!0?"✅":r.success===!1?"❌":"⏳",a=r.steps?[...new Set(r.steps.map(o=>o.agentType))].join(", "):"";return s.jsxs("button",{onClick:()=>n(r),style:{width:"100%",background:"#0d1117",border:"1px solid #21262d",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="#58a6ff",o.currentTarget.style.boxShadow="0 2px 10px #58a6ff22"},onMouseLeave:o=>{o.currentTarget.style.borderColor="#21262d",o.currentTarget.style.boxShadow="none"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[s.jsx("span",{children:i}),s.jsx("span",{style:{fontSize:11,color:"#58a6ff",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.id}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",marginLeft:"auto"},children:cM(r.startedAt)})]}),s.jsx("div",{style:{fontSize:13,color:"#e6edf3",marginBottom:6},children:r.goal}),s.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",fontSize:11,color:"#8b949e"},children:[s.jsxs("span",{children:["🔢 ",r.stepCount??0," call(s)"]}),s.jsxs("span",{children:["⏱ ",m0(r.durationMs)]}),r.failedSteps?s.jsxs("span",{style:{color:"#f85149"},children:["❌ ",r.failedSteps," failed"]}):s.jsx("span",{style:{color:"#3fb950"},children:"✓ all ok"}),r.totalTokens!==void 0&&s.jsxs("span",{children:["🧮 ",ac(r.totalTokens)," tok"]}),a&&s.jsxs("span",{children:["🤖 ",a.slice(0,60)]})]})]},r.id)})})}function pse(){const[e,t]=E.useState(null),[n,r]=E.useState(!1),i=E.useCallback(()=>{ee.fetchTraces().then(a=>{a?(t(a),r(!1)):r(!0)})},[]);return E.useEffect(()=>{i();const a=setInterval(i,15e3);return()=>clearInterval(a)},[i]),s.jsxs("div",{className:"panel",children:[s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("h2",{style:{margin:0,fontSize:18,color:"#e6edf3"},children:"🔍 Reasoning Traces"}),s.jsx("p",{style:{margin:"4px 0 0 0",fontSize:12,color:"#8b949e"},children:"Every LLM call in each pipeline — agent × model × prompt digest × response × tokens × latency × routing snapshot (assessment P0)."})]}),e===null&&!n&&s.jsx(Vv,{icon:"⏳",title:"Loading…",children:s.jsx("div",{style:{color:"#8b949e",fontSize:13},children:"Fetching reasoning traces…"})}),n&&e===null&&s.jsx(Vv,{icon:"⚠️",title:"Could not reach the dashboard server",children:s.jsxs("div",{style:{color:"#8b949e",fontSize:13},children:["The traces endpoint is unavailable right now — retrying automatically. Run"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff trace list"})," in the terminal to inspect traces directly."]})}),e!==null&&e.length===0&&s.jsx(use,{}),e!==null&&e.length>0&&s.jsx(hse,{traces:e})]})}function sg(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function mse({authed:e,role:t}){const[n,r]=E.useState(null),[i,a]=E.useState({}),[o,l]=E.useState(""),[c,u]=E.useState(!1),[d,f]=E.useState(null),[h,p]=E.useState(null),g=e&&(t==="admin"||t==="operator"),m=e&&t==="admin",v=E.useCallback(async()=>{var _,N,C;const S=await ee.fetchAdminQuota();if(!S){p("Could not load budget config.");return}p(null),r(S);const w={};for(const T of S.providers){const I=S.quota[T]||{};w[T]={provider:T,tokens:((_=I.tokensPerWindow)==null?void 0:_.toString())??"",requests:((N=I.requestsPerWindow)==null?void 0:N.toString())??"",windowMs:((C=I.windowMs)==null?void 0:C.toString())??""}}a(w),l(S.costUsd===null?"":String(S.costUsd))},[]);E.useEffect(()=>{v()},[v]);const y=(S,w,_)=>{a(N=>({...N,[S]:{...N[S]||{provider:S},[w]:_}}))},b=async()=>{u(!0),f(null);const S={};for(const N of Object.values(i)){const C={},T=sg(N.tokens),I=sg(N.requests),M=sg(N.windowMs);T!==null&&(C.tokensPerWindow=T),I!==null&&(C.requestsPerWindow=I),M!==null&&(C.windowMs=M),S[N.provider]=Object.keys(C).length>0?C:null}const w={quota:S};if(m)if(o.trim()!==""){const N=Number(o);if(!Number.isFinite(N)||N<0){f({ok:!1,text:"Cost cap must be a non-negative number."}),u(!1);return}w.costUsd=N}else w.costUsd=null;const _=await ee.saveAdminQuota(w);u(!1),_.ok?(f({ok:!0,text:"Budget saved — the quota ledger + auto-router will enforce it."}),v()):f({ok:!1,text:_.error||"Save failed."})},x=S=>{const w=n==null?void 0:n.quota[S];return!!w&&(w.tokensPerWindow!==void 0||w.requestsPerWindow!==void 0||w.windowMs!==void 0)},k=S=>"admin-input";return s.jsxs("div",{className:"admin-quota-panel",children:[s.jsx("h3",{className:"section-subtitle",children:"💰 Daily Budget (routing.quota — your plan, your say)"}),s.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 ",s.jsx("code",{children:"buff model quota set"}),"."]}),h?s.jsx("div",{className:"admin-error",children:h}):null,n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-quota-table",children:[s.jsxs("div",{className:"admin-quota-row admin-quota-head",children:[s.jsx("span",{children:"Provider"}),s.jsx("span",{children:"Tokens / window"}),s.jsx("span",{children:"Requests / window"}),s.jsx("span",{children:"Window (ms)"}),s.jsx("span",{children:"Status"})]}),n.providers.map(S=>{var w,_,N;return s.jsxs("div",{className:"admin-quota-row",children:[s.jsx("span",{className:"admin-provider-type",children:S}),s.jsx("input",{className:k(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((w=i[S])==null?void 0:w.tokens)??"",onChange:C=>y(S,"tokens",C.target.value)}),s.jsx("input",{className:k(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((_=i[S])==null?void 0:_.requests)??"",onChange:C=>y(S,"requests",C.target.value)}),s.jsx("input",{className:k(!g),type:"number",min:0,placeholder:"86400000 (24h)",disabled:!g,value:((N=i[S])==null?void 0:N.windowMs)??"",onChange:C=>y(S,"windowMs",C.target.value)}),s.jsx("span",{className:`admin-role-badge ${x(S)?"admin-role-admin":"admin-role-viewer"}`,children:x(S)?"declared":"unset"})]},S)})]}),s.jsxs("div",{className:"admin-quota-row admin-quota-cost",children:[s.jsx("span",{className:"admin-provider-type",children:"Max cost / call (USD, admin)"}),s.jsx("input",{className:k(!m),type:"number",min:0,step:.01,placeholder:"unset",disabled:!m,value:o,onChange:S=>l(S.target.value)}),s.jsx("span",{className:"admin-quota-cost-hint",children:"governance.maxCostUsd — hard admin cap"})]}),g||m?s.jsxs("div",{className:"admin-quota-actions",children:[s.jsx("button",{className:"admin-mini-btn",onClick:()=>void b(),disabled:c,children:c?"⏳ Saving…":"💾 Save budget"}),d?s.jsx("span",{className:d.ok?"admin-quota-ok":"admin-quota-err",children:d.text}):null]}):s.jsxs("div",{className:"admin-readonly-note",children:["🔒 Read-only for ",s.jsx("code",{children:t})," — budget limits need ",s.jsx("code",{children:"admin"})," or"," ",s.jsx("code",{children:"operator"}),"; the cost cap needs ",s.jsx("code",{children:"admin"}),"."]})]}):s.jsx("div",{className:"empty-state",children:"Loading budget…"})]})}const gse={pass:"✅",warn:"⚠️",fail:"❌"},yse={pass:"PASS",warn:"WARN",fail:"FAIL"},vse={env:"Environment",config:"Config",vault:"Vault",local:"Local (no key)",none:"Not configured"};function v_({check:e}){return s.jsxs("div",{className:"admin-check-row","data-status":e.status,children:[s.jsxs("span",{className:`admin-check-badge admin-check-${e.status}`,children:[gse[e.status]," ",yse[e.status]]}),s.jsxs("div",{className:"admin-check-body",children:[s.jsx("div",{className:"admin-check-name",children:e.name}),s.jsx("div",{className:"admin-check-message",children:e.message}),e.detail?s.jsx("div",{className:"admin-check-detail",children:e.detail}):null,e.fix?s.jsxs("div",{className:"admin-check-fix",children:["💡 ",e.fix]}):null]})]})}function bse(){const[e,t]=E.useState(null),[n,r]=E.useState(!0),[i,a]=E.useState(null),[o,l]=E.useState(null),[c,u]=E.useState(!1),[d,f]=E.useState(!1),[h,p]=E.useState(""),[g,m]=E.useState(""),[v,y]=E.useState(null),[b,x]=E.useState(null),[k,S]=E.useState(""),[w,_]=E.useState(""),[N,C]=E.useState(""),[T,I]=E.useState(null),[M,$]=E.useState(!1),[R,z]=E.useState([]),[D,U]=E.useState(null),[O,F]=E.useState(""),[A,Z]=E.useState(""),[L,P]=E.useState("viewer"),[ce,we]=E.useState([]),[pe,Pe]=E.useState({}),[G,X]=E.useState(null),[ae,le]=E.useState({}),[Y,_e]=E.useState(""),[Ee,je]=E.useState(null),[ve,$e]=E.useState(null),fe=E.useCallback(async()=>{r(!0),a(null);const q=await ee.fetchAdminChecks();t(q),q||a("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),r(!1)},[]),vt=E.useCallback(async()=>{const q=await ee.fetchAdminCatalog();q&&q.length>0&&we(q)},[]),Le=E.useCallback(async()=>{const q=await ee.fetchAdminUsers();q.ok&&q.users&&z(q.users)},[]);E.useEffect(()=>{let q=!0;return ee.fetchAdminAuthStatus().then(me=>{if(q){if(!me){a("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:me.configured,authenticated:me.authenticated}),u(me.authenticated),y(me.role??null),x(me.user??null),f(me.mustChangePassword===!0),me.authenticated?(fe(),vt(),Le()):r(!1)}}),()=>{q=!1}},[fe,vt,Le]);const Ae=v==="admin",He=()=>{u(!1),l(q=>q&&{...q,authenticated:!1}),I("Session expired — log in again.")},Ie=async q=>{q.preventDefault(),$(!0),I(null);const me=await ee.adminLogin(k,w);me.ok?(u(!0),l({configured:!0,authenticated:!0}),y(me.role??"admin"),x(me.user??null),S(""),_(""),ee.fetchAdminAuthStatus().then(Re=>{Re&&f(Re.mustChangePassword===!0)}),fe(),vt(),Le()):I(me.error||"Login failed."),$(!1)},xn=async q=>{if(q.preventDefault(),$(!0),I(null),w.length<8){I("Password must be at least 8 characters."),$(!1);return}if(w!==N){I("Passwords do not match."),$(!1);return}const me=await ee.adminSetup(k,w);me.ok?(u(!0),l({configured:!0,authenticated:!0}),y(me.role??"admin"),x(me.user??null),S(""),_(""),C(""),fe(),vt(),Le()):I(me.error||"Setup failed."),$(!1)},$t=async()=>{await ee.adminLogout(),u(!1),l(q=>q&&{...q,authenticated:!1}),y(null),x(null),t(null),Pe({}),le({}),z([])},W=async()=>{if(!window.confirm("Stop the running gateway? Channels will stop responding until you restart it with `buff gateway start`."))return;$e("gateway"),je(null);const q=await ee.shutdown("gateway");$e(null),q.ok?je(q.stopped?"✅ Gateway stopped.":`ℹ️ ${q.reason||"No running gateway found — nothing to stop."}`):(je(`❌ ${q.error||"Stop failed."}`),q.unauthorized&&He())},V=async()=>{window.confirm("Shut down the dashboard? This page will disconnect and the server will exit. Restart with `buff dashboard`.")&&($e("dashboard"),je("🛑 Shutting down the dashboard — this page will disconnect…"),await ee.shutdown("dashboard"),$e(null),je("ℹ️ The dashboard server did not stop (see the server terminal). You can also stop it with `buff dashboard stop`."))},oe=async q=>{if(q.preventDefault(),U(null),A.length<8){U("Password must be at least 8 characters.");return}const me=await ee.addAdminUser(O,A,L);me.ok?(F(""),Z(""),U("✅ User added"),Le()):(U(`❌ ${me.error||"Failed to add user"}`),me.unauthorized&&He())},he=async q=>{if(!window.confirm(`Remove dashboard user '${q}'?`))return;U(null);const me=await ee.removeAdminUser(q);me.ok?(U(`✅ Removed ${q}`),Le()):(U(`❌ ${me.error||"Failed to remove user"}`),me.unauthorized&&He())},xe=(q,me,Re)=>{Pe(Ce=>({...Ce,[q]:{...Ce[q]||{},[me]:Re}}))},Qe=async q=>{X(q),le({});const me=pe[q]||{},Re=await ee.saveProvider(q,me);Re.ok?(t(Ce=>{if(!Ce)return Ce;const Rr=Ce.providers.some(gr=>gr.type===q)?Ce.providers.map(gr=>gr.type===q&&Re.provider?Re.provider:gr):Re.provider?[...Ce.providers,Re.provider]:Ce.providers;return{...Ce,providers:Rr}}),Pe(Ce=>{const Fn={...Ce};return delete Fn[q],Fn}),le(Ce=>({...Ce,[q]:"✅ Saved"}))):(le(Ce=>({...Ce,[q]:`❌ ${Re.error||"Save failed"}`})),Re.unauthorized&&He()),X(null)},Lt=async q=>{if(!window.confirm(`Remove ${q}'s API key and configuration? This cannot be undone.`))return;X(q),le({});const me=await ee.deleteProvider(q);me.ok?me.envSourced?(t(Re=>Re&&{...Re,providers:Re.providers.map(Ce=>Ce.type===q&&me.provider||Ce)}),le(Re=>({...Re,[q]:`⚠️ Key comes from ${me.envVar?`$${me.envVar}`:"an env var"} — unset it there to remove it (config can't override the env).`}))):(t(Re=>Re&&{...Re,providers:Re.providers.filter(Ce=>Ce.type!==q)}),Pe(Re=>{const Ce={...Re};return delete Ce[q],Ce})):(le(Re=>({...Re,[q]:`❌ ${me.error||"Remove failed"}`})),me.unauthorized&&He()),X(null)},Ct=async q=>{X(q);const me=await ee.testProvider(q);le(Re=>{var Ce;return{...Re,[q]:me.ok?`✅ Connected — ${((Ce=me.models)==null?void 0:Ce.length)??0} model(s) reachable`:`❌ ${me.error||"Connection failed"}`}}),X(null)},An=()=>{Y&&(Pe(q=>({...q,[Y]:{}})),_e(""))};if(i&&!o)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"🛠️ Admin"}),s.jsx("div",{className:"admin-error",children:i})]});if(!o||!c&&n)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"🛠️ Admin"}),s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Loading…"})]})]});if(!c){const q=!o.configured;return s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["🛠️ Admin — ",q?"Set up access":"Log in"]}),s.jsx("p",{className:"admin-subtitle",children:q?"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."}),s.jsxs("form",{className:"admin-gate-form",onSubmit:q?xn:Ie,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:k,onChange:me=>S(me.target.value),autoComplete:"username",placeholder:"admin"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:w,onChange:me=>_(me.target.value),autoComplete:q?"new-password":"current-password",placeholder:"••••••••"})]}),q?s.jsxs("label",{children:[s.jsx("span",{children:"Confirm password"}),s.jsx("input",{type:"password",value:N,onChange:me=>C(me.target.value),autoComplete:"new-password",placeholder:"••••••••"})]}):null,T?s.jsx("div",{className:"admin-error",children:T}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:M||!k||!w,children:M?"⏳ …":q?"🔐 Create admin":"🔐 Log in"}),q?s.jsxs("p",{className:"admin-hint",children:["Automation alternative: set ",s.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_USER"})," and"," ",s.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_PASSWORD"})," in the dashboard's environment."]}):null]})]})}if(d){const q=h.length>0&&h.length<8,me=g.length>0&&g!==h,Re=async Ce=>{if(Ce.preventDefault(),q||me||!h)return;$(!0),I(null);const Fn=await ee.changeAdminPassword(w,h);Fn.ok?(f(!1),_(""),p(""),m(""),fe(),vt(),Le()):I(Fn.error||"Could not change the password."),$(!1)};return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"🔐 Set your own password"}),s.jsxs("p",{className:"admin-subtitle",children:["This dashboard is running on its ",s.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."]}),s.jsxs("form",{className:"admin-gate-form",onSubmit:Re,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Current password"}),s.jsx("input",{type:"password",value:w,onChange:Ce=>_(Ce.target.value),autoComplete:"current-password",placeholder:"admin"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"New password"}),s.jsx("input",{type:"password",value:h,onChange:Ce=>p(Ce.target.value),autoComplete:"new-password",placeholder:"at least 8 characters"})]}),q?s.jsx("div",{className:"admin-error",children:"Use at least 8 characters."}):null,s.jsxs("label",{children:[s.jsx("span",{children:"Confirm new password"}),s.jsx("input",{type:"password",value:g,onChange:Ce=>m(Ce.target.value),autoComplete:"new-password",placeholder:"repeat it"})]}),me?s.jsx("div",{className:"admin-error",children:"The two passwords do not match."}):null,T?s.jsx("div",{className:"admin-error",children:T}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:M||!w||!h||q||me,children:M?"⏳ …":"🔐 Save new password"})]})]})}const Ot=(e==null?void 0:e.system.filter(q=>q.status==="pass").length)??0,dt=(e==null?void 0:e.system.filter(q=>q.status==="warn").length)??0,Tn=(e==null?void 0:e.system.filter(q=>q.status==="fail").length)??0,Qt=(e==null?void 0:e.enterprise.filter(q=>q.status==="pass").length)??0,ws=(e==null?void 0:e.enterprise.filter(q=>q.status==="warn").length)??0,ka=(e==null?void 0:e.enterprise.filter(q=>q.status==="fail").length)??0,mr=(e==null?void 0:e.providers)??[],Jt=q=>{const me=ce.find(Re=>Re.id===q);return me||{label:q}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["🛠️ Admin — Command Runner & Configuration",b?s.jsxs("span",{className:`admin-role-badge admin-role-${v||"viewer"}`,children:[b," · ",v||"viewer"]}):null]}),s.jsxs("div",{className:"admin-header-actions",children:[s.jsx("button",{className:"admin-refresh-btn",onClick:()=>void fe(),disabled:n,children:n?"⏳ Running checks…":"🔄 Refresh (run all commands)"}),Ae||v==="operator"?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void W(),disabled:ve!==null,title:"Stop the running gateway (buff gateway stop)",children:ve==="gateway"?"⏳ Stopping…":"⏻ Stop gateway"}):null,Ae?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void V(),disabled:ve!==null,title:"Shut down this dashboard server (buff dashboard stop)",children:ve==="dashboard"?"⏳ Stopping…":"🛑 Stop dashboard"}):null,s.jsx("button",{className:"admin-logout-btn",onClick:()=>void $t(),children:"🚪 Log out"})]})]}),Ee?s.jsx("div",{className:"admin-error",children:Ee}):null,Ae?null:s.jsxs("div",{className:"admin-readonly-note",children:["🔒 Your role (",s.jsx("code",{children:v||"viewer"}),") is read-only here — provider configuration and user management require the ",s.jsx("code",{children:"admin"})," role. The CLI enforces the same governance policy (rbac.json)."]}),s.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."}),i?s.jsx("div",{className:"admin-error",children:i}):null,e?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card admin-summary-pass",children:[s.jsx("div",{className:"admin-summary-value",children:Ot+Qt}),s.jsx("div",{className:"admin-summary-label",children:"✅ Passing"})]}),s.jsxs("div",{className:"admin-summary-card admin-summary-warn",children:[s.jsx("div",{className:"admin-summary-value",children:dt+ws}),s.jsx("div",{className:"admin-summary-label",children:"⚠️ Warnings"})]}),s.jsxs("div",{className:"admin-summary-card admin-summary-fail",children:[s.jsx("div",{className:"admin-summary-value",children:Tn+ka}),s.jsx("div",{className:"admin-summary-label",children:"❌ Failing"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:mr.length}),s.jsx("div",{className:"admin-summary-label",children:"Providers"})]})]}),s.jsx("h3",{className:"section-subtitle",children:"⚙️ System Checks (buff doctor)"}),s.jsx("div",{className:"admin-check-list",children:e.system.map(q=>s.jsx(v_,{check:q},q.name))}),s.jsx("h3",{className:"section-subtitle",children:"🏥 Enterprise Self-Check (doctor --enterprise)"}),s.jsx("div",{className:"admin-check-list",children:e.enterprise.length>0?e.enterprise.map(q=>s.jsx(v_,{check:q},q.name)):s.jsx("div",{className:"empty-state",children:"No enterprise checks returned."})}),s.jsx("h3",{className:"section-subtitle",children:"🔑 Provider Configuration (keys masked)"}),s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Provider"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Key"}),s.jsx("th",{children:"Base URL"}),s.jsx("th",{children:"Model"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[mr.map(q=>{const me=Jt(q.type),Re=pe[q.type]||{};return s.jsxs("tr",{children:[s.jsxs("td",{className:"admin-provider-type",children:[me.icon?`${me.icon} `:"",me.label,s.jsxs("div",{className:"admin-provider-sub",children:[q.type," · ",vse[q.keySource]||q.keySource]}),q.keySource==="env"?s.jsxs("div",{className:"admin-hint",children:["comes from ",me.envVar||"env var"," — change it there, config can't override it"]}):q.keySource==="vault"?s.jsx("div",{className:"admin-hint",children:"stored in the OS keyring (vault)"}):null]}),s.jsx("td",{children:s.jsx("span",{className:`admin-check-badge ${q.configured?"admin-check-pass":"admin-check-warn"}`,children:q.configured?"✅ Configured":"⚠️ Not configured"})}),s.jsx("td",{children:me.keyless?s.jsx("div",{className:"admin-hint",children:"No key needed (probed)"}):Ae?s.jsx("input",{className:"admin-input admin-key-input",type:"password","aria-label":`${q.type} API key`,placeholder:q.keyMasked||"set a new key…",value:Re.apiKey??"",onChange:Ce=>xe(q.type,"apiKey",Ce.target.value),autoComplete:"new-password"}):s.jsx("div",{className:"admin-hint",children:q.keyMasked||"—"})}),s.jsx("td",{children:Ae?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${q.type} base URL`,placeholder:q.baseUrl||"default endpoint",value:Re.baseUrl??"",onChange:Ce=>xe(q.type,"baseUrl",Ce.target.value)}):s.jsx("div",{className:"admin-hint",children:q.baseUrl?q.baseUrl.replace(/^https?:\/\/(?:[^@/]*@)?/,""):"default endpoint"})}),s.jsx("td",{children:Ae?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${q.type} model`,placeholder:q.model||"default model",value:Re.model??"",onChange:Ce=>xe(q.type,"model",Ce.target.value)}):s.jsx("div",{className:"admin-hint",children:q.model||"default model"})}),s.jsx("td",{children:Ae?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-row-actions",children:[s.jsx("button",{className:"admin-mini-btn",disabled:G===q.type,onClick:()=>void Qe(q.type),children:"💾 Save"}),s.jsx("button",{className:"admin-mini-btn",disabled:G===q.type,title:"Tests the SAVED configuration — save first to test a new key",onClick:()=>void Ct(q.type),children:"🔌 Test"}),s.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:G===q.type,onClick:()=>void Lt(q.type),children:"🗑 Remove"})]}),ae[q.type]?s.jsx("div",{className:"admin-row-msg",children:ae[q.type]}):null]}):s.jsx("div",{className:"admin-hint",children:"read-only"})})]},q.type)}),mr.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"admin-empty-cell",children:"No providers configured yet."})}):null]})]})}),Ae&&ce.length>0?s.jsxs("div",{className:"admin-add-provider",children:[s.jsxs("select",{className:"admin-input",value:Y,onChange:q=>_e(q.target.value),children:[s.jsx("option",{value:"",children:"Add a provider…"}),ce.filter(q=>!mr.some(me=>me.type===q.id)).map(q=>s.jsxs("option",{value:q.id,children:[q.icon?`${q.icon} `:"",q.label," (",q.id,")"]},q.id))]}),s.jsx("button",{className:"admin-mini-btn",disabled:!Y,onClick:An,children:"➕ Add"})]}):null,s.jsx(mse,{authed:c,role:v||"viewer"}),Ae?s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"👥 Dashboard Users (role.manage)"}),s.jsxs("div",{className:"admin-users-list",children:[R.map(q=>s.jsxs("div",{className:"admin-user-row",children:[s.jsx("span",{className:"admin-user-name",children:q.user}),s.jsx("span",{className:`admin-role-badge admin-role-${q.role}`,children:q.role}),s.jsxs("span",{className:"admin-user-since",children:["since ",new Date(q.createdAt).toLocaleDateString()]}),q.user!==b?s.jsx("button",{className:"admin-mini-btn admin-mini-danger",onClick:()=>void he(q.user),children:"🗑 Remove user"}):s.jsx("span",{className:"admin-hint",children:"you"})]},q.user)),R.length===0?s.jsx("div",{className:"empty-state",children:"No dashboard users yet."}):null]}),s.jsxs("form",{className:"admin-gate-form admin-user-form",onSubmit:oe,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:O,onChange:q=>F(q.target.value),autoComplete:"off"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password (min 8 chars)"}),s.jsx("input",{type:"password",value:A,onChange:q=>Z(q.target.value),autoComplete:"new-password"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{value:L,onChange:q=>P(q.target.value),children:[s.jsx("option",{value:"viewer",children:"viewer — read-only"}),s.jsx("option",{value:"operator",children:"operator — read-only in the dashboard today"}),s.jsx("option",{value:"admin",children:"admin — full control"})]})]}),D?s.jsx("div",{className:"admin-row-msg",children:D}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:!O||!A,children:"➕ Add user"})]})]}):null]}):n?s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Running all state checks…"})]}):null]})}function uM(e){return String(e??"").replace(/\d{3,}/g,t=>t.slice(0,2)+"***")}const xse={idle:"Not paired",pairing:"⏳ Pairing…",paired:"✅ Paired",failed:"❌ Pairing failed",cancelled:"⏹ Cancelled",error:"💥 Pairing error"};function wse({authed:e,canWrite:t,sessionExpired:n,reveal:r=!1}){const[i,a]=E.useState(null),[o,l]=E.useState({}),[c,u]=E.useState(""),[d,f]=E.useState(!1),[h,p]=E.useState(null),g=E.useRef(null),m=E.useCallback(async()=>{const w=await ee.getWhatsAppStatus();w&&(a(w.status),l(w.contacts??{}))},[]);E.useEffect(()=>{if(m(),!e||typeof EventSource>"u")return;const w=ee.subscribeWhatsApp({onQr:_=>a(N=>N&&{...N,qr:_,state:"pairing"}),onCode:_=>a(N=>N&&{...N,pairingCode:_}),onStatus:_=>{a(_),(_.state==="paired"||_.state==="failed"||_.state==="error"||_.state==="cancelled")&&f(!1)}});return g.current=w,()=>{w(),g.current=null}},[e,m]);const v=async w=>{f(!0),p(null);const _=await w();if(!_.ok&&_.error&&/Not authenticated|Session expired/i.test(_.error)){n(),f(!1);return}_.ok?(p({kind:"ok",text:"Done."}),await m()):p({kind:"err",text:_.error||"Action failed."}),f(!1)},y=w=>{p(null),v(()=>ee.startWhatsAppPair(w?c.trim():void 0)).then(()=>u(""))},b=()=>{p(null),v(()=>ee.cancelWhatsAppPair())},x=()=>{window.confirm("Remove the paired WhatsApp session from this machine? You will need to scan a QR to pair again.")&&(p(null),v(()=>ee.unpairWhatsApp()))},k=(i==null?void 0:i.state)??"idle",S=k==="pairing";return s.jsxs("div",{className:"wa-panel",children:[s.jsxs("div",{className:"wa-panel-head",children:[s.jsx("span",{className:"wa-panel-title",children:"🟢 WhatsApp bridge"}),i?s.jsx("span",{className:`wa-badge ${i.paired?"wa-badge-paired":S?"wa-badge-pairing":""}`,children:xse[k]}):s.jsx("span",{className:"admin-hint",children:"loading…"})]}),s.jsxs("p",{className:"admin-hint",children:["The personal Baileys bridge (no Meta Business account) — pair once, and the gateway can send & receive WhatsApp. Session: ",s.jsx("code",{children:(i==null?void 0:i.sessionDir)??"~/.buff/whatsapp/session"}),". Same engine as"," ",s.jsx("code",{children:"buff whatsapp pair"}),"."]}),S?s.jsxs("div",{className:"wa-pairing",children:[i!=null&&i.qr?s.jsxs("div",{className:"wa-qr-box",children:[s.jsx("img",{className:"wa-qr-img",src:i.qr,alt:"WhatsApp pairing QR code"}),s.jsxs("p",{className:"admin-hint",children:["Open WhatsApp on the phone → ",s.jsx("strong",{children:"Linked devices → Link a device → scan"}),". The QR refreshes automatically while this window is open."]})]}):i!=null&&i.phone?s.jsxs("div",{className:"wa-code-box",children:[s.jsxs("p",{className:"admin-hint",children:["On the phone with ",s.jsx("strong",{children:i.phone}),": WhatsApp → Linked devices → Link a device →"," ",s.jsx("strong",{children:"“Link with phone number instead”"})," → enter:"]}),s.jsx("div",{className:"wa-code",children:i.pairingCode??"… waiting for code"})]}):s.jsx("div",{className:"wa-code-box",children:s.jsx("p",{className:"admin-hint",children:"Waiting for WhatsApp to hand over a QR… (it usually appears within a few seconds)"})}),i!=null&&i.phone?null:s.jsxs("div",{className:"admin-hint",children:["Tip: on a phone, “Link with phone number instead” needs the number format"," ",s.jsx("code",{children:"918844433322"})," (country code included) — enter it below instead of scanning."]}),i!=null&&i.error?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:i.error}):null,t&&e?s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:b,disabled:d,children:d?"⏳…":"⏹ Cancel pairing"}):null]}):s.jsxs("div",{className:"wa-actions",children:[t&&e?i!=null&&i.paired?s.jsxs("div",{className:"wa-action-row",children:[s.jsx("button",{className:"admin-refresh-btn wa-unpair-btn",type:"button",onClick:x,disabled:d,children:d?"⏳…":"🗑 Unpair (remove session)"}),s.jsx("span",{className:"admin-hint",children:"Removes creds.json — you will need to scan a QR again."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"wa-action-row",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>y(!1),disabled:d,children:d?"⏳…":"🔳 Pair with a QR"}),s.jsx("span",{className:"admin-hint",children:"Scans from the phone you want to link."})]}),s.jsxs("div",{className:"wa-action-row wa-phone-row",children:[s.jsx("input",{type:"text",className:"wa-phone-input",value:c,onChange:w=>u(w.target.value),placeholder:"or pair with a number — e.g. 918844433322",disabled:d,maxLength:16}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>y(!0),disabled:d||!c.trim(),children:"Pair by number"})]})]}):null,k==="failed"||k==="error"||k==="cancelled"?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:(i==null?void 0:i.error)||(k==="cancelled"?"Pairing cancelled.":"Pairing failed — try again.")}):null,e?t?null:s.jsx("div",{className:"admin-row-msg",children:"Your role can view pairing status but not change it (requires admin or operator)."}):s.jsx("div",{className:"admin-row-msg",children:"Log in (admin or operator) to pair, cancel, or unpair."}),h?s.jsx("div",{className:`admin-row-msg${h.kind==="ok"?"":" admin-row-msg-err"}`,children:h.text}):null]}),s.jsxs("div",{className:"wa-contacts",children:[s.jsxs("div",{className:"wa-contacts-head",children:[s.jsx("span",{className:"wa-panel-title",children:"📇 Send-by-name contacts"}),s.jsxs("span",{className:"admin-hint",children:[Object.keys(o).length," mapped"]})]}),s.jsxs("p",{className:"admin-hint",children:["These names are for ",s.jsx("strong",{children:"sending messages by name"})," (e.g."," ",s.jsx("code",{children:'buff gateway send whatsapp:Name "…"'}),") — they do"," ",s.jsx("strong",{children:"NOT"})," let these numbers trigger the agent."]}),s.jsx("div",{className:"hub-alias-list",children:Object.keys(o).length===0?s.jsxs("span",{className:"admin-hint",children:["(none — add one with ",s.jsx("code",{children:"buff whatsapp contact add <Name> <number>"}),")"]}):Object.entries(o).map(([w,_])=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:w}),s.jsxs("span",{className:"admin-hint",children:["→ ",r?_:uM(_)]})]},w))}),s.jsxs("p",{className:"admin-hint",style:{marginTop:8},children:["To let a number ",s.jsx("strong",{children:"trigger the agent"})," (respond to its messages), add it to the"," ",s.jsx("strong",{children:"verified list"})," in the ",s.jsx("strong",{children:"Permissions tab above"}),", or run"," ",s.jsx("code",{children:"buff config gateway allow whatsapp user <number>"}),"."]})]})]})}function Sse({canWrite:e,sessionExpired:t,mode:n="grid"}){const[r,i]=E.useState(null),[a,o]=E.useState(null),[l,c]=E.useState(null),[u,d]=E.useState(null),[f,h]=E.useState(null),[p,g]=E.useState(0),[m,v]=E.useState({}),[y,b]=E.useState(!1),[x,k]=E.useState(null),S=E.useRef(!0),w=E.useCallback(async()=>{const $=await ee.getPlatformConfigs();S.current&&i($)},[t]);E.useEffect(()=>(w(),()=>{S.current=!1}),[w]);const _=async($,R)=>{c($),d(null);const z=await ee.setPlatformConfig($,R);if(S.current){if(c(null),z.unauthorized||z.forbidden){t(z.error);return}d({kind:z.ok?"ok":"err",text:z.ok?"Saved — transport active.":z.error||"Save failed."}),z.ok&&(o(null),w())}},N=async $=>{if(!window.confirm(`Remove ${$} transport config? Tokens will be deleted from ~/.buff/.env.`))return;c($),d(null);const R=await ee.removePlatformConfig($);if(S.current){if(c(null),R.unauthorized||R.forbidden){t(R.error);return}d({kind:R.ok?"ok":"err",text:R.ok?"Removed.":R.error||"Remove failed."}),R.ok&&w()}},C={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!"]}},T=$=>{e&&(h($),g(0),v(Object.fromEntries($.envVars.map(R=>[R.varName,R.value]))),k(null))},I=async()=>{if(!f||!e)return;b(!0),k(null);const $=await ee.setPlatformConfig(f.platform,m);if(b(!1),$.unauthorized||$.forbidden){t($.error);return}$.ok?(k({kind:"ok",text:"✅ Token saved! The transport is now active."}),w()):k({kind:"err",text:$.error||"Save failed."})};if(r===null)return s.jsx("div",{className:"empty-state",children:"Loading platform transports…"});const M=f?C[f.platform]:null;return n==="table"?s.jsxs(s.Fragment,{children:[f&&M?s.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:s.jsxs("div",{className:"wizard-modal",onClick:$=>$.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:"🚀"}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"✕"})]}),s.jsx("div",{className:"wizard-body",children:p===0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"📋 Steps to create your bot:"}),s.jsx("ol",{className:"wizard-steps",children:M.steps.map(($,R)=>s.jsx("li",{children:$},R))}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token →"}),f.setupUrl?s.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Docs"}):null]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"🔑 Paste your token:"}),f.envVars.map($=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:$.prompt}),s.jsx("input",{type:$.secret?"password":"text",value:m[$.varName]??"",onChange:R=>v(z=>({...z,[$.varName]:R.target.value})),placeholder:$.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},$.varName)),x?s.jsx("div",{className:`admin-row-msg${x.kind==="ok"?"":" admin-row-msg-err"}`,children:x.text}):null,s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"← Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void I(),disabled:y||!e,children:y?"⏳ Saving…":"💾 Save token"})]}),(x==null?void 0:x.kind)==="ok"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"📋 Next steps:"}),s.jsx("ol",{className:"wizard-steps",children:M.postSetup.map(($,R)=>s.jsx("li",{children:$},R))})]}):null]})})]})}):null,u?s.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,s.jsx("div",{className:"platform-config-table-wrapper",children:s.jsxs("table",{className:"platform-config-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Platform"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Configuration"}),s.jsx("th",{children:"CLI Command"})]})}),s.jsx("tbody",{children:r.map($=>s.jsxs(H.Fragment,{children:[s.jsxs("tr",{className:`platform-config-row ${$.configured?"configured":""}`,children:[s.jsxs("td",{className:"platform-config-name",children:[s.jsx("span",{className:"hub-platform-label",children:$.label}),s.jsx("span",{className:"hub-card-id",children:$.platform})]}),s.jsxs("td",{children:[s.jsx("span",{className:`status-dot ${$.configured?"connected":"reconnecting"}`}),s.jsx("span",{className:"platform-config-status-text",children:$.configured?"Active":"Not configured"})]}),s.jsxs("td",{className:"platform-config-actions",children:[$.configured?null:s.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>T($),disabled:!e,children:"🚀 Getting Started"}),$.setupUrl?s.jsx("a",{href:$.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Docs"}):null,s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(a===$.platform?null:$.platform),disabled:!e,children:a===$.platform?"▴ Close":$.configured?"✎ Edit":"⚙ Configure"}),$.configured?s.jsx("button",{type:"button",className:"admin-mini-btn contact-delete-btn",onClick:()=>void N($.platform),disabled:!e,children:"🗑️"}):null]}),s.jsx("td",{className:"platform-config-cli",children:s.jsxs("code",{children:["buff gateway setup ",$.platform]})})]}),a===$.platform?s.jsx("tr",{className:"platform-config-expanded",children:s.jsx("td",{colSpan:4,children:s.jsxs("div",{className:"platform-config-form",children:[$.envVars.map(R=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:R.prompt}),s.jsx("input",{type:R.secret?"password":"text",value:R.value,readOnly:!0,className:"platform-config-readonly",placeholder:R.secret?"••••••••":"value"})]},R.varName)),s.jsxs("p",{className:"admin-hint",children:["Tokens are in ",s.jsx("code",{children:"~/.buff/.env"})," — edit there or use the wizard above."]})]})})}):null]},$.platform))})]})})]}):s.jsxs(s.Fragment,{children:[f&&M?s.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:s.jsxs("div",{className:"wizard-modal",onClick:$=>$.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:"🚀"}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"✕"})]}),s.jsx("div",{className:"wizard-body",children:p===0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"📋 Steps to create your bot:"}),s.jsx("ol",{className:"wizard-steps",children:M.steps.map(($,R)=>s.jsx("li",{children:$},R))}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token →"}),f.setupUrl?s.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"📖 Open docs in new tab"}):null]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"🔑 Paste your token:"}),f.envVars.map($=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:$.prompt}),s.jsx("input",{type:$.secret?"password":"text",value:m[$.varName]??"",onChange:R=>v(z=>({...z,[$.varName]:R.target.value})),placeholder:$.secret?"••••••••":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},$.varName)),x?s.jsx("div",{className:`admin-row-msg${x.kind==="ok"?"":" admin-row-msg-err"}`,children:x.text}):null,s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"← Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void I(),disabled:y||!e,children:y?"⏳ Saving…":"💾 Save token"})]}),(x==null?void 0:x.kind)==="ok"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"📋 Next steps:"}),s.jsx("ol",{className:"wizard-steps",children:M.postSetup.map(($,R)=>s.jsx("li",{children:$},R))})]}):null]})})]})}):null,s.jsxs("div",{className:"platform-config",children:[s.jsx("h3",{className:"section-subtitle",children:"⚙️ Platform transports (buff config gateway)"}),u?s.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,s.jsx("div",{className:"hub-platform-grid",children:r.map($=>s.jsx(kse,{entry:$,canWrite:e,busy:l===$.platform,expanded:a===$.platform,onToggle:()=>o(a===$.platform?null:$.platform),onSave:R=>void _($.platform,R),onRemove:()=>void N($.platform),onStartWizard:()=>T($)},$.platform))}),s.jsxs("p",{className:"admin-hint",children:["Tokens are written to ",s.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 kse(e){const{entry:t,canWrite:n,busy:r,expanded:i,onToggle:a,onSave:o,onRemove:l,onStartWizard:c}=e,[u,d]=E.useState(()=>Object.fromEntries(t.envVars.map(h=>[h.varName,h.value]))),f=(h,p)=>{d(g=>({...g,[h]:p}))};return s.jsxs("div",{className:`hub-platform${t.configured?" configured":""}`,children:[s.jsxs("div",{className:"hub-platform-head",children:[s.jsx("span",{className:`status-dot ${t.configured?"connected":"reconnecting"}`}),s.jsx("span",{className:"hub-platform-label",children:t.label}),s.jsx("span",{className:"hub-card-id",children:t.platform}),t.configured?null:s.jsx("button",{type:"button",className:"wizard-start-btn",onClick:c,disabled:!n,title:"Step-by-step setup wizard",children:"🚀 Getting Started"}),t.setupUrl?s.jsx("a",{href:t.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",title:"Setup documentation",children:"📖 Docs"}):null,s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:a,disabled:!n,children:i?"▴ Collapse":t.configured?"✎ Edit":"⚙ Configure"})]}),!i&&t.setupHint&&!t.configured?s.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,i?s.jsxs("div",{className:"platform-config-form",children:[t.setupHint?s.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,t.envVars.map(h=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:h.prompt}),s.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)),s.jsxs("div",{className:"platform-config-actions",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(u),disabled:r||!n,children:r?"⏳ Saving…":"💾 Save"}),t.configured?s.jsx("button",{type:"button",className:"hub-remove-btn",onClick:l,disabled:r||!n,children:"🗑 Remove"}):null]})]}):s.jsx("div",{className:"hub-platform-env",children:t.envVars.map(h=>s.jsxs("div",{children:[s.jsx("code",{children:h.varName})," ",h.set?"✓ set":"— unset"]},h.varName))})]})}const Ese=[{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:"🧠"}],_se={pending:"⏳ pending",sent:"✅ sent",failed:"❌ failed"};function Nse(){var W0,H0,G0,q0,K0,V0,Y0,X0,Z0;const[e,t]=E.useState("tools"),[n,r]=E.useState(null),[i,a]=E.useState(!0),[o,l]=E.useState(null),[c,u]=E.useState(!1),[d,f]=E.useState(null),[h,p]=E.useState(!1),[g,m]=E.useState(null),[v,y]=E.useState(null),[b,x]=E.useState(""),[k,S]=E.useState(""),[w,_]=E.useState(null),[N,C]=E.useState(!1),[T,I]=E.useState(null),[M,$]=E.useState(null),[R,z]=E.useState({}),[D,U]=E.useState(""),[O,F]=E.useState(""),[A,Z]=E.useState(!1),[L,P]=E.useState(null),[ce,we]=E.useState(!1),[pe,Pe]=E.useState({}),[G,X]=E.useState(!1),[ae,le]=E.useState(null),[Y,_e]=E.useState({}),[Ee,je]=E.useState({}),[ve,$e]=E.useState({}),[fe,vt]=E.useState(!1),[Le,Ae]=E.useState(null),[He,Ie]=E.useState(""),[xn,$t]=E.useState(null),[W,V]=E.useState(!1),[oe,he]=E.useState(new Map),[xe,Qe]=E.useState(new Set),[Lt,Ct]=E.useState(!1),[An,Ot]=E.useState([]),[dt,Tn]=E.useState(""),[Qt,ws]=E.useState(null),[ka,mr]=E.useState(""),[Jt,q]=E.useState([]),[me,Re]=E.useState(0),[Ce,Fn]=E.useState(0),[Rr,gr]=E.useState(!0),[Fe,Ss]=E.useState(!1),[ei,Ht]=E.useState(!1),Ci=20,Oi=E.useRef(null),Pi=E.useCallback(async(j=!1)=>{if(Fe)return;const K=j?0:Ce;Ss(!0);try{const ne=await ee.fetchGatewayConversations({offset:K,limit:Ci,q:He||void 0});ne.ok&&ne.conversations&&(q(re=>j?ne.conversations:[...re,...ne.conversations]),Re(ne.total??0),Fn(K+ne.conversations.length),gr(ne.hasMore??!1))}catch{}Ss(!1)},[Fe,Ce,He]);E.useEffect(()=>{e==="conversations"&&!ei&&!Fe&&(Ht(!0),Pi(!0))},[e,ei,Fe,Pi]),E.useEffect(()=>{const j=Oi.current;if(!j)return;const K=new IntersectionObserver(ne=>{var re;(re=ne[0])!=null&&re.isIntersecting&&Rr&&!Fe&&Pi(!1)},{threshold:.1});return K.observe(j),()=>K.disconnect()},[Rr,Fe,Pi]),E.useEffect(()=>{const j=setTimeout(()=>{e==="conversations"&&ei&&(q([]),Fn(0),gr(!0),Pi(!0))},300);return()=>clearTimeout(j)},[He]),E.useEffect(()=>ee.onTypingEvent(K=>{he(ne=>{const re=new Map(ne),de=`${K.platform}:${K.channelId}`;return K.typing?re.set(de,{platform:K.platform,channelId:K.channelId,startedAt:Date.now()}):re.delete(de),re})}),[]);const Fp=E.useCallback((j,K)=>{K.stopPropagation(),Qe(ne=>{const re=new Set(ne);return re.has(j)?re.delete(j):re.add(j),re})},[]),ul=E.useCallback(()=>{Qe(j=>j.size===Jt.length?new Set:new Set(Jt.map(K=>K.key)))},[Jt]),ks=E.useCallback(async()=>{if(xe.size!==0){Ct(!0);try{await ee.exportGatewayConversations([...xe])}catch{}Ct(!1)}},[xe]);E.useEffect(()=>{e==="conversations"&&ee.getAllConversationTags().then(j=>{j.ok&&j.tags&&Ot(j.tags)})},[e]);const Up=E.useCallback(async(j,K)=>{if(!K.trim())return;(await ee.addConversationTag(j,K.trim())).ok&&(q(re=>re.map(de=>de.key===j?{...de,tags:[...de.tags??[],K.trim().toLowerCase()]}:de)),Ot(re=>re.includes(K.trim().toLowerCase())?re:[...re,K.trim().toLowerCase()].sort())),ws(null),mr("")},[]),Ou=E.useCallback(async(j,K)=>{(await ee.removeConversationTag(j,K)).ok&&q(re=>re.map(de=>de.key===j?{...de,tags:(de.tags??[]).filter(Oe=>Oe!==K)}:de))},[]),Wp=E.useCallback((j,K)=>{K.stopPropagation();const ne=j.contactName||j.channelId,re=[`Conversation with ${ne} (${j.platform})`,`Exported: ${new Date().toLocaleString()}`,`Messages: ${j.messageCount}`,"─".repeat(50),""];if(j.messages)for(const ht of j.messages){const be=ht.role==="user"?ne:"Agent",Nt=new Date(ht.ts).toLocaleString();re.push(`[${Nt}] ${be}:`),re.push(ht.content),re.push("")}const de=new Blob([re.join(`
135
+ `)],{type:"text/plain;charset=utf-8"}),Oe=URL.createObjectURL(de),it=document.createElement("a");it.href=Oe,it.download=`conversation-${j.platform}-${j.channelId.replace(/[^\w]/g,"_")}-${new Date().toISOString().slice(0,10)}.txt`,document.body.appendChild(it),it.click(),document.body.removeChild(it),URL.revokeObjectURL(Oe)},[]),Hp=E.useCallback((j,K)=>{K.stopPropagation();const ne=j.contactName||j.channelId,re=j.messages??[],de=`<!DOCTYPE html>
136
+ <html>
137
+ <head>
138
+ <meta charset="utf-8">
139
+ <title>Conversation with ${ne}</title>
140
+ <style>
141
+ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 700px; margin: 40px auto; padding: 0 20px; color: #1a1a1a; line-height: 1.6; }
142
+ h1 { font-size: 20px; margin-bottom: 4px; }
143
+ .meta { color: #666; font-size: 13px; margin-bottom: 20px; }
144
+ .msg { margin-bottom: 16px; }
145
+ .msg-user { text-align: right; }
146
+ .msg-assistant { text-align: left; }
147
+ .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; }
148
+ .bubble-user { background: #007bff; color: #fff; border-bottom-right-radius: 4px; }
149
+ .bubble-assistant { background: #f0f0f0; color: #1a1a1a; border-bottom-left-radius: 4px; }
150
+ .timestamp { font-size: 11px; color: #999; margin-top: 2px; }
151
+ @media print { body { margin: 0; } }
152
+ </style>
153
+ </head>
154
+ <body>
155
+ <h1>Conversation with ${ne}</h1>
156
+ <div class="meta">Platform: ${j.platform} · ${j.messageCount} messages · Exported: ${new Date().toLocaleString()}</div>
157
+ ${re.map(it=>{const ht=it.role==="user"?"user":"assistant",be=it.role==="user"?ne:"Agent";return`<div class="msg msg-${ht}">
158
+ <div class="bubble bubble-${ht}">${it.content.replace(/</g,"&lt;").replace(/>/g,"&gt;")}</div>
159
+ <div class="timestamp">${be} · ${new Date(it.ts).toLocaleString()}</div>
160
+ </div>`}).join(`
161
+ `)}
162
+ </body>
163
+ </html>`,Oe=window.open("","_blank");Oe&&(Oe.document.write(de),Oe.document.close(),setTimeout(()=>Oe.print(),300))},[]);E.useEffect(()=>{var K;const j=(K=n==null?void 0:n.conversations)==null?void 0:K.recent;!j||j.length===0||ei&&(Ce>Ci||He||q(ne=>{const re=new Set(ne.map(be=>be.key)),de=j.map(be=>({...be})),Oe=new Map(ne.map(be=>[be.key,be]));for(const be of de)Oe.has(be.key)&&Oe.set(be.key,be);const ht=[...de.filter(be=>!re.has(be.key)),...Oe.values()];return ht.sort((be,Nt)=>Nt.lastActiveAt-be.lastActiveAt),ht}))},[(W0=n==null?void 0:n.conversations)==null?void 0:W0.recent]);const[dl,Pu]=E.useState(""),[Mu,fl]=E.useState([]),[yr,Es]=E.useState(!1),[Ea,_s]=E.useState(!1),[hl,Je]=E.useState(null),[pl,_a]=E.useState(null),[ml,gl]=E.useState({}),[Mi,yl]=E.useState([]),[Ri,Ns]=E.useState([]),[js,ti]=E.useState(""),ni=j=>fe?String(j??""):uM(j),Gp=j=>{const K=j.match(/^(\d+)@/);if(!K)return"";const ne=K[1];return ne.length===12&&ne.startsWith("91")?`+${ne.slice(0,2)} ${ne.slice(2,7)} ${ne.slice(7)}`:ne.length===10?`+91 ${ne.slice(0,5)} ${ne.slice(5)}`:`+${ne}`},qp=j=>{const K=Gp(j.channelId);return j.contactName?{name:j.contactName,phone:K}:{name:K||ni(j.channelId),phone:""}},Ir=E.useCallback(async()=>{var K,ne;u(!0),l(null);const j=await ee.fetchHub();r(j),(K=j==null?void 0:j.channels)!=null&&K.statusRecipients&&Ns(j.channels.statusRecipients),(ne=j==null?void 0:j.channels)!=null&&ne.contacts&&yl(j.channels.contacts),j||l("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),a(!1),u(!1)},[]);E.useEffect(()=>{Ir(),ee.fetchAdminAuthStatus().then(j=>{j&&(f({configured:j.configured,authenticated:j.authenticated}),p(j.authenticated),m(j.role??null),y(j.user??null))})},[Ir]);const Gt=h&&(g==="admin"||g==="operator"),Ru=async j=>{j==null||j.preventDefault();const K=dl.trim();if(!K)return;_s(!0),Je(null);const ne=await ee.marketplaceSearch(K);fl(ne),Es(!0),_s(!1)},Iu=async j=>{if(!h){Je({kind:"err",text:"🔐 Log in (or set up admin access) to install skills."});return}if(!Gt){Je({kind:"err",text:"Your role cannot install skills — admin or operator only."});return}_a(j),Je(null);const K=await ee.marketplaceInstall(j);K.ok?(Je({kind:"ok",text:`✅ Installed ${j} (quarantine checked) — it appears in the Skills list and loads via the skill tool next turn.`}),Ir()):Je({kind:"err",text:K.quarantined?`⛔ ${K.error||"checksum mismatch — quarantined"}`:`❌ ${K.error||"Install failed."}`}),_a(null)},$u=async j=>{if(!h){Je({kind:"err",text:"🔐 Log in (or set up admin access) to uninstall skills."});return}if(!Gt){Je({kind:"err",text:"Your role cannot uninstall skills — admin or operator only."});return}_a(j),Je(null);const K=await ee.marketplaceUninstall(j);K.ok?(Je({kind:"ok",text:`🗑️ Uninstalled ${j} — removed from .agents/skills/ and provenance.`}),Ir()):Je({kind:"err",text:`❌ ${K.error||"Uninstall failed."}`}),_a(null)},Ii=()=>{p(!1),f(j=>j&&{...j,authenticated:!1}),_("Session expired — log in again to toggle capabilities.")},Lu=async j=>{j.preventDefault(),C(!0),_(null);const K=await ee.adminLogin(b,k);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),y(K.user??null),x(""),S("");const ne=T;I(null),ne&&await J(ne.kind,ne.name,ne.enabled)}else _(K.error||"Login failed.");C(!1)},B=async j=>{if(j.preventDefault(),C(!0),_(null),k.length<8){_("Password must be at least 8 characters."),C(!1);return}const K=await ee.adminSetup(b,k);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),y(K.user??null),x(""),S("");const ne=T;I(null),ne&&await J(ne.kind,ne.name,ne.enabled)}else _(K.error||"Setup failed.");C(!1)},te=async()=>{await ee.adminLogout(),p(!1),f(j=>j&&{...j,authenticated:!1}),m(null),y(null)},J=async(j,K,ne)=>{$(K);const re=j==="skill"?await ee.setSkillEnabled(K,ne):await ee.setToolsetEnabled(K,ne);re.ok?(z(de=>({...de,[K]:`✅ ${ne?"Enabled":"Disabled"} — live for new agent runs`})),Ir()):re.unauthorized?Ii():(z(de=>({...de,[K]:`❌ ${re.error||"Toggle failed"}`})),re.forbidden&&_(re.error||"Your role cannot change capabilities.")),$(null)},ke=(j,K)=>{if(!h){I({kind:"toolset",name:j,enabled:K});return}J("toolset",j,K)},ri=(j,K)=>{if(!h){I({kind:"skill",name:j,enabled:K});return}J("skill",j,K)},qt=async j=>{if(j.preventDefault(),!h){P({kind:"err",text:"🔐 Log in (or set up admin access) to send test messages."});return}if(!Gt){P({kind:"err",text:"🔒 Your role cannot send channel messages — requires the admin or operator role."});return}Z(!0),P(null);const K=await ee.sendChannelMessage(D.trim(),O);K.ok?(P({kind:"ok",text:`✅ Sent to ${D.trim()} (${K.platform}:${ni(K.channelId)})`}),F("")):K.unauthorized?(Ii(),P({kind:"err",text:K.error||"Session expired — log in again."})):P({kind:"err",text:K.error||"Send failed."}),Z(!1)},Cn=(j,K)=>{var re,de;return(((de=(re=n==null?void 0:n.channels)==null?void 0:re.policies)==null?void 0:de[j])??{})[K]??[]},en=j=>j==="user"?"allowedUsers":j==="group"?"allowedGroups":"outboundSenders",vr=(j,K,ne)=>{const re=ne.trim();re&&Pe(de=>{var Nt;const Oe={...de[j]??{}},it=en(K),be=[...((Nt=de[j])==null?void 0:Nt[it])??Cn(j,it)];return be.includes(re)||be.push(re),Oe[it]=be,{...de,[j]:Oe}})},On=(j,K,ne)=>{Pe(re=>{var Nt;const de=en(K),Oe=Cn(j,de),ht=(((Nt=re[j])==null?void 0:Nt[de])??Oe).filter(vl=>vl!==ne);if(ht.length===0&&Oe.length===0){const vl={...re[j]??{}};delete vl[de];const Kp={...re};return Object.keys(vl).length===0?delete Kp[j]:Kp[j]=vl,Kp}const be={...re[j]??{}};return be[de]=ht,{...re,[j]:be}})},Se=(j,K)=>{const ne=j.trim().toLowerCase(),re=K.trim().toLowerCase();if(ne==="*"||re==="*"||ne===re)return!0;const de=ne.replace(/\D+/g,""),Oe=re.replace(/\D+/g,"");return de.length>0&&de===Oe},Ue=j=>{const K=(ml[j]??"").trim(),ne=(Y[j]??"").trim();ne&&(vr(j,"user",ne),K&&yl(re=>[...re.filter(Oe=>!(Oe.platform===j&&(Se(Oe.id,ne)||Oe.name.toLowerCase()===K.toLowerCase()))),{name:K,platform:j,id:ne,addedAt:Date.now()}]),_e(re=>({...re,[j]:""})),gl(re=>({...re,[j]:""})))},ft=(j,K)=>{On(j,"user",K),yl(ne=>ne.filter(re=>!(re.platform===j&&Se(re.id,K))))},wt=(j,K)=>{Pe(ne=>{const re={...ne[j]??{}};return K==="silentDrop"?re.silentDrop=re.silentDrop===!1:re[K]?delete re[K]:re[K]=!0,{...ne,[j]:re}})},on=Object.keys(pe).length>0||Mi.length!==(((G0=(H0=n==null?void 0:n.channels)==null?void 0:H0.contacts)==null?void 0:G0.length)??0)||Mi.some((j,K)=>{var ne,re;return!((re=(ne=n==null?void 0:n.channels)==null?void 0:ne.contacts)!=null&&re[K])||j.platform!==n.channels.contacts[K].platform||j.id!==n.channels.contacts[K].id||j.name!==n.channels.contacts[K].name})||Ri.length!==(((K0=(q0=n==null?void 0:n.channels)==null?void 0:q0.statusRecipients)==null?void 0:K0.length)??0)||Ri.some((j,K)=>{var ne,re;return j!==((re=(ne=n==null?void 0:n.channels)==null?void 0:ne.statusRecipients)==null?void 0:re[K])}),F0=async()=>{var K;if(!h){le({kind:"err",text:"🔐 Log in (or set up admin access) to change permissions."});return}if(!Gt){le({kind:"err",text:"🔒 Your role cannot change permissions — requires the admin or operator role."});return}X(!0),le(null);const j=await ee.saveGatewayPolicies(pe,Ri,Mi);if(j.ok){const ne=(K=j.contactErrors)!=null&&K.length?`
164
+ ⚠️ Some contacts were rejected: ${j.contactErrors.join("; ")}`:"";le({kind:ne?"warn":"ok",text:`✅ Permissions + saved contacts + status recipients saved — the running gateway applies them immediately.${ne}`}),Pe({}),Ir()}else j.unauthorized?(Ii(),le({kind:"err",text:j.error||"Session expired — log in again."})):le({kind:"err",text:j.error||"Failed to save permissions."});X(!1)};if(i)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"🧰 Agent Hub"}),s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Loading hub…"})]})]});const U0=!h&&T!==null;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["🧰 Agent Hub",v?s.jsxs("span",{className:`admin-role-badge admin-role-${g||"viewer"}`,children:[v," · ",g||"viewer"]}):null]}),s.jsxs("div",{className:"admin-header-actions",children:[s.jsx("button",{className:"admin-refresh-btn",onClick:()=>void Ir(),disabled:c,children:c?"⏳ Refreshing…":"🔄 Refresh"}),h?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void te(),children:"🚪 Log out"}):null]})]}),s.jsxs("p",{className:"admin-subtitle",children:["Capabilities, messaging, artifacts and skills in one place — a single 4-view management page. Toggles persist to ",s.jsx("code",{children:"buffconfig"})," and are honored by the runtime immediately (never cosmetic)."]}),o?s.jsx("div",{className:"admin-error",children:o}):null,U0?s.jsxs("div",{className:"admin-header",children:[s.jsx("h3",{className:"section-subtitle",children:d!=null&&d.configured?`🔐 Log in to ${T.enabled?"enable":"disable"} '${T.name}'`:`🔐 Set up admin access to ${T.enabled?"enable":"disable"} '${T.name}'`}),s.jsxs("form",{className:"admin-gate-form",onSubmit:d!=null&&d.configured?Lu:B,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:b,onChange:j=>x(j.target.value),autoComplete:"username",placeholder:"admin"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:k,onChange:j=>S(j.target.value),autoComplete:d!=null&&d.configured?"current-password":"new-password",placeholder:"••••••••"})]}),w?s.jsx("div",{className:"admin-error",children:w}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:N||!b||!k,children:N?"⏳ …":d!=null&&d.configured?"🔐 Log in & apply":"🔐 Create admin & apply"}),d!=null&&d.configured?null:s.jsxs("p",{className:"admin-hint",children:["The first user is always an admin. Automation alternative: set"," ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," / ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"}),"."]})]})]}):null,!U0&&!Gt&&h?s.jsxs("div",{className:"admin-readonly-note",children:["🔒 Your role (",s.jsx("code",{children:g||"viewer"}),") can view but not change capabilities — toggles require the ",s.jsx("code",{children:"admin"})," or ",s.jsx("code",{children:"operator"})," role."]}):null,s.jsx("div",{className:"hub-tabs",role:"tablist",children:Ese.map(j=>{var ne;const K=j.id==="tools"?n?`${n.toolsets.enabled}/${n.toolsets.toolsets.length}`:"":j.id==="channels"?n?String(n.channels.delivery.total):"":j.id==="conversations"?n?String(((ne=n.conversations)==null?void 0:ne.total)??0):"":j.id==="artifacts"?n?String(n.artifacts.totalSessions):"":n?`${n.skills.enabled}/${n.skills.total}`:"";return s.jsxs("button",{role:"tab","aria-selected":e===j.id,className:`hub-tab${e===j.id?" active":""}`,onClick:()=>t(j.id),children:[j.icon," ",j.label,K?s.jsx("span",{className:"hub-tab-count",children:K}):null]},j.id)})}),e==="tools"&&n?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.toolsets.enabled}),s.jsx("div",{className:"admin-summary-label",children:"Enabled toolsets"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.toolsets.disabled}),s.jsx("div",{className:"admin-summary-label",children:"Disabled toolsets"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.toolsets.totalTools}),s.jsx("div",{className:"admin-summary-label",children:"Registered tools"})]})]}),s.jsx("div",{className:"hub-toolset-grid",children:n.toolsets.toolsets.map(j=>s.jsxs("div",{className:`hub-card${j.enabled?"":" hub-card-disabled"}`,children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.label}),s.jsx("span",{className:"hub-card-id",children:j.name})]}),s.jsx("button",{role:"switch","aria-checked":j.enabled,"aria-label":`${j.enabled?"Disable":"Enable"} ${j.label}`,className:`hub-switch${j.enabled?" on":""}`,disabled:M===j.name||T!==null||h&&!Gt,onClick:()=>ke(j.name,!j.enabled),children:s.jsx("span",{className:"hub-switch-knob"})})]}),s.jsx("p",{className:"hub-card-desc",children:j.description}),s.jsx("div",{className:"hub-card-tools",children:j.tools.length>0?j.tools.map(K=>s.jsx("span",{className:"hub-chip",children:K},K)):s.jsx("span",{className:"admin-hint",children:"gates dynamic MCP tools (no static names)"})}),R[j.name]?s.jsx("div",{className:"admin-row-msg",children:R[j.name]}):null,j.enabled?null:s.jsx("div",{className:"hub-card-note",children:"⛔ Removed from the model schema — calls return an explicit error"})]},j.name))})]}):null,e==="channels"&&n?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"hub-reveal-row",children:[s.jsxs("label",{className:"hub-reveal-toggle",children:[s.jsx("input",{type:"checkbox",checked:fe,onChange:j=>vt(j.target.checked),disabled:!Gt}),"Show full sender ids ",s.jsx("span",{className:"admin-hint",children:"(masks phone numbers by default)"})]}),Gt?null:s.jsx("span",{className:"admin-hint",children:"— admins and operators only"})]}),s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.pending}),s.jsx("div",{className:"admin-summary-label",children:"⏳ Queued for retry"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.sent}),s.jsx("div",{className:"admin-summary-label",children:"✅ Delivered"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.failed}),s.jsx("div",{className:"admin-summary-label",children:"❌ Failed (max retries)"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.channels.aliases.length}),s.jsx("div",{className:"admin-summary-label",children:"Channel aliases"})]})]}),s.jsx("h3",{className:"section-subtitle",children:"📮 Delivery ledger (guaranteed delivery)"}),n.channels.delivery.recent.length>0?s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Target"}),s.jsx("th",{children:"Platform"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Attempts"}),s.jsx("th",{children:"Next retry"}),s.jsx("th",{children:"Message"})]})}),s.jsx("tbody",{children:n.channels.delivery.recent.map(j=>s.jsxs("tr",{children:[s.jsx("td",{className:"admin-provider-type",children:ni(j.target)}),s.jsx("td",{children:j.platform}),s.jsx("td",{children:s.jsx("span",{className:`admin-check-badge admin-check-${j.status==="sent"?"pass":j.status==="failed"?"fail":"warn"}`,children:_se[j.status]||j.status})}),s.jsxs("td",{children:[j.attempts,"/5"]}),s.jsx("td",{children:j.status==="pending"?`${Math.max(0,Math.round((j.nextAttemptAt-Date.now())/1e3))}s`:"—"}),s.jsx("td",{className:"admin-hint",children:j.lastError?`⚠️ ${j.lastError}`:(j.text||"").slice(0,60)})]},j.id))})]})}):s.jsx("div",{className:"empty-state",children:"Delivery ledger is empty — every gateway send has gone through."}),s.jsx("h3",{className:"section-subtitle",children:"📥 Inbox (received messages)"}),n.channels.inbox.recent.length>0?s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Platform"}),s.jsx("th",{children:"From"}),s.jsx("th",{children:"Message"}),s.jsx("th",{children:"Handled"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:n.channels.inbox.recent.map(j=>s.jsxs("tr",{children:[s.jsxs("td",{className:"admin-provider-type",children:[j.platform,j.isGroup?s.jsx("span",{className:"hub-chip",children:"group"}):null]}),s.jsx("td",{children:ni(j.from||j.senderId||j.channelId)}),s.jsx("td",{className:"admin-hint",children:(j.text||"").slice(0,60)}),s.jsxs("td",{children:[s.jsx("span",{className:`admin-check-badge admin-check-${j.handled==="pipeline"?"pass":j.handled==="refused"?"fail":"warn"}`,children:j.handled}),j.reply?s.jsx("div",{className:"admin-hint",children:j.reply.slice(0,40)}):null]}),s.jsx("td",{className:"admin-hint",children:new Date(j.at).toLocaleString()})]},j.id))})]})}):s.jsx("div",{className:"empty-state",children:"Inbox is empty — messages the gateway receives will appear here."}),s.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."]}),s.jsx("h3",{className:"section-subtitle",children:"🔌 Platform transports"}),s.jsx(Sse,{canWrite:Gt,sessionExpired:Ii,mode:"table"}),s.jsx("h3",{className:"section-subtitle",children:"🔗 Channel aliases (buff gateway status)"}),n.channels.aliases.length>0?s.jsx("div",{className:"hub-alias-list",children:n.channels.aliases.map(j=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:j.alias}),s.jsxs("span",{className:"admin-hint",children:["→ ",j.platform,":",ni(j.channelId)]})]},j.alias))}):s.jsxs("div",{className:"empty-state",children:["No aliases yet — register one with ",s.jsx("code",{children:"buff gateway alias <name> <platform> <channelId>"}),"."]}),on?s.jsxs("div",{className:"hub-unsaved-banner",role:"status",children:[s.jsxs("span",{children:["⚠️ ",s.jsx("strong",{children:"Unsaved changes"})," — what you see below is a ",s.jsx("em",{children:"draft"}),". Press"," ",s.jsx("strong",{children:"💾 Save permissions"})," to apply it to the gateway; leaving the page discards it."]}),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:G,onClick:()=>void F0(),children:G?"⏳ Saving…":"💾 Save permissions"})]}):null,s.jsx("div",{style:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:8,marginBottom:8},onClick:()=>we(!ce),children:s.jsxs("h3",{className:"section-subtitle",style:{margin:0},children:[ce?"▼":"▶"," 🔐 Permissions — who can TRIGGER the agent"]})}),s.jsxs("p",{className:"admin-hint",style:{marginBottom:ce?10:0},children:["This list controls ",s.jsx("strong",{children:"who may trigger the agent"})," when they message you on each platform (WhatsApp, Telegram, email, …). Click to ",ce?"collapse":"expand"," and manage permissions."]}),ce?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-hint",style:{marginBottom:10},children:["⚠ ",s.jsx("strong",{children:"Not the same as send-by-name contacts:"})," a WhatsApp contact name (from"," ",s.jsx("code",{children:"buff whatsapp contact add"}),", shown in the WhatsApp bridge panel below) only lets"," ",s.jsx("em",{children:"you"})," send ",s.jsx("em",{children:"to"})," it by name — it does ",s.jsx("strong",{children:"not"})," let that number trigger the agent. Add the number here (or ",s.jsx("code",{children:"buff config gateway allow <platform> user <id>"}),") to grant inbound access."]}),s.jsx("div",{className:"hub-permissions",children:n.channels.platforms.map(j=>{const K={...n.channels.policies[j.platform]??{},...pe[j.platform]??{}},ne=K.allowedUsers??[],re=K.allowedGroups??[];return s.jsxs("div",{className:"hub-card",children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsx("span",{className:"hub-chip",children:j.label}),s.jsx("span",{className:"hub-card-id",children:j.platform}),K.disabled?s.jsx("span",{className:"hub-chip",children:"disabled"}):null]}),s.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed users — who may trigger the agent"}),s.jsxs("div",{className:"hub-alias-list",children:[ne.length===0?s.jsxs("span",{className:"admin-hint",children:["(blank — no one may trigger; add ",s.jsx("code",{children:"Allow-All"})," to allow everyone)"]}):null,ne.map(de=>{var it,ht,be,Nt;const Oe=(((it=pe[j.platform])==null?void 0:it.allowedUsers)??[]).includes(de)&&!(((Nt=(be=(ht=n==null?void 0:n.channels)==null?void 0:ht.policies)==null?void 0:be[j.platform])==null?void 0:Nt.allowedUsers)??[]).includes(de);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Oe?" hub-chip-pending":""}`,title:Oe?"Not saved yet — press 💾 Save permissions":void 0,children:[ni(de),Oe?" · unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>ft(j.platform,de),children:"✕"})]},`u-${de}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:ml[j.platform]??"",onChange:de=>gl(Oe=>({...Oe,[j.platform]:de.target.value})),placeholder:"Name (optional)",disabled:G}),s.jsx("input",{type:"text",value:Y[j.platform]??"",onChange:de=>_e(Oe=>({...Oe,[j.platform]:de.target.value})),placeholder:"Contact no / sender id, or Allow-All",disabled:G}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!(Y[j.platform]??"").trim(),onClick:()=>Ue(j.platform),children:"+ User"})]}),s.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed groups"}),s.jsxs("div",{className:"hub-alias-list",children:[re.length===0?s.jsx("span",{className:"admin-hint",children:"(none — any group may trigger)"}):null,re.map(de=>{var it,ht,be,Nt;const Oe=(((it=pe[j.platform])==null?void 0:it.allowedGroups)??[]).includes(de)&&!(((Nt=(be=(ht=n==null?void 0:n.channels)==null?void 0:ht.policies)==null?void 0:be[j.platform])==null?void 0:Nt.allowedGroups)??[]).includes(de);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Oe?" hub-chip-pending":""}`,title:Oe?"Not saved yet — press 💾 Save permissions":void 0,children:[de,Oe?" · unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>On(j.platform,"group",de),children:"✕"})]},`g-${de}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:Ee[j.platform]??"",onChange:de=>je(Oe=>({...Oe,[j.platform]:de.target.value})),placeholder:"group id, e.g. 1203630283471234@g.us",disabled:G}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!(Ee[j.platform]??"").trim(),onClick:()=>{vr(j.platform,"group",Ee[j.platform]??""),je(de=>({...de,[j.platform]:""}))},children:"+ Group"})]}),s.jsx("div",{className:"admin-hint",style:{margin:"12px 0 4px"},children:"Send authority — who may tell the agent to send to OTHER people"}),s.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)."}),s.jsx("div",{className:"hub-alias-list",children:(K.outboundSenders??[]).map(de=>{var it,ht,be,Nt;const Oe=(((it=pe[j.platform])==null?void 0:it.outboundSenders)??[]).includes(de)&&!(((Nt=(be=(ht=n==null?void 0:n.channels)==null?void 0:ht.policies)==null?void 0:be[j.platform])==null?void 0:Nt.outboundSenders)??[]).includes(de);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Oe?" hub-chip-pending":""}`,title:Oe?"Not saved yet — press 💾 Save permissions":void 0,children:[ni(de),Oe?" · unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>On(j.platform,"send",de),children:"✕"})]},`s-${de}`)})}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:ve[j.platform]??"",onChange:de=>$e(Oe=>({...Oe,[j.platform]:de.target.value})),placeholder:"sender id, or Allow-All",disabled:G}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!(ve[j.platform]??"").trim(),onClick:()=>{vr(j.platform,"send",ve[j.platform]??""),$e(de=>({...de,[j.platform]:""}))},children:"+ Sender"})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 0"},children:[s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[s.jsx("input",{type:"checkbox",checked:K.silentDrop!==!1,disabled:G,onChange:()=>wt(j.platform,"silentDrop")}),s.jsx("span",{className:"admin-hint",children:"Silent (no reply to unapproved) — default"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[s.jsx("input",{type:"checkbox",checked:!!K.requireMention,disabled:G,onChange:()=>wt(j.platform,"requireMention")}),s.jsx("span",{className:"admin-hint",children:"Groups: mention only"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[s.jsx("input",{type:"checkbox",checked:!!K.disabled,disabled:G,onChange:()=>wt(j.platform,"disabled")}),s.jsx("span",{className:"admin-hint",children:"Disabled (off)"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx("input",{type:"checkbox",checked:!!K.requireApprovedTarget,disabled:G,onChange:()=>wt(j.platform,"requireApprovedTarget")}),s.jsx("span",{className:"admin-hint",children:"Require approved recipients for sends"})]})]})]},j.platform)})})]}):null,s.jsx("h3",{className:"section-subtitle",style:{marginTop:22},children:"📇 Telegram User Onboarding"}),s.jsxs("div",{className:"onboarding-summary",children:[s.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 j=Mi.filter(re=>re.status==="pending").length,K=Mi.filter(re=>re.status==="approved").length,ne=Mi.filter(re=>re.status==="rejected").length;return s.jsxs("div",{className:"onboarding-stats",children:[s.jsxs("span",{className:"onboarding-stat pending",children:["⏳ ",j," pending"]}),s.jsxs("span",{className:"onboarding-stat approved",children:["✅ ",K," approved"]}),s.jsxs("span",{className:"onboarding-stat rejected",children:["🚫 ",ne," rejected"]})]})})(),s.jsxs("div",{className:"onboarding-steps",children:[s.jsxs("div",{className:"onboarding-step",children:[s.jsx("span",{className:"onboarding-step-num",children:"1"}),s.jsxs("span",{children:["User sends any message to ",s.jsx("code",{children:"@agent_nuvira_bot"})]})]}),s.jsxs("div",{className:"onboarding-step",children:[s.jsx("span",{className:"onboarding-step-num",children:"2"}),s.jsxs("span",{children:["Bot auto-registers them as ",s.jsx("strong",{children:"⏳ pending"})]})]}),s.jsxs("div",{className:"onboarding-step",children:[s.jsx("span",{className:"onboarding-step-num",children:"3"}),s.jsx("span",{children:"Admin approves → they can receive outbound messages"})]})]}),s.jsx("a",{href:"/contacts",className:"admin-refresh-btn",style:{marginTop:12,display:"inline-block",textDecoration:"none"},children:"📋 Go to Contacts tab to manage →"})]}),s.jsx("h3",{className:"section-subtitle",style:{marginTop:22},children:"📊 Status recipients"}),s.jsxs("p",{className:"admin-hint",children:["Contacts/groups that ALWAYS receive the pipeline completion summary, whoever triggered it. Use a contact name, number, or ",s.jsx("code",{children:"platform:channelId"})," — e.g."," ",s.jsx("code",{children:"whatsapp:Name"}),", ",s.jsx("code",{children:"whatsapp:+91***"}),", ",s.jsx("code",{children:"telegram:123456"}),","," ",s.jsx("code",{children:"slack:ops"}),"."]}),Ri.length>0?s.jsx("div",{className:"hub-alias-list",children:Ri.map(j=>{var K,ne;return s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:"📊"}),s.jsx("span",{className:"admin-hint",children:((ne=(K=n==null?void 0:n.channels)==null?void 0:K.statusRecipientDisplay)==null?void 0:ne[j])??j}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>Ns(re=>re.filter(de=>de!==j)),children:"✕"})]},j)})}):s.jsx("div",{className:"empty-state",style:{padding:"14px"},children:"No status recipients — add one below."}),s.jsxs("div",{className:"hub-send-form",children:[s.jsx("input",{type:"text",value:js,onChange:j=>ti(j.target.value),placeholder:"whatsapp:Name or whatsapp:+91***",disabled:G,maxLength:128}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!js.trim()||Ri.includes(js.trim()),onClick:()=>{Ns(j=>[...j,js.trim()]),ti("")},children:"+ Add"})]}),s.jsxs("div",{className:"hub-send-form",style:{marginTop:10},children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:G,onClick:()=>void F0(),children:G?"⏳ Saving…":"💾 Save permissions"}),Object.keys(pe).length>0?s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:G,onClick:()=>Pe({}),children:"Discard draft"}):null]}),ae?s.jsx("div",{className:`admin-row-msg${ae.kind==="ok"?"":" admin-row-msg-err"}`,children:ae.text}):null,s.jsx("h3",{className:"section-subtitle",children:"📤 Test a channel (buff gateway send)"}),s.jsxs("form",{className:"hub-send-form",onSubmit:j=>void qt(j),children:[s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"Target — an alias or platform:channelId"}),s.jsx("input",{type:"text",value:D,onChange:j=>U(j.target.value),placeholder:"ops or slack:C0123 or email:team@example.com",disabled:A,maxLength:128})]}),s.jsxs("label",{className:"hub-send-message",children:[s.jsx("span",{className:"admin-hint",children:"Message"}),s.jsx("input",{type:"text",value:O,onChange:j=>F(j.target.value),placeholder:"nightly build done 🎉",disabled:A,maxLength:4e3})]}),s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:A||!D.trim()||!O,children:A?"⏳ Sending…":"📤 Send test message"})]}),L?s.jsx("div",{className:`admin-row-msg${L.kind==="ok"?"":" admin-row-msg-err"}`,children:L.text}):null,s.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. ",s.jsx("code",{children:"BUFF_SMTP_HOST"}),"). Requires admin or operator."]}),s.jsx("h3",{className:"section-subtitle",children:"🟢 WhatsApp bridge (buff whatsapp pair)"}),s.jsx(wse,{authed:h,canWrite:Gt,sessionExpired:Ii,reveal:fe})]}):null,e==="conversations"&&n?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:((V0=n.conversations)==null?void 0:V0.total)??0}),s.jsx("div",{className:"admin-summary-label",children:"Stored conversations"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:Jt.filter(j=>Date.now()-j.lastActiveAt<864e5).length}),s.jsx("div",{className:"admin-summary-label",children:"Active today"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:Jt.filter(j=>j.platform==="whatsapp").length}),s.jsx("div",{className:"admin-summary-label",children:"WhatsApp"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:Jt.filter(j=>j.platform==="telegram").length}),s.jsx("div",{className:"admin-summary-label",children:"Telegram"})]})]}),((Y0=n.conversations)==null?void 0:Y0.analytics)&&n.conversations.analytics.totalConversations>0&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>V(!W),style:{marginBottom:12},children:W?"📊 Hide Analytics":"📊 Show Analytics"}),W?s.jsxs("div",{className:"hub-session-list",style:{marginBottom:16},children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.totalMessages}),s.jsx("div",{className:"admin-summary-label",children:"Total messages"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgMessagesPerConversation}),s.jsx("div",{className:"admin-summary-label",children:"Avg msgs/conversation"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgUserMessageLength}),s.jsx("div",{className:"admin-summary-label",children:"Avg user msg length"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgAssistantMessageLength}),s.jsx("div",{className:"admin-summary-label",children:"Avg assistant msg length"})]})]}),s.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[s.jsx("div",{className:"hub-card-top",children:s.jsx("div",{className:"hub-card-title",children:s.jsx("span",{className:"hub-card-name",children:"🏆 Most Active Contacts"})})}),s.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.topContacts.map((j,K)=>{var de;const ne=((de=n.conversations.analytics.topContacts[0])==null?void 0:de.messageCount)||1,re=Math.round(j.messageCount/ne*100);return s.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[s.jsx("span",{style:{width:24,textAlign:"center",fontWeight:600,color:K<3?"#f59e0b":"var(--muted)"},children:K===0?"🥇":K===1?"🥈":K===2?"🥉":`${K+1}.`}),s.jsxs("span",{style:{flex:1,marginLeft:8},children:[j.platform==="whatsapp"?"📱":"✈️"," ",j.name]}),s.jsx("span",{style:{width:60,textAlign:"right",fontWeight:600},children:j.messageCount}),s.jsx("div",{style:{width:100,height:8,background:"var(--border)",borderRadius:4,marginLeft:8},children:s.jsx("div",{style:{width:`${re}%`,height:"100%",background:"#3b82f6",borderRadius:4}})})]},K)})})]}),s.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[s.jsx("div",{className:"hub-card-top",children:s.jsx("div",{className:"hub-card-title",children:s.jsx("span",{className:"hub-card-name",children:"🕐 Peak Hours"})})}),s.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:80,marginTop:8,gap:2},children:n.conversations.analytics.hourlyDistribution.map(({hour:j,count:K})=>{const ne=Math.max(...n.conversations.analytics.hourlyDistribution.map(de=>de.count),1),re=Math.round(K/ne*70);return s.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:s.jsx("div",{style:{width:"100%",height:re,background:j>=9&&j<=21?"#3b82f6":"#6b7280",borderRadius:2},title:`${j}:00 — ${K} messages`})},j)})}),s.jsx("div",{style:{display:"flex",fontSize:10,color:"var(--muted)",marginTop:4},children:[0,6,12,18,23].map(j=>s.jsxs("span",{style:{flex:1,textAlign:j===0?"left":j===23?"right":"center"},children:[j,":00"]},j))})]}),s.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[s.jsx("div",{className:"hub-card-top",children:s.jsx("div",{className:"hub-card-title",children:s.jsx("span",{className:"hub-card-name",children:"📱 Platform Breakdown"})})}),s.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.platformBreakdown.map(j=>s.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[s.jsx("span",{className:"hub-chip",style:{width:80,textAlign:"center"},children:j.platform}),s.jsxs("span",{style:{marginLeft:8,flex:1},children:[j.conversations," conversations"]}),s.jsxs("span",{style:{fontWeight:600},children:[j.messages," msgs"]})]},j.platform))})]}),s.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[s.jsx("div",{className:"hub-card-top",children:s.jsx("div",{className:"hub-card-title",children:s.jsx("span",{className:"hub-card-name",children:"📈 Daily Volume (14 days)"})})}),s.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:60,marginTop:8,gap:2},children:n.conversations.analytics.dailyVolume.map(({date:j,count:K})=>{const ne=Math.max(...n.conversations.analytics.dailyVolume.map(de=>de.count),1),re=Math.round(K/ne*50);return s.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:s.jsx("div",{style:{width:"100%",height:re,background:"#10b981",borderRadius:2},title:`${j}: ${K} messages`})},j)})}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"var(--muted)",marginTop:4},children:[s.jsx("span",{children:(X0=n.conversations.analytics.dailyVolume[0])==null?void 0:X0.date}),s.jsx("span",{children:(Z0=n.conversations.analytics.dailyVolume[n.conversations.analytics.dailyVolume.length-1])==null?void 0:Z0.date})]})]})]}):null]}),s.jsx("h3",{className:"section-subtitle",children:"💬 Per-contact chat history"}),s.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."}),Jt.length>0||Fe?s.jsxs(s.Fragment,{children:[An.length>0&&s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:[s.jsx("span",{className:"admin-hint",style:{marginRight:4},children:"Filter by tag:"}),An.map(j=>s.jsxs("button",{type:"button",onClick:()=>Tn(dt===j?"":j),style:{padding:"2px 10px",borderRadius:12,fontSize:11,cursor:"pointer",border:`1px solid ${dt===j?"#3b82f6":"var(--border)"}`,background:dt===j?"#3b82f620":"transparent",color:dt===j?"#3b82f6":"var(--muted)"},children:["🏷️ ",j]},j))]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12,flexWrap:"wrap"},children:[s.jsx("input",{type:"text",value:He,onChange:j=>Ie(j.target.value),placeholder:"🔍 Search by contact name, phone number, or message content…",style:{flex:1,minWidth:200}}),s.jsxs("span",{className:"admin-hint",children:[me," conversation",me===1?"":"s",He?` matching "${He}"`:""]}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:ul,style:{fontSize:12,padding:"4px 10px"},children:xe.size===Jt.length?"☑ Deselect All":"☐ Select All"}),xe.size>0&&s.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:Lt,onClick:()=>void ks(),style:{fontSize:12,padding:"4px 10px",background:"#3b82f6",color:"#fff",border:"none"},children:Lt?"⏳ Exporting…":`📦 Export ${xe.size} as ZIP`})]}),s.jsxs("div",{className:"hub-session-list",children:[Jt.filter(j=>!dt||(j.tags??[]).includes(dt)).map(j=>{const K=Date.now()-j.lastActiveAt,ne=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`,re=Le===j.key,{name:de,phone:Oe}=qp(j),it=async be=>{if(be.stopPropagation(),!h||!Gt){le({kind:"err",text:"🔐 Log in (admin/operator) to clear conversations."});return}$t(j.key);try{await ee.clearGatewayConversation(j.key),Ir()}catch{}$t(null)},ht=xe.has(j.key);return s.jsxs("div",{className:"hub-card",style:{cursor:"pointer",borderLeft:`3px solid ${j.platform==="whatsapp"?"#25d366":j.platform==="telegram"?"#0088cc":"#6c757d"}`,opacity:xe.size>0&&!ht?.5:1,transition:"opacity 0.2s"},onClick:()=>Ae(re?null:j.key),children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("input",{type:"checkbox",checked:ht,onClick:be=>Fp(j.key,be),onChange:()=>{},style:{cursor:"pointer",width:16,height:16}}),s.jsxs("div",{className:"hub-card-title",children:[s.jsxs("span",{className:"hub-card-name",children:[j.platform==="whatsapp"?"📱":j.platform==="telegram"?"✈️":"💬"," ",de]}),s.jsxs("span",{className:"hub-card-id",children:[Oe&&s.jsx("span",{style:{color:"var(--text-secondary, #8b949e)",marginRight:6},children:Oe}),j.platform," · ",ne]})]})]}),s.jsxs("div",{className:"hub-card-actions",style:{gap:6},children:[s.jsxs("span",{className:"hub-chip",children:[j.messageCount," msgs"]}),re&&j.messages&&j.messages.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"hub-mini-btn",onClick:be=>Wp(j,be),title:"Export as text file",children:"📄"}),s.jsx("button",{type:"button",className:"hub-mini-btn",onClick:be=>Hp(j,be),title:"Export as PDF (opens print dialog)",children:"📑"})]}),s.jsx("button",{type:"button",className:"hub-mini-btn",disabled:xn===j.key,onClick:it,title:"Clear conversation history",style:{color:"#ef4444"},children:"🗑️"}),s.jsx("span",{style:{fontSize:18,transition:"transform 0.2s",transform:re?"rotate(180deg)":"none"},children:"▼"})]})]}),s.jsxs("p",{className:"hub-card-desc",style:{fontStyle:"italic",color:"var(--text-muted, #6e7681)"},children:[s.jsx("span",{style:{color:"var(--text-primary, #e6edf3)",fontWeight:500},children:"Last message:"})," ",j.lastUserMessage.slice(0,120),j.lastUserMessage.length>120?"…":""]}),s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:[(j.tags??[]).map(be=>s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 8px",borderRadius:12,fontSize:11,background:"#3b82f620",color:"#3b82f6",border:"1px solid #3b82f640"},children:["🏷️ ",be,s.jsx("button",{type:"button",onClick:Nt=>{Nt.stopPropagation(),Ou(j.key,be)},style:{background:"none",border:"none",color:"#3b82f6",cursor:"pointer",padding:0,fontSize:12,lineHeight:1},children:"×"})]},be)),Qt===j.key?s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:s.jsx("input",{type:"text",value:ka,onChange:be=>mr(be.target.value),onKeyDown:be=>{be.key==="Enter"&&Up(j.key,ka),be.key==="Escape"&&(ws(null),mr(""))},placeholder:"tag name",autoFocus:!0,onClick:be=>be.stopPropagation(),style:{width:80,padding:"1px 6px",fontSize:11,borderRadius:8,border:"1px solid var(--border)"}})}):s.jsx("button",{type:"button",onClick:be=>{be.stopPropagation(),ws(j.key),mr("")},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"})]}),re&&j.messages&&j.messages.length>0?s.jsxs("div",{className:"conversation-thread",style:{marginTop:10,borderTop:"1px solid var(--border)",paddingTop:10,maxHeight:400,overflowY:"auto"},children:[j.messages.map((be,Nt)=>s.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:be.role==="user"?"flex-end":"flex-start"},children:[s.jsxs("div",{style:{maxWidth:"80%",padding:"8px 12px",borderRadius:12,backgroundColor:be.role==="user"?"#007bff":"var(--bg-card, #1a1f2e)",color:be.role==="user"?"#fff":"var(--text-primary, #e6edf3)",fontSize:13,lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[be.content.slice(0,500),be.content.length>500?"…":""]}),s.jsxs("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:[be.role==="user"?"👤":"🤖"," ",new Date(be.ts).toLocaleString()]})]},Nt)),oe.has(j.key)&&s.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[s.jsxs("div",{style:{padding:"8px 16px",borderRadius:12,backgroundColor:"var(--bg-card, #1a1f2e)",fontSize:13,display:"flex",alignItems:"center",gap:4},children:[s.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out"},children:"●"}),s.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.2s"},children:"●"}),s.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.4s"},children:"●"})]}),s.jsx("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:"🤖 typing…"})]})]}):re?s.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"No message details available."}):null]},j.key)}),Rr&&!Fe&&s.jsx("div",{ref:Oi,style:{height:1}}),Fe&&s.jsxs("div",{className:"loading-state",style:{padding:12},children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("span",{className:"admin-hint",style:{marginLeft:8},children:"Loading more conversations…"})]}),!Fe&&!Rr&&Jt.length>0&&s.jsxs("p",{className:"admin-hint",style:{textAlign:"center",padding:12},children:["All ",me," conversation",me===1?"":"s"," loaded."]})]})]}):Fe?s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{className:"admin-hint",children:"Loading conversations…"})]}):s.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?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalSessions}),s.jsx("div",{className:"admin-summary-label",children:"Sessions"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalArtifacts}),s.jsx("div",{className:"admin-summary-label",children:"Artifacts"})]})]}),n.artifacts.sessions.length>0?s.jsx("div",{className:"hub-session-list",children:n.artifacts.sessions.map(j=>s.jsxs("div",{className:"hub-card",children:[s.jsx("div",{className:"hub-card-top",children:s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.sessionId}),s.jsxs("span",{className:"hub-card-id",children:[j.count," artifact",j.count===1?"":"s"," · ",new Date(j.latestAt).toLocaleString()]})]})}),j.recent.length>0?s.jsx("ul",{className:"hub-artifact-list",children:j.recent.map((K,ne)=>s.jsxs("li",{children:[s.jsx("span",{className:"hub-chip",children:K.kind}),s.jsx("span",{className:"hub-artifact-title",children:K.title||"(untitled)"}),K.preview?s.jsx("div",{className:"hub-artifact-preview",children:K.preview}):null]},ne))}):s.jsx("div",{className:"admin-hint",children:"No artifact details."})]},j.sessionId))}):s.jsx("div",{className:"empty-state",children:"No artifacts yet — tools that return a deliverable payload land here per session."})]}):null,e==="skills"&&n?s.jsxs("div",{role:"tabpanel",children:[s.jsxs("div",{className:"admin-summary-grid",children:[s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.skills.enabled}),s.jsx("div",{className:"admin-summary-label",children:"Enabled skills"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.skills.disabled}),s.jsx("div",{className:"admin-summary-label",children:"Disabled skills"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:n.skills.hub.length}),s.jsx("div",{className:"admin-summary-label",children:"Hub skills (SKILL.md)"})]})]}),s.jsx("h3",{className:"section-subtitle",children:"📚 Compiled skills (SkillStore — matched at plan time)"}),n.skills.compiled.length>0?s.jsx("div",{className:"hub-session-list",children:n.skills.compiled.map(j=>s.jsxs("div",{className:`hub-card${j.enabled?"":" hub-card-disabled"}`,children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.name}),s.jsxs("span",{className:"hub-card-id",children:[j.id,j.version?` · v${j.version}`:""]})]}),s.jsxs("div",{className:"hub-card-actions",children:[j.bundled===!0?s.jsx("span",{className:"hub-chip hub-chip-bundled",children:"🧠 bundled"}):s.jsx("span",{className:"hub-chip",children:"community"}),s.jsx("button",{role:"switch","aria-checked":j.enabled,"aria-label":`${j.enabled?"Disable":"Enable"} ${j.name}`,className:`hub-switch${j.enabled?" on":""}`,disabled:M===j.id||T!==null||h&&!Gt,onClick:()=>ri(j.id,!j.enabled),children:s.jsx("span",{className:"hub-switch-knob"})})]})]}),s.jsx("p",{className:"hub-card-desc",children:j.description}),s.jsxs("div",{className:"hub-card-tools",children:[typeof j.usageCount=="number"?s.jsxs("span",{className:"hub-chip",children:[j.usageCount," uses"]}):null,j.enabled?null:s.jsx("span",{className:"hub-chip",children:"disabled"})]}),R[j.id]?s.jsx("div",{className:"admin-row-msg",children:R[j.id]}):null,j.enabled?null:s.jsx("div",{className:"hub-card-note",children:"⛔ Excluded from skill matching — not injected into the planner"})]},`c-${j.id}`))}):s.jsx("div",{className:"empty-state",children:"No compiled skills."}),s.jsx("h3",{className:"section-subtitle",children:"🌍 Hub skills (installed SKILL.md)"}),n.skills.hub.length>0?s.jsx("div",{className:"hub-session-list",children:n.skills.hub.map(j=>s.jsxs("div",{className:`hub-card${j.enabled?"":" hub-card-disabled"}`,children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.name}),s.jsx("span",{className:"hub-card-id",children:j.id})]}),s.jsxs("div",{className:"hub-card-actions",children:[s.jsx("button",{type:"button",className:"hub-mini-btn",disabled:pl===j.id||h&&!Gt,onClick:()=>void $u(j.id),children:"🗑 Uninstall"}),s.jsx("button",{role:"switch","aria-checked":j.enabled,"aria-label":`${j.enabled?"Disable":"Enable"} ${j.name}`,className:`hub-switch${j.enabled?" on":""}`,disabled:M===j.id||T!==null||h&&!Gt,onClick:()=>ri(j.id,!j.enabled),children:s.jsx("span",{className:"hub-switch-knob"})})]})]}),s.jsx("p",{className:"hub-card-desc",children:j.description}),s.jsxs("div",{className:"hub-card-tools",children:[s.jsx("span",{className:"hub-chip",children:"SKILL.md"}),j.enabled?null:s.jsx("span",{className:"hub-chip",children:"disabled"})]}),R[j.id]?s.jsx("div",{className:"admin-row-msg",children:R[j.id]}):null,j.enabled?null:s.jsx("div",{className:"hub-card-note",children:"⛔ Excluded from skill matching — not injected into the planner"})]},`h-${j.id}`))}):s.jsxs("div",{className:"empty-state",children:["No hub skills installed — search the marketplace below or run ",s.jsx("code",{children:"buff skills install <name>"}),"."]}),s.jsx("h3",{className:"section-subtitle",children:"🛒 Marketplace (community skills)"}),s.jsxs("form",{className:"hub-market-search",onSubmit:Ru,children:[s.jsx("input",{type:"text",value:dl,onChange:j=>Pu(j.target.value),placeholder:"Search community skills (e.g. code-assist, deploy, testing)…"}),s.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:Ea,children:Ea?"Searching…":"🔎 Search"})]}),hl?s.jsx("div",{className:`admin-row-msg${hl.kind==="err"?" admin-row-msg-err":""}`,children:hl.text}):null,yr&&!Ea?Mu.length>0?s.jsx("div",{className:"hub-session-list",children:Mu.map(j=>s.jsxs("div",{className:"hub-card",children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("div",{className:"hub-card-title",children:[s.jsx("span",{className:"hub-card-name",children:j.name}),s.jsxs("span",{className:"hub-card-id",children:["v",j.version," · ",j.sourceKind]})]}),s.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:pl===j.name||h&&!Gt,onClick:()=>void Iu(j.name),children:pl===j.name?"Installing…":"⬇ Install"})]}),s.jsx("p",{className:"hub-card-desc",children:j.description}),s.jsxs("div",{className:"hub-card-tools",children:[s.jsx("span",{className:"hub-chip",children:j.author}),j.tags.slice(0,3).map(K=>s.jsx("span",{className:"hub-chip",children:K},K))]})]},`m-${j.name}`))}):s.jsxs("div",{className:"empty-state",children:['No skills match "',dl,'" — try a broader term, or add a registry to ',s.jsx("code",{children:"skills.registries"})," in config."]}):null]}):null]})}const b_={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error"};function x_(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 jse(e){const t=[];let n="",r=null;for(const i of e.trim())r?i===r?r=null:n+=i:i==='"'||i==="'"?r=i:/\s/.test(i)?n&&(t.push(n),n=""):n+=i;return n&&t.push(n),t}function w_(e){return e===null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Ase(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 Tse(){const[e,t]=E.useState(null),[n,r]=E.useState(""),[i,a]=E.useState(300),[o,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(null),[h,p]=E.useState([]),[g,m]=E.useState(!0),v=E.useRef(null),y=E.useRef(null),b=E.useCallback(async()=>{const N=await ee.listTasks();N&&p(N.tasks)},[]);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(N=>{t(N?{configured:N.configured,authenticated:N.authenticated,role:N.role}:{configured:!1,authenticated:!1,role:null}),N!=null&&N.authenticated&&b()})},[b]),E.useEffect(()=>{var N,C;if(g&&(d==null?void 0:d.status)==="running")try{(C=(N=v.current)==null?void 0:N.scrollIntoView)==null||C.call(N,{block:"end"})}catch{}},[d==null?void 0:d.logs.length,d==null?void 0:d.status,g]),E.useEffect(()=>()=>{var N;return(N=y.current)==null?void 0:N.call(y)},[]);const x=E.useCallback((N,C)=>{var I;if((I=y.current)==null||I.call(y),f(N),u(""),!C)return;const T=ee.subscribeTask(N.id,{onLog:M=>f($=>$&&$.id===N.id?{...$,logs:[...$.logs,M]}:$),onStatus:M=>f($=>$&&$.id===N.id?{...$,status:M}:$)});y.current=T},[]),k=E.useCallback(async()=>{const N=jse(n);if(N.length===0){u("Type a command first — e.g. `eval run --task smoke-test` or `gateway status`.");return}l(!0),u("");const C=await ee.startTask(N,i*1e3);if(l(!1),!C.ok||!C.task){u(C.error||"Failed to start task.");return}r(""),b(),x(C.task,!0)},[n,i,x,b]),S=E.useCallback(async N=>{await ee.cancelTask(N)},[]),w=E.useCallback(async N=>{const C=await ee.getTask(N);C!=null&&C.task&&x(C.task,!1)},[x]),_=E.useCallback(()=>{var N;(N=y.current)==null||N.call(y),f(null)},[]);return e?e.authenticated?s.jsxs("div",{className:"panel",children:[s.jsx("h2",{className:"panel-title",children:"🚀 Command Console"}),s.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."}),s.jsxs("form",{className:"task-run-form",onSubmit:N=>{N.preventDefault(),k()},children:[s.jsx("input",{className:"admin-input task-cmd-input",placeholder:"eval run --task smoke-test · gateway status · skill list · memory stats",value:n,onChange:N=>r(N.target.value),autoComplete:"off",spellCheck:!1}),s.jsxs("select",{className:"admin-input task-timeout-select",title:"Task timeout",value:i,onChange:N=>a(Number(N.target.value)),children:[s.jsx("option",{value:60,children:"1 min"}),s.jsx("option",{value:300,children:"5 min"}),s.jsx("option",{value:600,children:"10 min"}),s.jsx("option",{value:1800,children:"30 min"})]}),s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||n.trim()==="",children:o?"⏳ Starting…":"▶ Run"})]}),c&&s.jsx("div",{className:"admin-error",children:c}),s.jsx("p",{className:"task-hint",children:"Long-running commands stream their output live. Runs are capped at the chosen timeout and can be cancelled."}),d&&s.jsxs("div",{className:"task-console-wrap",children:[s.jsxs("div",{className:"task-console-header",children:[s.jsx("code",{className:"task-console-cmd",children:d.command}),s.jsx("span",{className:`task-status ${x_(d.status)}`,children:b_[d.status]}),s.jsxs("span",{className:"task-meta",children:["exit ",d.exitCode??"—"," · ",w_(d.durationMs)]}),d.status==="running"&&s.jsx("button",{className:"admin-mini-btn task-cancel-btn",onClick:()=>void S(d.id),children:"⏹ Cancel"}),s.jsx("button",{className:"admin-mini-btn",onClick:_,children:"✕ Close"})]}),s.jsxs("div",{className:"task-console",children:[d.logs.map((N,C)=>s.jsx("div",{className:`task-line task-line-${N.stream}`,children:N.text},C)),d.logs.length===0&&d.status==="running"&&s.jsx("div",{className:"task-line task-line-system",children:"⏳ waiting for output…"}),s.jsx("div",{ref:v})]}),s.jsxs("label",{className:"task-autoscroll",children:[s.jsx("input",{type:"checkbox",checked:g,onChange:N=>m(N.target.checked)})," auto-scroll"]})]}),s.jsx("h3",{className:"task-history-title",children:"History"}),h.length===0?s.jsx("div",{className:"empty-state",children:"No tasks yet — run your first command above."}):s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table task-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Command"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Exit"}),s.jsx("th",{children:"Duration"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:h.map(N=>s.jsxs("tr",{className:(d==null?void 0:d.id)===N.id?"task-row-active":"",onClick:()=>void w(N.id),children:[s.jsx("td",{children:s.jsx("code",{children:N.command})}),s.jsx("td",{children:s.jsx("span",{className:`task-status ${x_(N.status)}`,children:b_[N.status]})}),s.jsx("td",{children:N.exitCode??"—"}),s.jsx("td",{children:w_(N.durationMs)}),s.jsx("td",{children:Ase(N.startedAt)})]},N.id))})]})})]}):s.jsxs("div",{className:"panel",children:[s.jsx("h2",{className:"panel-title",children:"🚀 Command Console"}),s.jsxs("div",{className:"empty-state",children:[s.jsxs("p",{children:[s.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)."]}),s.jsx("p",{children:e.configured?s.jsx(ky,{className:"admin-refresh-btn",to:"/admin",children:"🔐 Log in"}):s.jsx(ky,{className:"admin-refresh-btn",to:"/admin",children:"🔐 Create admin account"})})]})]}):s.jsxs("div",{className:"panel",children:[s.jsx("h2",{className:"panel-title",children:"🚀 Command Console"}),s.jsx("div",{className:"loading-state",children:"Loading…"})]})}function Cse(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ose=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pse=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mse={};function S_(e,t){return(Mse.jsx?Pse:Ose).test(e)}const Rse=/[ \t\n\f\r]/g;function Ise(e){return typeof e=="object"?e.type==="text"?k_(e.value):!1:k_(e)}function k_(e){return e.replace(Rse,"")===""}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 dM(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ju(n,r,t)}function Yv(e){return e.toLowerCase()}class zn{constructor(t,n){this.attribute=n,this.property=t}}zn.prototype.attribute="";zn.prototype.booleanish=!1;zn.prototype.boolean=!1;zn.prototype.commaOrSpaceSeparated=!1;zn.prototype.commaSeparated=!1;zn.prototype.defined=!1;zn.prototype.mustUseProperty=!1;zn.prototype.number=!1;zn.prototype.overloadedBoolean=!1;zn.prototype.property="";zn.prototype.spaceSeparated=!1;zn.prototype.space=void 0;let $se=0;const Me=vs(),Mt=vs(),Xv=vs(),se=vs(),st=vs(),Ja=vs(),Un=vs();function vs(){return 2**++$se}const Zv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Me,booleanish:Mt,commaOrSpaceSeparated:Un,commaSeparated:Ja,number:se,overloadedBoolean:Xv,spaceSeparated:st},Symbol.toStringTag,{value:"Module"})),og=Object.keys(Zv);class g0 extends zn{constructor(t,n,r,i){let a=-1;if(super(t,n),E_(this,"space",i),typeof r=="number")for(;++a<og.length;){const o=og[a];E_(this,og[a],(r&Zv[o])===Zv[o])}}}g0.prototype.defined=!0;function E_(e,t,n){n&&(e[t]=n)}function ll(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new g0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Yv(r)]=r,n[Yv(a.attribute)]=r}return new ju(t,n,e.space)}const fM=ll({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:st,ariaCurrent:null,ariaDescribedBy:st,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:st,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:st,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:st,ariaLevel:se,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:st,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:st,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:Mt,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function hM(e,t){return t in e?e[t]:t}function pM(e,t){return hM(e,t.toLowerCase())}const Lse=ll({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ja,acceptCharset:st,accessKey:st,action:null,allow:null,allowFullScreen:Me,allowPaymentRequest:Me,allowUserMedia:Me,alpha:Me,alt:null,as:null,async:Me,autoCapitalize:null,autoComplete:st,autoFocus:Me,autoPlay:Me,blocking:st,capture:null,charSet:null,checked:Me,cite:null,className:st,closedBy:null,colorSpace:null,cols:se,colSpan:se,command:null,commandFor:null,content:null,contentEditable:Mt,controls:Me,controlsList:st,coords:se|Ja,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Me,defer:Me,dir:null,dirName:null,disabled:Me,download:Xv,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Me,formTarget:null,headers:st,height:se,hidden:Xv,high:se,href:null,hrefLang:null,htmlFor:st,httpEquiv:st,id:null,imageSizes:null,imageSrcSet:null,inert:Me,inputMode:null,integrity:null,is:null,isMap:Me,itemId:null,itemProp:st,itemRef:st,itemScope:Me,itemType:st,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Me,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:Me,muted:Me,name:null,nonce:null,noModule:Me,noValidate:Me,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:Me,optimum:se,pattern:null,ping:st,placeholder:null,playsInline:Me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Me,referrerPolicy:null,rel:st,required:Me,reversed:Me,rows:se,rowSpan:se,sandbox:st,scope:null,scoped:Me,seamless:Me,selected:Me,shadowRootClonable:Me,shadowRootCustomElementRegistry:Me,shadowRootDelegatesFocus:Me,shadowRootMode:null,shadowRootSerializable:Me,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:Me,useMap:null,value:Mt,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:st,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Me,declare:Me,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:Me,noHref:Me,noShade:Me,noWrap:Me,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Me,disablePictureInPicture:Me,disableRemotePlayback:Me,exportParts:Ja,part:st,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:pM}),Dse=ll({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:Un,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:st,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:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:Me,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,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:Ja,g2:Ja,glyphName:Ja,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:Un,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,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:se,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:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:st,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Un,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Un,rev:Un,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Un,requiredFeatures:Un,requiredFonts:Un,requiredFormats:Un,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:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:Un,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Un,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Un,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hM}),mM=ll({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()}}),gM=ll({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pM}),yM=ll({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bse={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"},zse=/[A-Z]/g,__=/-[a-z]/g,Fse=/^data[-\w.:]+$/i;function Use(e,t){const n=Yv(t);let r=t,i=zn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Fse.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(__,Hse);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!__.test(a)){let o=a.replace(zse,Wse);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=g0}return new i(r,t)}function Wse(e){return"-"+e.toLowerCase()}function Hse(e){return e.charAt(1).toUpperCase()}const Gse=dM([fM,Lse,mM,gM,yM],"html"),y0=dM([fM,Dse,mM,gM,yM],"svg");function qse(e){return e.join(" ").trim()}var v0={},N_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Kse=/\n/g,Vse=/^\s*/,Yse=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xse=/^:\s*/,Zse=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Qse=/^[;\s]*/,Jse=/^\s+|\s+$/g,eoe=`
165
+ `,j_="/",A_="*",Da="",toe="comment",noe="declaration";function roe(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 i(g){var m=g.match(Kse);m&&(n+=m.length);var v=g.lastIndexOf(eoe);r=~v?g.length-v:r+g.length}function a(){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 v=m[0];return i(v),e=e.slice(v.length),m}}function u(){c(Vse)}function d(g){var m;for(g=g||[];m=f();)m!==!1&&g.push(m);return g}function f(){var g=a();if(!(j_!=e.charAt(0)||A_!=e.charAt(1))){for(var m=2;Da!=e.charAt(m)&&(A_!=e.charAt(m)||j_!=e.charAt(m+1));)++m;if(m+=2,Da===e.charAt(m-1))return l("End of comment missing");var v=e.slice(2,m-2);return r+=2,i(v),e=e.slice(m),r+=2,g({type:toe,comment:v})}}function h(){var g=a(),m=c(Yse);if(m){if(f(),!c(Xse))return l("property missing ':'");var v=c(Zse),y=g({type:noe,property:T_(m[0].replace(N_,Da)),value:v?T_(v[0].replace(N_,Da)):Da});return c(Qse),y}}function p(){var g=[];d(g);for(var m;m=h();)m!==!1&&(g.push(m),d(g));return g}return u(),p()}function T_(e){return e?e.replace(Jse,Da):Da}var ioe=roe,aoe=Ki&&Ki.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(v0,"__esModule",{value:!0});v0.default=ooe;const soe=aoe(ioe);function ooe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,soe.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:l}=a;i?t(o,l,a):l&&(n=n||{},n[o]=l)}),n}var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.camelCase=void 0;var loe=/^--[a-zA-Z0-9_-]+$/,coe=/-([a-z])/g,uoe=/^[^-]+$/,doe=/^-(webkit|moz|ms|o|khtml)-/,foe=/^-(ms)-/,hoe=function(e){return!e||uoe.test(e)||loe.test(e)},poe=function(e,t){return t.toUpperCase()},C_=function(e,t){return"".concat(t,"-")},moe=function(e,t){return t===void 0&&(t={}),hoe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(foe,C_):e=e.replace(doe,C_),e.replace(coe,poe))};Rp.camelCase=moe;var goe=Ki&&Ki.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yoe=goe(v0),voe=Rp;function Qv(e,t){var n={};return!e||typeof e!="string"||(0,yoe.default)(e,function(r,i){r&&i&&(n[(0,voe.camelCase)(r,t)]=i)}),n}Qv.default=Qv;var boe=Qv;const xoe=Ze(boe),vM=bM("end"),b0=bM("start");function bM(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 woe(e){const t=b0(e),n=vM(e);if(t&&n)return{start:t,end:n}}function sc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?O_(e.position):"start"in e||"end"in e?O_(e):"line"in e||"column"in e?Jv(e):""}function Jv(e){return P_(e&&e.line)+":"+P_(e&&e.column)}function O_(e){return Jv(e&&e.start)+"-"+Jv(e&&e.end)}function P_(e){return e&&typeof e=="number"?e:1}class bn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=sc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}bn.prototype.file="";bn.prototype.name="";bn.prototype.reason="";bn.prototype.message="";bn.prototype.stack="";bn.prototype.column=void 0;bn.prototype.line=void 0;bn.prototype.ancestors=void 0;bn.prototype.cause=void 0;bn.prototype.fatal=void 0;bn.prototype.place=void 0;bn.prototype.ruleId=void 0;bn.prototype.source=void 0;const x0={}.hasOwnProperty,Soe=new Map,koe=/[A-Z]/g,Eoe=new Set(["table","tbody","thead","tfoot","tr"]),_oe=new Set(["td","th"]),xM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Noe(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=Roe(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=Moe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?y0:Gse,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=wM(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function wM(e,t,n){if(t.type==="element")return joe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Aoe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Coe(e,t,n);if(t.type==="mdxjsEsm")return Toe(e,t);if(t.type==="root")return Ooe(e,t,n);if(t.type==="text")return Poe(e,t)}function joe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=y0,e.schema=i),e.ancestors.push(t);const a=kM(e,t.tagName,!1),o=Ioe(e,t);let l=S0(e,t);return Eoe.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Ise(c):!0})),SM(e,o,a,t),w0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Aoe(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)}uu(e,t.position)}function Toe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);uu(e,t.position)}function Coe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=y0,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:kM(e,t.name,!0),o=$oe(e,t),l=S0(e,t);return SM(e,o,a,t),w0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ooe(e,t,n){const r={};return w0(r,S0(e,t)),e.create(t,e.Fragment,r,n)}function Poe(e,t){return t.value}function SM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function w0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Moe(e,t,n){return r;function r(i,a,o,l){const u=Array.isArray(o.children)?n:t;return l?u(a,o,l):u(a,o)}}function Roe(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=b0(r);return t(i,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Ioe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&x0.call(t.properties,i)){const a=Loe(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&_oe.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function $oe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else uu(e,t.position);else{const i=r.name;let a;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,a=e.evaluater.evaluateExpression(l.expression)}else uu(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function S0(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Soe;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=i.get(c)||0;o=c+"-"+u,i.set(c,u+1)}}const l=wM(e,a,o);l!==void 0&&n.push(l)}return n}function Loe(e,t,n){const r=Use(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Cse(n):qse(n)),r.property==="style"){let i=typeof n=="object"?n:Doe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Boe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Bse[r.property]||r.property:r.attribute,n]}}function Doe(e,t){try{return xoe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new bn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=xM+"#cannot-parse-style-attribute",i}}function kM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const l=S_(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=o}else r=S_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return x0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);uu(e)}function uu(e,t){const n=new bn("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=xM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Boe(e){const t={};let n;for(n in e)x0.call(e,n)&&(t[zoe(n)]=e[n]);return t}function zoe(e){let t=e.replace(koe,Foe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Foe(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"]},Uoe={};function k0(e,t){const n=Uoe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return EM(e,r,i)}function EM(e,t,n){if(Woe(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 M_(e.children,t,n)}return Array.isArray(e)?M_(e,t,n):""}function M_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=EM(e[i],t,n);return r.join("")}function Woe(e){return!!(e&&typeof e=="object")}const R_=document.createElement("i");function E0(e){const t="&"+e+";";R_.innerHTML=t;const n=R_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Yn(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ar(e,t){return e.length>0?(Yn(e,e.length,0,t),e):t}const I_={}.hasOwnProperty;function _M(e){const t={};let n=-1;for(;++n<e.length;)Hoe(t,e[n]);return t}function Hoe(e,t){let n;for(n in t){const i=(I_.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){I_.call(i,o)||(i[o]=[]);const l=a[o];Goe(i[o],Array.isArray(l)?l:l?[l]:[])}}}function Goe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Yn(e,0,0,r)}function NM(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 Or(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=Sa(/[A-Za-z]/),yn=Sa(/[\dA-Za-z]/),qoe=Sa(/[#-'*+\--9=?A-Z^-~]/);function bh(e){return e!==null&&(e<32||e===127)}const eb=Sa(/\d/),Koe=Sa(/[\dA-Fa-f]/),Voe=Sa(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function lt(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const Ip=Sa(new RegExp("\\p{P}|\\p{S}","u")),ds=Sa(/\s/);function Sa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function cl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&yn(e.charCodeAt(n+1))&&yn(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function We(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Be(c)?(e.enter(n),l(c)):t(c)}function l(c){return Be(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const Yoe={tokenize:Xoe};function Xoe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);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 i(l){return e.enter("paragraph"),a(l)}function a(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 Ne(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const Zoe={tokenize:Qoe},$_={tokenize:Joe};function Qoe(e){const t=this,n=[];let r=0,i,a,o;return l;function l(x){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,c,u)(x)}return u(x)}function c(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const k=t.events.length;let S=k,w;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){w=t.events[S][1].end;break}y(r);let _=k;for(;_<t.events.length;)t.events[_][1].end={...w},_++;return Yn(t.events,S+1,0,t.events.slice(k)),t.events.length=_,u(x)}return l(x)}function u(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return g(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($_,d,f)(x)}function d(x){return i&&b(),y(r),h(x)}function f(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(x)}function h(x){return t.containerState={},e.attempt($_,p,g)(x)}function p(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function g(x){if(x===null){i&&b(),y(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),m(x)}function m(x){if(x===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return Ne(x)?(e.consume(x),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(x),m)}function v(x,k){const S=t.sliceStream(x);if(k&&S.push(null),x.previous=a,a&&(a.next=x),a=x,i.defineSkip(x.start),i.write(S),t.parser.lazy[x.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<o&&(!i.events[w][1].end||i.events[w][1].end.offset>o))return;const _=t.events.length;let N=_,C,T;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(C){T=t.events[N][1].end;break}C=!0}for(y(r),w=_;w<t.events.length;)t.events[w][1].end={...T},w++;Yn(t.events,N+1,0,t.events.slice(_)),t.events.length=w}}function y(x){let k=n.length;for(;k-- >x;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=x}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Joe(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 Uo(e){if(e===null||lt(e)||ds(e))return 1;if(Ip(e))return 2}function $p(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const tb={name:"attention",resolveAll:ele,tokenize:tle};function ele(e,t){let n=-1,r,i,a,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};L_(f,-c),L_(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},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...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=ar(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ar(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=ar(u,$p(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ar(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=ar(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Yn(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 tle(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Uo(r);let a;return o;function o(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const u=e.exit("attentionSequence"),d=Uo(c),f=!d||d===2&&i||n.includes(c),h=!i||i===2&&d||n.includes(r);return u._open=!!(a===42?f:f&&(i||!h)),u._close=!!(a===42?h:h&&(d||!f)),t(c)}}function L_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const nle={name:"autolink",tokenize:rle};function rle(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return kn(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||yn(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||yn(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||bh(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):qoe(p)?(e.consume(p),u):n(p)}function d(p){return yn(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||yn(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const Au={partial:!0,tokenize:ile};function ile(e,t,n){return r;function r(a){return Be(a)?We(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ne(a)?t(a):n(a)}}const jM={continuation:{tokenize:sle},exit:ole,name:"blockQuote",tokenize:ale};function ale(e,t,n){const r=this;return i;function i(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"),a}return n(o)}function a(o){return Be(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function sle(e,t,n){const r=this;return i;function i(o){return Be(o)?We(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(jM,t,n)(o)}}function ole(e){e.exit("blockQuote")}const AM={name:"characterEscape",tokenize:lle};function lle(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Voe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const TM={name:"characterReference",tokenize:cle};function cle(e,t,n){const r=this;let i=0,a,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"),a=31,o=yn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Koe,d):(e.enter("characterReferenceValue"),a=7,o=eb,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===yn&&!E0(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&i++<a?(e.consume(f),d):n(f)}}const D_={partial:!0,tokenize:dle},B_={concrete:!0,name:"codeFenced",tokenize:ule};function ule(e,t,n){const r=this,i={partial:!0,tokenize:S};let a=0,o=0,l;return c;function c(w){return u(w)}function u(w){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,l=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(w)}function d(w){return w===l?(o++,e.consume(w),d):o<3?n(w):(e.exit("codeFencedFenceSequence"),Be(w)?We(e,f,"whitespace")(w):f(w))}function f(w){return w===null||Ne(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(D_,m,k)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||Ne(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(w)):Be(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),We(e,p,"whitespace")(w)):w===96&&w===l?n(w):(e.consume(w),h)}function p(w){return w===null||Ne(w)?f(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||Ne(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(w)):w===96&&w===l?n(w):(e.consume(w),g)}function m(w){return e.attempt(i,k,v)(w)}function v(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return a>0&&Be(w)?We(e,b,"linePrefix",a+1)(w):b(w)}function b(w){return w===null||Ne(w)?e.check(D_,m,k)(w):(e.enter("codeFlowValue"),x(w))}function x(w){return w===null||Ne(w)?(e.exit("codeFlowValue"),b(w)):(e.consume(w),x)}function k(w){return e.exit("codeFenced"),t(w)}function S(w,_,N){let C=0;return T;function T(z){return w.enter("lineEnding"),w.consume(z),w.exit("lineEnding"),I}function I(z){return w.enter("codeFencedFence"),Be(z)?We(w,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):M(z)}function M(z){return z===l?(w.enter("codeFencedFenceSequence"),$(z)):N(z)}function $(z){return z===l?(C++,w.consume(z),$):C>=o?(w.exit("codeFencedFenceSequence"),Be(z)?We(w,R,"whitespace")(z):R(z)):N(z)}function R(z){return z===null||Ne(z)?(w.exit("codeFencedFence"),_(z)):N(z)}}}function dle(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const cg={name:"codeIndented",tokenize:hle},fle={partial:!0,tokenize:ple};function hle(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),We(e,a,"linePrefix",5)(u)}function a(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):Ne(u)?e.attempt(fle,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ne(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function ple(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ne(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):We(e,a,"linePrefix",5)(o)}function a(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):Ne(o)?i(o):n(o)}}const mle={name:"codeText",previous:yle,resolve:gle,tokenize:vle};function gle(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function yle(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function vle(e,t,n){let r=0,i,a;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?(a=e.enter("codeTextSequence"),i=0,d(f)):Ne(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||Ne(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",u(f))}}class ble{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 i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Dl(this.left,r),a.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),Dl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Dl(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);Dl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Dl(this.left,n.reverse())}}}function Dl(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 CM(e){const t={};let n=-1,r,i,a,o,l,c,u;const d=new ble(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,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,xle(d,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=d.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},l=d.slice(i,n),l.unshift(r),d.splice(i,n-i+1,l))}}return Yn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function xle(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];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 v=[m];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),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,v.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):v.pop(),h=v.length;h--;){const y=l.slice(v[h],v[h+1]),b=a.pop();c.push([b,b+y.length-1]),e.splice(b,2,y)}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 wle={resolve:kle,tokenize:Ele},Sle={partial:!0,tokenize:_le};function kle(e){return CM(e),e}function Ele(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):Ne(l)?e.check(Sle,o,a)(l):(e.consume(l),i)}function a(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,i}}function _le(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),We(e,a,"linePrefix")}function a(o){if(o===null||Ne(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 OM(e,t,n,r,i,a,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(y),e.exit(a),h):y===null||y===32||y===41||bh(y)?n(y):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function h(y){return y===62?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||Ne(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function m(y){return!d&&(y===null||y===41||lt(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(y)):d<u&&y===40?(e.consume(y),d++,m):y===41?(e.consume(y),d--,m):y===null||y===32||y===40||bh(y)?n(y):(e.consume(y),y===92?v:m)}function v(y){return y===40||y===41||y===92?(e.consume(y),m):m(y)}}function PM(e,t,n,r,i,a){const o=this;let l=0,c;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),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(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Ne(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||Ne(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Be(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function MM(e,t,n,r,i,a){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(a),u(h))}function u(h){return h===o?(e.exit(a),c(o)):h===null?n(h):Ne(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||Ne(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 oc(e,t){let n;return r;function r(i){return Ne(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Be(i)?We(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Nle={name:"definition",tokenize:Ale},jle={partial:!0,tokenize:Tle};function Ale(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return PM.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Or(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 lt(p)?oc(e,u)(p):u(p)}function u(p){return OM(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(jle,f,f)(p)}function f(p){return Be(p)?We(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Ne(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Tle(e,t,n){return r;function r(l){return lt(l)?oc(e,i)(l):n(l)}function i(l){return MM(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Be(l)?We(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ne(l)?t(l):n(l)}}const Cle={name:"hardBreakEscape",tokenize:Ole};function Ole(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ne(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Ple={name:"headingAtx",resolve:Mle,tokenize:Rle};function Mle(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Yn(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Rle(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||lt(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ne(d)?(e.exit("atxHeading"),t(d)):Be(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||lt(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const Ile=["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"],z_=["pre","script","style","textarea"],$le={concrete:!0,name:"htmlFlow",resolveTo:Ble,tokenize:zle},Lle={partial:!0,tokenize:Ule},Dle={partial:!0,tokenize:Fle};function Ble(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 zle(e,t,n){const r=this;let i,a,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),a=!0,m):P===63?(e.consume(P),i=3,r.interrupt?t:A):kn(P)?(e.consume(P),o=String.fromCharCode(P),v):n(P)}function h(P){return P===45?(e.consume(P),i=2,p):P===91?(e.consume(P),i=5,l=0,g):kn(P)?(e.consume(P),i=4,r.interrupt?t:A):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:A):n(P)}function g(P){const ce="CDATA[";return P===ce.charCodeAt(l++)?(e.consume(P),l===ce.length?r.interrupt?t:M:g):n(P)}function m(P){return kn(P)?(e.consume(P),o=String.fromCharCode(P),v):n(P)}function v(P){if(P===null||P===47||P===62||lt(P)){const ce=P===47,we=o.toLowerCase();return!ce&&!a&&z_.includes(we)?(i=1,r.interrupt?t(P):M(P)):Ile.includes(o.toLowerCase())?(i=6,ce?(e.consume(P),y):r.interrupt?t(P):M(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):a?b(P):x(P))}return P===45||yn(P)?(e.consume(P),o+=String.fromCharCode(P),v):n(P)}function y(P){return P===62?(e.consume(P),r.interrupt?t:M):n(P)}function b(P){return Be(P)?(e.consume(P),b):T(P)}function x(P){return P===47?(e.consume(P),T):P===58||P===95||kn(P)?(e.consume(P),k):Be(P)?(e.consume(P),x):T(P)}function k(P){return P===45||P===46||P===58||P===95||yn(P)?(e.consume(P),k):S(P)}function S(P){return P===61?(e.consume(P),w):Be(P)?(e.consume(P),S):x(P)}function w(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,_):Be(P)?(e.consume(P),w):N(P)}function _(P){return P===c?(e.consume(P),c=null,C):P===null||Ne(P)?n(P):(e.consume(P),_)}function N(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||lt(P)?S(P):(e.consume(P),N)}function C(P){return P===47||P===62||Be(P)?x(P):n(P)}function T(P){return P===62?(e.consume(P),I):n(P)}function I(P){return P===null||Ne(P)?M(P):Be(P)?(e.consume(P),I):n(P)}function M(P){return P===45&&i===2?(e.consume(P),D):P===60&&i===1?(e.consume(P),U):P===62&&i===4?(e.consume(P),Z):P===63&&i===3?(e.consume(P),A):P===93&&i===5?(e.consume(P),F):Ne(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Lle,L,$)(P)):P===null||Ne(P)?(e.exit("htmlFlowData"),$(P)):(e.consume(P),M)}function $(P){return e.check(Dle,R,L)(P)}function R(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),z}function z(P){return P===null||Ne(P)?$(P):(e.enter("htmlFlowData"),M(P))}function D(P){return P===45?(e.consume(P),A):M(P)}function U(P){return P===47?(e.consume(P),o="",O):M(P)}function O(P){if(P===62){const ce=o.toLowerCase();return z_.includes(ce)?(e.consume(P),Z):M(P)}return kn(P)&&o.length<8?(e.consume(P),o+=String.fromCharCode(P),O):M(P)}function F(P){return P===93?(e.consume(P),A):M(P)}function A(P){return P===62?(e.consume(P),Z):P===45&&i===2?(e.consume(P),A):M(P)}function Z(P){return P===null||Ne(P)?(e.exit("htmlFlowData"),L(P)):(e.consume(P),Z)}function L(P){return e.exit("htmlFlow"),t(P)}}function Fle(e,t,n){const r=this;return i;function i(o){return Ne(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Ule(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Au,t,n)}}const Wle={name:"htmlText",tokenize:Hle};function Hle(e,t,n){const r=this;let i,a,o;return l;function l(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),S):A===63?(e.consume(A),x):kn(A)?(e.consume(A),N):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),a=0,g):kn(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),h):Ne(A)?(o=f,U(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?D(A):A===45?h(A):f(A)}function g(A){const Z="CDATA[";return A===Z.charCodeAt(a++)?(e.consume(A),a===Z.length?m:g):n(A)}function m(A){return A===null?n(A):A===93?(e.consume(A),v):Ne(A)?(o=m,U(A)):(e.consume(A),m)}function v(A){return A===93?(e.consume(A),y):m(A)}function y(A){return A===62?D(A):A===93?(e.consume(A),y):m(A)}function b(A){return A===null||A===62?D(A):Ne(A)?(o=b,U(A)):(e.consume(A),b)}function x(A){return A===null?n(A):A===63?(e.consume(A),k):Ne(A)?(o=x,U(A)):(e.consume(A),x)}function k(A){return A===62?D(A):x(A)}function S(A){return kn(A)?(e.consume(A),w):n(A)}function w(A){return A===45||yn(A)?(e.consume(A),w):_(A)}function _(A){return Ne(A)?(o=_,U(A)):Be(A)?(e.consume(A),_):D(A)}function N(A){return A===45||yn(A)?(e.consume(A),N):A===47||A===62||lt(A)?C(A):n(A)}function C(A){return A===47?(e.consume(A),D):A===58||A===95||kn(A)?(e.consume(A),T):Ne(A)?(o=C,U(A)):Be(A)?(e.consume(A),C):D(A)}function T(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),T):I(A)}function I(A){return A===61?(e.consume(A),M):Ne(A)?(o=I,U(A)):Be(A)?(e.consume(A),I):C(A)}function M(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,$):Ne(A)?(o=M,U(A)):Be(A)?(e.consume(A),M):(e.consume(A),R)}function $(A){return A===i?(e.consume(A),i=void 0,z):A===null?n(A):Ne(A)?(o=$,U(A)):(e.consume(A),$)}function R(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||lt(A)?C(A):(e.consume(A),R)}function z(A){return A===47||A===62||lt(A)?C(A):n(A)}function D(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function U(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return Be(A)?We(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):F(A)}function F(A){return e.enter("htmlTextData"),o(A)}}const _0={name:"labelEnd",resolveAll:Vle,resolveTo:Yle,tokenize:Xle},Gle={tokenize:Zle},qle={tokenize:Qle},Kle={tokenize:Jle};function Vle(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 i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Yn(e,0,e.length,n),e}function Yle(e,t){let n=e.length,r=0,i,a,o,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=ar(l,e.slice(a+1,a+r+3)),l=ar(l,[["enter",d,t]]),l=ar(l,$p(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=ar(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=ar(l,e.slice(o+1)),l=ar(l,[["exit",c,t]]),Yn(e,a,e.length,l),e}function Xle(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(h){return a?a._inactive?f(h):(o=r.parser.defined.includes(Or(r.sliceSerialize({start:a.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(Gle,d,o?d:f)(h):h===91?e.attempt(qle,d,o?u:f)(h):o?d(h):f(h)}function u(h){return e.attempt(Kle,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function Zle(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return lt(f)?oc(e,a)(f):a(f)}function a(f){return f===41?d(f):OM(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return lt(f)?oc(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?MM(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return lt(f)?oc(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 Qle(e,t,n){const r=this;return i;function i(l){return PM.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Or(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function Jle(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const ece={name:"labelStartImage",resolveAll:_0.resolveAll,tokenize:tce};function tce(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(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 nce={name:"labelStartLink",resolveAll:_0.resolveAll,tokenize:rce};function rce(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const ug={name:"lineEnding",tokenize:ice};function ice(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),We(e,t,"linePrefix")}}const Wd={name:"thematicBreak",tokenize:ace};function ace(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ne(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Be(u)?We(e,l,"whitespace")(u):l(u))}}const Pn={continuation:{tokenize:cce},exit:dce,name:"list",tokenize:lce},sce={partial:!0,tokenize:fce},oce={partial:!0,tokenize:uce};function lce(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[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:eb(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(Wd,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 eb(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(Au,r.interrupt?n:d,e.attempt(sce,h,f))}function d(p){return r.containerState.initialBlankLine=!0,a++,h(p)}function f(p){return Be(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function cce(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Au,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,We(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Be(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(oce,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,We(e,e.attempt(Pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function uce(e,t,n){const r=this;return We(e,i,"listItemIndent",r.containerState.size+1);function i(a){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(a):n(a)}}function dce(e){e.exit(this.containerState.type)}function fce(e,t,n){const r=this;return We(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Be(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const F_={name:"setextUnderline",resolveTo:hce,tokenize:pce};function hce(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function pce(e,t,n){const r=this;let i;return a;function a(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"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Be(u)?We(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ne(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const mce={tokenize:gce};function gce(e){const t=this,n=e.attempt(Au,r,e.attempt(this.parser.constructs.flowInitial,i,We(e,e.attempt(this.parser.constructs.flow,i,e.attempt(wle,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const yce={resolveAll:IM()},vce=RM("string"),bce=RM("text");function RM(e){return{resolveAll:IM(e==="text"?xce:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(d){return u(d)?a(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"),a(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=i[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 IM(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function xce(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],i=t.sliceStream(r);let a=i.length,o=-1,l=0,c;for(;a--;){const u=i[a];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){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,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 wce={42:Pn,43:Pn,45:Pn,48:Pn,49:Pn,50:Pn,51:Pn,52:Pn,53:Pn,54:Pn,55:Pn,56:Pn,57:Pn,62:jM},Sce={91:Nle},kce={[-2]:cg,[-1]:cg,32:cg},Ece={35:Ple,42:Wd,45:[F_,Wd],60:$le,61:F_,95:Wd,96:B_,126:B_},_ce={38:TM,92:AM},Nce={[-5]:ug,[-4]:ug,[-3]:ug,33:ece,38:TM,42:tb,60:[nle,Wle],91:nce,92:[Cle,AM],93:_0,95:tb,96:mle},jce={null:[tb,yce]},Ace={null:[42,95]},Tce={null:[]},Cce=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ace,contentInitial:Sce,disable:Tce,document:wce,flow:Ece,flowInitial:kce,insideSpan:jce,string:_ce,text:Nce},Symbol.toStringTag,{value:"Module"}));function Oce(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 i={},a=[];let o=[],l=[];const c={attempt:_(S),check:_(w),consume:b,enter:x,exit:k,interrupt:_(w,{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&&a.push(t),u;function f(I){return o=ar(o,I),v(),o[o.length-1]!==null?[]:(N(t,0),u.events=$p(a,u.events,u),u.events)}function h(I,M){return Mce(p(I),M)}function p(I){return Pce(o,I)}function g(){const{_bufferIndex:I,_index:M,line:$,column:R,offset:z}=r;return{_bufferIndex:I,_index:M,line:$,column:R,offset:z}}function m(I){i[I.line]=I.column,T()}function v(){let I;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<M.length;)y(M.charCodeAt(r._bufferIndex));else y(M)}}function y(I){d=d(I)}function b(I){Ne(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,T()):I!==-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=I}function x(I,M){const $=M||{};return $.type=I,$.start=g(),u.events.push(["enter",$,u]),l.push($),$}function k(I){const M=l.pop();return M.end=g(),u.events.push(["exit",M,u]),M}function S(I,M){N(I,M.from)}function w(I,M){M.restore()}function _(I,M){return $;function $(R,z,D){let U,O,F,A;return Array.isArray(R)?L(R):"tokenize"in R?L([R]):Z(R);function Z(pe){return Pe;function Pe(G){const X=G!==null&&pe[G],ae=G!==null&&pe.null,le=[...Array.isArray(X)?X:X?[X]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return L(le)(G)}}function L(pe){return U=pe,O=0,pe.length===0?D:P(pe[O])}function P(pe){return Pe;function Pe(G){return A=C(),F=pe,pe.partial||(u.currentConstruct=pe),pe.name&&u.parser.constructs.disable.null.includes(pe.name)?we():pe.tokenize.call(M?Object.assign(Object.create(u),M):u,c,ce,we)(G)}}function ce(pe){return I(F,A),z}function we(pe){return A.restore(),++O<U.length?P(U[O]):D}}}function N(I,M){I.resolveAll&&!a.includes(I)&&a.push(I),I.resolve&&Yn(u.events,M,u.events.length-M,I.resolve(u.events.slice(M),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function C(){const I=g(),M=u.previous,$=u.currentConstruct,R=u.events.length,z=Array.from(l);return{from:R,restore:D};function D(){r=I,u.previous=M,u.currentConstruct=$,u.events.length=R,l=z,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Pce(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Mce(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){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&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function Rce(e){const r={constructs:_M([Cce,...(e||{}).extensions||[]]),content:i(Yoe),defined:[],document:i(Zoe),flow:i(mce),lazy:{},string:i(vce),text:i(bce)};return r;function i(a){return o;function o(l){return Oce(r,a,l)}}}function Ice(e){for(;!CM(e););return e}const U_=/[\0\t\n\r]/g;function $ce(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const c=[];let u,d,f,h,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(U_.lastIndex=f,u=U_.exec(a),h=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(h),!u){t=a.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(a.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 Lce=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dce(e){return e.replace(Lce,Bce)}function Bce(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return NM(n.slice(a?2:1),a?16:10)}return E0(n)||e}const $M={}.hasOwnProperty;function zce(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Fce(n)(Ice(Rce(n).document().write($ce()(e,t,!0))))}function Fce(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(vt),autolinkProtocol:C,autolinkEmail:C,atxHeading:a(je),blockQuote:a(ae),characterEscape:C,characterReference:C,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(Y,o),codeTextData:C,data:C,codeFlowValue:C,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ee),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a($e,o),htmlFlowData:C,htmlText:a($e,o),htmlTextData:C,image:a(fe),label:o,link:a(vt),listItem:a(Ae),listItemValue:h,listOrdered:a(Le,f),listUnordered:a(Le),paragraph:a(He),reference:P,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(je),strong:a(Ie),thematicBreak:a($t)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:X,autolinkProtocol:G,blockQuote:c(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:we,characterReferenceMarkerNumeric:we,characterReferenceValue:pe,characterReference:Pe,codeFenced:c(v),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:T,codeIndented:c(y),codeText:c(z),codeTextData:T,data:T,definition:c(),definitionDestinationString:k,definitionLabelString:b,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(M),hardBreakTrailing:c(M),htmlFlow:c($),htmlFlowData:T,htmlText:c(R),htmlTextData:T,image:c(U),label:F,labelText:O,lineEnding:I,link:c(D),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:A,resourceTitleString:Z,resource:L,setextHeading:c(N),setextHeadingLineSequence:_,setextHeadingText:w,strong:c(),thematicBreak:c()}};LM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(W){let V={type:"root",children:[]};const oe={stack:[V],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 Qe=he.pop();xe=i(W,Qe,xe)}for(xe=-1;++xe<W.length;){const Qe=t[W[xe][0]];$M.call(Qe,W[xe][1].type)&&Qe[W[xe][1].type].call(Object.assign({sliceSerialize:W[xe][2].sliceSerialize},oe),W[xe][1])}if(oe.tokenStack.length>0){const Qe=oe.tokenStack[oe.tokenStack.length-1];(Qe[1]||W_).call(oe,void 0,Qe[0])}for(V.position={start:Bi(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Bi(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe<t.transforms.length;)V=t.transforms[xe](V)||V;return V}function i(W,V,oe){let he=V-1,xe=-1,Qe=!1,Lt,Ct,An,Ot;for(;++he<=oe;){const dt=W[he];switch(dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dt[0]==="enter"?xe++:xe--,Ot=void 0;break}case"lineEndingBlank":{dt[0]==="enter"&&(Lt&&!Ot&&!xe&&!An&&(An=he),Ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ot=void 0}if(!xe&&dt[0]==="enter"&&dt[1].type==="listItemPrefix"||xe===-1&&dt[0]==="exit"&&(dt[1].type==="listUnordered"||dt[1].type==="listOrdered")){if(Lt){let Tn=he;for(Ct=void 0;Tn--;){const Qt=W[Tn];if(Qt[1].type==="lineEnding"||Qt[1].type==="lineEndingBlank"){if(Qt[0]==="exit")continue;Ct&&(W[Ct][1].type="lineEndingBlank",Qe=!0),Qt[1].type="lineEnding",Ct=Tn}else if(!(Qt[1].type==="linePrefix"||Qt[1].type==="blockQuotePrefix"||Qt[1].type==="blockQuotePrefixWhitespace"||Qt[1].type==="blockQuoteMarker"||Qt[1].type==="listItemIndent"))break}An&&(!Ct||An<Ct)&&(Lt._spread=!0),Lt.end=Object.assign({},Ct?W[Ct][1].start:dt[1].end),W.splice(Ct||he,0,["exit",Lt,dt[2]]),he++,oe++}if(dt[1].type==="listItemPrefix"){const Tn={type:"listItem",_spread:!1,start:Object.assign({},dt[1].start),end:void 0};Lt=Tn,W.splice(he,0,["enter",Tn,dt[2]]),he++,oe++,An=void 0,Ot=!0}}}return W[V][1]._spread=Qe,oe}function a(W,V){return oe;function oe(he){l.call(this,W(he),he),V&&V.call(this,he)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(W,V,oe){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([V,oe||void 0]),W.position={start:Bi(V.start),end:void 0}}function c(W){return V;function V(oe){W&&W.call(this,oe),u.call(this,oe)}}function u(W,V){const oe=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==W.type&&(V?V.call(this,W,he[0]):(he[1]||W_).call(this,W,he[0]));else throw new Error("Cannot close `"+W.type+"` ("+sc({start:W.start,end:W.end})+"): it’s not open");oe.position.end=Bi(W.end)}function d(){return k0(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(W){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function p(){const W=this.resume(),V=this.stack[this.stack.length-1];V.lang=W}function g(){const W=this.resume(),V=this.stack[this.stack.length-1];V.meta=W}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W.replace(/(\r?\n|\r)$/g,"")}function b(W){const V=this.resume(),oe=this.stack[this.stack.length-1];oe.label=V,oe.identifier=Or(this.sliceSerialize(W)).toLowerCase()}function x(){const W=this.resume(),V=this.stack[this.stack.length-1];V.title=W}function k(){const W=this.resume(),V=this.stack[this.stack.length-1];V.url=W}function S(W){const V=this.stack[this.stack.length-1];if(!V.depth){const oe=this.sliceSerialize(W).length;V.depth=oe}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function _(W){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function C(W){const oe=this.stack[this.stack.length-1].children;let he=oe[oe.length-1];(!he||he.type!=="text")&&(he=xn(),he.position={start:Bi(W.start),end:void 0},oe.push(he)),this.stack.push(he)}function T(W){const V=this.stack.pop();V.value+=this.sliceSerialize(W),V.position.end=Bi(W.end)}function I(W){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=V.children[V.children.length-1];oe.position.end=Bi(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(C.call(this,W),T.call(this,W))}function M(){this.data.atHardBreak=!0}function $(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function R(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function z(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function D(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=V,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function U(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=V,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function O(W){const V=this.sliceSerialize(W),oe=this.stack[this.stack.length-2];oe.label=Dce(V),oe.identifier=Or(V).toLowerCase()}function F(){const W=this.stack[this.stack.length-1],V=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const he=W.children;oe.children=he}else oe.alt=V}function A(){const W=this.resume(),V=this.stack[this.stack.length-1];V.url=W}function Z(){const W=this.resume(),V=this.stack[this.stack.length-1];V.title=W}function L(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function ce(W){const V=this.resume(),oe=this.stack[this.stack.length-1];oe.label=V,oe.identifier=Or(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function we(W){this.data.characterReferenceType=W.type}function pe(W){const V=this.sliceSerialize(W),oe=this.data.characterReferenceType;let he;oe?(he=NM(V,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=E0(V);const xe=this.stack[this.stack.length-1];xe.value+=he}function Pe(W){const V=this.stack.pop();V.position.end=Bi(W.end)}function G(W){T.call(this,W);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(W)}function X(W){T.call(this,W);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(W)}function ae(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function ve(){return{type:"break"}}function $e(){return{type:"html",value:""}}function fe(){return{type:"image",title:null,url:"",alt:null}}function vt(){return{type:"link",title:null,url:"",children:[]}}function Le(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 He(){return{type:"paragraph",children:[]}}function Ie(){return{type:"strong",children:[]}}function xn(){return{type:"text",value:""}}function $t(){return{type:"thematicBreak"}}}function Bi(e){return{line:e.line,column:e.column,offset:e.offset}}function LM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?LM(e,r):Uce(e,r)}}function Uce(e,t){let n;for(n in t)if($M.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 W_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sc({start:t.start,end:t.end})+") is still open")}function Wce(e){const t=this;t.parser=n;function n(r){return zce(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Hce(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 Gce(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
168
+ `}]}function qce(e,t){const n=t.value?t.value+`
169
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Kce(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vce(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yce(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=cl(r.toLowerCase()),a=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=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(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 Xce(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 Zce(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function DM(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 i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Qce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DM(e,t);const i={src:cl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Jce(e,t){const n={src:cl(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 eue(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 tue(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DM(e,t);const i={href:cl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function nue(e,t){const n={href:cl(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 rue(e,t,n){const r=e.all(t),i=n?iue(n):BM(t),a={},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:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(i||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
170
+ `}),d.type==="element"&&d.tagName==="p"&&!i?o.push(...d.children):o.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
171
+ `});const u={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,u),e.applyData(t,u)}function iue(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=BM(n[r])}return t}function BM(e){const t=e.spread;return t??e.children.length>1}function aue(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];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 a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function sue(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oue(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function lue(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cue(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=b0(t.children[1]),c=vM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function uue(e,t,n){const r=n?n.children:void 0,a=(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:a,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 due(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const H_=9,G_=32;function fue(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(q_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(q_(t.slice(i),i>0,!1)),a.join("")}function q_(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===H_||a===G_;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===H_||a===G_;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function hue(e,t){const n={type:"text",value:fue(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function pue(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const mue={blockquote:Hce,break:Gce,code:qce,delete:Kce,emphasis:Vce,footnoteReference:Yce,heading:Xce,html:Zce,imageReference:Qce,image:Jce,inlineCode:eue,linkReference:tue,link:nue,listItem:rue,list:aue,paragraph:sue,root:oue,strong:lue,table:cue,tableCell:due,tableRow:uue,text:hue,thematicBreak:pue,toml:bd,yaml:bd,definition:bd,footnoteDefinition:bd};function bd(){}const zM=-1,Lp=0,lc=1,xh=2,N0=3,j0=4,A0=5,T0=6,FM=7,UM=8,WM=typeof self=="object"?self:globalThis,K_=(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 WM[e](t)},gue=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case Lp:case zM:return n(o,i);case lc:{const l=n([],i);for(const c of o)l.push(r(c));return l}case xh:{const l=n({},i);for(const[c,u]of o)l[r(c)]=r(u);return l}case N0:return n(new Date(o),i);case j0:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case A0:{const l=n(new Map,i);for(const[c,u]of o)l.set(r(c),r(u));return l}case T0:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case FM:{const{name:l,message:c}=o;return n(typeof WM[l]=="function"?K_(l,c):new Error(c),i)}case UM:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);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(K_(a,o),i)};return r},V_=e=>gue(new Map,e)(0),Ia="",{toString:yue}={},{keys:vue}=Object,Bl=e=>{const t=typeof e;if(t!=="object"||!e)return[Lp,t];const n=yue.call(e).slice(8,-1);switch(n){case"Array":return[lc,Ia];case"Object":return[xh,Ia];case"Date":return[N0,Ia];case"RegExp":return[j0,Ia];case"Map":return[A0,Ia];case"Set":return[T0,Ia];case"DataView":return[lc,n]}return n.includes("Array")?[lc,n]:e instanceof Error?[FM,e.name||"Error"]:[xh,n]},xd=([e,t])=>e===Lp&&(t==="function"||t==="symbol"),bue=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=Bl(o);switch(l){case Lp:{let d=o;switch(c){case"bigint":l=UM,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([zM],o)}return i([l,d],o)}case lc:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),i([c,[...h]],o)}const d=[],f=i([l,d],o);for(const h of o)d.push(a(h));return f}case xh:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],f=i([l,d],o);for(const h of vue(o))(e||!xd(Bl(o[h])))&&d.push([a(h),a(o[h])]);return f}case N0:return i([l,isNaN(o.getTime())?Ia:o.toISOString()],o);case j0:{const{source:d,flags:f}=o;return i([l,{source:d,flags:f}],o)}case A0:{const d=[],f=i([l,d],o);for(const[h,p]of o)(e||!(xd(Bl(h))||xd(Bl(p))))&&d.push([a(h),a(p)]);return f}case T0:{const d=[],f=i([l,d],o);for(const h of o)(e||!xd(Bl(h)))&&d.push(a(h));return f}}const{message:u}=o;return i([l,{name:c,message:u}],o)};return a},Y_=(e,{json:t,lossy:n}={})=>{const r=[];return bue(!(t||n),!!t,new Map,r)(e),r},wh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?V_(Y_(e,t)):structuredClone(e):(e,t)=>V_(Y_(e,t));function xue(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 wue(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Sue(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||xue,r=e.options.footnoteBackLabel||wue,i=e.options.footnoteLabel||"Footnotes",a=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=cl(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 b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),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(b)?b:[b]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const b=v.children[v.children.length-1];b&&b.type==="text"?b.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...wh(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
172
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
173
+ `}]}}const Tu=function(e){if(e==null)return Nue;if(typeof e=="function")return Dp(e);if(typeof e=="object")return Array.isArray(e)?kue(e):Eue(e);if(typeof e=="string")return _ue(e);throw new Error("Expected function, string, or object as test")};function kue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Tu(e[n]);return Dp(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Eue(e){const t=e;return Dp(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function _ue(e){return Dp(t);function t(n){return n&&n.type===e}}function Dp(e){return t;function t(n,r,i){return!!(jue(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Nue(){return!0}function jue(e){return e!==null&&typeof e=="object"&&"type"in e}const HM=[],Aue=!0,nb=!1,Tue="skip";function GM(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Tu(i),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=HM,g,m,v;if((!t||a(c,u,d[d.length-1]||void 0))&&(p=Cue(n(c,d)),p[0]===nb))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==Tue)for(m=(r?y.children.length:-1)+o,v=d.concat(y);m>-1&&m<y.children.length;){const b=y.children[m];if(g=l(b,m,v)(),g[0]===nb)return g;m=typeof g[1]=="number"?g[1]:m+o}}return p}}}function Cue(e){return Array.isArray(e)?e:typeof e=="number"?[Aue,e]:e==null?HM:[e]}function Bp(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),GM(e,a,l,i);function l(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return o(c,f,d)}}const rb={}.hasOwnProperty,Oue={};function Pue(e,t){const n=t||Oue,r=new Map,i=new Map,a=new Map,o={...mue,...n.handlers},l={all:u,applyData:Rue,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:Mue,wrap:$ue};return Bp(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,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(rb.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,...v}=d,y=wh(v);return y.children=l.all(d),y}return wh(d)}return(l.options.unknownHandler||Iue)(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=X_(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=X_(m.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function Mue(e,t){e.position&&(t.position=woe(e))}function Rue(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=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"&&a&&Object.assign(n.properties,wh(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Iue(e,t){const n=t.data||{},r="value"in t&&!(rb.call(n,"hProperties")||rb.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 $ue(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 X_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Z_(e,t){const n=Pue(e,t),r=n.one(e,void 0),i=Sue(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
177
+ `},i),a}function Lue(e,t){return e&&"run"in e?async function(n,r){const i=Z_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Z_(n,{file:r,...e||t})}}function Q_(e){if(e)throw e}var Hd=Object.prototype.hasOwnProperty,qM=Object.prototype.toString,J_=Object.defineProperty,eN=Object.getOwnPropertyDescriptor,tN=function(t){return typeof Array.isArray=="function"?Array.isArray(t):qM.call(t)==="[object Array]"},nN=function(t){if(!t||qM.call(t)!=="[object Object]")return!1;var n=Hd.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Hd.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Hd.call(t,i)},rN=function(t,n){J_&&n.name==="__proto__"?J_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},iN=function(t,n){if(n==="__proto__")if(Hd.call(t,n)){if(eN)return eN(t,n).value}else return;return t[n]},Due=function e(){var t,n,r,i,a,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=iN(l,n),i=iN(t,n),l!==i&&(d&&i&&(nN(i)||(a=tN(i)))?(a?(a=!1,o=r&&tN(r)?r:[]):o=r&&nN(r)?r:{},rN(l,{name:n,newValue:e(d,o,i)})):typeof i<"u"&&rN(l,{name:n,newValue:i}));return l};const dg=Ze(Due);function ib(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 Bue(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(c,...u){const d=e[++a];let f=-1;if(c){o(c);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,d?zue(d,l)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function zue(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return i(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}const Fr={basename:Fue,dirname:Uue,extname:Wue,join:Hue,sep:"/"};function Fue(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Cu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Uue(e){if(Cu(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 Wue(e){Cu(e);let t=e.length,n=-1,r=0,i=-1,a=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?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Hue(...e){let t=-1,n;for(;++t<e.length;)Cu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Gue(n)}function Gue(e){Cu(e);const t=e.codePointAt(0)===47;let n=que(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function que(e,t){let n="",r=0,i=-1,a=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(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function Cu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kue={cwd:Vue};function Vue(){return"/"}function ab(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Yue(e){if(typeof e=="string")e=new URL(e);else if(!ab(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 Xue(e)}function Xue(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 i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const fg=["history","path","basename","stem","extname","dirname"];class KM{constructor(t){let n;t?ab(t)?n={path:t}:typeof t=="string"||Zue(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Kue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<fg.length;){const a=fg[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)fg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Fr.basename(this.path):void 0}set basename(t){pg(t,"basename"),hg(t,"basename"),this.path=Fr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Fr.dirname(this.path):void 0}set dirname(t){aN(this.basename,"dirname"),this.path=Fr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Fr.extname(this.path):void 0}set extname(t){if(hg(t,"extname"),aN(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=Fr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ab(t)&&(t=Yue(t)),pg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Fr.basename(this.path,this.extname):void 0}set stem(t){pg(t,"stem"),hg(t,"stem"),this.path=Fr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new bn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function hg(e,t){if(e&&e.includes(Fr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Fr.sep+"`")}function pg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function aN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Zue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Que=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},Jue={}.hasOwnProperty;class C0 extends Que{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=Bue()}copy(){const t=new C0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(dg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(yg("data",this.frozen),this.namespace[t]=n,this):Jue.call(this.namespace,t)&&this.namespace[t]||void 0:t?(yg("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 i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=wd(t),r=this.parser||this.Parser;return mg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),mg("process",this.parser||this.Parser),gg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=wd(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);nde(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?o(d):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),mg("processSync",this.parser||this.Parser),gg("processSync",this.compiler||this.Compiler),this.process(t,i),oN("processSync","process",n),r;function i(a,o){n=!0,Q_(a),r=o}}run(t,n,r){sN(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,l){const c=wd(n);i.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,i;return this.run(t,n,a),oN("runSync","run",r),i;function a(o,l){Q_(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=wd(n),i=this.compiler||this.Compiler;return gg("stringify",i),sN(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(yg("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 a(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&&(i.settings=dg(!0,i.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];a(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];ib(m)&&ib(p)&&(p=dg(!0,m,p)),r[h]=[u,p,...g]}}}}const ede=new C0().freeze();function mg(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 yg(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 sN(e){if(!ib(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function oN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wd(e){return tde(e)?e:new KM(e)}function tde(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function nde(e){return typeof e=="string"||rde(e)}function rde(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ide="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lN=[],cN={allowDangerousHtml:!0},ade=/^(https?|ircs?|mailto|xmpp)$/i,sde=[{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 ode(e){const t=lde(e),n=cde(e);return ude(t.runSync(t.parse(n),n),e)}function lde(e){const t=e.rehypePlugins||lN,n=e.remarkPlugins||lN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cN}:cN;return ede().use(Wce).use(n).use(Lue,r).use(t)}function cde(e){const t=e.children||"",n=new KM;return typeof t=="string"&&(n.value=t),n}function ude(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||dde;for(const d of sde)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+ide+d.id,void 0);return Bp(e,u),Noe(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.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):a?a.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 dde(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||ade.test(e.slice(0,t))?e:""}function uN(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function fde(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function hde(e,t,n){const i=Tu((n||{}).ignore||[]),a=pde(t);let o=-1;for(;++o<a.length;)GM(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(i(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=a[o][0],p=a[o][1];let g=0;const v=f.children.indexOf(u);let y=!1,b=[];h.lastIndex=0;let x=h.exec(u.value);for(;x;){const k=x.index,S={index:x.index,input:x.input,stack:[...d,u]};let w=p(...x,S);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?h.lastIndex=k+1:(g!==k&&b.push({type:"text",value:u.value.slice(g,k)}),Array.isArray(w)?b.push(...w):w&&b.push(w),g=k+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g<u.value.length&&b.push({type:"text",value:u.value.slice(g)}),f.children.splice(v,1,...b)):b=[u],v+b.length}}function pde(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 i=n[r];t.push([mde(i[0]),gde(i[1])])}return t}function mde(e){return typeof e=="string"?new RegExp(fde(e),"g"):e}function gde(e){return typeof e=="function"?e:function(){return e}}const vg="phrasing",bg=["autolink","link","image","label"];function yde(){return{transforms:[Ede],enter:{literalAutolink:bde,literalAutolinkEmail:xg,literalAutolinkHttp:xg,literalAutolinkWww:xg},exit:{literalAutolink:kde,literalAutolinkEmail:Sde,literalAutolinkHttp:xde,literalAutolinkWww:wde}}}function vde(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vg,notInConstruct:bg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vg,notInConstruct:bg},{character:":",before:"[ps]",after:"\\/",inConstruct:vg,notInConstruct:bg}]}}function bde(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xg(e){this.config.enter.autolinkProtocol.call(this,e)}function xde(e){this.config.exit.autolinkProtocol.call(this,e)}function wde(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 Sde(e){this.config.exit.autolinkEmail.call(this,e)}function kde(e){this.exit(e)}function Ede(e){hde(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_de],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Nde]],{ignore:["link","linkReference"]})}function _de(e,t,n,r,i){let a="";if(!VM(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!jde(n)))return!1;const o=Ade(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function Nde(e,t,n,r){return!VM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jde(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 Ade(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 i=uN(e,"(");let a=uN(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function VM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ds(n)||Ip(n))&&(!t||n!==47)}YM.peek=Lde;function Tde(){this.buffer()}function Cde(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ode(){this.buffer()}function Pde(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Mde(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Or(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Rde(e){this.exit(e)}function Ide(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Or(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $de(e){this.exit(e)}function Lde(){return"["}function YM(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function Dde(){return{enter:{gfmFootnoteCallString:Tde,gfmFootnoteCall:Cde,gfmFootnoteDefinitionLabelString:Ode,gfmFootnoteDefinition:Pde},exit:{gfmFootnoteCallString:Mde,gfmFootnoteCall:Rde,gfmFootnoteDefinitionLabelString:Ide,gfmFootnoteDefinition:$de}}}function Bde(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:YM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let c=l.move("[^");const u=a.enter("footnoteDefinition"),d=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
178
+ `:" ")+a.indentLines(a.containerFlow(r,l.current()),t?XM:zde))),u(),c}}function zde(e,t,n){return t===0?e:XM(e,t,n)}function XM(e,t,n){return(n?"":" ")+e}const Fde=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ZM.peek=qde;function Ude(){return{canContainEols:["delete"],enter:{strikethrough:Hde},exit:{strikethrough:Gde}}}function Wde(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Fde}],handlers:{delete:ZM}}}function Hde(e){this.enter({type:"delete",children:[]},e)}function Gde(e){this.exit(e)}function ZM(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function qde(){return"~"}function Kde(e){return e.length}function Vde(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Kde,a=[],o=[],l=[],c=[];let u=0,d=-1;for(;++d<e.length;){const m=[],v=[];let y=-1;for(e[d].length>u&&(u=e[d].length);++y<e[d].length;){const b=Yde(e[d][y]);if(n.alignDelimiters!==!1){const x=i(b);v[y]=x,(c[y]===void 0||x>c[y])&&(c[y]=x)}m.push(b)}o[d]=m,l[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)a[f]=dN(r[f]);else{const m=dN(r);for(;++f<u;)a[f]=m}f=-1;const h=[],p=[];for(;++f<u;){const m=a[f];let v="",y="";m===99?(v=":",y=":"):m===108?v=":":m===114&&(y=":");let b=n.alignDelimiters===!1?1:Math.max(1,c[f]-v.length-y.length);const x=v+"-".repeat(b)+y;n.alignDelimiters!==!1&&(b=v.length+b+y.length,b>c[f]&&(c[f]=b),p[f]=b),h[f]=x}o.splice(1,0,h),l.splice(1,0,p),d=-1;const g=[];for(;++d<o.length;){const m=o[d],v=l[d];f=-1;const y=[];for(;++f<u;){const b=m[f]||"";let x="",k="";if(n.alignDelimiters!==!1){const S=c[f]-(v[f]||0),w=a[f];w===114?x=" ".repeat(S):w===99?S%2?(x=" ".repeat(S/2+.5),k=" ".repeat(S/2-.5)):(x=" ".repeat(S/2),k=x):k=" ".repeat(S)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(x),y.push(b),n.alignDelimiters!==!1&&y.push(k),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
179
+ `)}function Yde(e){return e==null?"":String(e)}function dN(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 Xde(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),Zde);return i(),o}function Zde(e,t,n){return">"+(n?"":" ")+e}function Qde(e,t){return fN(e,t.inConstruct,!0)&&!fN(e,t.notInConstruct,!1)}function fN(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 hN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
180
+ `&&Qde(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
181
+ `}function Jde(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function efe(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 tfe(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 nfe(e,t,n,r){const i=tfe(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(efe(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,rfe);return f(),h}const l=n.createTracker(r),c=i.repeat(Math.max(Jde(a,i)+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
+ `),a&&(d+=l.move(a+`
184
+ `)),d+=l.move(c),u(),d}function rfe(e,t,n){return(n?"":" ")+e}function O0(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 ife(e,t,n,r){const i=O0(n),a=i==='"'?"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${a}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),o(),u}function afe(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 du(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Sh(e,t,n){const r=Uo(e),i=Uo(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}QM.peek=sfe;function QM(e,t,n,r){const i=afe(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const u=c.charCodeAt(0),d=Sh(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=du(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Sh(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+du(f));const p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function sfe(e,t,n){return n.options.emphasis||"*"}function ofe(e,t){let n=!1;return Bp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,nb}),!!((!e.depth||e.depth<3)&&k0(e)&&(t.options.setext||n))}function lfe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(ofe(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...a.current(),before:`
186
+ `,after:`
187
+ `});return f(),d(),h+`
188
+ `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
189
+ `))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
190
+ `,...a.current()});return/^[\t ]/.test(u)&&(u=du(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}JM.peek=cfe;function JM(e){return e.value||""}function cfe(){return"<"}eR.peek=ufe;function eR(e,t,n,r){const i=O0(n),a=i==='"'?"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${a}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),u+=c.move(")"),o(),u}function ufe(){return"!"}tR.peek=dfe;function tR(e,t,n,r){const i=e.referenceType,a=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,a(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function dfe(){return"!"}nR.peek=ffe;function nR(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const o=n.unsafe[a],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 i+r+i}function ffe(){return"`"}function rR(e,t){const n=k0(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))}iR.peek=hfe;function iR(e,t,n,r){const i=O0(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(rR(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${a}`),u+=o.move(" "+i),u+=o.move(n.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),c()),u+=o.move(")"),l(),u}function hfe(e,t,n){return rR(e,n)?"<":"["}aR.peek=pfe;function aR(e,t,n,r){const i=e.referenceType,a=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,a(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function pfe(){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 mfe(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 gfe(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 sR(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 yfe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?gfe(n):P0(n);const l=e.ordered?o==="."?")":".":mfe(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),sR(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=a,i(),u}function vfe(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 bfe(e,t,n,r){const i=vfe(n);let a=n.bulletCurrent||P0(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.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?a:a+" ".repeat(o-a.length))+f}}function xfe(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const wfe=Tu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Sfe(e,t,n,r){return(e.children.some(function(o){return wfe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function kfe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}oR.peek=Efe;function oR(e,t,n,r){const i=kfe(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const u=c.charCodeAt(0),d=Sh(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=du(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Sh(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+du(f));const p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function Efe(e,t,n){return n.options.strong||"*"}function _fe(e,t,n,r){return n.safe(e.value,r)}function Nfe(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 jfe(e,t,n){const r=(sR(n)+(n.options.ruleSpaces?" ":"")).repeat(Nfe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const lR={blockquote:Xde,break:hN,code:nfe,definition:ife,emphasis:QM,hardBreak:hN,heading:lfe,html:JM,image:eR,imageReference:tR,inlineCode:nR,link:iR,linkReference:aR,list:yfe,listItem:bfe,paragraph:xfe,root:Sfe,strong:oR,text:_fe,thematicBreak:jfe};function Afe(){return{enter:{table:Tfe,tableData:pN,tableHeader:pN,tableRow:Ofe},exit:{codeText:Pfe,table:Cfe,tableData:wg,tableHeader:wg,tableRow:wg}}}function Tfe(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 Cfe(e){this.exit(e),this.data.inTable=void 0}function Ofe(e){this.enter({type:"tableRow",children:[]},e)}function wg(e){this.exit(e)}function pN(e){this.enter({type:"tableCell",children:[]},e)}function Pfe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Mfe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Mfe(e,t){return t==="|"?t:e}function Rfe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=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,v){return u(d(p,m,v),p.align)}function l(p,g,m,v){const y=f(p,m,v),b=u([y]);return b.slice(0,b.indexOf(`
192
+ `))}function c(p,g,m,v){const y=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(p,{...v,before:a,after:a});return b(),y(),x}function u(p,g){return Vde(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,m){const v=p.children;let y=-1;const b=[],x=g.enter("table");for(;++y<v.length;)b[y]=f(v[y],g,m);return x(),b}function f(p,g,m){const v=p.children;let y=-1;const b=[],x=g.enter("tableRow");for(;++y<v.length;)b[y]=c(v[y],p,g,m);return x(),b}function h(p,g,m){let v=lR.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function Ife(){return{exit:{taskListCheckValueChecked:mN,taskListCheckValueUnchecked:mN,paragraph:Lfe}}}function $fe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Dfe}}}function mN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Lfe(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 i=t.children;let a=-1,o;for(;++a<i.length;){const l=i[a];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 Dfe(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(o);let c=lR.listItem(e,t,n,{...r,...l.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+o}}function Bfe(){return[yde(),Dde(),Ude(),Afe(),Ife()]}function zfe(e){return{extensions:[vde(),Bde(e),Wde(),Rfe(e),$fe()]}}const Ffe={tokenize:Kfe,partial:!0},cR={tokenize:Vfe,partial:!0},uR={tokenize:Yfe,partial:!0},dR={tokenize:Xfe,partial:!0},Ufe={tokenize:Zfe,partial:!0},fR={name:"wwwAutolink",tokenize:Gfe,previous:pR},hR={name:"protocolAutolink",tokenize:qfe,previous:mR},Ti={name:"emailAutolink",tokenize:Hfe,previous:gR},Jr={};function Wfe(){return{text:Jr}}let Aa=48;for(;Aa<123;)Jr[Aa]=Ti,Aa++,Aa===58?Aa=65:Aa===91&&(Aa=97);Jr[43]=Ti;Jr[45]=Ti;Jr[46]=Ti;Jr[95]=Ti;Jr[72]=[Ti,hR];Jr[104]=[Ti,hR];Jr[87]=[Ti,fR];Jr[119]=[Ti,fR];function Hfe(e,t,n){const r=this;let i,a;return o;function o(f){return!sb(f)||!gR.call(r,r.previous)||M0(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return sb(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(Ufe,d,u)(f):f===45||f===95||yn(f)?(a=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),i=!0,c}function d(f){return a&&i&&kn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Gfe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!pR.call(r,r.previous)||M0(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Ffe,e.attempt(cR,e.attempt(uR,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function qfe(e,t,n){const r=this;let i="",a=!1;return o;function o(f){return(f===72||f===104)&&mR.call(r,r.previous)&&!M0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(kn(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),a?u:(a=!0,c)):n(f)}function u(f){return f===null||bh(f)||lt(f)||ds(f)||Ip(f)?n(f):e.attempt(cR,e.attempt(uR,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Kfe(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function Vfe(e,t,n){let r,i,a;return o;function o(u){return u===46||u===95?e.check(dR,c,l)(u):u===null||lt(u)||ds(u)||u!==45&&Ip(u)?c(u):(a=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),o}function c(u){return i||r||!a?n(u):t(u)}}function Yfe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(dR,t,a)(o):o===null||lt(o)||ds(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function Xfe(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),a):l===93?(e.consume(l),i):l===60||l===null||lt(l)||ds(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||lt(l)||ds(l)?t(l):r(l)}function a(l){return kn(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):kn(l)?(e.consume(l),o):n(l)}}function Zfe(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return yn(a)?n(a):t(a)}}function pR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||lt(e)}function mR(e){return!kn(e)}function gR(e){return!(e===47||sb(e))}function sb(e){return e===43||e===45||e===46||e===95||yn(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 Qfe={tokenize:she,partial:!0};function Jfe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rhe,continuation:{tokenize:ihe},exit:ahe}},text:{91:{name:"gfmFootnoteCall",tokenize:nhe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ehe,resolveTo:the}}}}function ehe(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][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=Or(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function the(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function nhe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=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(a>999||f===93&&!o||f===null||f===91||lt(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Or(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return lt(f)||(o=!0),a++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,u):u(f)}}function rhe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,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||lt(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return a=Or(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return lt(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"),i.includes(a)||i.push(a),We(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function ihe(e,t,n){return e.check(Au,t,e.attempt(Qfe,t,n))}function ahe(e){e.exit("gfmFootnoteDefinition")}function she(e,t,n){const r=this;return We(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function ohe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(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&&Yn(h,h.length,0,$p(p,o.slice(u+1,c),l)),Yn(h,h.length,0,[["exit",f,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),Yn(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 a(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=Uo(u);if(g===126)return f>1?c(g):(o.consume(g),f++,p);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=Uo(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,l(g)}}}class lhe{constructor(){this.map=[]}add(t,n,r){che(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[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 i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function che(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function uhe(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function dhe(){return{flow:{null:{name:"table",tokenize:fhe,resolveAll:hhe}}}}function fhe(e,t,n){const r=this;let i=0,a=0,o;return l;function l(T){let I=r.events.length-1;for(;I>-1;){const R=r.events[I][1].type;if(R==="lineEnding"||R==="linePrefix")I--;else break}const M=I>-1?r.events[I][1].type:null,$=M==="tableHead"||M==="tableRow"?w:c;return $===w&&r.parser.lazy[r.now().line]?n(T):$(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,a+=1),d(T)}function d(T){return T===null?n(T):Ne(T)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),p):n(T):Be(T)?We(e,d,"whitespace")(T):(a+=1,o&&(o=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||lt(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function p(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Be(T)?We(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),m):S(T)}function m(T){return Be(T)?We(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(a+=1,y(T)):T===null||Ne(T)?k(T):S(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),b(T)):S(T)}function b(T){return T===45?(e.consume(T),b):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Be(T)?We(e,k,"whitespace")(T):k(T)}function k(T){return T===124?g(T):T===null||Ne(T)?!o||i!==a?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function w(T){return e.enter("tableRow"),_(T)}function _(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),_):T===null||Ne(T)?(e.exit("tableRow"),t(T)):Be(T)?We(e,_,"whitespace")(T):(e.enter("data"),N(T))}function N(T){return T===null||T===124||lt(T)?(e.exit("data"),_(T)):(e.consume(T),T===92?C:N)}function C(T){return T===92||T===124?(e.consume(T),N):N(T)}}function hhe(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new lhe;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(gN(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,a=[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]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],f=Sd(h,t,a,i,void 0,f),a=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],f=Sd(h,t,a,i,void 0,f)),a=o,o=[a[1],n,0,0])):g.type==="tableHead"?(l=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,a[1]!==0?(o[0]=o[1],f=Sd(h,t,a,i,n,f)):o[1]!==0&&(f=Sd(h,t,o,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&gN(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=uhe(t.events,n))}return e}function Sd(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},$s(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=$s(t.events,n[1]);if(a={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=$s(t.events,n[2]),d=$s(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 i!==void 0&&(a.end=Object.assign({},$s(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function gN(e,t,n,r,i){const a=[],o=$s(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function $s(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const phe={name:"tasklistCheck",tokenize:ghe};function mhe(){return{text:{91:phe}}}function ghe(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return lt(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 Ne(c)?t(c):Be(c)?e.check({tokenize:yhe},t,n)(c):n(c)}}function yhe(e,t,n){return We(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function vhe(e){return _M([Wfe(),Jfe(),ohe(e),dhe(),mhe()])}const bhe={};function xhe(e){const t=this,n=e||bhe,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(vhe(n)),a.push(Bfe()),o.push(zfe(n))}const yN=function(e,t,n){const r=Tu(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]},bs=function(e){if(e==null)return khe;if(typeof e=="string")return She(e);if(typeof e=="object")return whe(e);if(typeof e=="function")return R0(e);throw new Error("Expected function, string, or array as `test`")};function whe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=bs(e[n]);return R0(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function She(e){return R0(t);function t(n){return n.tagName===e}}function R0(e){return t;function t(n,r,i){return!!(Ehe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function khe(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Ehe(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const vN=/\n/g,bN=/[\t ]+/g,ob=bs("br"),xN=bs(Phe),_he=bs("p"),wN=bs("tr"),Nhe=bs(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Ohe,Mhe]),yR=bs(["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 jhe(e,t){const n=t||{},r="children"in e?e.children:[],i=yR(e),a=xR(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...bR(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)o.push(...vR(r[l],e,{whitespace:a,breakBefore:l?void 0:i,breakAfter:l<r.length-1?ob(r[l+1]):i}));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 vR(e,t,n){return e.type==="element"?Ahe(e,t,n):e.type==="text"?n.whitespace==="normal"?bR(e,n):The(e):[]}function Ahe(e,t,n){const r=xR(e,n),i=e.children||[];let a=-1,o=[];if(Nhe(e))return o;let l,c;for(ob(e)||wN(e)&&yN(t,e,wN)?c=`
194
+ `:_he(e)?(l=2,c=2):yR(e)&&(l=1,c=1);++a<i.length;)o=o.concat(vR(i[a],e,{whitespace:r,breakBefore:a?void 0:l,breakAfter:a<i.length-1?ob(i[a+1]):c}));return xN(e)&&yN(t,e,xN)&&o.push(" "),l&&o.unshift(l),c&&o.push(c),o}function bR(e,t){const n=String(e.value),r=[],i=[];let a=0;for(;a<=n.length;){vN.lastIndex=a;const c=vN.exec(n),u=c&&"index"in c?c.index:n.length;r.push(Che(n.slice(a,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),a=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?(i.push(r[o]),l=void 0):r[o]?(typeof l=="number"&&i.push(l),i.push(r[o]),l=0):(o===0||o===r.length-1)&&i.push(0);return i}function The(e){return[String(e.value)]}function Che(e,t,n){const r=[];let i=0,a;for(;i<e.length;){bN.lastIndex=i;const o=bN.exec(e);a=o?o.index:e.length,!i&&!a&&o&&!t&&r.push(""),i!==a&&r.push(e.slice(i,a)),i=o?a+o[0].length:a}return i!==a&&!n&&r.push(""),r.join(" ")}function xR(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 Ohe(e){return!!(e.properties||{}).hidden}function Phe(e){return e.tagName==="td"||e.tagName==="th"}function Mhe(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function Rhe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[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(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+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"],v=["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"],y=["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"],k={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},w=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:w.concat([{begin:/\(/,end:/\)/,keywords:k,contains:w.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:k,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:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,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:k,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(_,N,S,w,[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:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Ihe(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=Rhe(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 $he(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 i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=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,i]};i.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"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["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"],S=["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:v,built_in:[...b,...x,"set","shopt",...k,...S]},contains:[p,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function Lhe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(i)+"[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(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",v={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"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,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:v,disableAutodetect:!0,illegal:"</",contains:[].concat(b,x,y,[f,{begin:e.IDENT_RE+"::",keywords:v},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function Dhe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[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(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+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"],v=["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"],y=["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"],k={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},w=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:w.concat([{begin:/\(/,end:/\)/,keywords:k,contains:w.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:k,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:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:k,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:k,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(_,N,S,w,[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:k,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Bhe(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"],i=["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"],a=["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:i.concat(a),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]},v=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=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,m,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",k={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"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,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,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},k]}}const zhe=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_-]*/}}),Fhe=["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"],Uhe=["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"],Whe=[...Fhe,...Uhe],Hhe=["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(),Ghe=["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(),qhe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Khe=["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 Vhe(e){const t=e.regex,n=zhe(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\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:":("+Ghe.join("|")+")"},{begin:":(:)?("+qhe.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Khe.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:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Hhe.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Whe.join("|")+")\\b"}]}}function Yhe(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 Xhe(e){const a={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:a,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:a,illegal:/["']/}]}]}}function Zhe(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 Qhe(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 i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={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,a,i,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,a,i,o,n]}}]}}var Ls="[0-9](_*[0-9])*",kd=`\\.(${Ls})`,Ed="[0-9a-fA-F](_*[0-9a-fA-F])*",SN={className:"number",variants:[{begin:`(\\b(${Ls})((${kd})|\\.)?|(${kd}))[eE][+-]?(${Ls})[fFdD]?\\b`},{begin:`\\b(${Ls})((${kd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${kd})[fFdD]?\\b`},{begin:`\\b(${Ls})[fFdD]\\b`},{begin:`\\b0[xX]((${Ed})\\.?|(${Ed})?\\.(${Ed}))[pP][+-]?(${Ls})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ed})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function wR(e,t,n){return n===-1?"":e.replace(t,r=>wR(e,t,n-1))}function Jhe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+wR("(?:<"+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,SN,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},SN,u]}}const kN="[A-Za-z$_][0-9A-Za-z$_]*",epe=["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"],tpe=["true","false","null","undefined","NaN","Infinity"],SR=["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"],kR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ER=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],npe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rpe=[].concat(ER,SR,kR);function ipe(e){const t=e.regex,n=(O,{after:F})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,F)!==-1},r=kN,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,F)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){F.ignoreMatch();return}Z===">"&&(n(O,{after:A})||F.ignoreMatch());let L;const P=O.input.substring(A);if(L=P.match(/^\s*=/)){F.ignoreMatch();return}if((L=P.match(/^\s+extends\s+/))&&L.index===0){F.ignoreMatch();return}}},l={$pattern:kN,keyword:epe,literal:tpe,built_in:rpe,"variable.language":npe},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"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={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"}}]},N={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:{_:[...SR,...kR]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const $={match:t.concat(/\b/,M([...ER,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:D,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:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},$,I,_,z,{match:/\$[(.]/}]}}const ape="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",spe={scope:"number",match:ape,relevance:0};function ope(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={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,i,spe,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ds="[0-9](_*[0-9])*",_d=`\\.(${Ds})`,Nd="[0-9a-fA-F](_*[0-9a-fA-F])*",lpe={className:"number",variants:[{begin:`(\\b(${Ds})((${_d})|\\.)?|(${_d}))[eE][+-]?(${Ds})[fFdD]?\\b`},{begin:`\\b(${Ds})((${_d})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_d})[fFdD]?\\b`},{begin:`\\b(${Ds})[fFdD]\\b`},{begin:`\\b0[xX]((${Nd})\\.?|(${Nd})?\\.(${Nd}))[pP][+-]?(${Ds})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Nd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function cpe(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+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,i]}]};i.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=lpe,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 upe=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_-]*/}}),dpe=["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"],fpe=["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"],hpe=[...dpe,...fpe],ppe=["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(),_R=["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(),NR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),mpe=["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(),gpe=_R.concat(NR).sort().reverse();function ype(e){const t=upe(e),n=gpe,r="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,k,S){return{className:x,begin:k,relevance:S}},d={$pattern:/[a-z-]+/,keyword:r,attribute:ppe.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","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\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:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mpe.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}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,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","@\\{"+i+"\\}"),{begin:"\\b("+hpe.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",a,0),u("selector-id","#"+a),u("selector-class","\\."+a,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+_R.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+NR.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,v,b,g,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function vpe(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[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:i.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:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function bpe(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]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},a={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,i,a,o]}}function xpe(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={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}]},a={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(y=>{y.contains=y.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,a,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function wpe(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 Spe(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}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},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,a,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(m,v,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},p=(m,v,y)=>t.concat(t.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,y,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 a.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function kpe(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),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=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":(R,z)=>{z.data._beginMatch=R[1]||R[2]},"on:end":(R,z)=>{z.data._beginMatch!==R[1]&&z.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},v=["false","null","true"],y=["__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"],b=["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"],k={keyword:y,literal:(R=>{const z=[];return R.forEach(D=>{z.push(D),D.toLowerCase()===D?z.push(D.toUpperCase()):z.push(D.toLowerCase())}),z})(v),built_in:b},S=R=>R.map(z=>z.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",S(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},_=t.concat(r,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},C={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:k,contains:[C,o,N,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,w]},I={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(I);const M=[C,N,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,w],$={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...M]},...M,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:k,contains:[$,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,I,N,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},w,{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:k,contains:["self",$,o,N,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 Epe(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 _pe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Npe(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})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={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,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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,y,f]}]}}function jpe(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Ape(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]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=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:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[a,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Tpe(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]+/),i=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}]},w=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.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=w,m.contains=w;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:w}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:w}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(w)}}function Cpe(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,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:"->"},a]}}const Ope=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_-]*/}}),Ppe=["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"],Mpe=["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"],Rpe=[...Ppe,...Mpe],Ipe=["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(),$pe=["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(),Lpe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Dpe=["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 Bpe(e){const t=Ope(e),n=Lpe,r=$pe,i="@[a-z-]+",a="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("+Rpe.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("+Dpe.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:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Ipe.join(" ")},contains:[{begin:i,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 zpe(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Fpe(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["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(S=>!d.includes(S)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(S){return t.concat(/\b/,t.either(...S.map(w=>w.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function k(S,{exceptions:w,when:_}={}){const N=_;return w=w||[],S.map(C=>C.match(/\|\d+$/)||w.includes(C)?C:N(C)?`${C}|0`:C)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:k(g,{when:S=>S.length<3}),literal:a,type:l,built_in:f},contains:[{scope:"type",match:b(o)},x,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function jR(e){return e?typeof e=="string"?e:e.source:null}function zl(e){return nt("(?=",e,")")}function nt(...e){return e.map(n=>jR(n)).join("")}function Upe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function wn(...e){return"("+(Upe(e).capture?"":"?:")+e.map(r=>jR(r)).join("|")+")"}const I0=e=>nt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Wpe=["Protocol","Type"].map(I0),EN=["init","self"].map(I0),Hpe=["Any","Self"],Sg=["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"],_N=["false","nil","true"],Gpe=["assignment","associativity","higherThan","left","lowerThan","none","right"],qpe=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],NN=["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"],AR=wn(/[/=\-+!*%<>&|^~?]/,/[\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]/),TR=wn(AR,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),kg=nt(AR,TR,"*"),CR=wn(/[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]/),kh=wn(CR,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Br=nt(CR,kh,"*"),jd=nt(/[A-Z]/,kh,"*"),Kpe=["attached","autoclosure",nt(/convention\(/,wn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,Br,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Vpe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Ype(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,wn(...Wpe,...EN)],className:{2:"keyword"}},a={match:nt(/\./,wn(...Sg)),relevance:0},o=Sg.filter(ve=>typeof ve=="string").concat(["_|0"]),l=Sg.filter(ve=>typeof ve!="string").concat(Hpe).map(I0),c={variants:[{className:"keyword",match:wn(...l,...EN)}]},u={$pattern:wn(/\b\w+/,/#\w+/),keyword:o.concat(qpe),literal:_N},d=[i,a,c],f={match:nt(/\./,wn(...NN)),relevance:0},h={className:"built_in",match:nt(/\b/,wn(...NN),/(?=\()/)},p=[f,h],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:kg},{match:`\\.(\\.|${TR})+`}]},v=[g,m],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},k=(ve="")=>({className:"subst",variants:[{match:nt(/\\/,ve,/[0\\tnr"']/)},{match:nt(/\\/,ve,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(ve="")=>({className:"subst",match:nt(/\\/,ve,/[\t ]*(?:[\r\n]|\r\n)/)}),w=(ve="")=>({className:"subst",label:"interpol",begin:nt(/\\/,ve,/\(/),end:/\)/}),_=(ve="")=>({begin:nt(ve,/"""/),end:nt(/"""/,ve),contains:[k(ve),S(ve),w(ve)]}),N=(ve="")=>({begin:nt(ve,/"/),end:nt(/"/,ve),contains:[k(ve),w(ve)]}),C={className:"string",variants:[_(),_("#"),_("##"),_("###"),N(),N("#"),N("##"),N("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],I={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},M=ve=>{const $e=nt(ve,/\//),fe=nt(/\//,ve);return{begin:$e,end:fe,contains:[...T,{scope:"comment",begin:`#(?!.*${fe})`,end:/$/}]}},$={scope:"regexp",variants:[M("###"),M("##"),M("#"),I]},R={match:nt(/`/,Br,/`/)},z={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${kh}+`},U=[R,z,D],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Vpe,contains:[...v,x,C]}]}},F={scope:"keyword",match:nt(/@/,wn(...Kpe),zl(wn(/\(/,/\s+/)))},A={scope:"meta",match:nt(/@/,Br)},Z=[O,F,A],L={match:zl(/\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)/,kh,"+")},{className:"type",match:jd,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,zl(jd)),relevance:0}]},P={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...Z,g,L]};L.contains.push(P);const ce={match:nt(Br,/\s*:/),keywords:"_|0",relevance:0},we={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ce,...r,$,...d,...p,...v,x,C,...U,...Z,L]},pe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,L]},Pe={begin:wn(zl(nt(Br,/\s*:/)),zl(nt(Br,/\s+/,Br,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Br}]},G={begin:/\(/,end:/\)/,keywords:u,contains:[Pe,...r,...d,...v,x,C,...Z,L,we],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,wn(R.match,Br,kg)],className:{1:"keyword",3:"title.function"},contains:[pe,G,t],illegal:[/\[/,/%/]},ae={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[pe,G,t],illegal:/\[|%/},le={match:[/operator/,/\s+/,kg],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,jd],className:{1:"keyword",3:"title"},contains:[L],keywords:[...Gpe,..._N],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"}},Ee={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},je={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Br,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[pe,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:jd},...d],relevance:0}]};for(const ve of C.variants){const $e=ve.contains.find(vt=>vt.label==="interpol");$e.keywords=u;const fe=[...d,...p,...v,x,C,...U];$e.contains=[...fe,{begin:/\(/,end:/\)/,contains:["self",...fe]}]}return{name:"Swift",keywords:u,contains:[...r,X,ae,_e,Ee,je,le,Y,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},$,...d,...p,...v,x,C,...U,...Z,L,we]}}const Eh="[A-Za-z$_][0-9A-Za-z$_]*",OR=["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"],PR=["true","false","null","undefined","NaN","Infinity"],MR=["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"],RR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],IR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$R=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],LR=[].concat(IR,MR,RR);function Xpe(e){const t=e.regex,n=(O,{after:F})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,F)!==-1},r=Eh,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,F)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){F.ignoreMatch();return}Z===">"&&(n(O,{after:A})||F.ignoreMatch());let L;const P=O.input.substring(A);if(L=P.match(/^\s*=/)){F.ignoreMatch();return}if((L=P.match(/^\s+extends\s+/))&&L.index===0){F.ignoreMatch();return}}},l={$pattern:Eh,keyword:OR,literal:PR,built_in:LR,"variable.language":$R},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"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={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"}}]},N={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:{_:[...MR,...RR]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const $={match:t.concat(/\b/,M([...IR,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:D,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:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},$,I,_,z,{match:/\$[(.]/}]}}function Zpe(e){const t=e.regex,n=Xpe(e),r=Eh,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},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:Eh,keyword:OR.concat(c),literal:PR,built_in:LR.concat(i),"variable.language":$R},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(x=>x.label===v);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,y)};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,a,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 Qpe(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\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(a,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,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 Jpe(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"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={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"}},a,o,i,e.QUOTE_STRING_MODE,c,u,l]}}function eme(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,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{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:[i]},{begin:/'/,end:/'/,contains:[i]},{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:[a,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{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 tme(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]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={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,i]},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},v=[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,a,o],y=[...v];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const nme={arduino:Ihe,bash:$he,c:Lhe,cpp:Dhe,csharp:Bhe,css:Vhe,diff:Yhe,go:Xhe,graphql:Zhe,ini:Qhe,java:Jhe,javascript:ipe,json:ope,kotlin:cpe,less:ype,lua:vpe,makefile:bpe,markdown:xpe,objectivec:wpe,perl:Spe,php:kpe,"php-template":Epe,plaintext:_pe,python:Npe,"python-repl":jpe,r:Ape,ruby:Tpe,rust:Cpe,scss:Bpe,shell:zpe,sql:Fpe,swift:Ype,typescript:Zpe,vbnet:Qpe,wasm:Jpe,xml:eme,yaml:tme};function DR(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)&&DR(n)}),e}class jN{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function BR(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Qi(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const rme="</span>",AN=e=>!!e.scope,ime=(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,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class ame{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=BR(t)}openNode(t){if(!AN(t))return;const n=ime(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){AN(t)&&(this.buffer+=rme)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const TN=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class $0{constructor(){this.rootNode=TN(),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=TN({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=>{$0._collapse(n)}))}}class sme extends $0{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 ame(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function fu(e){return e?typeof e=="string"?e:e.source:null}function zR(e){return xs("(?=",e,")")}function ome(e){return xs("(?:",e,")*")}function lme(e){return xs("(?:",e,")?")}function xs(...e){return e.map(n=>fu(n)).join("")}function cme(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function L0(...e){return"("+(cme(e).capture?"":"?:")+e.map(r=>fu(r)).join("|")+")"}function FR(e){return new RegExp(e.toString()+"|").exec("").length-1}function ume(e,t){const n=e&&e.exec(t);return n&&n.index===0}const dme=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function D0(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let a=fu(r),o="";for(;a.length>0;){const l=dme.exec(a);if(!l){o+=a;break}o+=a.substring(0,l.index),a=a.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+i):(o+=l[0],l[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}const fme=/\b\B/,UR="[a-zA-Z]\\w*",B0="[a-zA-Z_]\\w*",WR="\\b\\d+(\\.\\d+)?",HR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",GR="\\b(0b[01]+)",hme="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",pme=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=xs(t,/.*\b/,e.binary,/\b.*/)),Qi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},hu={begin:"\\\\[\\s\\S]",relevance:0},mme={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[hu]},gme={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[hu]},yme={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/},zp=function(e,t,n={}){const r=Qi({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 i=L0("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:xs(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},vme=zp("//","$"),bme=zp("/\\*","\\*/"),xme=zp("#","$"),wme={scope:"number",begin:WR,relevance:0},Sme={scope:"number",begin:HR,relevance:0},kme={scope:"number",begin:GR,relevance:0},Eme={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[hu,{begin:/\[/,end:/\]/,relevance:0,contains:[hu]}]},_me={scope:"title",begin:UR,relevance:0},Nme={scope:"title",begin:B0,relevance:0},jme={begin:"\\.\\s*"+B0,relevance:0},Ame=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 Ad=Object.freeze({__proto__:null,APOS_STRING_MODE:mme,BACKSLASH_ESCAPE:hu,BINARY_NUMBER_MODE:kme,BINARY_NUMBER_RE:GR,COMMENT:zp,C_BLOCK_COMMENT_MODE:bme,C_LINE_COMMENT_MODE:vme,C_NUMBER_MODE:Sme,C_NUMBER_RE:HR,END_SAME_AS_BEGIN:Ame,HASH_COMMENT_MODE:xme,IDENT_RE:UR,MATCH_NOTHING_RE:fme,METHOD_GUARD:jme,NUMBER_MODE:wme,NUMBER_RE:WR,PHRASAL_WORDS_MODE:yme,QUOTE_STRING_MODE:gme,REGEXP_MODE:Eme,RE_STARTERS_RE:hme,SHEBANG:pme,TITLE_MODE:_me,UNDERSCORE_IDENT_RE:B0,UNDERSCORE_TITLE_MODE:Nme});function Tme(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Cme(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Ome(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Tme,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Pme(e,t){Array.isArray(e.illegal)&&(e.illegal=L0(...e.illegal))}function Mme(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 Rme(e,t){e.relevance===void 0&&(e.relevance=1)}const Ime=(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=xs(n.beforeMatch,zR(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},$me=["of","and","for","in","not","or","if","then","parent","list","value"],Lme="keyword";function qR(e,t,n=Lme){const r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(a){Object.assign(r,qR(e[a],t,a))}),r;function i(a,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");r[c[0]]=[a,Dme(c[0],c[1])]})}}function Dme(e,t){return t?Number(t):Bme(e)?0:1}function Bme(e){return $me.includes(e.toLowerCase())}const CN={},es=e=>{console.error(e)},ON=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Is=(e,t)=>{CN[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),CN[`${e}/${t}`]=!0)},_h=new Error;function KR(e,t,{key:n}){let r=0;const i=e[n],a={},o={};for(let l=1;l<=t.length;l++)o[l+r]=i[l],a[l+r]=!0,r+=FR(t[l-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function zme(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw es("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),_h;if(typeof e.beginScope!="object"||e.beginScope===null)throw es("beginScope must be object"),_h;KR(e,e.begin,{key:"beginScope"}),e.begin=D0(e.begin,{joinWith:""})}}function Fme(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw es("skip, excludeEnd, returnEnd not compatible with endScope: {}"),_h;if(typeof e.endScope!="object"||e.endScope===null)throw es("endScope must be object"),_h;KR(e,e.end,{key:"endScope"}),e.end=D0(e.end,{joinWith:""})}}function Ume(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Wme(e){Ume(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),zme(e),Fme(e)}function Hme(e){function t(o,l){return new RegExp(fu(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+=FR(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(D0(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 i(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 a(o,l){const c=o;if(o.isCompiled)return c;[Cme,Mme,Wme,Ime].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[Ome,Pme,Rme].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=qR(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=fu(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 Gme(d==="self"?o:d)})),o.contains.forEach(function(d){a(d,c)}),o.starts&&a(o.starts,l),c.matcher=i(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=Qi(e.classNameAliases||{}),a(e)}function VR(e){return e?e.endsWithParent||VR(e.starts):!1}function Gme(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Qi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:VR(e)?Qi(e,{starts:e.starts?Qi(e.starts):null}):Object.isFrozen(e)?Qi(e):e}var qme="11.11.2";class Kme extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Eg=BR,PN=Qi,MN=Symbol("nomatch"),Vme=7,YR=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const a="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:sme};function c(D){return l.noHighlightRe.test(D)}function u(D){let U=D.className+" ";U+=D.parentNode?D.parentNode.className:"";const O=l.languageDetectRe.exec(U);if(O){const F=N(O[1]);return F||(ON(a.replace("{}",O[1])),ON("Falling back to no-highlight mode for this block.",D)),F?O[1]:"no-highlight"}return U.split(/\s+/).find(F=>c(F)||N(F))}function d(D,U,O){let F="",A="";typeof U=="object"?(F=D,O=U.ignoreIllegals,A=U.language):(Is("10.7.0","highlight(lang, code, ...args) has been deprecated."),Is("10.7.0",`Please use highlight(code, options) instead.
197
+ https://github.com/highlightjs/highlight.js/issues/2277`),A=D,F=U),O===void 0&&(O=!0);const Z={code:F,language:A};R("before:highlight",Z);const L=Z.result?Z.result:f(Z.language,Z.code,O);return L.code=Z.code,R("after:highlight",L),L}function f(D,U,O,F){const A=Object.create(null);function Z(W,V){return W.keywords[V]}function L(){if(!fe.keywords){Le.addText(Ae);return}let W=0;fe.keywordPatternRe.lastIndex=0;let V=fe.keywordPatternRe.exec(Ae),oe="";for(;V;){oe+=Ae.substring(W,V.index);const he=je.case_insensitive?V[0].toLowerCase():V[0],xe=Z(fe,he);if(xe){const[Qe,Lt]=xe;if(Le.addText(oe),oe="",A[he]=(A[he]||0)+1,A[he]<=Vme&&(He+=Lt),Qe.startsWith("_"))oe+=V[0];else{const Ct=je.classNameAliases[Qe]||Qe;we(V[0],Ct)}}else oe+=V[0];W=fe.keywordPatternRe.lastIndex,V=fe.keywordPatternRe.exec(Ae)}oe+=Ae.substring(W),Le.addText(oe)}function P(){if(Ae==="")return;let W=null;if(typeof fe.subLanguage=="string"){if(!t[fe.subLanguage]){Le.addText(Ae);return}W=f(fe.subLanguage,Ae,!0,vt[fe.subLanguage]),vt[fe.subLanguage]=W._top}else W=p(Ae,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(He+=W.relevance),Le.__addSublanguage(W._emitter,W.language)}function ce(){fe.subLanguage!=null?P():L(),Ae=""}function we(W,V){W!==""&&(Le.startScope(V),Le.addText(W),Le.endScope())}function pe(W,V){let oe=1;const he=V.length-1;for(;oe<=he;){if(!W._emit[oe]){oe++;continue}const xe=je.classNameAliases[W[oe]]||W[oe],Qe=V[oe];xe?we(Qe,xe):(Ae=Qe,L(),Ae=""),oe++}}function Pe(W,V){return W.scope&&typeof W.scope=="string"&&Le.openNode(je.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(we(Ae,je.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Ae=""):W.beginScope._multi&&(pe(W.beginScope,V),Ae="")),fe=Object.create(W,{parent:{value:fe}}),fe}function G(W,V,oe){let he=ume(W.endRe,oe);if(he){if(W["on:end"]){const xe=new jN(W);W["on:end"](V,xe),xe.isMatchIgnored&&(he=!1)}if(he){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return G(W.parent,V,oe)}function X(W){return fe.matcher.regexIndex===0?(Ae+=W[0],1):($t=!0,0)}function ae(W){const V=W[0],oe=W.rule,he=new jN(oe),xe=[oe.__beforeBegin,oe["on:begin"]];for(const Qe of xe)if(Qe&&(Qe(W,he),he.isMatchIgnored))return X(V);return oe.skip?Ae+=V:(oe.excludeBegin&&(Ae+=V),ce(),!oe.returnBegin&&!oe.excludeBegin&&(Ae=V)),Pe(oe,W),oe.returnBegin?0:V.length}function le(W){const V=W[0],oe=U.substring(W.index),he=G(fe,W,oe);if(!he)return MN;const xe=fe;fe.endScope&&fe.endScope._wrap?(ce(),we(V,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(ce(),pe(fe.endScope,W)):xe.skip?Ae+=V:(xe.returnEnd||xe.excludeEnd||(Ae+=V),ce(),xe.excludeEnd&&(Ae=V));do fe.scope&&Le.closeNode(),!fe.skip&&!fe.subLanguage&&(He+=fe.relevance),fe=fe.parent;while(fe!==he.parent);return he.starts&&Pe(he.starts,W),xe.returnEnd?0:V.length}function Y(){const W=[];for(let V=fe;V!==je;V=V.parent)V.scope&&W.unshift(V.scope);W.forEach(V=>Le.openNode(V))}let _e={};function Ee(W,V){const oe=V&&V[0];if(Ae+=W,oe==null)return ce(),0;if(_e.type==="begin"&&V.type==="end"&&_e.index===V.index&&oe===""){if(Ae+=U.slice(V.index,V.index+1),!i){const he=new Error(`0 width match regex (${D})`);throw he.languageName=D,he.badRule=_e.rule,he}return 1}if(_e=V,V.type==="begin")return ae(V);if(V.type==="illegal"&&!O){const he=new Error('Illegal lexeme "'+oe+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw he.mode=fe,he}else if(V.type==="end"){const he=le(V);if(he!==MN)return he}if(V.type==="illegal"&&oe==="")return V.index===U.length||(Ae+=`
198
+ `),1;if(xn>1e5&&xn>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ae+=oe,oe.length}const je=N(D);if(!je)throw es(a.replace("{}",D)),new Error('Unknown language: "'+D+'"');const ve=Hme(je);let $e="",fe=F||ve;const vt={},Le=new l.__emitter(l);Y();let Ae="",He=0,Ie=0,xn=0,$t=!1;try{if(je.__emitTokens)je.__emitTokens(U,Le);else{for(fe.matcher.considerAll();;){xn++,$t?$t=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=Ie;const W=fe.matcher.exec(U);if(!W)break;const V=U.substring(Ie,W.index),oe=Ee(V,W);Ie=W.index+oe}Ee(U.substring(Ie))}return Le.finalize(),$e=Le.toHTML(),{language:D,value:$e,relevance:He,illegal:!1,_emitter:Le,_top:fe}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:D,value:Eg(U),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:Ie,context:U.slice(Ie-100,Ie+100),mode:W.mode,resultSoFar:$e},_emitter:Le};if(i)return{language:D,value:Eg(U),illegal:!1,relevance:0,errorRaised:W,_emitter:Le,_top:fe};throw W}}function h(D){const U={value:Eg(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return U._emitter.addText(D),U}function p(D,U){U=U||l.languages||Object.keys(t);const O=h(D),F=U.filter(N).filter(T).map(ce=>f(ce,D,!1));F.unshift(O);const A=F.sort((ce,we)=>{if(ce.relevance!==we.relevance)return we.relevance-ce.relevance;if(ce.language&&we.language){if(N(ce.language).supersetOf===we.language)return 1;if(N(we.language).supersetOf===ce.language)return-1}return 0}),[Z,L]=A,P=Z;return P.secondBest=L,P}function g(D,U,O){const F=U&&n[U]||O;D.classList.add("hljs"),D.classList.add(`language-${F}`)}function m(D){let U=null;const O=u(D);if(c(O))return;if(R("before:highlightElement",{el:D,language:O}),D.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",D);return}if(D.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(D)),l.throwUnescapedHTML))throw new Kme("One of your code blocks includes unescaped HTML.",D.innerHTML);U=D;const F=U.textContent,A=O?d(F,{language:O,ignoreIllegals:!0}):p(F);D.innerHTML=A.value,D.dataset.highlighted="yes",g(D,O,A.language),D.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(D.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),R("after:highlightElement",{el:D,result:A,text:F})}function v(D){l=PN(l,D)}const y=()=>{k(),Is("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){k(),Is("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function k(){function D(){k()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",D,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function S(D,U){let O=null;try{O=U(e)}catch(F){if(es("Language definition for '{}' could not be registered.".replace("{}",D)),i)es(F);else throw F;O=o}O.name||(O.name=D),t[D]=O,O.rawDefinition=U.bind(null,e),O.aliases&&C(O.aliases,{languageName:D})}function w(D){delete t[D];for(const U of Object.keys(n))n[U]===D&&delete n[U]}function _(){return Object.keys(t)}function N(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function C(D,{languageName:U}){typeof D=="string"&&(D=[D]),D.forEach(O=>{n[O.toLowerCase()]=U})}function T(D){const U=N(D);return U&&!U.disableAutodetect}function I(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=U=>{D["before:highlightBlock"](Object.assign({block:U.el},U))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=U=>{D["after:highlightBlock"](Object.assign({block:U.el},U))})}function M(D){I(D),r.push(D)}function $(D){const U=r.indexOf(D);U!==-1&&r.splice(U,1)}function R(D,U){const O=D;r.forEach(function(F){F[O]&&F[O](U)})}function z(D){return Is("10.7.0","highlightBlock will be removed entirely in v12.0"),Is("10.7.0","Please use highlightElement now."),m(D)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:k,highlightElement:m,highlightBlock:z,configure:v,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:S,unregisterLanguage:w,listLanguages:_,getLanguage:N,registerAliases:C,autoDetection:T,inherit:PN,addPlugin:M,removePlugin:$}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=qme,e.regex={concat:xs,lookahead:zR,either:L0,optional:lme,anyNumberOfTimes:ome};for(const D in Ad)typeof Ad[D]=="object"&&DR(Ad[D]);return Object.assign(e,Ad),e},Wo=YR({});Wo.newInstance=()=>YR({});var Yme=Wo;Wo.HighlightJS=Wo;Wo.default=Wo;const Xme=Ze(Yme),RN={},Zme="hljs-";function Qme(e){const t=Xme.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:l};function n(c,u,d){const f=d||RN,h=typeof f.prefix=="string"?f.prefix:Zme;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Jme,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||RN).subset||i();let h=-1,p=0,g;for(;++h<f.length;){const m=f[h];if(!t.getLanguage(m))continue;const v=n(m,c,u);v.data&&v.data.relevance!==void 0&&v.data.relevance>p&&(p=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function a(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 Jme{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],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const ege={};function tge(e){const t=e||ege,n=t.aliases,r=t.detect||!1,i=t.languages||nme,a=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=Qme(i);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){Bp(d,"element",function(h,p,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=nge(h);if(m===!1||!m&&!r||m&&a&&a.includes(m))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=jhe(h,{whitespace:"pre"});let y;try{y=m?u.highlight(m,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(b){const x=b;if(m&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+m+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!m&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function nge(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const i=String(t[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}const Nh="[A-Za-z$_][0-9A-Za-z$_]*",XR=["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"],ZR=["true","false","null","undefined","NaN","Infinity"],QR=["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"],JR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],e2=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],t2=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],n2=[].concat(e2,QR,JR);function rge(e){const t=e.regex,n=(O,{after:F})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,F)!==-1},r=Nh,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,F)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){F.ignoreMatch();return}Z===">"&&(n(O,{after:A})||F.ignoreMatch());let L;const P=O.input.substring(A);if(L=P.match(/^\s*=/)){F.ignoreMatch();return}if((L=P.match(/^\s+extends\s+/))&&L.index===0){F.ignoreMatch();return}}},l={$pattern:Nh,keyword:XR,literal:ZR,built_in:n2,"variable.language":t2},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"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={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"}}]},N={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:{_:[...QR,...JR]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const $={match:t.concat(/\b/,M([...e2,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:D,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:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},$,I,_,z,{match:/\$[(.]/}]}}function IN(e){const t=e.regex,n=rge(e),r=Nh,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},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:Nh,keyword:XR.concat(c),literal:ZR,built_in:n2.concat(i),"variable.language":t2},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(x=>x.label===v);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,y)};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,a,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 $N="[A-Za-z$_][0-9A-Za-z$_]*",ige=["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"],age=["true","false","null","undefined","NaN","Infinity"],r2=["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"],i2=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],a2=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sge=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],oge=[].concat(a2,r2,i2);function LN(e){const t=e.regex,n=(O,{after:F})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,F)!==-1},r=$N,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,F)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){F.ignoreMatch();return}Z===">"&&(n(O,{after:A})||F.ignoreMatch());let L;const P=O.input.substring(A);if(L=P.match(/^\s*=/)){F.ignoreMatch();return}if((L=P.match(/^\s+extends\s+/))&&L.index===0){F.ignoreMatch();return}}},l={$pattern:$N,keyword:ige,literal:age,built_in:oge,"variable.language":sge},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"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={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"}}]},N={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:{_:[...r2,...i2]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const $={match:t.concat(/\b/,M([...a2,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:D,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:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},$,I,_,z,{match:/\$[(.]/}]}}const lge="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",cge={scope:"number",match:lge,relevance:0};function uge(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={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,i,cge,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function dge(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 i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=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,i]};i.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"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["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"],S=["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:v,built_in:[...b,...x,"set","shopt",...k,...S]},contains:[p,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function DN(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function BN(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})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={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,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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,y,f]}]}}function zN(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},i={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}]},a={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(y=>{y.contains=y.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,a,r,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function FN(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]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={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,i]},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},v=[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,a,o],y=[...v];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}function fge(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 hge(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["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(S=>!d.includes(S)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(S){return t.concat(/\b/,t.either(...S.map(w=>w.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function k(S,{exceptions:w,when:_}={}){const N=_;return w=w||[],S.map(C=>C.match(/\|\d+$/)||w.includes(C)?C:N(C)?`${C}|0`:C)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:k(g,{when:S=>S.length<3}),literal:a,type:l,built_in:f},contains:[{scope:"type",match:b(o)},x,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function UN(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,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{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:[i]},{begin:/'/,end:/'/,contains:[i]},{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:[a,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{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 pge=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_-]*/}}),mge=["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"],gge=["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"],yge=[...mge,...gge],vge=["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(),bge=["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(),xge=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wge=["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 Sge(e){const t=e.regex,n=pge(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\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:":("+bge.join("|")+")"},{begin:":(:)?("+xge.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wge.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:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:vge.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+yge.join("|")+")\\b"}]}}function WN(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}const kge={ts:IN,typescript:IN,js:LN,javascript:LN,json:uge,bash:dge,shell:DN,sh:DN,python:BN,py:BN,markdown:zN,md:zN,yaml:FN,yml:FN,diff:fge,sql:hge,html:UN,xml:UN,css:Sge,text:WN,plaintext:WN};function s2(e){if(e==null)return"";const t=e;return typeof t.value=="string"?t.value:Array.isArray(t.children)?t.children.map(s2).join(""):""}function Ege({lang:e,code:t,children:n}){const[r,i]=E.useState(!1),a=async()=>{var o;try{await((o=navigator.clipboard)==null?void 0:o.writeText(t)),i(!0),setTimeout(()=>i(!1),1500)}catch{}};return s.jsxs("div",{className:"md-code-block",children:[s.jsxs("div",{className:"md-code-head",children:[s.jsx("span",{className:"md-code-lang",children:e}),s.jsx("button",{type:"button",className:"md-code-copy",onClick:()=>void a(),children:r?"✓ Copied":"⧉ Copy"})]}),s.jsx("pre",{className:"md-code-pre",children:s.jsx("code",{children:n})})]})}function _ge({node:e,children:t}){var o,l,c,u;const n=(o=e==null?void 0:e.children)==null?void 0:o[0],i=((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",a=E.useMemo(()=>s2(n),[n]);return s.jsx(Ege,{lang:i,code:a,children:t})}function HN({text:e}){const t=E.useMemo(()=>({h1:({node:n,...r})=>s.jsx("h1",{className:"md-heading md-h1",...r}),h2:({node:n,...r})=>s.jsx("h2",{className:"md-heading md-h2",...r}),h3:({node:n,...r})=>s.jsx("h3",{className:"md-heading md-h3",...r}),h4:({node:n,...r})=>s.jsx("h4",{className:"md-heading md-h4",...r}),h5:({node:n,...r})=>s.jsx("h5",{className:"md-heading md-h5",...r}),h6:({node:n,...r})=>s.jsx("h6",{className:"md-heading md-h6",...r}),p:({node:n,...r})=>s.jsx("p",{className:"md-para",...r}),ul:({node:n,...r})=>s.jsx("ul",{className:"md-list md-ul",...r}),ol:({node:n,...r})=>s.jsx("ol",{className:"md-list md-ol",...r}),blockquote:({node:n,...r})=>s.jsx("blockquote",{className:"md-quote",...r}),hr:({node:n,...r})=>s.jsx("hr",{className:"md-hr",...r}),table:({node:n,...r})=>s.jsx("table",{className:"md-table",...r}),a:({node:n,...r})=>s.jsx("a",{target:"_blank",rel:"noreferrer",...r}),pre:_ge}),[]);return s.jsx("div",{className:"md-root",children:s.jsx(ode,{remarkPlugins:[xhe],rehypePlugins:[[tge,{languages:kge}]],components:t,children:e??""})})}const GN=/```([\w+-]*)\n([\s\S]*?)```/g;function Nge(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 jge(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 Age(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 Tge(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 qN=/https?:\/\/[^\s)\]}"'<>]+/i,KN=/(🚀|deploy(?:ed|ment|ing)?|live at|published|available at|open the)/i;function Cge(e){return e.replace(/[.,;:!?]+$/,"")}function Oge(e){const t=e.split(`
202
+ `),n=[],r=new Set;for(let i=0;i<t.length;i+=1){const a=t[i];let o=a.match(KN);!o&&i+1<t.length&&/deploy(?:ed|ment|ing)?:\s*$/i.test(a.trim())&&(o=t[i+1].match(KN));const l=a.match(qN)||(i+1<t.length?t[i+1].match(qN):null);if(!o||!l)continue;const c=Cge(l[0]);r.has(c)||(r.add(c),n.push({url:c,title:a.trim().slice(0,80)||"Deployment"}))}return n}function VN(e){const t=[],n=[],r=[];GN.lastIndex=0;let i;for(;(i=GN.exec(e))!==null;){const a=(i[1]||"").toLowerCase(),o=i[2];if(a==="diff"||o.includes("diff --git ")){const l=Nge(o);l.length>0&&t.push({files:l,summary:`${l.length} file${l.length===1?"":"s"} changed`})}else jge(o)&&n.push({verdict:Age(o),title:Tge(o),body:o})}for(const a of Oge(e))r.push(a);return{diffs:t,results:n,deploys:r}}const Pge=/\x1b(?:\[[0-9;?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-Z\\-_])/g;function YN(e){return e?e.replace(Pge,""):""}const XN=3e5,Mge=2e3;function Rge(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 Ige={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error"};function Td({diff:e,selectable:t=!1,onCommitAccepted:n,lockedHint:r}){const[i,a]=E.useState(null),o=new Set(i??e.files.map(d=>d.path)),l=d=>{a(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 s.jsxs("div",{className:"chat-diff-card",children:[s.jsxs("div",{className:"chat-diff-head",children:[s.jsx("span",{className:"chat-diff-icon",children:"🔧"}),s.jsx("span",{className:"chat-diff-title",children:"git diff"}),s.jsxs("span",{className:"chat-diff-meta",children:[e.files.length," file",e.files.length===1?"":"s"," · +",c," −",u]})]}),s.jsx("div",{className:"chat-diff-files",children:e.files.map(d=>{const f=o.has(d.path);return s.jsxs("details",{className:`chat-diff-file${f?"":" chat-diff-file-rejected"}`,open:e.files.length===1,children:[s.jsxs("summary",{className:"chat-diff-file-path",children:[t?s.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]}),s.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 s.jsx("div",{className:`chat-diff-line ${g}`,children:h||" "},p)})})]},d.path)})}),t&&n?s.jsxs("div",{className:"chat-diff-actions",children:[s.jsxs("button",{className:"admin-refresh-btn",type:"button",disabled:o.size===0,onClick:()=>n([...o]),children:["Commit accepted (",o.size,")"]}),s.jsx("span",{className:"admin-hint",children:"Only accepted files are committed — the agent re-confirms with a question card."})]}):r?s.jsx("div",{className:"chat-diff-actions",children:s.jsxs("span",{className:"admin-hint chat-diff-locked",children:["🔒 ",r]})}):null]})}function z0({text:e,label:t}){const[n,r]=E.useState(!1),i=async()=>{var a;try{await((a=navigator.clipboard)==null?void 0:a.writeText(e)),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return s.jsx("button",{type:"button",className:"chat-card-copy",title:`Copy ${t}`,onClick:()=>void i(),children:n?"✓ Copied":"⧉ Copy"})}function $ge({result:e}){const t=e.verdict==="pass"?"✅":e.verdict==="fail"?"❌":"📋";return s.jsxs("div",{className:`chat-result-card chat-result-${e.verdict}`,children:[s.jsxs("div",{className:"chat-result-head",children:[s.jsx("span",{className:"chat-result-icon",children:t}),s.jsx("span",{className:"chat-result-title",children:e.title}),s.jsx("span",{className:"chat-result-meta",children:e.verdict}),s.jsx(z0,{text:e.body,label:"result output"})]}),s.jsx("pre",{className:"chat-result-body",children:e.body})]})}function Lge({deploy:e}){return s.jsxs("div",{className:"chat-deploy-card",children:[s.jsxs("div",{className:"chat-deploy-head",children:[s.jsx("span",{className:"chat-deploy-icon",children:"🚀"}),s.jsx("span",{className:"chat-deploy-title",children:e.title||"Deployment"}),s.jsx(z0,{text:e.url,label:"deployment URL"})]}),s.jsx("a",{className:"chat-deploy-url",href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.url})]})}function Dge({children:e}){const t=E.useRef(null),n=r=>{if(!t.current)return;const i=Array.from(t.current.querySelectorAll("[data-artifact-card]"));if(i.length===0)return;const a=i.indexOf(document.activeElement);let o=-1;r.key==="ArrowDown"?o=a+1>=i.length?0:a+1:r.key==="ArrowUp"?o=a-1<0?i.length-1:a-1:r.key==="Home"?o=0:r.key==="End"&&(o=i.length-1),o>=0&&o!==a&&(r.preventDefault(),i[o].focus())};return s.jsx("div",{className:"chat-artifacts",ref:t,role:"group","aria-label":"Artifacts",onKeyDown:n,children:e})}function Bge({task:e,onCancel:t}){const n=e.status==="running",r=e.logs.map(i=>YN(i.text)).join(`
204
+ `);return s.jsxs("div",{className:`chat-task-card${n?" chat-task-running":e.status==="done"?" chat-task-ok":" chat-task-err"}`,children:[s.jsxs("div",{className:"chat-task-head",children:[s.jsx("span",{className:"chat-task-icon",children:"⚙️"}),s.jsx("code",{className:"chat-task-cmd",children:e.command}),s.jsx("span",{className:"chat-task-status",title:e.status,children:Ige[e.status]}),!n&&e.exitCode!==null?s.jsxs("span",{className:"chat-task-exit",children:["exit ",e.exitCode]}):null,!n&&e.durationMs!==null?s.jsxs("span",{className:"chat-task-dur",children:[e.durationMs,"ms"]}):null,r?s.jsx(z0,{text:r,label:"task output"}):null,n&&t?s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:t,children:"⏹ Cancel"}):null]}),s.jsx("pre",{className:"chat-task-logs",role:"log",children:e.logs.length>0?e.logs.map((i,a)=>{const o=e.logs[a-1],l=o&&o.stream!==i.stream,c=YN(i.text)||" ";return s.jsxs("div",{children:[l?s.jsx("div",{className:`chat-task-log-sep chat-task-log-sep-${i.stream}`,"aria-hidden":"true",children:i.stream}):null,s.jsx("div",{className:`chat-task-log chat-task-log-${i.stream}`,children:c})]},a)}):s.jsx("div",{className:"admin-hint",children:n?"Waiting for output…":"(no output)"})})]})}function ZN({draft:e,onAccept:t,onReject:n,onEdit:r}){const i=e.status??"pending",a=e.markdown.split(`
205
+ `),o=a.findIndex(c=>c.startsWith("# "))>=0?a.findIndex(c=>c.startsWith("# ")):0,l=a.slice(o,o+14).join(`
206
+ `);return s.jsxs("div",{className:`chat-draft-card${i==="saved"?" chat-draft-saved":""}${i==="rejected"?" chat-draft-rejected":""}`,children:[s.jsxs("div",{className:"chat-draft-head",children:[s.jsx("span",{className:"chat-draft-icon",children:"🧠"}),s.jsxs("span",{className:"chat-draft-title",children:["New skill draft: ",e.name]}),s.jsx("span",{className:"chat-draft-meta",children:"pending your review"})]}),s.jsx("p",{className:"chat-draft-desc",children:e.description}),s.jsx("pre",{className:"chat-draft-body",children:l}),i==="saving"?s.jsx("div",{className:"admin-hint",children:"Saving…"}):i==="saved"?s.jsx("div",{className:"admin-hint",children:"✅ Saved — the skill is live: load it in chat or see it in the Agent Hub Skills tab."}):i==="rejected"?s.jsx("div",{className:"admin-hint",children:"🗑️ Rejected — the draft was discarded, nothing was saved."}):s.jsxs("div",{className:"chat-draft-actions",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>t(e.name),children:"✅ Accept"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>r(e.name),children:"✏️ Edit"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>n(e.name),children:"↩ Reject"})]})]})}function zge({request:e,onSave:t}){const[n,r]=E.useState({}),[i,a]=E.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 s.jsxs("div",{className:"chat-secret-card",children:[s.jsxs("div",{className:"chat-secret-head",children:[s.jsx("span",{className:"chat-secret-icon",children:"🔐"}),s.jsxs("span",{className:"chat-secret-title",children:[e.skillName," needs environment variables"]})]}),l.length>0?s.jsxs("div",{className:"chat-secret-persisted",children:["Already configured: ",l.map(u=>s.jsx("code",{children:u},u)).join(", ")]}):null,c.length>0&&!i?s.jsxs("div",{className:"chat-secret-fields",children:[c.map(u=>s.jsxs("div",{className:"chat-secret-row",children:[s.jsxs("label",{className:"chat-secret-label",htmlFor:`secret-${u}`,children:[u,":"]}),s.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)),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!o,onClick:()=>{t(n),a(!0)},children:"💾 Save to ~/.buff/.env"})]}):i?s.jsx("div",{className:"admin-hint",children:"✅ Saved — the skill will pick up these values on next load."}):s.jsx("div",{className:"admin-hint",children:"All required env vars are already configured."})]})}function Fge({result:e}){const[t,n]=E.useState(!1),r=e.success?"✅":"❌",i=e.success?"Success":`Failed (exit ${e.exitCode})`,a=e.success?"chat-exec-success":"chat-exec-failure",o=new Date(e.timestamp).toLocaleTimeString();return s.jsxs("div",{className:`chat-exec-card ${a}`,children:[s.jsxs("div",{className:"chat-exec-head",onClick:()=>n(!t),style:{cursor:"pointer"},children:[s.jsx("span",{className:"chat-exec-icon",children:"📜"}),s.jsx("span",{className:"chat-exec-title",children:e.skillName}),s.jsxs("span",{className:"chat-exec-status",children:[r," ",i]}),s.jsxs("span",{className:"chat-exec-meta",children:[e.runtime," · ",e.durationMs,"ms · ",o]}),s.jsx("span",{className:"chat-exec-expand",children:t?"▼":"▶"})]}),t&&s.jsxs("div",{className:"chat-exec-body",children:[e.stdout&&s.jsxs("div",{className:"chat-exec-section",children:[s.jsx("div",{className:"chat-exec-section-title",children:"stdout"}),s.jsx("pre",{className:"chat-exec-output",children:e.stdout})]}),e.stderr&&s.jsxs("div",{className:"chat-exec-section chat-exec-stderr",children:[s.jsx("div",{className:"chat-exec-section-title",children:"stderr"}),s.jsx("pre",{className:"chat-exec-output",children:e.stderr})]}),s.jsxs("div",{className:"chat-exec-details",children:[s.jsxs("span",{children:["Runtime: ",e.runtime]}),s.jsxs("span",{children:["Exit code: ",e.exitCode]}),s.jsxs("span",{children:["Duration: ",e.durationMs,"ms"]})]})]})]})}function Uge(e){return e==="done"?"✅":e==="running"?"🔄":e==="blocked"?"⛔":"⬜"}function QN({plan:e}){const t=e.steps.filter(n=>n.status==="done").length;return s.jsxs("div",{className:"chat-plan-card",children:[s.jsxs("div",{className:"chat-plan-head",children:[s.jsx("span",{className:"chat-plan-icon",children:"🗂️"}),s.jsx("span",{className:"chat-plan-goal",children:e.goal}),s.jsxs("span",{className:"chat-plan-count",children:[t,"/",e.steps.length," done"]})]}),s.jsx("div",{className:"chat-plan-steps",children:e.steps.map(n=>s.jsxs("div",{className:`chat-plan-step chat-plan-step-${n.status}`,children:[s.jsx("span",{className:"chat-plan-step-icon",children:Uge(n.status)}),s.jsx("span",{className:"chat-plan-step-text",children:n.description}),s.jsx("span",{className:"chat-plan-step-status",children:n.status})]},n.id))})]})}function JN({tools:e,live:t}){return!e||e.length===0?null:s.jsx("div",{className:`chat-tool-cards${t?" chat-tool-cards-live":""}`,children:e.map(n=>{const r=n.phase==="started"||n.ok===void 0,i=n.ok===!1;return s.jsxs("div",{className:`chat-tool-card${r?" chat-tool-running":i?" chat-tool-err":" chat-tool-ok"}`,children:[s.jsxs("div",{className:"chat-tool-head",children:[s.jsx("span",{className:"chat-tool-icon",children:Rge(n.tool)}),s.jsx("span",{className:"chat-tool-name",children:n.tool}),n.args?s.jsx("code",{className:"chat-tool-args",children:n.args}):null,s.jsx("span",{className:"chat-tool-status",title:r?"running":i?"failed":"done",children:r?"⏳":i?"✗":"✓"}),n.durationMs!==void 0&&!r?s.jsxs("span",{className:"chat-tool-dur",children:[n.durationMs,"ms"]}):null]}),n.error||n.result?s.jsxs("details",{className:"chat-tool-detail",children:[s.jsx("summary",{children:i?"Error":"Result"}),s.jsx("pre",{className:"chat-tool-body",children:n.error||n.result})]}):null]},n.id)})})}function _g(){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 Wge(e,t){const n=t.trim().toLowerCase(),r=n?e.filter(u=>`${u.title} ${u.preview} ${u.firstUser}`.toLowerCase().includes(n)):e,i=[],a=new Date,o=new Date(a.getFullYear(),a.getMonth(),a.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&&i.push({label:u.label,items:d})}return i}function ej(){var Ru,Iu,$u,Ii,Lu;const[e,t]=E.useState(null),[n,r]=E.useState([]),[i,a]=E.useState(""),[o,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(null),[h,p]=E.useState([]),[g,m]=E.useState([]),[v,y]=E.useState(null),[b,x]=E.useState(null),[k,S]=E.useState(null),[w,_]=E.useState([]),[N,C]=E.useState([]),[T,I]=E.useState(null),M=E.useRef([]),$=E.useRef([]),R=E.useRef(null),z=E.useRef(null),D=E.useRef(null),[U,O]=E.useState(""),F=E.useRef(""),A=E.useRef(null),[Z,L]=E.useState(null),P=E.useRef(_g()),ce=E.useRef(""),[we,pe]=E.useState([]),[Pe,G]=E.useState(!0),[X,ae]=E.useState(""),[le,Y]=E.useState(null),[_e,Ee]=E.useState(""),[je,ve]=E.useState([]),[$e,fe]=E.useState(null),[vt,Le]=E.useState(!1),Ae=E.useRef(null),He=E.useRef(null),[Ie,xn]=E.useState(null),[$t,W]=E.useState(null),[V,oe]=E.useState([]),[he,xe]=E.useState(""),[Qe,Lt]=E.useState(""),[Ct,An]=E.useState(!1),[Ot,dt]=E.useState(""),[Tn,Qt]=E.useState([]),[ws,ka]=E.useState(null),[mr,Jt]=E.useState(!1),[q,me]=E.useState([]),[Re,Ce]=E.useState([]),[Fn,Rr]=E.useState(""),gr=E.useRef(null),Fe=E.useRef(null),Ss=E.useRef(null),ei=E.useRef(null),[Ht,Ci]=E.useState(null),[Oi,Pi]=E.useState(new Set);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(B=>{t(B?{configured:B.configured,authenticated:B.authenticated,role:B.role}:{configured:!1,authenticated:!1,role:null})})},[]),E.useEffect(()=>{var B,te;try{(te=(B=Ss.current)==null?void 0:B.scrollTo)==null||te.call(B,{top:Ss.current.scrollHeight})}catch{}},[n,o,h]),E.useEffect(()=>()=>{var B;(B=Fe.current)==null||B.call(Fe),Fe.current=null},[]);const Fp=E.useCallback(async B=>{var ke,ri;(ke=Fe.current)==null||ke.call(Fe),Fe.current=null;const te=await ee.getChatSession(B);if(!te)return;P.current=B,r(te.turns.map(qt=>({role:qt.role,content:qt.content,...qt.role==="assistant"?{followups:[],artifacts:VN(qt.content)}:{}}))),p([]),M.current=[],m([]),$.current=[],y(null),R.current=null,x(null),z.current=null,S(null),D.current=null,F.current="",O(""),L(null),u(""),f(null),I(null),Ci(null),G(!0);const J=te.projectPath;if(J){if(W(J),(Ie==null?void 0:Ie.path)===J)return;(ri=ei.current)==null||ri.call(ei,J)}else W(null)},[Ie]),ul=E.useCallback(()=>{var B;(B=Fe.current)==null||B.call(Fe),Fe.current=null,P.current=_g(),W(null),r([]),p([]),M.current=[],m([]),$.current=[],y(null),R.current=null,x(null),z.current=null,S(null),D.current=null,F.current="",O(""),L(null),u(""),f(null),I(null),Ci(null),ve([]),fe(null),a(""),G(!0)},[]),ks=E.useCallback(B=>{ve(te=>[...te,B].slice(-10))},[]),Up=E.useCallback(B=>{ve(te=>te.filter((J,ke)=>ke!==B))},[]),Ou=E.useCallback(async B=>{if(!B)return;if(B.size>XN){u(`Attachment "${B.name}" is too large (max ${Math.round(XN/1024)} KB).`);return}const te=await B.text();ks({name:B.name,content:te,kind:"file"})},[ks]),Wp=E.useCallback(B=>{const te=B.currentTarget,J=B.clipboardData.getData("text")||"";J.length>=Mge&&(He.current={start:te.selectionStart,end:te.selectionEnd},fe({text:J}))},[]),Hp=E.useCallback(()=>{const B=$e;if(!B)return;const te=He.current;a(J=>te?J.slice(0,te.start)+J.slice(te.end):J),ks({name:"pasted-text.txt",content:B.text,kind:"paste"}),fe(null),He.current=null},[$e,ks]),dl=E.useCallback(B=>{Y(B.id),Ee(B.title==="(untitled conversation)"?"":B.title)},[]),Pu=E.useCallback(async B=>{const te=await ee.renameChatSession(B,_e);te.ok?pe(J=>J.map(ke=>ke.id===B?{...ke,title:_e.trim()||ke.title}:ke)):u(te.error||"Could not rename the session."),Y(null),Ee("")},[_e]),Mu=E.useCallback(async B=>{const te=await ee.deleteChatSession(B);te.ok?(pe(J=>J.filter(ke=>ke.id!==B)),P.current===B&&ul()):u(te.error||"Could not delete the session.")},[ul]),fl=(e==null?void 0:e.authenticated)===!0&&(e.role==="admin"||e.role==="operator");E.useEffect(()=>{fl&&(ee.listChatSessions().then(B=>{Array.isArray(B)&&pe(B)}),ee.listProjects().then(B=>{Array.isArray(B)&&oe(B)}))},[fl]);const yr=E.useCallback(async B=>{const te=B.trim();if(!te)return;Lt("");const J=await ee.attachProject(te);if(J.ok&&J.project){xn(J.project),xe("");const ke=await ee.listProjects();Array.isArray(ke)&&oe(ke)}else Lt(J.error||"Could not attach that directory.")},[]);ei.current=yr;const Es=E.useCallback(async B=>{An(!0),Jt(!0),Rr("");const te=await ee.browseDirectories(B,{showDrives:!B});te.ok&&(dt(te.path),Qt(te.entries),ka(te.parent),te.drives&&me(te.drives),te.breadcrumbs&&Ce(te.breadcrumbs)),Jt(!1)},[]),Ea=E.useCallback(async B=>{Jt(!0),Rr("");const te=await ee.browseDirectories(B);te.ok&&(dt(te.path),Qt(te.entries),ka(te.parent),te.breadcrumbs&&Ce(te.breadcrumbs)),Jt(!1)},[]),_s=E.useCallback(async()=>{if(!Ot)return;const B=await ee.browseDirectories(Ot);B.ok&&Qt(B.entries)},[Ot]);E.useEffect(()=>ee.onChatRetryEvent(te=>{if(te.sessionId!==P.current){ee.listChatSessions().then(J=>{Array.isArray(J)&&pe(J)});return}r(J=>[...J,{role:"assistant",content:te.content}]),te.kind==="answer"&&L(null)}),[]),E.useEffect(()=>(Ct&&Ot&&(gr.current=setInterval(()=>{_s()},5e3)),()=>{gr.current&&clearInterval(gr.current)}),[Ct,Ot,_s]);const hl=E.useCallback(async()=>{if(typeof window<"u"&&"showDirectoryPicker"in window)try{const J=(await window.showDirectoryPicker({mode:"read"})).name;if(!J){Es();return}Lt(""),l(!0);const ke=await ee.resolveFolder(J);l(!1),ke.ok&&ke.path?(xe(ke.path),yr(ke.path)):Lt('Folder "'+J+'" 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}Es()},[Es,yr]),Je=E.useCallback(async(B,te)=>{var vr,On;const J=B.trim(),ke=Array.isArray(te)?te:je,ri=!Array.isArray(te)&&(te==null?void 0:te.skipResolve)===!0;if(!J&&ke.length===0||o)return;if(u(""),f(null),p([]),M.current=[],m([]),$.current=[],y(null),R.current=null,x(null),z.current=null,S(null),D.current=null,r(Se=>[...Se,{role:"user",content:J,attachments:ke.length>0?ke:void 0}]),a(""),ve([]),fe(null),ce.current=J||`[${ke.length} attachment(s)]`,l(!0),G(!1),!ri){const ft=((await ee.chatResolve(J)).matches??[])[0]??null;if(ft&&ft.command&&!ft.ambiguous&&ft.score>=.6){I({ask:J,top:ft}),l(!1);return}if(ft&&ft.ambiguous&&!T){I({ask:J,top:ft}),l(!1);return}}const qt=P.current,Cn=new AbortController;A.current=Cn,L(null),(vr=Fe.current)==null||vr.call(Fe),Fe.current=ee.subscribeChat(qt,{onToken:Se=>{F.current+=Se,O(F.current)},onProgress:Se=>{M.current=[...M.current,Se],p(M.current)},onQuestion:Se=>{Ci(Se),Pi(new Set)},onTool:Se=>{const Ue=[...$.current],ft=Ue.findIndex(on=>on.id===Se.id),wt={id:Se.id,tool:Se.tool,phase:Se.phase,args:Se.args,ok:Se.ok,result:Se.result,error:Se.error,durationMs:Se.durationMs};ft>=0?Ue[ft]=wt:Ue.push(wt),$.current=Ue,m(Ue)},onPlan:Se=>{const Ue={goal:Se.goal,steps:Se.steps,revision:Se.revision};R.current=Ue,y(Ue)},onDiff:Se=>{const Ue={files:Se.files,summary:Se.summary};z.current=Ue,x(Ue)},onSkillDraft:Se=>{const Ue={name:Se.name,description:Se.description,markdown:Se.markdown,updatedAt:Se.updatedAt,status:"pending"};D.current=Ue,S(Ue)},onSecretRequest:Se=>{_(Ue=>{const ft=Ue.findIndex(wt=>wt.skillName===Se.skillName);if(ft>=0){const wt=[...Ue];return wt[ft]=Se,wt}return[...Ue,Se]})},onExecutionResult:Se=>{C(Ue=>[...Ue,Se])}});const en=await ee.chatSend(qt,J||`(see ${ke.length} attachment${ke.length===1?"":"s"})`,{projectPath:Ie==null?void 0:Ie.path,attachments:ke.map(Se=>({name:Se.name,content:Se.content,kind:Se.kind}))},Cn.signal);if(A.current=null,(On=Fe.current)==null||On.call(Fe),Fe.current=null,F.current="",O(""),en.ok){f(en.generationFailed?null:`${en.provider??"provider"}${en.model?` / ${en.model}`:" (auto-routed)"}`),L(en.generationFailed&&!en.retryQueued?J:null);const Se=en.content||"(the agent produced no text — try rephrasing)";r(Ue=>[...Ue,{role:"assistant",content:Se,error:en.generationFailed,followups:en.followups,steps:M.current,tools:$.current,plan:R.current,diff:z.current,draft:D.current,artifacts:VN(Se)}])}else Cn.signal.aborted?(u(""),L(null)):en.unauthorized?(t(Se=>Se&&{...Se,authenticated:!1}),u("Session expired — log in again to chat.")):(u(en.error||"The agent could not answer — check that a provider API key is set for the dashboard process."),L(J));l(!1),G(!0)},[o,Ie,je]),pl=E.useCallback(()=>{var B;(B=A.current)==null||B.abort()},[]),_a=E.useCallback(async B=>{S(J=>J&&{...J,status:"saving"});const te=await ee.skillDraftAccept(B);S(J=>J&&{...J,status:te.ok?"saved":"error"}),te.ok||u(te.error||"Could not accept the draft.")},[]),ml=E.useCallback(async B=>{const te=await ee.skillDraftReject(B);te.ok?S(J=>J&&{...J,status:"rejected"}):u(te.error||"Could not reject the draft.")},[]),gl=E.useCallback(B=>{Je(`Revise the skill draft "${B}" — improve it per your best judgment and present it again.`)},[Je]),Mi=E.useCallback(async B=>{const te=await ee.saveSecrets(B);if(!te.ok){u(te.error||"Could not save secrets.");return}const J=te.refused??[];J.length>0&&u(J.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(" "))},[]),yl=E.useCallback(async B=>{const ke=((await ee.chatResolve(B)).matches??[])[0]??null;if(!(ke!=null&&ke.command)){I(null);return}I(null),l(!0);const ri=ke.command.split(/\s+/),qt=await ee.startTask(ri,6e4);if(!qt.ok||!qt.task){u(qt.error||"The command could not be started."),l(!1);return}const Cn=qt.task.id,en={id:Cn,command:ke.command,status:qt.task.status,exitCode:qt.task.exitCode,durationMs:qt.task.durationMs,logs:qt.task.logs??[]};r(ft=>[...ft,{role:"assistant",content:"",task:en}]);const vr=ft=>r(wt=>wt.map(on=>on.task&&on.task.id===Cn?{...on,task:{...on.task,...ft}}:on));let On=null;On=ee.subscribeTask(Cn,{onLog:ft=>r(wt=>wt.map(on=>on.task&&on.task.id===Cn?{...on,task:{...on.task,logs:[...on.task.logs,ft]}}:on)),onStatus:ft=>{vr({status:ft}),ft!=="running"&&(ee.getTask(Cn).then(wt=>{wt!=null&&wt.task&&vr({exitCode:wt.task.exitCode,durationMs:wt.task.durationMs,logs:wt.task.logs??[]})}),On==null||On(),l(!1))}});const Se=await ee.getTask(Cn);Se!=null&&Se.task&&vr({status:Se.task.status,exitCode:Se.task.exitCode,durationMs:Se.task.durationMs,logs:Se.task.logs??[]});const Ue=await ee.getTask(Cn);Ue!=null&&Ue.task&&Ue.task.status!=="running"&&(On==null||On(),vr({status:Ue.task.status,exitCode:Ue.task.exitCode,durationMs:Ue.task.durationMs,logs:Ue.task.logs??[]}),l(!1))},[]),Ri=E.useCallback(B=>{I(null),Je(B,{skipResolve:!0})},[Je]),Ns=E.useCallback(B=>{if(B.length===0)return;const te=Ie?` in the attached project ${Ie.path}`:"";Je(`Commit exactly these files that I accepted on the diff card (and nothing else)${te}: ${B.join(", ")}. Show me a short confirmation before finishing.`)},[Je,Ie]),js=E.useCallback(async B=>{await ee.cancelTask(B)},[]),ti=E.useCallback(async B=>{const te=Ht;if(!te)return;Ci(null);const J=await ee.chatRespond(P.current,te.questionId,B);J.ok||u(J.error||"The question could not be answered — try sending your message again.")},[Ht]),ni=E.useCallback(()=>{if(!Ht)return;const B=Ht.multiSelect?[...Oi]:[...Oi][0];Ht.multiSelect?ti({index:[...Oi]}):ti(B!==void 0?{index:B}:{index:-1})},[Ht,Oi,ti]),Gp=E.useCallback(()=>{Ht&&ti({index:-1})},[Ht,ti]),qp=E.useCallback(B=>{Pi(te=>{const J=new Set(te);return Ht!=null&&Ht.multiSelect?J.has(B)?J.delete(B):J.add(B):(J.clear(),J.add(B)),J})},[Ht]),Ir=E.useCallback(async()=>{var te;(te=Fe.current)==null||te.call(Fe),Fe.current=null,P.current=_g(),r([]),p([]),M.current=[],m([]),$.current=[],y(null),R.current=null,x(null),z.current=null,S(null),D.current=null,F.current="",O(""),L(null),u(""),f(null),I(null),Ci(null);const B=await ee.listChatSessions();Array.isArray(B)&&pe(B)},[]),Gt=((Ru=[...n].reverse().find(B=>{var te;return B.role==="assistant"&&!B.error&&(((te=B.followups)==null?void 0:te.length)??0)>0}))==null?void 0:Ru.followups)??[];return s.jsxs("div",{className:"panel",children:[s.jsxs("div",{className:"panel-header",children:[s.jsx("h2",{children:"💬 Chat with the agent"}),s.jsxs("div",{className:"chat-head-actions",children:[d?s.jsx("span",{className:"admin-hint",children:d}):null,s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void Ir(),disabled:o||n.length===0,children:"🗑 New conversation"})]})]}),e!=null&&e.authenticated?fl?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-project-bar",children:Ie?s.jsxs("div",{className:"chat-project-attached",children:[s.jsx("span",{className:"chat-project-icon",children:"📁"}),s.jsx("span",{className:"chat-project-name",children:Ie.name}),s.jsxs("span",{className:"chat-project-meta",children:[Ie.fileCount," files · ",Ie.symbolCount," symbols",Ie.truncated?" · truncated map":""]}),s.jsx("span",{className:"chat-project-path",title:Ie.path,children:Ie.path}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>xn(null),children:"✕ detach"})]}):s.jsxs("div",{className:"chat-project-pick",children:[s.jsx("span",{className:"chat-project-icon",children:"📁"}),s.jsx("span",{className:"chat-project-hint",children:"Select Project Folder"}),V.length>0?s.jsx("span",{className:"chat-project-chips",children:V.filter(B=>B.kind!=="cwd").slice(0,3).map(B=>s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void yr(B.path),children:B.name},B.path))}):null,s.jsx("input",{className:"chat-project-input",value:he,onChange:B=>xe(B.target.value),onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),yr(he))},placeholder:"or type a path, e.g. ~/code/my-app",disabled:o}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void yr(he),disabled:o||!he.trim(),children:"Attach"}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void hl(),title:"Pick a project folder using your system's folder picker (Finder / Explorer)",children:"🗂️ Browse"}),Qe?s.jsx("span",{className:"chat-project-error",children:Qe}):null,Ct?s.jsxs("div",{className:"chat-browse-popover",children:[s.jsxs("div",{className:"chat-browse-head",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>An(!1),title:"Close",children:"✕"}),s.jsx("div",{className:"chat-browse-breadcrumbs",children:q.length>0&&!Ot?s.jsx("span",{className:"admin-hint",children:"Select a drive or home folder:"}):s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void Es(),children:"🏠"}),Re.map((B,te)=>s.jsxs("span",{children:[s.jsx("span",{className:"chat-breadcrumb-sep",children:"/"}),s.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void Ea(B.path),children:B.name})]},B.path))]})})]}),q.length>0&&!Ot?s.jsx("div",{className:"chat-browse-drives",children:q.map(B=>s.jsx("button",{type:"button",className:"chat-browse-drive",onClick:()=>void Ea(B.path),children:B.name},B.path))}):null,Tn.length>5?s.jsx("div",{className:"chat-browse-search",children:s.jsx("input",{type:"text",className:"chat-browse-filter",placeholder:"🔍 Filter folders…",value:Fn,onChange:B=>Rr(B.target.value),autoFocus:!0})}):null,s.jsx("div",{className:"chat-browse-list",children:mr?s.jsx("span",{className:"admin-hint",children:"Loading…"}):Tn.length===0?s.jsx("span",{className:"admin-hint",children:"No subdirectories found"}):Tn.filter(B=>!Fn||B.name.toLowerCase().includes(Fn.toLowerCase())).map(B=>s.jsxs("button",{type:"button",className:"chat-browse-entry",onClick:()=>void Ea(B.path),children:[s.jsx("span",{className:"chat-browse-entry-icon",children:"📁"}),s.jsx("span",{className:"chat-browse-entry-name",children:B.name}),B.modified?s.jsx("span",{className:"chat-browse-entry-date",children:new Date(B.modified).toLocaleDateString()}):null]},B.path))}),s.jsxs("div",{className:"chat-browse-foot",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void _s(),title:"Refresh folder list",children:"🔄"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>{An(!1),yr(Ot)},disabled:!Ot,children:"📁 Select this folder"})]})]}):null]})}),$t&&(!Ie||Ie.path!==$t)?s.jsxs("div",{className:"chat-session-project-banner",children:[s.jsxs("span",{children:["⚠️ This conversation was working in ",s.jsx("code",{children:$t})]}),Ie?s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void yr($t),children:"📁 Switch to it"}):s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void yr($t),children:"📁 Attach it"})]}):null,s.jsxs("div",{className:"chat-layout",children:[Pe?s.jsxs("div",{className:"chat-sidebar",children:[s.jsxs("div",{className:"chat-sidebar-head",children:[s.jsx("span",{children:"📁 Sessions"}),s.jsxs("div",{className:"chat-sidebar-head-actions",children:[s.jsx("button",{type:"button",className:"chat-mini-action",title:"New chat",onClick:ul,children:"+ New"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Collapse history",onClick:()=>G(!1),children:"▸"})]})]}),s.jsx("input",{className:"chat-session-search",placeholder:"Search conversations…",value:X,onChange:B=>ae(B.target.value)}),we.length===0?s.jsx("div",{className:"chat-sidebar-empty",children:"No past conversations yet."}):s.jsx("div",{className:"chat-sidebar-list",children:Wge(we,X).map(({label:B,items:te})=>s.jsxs("div",{className:"chat-session-group",children:[s.jsx("div",{className:"chat-session-group-label",children:B}),te.map(J=>s.jsx("div",{className:`chat-session-item${J.id===P.current?" chat-session-active":""}`,children:le===J.id?s.jsxs("div",{className:"chat-session-rename",children:[s.jsx("input",{autoFocus:!0,value:_e,onChange:ke=>Ee(ke.target.value),onKeyDown:ke=>{ke.key==="Enter"&&Pu(J.id),ke.key==="Escape"&&Y(null)},placeholder:"Session title"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>void Pu(J.id),children:"✓"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"chat-session-main",onClick:()=>void Fp(J.id),title:J.preview||J.title,children:[s.jsx("span",{className:"chat-session-title",children:J.title}),s.jsx("span",{className:"chat-session-preview",children:J.firstUser||J.preview}),s.jsxs("span",{className:"chat-session-meta",children:[J.projectPath?`📁 ${J.projectPath.split("/").pop()} · `:"",J.turnCount," msg",J.turnCount===1?"":"s"," · ",new Date(J.updatedAt).toLocaleString()]})]}),s.jsxs("span",{className:"chat-session-actions",children:[s.jsx("button",{type:"button",className:"chat-mini-action",title:"Rename",onClick:()=>dl(J),children:"✏️"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Delete",onClick:()=>void Mu(J.id),children:"🗑"})]})]})},J.id))]},B))})]}):s.jsx("div",{className:"chat-rail",children:s.jsx("button",{type:"button",className:"chat-rail-btn",onClick:()=>G(!0),title:"Show history",children:"📁"})}),s.jsxs("div",{className:"chat-main",children:[s.jsxs("div",{className:"chat-thread",ref:Ss,role:"log","aria-live":"polite",children:[n.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("p",{className:"empty-state-title",children:"Say anything — the agent decides what to do (answer, fix code, plan, run the pipeline)."}),s.jsxs("div",{className:"empty-state-chips",children:[s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("what's the state of this project?"),children:"📋 assess this project"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("run the test suite"),children:"🧪 run the tests"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("stop the gateway"),children:"⏹ stop the gateway"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("load the code-assessment skill and assess this project"),children:"🧠 load the code-assessment skill"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("learn the workflow I just did as a skill"),children:"📚 learn a workflow as a skill"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Je("publish the current version"),children:"🚀 publish the release"})]})]}):n.map((B,te)=>s.jsxs("div",{className:`chat-bubble chat-${B.role}${B.error?" chat-error":""}`,children:[s.jsx("div",{className:"chat-bubble-role",children:B.role==="user"?"You":"🤖 Agent"}),B.role==="assistant"?s.jsx("div",{className:"chat-bubble-text",children:s.jsx(HN,{text:B.content})}):s.jsx("div",{className:"chat-bubble-text",children:B.content}),B.role==="user"&&B.attachments&&B.attachments.length>0?s.jsxs("details",{className:"chat-steps",open:B.attachments.length===1,children:[s.jsxs("summary",{children:["📎 ",B.attachments.length," attachment",B.attachments.length===1?"":"s",":"," ",B.attachments.map(J=>J.name).join(", ")]}),B.attachments.map((J,ke)=>s.jsxs("div",{className:"chat-attach-content",children:[s.jsxs("div",{className:"admin-hint",children:[J.name," — ",J.content.length.toLocaleString()," chars"]}),s.jsx("pre",{children:J.content})]},ke))]}):null,B.role==="assistant"&&B.diff?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Changes: ",B.diff.summary]}),s.jsx(Td,{diff:B.diff,selectable:!0,onCommitAccepted:Ns})]}):null,B.role==="assistant"&&B.artifacts&&(B.artifacts.diffs.length>0||B.artifacts.results.length>0||B.artifacts.deploys.length>0)?s.jsxs(Dge,{children:[B.artifacts.diffs.map((J,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Diff: ${J.summary}`,className:"chat-artifact-item",children:Ie?s.jsx(Td,{diff:J,selectable:!0,onCommitAccepted:Ns}):s.jsx(Td,{diff:J,lockedHint:"Attach a project to review and commit these changes."})},`diff-${ke}`)),B.artifacts.results.map((J,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Result: ${J.title}`,className:"chat-artifact-item",children:s.jsx($ge,{result:J})},`result-${ke}`)),B.artifacts.deploys.map((J,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Deployment: ${J.url}`,className:"chat-artifact-item",children:s.jsx(Lge,{deploy:J})},`deploy-${ke}`))]}):null,B.role==="assistant"&&B.task?s.jsx(Bge,{task:B.task,onCancel:B.task.status==="running"?()=>void js(B.task.id):void 0}):null,B.role==="assistant"&&B.draft?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Skill draft: ",B.draft.name]}),s.jsx(ZN,{draft:B.draft,onAccept:_a,onReject:ml,onEdit:gl})]}):null,B.role==="assistant"&&B.plan?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Plan: ",B.plan.goal]}),s.jsx(QN,{plan:B.plan})]}):null,B.role==="assistant"&&B.tools&&B.tools.length>0?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:[B.tools.length," tool call",B.tools.length===1?"":"s"]}),s.jsx(JN,{tools:B.tools})]}):null,B.role==="assistant"&&B.steps&&B.steps.length>0?s.jsxs("details",{className:"chat-steps",children:[s.jsxs("summary",{children:[B.steps.length," step",B.steps.length===1?"":"s"]}),s.jsx("div",{className:"chat-step-line",children:B.steps.map((J,ke)=>s.jsx("div",{children:J.trim()},ke))})]}):null]},te)),o?s.jsxs("div",{className:"chat-bubble chat-assistant",children:[s.jsx("div",{className:"chat-bubble-role",children:"🤖 Agent"}),v?s.jsx(QN,{plan:v}):null,b?s.jsx(Td,{diff:b}):null,k?s.jsx(ZN,{draft:k,onAccept:_a,onReject:ml,onEdit:gl}):null,w.map(B=>s.jsx(zge,{request:B,onSave:Mi},B.skillName)),N.map((B,te)=>s.jsx(Fge,{result:B},`${B.skillName}-${te}`)),s.jsx(JN,{tools:g,live:!0}),U?s.jsx("div",{className:"chat-bubble-text chat-streaming",children:s.jsx(HN,{text:U})}):null,s.jsx("div",{className:"chat-working",children:h.length>0?s.jsx("span",{className:"chat-working-lines",children:h.map((B,te)=>s.jsx("div",{className:"chat-step-line",children:B.trim()},te))}):s.jsxs(s.Fragment,{children:["💭 thinking… ",s.jsx("span",{className:"chat-dots"})]})})]}):null]}),c?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:c}):null,Z&&!o?s.jsxs("div",{className:"chat-retry-row",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void Je(Z),children:"↻ Retry"}),s.jsx("span",{className:"admin-hint",children:"Re-send the last message — the turn failed."})]}):null,T&&!o?s.jsx("div",{className:"chat-resolve-card",children:(Iu=T.top)!=null&&Iu.ambiguous&&(($u=T.top.options)!=null&&$u.length)?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"chat-resolve-head",children:[s.jsx("strong",{children:"🤔 Which do you mean?"}),' — "',T.ask,'" maps to more than one action.']}),s.jsx("div",{className:"chat-resolve-options",children:T.top.options.map(B=>s.jsxs("button",{className:"chat-chip",type:"button",onClick:()=>void Je(B.command),children:[B.summary," — ",s.jsx("code",{children:B.command})]},B.command))}),s.jsx("div",{className:"chat-resolve-foot",children:s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{I(null)},children:"✕ Not that — ask the agent"})})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"chat-resolve-head",children:[s.jsx("strong",{children:"⚡ Run this command?"}),' — "',T.ask,'"']}),s.jsx("div",{className:"chat-resolve-cmd",children:s.jsx("code",{children:(Ii=T.top)==null?void 0:Ii.command})}),(Lu=T.top)!=null&&Lu.confirmation?s.jsx("div",{className:"admin-hint",children:"⚠ This changes running services/state."}):null,s.jsxs("div",{className:"chat-resolve-foot",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void yl(T.ask),children:"▶ Run"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>Ri(T.ask),children:"✕ No — ask the agent"})]})]})}):null,Ht?s.jsxs("div",{className:"chat-resolve-card chat-question-card",children:[s.jsx("div",{className:"chat-resolve-head",children:s.jsxs("strong",{children:["🤔 ",Ht.question]})}),s.jsx("div",{className:"chat-resolve-options",children:Ht.choices.map((B,te)=>s.jsxs("button",{type:"button",className:`chat-chip${Oi.has(te)?" chat-chip-selected":""}`,onClick:()=>qp(te),children:[B.label,B.description?s.jsxs("span",{className:"admin-hint",children:[" — ",B.description]}):null]},`${B.label}-${te}`))}),s.jsxs("div",{className:"chat-resolve-foot",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:ni,children:Ht.multiSelect?"Submit":"Choose"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:Gp,children:"Skip — best judgment"})]})]}):null,Gt.length>0&&!o?s.jsxs("div",{className:"chat-followups",children:[s.jsx("span",{className:"admin-hint",children:"Next steps:"}),Gt.map((B,te)=>s.jsx("button",{className:"chat-chip",type:"button",onClick:()=>void Je(B.prompt),children:B.label||B.prompt},te))]}):null,s.jsxs("form",{className:`chat-composer${vt?" chat-composer-drag":""}`,onSubmit:B=>{B.preventDefault(),Je(i)},onDragOver:B=>{B.preventDefault(),Le(!0)},onDragLeave:()=>Le(!1),onDrop:B=>{var J;B.preventDefault(),Le(!1);const te=Array.from(((J=B.dataTransfer)==null?void 0:J.files)??[]);for(const ke of te.slice(0,10))Ou(ke)},children:[$e?s.jsxs("div",{className:"chat-paste-offer",children:[s.jsxs("span",{className:"admin-hint",children:["📄 You pasted ",$e.text.length.toLocaleString()," characters. Attach it as a file instead?"]}),s.jsx("button",{type:"button",className:"chat-chip",onClick:Hp,children:"Attach as text"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>{fe(null),He.current=null},children:"Keep inline"})]}):null,je.length>0?s.jsx("div",{className:"chat-attach-row",children:je.map((B,te)=>s.jsxs("span",{className:"chat-attach-chip",title:`${B.name} (${B.content.length.toLocaleString()} chars)`,children:["📎 ",B.name,s.jsxs("span",{className:"admin-hint",children:[" ",B.content.length.toLocaleString(),"c"]}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>Up(te),children:"✕"})]},`${B.name}-${te}`))}):null,s.jsxs("div",{className:"chat-input-row",children:[s.jsx("input",{ref:Ae,type:"file",style:{display:"none"},onChange:B=>{var J;const te=(J=B.target.files)==null?void 0:J[0];te&&Ou(te),B.target.value=""}}),s.jsx("button",{type:"button",className:"chat-attach-btn",title:"Attach a file (up to 300 KB, text only)",disabled:o||je.length>=10,onClick:()=>{var B;return(B=Ae.current)==null?void 0:B.click()},children:"📎"}),s.jsx("textarea",{className:"chat-input-box",value:i,onChange:B=>a(B.target.value),onPaste:Wp,onKeyDown:B=>{B.key==="Enter"&&!B.shiftKey?(B.preventDefault(),Je(i)):B.key==="ArrowUp"&&i===""&&ce.current&&(B.preventDefault(),a(ce.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?s.jsx("button",{className:"admin-mini-btn chat-cancel-btn",type:"button",onClick:pl,children:"⏹ Cancel"}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||!i.trim()&&je.length===0,children:o?"⏳ Working…":"➤ Send"})]})]}),s.jsxs("p",{className:"admin-hint",children:["Each message runs the full agent loop in the dashboard process (same engine as"," ",s.jsx("code",{children:'buff chat "<prompt>"'}),") — the provider API keys must be configured in the dashboard process. Clarifications (",s.jsx("code",{children:"ask_user"}),") appear as a question card here — choose an answer or skip (best judgment)."]})]})]})]}):s.jsx("div",{className:"admin-login-hint",children:s.jsx("p",{children:"Your role can view the dashboard but not chat (requires admin or operator)."})}):s.jsxs("div",{className:"admin-login-hint",children:[s.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?s.jsxs("p",{className:"admin-hint",children:["Run ",s.jsx("code",{children:"buff dashboard"})," once, or set ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," / ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"}),"."]}):null]})]})}const Hge={running:"⏳ running",done:"✅ done",failed:"❌ failed",cancelled:"⏹ cancelled",timeout:"⏰ timed out",error:"💥 error"};function o2({presets:e,customPlaceholder:t,timeoutMs:n=3e5,hint:r}){const[i,a]=E.useState(null),[o,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(""),[h,p]=E.useState(null),[g,m]=E.useState([]),v=E.useRef(null),y=E.useRef(null);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(S=>{a(S?{authenticated:S.authenticated,role:S.role}:{authenticated:!1,role:null})})},[]),E.useEffect(()=>{var S,w;try{(w=(S=v.current)==null?void 0:S.scrollIntoView)==null||w.call(S,{block:"end"})}catch{}},[g]),E.useEffect(()=>()=>{var S;(S=y.current)==null||S.call(y)},[]);const b=(i==null?void 0:i.authenticated)===!0&&(i.role==="admin"||i.role==="operator"),x=E.useCallback(async(S,w)=>{var T;if(o)return;l(!0),u(""),m([]);const _=await ee.startTask(S,w??n);if(!_.ok||!_.task){u(_.error||"Could not start the command."),l(!1);return}const N=_.task;p(N);const C=await ee.getTask(N.id);C!=null&&C.task&&m(C.task.logs.map(I=>({stream:I.stream,text:I.text}))),(T=y.current)==null||T.call(y),y.current=ee.subscribeTask(N.id,{onLog:I=>m(M=>[...M,{stream:I.stream,text:I.text}]),onStatus:I=>{p(M=>M&&{...M,status:I}),I!=="running"&&l(!1)}})},[o,n]),k=E.useCallback(async()=>{h&&await ee.cancelTask(h.id)},[h]);return s.jsxs("div",{className:"ops-console",children:[i!=null&&i.authenticated?b?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"ops-presets",children:e.map(S=>s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void x(S.args,S.timeoutMs),disabled:o,children:S.label},S.label))}),s.jsxs("div",{className:"ops-custom-row",children:[s.jsx("input",{type:"text",value:d,onChange:S=>f(S.target.value),placeholder:t,disabled:o,maxLength:160}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void x(d.trim().split(/\s+/)),disabled:o||!d.trim(),children:"Run"})]}),r?s.jsx("p",{className:"admin-hint",children:r}):null]}):s.jsx("div",{className:"admin-login-hint",children:"Your role can view but not run commands (requires admin or operator)."}):s.jsx("div",{className:"admin-login-hint",children:"Log in (admin or operator) to run commands."}),c?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:c}):null,h?s.jsxs("div",{className:"ops-console-box",children:[s.jsxs("div",{className:"ops-console-head",children:[s.jsxs("span",{children:[h.command," · ",s.jsx("span",{className:h.status==="running"?"task-status-running":"",children:Hge[h.status]})]}),h.status==="running"?s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void k(),children:"⏹ Cancel"}):null]}),s.jsxs("pre",{className:"ops-console",role:"log",children:[g.length>0?g.map((S,w)=>s.jsx("div",{children:S.text},w)):s.jsx("div",{className:"admin-hint",children:"Waiting for output…"}),s.jsx("div",{ref:v})]})]}):null]})}const Gge=[{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 tj(e){return typeof e!="number"?"—":`${Math.round(e*100)}%`}function qge(e){return new Date(e).toLocaleString()}function Kge({data:e}){var n;const t=((n=e==null?void 0:e.evals)==null?void 0:n.runs)??[];return s.jsxs("div",{className:"panel",children:[s.jsx("div",{className:"panel-header",children:s.jsx("h2",{children:"🏆 Evals — run buff eval from the GUI"})}),s.jsx(o2,{presets:Gge,customPlaceholder:"e.g. eval run --tasks my-task --provider groq --model llama",timeoutMs:9e5,hint:s.jsxs(s.Fragment,{children:["Runs the real ",s.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."]})}),s.jsx("h3",{className:"section-subtitle",children:"📜 Past runs (auto-refreshes)"}),t.length>0?s.jsx("div",{className:"admin-table-wrapper",children:s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Provider"}),s.jsx("th",{children:"Model"}),s.jsx("th",{children:"Tasks"}),s.jsx("th",{children:"Pass"}),s.jsx("th",{children:"Completion"}),s.jsx("th",{children:"Composite"}),s.jsx("th",{children:"Cost"})]})}),s.jsx("tbody",{children:t.map(r=>s.jsxs("tr",{children:[s.jsx("td",{children:qge(r.startedAt)}),s.jsx("td",{className:"admin-provider-type",children:r.provider}),s.jsx("td",{children:r.model}),s.jsx("td",{children:r.summary.totalTasks}),s.jsxs("td",{children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),s.jsx("td",{children:tj(r.summary.completionRate)}),s.jsx("td",{children:tj(r.summary.avgCompositeScore)}),s.jsxs("td",{children:["$",(r.summary.totalCostUsd??0).toFixed(4)]})]},r.id))})]})}):s.jsx("div",{className:"empty-state",children:"No eval runs yet — start one above (or `buff eval run` from the CLI)."})]})}const Vge=[{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 Yge(){return s.jsxs("div",{className:"panel",children:[s.jsx("div",{className:"panel-header",children:s.jsx("h2",{children:"🌐 Gateway ops — run buff gateway from the GUI"})}),s.jsx(o2,{presets:Vge,customPlaceholder:"e.g. admin cron run nightly or gateway alias add ops email:team@example.com",timeoutMs:3e5,hint:s.jsxs(s.Fragment,{children:["Each command runs as the real CLI in an isolated process (the P1 task runner) — the same engine as your terminal. ",s.jsx("code",{children:"gateway start"})," runs in the foreground ",s.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 ",s.jsx("strong",{children:"Cancel"}),". The delivery ledger also has its own view in"," ",s.jsx("strong",{children:"Agent Hub → Channels"}),"."]})})]})}const Ng={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 Xge(){const[e,t]=E.useState(null),[n,r]=E.useState("all"),[i,a]=E.useState(null),[o,l]=E.useState(0),[c,u]=E.useState({}),[d,f]=E.useState(!1),[h,p]=E.useState(null),[g,m]=E.useState({status:"idle"}),[v,y]=E.useState(""),[b,x]=E.useState("Hello from agent-nuvira!"),[k,S]=E.useState(!1),[w,_]=E.useState(null),N=E.useRef(!0),C=E.useCallback(async()=>{const O=await ee.getPlatformConfigs();N.current&&t(O)},[]);E.useEffect(()=>(C(),()=>{N.current=!1}),[C]);const T=O=>{a(O),l(0),u(Object.fromEntries(O.envVars.map(A=>[A.varName,A.value]))),p(null),m({status:"idle"});const F=Ng[O.platform];y((F==null?void 0:F.testTarget)??""),x("Hello from agent-nuvira!"),_(null)},I=async()=>{if(!i)return;m({status:"checking"});const O=await ee.verifyPlatformConfig(i.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."}))},M=async()=>{if(!i)return;f(!0),p(null);const O=await ee.setPlatformConfig(i.platform,c);f(!1),O.ok?(p({kind:"ok",text:"Token saved! Verifying..."}),C(),l(2),I()):p({kind:"err",text:O.error||"Save failed."})},$=async()=>{if(!i||!v)return;S(!0),_(null);const O=await ee.sendChannelMessage(v,b);S(!1),O.ok?_({kind:"ok",text:"Message sent via "+O.platform+"! Check your "+i.label+" app."}):_({kind:"err",text:O.error||"Send failed. Make sure the gateway is running (Gateway tab)."})};if(e===null)return s.jsx("div",{className:"empty-state",children:"Loading platforms..."});const R=e.filter(O=>O.configured).length,z=e.filter(O=>n==="configured"?O.configured:n==="unconfigured"?!O.configured:!0),D=i?Ng[i.platform]:null;function U(O){return o===O?"wizard-step-dot active":"wizard-step-dot"}return s.jsxs("div",{className:"panel",children:[s.jsx("div",{className:"panel-header",children:s.jsx("h2",{children:"Platforms — Messaging Gateway Onboarding"})}),s.jsxs("div",{className:"platforms-summary",children:[s.jsxs("div",{className:"platforms-summary-stat",children:[s.jsx("span",{className:"platforms-summary-number",children:R}),s.jsx("span",{className:"platforms-summary-label",children:"configured"})]}),s.jsxs("div",{className:"platforms-summary-stat",children:[s.jsx("span",{className:"platforms-summary-number",children:e.length-R}),s.jsx("span",{className:"platforms-summary-label",children:"available"})]}),s.jsx("div",{className:"platforms-summary-filters",children:["all","configured","unconfigured"].map(O=>s.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))})]}),s.jsx("div",{className:"platforms-grid",children:z.map(O=>{const F=Ng[O.platform];return s.jsxs("div",{className:O.configured?"platform-card configured":"platform-card",children:[s.jsxs("div",{className:"platform-card-head",children:[s.jsx("span",{className:"platform-card-icon",children:(F==null?void 0:F.icon)??"🔌"}),s.jsxs("div",{className:"platform-card-info",children:[s.jsx("span",{className:"platform-card-name",children:O.label}),s.jsx("span",{className:"platform-card-category",children:(F==null?void 0:F.category)??"Platform"})]}),s.jsx("span",{className:O.configured?"status-dot connected":"status-dot reconnecting"})]}),s.jsx("div",{className:"platform-card-vars",children:O.envVars.map(A=>s.jsxs("span",{className:A.set?"platform-var-chip set":"platform-var-chip",children:[A.varName," ",A.set?"done":"--"]},A.varName))}),s.jsxs("div",{className:"platform-card-actions",children:[O.configured?s.jsx("span",{className:"platform-card-badge",children:"Active"}):s.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>T(O),children:"Setup"}),O.setupUrl?s.jsx("a",{href:O.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Docs"}):null]}),!O.configured&&O.setupHint?s.jsx("div",{className:"platform-card-hint",children:O.setupHint}):null]},O.platform)})}),s.jsxs("div",{className:"platforms-cli-hint",children:[s.jsx("span",{className:"admin-hint",children:"Prefer the terminal? "}),s.jsx("code",{children:"buff gateway setup telegram"}),s.jsx("span",{className:"admin-hint",children:" — same wizard from your CLI"})]}),i&&D?s.jsx("div",{className:"wizard-overlay",onClick:()=>a(null),children:s.jsxs("div",{className:"wizard-modal",onClick:O=>O.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:D.icon}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",i.label]}),s.jsxs("div",{className:"wizard-steps-indicator",children:[s.jsx("span",{className:U(0),children:"1"}),s.jsx("span",{className:U(1),children:"2"}),s.jsx("span",{className:U(2),children:"3"})]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>a(null),children:"X"})]}),s.jsxs("div",{className:"wizard-body",children:[o===0&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"wizard-section-title",children:["Step 1: Create your bot on ",i.label]}),s.jsx("ol",{className:"wizard-steps",children:D.steps.map((O,F)=>s.jsx("li",{children:O},F))}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>l(1),children:"I have my token — Step 2"}),i.setupUrl?s.jsx("a",{href:i.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Open docs"}):null]})]}),o===1&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"Step 2: Paste your token"}),i.envVars.map(O=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:O.prompt}),s.jsx("input",{type:O.secret?"password":"text",value:c[O.varName]??"",onChange:F=>u(A=>({...A,[O.varName]:F.target.value})),placeholder:O.secret?"paste your token here":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},O.varName)),h?s.jsx("div",{className:h.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:h.text}):null,s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(0),children:"Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void M(),disabled:d,children:d?"Saving...":"Save & Verify"})]})]}),o===2&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"Step 3: Verify and test"}),g.status==="checking"&&s.jsx("div",{className:"wizard-verify-status",children:"Verifying token..."}),g.status==="ok"&&s.jsxs("div",{className:"wizard-verify-status ok",children:["Connected as ",g.info]}),g.status==="err"&&s.jsx("div",{className:"wizard-verify-status err",children:g.error}),g.status==="idle"&&(h==null?void 0:h.kind)==="ok"&&s.jsx("div",{className:"wizard-verify-status ok",children:h.text}),v&&s.jsxs("div",{className:"wizard-test-section",children:[s.jsx("p",{className:"wizard-section-title",children:"Send a test message:"}),s.jsx("div",{className:"wizard-test-row",children:s.jsx("input",{className:"wizard-test-input",value:v,onChange:O=>y(O.target.value),placeholder:"telegram:YOUR_CHAT_ID"})}),s.jsxs("div",{className:"wizard-test-row",children:[s.jsx("input",{className:"wizard-test-input",value:b,onChange:O=>x(O.target.value),placeholder:"Hello from agent-nuvira!"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void $(),disabled:k||!v,children:k?"Sending...":"Send test"})]}),w?s.jsx("div",{className:w.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:w.text}):null]}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(1),children:"Edit token"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>a(null),children:"Done"})]}),!v&&s.jsxs("p",{className:"wizard-hint",children:["Token saved! Start the gateway from the Gateway tab, then send a message from your ",i.label," app."]})]})]})]})}):null]})}const Zge=[{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)"}],nj=[{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 Qge({canWrite:e,sessionExpired:t}){const[n,r]=E.useState(null),[i,a]=E.useState(null),[o,l]=E.useState(!1),[c,u]=E.useState("overview"),d=E.useRef(!0),[f,h]=E.useState("bearer"),[p,g]=E.useState(""),[m,v]=E.useState(""),[y,b]=E.useState(""),[x,k]=E.useState("us-east-1"),[S,w]=E.useState(nj.filter(R=>R.checked).map(R=>R.name)),[_,N]=E.useState(!1),[C,T]=E.useState(null),I=E.useCallback(async()=>{const R=await ee.getBedrockStatus();d.current&&r(R)},[]);E.useEffect(()=>(I(),()=>{d.current=!1}),[I]);const M=async()=>{l(!0),a(null);try{const R=await ee.probeBedrock((n==null?void 0:n.region)||"us-east-1");if(!d.current)return;R.ok&&R.models&&(a(R.models),u("test"))}catch{}finally{d.current&&l(!1)}},$=async()=>{N(!0),T(null);try{const R={BEDROCK_REGION:x};f==="bearer"&&p?R.AWS_BEARER_TOKEN=p:f==="iam"&&(m&&(R.AWS_ACCESS_KEY_ID=m),y&&(R.AWS_SECRET_ACCESS_KEY=y));const z=await ee.setupBedrock(R);if(!d.current)return;z.ok?(T({kind:"ok",text:"✅ Configuration saved! Running connectivity test…"}),u("overview"),await I(),setTimeout(()=>void M(),500)):T({kind:"err",text:z.error||"Save failed"})}catch{d.current&&T({kind:"err",text:"Could not reach the dashboard server."})}finally{d.current&&N(!1)}};return n===null?s.jsx("div",{className:"empty-state",children:"Loading Bedrock status…"}):s.jsxs("div",{className:"bedrock-onboarding",children:[s.jsx("h2",{className:"section-title",children:"🟠 AWS Bedrock"}),s.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 ",s.jsx("strong",{children:"region"}),", ",s.jsx("strong",{children:"AWS credentials"}),", and explicit ",s.jsx("strong",{children:"model access approval"}),"."]}),C?s.jsx("div",{className:`admin-row-msg${C.kind==="ok"?"":" admin-row-msg-err"}`,children:C.text}):null,s.jsxs("div",{className:"bedrock-status-bar",children:[s.jsxs("div",{className:"bedrock-status-item",children:[s.jsx("span",{className:`status-dot ${n.configured?"connected":"reconnecting"}`}),s.jsx("span",{children:n.configured?"Configured":"Not configured"})]}),s.jsxs("div",{className:"bedrock-status-item",children:[s.jsx("span",{className:"bedrock-status-label",children:"Region:"}),s.jsx("code",{children:n.region})]}),s.jsxs("div",{className:"bedrock-status-item",children:[s.jsx("span",{className:"bedrock-status-label",children:"Auth:"}),s.jsx("code",{children:n.authMethod==="bearer"?"API Key":n.authMethod==="iam"?"IAM":"None"})]}),s.jsxs("div",{className:"bedrock-status-actions",children:[e?s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>u(c==="setup"?"overview":"setup"),children:c==="setup"?"✕ Cancel":"⚙ Setup Wizard"}):null,n.configured?s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void M(),disabled:o,children:o?"⏳ Probing…":"🔍 Test Models"}):null]})]}),c==="setup"&&s.jsxs("div",{className:"bedrock-setup-wizard",children:[s.jsx("h3",{className:"section-subtitle",children:"🚀 Bedrock Setup Wizard"}),s.jsxs("div",{className:"bedrock-wizard-step",children:[s.jsx("h4",{children:"Step 1: Authentication"}),s.jsxs("div",{className:"bedrock-auth-options",children:[s.jsxs("label",{className:`bedrock-auth-option ${f==="bearer"?"selected":""}`,children:[s.jsx("input",{type:"radio",name:"authMethod",checked:f==="bearer",onChange:()=>h("bearer")}),s.jsxs("div",{children:[s.jsx("strong",{children:"Bedrock API Key"}),s.jsx("span",{children:"Simpler — get from Bedrock → Settings → API keys"})]})]}),s.jsxs("label",{className:`bedrock-auth-option ${f==="iam"?"selected":""}`,children:[s.jsx("input",{type:"radio",name:"authMethod",checked:f==="iam",onChange:()=>h("iam")}),s.jsxs("div",{children:[s.jsx("strong",{children:"IAM Credentials"}),s.jsx("span",{children:"Full AWS SDK auth — AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY"})]})]})]}),f==="bearer"?s.jsxs("div",{className:"bedrock-wizard-fields",children:[s.jsxs("div",{className:"bedrock-setup-hint",children:[s.jsx("strong",{children:"How to get a Bedrock API key:"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Open ",s.jsx("a",{href:"https://console.aws.amazon.com/bedrock/",target:"_blank",rel:"noopener noreferrer",children:"AWS Bedrock Console"})]}),s.jsxs("li",{children:["Go to ",s.jsx("strong",{children:"Settings"})," → ",s.jsx("strong",{children:"API keys"})]}),s.jsx("li",{children:"Create a new key and paste it below"})]})]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"Bedrock API Key (Bearer token)"}),s.jsx("input",{type:"password",value:p,onChange:R=>g(R.target.value),placeholder:"••••••••••••",autoComplete:"off",spellCheck:!1})]})]}):s.jsxs("div",{className:"bedrock-wizard-fields",children:[s.jsxs("div",{className:"bedrock-setup-hint",children:[s.jsx("strong",{children:"IAM credentials"})," give full AWS SDK access. Create an IAM user with Bedrock permissions."]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"AWS_ACCESS_KEY_ID"}),s.jsx("input",{type:"text",value:m,onChange:R=>v(R.target.value),placeholder:"AKIA...",autoComplete:"off",spellCheck:!1})]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"AWS_SECRET_ACCESS_KEY"}),s.jsx("input",{type:"password",value:y,onChange:R=>b(R.target.value),placeholder:"••••••••••••",autoComplete:"off",spellCheck:!1})]})]})]}),s.jsxs("div",{className:"bedrock-wizard-step",children:[s.jsx("h4",{children:"Step 2: AWS Region"}),s.jsxs("p",{className:"admin-hint",children:["Models vary by region. ",s.jsx("strong",{children:"us-east-1"})," and ",s.jsx("strong",{children:"us-west-2"})," have the most models. ⚠️ Do NOT use eu-north-1 unless models are explicitly enabled there."]}),s.jsx("select",{className:"bedrock-region-select",value:x,onChange:R=>k(R.target.value),children:Zge.map(R=>s.jsx("option",{value:R.value,children:R.label},R.value))})]}),s.jsxs("div",{className:"bedrock-wizard-step",children:[s.jsx("h4",{children:"Step 3: Model Access"}),s.jsx("p",{className:"admin-hint",children:"Bedrock requires you to request access for each model family."}),s.jsx("div",{className:"bedrock-model-access-hint",children:s.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${x}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"📖 Open Model Access in AWS Console"})}),s.jsx("div",{className:"bedrock-family-grid",children:nj.map(R=>s.jsxs("label",{className:`bedrock-family-card ${S.includes(R.name)?"selected":""}`,children:[s.jsx("input",{type:"checkbox",checked:S.includes(R.name),onChange:z=>{z.target.checked?w(D=>[...D,R.name]):w(D=>D.filter(U=>U!==R.name))}}),s.jsxs("div",{children:[s.jsx("strong",{children:R.name}),s.jsxs("span",{children:[R.models.length," model(s)"]})]})]},R.name))}),s.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."})]}),s.jsxs("div",{className:"bedrock-wizard-actions",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void $(),disabled:_||f==="bearer"&&!p||f==="iam"&&(!m||!y),children:_?"⏳ Saving…":"💾 Save & Test"}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),children:"Cancel"})]})]}),c==="test"&&i&&s.jsxs("div",{className:"bedrock-probe-results",children:[s.jsxs("h3",{className:"section-subtitle",children:["🔍 Model Probe Results (",n.region,")"]}),s.jsx("div",{className:"bedrock-probe-grid",children:i.map(R=>s.jsxs("div",{className:`bedrock-probe-card bedrock-probe-${R.status}`,children:[s.jsx("span",{className:"bedrock-probe-icon",children:R.status==="accessible"?"✅":R.status==="permission-denied"?"🔒":R.status==="not-found"?"⚫":"❌"}),s.jsx("span",{className:"bedrock-probe-id",children:R.modelId}),s.jsx("span",{className:"bedrock-probe-status",children:R.status==="accessible"?"Ready":R.status==="permission-denied"?`Need access (HTTP ${R.httpStatus})`:R.status==="not-found"?"Not in this region":"Error"})]},R.modelId))}),i.some(R=>R.status==="permission-denied")&&s.jsxs("div",{className:"bedrock-probe-action",children:[s.jsxs("p",{children:["Some models exist in ",n.region," but access is not approved."]}),s.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 →"})]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),style:{marginTop:12},children:"← Back"})]}),!n.configured&&c==="overview"&&s.jsxs("div",{className:"bedrock-getting-started",children:[s.jsx("h3",{className:"section-subtitle",children:"📋 Getting Started with Bedrock"}),s.jsxs("div",{className:"bedrock-steps",children:[s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"1"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Create an AWS account"})," (or use existing)",s.jsxs("span",{children:["New to AWS? Sign up at ",s.jsx("a",{href:"https://aws.amazon.com/",target:"_blank",rel:"noopener noreferrer",children:"aws.amazon.com"})]})]})]}),s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"2"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Get Bedrock API key"}),s.jsx("span",{children:"Bedrock → Settings → API keys → Create key"})]})]}),s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"3"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Request model access"}),s.jsx("span",{children:"Bedrock → Model access → Select Claude, Llama, etc. → Submit"})]})]}),s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"4"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Configure in this wizard"}),s.jsx("span",{children:'Click "Setup Wizard" above to enter your credentials'})]})]})]})]}),n.configured&&c==="overview"&&!i&&s.jsx("div",{className:"bedrock-quick-status",children:s.jsxs("p",{className:"admin-hint",children:["Bedrock is configured. Click ",s.jsx("strong",{children:"🔍 Test Models"})," to verify connectivity and discover which models are accessible in ",n.region,"."]})})]})}const jg=["whatsapp","whatsapp_cloud","telegram","signal","slack","discord","email"];function Jge(){const[e,t]=E.useState([]),[n,r]=E.useState(!0),[i,a]=E.useState("all"),[o,l]=E.useState(null),[c,u]=E.useState(""),[d,f]=E.useState(""),[h,p]=E.useState(null),[g,m]=E.useState({}),[v,y]=E.useState({}),[b,x]=E.useState({}),[k,S]=E.useState(null),[w,_]=E.useState(!1),[N,C]=E.useState(!1),[T,I]=E.useState(!1),[M,$]=E.useState(12e4),R=E.useCallback(async()=>{r(!0);const G=await ee.getContacts();G.ok&&G.contacts&&t(G.contacts);const X=await ee.gatewayPolicies();if(X.ok&&X.policies){const ae={};for(const le of jg){const Y=X.policies[le];Y&&(ae[le]={...Y.outboundSenders!==void 0?{outboundSenders:Y.outboundSenders}:{},...Y.requireApprovedTarget!==void 0?{requireApprovedTarget:Y.requireApprovedTarget}:{}})}m(ae),y(ae)}C(X.askUserWait===!0),I(X.askUserWait===!0),typeof X.askUserTimeoutMs=="number"&&$(X.askUserTimeoutMs),r(!1)},[]);E.useEffect(()=>{R()},[R]);const z=e.filter(G=>i==="all"||G.status===i),D=async G=>{p(null);const X=await ee.approveContact(G.platform,G.name);p(X.ok?{kind:"ok",text:`✅ ${G.name} approved.`}:{kind:"err",text:X.error||"Failed."}),R()},U=async G=>{p(null);const X=await ee.rejectContact(G.platform,G.name);p(X.ok?{kind:"ok",text:`🚫 ${G.name} rejected.`}:{kind:"err",text:X.error||"Failed."}),R()},O=async G=>{p(null);const X=await ee.deleteContact(G.platform,G.name);p(X.ok?{kind:"ok",text:`🗑️ ${G.name} deleted.`}:{kind:"err",text:X.error||"Failed."}),R()},F=async()=>{if(!o)return;p(null);const G=await ee.updateContact(o.platform,o.id,{name:c,phone:d});p(G.ok?{kind:"ok",text:`✅ ${c} updated.`}:{kind:"err",text:G.error||"Failed."}),l(null),R()},A=G=>G==="approved"?s.jsx("span",{className:"contact-status-badge approved",children:"✅ Approved"}):G==="pending"?s.jsx("span",{className:"contact-status-badge pending",children:"⏳ Pending"}):s.jsx("span",{className:"contact-status-badge rejected",children:"🚫 Rejected"}),Z=G=>({telegram:"✈️",whatsapp:"📱",whatsapp_cloud:"📱",email:"📧",slack:"💬",discord:"🎮"})[G]||"🔌",L=G=>G?new Date(G).toLocaleString():"—",P=G=>{const X=(b[G]??"").trim();X&&(m(ae=>{var _e;const le={...ae[G]??{}},Y=le.outboundSenders??((_e=v[G])==null?void 0:_e.outboundSenders)??[];return Y.some(Ee=>Ee.toLowerCase()===X.toLowerCase())||(le.outboundSenders=[...Y,X]),{...ae,[G]:le}}),x(ae=>({...ae,[G]:""})))},ce=(G,X)=>{m(ae=>{var _e;const le={...ae[G]??{}},Y=le.outboundSenders??((_e=v[G])==null?void 0:_e.outboundSenders)??[];return le.outboundSenders=Y.filter(Ee=>Ee.toLowerCase()!==X.toLowerCase()),{...ae,[G]:le}})},we=G=>{m(X=>{const ae={...X[G]??{}};return ae.requireApprovedTarget=ae.requireApprovedTarget!==!0,{...X,[G]:ae}})},pe=G=>{m(X=>{const ae={...X[G]??{}};return delete ae.outboundSenders,{...X,[G]:ae}})},Pe=async()=>{_(!0),S(null);const G={};for(const le of jg){const Y=g[le]??{},_e=v[le]??{};(JSON.stringify(Y.outboundSenders??null)!==JSON.stringify(_e.outboundSenders??null)||!!Y.requireApprovedTarget!=!!_e.requireApprovedTarget)&&(G[le]={...Y.outboundSenders!==void 0?{outboundSenders:Y.outboundSenders}:{outboundSenders:null},requireApprovedTarget:!!Y.requireApprovedTarget})}const X=N!==T;if(Object.keys(G).length===0&&!X){_(!1),S({kind:"ok",text:"No changes to save."});return}const ae=await ee.saveGatewayPolicies(G,void 0,void 0,{wait:N,timeoutMs:M});ae.ok?(S({kind:"ok",text:"✅ Send authority saved."}),R()):S({kind:"err",text:ae.error||"Failed to save send authority."}),_(!1)};return s.jsxs("div",{className:"panel contacts-page",children:[s.jsxs("div",{className:"panel-header",children:[s.jsx("h2",{children:"📇 Contacts — Outbound Messaging Directory"}),s.jsx("p",{className:"admin-hint",children:"Manage who the bot can send messages to. Users auto-register on first Telegram message."})]}),h&&s.jsxs("div",{className:`admin-row-msg ${h.kind==="err"?"admin-row-msg-err":""}`,children:[h.text,s.jsx("button",{className:"admin-mini-btn",onClick:()=>p(null),children:"✕"})]}),s.jsxs("div",{className:"contacts-filters",children:[["all","approved","pending","rejected"].map(G=>s.jsx("button",{type:"button",className:i===G?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>a(G),children:G==="all"?`All (${e.length})`:G==="approved"?`✅ Approved (${e.filter(X=>X.status==="approved").length})`:G==="pending"?`⏳ Pending (${e.filter(X=>X.status==="pending").length})`:`🚫 Rejected (${e.filter(X=>X.status==="rejected").length})`},G)),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void R(),children:"🔄 Refresh"})]}),n?s.jsx("div",{className:"empty-state",children:"Loading contacts..."}):z.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsxs("p",{children:["No contacts",i!=="all"?` with status "${i}"`:"","."]}),s.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.'})]}):s.jsx("div",{className:"contacts-table-wrapper",children:s.jsxs("table",{className:"contacts-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Platform"}),s.jsx("th",{children:"Name"}),s.jsx("th",{children:"ID"}),s.jsx("th",{children:"Phone"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Registered"}),s.jsx("th",{children:"Actions"})]})}),s.jsx("tbody",{children:z.map(G=>s.jsxs("tr",{className:`contact-row status-${G.status}`,children:[s.jsxs("td",{children:[Z(G.platform)," ",G.platform]}),s.jsx("td",{className:"contact-name",children:G.name}),s.jsx("td",{className:"contact-id",children:s.jsx("code",{children:G.id})}),s.jsx("td",{className:"contact-phone",children:G.phone||"—"}),s.jsx("td",{children:A(G.status)}),s.jsx("td",{className:"contact-date",children:L(G.registeredAt||G.addedAt)}),s.jsxs("td",{className:"contact-actions",children:[G.status!=="approved"&&s.jsx("button",{className:"admin-mini-btn contact-approve-btn",onClick:()=>void D(G),children:"✅ Approve"}),G.status!=="rejected"&&s.jsx("button",{className:"admin-mini-btn contact-reject-btn",onClick:()=>void U(G),children:"🚫 Reject"}),s.jsx("button",{className:"admin-mini-btn",onClick:()=>{l(G),u(G.name),f(G.phone||"")},children:"✏️ Edit"}),s.jsx("button",{className:"admin-mini-btn contact-delete-btn",onClick:()=>void O(G),children:"🗑️"})]})]},`${G.platform}:${G.id}`))})]})}),s.jsxs("div",{className:"panel-header",style:{marginTop:28},children:[s.jsx("h2",{children:"🔐 Send authority — who may message others"}),s.jsxs("p",{className:"admin-hint",children:["Controls who can ask the agent to send a message to ",s.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 ",s.jsx("em",{children:"to"})," that person. Left empty, a platform ",s.jsx("strong",{children:"inherits"})," its allowed-users list (open). Add ",s.jsx("code",{children:"Allow-All"})," to allow everyone, or list specific senders to restrict it."]})]}),k&&s.jsxs("div",{className:`admin-row-msg ${k.kind==="err"?"admin-row-msg-err":""}`,children:[k.text,s.jsx("button",{className:"admin-mini-btn",onClick:()=>S(null),children:"✕"})]}),s.jsx("div",{className:"hub-permissions",children:jg.map(G=>{const X=g[G]??{},ae=X.outboundSenders??[],le=X.outboundSenders===void 0;return s.jsxs("div",{className:"hub-card",children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsxs("span",{className:"hub-chip",children:[Z(G)," ",G]}),le?s.jsx("span",{className:"hub-chip",children:"open"}):s.jsx("span",{className:"hub-chip",children:"restricted"})]}),s.jsx("div",{className:"hub-alias-list",children:le?s.jsx("span",{className:"admin-hint",children:"Open — anyone who can trigger the agent may send to others."}):ae.length===0?s.jsx("span",{className:"admin-hint",children:"(empty — nobody may send to others)"}):ae.map(Y=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:Y}),s.jsx("button",{className:"admin-refresh-btn",disabled:w,onClick:()=>ce(G,Y),children:"✕"})]},`sa-${G}-${Y}`))}),s.jsxs("div",{className:"hub-send-form",children:[s.jsx("input",{type:"text",value:b[G]??"",onChange:Y=>x(_e=>({..._e,[G]:Y.target.value})),placeholder:"sender id, or Allow-All",disabled:w}),s.jsx("button",{className:"admin-refresh-btn",disabled:w||!(b[G]??"").trim(),onClick:()=>P(G),children:"+ Sender"}),le?null:s.jsx("button",{className:"admin-refresh-btn",disabled:w,onClick:()=>pe(G),children:"↺ Reset to open"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[s.jsx("input",{type:"checkbox",checked:!!X.requireApprovedTarget,disabled:w,onChange:()=>we(G)}),s.jsx("span",{className:"admin-hint",children:"Require approved recipients"})]})]},`sa-${G}`)})}),s.jsxs("div",{className:"hub-card",style:{marginTop:16},children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsx("span",{className:"hub-chip",children:"🧠 Clarifying questions"}),N?s.jsx("span",{className:"hub-chip",children:"wait for reply"}):s.jsx("span",{className:"hub-chip",children:"assume option 1"}),N!==T?s.jsx("span",{className:"hub-chip",children:"· unsaved"}):null]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[s.jsx("input",{type:"checkbox",checked:N,disabled:w,onChange:()=>C(G=>!G)}),s.jsxs("span",{className:"admin-hint",children:["When the agent asks a question on a channel, ",s.jsx("strong",{children:"wait for the sender's reply"})," before acting. Off (default): the question is sent and the ",s.jsx("em",{children:"first"})," option is assumed immediately — so a reply typed afterwards arrives too late to change anything."]})]}),N?s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[s.jsx("span",{className:"admin-hint",children:"Reply window (seconds)"}),s.jsx("input",{type:"number",min:5,max:600,value:Math.round(M/1e3),disabled:w,onChange:G=>$(Math.max(5,Math.min(600,Number(G.target.value)||120))*1e3),style:{width:90}}),s.jsx("span",{className:"admin-hint",children:"then the first option is used, and the timeout is logged."})]}):null]}),s.jsx("div",{style:{marginTop:12},children:s.jsx("button",{className:"admin-refresh-btn",disabled:w,onClick:()=>void Pe(),children:"💾 Save send authority"})}),o&&s.jsx("div",{className:"wizard-overlay",onClick:()=>l(null),children:s.jsxs("div",{className:"wizard-modal",onClick:G=>G.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:"✏️"}),s.jsxs("span",{className:"wizard-title",children:["Edit Contact: ",o.name]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"✕"})]}),s.jsxs("div",{className:"wizard-body",children:[s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"Name"}),s.jsx("input",{type:"text",value:c,onChange:G=>u(G.target.value)})]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"Phone (optional, for flexible lookup)"}),s.jsx("input",{type:"text",value:d,onChange:G=>f(G.target.value),placeholder:"+918800123456"})]}),s.jsxs("p",{className:"admin-hint",children:["Platform: ",s.jsx("strong",{children:o.platform})," | ID: ",s.jsx("code",{children:o.id})]}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"Cancel"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void F(),children:"Save"})]})]})]})})]})}function fo(e){if(e<=0)return"never";const t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),i=Math.floor(r/24);return i>30?`${i}d ago`:i>0?`${i}d ${r%24}h ago`:r>0?`${r}h ${n%60}m ago`:n>0?`${n}m ago`:`${t}s ago`}function eye(e,t,n){if(e==="unavailable")return"#f85149";if(e==="unverified")return"#d29922";const i=(Date.now()-t)/(24*60*60*1e3);return i>30&&n>.5?"#f85149":i>7?"#d29922":"#3fb950"}function tye(e,t,n){if(e==="unavailable")return"Unavailable";if(e==="unverified")return"Unverified";const i=(Date.now()-t)/(24*60*60*1e3);return i>30&&n>.5?"Likely Removed":i>7?"Stale":"Fresh"}function nye({entry:e}){const t=Date.now(),n=t-e.lastProbedAt,r=t-e.lastVerifiedAt,i=t-e.lastUsedAt,a=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,i/(30*24*60*60*1e3)*100):-1;return s.jsxs("div",{className:"timeline-bar-container",children:[s.jsx("div",{className:"timeline-bar",title:`Last probed: ${fo(n)}`,children:s.jsx("div",{className:"timeline-bar-fill probe",style:{width:`${a}%`}})}),o>=0&&s.jsx("div",{className:"timeline-bar small",title:`Last verified: ${fo(r)}`,children:s.jsx("div",{className:"timeline-bar-fill verify",style:{width:`${o}%`}})}),l>=0&&s.jsx("div",{className:"timeline-bar small",title:`Last used: ${fo(i)}`,children:s.jsx("div",{className:"timeline-bar-fill use",style:{width:`${l}%`}})})]})}function rye(){const[e,t]=E.useState(null),[n,r]=E.useState(!0),[i,a]=E.useState(null),[o,l]=E.useState("all"),[c,u]=E.useState("provider"),d=E.useRef(!0),f=E.useCallback(async()=>{try{const v=await fetch("/api/model-timeline");if(!v.ok)throw new Error("Failed to fetch timeline data");const y=await v.json();d.current&&(t(y),a(null))}catch(v){d.current&&a(v instanceof Error?v.message:"Failed to load timeline")}finally{d.current&&r(!1)}},[]);if(E.useEffect(()=>{d.current=!0,f();const v=setInterval(f,3e4);return()=>{d.current=!1,clearInterval(v)}},[f]),n)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"📅 Model Discovery Timeline"}),s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Loading timeline..."})]})]});if(i)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"📅 Model Discovery Timeline"}),s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:i})]});const p=((e==null?void 0:e.entries)??[]).filter(v=>{const b=(Date.now()-v.lastProbedAt)/(24*60*60*1e3),x=b>7,k=b>30&&v.errorRate>.5,S=!x&&!k;return o==="fresh"?S:o==="stale"?x&&!k:o==="removed"?k:!0}),g=[...p].sort((v,y)=>{if(c==="provider")return v.provider.localeCompare(y.provider)||v.model.localeCompare(y.model);if(c==="lastProbed")return y.lastProbedAt-v.lastProbedAt;if(c==="status"){const b={unavailable:0,unverified:1,verified:2};return(b[y.status]??0)-(b[v.status]??0)}return 0}),m=new Map;for(const v of g)m.has(v.provider)||m.set(v.provider,[]),m.get(v.provider).push(v);return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"📅 Model Discovery Timeline"}),s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:(e==null?void 0:e.totalModels)??0}),s.jsx("div",{className:"stat-label",children:"Total Models"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#3fb950"},children:[s.jsx("div",{className:"stat-value",style:{color:"#3fb950"},children:(e==null?void 0:e.freshCount)??0}),s.jsx("div",{className:"stat-label",children:"Fresh (<7d)"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#d29922"},children:[s.jsx("div",{className:"stat-value",style:{color:"#d29922"},children:(e==null?void 0:e.staleCount)??0}),s.jsx("div",{className:"stat-label",children:"Stale (7-30d)"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#f85149"},children:[s.jsx("div",{className:"stat-value",style:{color:"#f85149"},children:(e==null?void 0:e.removedCount)??0}),s.jsx("div",{className:"stat-label",children:"Likely Removed (>30d)"})]})]}),s.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:[s.jsx("div",{style:{display:"flex",gap:4},children:["all","fresh","stale","removed"].map(v=>s.jsx("button",{className:`admin-refresh-btn ${o===v?"active":""}`,onClick:()=>l(v),style:{background:o===v?"#238636":"#21262d",border:`1px solid ${o===v?"#3fb950":"#30363d"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"},children:v.charAt(0).toUpperCase()+v.slice(1)},v))}),s.jsx("div",{style:{display:"flex",gap:4},children:["provider","lastProbed","status"].map(v=>s.jsxs("button",{className:`admin-refresh-btn ${c===v?"active":""}`,onClick:()=>u(v),style:{background:c===v?"#238636":"#21262d",border:`1px solid ${c===v?"#3fb950":"#30363d"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"},children:["Sort: ",v==="lastProbed"?"Last Seen":v.charAt(0).toUpperCase()+v.slice(1)]},v))}),s.jsx("button",{className:"admin-refresh-btn",onClick:f,style:{background:"#21262d",border:"1px solid #30363d",padding:"4px 12px",fontSize:12,cursor:"pointer"},children:"🔄 Refresh"})]}),s.jsxs("div",{style:{display:"flex",gap:16,marginBottom:12,fontSize:11,color:"#8b949e"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#58a6ff"},children:"■"})," Probe (last seen)"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#3fb950"},children:"■"})," Verified (last success)"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#d29922"},children:"■"})," Used (last invocation)"]})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from(m.entries()).map(([v,y])=>s.jsxs("div",{style:{background:"#161b22",borderRadius:8,border:"1px solid #30363d",overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{style:{fontSize:16},children:v==="groq"?"⚡":v==="gemini"?"🌀":v==="local"?"💻":"🤖"}),s.jsx("span",{style:{fontWeight:600,color:"#e6edf3"},children:v}),s.jsxs("span",{style:{fontSize:12,color:"#8b949e"},children:["(",y.length," models)"]})]}),s.jsx("div",{style:{padding:"8px 14px"},children:y.map(b=>{const x=Date.now();(x-b.lastProbedAt)/(24*60*60*1e3);const k=eye(b.status,b.lastProbedAt,b.errorRate),S=tye(b.status,b.lastProbedAt,b.errorRate);return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"6px 0",borderBottom:"1px solid #21262d"},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("div",{style:{fontSize:13,color:"#e6edf3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.model}),s.jsxs("div",{style:{fontSize:11,color:"#8b949e",display:"flex",gap:12},children:[s.jsxs("span",{children:["Probed: ",fo(x-b.lastProbedAt)]}),b.lastVerifiedAt>0&&s.jsxs("span",{children:["Verified: ",fo(x-b.lastVerifiedAt)]}),b.lastUsedAt>0&&s.jsxs("span",{children:["Used: ",fo(x-b.lastUsedAt)]}),b.latencyMs!==void 0&&s.jsxs("span",{children:[b.latencyMs,"ms"]})]})]}),s.jsx(nye,{entry:b}),s.jsx("div",{style:{fontSize:11,padding:"2px 8px",borderRadius:4,background:`${k}20`,color:k,border:`1px solid ${k}40`,whiteSpace:"nowrap"},children:S})]},b.model)})})]},v))}),p.length===0&&s.jsx("div",{style:{textAlign:"center",padding:"40px 20px",color:"#8b949e"},children:"No models match the current filter"})]})}function Ta(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function iye(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function aye({data:e}){var o,l;if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading memory data..."})});const{memory:t,health:n}=e,r=Object.entries(t.byFingerprint||{}).sort(([,c],[,u])=>u-c),i=Object.entries(((o=t.facts)==null?void 0:o.byProject)||{}).sort(([,c],[,u])=>u-c),a=t.recall||{total:0,today:0,last7d:0};return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"💾 Memory Store"}),s.jsxs("div",{className:"stats-grid mini",children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:Ta(t.total)}),s.jsx("div",{className:"stat-label",children:"Trajectories"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:iye(t.avgScore)}),s.jsx("div",{className:"stat-label",children:"Avg Score"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:Ta((l=t.facts)==null?void 0:l.total)}),s.jsx("div",{className:"stat-label",children:"Facts"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:Ta(a.total)}),s.jsx("div",{className:"stat-label",children:"Recall Hits"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:Ta(n==null?void 0:n.patterns)}),s.jsx("div",{className:"stat-label",children:"Coding Patterns"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:Ta(n==null?void 0:n.feedback)}),s.jsx("div",{className:"stat-label",children:"Feedback Ratings"})]})]}),s.jsxs("p",{className:"memory-backend",children:["Backend: ",s.jsx("code",{children:t.backend||"local"}),a.last7d>0?` · ${Ta(a.last7d)} recall(s) this week, ${Ta(a.today)} today`:" · no recalls yet"]}),r.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"By Project Type"}),s.jsx("div",{className:"memory-list",children:r.map(([c,u])=>s.jsxs("div",{className:"memory-item",children:[s.jsx("span",{className:"memory-project",children:c}),s.jsxs("span",{className:"memory-count",children:[u," trajectory(ies)"]})]},c))})]}),i.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"Facts by Project"}),s.jsx("div",{className:"memory-list",children:i.map(([c,u])=>s.jsxs("div",{className:"memory-item",children:[s.jsx("span",{className:"memory-project",children:c}),s.jsxs("span",{className:"memory-count",children:[u," fact(s)"]})]},c))})]})]})}function sye(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function oye({data:e}){if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading history..."})});const{history:t}=e,n=t.recent||[];return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"📝 Conversation History"}),s.jsx("div",{className:"history-stats",children:s.jsxs("span",{className:"history-count",children:["Total: ",s.jsx("strong",{children:t.total})," sessions"]})}),s.jsx("div",{className:"history-list",children:n.length===0?s.jsx("div",{className:"empty-state",children:"No conversations recorded yet."}):n.map(r=>s.jsxs("div",{className:"history-item",children:[s.jsx("div",{className:"history-summary",children:r.summary||"Untitled"}),s.jsxs("div",{className:"history-meta",children:[s.jsxs("span",{children:["📅 ",sye(r.startedAt)]}),s.jsxs("span",{children:["🤖 ",r.provider||"--"]}),s.jsxs("span",{children:["💬 ",r.messageCount||0," msgs"]}),r.tags&&r.tags.length>0&&s.jsxs("span",{children:["🏷️ ",r.tags.map(i=>s.jsx("span",{className:"history-tag",children:i},i))]})]})]},r.id))})]})}function lye({onFetch:e,onClear:t,onExport:n}){const[r,i]=E.useState([]),[a,o]=E.useState(!1),[l,c]=E.useState(""),[u,d]=E.useState(""),[f,h]=E.useState(null),[p,g]=E.useState(null);E.useEffect(()=>{m()},[l,u]);const m=async()=>{o(!0);try{const k=await e({skillName:l||void 0,status:u||void 0,limit:100});i(k);const S=k.length,w=k.filter(C=>C.status==="success").length,_=k.filter(C=>C.status==="failure").length,N=S>0?Math.round(k.reduce((C,T)=>C+T.durationMs,0)/S):0;g({total:S,success:w,failure:_,avgDuration:N})}catch(k){console.error("Failed to fetch execution history:",k)}finally{o(!1)}},v=async k=>{if(n)try{const S=await n(k),w=new Blob([S],{type:k==="json"?"application/json":"text/csv"}),_=URL.createObjectURL(w),N=document.createElement("a");N.href=_,N.download=`execution-history.${k}`,N.click(),URL.revokeObjectURL(_)}catch(S){console.error("Failed to export history:",S)}},y=async()=>{if(t&&confirm("Are you sure you want to clear all execution history?"))try{await t(),i([]),g(null)}catch(k){console.error("Failed to clear history:",k)}},b=k=>{switch(k){case"success":return"✅";case"failure":return"❌";case"timeout":return"⏰";case"rejected":return"🚫";case"error":return"💥";default:return"❓"}},x=k=>{switch(k){case"python":return"🐍";case"node":return"🟢";case"shell":return"🖥️";case"ruby":return"💎";case"go":return"🔵";case"rust":return"🦀";default:return"📜"}};return s.jsxs("div",{className:"execution-history",children:[s.jsxs("div",{className:"execution-history-header",children:[s.jsx("h3",{className:"execution-history-title",children:"📜 Execution History"}),s.jsxs("div",{className:"execution-history-actions",children:[s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>v("json"),children:"📥 Export JSON"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>v("csv"),children:"📥 Export CSV"}),t&&s.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:y,children:"🗑️ Clear"})]})]}),p&&s.jsxs("div",{className:"execution-history-stats",children:[s.jsxs("div",{className:"stat-item",children:[s.jsx("span",{className:"stat-value",children:p.total}),s.jsx("span",{className:"stat-label",children:"Total"})]}),s.jsxs("div",{className:"stat-item stat-success",children:[s.jsx("span",{className:"stat-value",children:p.success}),s.jsx("span",{className:"stat-label",children:"Success"})]}),s.jsxs("div",{className:"stat-item stat-failure",children:[s.jsx("span",{className:"stat-value",children:p.failure}),s.jsx("span",{className:"stat-label",children:"Failed"})]}),s.jsxs("div",{className:"stat-item",children:[s.jsxs("span",{className:"stat-value",children:[p.avgDuration,"ms"]}),s.jsx("span",{className:"stat-label",children:"Avg Duration"})]})]}),s.jsxs("div",{className:"execution-history-filters",children:[s.jsx("input",{className:"env-var-input",type:"text",placeholder:"Filter by skill name...",value:l,onChange:k=>c(k.target.value)}),s.jsxs("select",{className:"env-var-input",value:u,onChange:k=>d(k.target.value),children:[s.jsx("option",{value:"",children:"All statuses"}),s.jsx("option",{value:"success",children:"Success"}),s.jsx("option",{value:"failure",children:"Failure"}),s.jsx("option",{value:"timeout",children:"Timeout"}),s.jsx("option",{value:"rejected",children:"Rejected"}),s.jsx("option",{value:"error",children:"Error"})]})]}),s.jsx("div",{className:"execution-history-list",children:a?s.jsx("div",{className:"execution-history-empty",children:"Loading..."}):r.length===0?s.jsx("div",{className:"execution-history-empty",children:"No execution history found. Execute a skill to see results here."}):r.map(k=>s.jsxs("div",{className:`execution-history-entry ${k.status}`,onClick:()=>h((f==null?void 0:f.id)===k.id?null:k),children:[s.jsxs("div",{className:"entry-header",children:[s.jsx("span",{className:"entry-icon",children:b(k.status)}),s.jsx("span",{className:"entry-skill",children:k.skillName}),s.jsxs("span",{className:"entry-runtime",children:[x(k.runtime)," ",k.runtime]}),s.jsxs("span",{className:"entry-duration",children:[k.durationMs,"ms"]}),s.jsx("span",{className:"entry-time",children:new Date(k.timestamp).toLocaleString()}),s.jsx("span",{className:"entry-expand",children:(f==null?void 0:f.id)===k.id?"▼":"▶"})]}),(f==null?void 0:f.id)===k.id&&s.jsxs("div",{className:"entry-details",children:[s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Status:"}),s.jsx("span",{className:"detail-value",children:k.status})]}),s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Runtime:"}),s.jsx("span",{className:"detail-value",children:k.runtime})]}),s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Duration:"}),s.jsxs("span",{className:"detail-value",children:[k.durationMs,"ms"]})]}),k.exitCode!==void 0&&s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Exit Code:"}),s.jsx("span",{className:"detail-value",children:k.exitCode})]}),k.error&&s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Error:"}),s.jsx("span",{className:"detail-value entry-error",children:k.error})]}),k.command&&s.jsxs("div",{className:"entry-detail-row",children:[s.jsx("span",{className:"detail-label",children:"Command:"}),s.jsx("code",{className:"detail-value",children:k.command})]})]})]},k.id))})]})}function cye({envVars:e,onSave:t,onDelete:n,onTest:r,readOnly:i=!1}){const[a,o]=E.useState(null),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,h]=E.useState(""),[p,g]=E.useState(""),[m,v]=E.useState(null),[y,b]=E.useState({}),x=[...e].sort((_,N)=>_.requiredBy&&!N.requiredBy?-1:!_.requiredBy&&N.requiredBy?1:_.name.localeCompare(N.name)),k=_=>{t(_,l),o(null),c("")},S=()=>{f&&p&&(t(f,p),h(""),g(""),d(!1))},w=async _=>{if(r){v(_);try{const N=await r(_);b(C=>({...C,[_]:N}))}catch{b(N=>({...N,[_]:!1}))}finally{v(null)}}};return s.jsxs("div",{className:"env-var-editor",children:[s.jsxs("div",{className:"env-var-header",children:[s.jsx("h3",{className:"env-var-title",children:"🔐 Environment Variables"}),!i&&s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>d(!u),children:u?"✕ Cancel":"+ Add Variable"})]}),u&&!i&&s.jsxs("div",{className:"env-var-add-form",children:[s.jsx("input",{className:"env-var-input",type:"text",placeholder:"Variable name (e.g., MY_API_KEY)",value:f,onChange:_=>h(_.target.value)}),s.jsx("input",{className:"env-var-input",type:"password",placeholder:"Value",value:p,onChange:_=>g(_.target.value)}),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!f||!p,onClick:S,children:"💾 Save"})]}),s.jsx("div",{className:"env-var-list",children:x.length===0?s.jsx("div",{className:"env-var-empty",children:"No environment variables configured. Add one to get started."}):x.map(_=>s.jsxs("div",{className:`env-var-row ${_.isSet?"env-var-set":"env-var-missing"} ${_.isProviderCredential?"env-var-blocked":""}`,children:[s.jsxs("div",{className:"env-var-row-header",children:[s.jsxs("span",{className:"env-var-name",children:[_.name,_.requiredBy&&s.jsxs("span",{className:"env-var-required-badge",children:["required by ",_.requiredBy]}),_.isProviderCredential&&s.jsx("span",{className:"env-var-blocked-badge",children:"🔒 provider credential (blocked)"})]}),s.jsx("span",{className:"env-var-status",children:_.isSet?"✅ Set":"❌ Not set"})]}),_.description&&s.jsx("div",{className:"env-var-description",children:_.description}),a===_.name?s.jsxs("div",{className:"env-var-edit",children:[s.jsx("input",{className:"env-var-input",type:"password",value:l,onChange:N=>c(N.target.value),placeholder:"Enter new value..."}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>k(_.name),children:"💾 Save"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>o(null),children:"Cancel"})]}):s.jsxs("div",{className:"env-var-actions",children:[!i&&!_.isProviderCredential&&s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{o(_.name),c("")},children:"✏️ Edit"}),r&&s.jsx("button",{className:"admin-mini-btn",type:"button",disabled:m===_.name,onClick:()=>w(_.name),children:m===_.name?"⏳ Testing...":"🧪 Test"}),!i&&s.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:()=>n(_.name),children:"🗑️ Delete"}),y[_.name]!==void 0&&s.jsx("span",{className:`env-var-test-result ${y[_.name]?"env-var-test-pass":"env-var-test-fail"}`,children:y[_.name]?"✅ Valid":"❌ Invalid"})]})]},_.name))}),s.jsx("div",{className:"env-var-help",children:s.jsxs("p",{children:[s.jsx("strong",{children:"Tip:"})," Environment variables are stored in ",s.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 uye(){const[e,t]=E.useState({configured:!1,authenticated:!1,role:null}),[n,r]=E.useState([]),[i,a]=E.useState(!0),[o,l]=E.useState(null),[c,u]=E.useState(null),d=e.authenticated&&(e.role==="admin"||e.role==="operator"),f=E.useCallback(async()=>{a(!0);const m=await ee.fetchSkillEnv();r(m),a(!1)},[]);E.useEffect(()=>{ee.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=E.useCallback(async(m,v)=>{var x;l(null),u(null);const y=await ee.saveSecrets({[m]:v}),b=(x=y.refused)==null?void 0:x.find(k=>k.name===m);!y.ok||b?l(b?dye(m,b.reason):y.error||`Could not save ${m}.`):u(`Saved ${m}.`),await f()},[f]),p=E.useCallback(async m=>{l(null),u(null);const v=await ee.deleteSkillEnvVar(m);v.ok?u(v.removed?`Deleted ${m}.`:`${m} was not stored in the env file.`):l(v.error||`Could not delete ${m}.`),await f()},[f]),g=E.useCallback(async m=>{const v=await ee.testSkillEnvVar(m);return v.ok?(l(null),u(v.detail||`${m}: ${v.usable?"usable by skills":"not usable by skills"}`),v.usable===!0):(l(v.error||`Could not test ${m}.`),!1)},[]);return s.jsxs("div",{children:[s.jsx("h2",{className:"section-title",children:"🔐 Skill Environment Variables"}),s.jsxs("div",{className:"env-var-header",children:[s.jsx("span",{className:"env-var-title",children:"Values are masked; only names and set/unset state are shown."}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void f(),children:"↻ Refresh"})]}),s.jsxs("div",{className:"admin-hint",children:["Secrets here are injected into skill executions that declare them (",s.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:s.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?s.jsx("div",{className:"admin-hint",children:"Read-only — admins and operators can change these values."}):null,o?s.jsx("div",{className:"env-var-notice env-var-notice-error",children:o}):null,c?s.jsx("div",{className:"env-var-notice",children:c}):null,i?s.jsx("div",{className:"loading-state",children:"Loading…"}):s.jsx(cye,{envVars:n,onSave:(m,v)=>void h(m,v),onDelete:m=>void p(m),onTest:g,readOnly:!d})]})}function dye(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}).`}}function fye(){const[e,t]=E.useState(null),[n,r]=E.useState(!1),[i,a]=E.useState("--"),o=E.useCallback(c=>{t(c),a(new Date().toLocaleTimeString())},[]),l=E.useCallback(c=>{r(c)},[]);return E.useEffect(()=>{ee.fetchAll().then(d=>{d&&o(d)});const c=ee.subscribe(o),u=ee.onConnectionChange(l);return ee.connect(),()=>{c(),u(),ee.disconnect()}},[o,l]),s.jsx(qL,{connected:n,lastUpdated:i,children:s.jsxs(jL,{children:[s.jsx(at,{path:"/",element:s.jsx(ej,{})}),s.jsx(at,{path:"/overview",element:s.jsx(kie,{data:e})}),s.jsx(at,{path:"/chat",element:s.jsx(h1,{to:"/",replace:!0})}),s.jsx(at,{path:"/dag",element:s.jsx(Mie,{data:e})}),s.jsx(at,{path:"/costs",element:s.jsx(Iie,{data:e})}),s.jsx(at,{path:"/benchmarks",element:s.jsx(Lie,{data:e})}),s.jsx(at,{path:"/models",element:s.jsx(xae,{})}),s.jsx(at,{path:"/models/timeline",element:s.jsx(rye,{})}),s.jsx(at,{path:"/routing",element:s.jsx(tse,{data:e})}),s.jsx(at,{path:"/requests",element:s.jsx(ise,{data:e})}),s.jsx(at,{path:"/traces",element:s.jsx(pse,{})}),s.jsx(at,{path:"/hub",element:s.jsx(Nse,{})}),s.jsx(at,{path:"/tasks",element:s.jsx(Tse,{})}),s.jsx(at,{path:"/chat",element:s.jsx(ej,{})}),s.jsx(at,{path:"/evals",element:s.jsx(Kge,{data:e})}),s.jsx(at,{path:"/platforms",element:s.jsx(Xge,{})}),s.jsx(at,{path:"/bedrock",element:s.jsx(Qge,{canWrite:!0,sessionExpired:c=>console.error(c)})}),s.jsx(at,{path:"/contacts",element:s.jsx(Jge,{})}),s.jsx(at,{path:"/gateway",element:s.jsx(Yge,{})}),s.jsx(at,{path:"/env",element:s.jsx(uye,{})}),s.jsx(at,{path:"/memory",element:s.jsx(aye,{data:e})}),s.jsx(at,{path:"/history",element:s.jsx(oye,{data:e})}),s.jsx(at,{path:"/executions",element:s.jsx(lye,{onFetch:c=>ee.fetchExecutionAudit(c)})}),s.jsx(at,{path:"/system",element:s.jsx(Die,{data:e})}),s.jsx(at,{path:"/admin",element:s.jsx(bse,{})}),s.jsx(at,{path:"*",element:s.jsx(h1,{to:"/",replace:!0})})]})})}mT(document.getElementById("root")).render(s.jsx(E.StrictMode,{children:s.jsx(IL,{children:s.jsx(fye,{})})}));
207
+ //# sourceMappingURL=index-CjvoBhlz.js.map