agent-nuvira 3.3.6 โ 3.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/step-handoff.d.ts.map +1 -1
- package/dist/agents/step-handoff.js +11 -2
- package/dist/agents/step-handoff.js.map +1 -1
- package/dist/cli/process-control.d.ts.map +1 -1
- package/dist/cli/process-control.js +60 -37
- package/dist/cli/process-control.js.map +1 -1
- package/dist/learning/autonomy-policy.d.ts.map +1 -1
- package/dist/learning/autonomy-policy.js +10 -3
- package/dist/learning/autonomy-policy.js.map +1 -1
- package/dist/observability/debug-log.d.ts.map +1 -1
- package/dist/observability/debug-log.js +19 -1
- package/dist/observability/debug-log.js.map +1 -1
- package/package.json +3 -1
- package/src/web-dashboard/public/assets/index-J3sGSCLr.js +207 -0
- package/src/web-dashboard/public/assets/index-J3sGSCLr.js.map +1 -0
- package/src/web-dashboard/public/assets/index-u7mu-fxK.css +1 -0
- package/src/web-dashboard/public/index.html +2 -2
- package/dist/forwarded.d.ts +0 -2
- package/dist/forwarded.d.ts.map +0 -1
- package/dist/forwarded.js +0 -2
- package/dist/forwarded.js.map +0 -1
- package/dist/tools/child-agent-worker.d.ts +0 -15
- package/dist/tools/child-agent-worker.d.ts.map +0 -1
- package/dist/tools/child-agent-worker.js.map +0 -1
- package/src/web-dashboard/public/assets/index-BFquuwq9.js +0 -207
- package/src/web-dashboard/public/assets/index-BFquuwq9.js.map +0 -1
- package/src/web-dashboard/public/assets/index-CIJ6FHHZ.css +0 -1
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
var _2=Object.defineProperty;var j2=(e,t,n)=>t in e?_2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Hr=(e,t,n)=>j2(e,typeof t!="symbol"?t+"":t,n);function A2(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 Yi=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 bj={exports:{}},Fh={},xj={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 _u=Symbol.for("react.element"),C2=Symbol.for("react.portal"),T2=Symbol.for("react.fragment"),O2=Symbol.for("react.strict_mode"),P2=Symbol.for("react.profiler"),R2=Symbol.for("react.provider"),M2=Symbol.for("react.context"),I2=Symbol.for("react.forward_ref"),$2=Symbol.for("react.suspense"),L2=Symbol.for("react.memo"),D2=Symbol.for("react.lazy"),cw=Symbol.iterator;function B2(e){return e===null||typeof e!="object"?null:(e=cw&&e[cw]||e["@@iterator"],typeof e=="function"?e:null)}var wj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sj=Object.assign,kj={};function Qo(e,t,n){this.props=e,this.context=t,this.refs=kj,this.updater=n||wj}Qo.prototype.isReactComponent={};Qo.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")};Qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Nj(){}Nj.prototype=Qo.prototype;function Nb(e,t,n){this.props=e,this.context=t,this.refs=kj,this.updater=n||wj}var Eb=Nb.prototype=new Nj;Eb.constructor=Nb;Sj(Eb,Qo.prototype);Eb.isPureReactComponent=!0;var uw=Array.isArray,Ej=Object.prototype.hasOwnProperty,_b={current:null},_j={key:!0,ref:!0,__self:!0,__source:!0};function jj(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)Ej.call(t,r)&&!_j.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:_u,type:e,key:a,ref:o,props:i,_owner:_b.current}}function z2(e,t){return{$$typeof:_u,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function jb(e){return typeof e=="object"&&e!==null&&e.$$typeof===_u}function F2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var dw=/\/+/g;function um(e,t){return typeof e=="object"&&e!==null&&e.key!=null?F2(""+e.key):t.toString(36)}function Hd(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 _u:case C2:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+um(o,0):r,uw(i)?(n="",e!=null&&(n=e.replace(dw,"$&/")+"/"),Hd(i,t,n,"",function(u){return u})):i!=null&&(jb(i)&&(i=z2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(dw,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",uw(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+um(a,l);o+=Hd(a,t,n,c,i)}else if(c=B2(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+um(a,l++),o+=Hd(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 Ju(e,t,n){if(e==null)return e;var r=[],i=0;return Hd(e,r,"","",function(a){return t.call(n,a,i++)}),r}function U2(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 Cn={current:null},Gd={transition:null},W2={ReactCurrentDispatcher:Cn,ReactCurrentBatchConfig:Gd,ReactCurrentOwner:_b};function Aj(){throw Error("act(...) is not supported in production builds of React.")}ze.Children={map:Ju,forEach:function(e,t,n){Ju(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ju(e,function(){t++}),t},toArray:function(e){return Ju(e,function(t){return t})||[]},only:function(e){if(!jb(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ze.Component=Qo;ze.Fragment=T2;ze.Profiler=P2;ze.PureComponent=Nb;ze.StrictMode=O2;ze.Suspense=$2;ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W2;ze.act=Aj;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=_b.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Ej.call(t,c)&&!_j.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:_u,type:e.type,key:i,ref:a,props:r,_owner:o}};ze.createContext=function(e){return e={$$typeof:M2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:R2,_context:e},e.Consumer=e};ze.createElement=jj;ze.createFactory=function(e){var t=jj.bind(null,e);return t.type=e,t};ze.createRef=function(){return{current:null}};ze.forwardRef=function(e){return{$$typeof:I2,render:e}};ze.isValidElement=jb;ze.lazy=function(e){return{$$typeof:D2,_payload:{_status:-1,_result:e},_init:U2}};ze.memo=function(e,t){return{$$typeof:L2,type:e,compare:t===void 0?null:t}};ze.startTransition=function(e){var t=Gd.transition;Gd.transition={};try{e()}finally{Gd.transition=t}};ze.unstable_act=Aj;ze.useCallback=function(e,t){return Cn.current.useCallback(e,t)};ze.useContext=function(e){return Cn.current.useContext(e)};ze.useDebugValue=function(){};ze.useDeferredValue=function(e){return Cn.current.useDeferredValue(e)};ze.useEffect=function(e,t){return Cn.current.useEffect(e,t)};ze.useId=function(){return Cn.current.useId()};ze.useImperativeHandle=function(e,t,n){return Cn.current.useImperativeHandle(e,t,n)};ze.useInsertionEffect=function(e,t){return Cn.current.useInsertionEffect(e,t)};ze.useLayoutEffect=function(e,t){return Cn.current.useLayoutEffect(e,t)};ze.useMemo=function(e,t){return Cn.current.useMemo(e,t)};ze.useReducer=function(e,t,n){return Cn.current.useReducer(e,t,n)};ze.useRef=function(e){return Cn.current.useRef(e)};ze.useState=function(e){return Cn.current.useState(e)};ze.useSyncExternalStore=function(e,t,n){return Cn.current.useSyncExternalStore(e,t,n)};ze.useTransition=function(){return Cn.current.useTransition()};ze.version="18.3.1";xj.exports=ze;var N=xj.exports;const H=Ze(N),H2=A2({__proto__:null,default:H},[N]);/**
|
|
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 G2=N,q2=Symbol.for("react.element"),K2=Symbol.for("react.fragment"),V2=Object.prototype.hasOwnProperty,Y2=G2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,X2={key:!0,ref:!0,__self:!0,__source:!0};function Cj(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)V2.call(t,r)&&!X2.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:q2,type:e,key:a,ref:o,props:i,_owner:Y2.current}}Fh.Fragment=K2;Fh.jsx=Cj;Fh.jsxs=Cj;bj.exports=Fh;var s=bj.exports,Tj={exports:{}},ir={},Oj={exports:{}},Pj={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(O,U){var A=O.length;O.push(U);e:for(;0<A;){var Z=A-1>>>1,$=O[Z];if(0<i($,U))O[Z]=U,O[A]=$,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 U=O[0],A=O.pop();if(A!==U){O[0]=A;e:for(var Z=0,$=O.length,P=$>>>1;Z<P;){var oe=2*(Z+1)-1,be=O[oe],pe=oe+1,Ce=O[pe];if(0>i(be,A))pe<$&&0>i(Ce,be)?(O[Z]=Ce,O[pe]=A,Z=pe):(O[Z]=be,O[oe]=A,Z=oe);else if(pe<$&&0>i(Ce,A))O[Z]=Ce,O[pe]=A,Z=pe;else break e}}return U}function i(O,U){var A=O.sortIndex-U.sortIndex;return A!==0?A:O.id-U.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 w(O){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=O)r(u),U.sortIndex=U.expirationTime,t(c,U);else break;U=n(u)}}function k(O){if(m=!1,w(O),!g)if(n(c)!==null)g=!0,z(S);else{var U=n(u);U!==null&&R(k,U.startTime-O)}}function S(O,U){g=!1,m&&(m=!1,y(_),_=-1),p=!0;var A=h;try{for(w(U),f=n(c);f!==null&&(!(f.expirationTime>U)||O&&!L());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var $=Z(f.expirationTime<=U);U=e.unstable_now(),typeof $=="function"?f.callback=$:f===n(c)&&r(c),w(U)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var oe=n(u);oe!==null&&R(k,oe.startTime-U),P=!1}return P}finally{f=null,h=A,p=!1}}var x=!1,E=null,_=-1,C=5,T=-1;function L(){return!(e.unstable_now()-T<C)}function M(){if(E!==null){var O=e.unstable_now();T=O;var U=!0;try{U=E(!0,O)}finally{U?B():(x=!1,E=null)}}else x=!1}var B;if(typeof b=="function")B=function(){b(M)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,F=I.port2;I.port1.onmessage=M,B=function(){F.postMessage(null)}}else B=function(){v(M,0)};function z(O){E=O,x||(x=!0,B())}function R(O,U){_=v(function(){O(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,z(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 U=3;break;default:U=h}var A=h;h=U;try{return O()}finally{h=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,U){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var A=h;h=O;try{return U()}finally{h=A}},e.unstable_scheduleCallback=function(O,U,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 $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=A+$,O={id:d++,callback:U,priorityLevel:O,startTime:A,expirationTime:$,sortIndex:-1},A>Z?(O.sortIndex=A,t(u,O),n(c)===null&&O===n(u)&&(m?(y(_),_=-1):m=!0,R(k,A-Z))):(O.sortIndex=$,t(c,O),g||p||(g=!0,z(S))),O},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(O){var U=h;return function(){var A=h;h=U;try{return O.apply(this,arguments)}finally{h=A}}}})(Pj);Oj.exports=Pj;var Z2=Oj.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 Q2=N,nr=Z2;function se(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 Rj=new Set,wc={};function ys(e,t){wo(e,t),wo(e+"Capture",t)}function wo(e,t){for(wc[e]=t,e=0;e<t.length;e++)Rj.add(t[e])}var Ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wg=Object.prototype.hasOwnProperty,J2=/^[: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]*$/,fw={},hw={};function eI(e){return Wg.call(hw,e)?!0:Wg.call(fw,e)?!1:J2.test(e)?hw[e]=!0:(fw[e]=!0,!1)}function tI(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 nI(e,t,n,r){if(t===null||typeof t>"u"||tI(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 Tn(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 on={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){on[e]=new Tn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];on[t]=new Tn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){on[e]=new Tn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){on[e]=new Tn(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){on[e]=new Tn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){on[e]=new Tn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){on[e]=new Tn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){on[e]=new Tn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){on[e]=new Tn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ab=/[\-:]([a-z])/g;function Cb(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(Ab,Cb);on[t]=new Tn(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(Ab,Cb);on[t]=new Tn(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(Ab,Cb);on[t]=new Tn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){on[e]=new Tn(e,1,!1,e.toLowerCase(),null,!1,!1)});on.xlinkHref=new Tn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){on[e]=new Tn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Tb(e,t,n,r){var i=on.hasOwnProperty(t)?on[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(nI(t,n,i,r)&&(n=null),r||i===null?eI(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 Oi=Q2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ed=Symbol.for("react.element"),Ks=Symbol.for("react.portal"),Vs=Symbol.for("react.fragment"),Ob=Symbol.for("react.strict_mode"),Hg=Symbol.for("react.profiler"),Mj=Symbol.for("react.provider"),Ij=Symbol.for("react.context"),Pb=Symbol.for("react.forward_ref"),Gg=Symbol.for("react.suspense"),qg=Symbol.for("react.suspense_list"),Rb=Symbol.for("react.memo"),Ui=Symbol.for("react.lazy"),$j=Symbol.for("react.offscreen"),pw=Symbol.iterator;function Cl(e){return e===null||typeof e!="object"?null:(e=pw&&e[pw]||e["@@iterator"],typeof e=="function"?e:null)}var kt=Object.assign,dm;function Ql(e){if(dm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dm=t&&t[1]||""}return`
|
|
34
|
-
`+dm+e}var fm=!1;function hm(e,t){if(!e||fm)return"";fm=!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{fm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ql(e):""}function rI(e){switch(e.tag){case 5:return Ql(e.type);case 16:return Ql("Lazy");case 13:return Ql("Suspense");case 19:return Ql("SuspenseList");case 0:case 2:case 15:return e=hm(e.type,!1),e;case 11:return e=hm(e.type.render,!1),e;case 1:return e=hm(e.type,!0),e;default:return""}}function Kg(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 Vs:return"Fragment";case Ks:return"Portal";case Hg:return"Profiler";case Ob:return"StrictMode";case Gg:return"Suspense";case qg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ij:return(e.displayName||"Context")+".Consumer";case Mj:return(e._context.displayName||"Context")+".Provider";case Pb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rb:return t=e.displayName||null,t!==null?t:Kg(e.type)||"Memo";case Ui:t=e._payload,e=e._init;try{return Kg(e(t))}catch{}}return null}function iI(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 Kg(t);case 8:return t===Ob?"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 fa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function aI(e){var t=Lj(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 td(e){e._valueTracker||(e._valueTracker=aI(e))}function Dj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Lj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function sf(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 Vg(e,t){var n=t.checked;return kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fa(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 Bj(e,t){t=t.checked,t!=null&&Tb(e,"checked",t,!1)}function Yg(e,t){Bj(e,t);var n=fa(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")?Xg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xg(e,t.type,fa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gw(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 Xg(e,t,n){(t!=="number"||sf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Jl=Array.isArray;function uo(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=""+fa(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 Zg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return kt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function yw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(se(92));if(Jl(n)){if(1<n.length)throw Error(se(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:fa(n)}}function zj(e,t){var n=fa(t.value),r=fa(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 vw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Fj(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 Qg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Fj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var nd,Uj=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(nd=nd||document.createElement("div"),nd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=nd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Sc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ic={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},sI=["Webkit","ms","Moz","O"];Object.keys(ic).forEach(function(e){sI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ic[t]=ic[e]})});function Wj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ic.hasOwnProperty(e)&&ic[e]?(""+t).trim():t+"px"}function Hj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Wj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var oI=kt({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 Jg(e,t){if(t){if(oI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function ey(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 ty=null;function Mb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ny=null,fo=null,ho=null;function bw(e){if(e=Cu(e)){if(typeof ny!="function")throw Error(se(280));var t=e.stateNode;t&&(t=qh(t),ny(e.stateNode,e.type,t))}}function Gj(e){fo?ho?ho.push(e):ho=[e]:fo=e}function qj(){if(fo){var e=fo,t=ho;if(ho=fo=null,bw(e),t)for(e=0;e<t.length;e++)bw(t[e])}}function Kj(e,t){return e(t)}function Vj(){}var pm=!1;function Yj(e,t,n){if(pm)return e(t,n);pm=!0;try{return Kj(e,t,n)}finally{pm=!1,(fo!==null||ho!==null)&&(Vj(),qj())}}function kc(e,t){var n=e.stateNode;if(n===null)return null;var r=qh(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(se(231,t,typeof n));return n}var ry=!1;if(Ni)try{var Tl={};Object.defineProperty(Tl,"passive",{get:function(){ry=!0}}),window.addEventListener("test",Tl,Tl),window.removeEventListener("test",Tl,Tl)}catch{ry=!1}function lI(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 ac=!1,of=null,lf=!1,iy=null,cI={onError:function(e){ac=!0,of=e}};function uI(e,t,n,r,i,a,o,l,c){ac=!1,of=null,lI.apply(cI,arguments)}function dI(e,t,n,r,i,a,o,l,c){if(uI.apply(this,arguments),ac){if(ac){var u=of;ac=!1,of=null}else throw Error(se(198));lf||(lf=!0,iy=u)}}function vs(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 Xj(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 xw(e){if(vs(e)!==e)throw Error(se(188))}function fI(e){var t=e.alternate;if(!t){if(t=vs(e),t===null)throw Error(se(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 xw(i),e;if(a===r)return xw(i),t;a=a.sibling}throw Error(se(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(se(189))}}if(n.alternate!==r)throw Error(se(190))}if(n.tag!==3)throw Error(se(188));return n.stateNode.current===n?e:t}function Zj(e){return e=fI(e),e!==null?Qj(e):null}function Qj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Qj(e);if(t!==null)return t;e=e.sibling}return null}var Jj=nr.unstable_scheduleCallback,ww=nr.unstable_cancelCallback,hI=nr.unstable_shouldYield,pI=nr.unstable_requestPaint,Ct=nr.unstable_now,mI=nr.unstable_getCurrentPriorityLevel,Ib=nr.unstable_ImmediatePriority,eA=nr.unstable_UserBlockingPriority,cf=nr.unstable_NormalPriority,gI=nr.unstable_LowPriority,tA=nr.unstable_IdlePriority,Uh=null,Jr=null;function yI(e){if(Jr&&typeof Jr.onCommitFiberRoot=="function")try{Jr.onCommitFiberRoot(Uh,e,void 0,(e.current.flags&128)===128)}catch{}}var Rr=Math.clz32?Math.clz32:xI,vI=Math.log,bI=Math.LN2;function xI(e){return e>>>=0,e===0?32:31-(vI(e)/bI|0)|0}var rd=64,id=4194304;function ec(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 uf(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=ec(l):(a&=o,a!==0&&(r=ec(a)))}else o=n&~i,o!==0?r=ec(o):a!==0&&(r=ec(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-Rr(t),i=1<<n,r|=e[n],t&=~i;return r}function wI(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 SI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Rr(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&r)&&(i[o]=wI(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function ay(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function nA(){var e=rd;return rd<<=1,!(rd&4194240)&&(rd=64),e}function mm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ju(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Rr(t),e[t]=n}function kI(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-Rr(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function $b(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Rr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Qe=0;function rA(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var iA,Lb,aA,sA,oA,sy=!1,ad=[],ta=null,na=null,ra=null,Nc=new Map,Ec=new Map,Gi=[],NI="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 Sw(e,t){switch(e){case"focusin":case"focusout":ta=null;break;case"dragenter":case"dragleave":na=null;break;case"mouseover":case"mouseout":ra=null;break;case"pointerover":case"pointerout":Nc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ec.delete(t.pointerId)}}function Ol(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=Cu(t),t!==null&&Lb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function EI(e,t,n,r,i){switch(t){case"focusin":return ta=Ol(ta,e,t,n,r,i),!0;case"dragenter":return na=Ol(na,e,t,n,r,i),!0;case"mouseover":return ra=Ol(ra,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Nc.set(a,Ol(Nc.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Ec.set(a,Ol(Ec.get(a)||null,e,t,n,r,i)),!0}return!1}function lA(e){var t=Ha(e.target);if(t!==null){var n=vs(t);if(n!==null){if(t=n.tag,t===13){if(t=Xj(n),t!==null){e.blockedOn=t,oA(e.priority,function(){aA(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 qd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=oy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ty=r,n.target.dispatchEvent(r),ty=null}else return t=Cu(n),t!==null&&Lb(t),e.blockedOn=n,!1;t.shift()}return!0}function kw(e,t,n){qd(e)&&n.delete(t)}function _I(){sy=!1,ta!==null&&qd(ta)&&(ta=null),na!==null&&qd(na)&&(na=null),ra!==null&&qd(ra)&&(ra=null),Nc.forEach(kw),Ec.forEach(kw)}function Pl(e,t){e.blockedOn===t&&(e.blockedOn=null,sy||(sy=!0,nr.unstable_scheduleCallback(nr.unstable_NormalPriority,_I)))}function _c(e){function t(i){return Pl(i,e)}if(0<ad.length){Pl(ad[0],e);for(var n=1;n<ad.length;n++){var r=ad[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ta!==null&&Pl(ta,e),na!==null&&Pl(na,e),ra!==null&&Pl(ra,e),Nc.forEach(t),Ec.forEach(t),n=0;n<Gi.length;n++)r=Gi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Gi.length&&(n=Gi[0],n.blockedOn===null);)lA(n),n.blockedOn===null&&Gi.shift()}var po=Oi.ReactCurrentBatchConfig,df=!0;function jI(e,t,n,r){var i=Qe,a=po.transition;po.transition=null;try{Qe=1,Db(e,t,n,r)}finally{Qe=i,po.transition=a}}function AI(e,t,n,r){var i=Qe,a=po.transition;po.transition=null;try{Qe=4,Db(e,t,n,r)}finally{Qe=i,po.transition=a}}function Db(e,t,n,r){if(df){var i=oy(e,t,n,r);if(i===null)Em(e,t,r,ff,n),Sw(e,r);else if(EI(i,e,t,n,r))r.stopPropagation();else if(Sw(e,r),t&4&&-1<NI.indexOf(e)){for(;i!==null;){var a=Cu(i);if(a!==null&&iA(a),a=oy(e,t,n,r),a===null&&Em(e,t,r,ff,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Em(e,t,r,null,n)}}var ff=null;function oy(e,t,n,r){if(ff=null,e=Mb(r),e=Ha(e),e!==null)if(t=vs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Xj(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 ff=e,null}function cA(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(mI()){case Ib:return 1;case eA:return 4;case cf:case gI:return 16;case tA:return 536870912;default:return 16}default:return 16}}var Xi=null,Bb=null,Kd=null;function uA(){if(Kd)return Kd;var e,t=Bb,n=t.length,r,i="value"in Xi?Xi.value:Xi.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 Kd=i.slice(e,1<r?1-r:void 0)}function Vd(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 sd(){return!0}function Nw(){return!1}function ar(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)?sd:Nw,this.isPropagationStopped=Nw,this}return kt(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=sd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=sd)},persist:function(){},isPersistent:sd}),t}var Jo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zb=ar(Jo),Au=kt({},Jo,{view:0,detail:0}),CI=ar(Au),gm,ym,Rl,Wh=kt({},Au,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fb,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!==Rl&&(Rl&&e.type==="mousemove"?(gm=e.screenX-Rl.screenX,ym=e.screenY-Rl.screenY):ym=gm=0,Rl=e),gm)},movementY:function(e){return"movementY"in e?e.movementY:ym}}),Ew=ar(Wh),TI=kt({},Wh,{dataTransfer:0}),OI=ar(TI),PI=kt({},Au,{relatedTarget:0}),vm=ar(PI),RI=kt({},Jo,{animationName:0,elapsedTime:0,pseudoElement:0}),MI=ar(RI),II=kt({},Jo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$I=ar(II),LI=kt({},Jo,{data:0}),_w=ar(LI),DI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BI={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"},zI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function FI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zI[e])?!!t[e]:!1}function Fb(){return FI}var UI=kt({},Au,{key:function(e){if(e.key){var t=DI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?BI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fb,charCode:function(e){return e.type==="keypress"?Vd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),WI=ar(UI),HI=kt({},Wh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jw=ar(HI),GI=kt({},Au,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fb}),qI=ar(GI),KI=kt({},Jo,{propertyName:0,elapsedTime:0,pseudoElement:0}),VI=ar(KI),YI=kt({},Wh,{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}),XI=ar(YI),ZI=[9,13,27,32],Ub=Ni&&"CompositionEvent"in window,sc=null;Ni&&"documentMode"in document&&(sc=document.documentMode);var QI=Ni&&"TextEvent"in window&&!sc,dA=Ni&&(!Ub||sc&&8<sc&&11>=sc),Aw=" ",Cw=!1;function fA(e,t){switch(e){case"keyup":return ZI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ys=!1;function JI(e,t){switch(e){case"compositionend":return hA(t);case"keypress":return t.which!==32?null:(Cw=!0,Aw);case"textInput":return e=t.data,e===Aw&&Cw?null:e;default:return null}}function e$(e,t){if(Ys)return e==="compositionend"||!Ub&&fA(e,t)?(e=uA(),Kd=Bb=Xi=null,Ys=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return dA&&t.locale!=="ko"?null:t.data;default:return null}}var t$={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 Tw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!t$[e.type]:t==="textarea"}function pA(e,t,n,r){Gj(r),t=hf(t,"onChange"),0<t.length&&(n=new zb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var oc=null,jc=null;function n$(e){EA(e,0)}function Hh(e){var t=Qs(e);if(Dj(t))return e}function r$(e,t){if(e==="change")return t}var mA=!1;if(Ni){var bm;if(Ni){var xm="oninput"in document;if(!xm){var Ow=document.createElement("div");Ow.setAttribute("oninput","return;"),xm=typeof Ow.oninput=="function"}bm=xm}else bm=!1;mA=bm&&(!document.documentMode||9<document.documentMode)}function Pw(){oc&&(oc.detachEvent("onpropertychange",gA),jc=oc=null)}function gA(e){if(e.propertyName==="value"&&Hh(jc)){var t=[];pA(t,jc,e,Mb(e)),Yj(n$,t)}}function i$(e,t,n){e==="focusin"?(Pw(),oc=t,jc=n,oc.attachEvent("onpropertychange",gA)):e==="focusout"&&Pw()}function a$(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hh(jc)}function s$(e,t){if(e==="click")return Hh(t)}function o$(e,t){if(e==="input"||e==="change")return Hh(t)}function l$(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dr=typeof Object.is=="function"?Object.is:l$;function Ac(e,t){if(Dr(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(!Wg.call(t,i)||!Dr(e[i],t[i]))return!1}return!0}function Rw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mw(e,t){var n=Rw(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=Rw(n)}}function yA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vA(){for(var e=window,t=sf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=sf(e.document)}return t}function Wb(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 c$(e){var t=vA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&yA(n.ownerDocument.documentElement,n)){if(r!==null&&Wb(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=Mw(n,a);var o=Mw(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 u$=Ni&&"documentMode"in document&&11>=document.documentMode,Xs=null,ly=null,lc=null,cy=!1;function Iw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cy||Xs==null||Xs!==sf(r)||(r=Xs,"selectionStart"in r&&Wb(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}),lc&&Ac(lc,r)||(lc=r,r=hf(ly,"onSelect"),0<r.length&&(t=new zb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Xs)))}function od(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zs={animationend:od("Animation","AnimationEnd"),animationiteration:od("Animation","AnimationIteration"),animationstart:od("Animation","AnimationStart"),transitionend:od("Transition","TransitionEnd")},wm={},bA={};Ni&&(bA=document.createElement("div").style,"AnimationEvent"in window||(delete Zs.animationend.animation,delete Zs.animationiteration.animation,delete Zs.animationstart.animation),"TransitionEvent"in window||delete Zs.transitionend.transition);function Gh(e){if(wm[e])return wm[e];if(!Zs[e])return e;var t=Zs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in bA)return wm[e]=t[n];return e}var xA=Gh("animationend"),wA=Gh("animationiteration"),SA=Gh("animationstart"),kA=Gh("transitionend"),NA=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 ma(e,t){NA.set(e,t),ys(t,[e])}for(var Sm=0;Sm<$w.length;Sm++){var km=$w[Sm],d$=km.toLowerCase(),f$=km[0].toUpperCase()+km.slice(1);ma(d$,"on"+f$)}ma(xA,"onAnimationEnd");ma(wA,"onAnimationIteration");ma(SA,"onAnimationStart");ma("dblclick","onDoubleClick");ma("focusin","onFocus");ma("focusout","onBlur");ma(kA,"onTransitionEnd");wo("onMouseEnter",["mouseout","mouseover"]);wo("onMouseLeave",["mouseout","mouseover"]);wo("onPointerEnter",["pointerout","pointerover"]);wo("onPointerLeave",["pointerout","pointerover"]);ys("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ys("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ys("onBeforeInput",["compositionend","keypress","textInput","paste"]);ys("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tc="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(" "),h$=new Set("cancel close invalid load scroll toggle".split(" ").concat(tc));function Lw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,dI(r,t,void 0,e),e.currentTarget=null}function EA(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;Lw(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;Lw(i,l,u),a=c}}}if(lf)throw e=iy,lf=!1,iy=null,e}function ht(e,t){var n=t[py];n===void 0&&(n=t[py]=new Set);var r=e+"__bubble";n.has(r)||(_A(t,e,2,!1),n.add(r))}function Nm(e,t,n){var r=0;t&&(r|=4),_A(n,e,r,t)}var ld="_reactListening"+Math.random().toString(36).slice(2);function Cc(e){if(!e[ld]){e[ld]=!0,Rj.forEach(function(n){n!=="selectionchange"&&(h$.has(n)||Nm(n,!1,e),Nm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ld]||(t[ld]=!0,Nm("selectionchange",!1,t))}}function _A(e,t,n,r){switch(cA(t)){case 1:var i=jI;break;case 4:i=AI;break;default:i=Db}n=i.bind(null,t,n,e),i=void 0,!ry||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 Em(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=Ha(l),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue e}l=l.parentNode}}r=r.return}Yj(function(){var u=a,d=Mb(n),f=[];e:{var h=NA.get(e);if(h!==void 0){var p=zb,g=e;switch(e){case"keypress":if(Vd(n)===0)break e;case"keydown":case"keyup":p=WI;break;case"focusin":g="focus",p=vm;break;case"focusout":g="blur",p=vm;break;case"beforeblur":case"afterblur":p=vm;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=Ew;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=OI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=qI;break;case xA:case wA:case SA:p=MI;break;case kA:p=VI;break;case"scroll":p=CI;break;case"wheel":p=XI;break;case"copy":case"cut":case"paste":p=$I;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=jw}var m=(t&4)!==0,v=!m&&e==="scroll",y=m?h!==null?h+"Capture":null:h;m=[];for(var b=u,w;b!==null;){w=b;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,y!==null&&(k=kc(b,y),k!=null&&m.push(Tc(b,k,w)))),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!==ty&&(g=n.relatedTarget||n.fromElement)&&(Ha(g)||g[Ei]))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?Ha(g):null,g!==null&&(v=vs(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(m=Ew,k="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(m=jw,k="onPointerLeave",y="onPointerEnter",b="pointer"),v=p==null?h:Qs(p),w=g==null?h:Qs(g),h=new m(k,b+"leave",p,n,d),h.target=v,h.relatedTarget=w,k=null,Ha(d)===u&&(m=new m(y,b+"enter",g,n,d),m.target=w,m.relatedTarget=v,k=m),v=k,p&&g)t:{for(m=p,y=g,b=0,w=m;w;w=$s(w))b++;for(w=0,k=y;k;k=$s(k))w++;for(;0<b-w;)m=$s(m),b--;for(;0<w-b;)y=$s(y),w--;for(;b--;){if(m===y||y!==null&&m===y.alternate)break t;m=$s(m),y=$s(y)}m=null}else m=null;p!==null&&Dw(f,h,p,m,!1),g!==null&&v!==null&&Dw(f,v,g,m,!0)}}e:{if(h=u?Qs(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=r$;else if(Tw(h))if(mA)S=o$;else{S=a$;var x=i$}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=s$);if(S&&(S=S(e,u))){pA(f,S,n,d);break e}x&&x(e,h,u),e==="focusout"&&(x=h._wrapperState)&&x.controlled&&h.type==="number"&&Xg(h,"number",h.value)}switch(x=u?Qs(u):window,e){case"focusin":(Tw(x)||x.contentEditable==="true")&&(Xs=x,ly=u,lc=null);break;case"focusout":lc=ly=Xs=null;break;case"mousedown":cy=!0;break;case"contextmenu":case"mouseup":case"dragend":cy=!1,Iw(f,n,d);break;case"selectionchange":if(u$)break;case"keydown":case"keyup":Iw(f,n,d)}var E;if(Ub)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Ys?fA(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(dA&&n.locale!=="ko"&&(Ys||_!=="onCompositionStart"?_==="onCompositionEnd"&&Ys&&(E=uA()):(Xi=d,Bb="value"in Xi?Xi.value:Xi.textContent,Ys=!0)),x=hf(u,_),0<x.length&&(_=new _w(_,e,null,n,d),f.push({event:_,listeners:x}),E?_.data=E:(E=hA(n),E!==null&&(_.data=E)))),(E=QI?JI(e,n):e$(e,n))&&(u=hf(u,"onBeforeInput"),0<u.length&&(d=new _w("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=E))}EA(f,t)})}function Tc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hf(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=kc(e,n),a!=null&&r.unshift(Tc(e,a,i)),a=kc(e,t),a!=null&&r.push(Tc(e,a,i))),e=e.return}return r}function $s(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Dw(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=kc(n,a),c!=null&&o.unshift(Tc(n,c,l))):i||(c=kc(n,a),c!=null&&o.push(Tc(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var p$=/\r\n?/g,m$=/\u0000|\uFFFD/g;function Bw(e){return(typeof e=="string"?e:""+e).replace(p$,`
|
|
38
|
-
`).replace(m$,"")}function cd(e,t,n){if(t=Bw(t),Bw(e)!==t&&n)throw Error(se(425))}function pf(){}var uy=null,dy=null;function fy(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 hy=typeof setTimeout=="function"?setTimeout:void 0,g$=typeof clearTimeout=="function"?clearTimeout:void 0,zw=typeof Promise=="function"?Promise:void 0,y$=typeof queueMicrotask=="function"?queueMicrotask:typeof zw<"u"?function(e){return zw.resolve(null).then(e).catch(v$)}:hy;function v$(e){setTimeout(function(){throw e})}function _m(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),_c(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);_c(t)}function ia(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 Fw(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 el=Math.random().toString(36).slice(2),Yr="__reactFiber$"+el,Oc="__reactProps$"+el,Ei="__reactContainer$"+el,py="__reactEvents$"+el,b$="__reactListeners$"+el,x$="__reactHandles$"+el;function Ha(e){var t=e[Yr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ei]||n[Yr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fw(e);e!==null;){if(n=e[Yr])return n;e=Fw(e)}return t}e=n,n=e.parentNode}return null}function Cu(e){return e=e[Yr]||e[Ei],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Qs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function qh(e){return e[Oc]||null}var my=[],Js=-1;function ga(e){return{current:e}}function yt(e){0>Js||(e.current=my[Js],my[Js]=null,Js--)}function dt(e,t){Js++,my[Js]=e.current,e.current=t}var ha={},bn=ga(ha),Ln=ga(!1),ss=ha;function So(e,t){var n=e.type.contextTypes;if(!n)return ha;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 Dn(e){return e=e.childContextTypes,e!=null}function mf(){yt(Ln),yt(bn)}function Uw(e,t,n){if(bn.current!==ha)throw Error(se(168));dt(bn,t),dt(Ln,n)}function jA(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(se(108,iI(e)||"Unknown",i));return kt({},n,r)}function gf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ha,ss=bn.current,dt(bn,e),dt(Ln,Ln.current),!0}function Ww(e,t,n){var r=e.stateNode;if(!r)throw Error(se(169));n?(e=jA(e,t,ss),r.__reactInternalMemoizedMergedChildContext=e,yt(Ln),yt(bn),dt(bn,e)):yt(Ln),dt(Ln,n)}var pi=null,Kh=!1,jm=!1;function AA(e){pi===null?pi=[e]:pi.push(e)}function w$(e){Kh=!0,AA(e)}function ya(){if(!jm&&pi!==null){jm=!0;var e=0,t=Qe;try{var n=pi;for(Qe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}pi=null,Kh=!1}catch(i){throw pi!==null&&(pi=pi.slice(e+1)),Jj(Ib,ya),i}finally{Qe=t,jm=!1}}return null}var eo=[],to=0,yf=null,vf=0,dr=[],fr=0,os=null,mi=1,gi="";function Ia(e,t){eo[to++]=vf,eo[to++]=yf,yf=e,vf=t}function CA(e,t,n){dr[fr++]=mi,dr[fr++]=gi,dr[fr++]=os,os=e;var r=mi;e=gi;var i=32-Rr(r)-1;r&=~(1<<i),n+=1;var a=32-Rr(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,mi=1<<32-Rr(t)+i|n<<i|r,gi=a+e}else mi=1<<a|n<<i|r,gi=e}function Hb(e){e.return!==null&&(Ia(e,1),CA(e,1,0))}function Gb(e){for(;e===yf;)yf=eo[--to],eo[to]=null,vf=eo[--to],eo[to]=null;for(;e===os;)os=dr[--fr],dr[fr]=null,gi=dr[--fr],dr[fr]=null,mi=dr[--fr],dr[fr]=null}var er=null,Jn=null,vt=!1,Tr=null;function TA(e,t){var n=pr(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 Hw(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,er=e,Jn=ia(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,er=e,Jn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=os!==null?{id:mi,overflow:gi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=pr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,er=e,Jn=null,!0):!1;default:return!1}}function gy(e){return(e.mode&1)!==0&&(e.flags&128)===0}function yy(e){if(vt){var t=Jn;if(t){var n=t;if(!Hw(e,t)){if(gy(e))throw Error(se(418));t=ia(n.nextSibling);var r=er;t&&Hw(e,t)?TA(r,n):(e.flags=e.flags&-4097|2,vt=!1,er=e)}}else{if(gy(e))throw Error(se(418));e.flags=e.flags&-4097|2,vt=!1,er=e}}}function Gw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;er=e}function ud(e){if(e!==er)return!1;if(!vt)return Gw(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fy(e.type,e.memoizedProps)),t&&(t=Jn)){if(gy(e))throw OA(),Error(se(418));for(;t;)TA(e,t),t=ia(t.nextSibling)}if(Gw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Jn=ia(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Jn=null}}else Jn=er?ia(e.stateNode.nextSibling):null;return!0}function OA(){for(var e=Jn;e;)e=ia(e.nextSibling)}function ko(){Jn=er=null,vt=!1}function qb(e){Tr===null?Tr=[e]:Tr.push(e)}var S$=Oi.ReactCurrentBatchConfig;function Ml(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(se(309));var r=n.stateNode}if(!r)throw Error(se(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(se(284));if(!n._owner)throw Error(se(290,e))}return e}function dd(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function qw(e){var t=e._init;return t(e._payload)}function PA(e){function t(y,b){if(e){var w=y.deletions;w===null?(y.deletions=[b],y.flags|=16):w.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=la(y,b),y.index=0,y.sibling=null,y}function a(y,b,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<b?(y.flags|=2,b):w):(y.flags|=2,b)):(y.flags|=1048576,b)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,w,k){return b===null||b.tag!==6?(b=Mm(w,y.mode,k),b.return=y,b):(b=i(b,w),b.return=y,b)}function c(y,b,w,k){var S=w.type;return S===Vs?d(y,b,w.props.children,k,w.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ui&&qw(S)===b.type)?(k=i(b,w.props),k.ref=Ml(y,b,w),k.return=y,k):(k=tf(w.type,w.key,w.props,null,y.mode,k),k.ref=Ml(y,b,w),k.return=y,k)}function u(y,b,w,k){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=Im(w,y.mode,k),b.return=y,b):(b=i(b,w.children||[]),b.return=y,b)}function d(y,b,w,k,S){return b===null||b.tag!==7?(b=Ja(w,y.mode,k,S),b.return=y,b):(b=i(b,w),b.return=y,b)}function f(y,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=Mm(""+b,y.mode,w),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case ed:return w=tf(b.type,b.key,b.props,null,y.mode,w),w.ref=Ml(y,null,b),w.return=y,w;case Ks:return b=Im(b,y.mode,w),b.return=y,b;case Ui:var k=b._init;return f(y,k(b._payload),w)}if(Jl(b)||Cl(b))return b=Ja(b,y.mode,w,null),b.return=y,b;dd(y,b)}return null}function h(y,b,w,k){var S=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:l(y,b,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ed:return w.key===S?c(y,b,w,k):null;case Ks:return w.key===S?u(y,b,w,k):null;case Ui:return S=w._init,h(y,b,S(w._payload),k)}if(Jl(w)||Cl(w))return S!==null?null:d(y,b,w,k,null);dd(y,w)}return null}function p(y,b,w,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return y=y.get(w)||null,l(b,y,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case ed:return y=y.get(k.key===null?w:k.key)||null,c(b,y,k,S);case Ks:return y=y.get(k.key===null?w:k.key)||null,u(b,y,k,S);case Ui:var x=k._init;return p(y,b,w,x(k._payload),S)}if(Jl(k)||Cl(k))return y=y.get(w)||null,d(b,y,k,S,null);dd(b,k)}return null}function g(y,b,w,k){for(var S=null,x=null,E=b,_=b=0,C=null;E!==null&&_<w.length;_++){E.index>_?(C=E,E=null):C=E.sibling;var T=h(y,E,w[_],k);if(T===null){E===null&&(E=C);break}e&&E&&T.alternate===null&&t(y,E),b=a(T,b,_),x===null?S=T:x.sibling=T,x=T,E=C}if(_===w.length)return n(y,E),vt&&Ia(y,_),S;if(E===null){for(;_<w.length;_++)E=f(y,w[_],k),E!==null&&(b=a(E,b,_),x===null?S=E:x.sibling=E,x=E);return vt&&Ia(y,_),S}for(E=r(y,E);_<w.length;_++)C=p(E,y,_,w[_],k),C!==null&&(e&&C.alternate!==null&&E.delete(C.key===null?_:C.key),b=a(C,b,_),x===null?S=C:x.sibling=C,x=C);return e&&E.forEach(function(L){return t(y,L)}),vt&&Ia(y,_),S}function m(y,b,w,k){var S=Cl(w);if(typeof S!="function")throw Error(se(150));if(w=S.call(w),w==null)throw Error(se(151));for(var x=S=null,E=b,_=b=0,C=null,T=w.next();E!==null&&!T.done;_++,T=w.next()){E.index>_?(C=E,E=null):C=E.sibling;var L=h(y,E,T.value,k);if(L===null){E===null&&(E=C);break}e&&E&&L.alternate===null&&t(y,E),b=a(L,b,_),x===null?S=L:x.sibling=L,x=L,E=C}if(T.done)return n(y,E),vt&&Ia(y,_),S;if(E===null){for(;!T.done;_++,T=w.next())T=f(y,T.value,k),T!==null&&(b=a(T,b,_),x===null?S=T:x.sibling=T,x=T);return vt&&Ia(y,_),S}for(E=r(y,E);!T.done;_++,T=w.next())T=p(E,y,_,T.value,k),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?_:T.key),b=a(T,b,_),x===null?S=T:x.sibling=T,x=T);return e&&E.forEach(function(M){return t(y,M)}),vt&&Ia(y,_),S}function v(y,b,w,k){if(typeof w=="object"&&w!==null&&w.type===Vs&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ed:e:{for(var S=w.key,x=b;x!==null;){if(x.key===S){if(S=w.type,S===Vs){if(x.tag===7){n(y,x.sibling),b=i(x,w.props.children),b.return=y,y=b;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ui&&qw(S)===x.type){n(y,x.sibling),b=i(x,w.props),b.ref=Ml(y,x,w),b.return=y,y=b;break e}n(y,x);break}else t(y,x);x=x.sibling}w.type===Vs?(b=Ja(w.props.children,y.mode,k,w.key),b.return=y,y=b):(k=tf(w.type,w.key,w.props,null,y.mode,k),k.ref=Ml(y,b,w),k.return=y,y=k)}return o(y);case Ks:e:{for(x=w.key;b!==null;){if(b.key===x)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(y,b.sibling),b=i(b,w.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Im(w,y.mode,k),b.return=y,y=b}return o(y);case Ui:return x=w._init,v(y,b,x(w._payload),k)}if(Jl(w))return g(y,b,w,k);if(Cl(w))return m(y,b,w,k);dd(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(y,b.sibling),b=i(b,w),b.return=y,y=b):(n(y,b),b=Mm(w,y.mode,k),b.return=y,y=b),o(y)):n(y,b)}return v}var No=PA(!0),RA=PA(!1),bf=ga(null),xf=null,no=null,Kb=null;function Vb(){Kb=no=xf=null}function Yb(e){var t=bf.current;yt(bf),e._currentValue=t}function vy(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 mo(e,t){xf=e,Kb=no=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(In=!0),e.firstContext=null)}function vr(e){var t=e._currentValue;if(Kb!==e)if(e={context:e,memoizedValue:t,next:null},no===null){if(xf===null)throw Error(se(308));no=e,xf.dependencies={lanes:0,firstContext:e}}else no=no.next=e;return t}var Ga=null;function Xb(e){Ga===null?Ga=[e]:Ga.push(e)}function MA(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Xb(t)):(n.next=i.next,i.next=n),t.interleaved=n,_i(e,r)}function _i(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 Wi=!1;function Zb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function IA(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 xi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function aa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,We&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,_i(e,n)}return i=r.interleaved,i===null?(t.next=t,Xb(r)):(t.next=i.next,i.next=t),r.interleaved=t,_i(e,n)}function Yd(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,$b(e,n)}}function Kw(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 wf(e,t,n,r){var i=e.updateQueue;Wi=!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=kt({},f,h);break e;case 2:Wi=!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);cs|=o,e.lanes=o,e.memoizedState=f}}function Vw(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(se(191,i));i.call(r)}}}var Tu={},ei=ga(Tu),Pc=ga(Tu),Rc=ga(Tu);function qa(e){if(e===Tu)throw Error(se(174));return e}function Qb(e,t){switch(dt(Rc,t),dt(Pc,e),dt(ei,Tu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qg(t,e)}yt(ei),dt(ei,t)}function Eo(){yt(ei),yt(Pc),yt(Rc)}function $A(e){qa(Rc.current);var t=qa(ei.current),n=Qg(t,e.type);t!==n&&(dt(Pc,e),dt(ei,n))}function Jb(e){Pc.current===e&&(yt(ei),yt(Pc))}var xt=ga(0);function Sf(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 Am=[];function ex(){for(var e=0;e<Am.length;e++)Am[e]._workInProgressVersionPrimary=null;Am.length=0}var Xd=Oi.ReactCurrentDispatcher,Cm=Oi.ReactCurrentBatchConfig,ls=0,wt=null,Ut=null,Vt=null,kf=!1,cc=!1,Mc=0,k$=0;function un(){throw Error(se(321))}function tx(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dr(e[n],t[n]))return!1;return!0}function nx(e,t,n,r,i,a){if(ls=a,wt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xd.current=e===null||e.memoizedState===null?j$:A$,e=n(r,i),cc){a=0;do{if(cc=!1,Mc=0,25<=a)throw Error(se(301));a+=1,Vt=Ut=null,t.updateQueue=null,Xd.current=C$,e=n(r,i)}while(cc)}if(Xd.current=Nf,t=Ut!==null&&Ut.next!==null,ls=0,Vt=Ut=wt=null,kf=!1,t)throw Error(se(300));return e}function rx(){var e=Mc!==0;return Mc=0,e}function Kr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?wt.memoizedState=Vt=e:Vt=Vt.next=e,Vt}function br(){if(Ut===null){var e=wt.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var t=Vt===null?wt.memoizedState:Vt.next;if(t!==null)Vt=t,Ut=e;else{if(e===null)throw Error(se(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Vt===null?wt.memoizedState=Vt=e:Vt=Vt.next=e}return Vt}function Ic(e,t){return typeof t=="function"?t(e):t}function Tm(e){var t=br(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var r=Ut,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((ls&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,wt.lanes|=d,cs|=d}u=u.next}while(u!==null&&u!==a);c===null?o=r:c.next=l,Dr(r,t.memoizedState)||(In=!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,wt.lanes|=a,cs|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Om(e){var t=br(),n=t.queue;if(n===null)throw Error(se(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);Dr(a,t.memoizedState)||(In=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function LA(){}function DA(e,t){var n=wt,r=br(),i=t(),a=!Dr(r.memoizedState,i);if(a&&(r.memoizedState=i,In=!0),r=r.queue,ix(FA.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Vt!==null&&Vt.memoizedState.tag&1){if(n.flags|=2048,$c(9,zA.bind(null,n,r,i,t),void 0,null),Xt===null)throw Error(se(349));ls&30||BA(n,t,i)}return i}function BA(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=wt.updateQueue,t===null?(t={lastEffect:null,stores:null},wt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zA(e,t,n,r){t.value=n,t.getSnapshot=r,UA(t)&&WA(e)}function FA(e,t,n){return n(function(){UA(t)&&WA(e)})}function UA(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dr(e,n)}catch{return!0}}function WA(e){var t=_i(e,1);t!==null&&Mr(t,e,1,-1)}function Yw(e){var t=Kr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ic,lastRenderedState:e},t.queue=e,e=e.dispatch=_$.bind(null,wt,e),[t.memoizedState,e]}function $c(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=wt.updateQueue,t===null?(t={lastEffect:null,stores:null},wt.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 HA(){return br().memoizedState}function Zd(e,t,n,r){var i=Kr();wt.flags|=e,i.memoizedState=$c(1|t,n,void 0,r===void 0?null:r)}function Vh(e,t,n,r){var i=br();r=r===void 0?null:r;var a=void 0;if(Ut!==null){var o=Ut.memoizedState;if(a=o.destroy,r!==null&&tx(r,o.deps)){i.memoizedState=$c(t,n,a,r);return}}wt.flags|=e,i.memoizedState=$c(1|t,n,a,r)}function Xw(e,t){return Zd(8390656,8,e,t)}function ix(e,t){return Vh(2048,8,e,t)}function GA(e,t){return Vh(4,2,e,t)}function qA(e,t){return Vh(4,4,e,t)}function KA(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 VA(e,t,n){return n=n!=null?n.concat([e]):null,Vh(4,4,KA.bind(null,t,e),n)}function ax(){}function YA(e,t){var n=br();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tx(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function XA(e,t){var n=br();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tx(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ZA(e,t,n){return ls&21?(Dr(n,t)||(n=nA(),wt.lanes|=n,cs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,In=!0),e.memoizedState=n)}function N$(e,t){var n=Qe;Qe=n!==0&&4>n?n:4,e(!0);var r=Cm.transition;Cm.transition={};try{e(!1),t()}finally{Qe=n,Cm.transition=r}}function QA(){return br().memoizedState}function E$(e,t,n){var r=oa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},JA(e))eC(t,n);else if(n=MA(e,t,n,r),n!==null){var i=An();Mr(n,e,r,i),tC(n,t,r)}}function _$(e,t,n){var r=oa(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(JA(e))eC(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,Dr(l,o)){var c=t.interleaved;c===null?(i.next=i,Xb(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=MA(e,t,i,r),n!==null&&(i=An(),Mr(n,e,r,i),tC(n,t,r))}}function JA(e){var t=e.alternate;return e===wt||t!==null&&t===wt}function eC(e,t){cc=kf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function tC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$b(e,n)}}var Nf={readContext:vr,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},j$={readContext:vr,useCallback:function(e,t){return Kr().memoizedState=[e,t===void 0?null:t],e},useContext:vr,useEffect:Xw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zd(4194308,4,KA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zd(4,2,e,t)},useMemo:function(e,t){var n=Kr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Kr();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=E$.bind(null,wt,e),[r.memoizedState,e]},useRef:function(e){var t=Kr();return e={current:e},t.memoizedState=e},useState:Yw,useDebugValue:ax,useDeferredValue:function(e){return Kr().memoizedState=e},useTransition:function(){var e=Yw(!1),t=e[0];return e=N$.bind(null,e[1]),Kr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=wt,i=Kr();if(vt){if(n===void 0)throw Error(se(407));n=n()}else{if(n=t(),Xt===null)throw Error(se(349));ls&30||BA(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Xw(FA.bind(null,r,a,e),[e]),r.flags|=2048,$c(9,zA.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Kr(),t=Xt.identifierPrefix;if(vt){var n=gi,r=mi;n=(r&~(1<<32-Rr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=k$++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},A$={readContext:vr,useCallback:YA,useContext:vr,useEffect:ix,useImperativeHandle:VA,useInsertionEffect:GA,useLayoutEffect:qA,useMemo:XA,useReducer:Tm,useRef:HA,useState:function(){return Tm(Ic)},useDebugValue:ax,useDeferredValue:function(e){var t=br();return ZA(t,Ut.memoizedState,e)},useTransition:function(){var e=Tm(Ic)[0],t=br().memoizedState;return[e,t]},useMutableSource:LA,useSyncExternalStore:DA,useId:QA,unstable_isNewReconciler:!1},C$={readContext:vr,useCallback:YA,useContext:vr,useEffect:ix,useImperativeHandle:VA,useInsertionEffect:GA,useLayoutEffect:qA,useMemo:XA,useReducer:Om,useRef:HA,useState:function(){return Om(Ic)},useDebugValue:ax,useDeferredValue:function(e){var t=br();return Ut===null?t.memoizedState=e:ZA(t,Ut.memoizedState,e)},useTransition:function(){var e=Om(Ic)[0],t=br().memoizedState;return[e,t]},useMutableSource:LA,useSyncExternalStore:DA,useId:QA,unstable_isNewReconciler:!1};function jr(e,t){if(e&&e.defaultProps){t=kt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function by(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:kt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Yh={isMounted:function(e){return(e=e._reactInternals)?vs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=An(),i=oa(e),a=xi(r,i);a.payload=t,n!=null&&(a.callback=n),t=aa(e,a,i),t!==null&&(Mr(t,e,i,r),Yd(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=An(),i=oa(e),a=xi(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=aa(e,a,i),t!==null&&(Mr(t,e,i,r),Yd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=An(),r=oa(e),i=xi(n,r);i.tag=2,t!=null&&(i.callback=t),t=aa(e,i,r),t!==null&&(Mr(t,e,r,n),Yd(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?!Ac(n,r)||!Ac(i,a):!0}function nC(e,t,n){var r=!1,i=ha,a=t.contextType;return typeof a=="object"&&a!==null?a=vr(a):(i=Dn(t)?ss:bn.current,r=t.contextTypes,a=(r=r!=null)?So(e,i):ha),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Yh,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Qw(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&&Yh.enqueueReplaceState(t,t.state,null)}function xy(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Zb(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=vr(a):(a=Dn(t)?ss:bn.current,i.context=So(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(by(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&&Yh.enqueueReplaceState(i,i.state,null),wf(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function _o(e,t){try{var n="",r=t;do n+=rI(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 Pm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function wy(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var T$=typeof WeakMap=="function"?WeakMap:Map;function rC(e,t,n){n=xi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_f||(_f=!0,Oy=r),wy(e,t)},n}function iC(e,t,n){n=xi(-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(){wy(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){wy(e,t),typeof r!="function"&&(sa===null?sa=new Set([this]):sa.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Jw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new T$;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=H$.bind(null,e,t,n),t.then(e,e))}function e1(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 t1(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=xi(-1,1),t.tag=2,aa(n,t,1))),n.lanes|=1),e)}var O$=Oi.ReactCurrentOwner,In=!1;function En(e,t,n,r){t.child=e===null?RA(t,null,n,r):No(t,e.child,n,r)}function n1(e,t,n,r,i){n=n.render;var a=t.ref;return mo(t,i),r=nx(e,t,n,r,a,i),n=rx(),e!==null&&!In?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ji(e,t,i)):(vt&&n&&Hb(t),t.flags|=1,En(e,t,r,i),t.child)}function r1(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!hx(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,aC(e,t,a,r,i)):(e=tf(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:Ac,n(o,r)&&e.ref===t.ref)return ji(e,t,i)}return t.flags|=1,e=la(a,r),e.ref=t.ref,e.return=t,t.child=e}function aC(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ac(a,r)&&e.ref===t.ref)if(In=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(In=!0);else return t.lanes=e.lanes,ji(e,t,i)}return Sy(e,t,n,r,i)}function sC(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},dt(io,Xn),Xn|=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,dt(io,Xn),Xn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,dt(io,Xn),Xn|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,dt(io,Xn),Xn|=r;return En(e,t,i,n),t.child}function oC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Sy(e,t,n,r,i){var a=Dn(n)?ss:bn.current;return a=So(t,a),mo(t,i),n=nx(e,t,n,r,a,i),r=rx(),e!==null&&!In?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ji(e,t,i)):(vt&&r&&Hb(t),t.flags|=1,En(e,t,n,i),t.child)}function i1(e,t,n,r,i){if(Dn(n)){var a=!0;gf(t)}else a=!1;if(mo(t,i),t.stateNode===null)Qd(e,t),nC(t,n,r),xy(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=vr(u):(u=Dn(n)?ss:bn.current,u=So(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)&&Qw(t,o,r,u),Wi=!1;var h=t.memoizedState;o.state=h,wf(t,r,o,i),c=t.memoizedState,l!==r||h!==c||Ln.current||Wi?(typeof d=="function"&&(by(t,n,d,r),c=t.memoizedState),(l=Wi||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,IA(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:jr(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=vr(c):(c=Dn(n)?ss:bn.current,c=So(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)&&Qw(t,o,r,c),Wi=!1,h=t.memoizedState,o.state=h,wf(t,r,o,i);var g=t.memoizedState;l!==f||h!==g||Ln.current||Wi?(typeof p=="function"&&(by(t,n,p,r),g=t.memoizedState),(u=Wi||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 ky(e,t,n,r,a,i)}function ky(e,t,n,r,i,a){oC(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Ww(t,n,!1),ji(e,t,a);r=t.stateNode,O$.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=No(t,e.child,null,a),t.child=No(t,null,l,a)):En(e,t,l,a),t.memoizedState=r.state,i&&Ww(t,n,!0),t.child}function lC(e){var t=e.stateNode;t.pendingContext?Uw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Uw(e,t.context,!1),Qb(e,t.containerInfo)}function a1(e,t,n,r,i){return ko(),qb(i),t.flags|=256,En(e,t,n,r),t.child}var Ny={dehydrated:null,treeContext:null,retryLane:0};function Ey(e){return{baseLanes:e,cachePool:null,transitions:null}}function cC(e,t,n){var r=t.pendingProps,i=xt.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),dt(xt,i&1),e===null)return yy(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=Qh(o,r,0,null),e=Ja(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ey(n),t.memoizedState=Ny,e):sx(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=la(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=la(l,a):(a=Ja(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?Ey(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Ny,r}return a=e.child,e=a.sibling,r=la(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 sx(e,t){return t=Qh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fd(e,t,n,r){return r!==null&&qb(r),No(t,e.child,null,n),e=sx(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=Pm(Error(se(422))),fd(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Qh({mode:"visible",children:r.children},i,0,null),a=Ja(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&No(t,e.child,null,o),t.child.memoizedState=Ey(o),t.memoizedState=Ny,a);if(!(t.mode&1))return fd(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(se(419)),r=Pm(a,r,void 0),fd(e,t,o,r)}if(l=(o&e.childLanes)!==0,In||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,_i(e,i),Mr(r,e,i,-1))}return fx(),r=Pm(Error(se(421))),fd(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=G$.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Jn=ia(i.nextSibling),er=t,vt=!0,Tr=null,e!==null&&(dr[fr++]=mi,dr[fr++]=gi,dr[fr++]=os,mi=e.id,gi=e.overflow,os=t),t=sx(t,r.children),t.flags|=4096,t)}function s1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),vy(e.return,t,n)}function Rm(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 uC(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(En(e,t,r.children,n),r=xt.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&&s1(e,n,t);else if(e.tag===19)s1(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(dt(xt,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&&Sf(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Rm(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&&Sf(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Rm(t,!0,n,null,a);break;case"together":Rm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Qd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ji(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,n=la(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=la(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function R$(e,t,n){switch(t.tag){case 3:lC(t),ko();break;case 5:$A(t);break;case 1:Dn(t.type)&&gf(t);break;case 4:Qb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;dt(bf,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(dt(xt,xt.current&1),t.flags|=128,null):n&t.child.childLanes?cC(e,t,n):(dt(xt,xt.current&1),e=ji(e,t,n),e!==null?e.sibling:null);dt(xt,xt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return uC(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),dt(xt,xt.current),r)break;return null;case 22:case 23:return t.lanes=0,sC(e,t,n)}return ji(e,t,n)}var dC,_y,fC,hC;dC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};_y=function(){};fC=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,qa(ei.current);var a=null;switch(n){case"input":i=Vg(e,i),r=Vg(e,r),a=[];break;case"select":i=kt({},i,{value:void 0}),r=kt({},r,{value:void 0}),a=[];break;case"textarea":i=Zg(e,i),r=Zg(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=pf)}Jg(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"&&(wc.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"&&(wc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ht("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)}};hC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Il(e,t){if(!vt)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 dn(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 M$(e,t,n){var r=t.pendingProps;switch(Gb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(t),null;case 1:return Dn(t.type)&&mf(),dn(t),null;case 3:return r=t.stateNode,Eo(),yt(Ln),yt(bn),ex(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ud(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tr!==null&&(My(Tr),Tr=null))),_y(e,t),dn(t),null;case 5:Jb(t);var i=qa(Rc.current);if(n=t.type,e!==null&&t.stateNode!=null)fC(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(se(166));return dn(t),null}if(e=qa(ei.current),ud(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Yr]=t,r[Oc]=a,e=(t.mode&1)!==0,n){case"dialog":ht("cancel",r),ht("close",r);break;case"iframe":case"object":case"embed":ht("load",r);break;case"video":case"audio":for(i=0;i<tc.length;i++)ht(tc[i],r);break;case"source":ht("error",r);break;case"img":case"image":case"link":ht("error",r),ht("load",r);break;case"details":ht("toggle",r);break;case"input":mw(r,a),ht("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},ht("invalid",r);break;case"textarea":yw(r,a),ht("invalid",r)}Jg(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&&cd(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&cd(r.textContent,l,e),i=["children",""+l]):wc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ht("scroll",r)}switch(n){case"input":td(r),gw(r,a,!0);break;case"textarea":td(r),vw(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=pf)}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=Fj(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[Yr]=t,e[Oc]=r,dC(e,t,!1,!1),t.stateNode=e;e:{switch(o=ey(n,r),n){case"dialog":ht("cancel",e),ht("close",e),i=r;break;case"iframe":case"object":case"embed":ht("load",e),i=r;break;case"video":case"audio":for(i=0;i<tc.length;i++)ht(tc[i],e);i=r;break;case"source":ht("error",e),i=r;break;case"img":case"image":case"link":ht("error",e),ht("load",e),i=r;break;case"details":ht("toggle",e),i=r;break;case"input":mw(e,r),i=Vg(e,r),ht("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=kt({},r,{value:void 0}),ht("invalid",e);break;case"textarea":yw(e,r),i=Zg(e,r),ht("invalid",e);break;default:i=r}Jg(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Hj(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Uj(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Sc(e,c):typeof c=="number"&&Sc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(wc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ht("scroll",e):c!=null&&Tb(e,a,c,o))}switch(n){case"input":td(e),gw(e,r,!1);break;case"textarea":td(e),vw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+fa(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?uo(e,!!r.multiple,a,!1):r.defaultValue!=null&&uo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=pf)}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 dn(t),null;case 6:if(e&&t.stateNode!=null)hC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(se(166));if(n=qa(Rc.current),qa(ei.current),ud(t)){if(r=t.stateNode,n=t.memoizedProps,r[Yr]=t,(a=r.nodeValue!==n)&&(e=er,e!==null))switch(e.tag){case 3:cd(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&cd(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Yr]=t,t.stateNode=r}return dn(t),null;case 13:if(yt(xt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&Jn!==null&&t.mode&1&&!(t.flags&128))OA(),ko(),t.flags|=98560,a=!1;else if(a=ud(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(se(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(se(317));a[Yr]=t}else ko(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dn(t),a=!1}else Tr!==null&&(My(Tr),Tr=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||xt.current&1?Wt===0&&(Wt=3):fx())),t.updateQueue!==null&&(t.flags|=4),dn(t),null);case 4:return Eo(),_y(e,t),e===null&&Cc(t.stateNode.containerInfo),dn(t),null;case 10:return Yb(t.type._context),dn(t),null;case 17:return Dn(t.type)&&mf(),dn(t),null;case 19:if(yt(xt),a=t.memoizedState,a===null)return dn(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)Il(a,!1);else{if(Wt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Sf(e),o!==null){for(t.flags|=128,Il(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 dt(xt,xt.current&1|2),t.child}e=e.sibling}a.tail!==null&&Ct()>jo&&(t.flags|=128,r=!0,Il(a,!1),t.lanes=4194304)}else{if(!r)if(e=Sf(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Il(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!vt)return dn(t),null}else 2*Ct()-a.renderingStartTime>jo&&n!==1073741824&&(t.flags|=128,r=!0,Il(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=Ct(),t.sibling=null,n=xt.current,dt(xt,r?n&1|2:n&1),t):(dn(t),null);case 22:case 23:return dx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Xn&1073741824&&(dn(t),t.subtreeFlags&6&&(t.flags|=8192)):dn(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function I$(e,t){switch(Gb(t),t.tag){case 1:return Dn(t.type)&&mf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Eo(),yt(Ln),yt(bn),ex(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jb(t),null;case 13:if(yt(xt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));ko()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return yt(xt),null;case 4:return Eo(),null;case 10:return Yb(t.type._context),null;case 22:case 23:return dx(),null;case 24:return null;default:return null}}var hd=!1,mn=!1,$$=typeof WeakSet=="function"?WeakSet:Set,ye=null;function ro(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_t(e,t,r)}else n.current=null}function jy(e,t,n){try{n()}catch(r){_t(e,t,r)}}var o1=!1;function L$(e,t){if(uy=df,e=vA(),Wb(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(dy={focusedElem:e,selectionRange:n},df=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,v=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:jr(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(k){_t(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return g=o1,o1=!1,g}function uc(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&&jy(t,n,a)}i=i.next}while(i!==r)}}function Xh(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 Ay(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 pC(e){var t=e.alternate;t!==null&&(e.alternate=null,pC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yr],delete t[Oc],delete t[py],delete t[b$],delete t[x$])),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 mC(e){return e.tag===5||e.tag===3||e.tag===4}function l1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mC(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 Cy(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=pf));else if(r!==4&&(e=e.child,e!==null))for(Cy(e,t,n),e=e.sibling;e!==null;)Cy(e,t,n),e=e.sibling}function Ty(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(Ty(e,t,n),e=e.sibling;e!==null;)Ty(e,t,n),e=e.sibling}var rn=null,Ar=!1;function Di(e,t,n){for(n=n.child;n!==null;)gC(e,t,n),n=n.sibling}function gC(e,t,n){if(Jr&&typeof Jr.onCommitFiberUnmount=="function")try{Jr.onCommitFiberUnmount(Uh,n)}catch{}switch(n.tag){case 5:mn||ro(n,t);case 6:var r=rn,i=Ar;rn=null,Di(e,t,n),rn=r,Ar=i,rn!==null&&(Ar?(e=rn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rn.removeChild(n.stateNode));break;case 18:rn!==null&&(Ar?(e=rn,n=n.stateNode,e.nodeType===8?_m(e.parentNode,n):e.nodeType===1&&_m(e,n),_c(e)):_m(rn,n.stateNode));break;case 4:r=rn,i=Ar,rn=n.stateNode.containerInfo,Ar=!0,Di(e,t,n),rn=r,Ar=i;break;case 0:case 11:case 14:case 15:if(!mn&&(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)&&jy(n,t,o),i=i.next}while(i!==r)}Di(e,t,n);break;case 1:if(!mn&&(ro(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){_t(n,t,l)}Di(e,t,n);break;case 21:Di(e,t,n);break;case 22:n.mode&1?(mn=(r=mn)||n.memoizedState!==null,Di(e,t,n),mn=r):Di(e,t,n);break;default:Di(e,t,n)}}function c1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $$),t.forEach(function(r){var i=q$.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Er(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:rn=l.stateNode,Ar=!1;break e;case 3:rn=l.stateNode.containerInfo,Ar=!0;break e;case 4:rn=l.stateNode.containerInfo,Ar=!0;break e}l=l.return}if(rn===null)throw Error(se(160));gC(a,o,i),rn=null,Ar=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){_t(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)yC(t,e),t=t.sibling}function yC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Er(t,e),Gr(e),r&4){try{uc(3,e,e.return),Xh(3,e)}catch(m){_t(e,e.return,m)}try{uc(5,e,e.return)}catch(m){_t(e,e.return,m)}}break;case 1:Er(t,e),Gr(e),r&512&&n!==null&&ro(n,n.return);break;case 5:if(Er(t,e),Gr(e),r&512&&n!==null&&ro(n,n.return),e.flags&32){var i=e.stateNode;try{Sc(i,"")}catch(m){_t(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&&Bj(i,a),ey(l,o);var u=ey(l,a);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?Hj(i,f):d==="dangerouslySetInnerHTML"?Uj(i,f):d==="children"?Sc(i,f):Tb(i,d,f,u)}switch(l){case"input":Yg(i,a);break;case"textarea":zj(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?uo(i,!!a.multiple,p,!1):h!==!!a.multiple&&(a.defaultValue!=null?uo(i,!!a.multiple,a.defaultValue,!0):uo(i,!!a.multiple,a.multiple?[]:"",!1))}i[Oc]=a}catch(m){_t(e,e.return,m)}}break;case 6:if(Er(t,e),Gr(e),r&4){if(e.stateNode===null)throw Error(se(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){_t(e,e.return,m)}}break;case 3:if(Er(t,e),Gr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{_c(t.containerInfo)}catch(m){_t(e,e.return,m)}break;case 4:Er(t,e),Gr(e);break;case 13:Er(t,e),Gr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(cx=Ct())),r&4&&c1(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(mn=(u=mn)||d,Er(t,e),mn=u):Er(t,e),Gr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ye=e,d=e.child;d!==null;){for(f=ye=d;ye!==null;){switch(h=ye,p=h.child,h.tag){case 0:case 11:case 14:case 15:uc(4,h,h.return);break;case 1:ro(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){_t(r,n,m)}}break;case 5:ro(h,h.return);break;case 22:if(h.memoizedState!==null){d1(f);continue}}p!==null?(p.return=h,ye=p):d1(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=Wj("display",o))}catch(m){_t(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){_t(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:Er(t,e),Gr(e),r&4&&c1(e);break;case 21:break;default:Er(t,e),Gr(e)}}function Gr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(mC(n)){var r=n;break e}n=n.return}throw Error(se(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Sc(i,""),r.flags&=-33);var a=l1(e);Ty(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=l1(e);Cy(e,l,o);break;default:throw Error(se(161))}}catch(c){_t(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function D$(e,t,n){ye=e,vC(e)}function vC(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var i=ye,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||hd;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||mn;l=hd;var u=mn;if(hd=o,(mn=c)&&!u)for(ye=i;ye!==null;)o=ye,c=o.child,o.tag===22&&o.memoizedState!==null?f1(i):c!==null?(c.return=o,ye=c):f1(i);for(;a!==null;)ye=a,vC(a),a=a.sibling;ye=i,hd=l,mn=u}u1(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,ye=a):u1(e)}}function u1(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:mn||Xh(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!mn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:jr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Vw(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}Vw(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&&_c(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}mn||t.flags&512&&Ay(t)}catch(h){_t(t,t.return,h)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function d1(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function f1(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Xh(4,t)}catch(c){_t(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){_t(t,i,c)}}var a=t.return;try{Ay(t)}catch(c){_t(t,a,c)}break;case 5:var o=t.return;try{Ay(t)}catch(c){_t(t,o,c)}}}catch(c){_t(t,t.return,c)}if(t===e){ye=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ye=l;break}ye=t.return}}var B$=Math.ceil,Ef=Oi.ReactCurrentDispatcher,ox=Oi.ReactCurrentOwner,gr=Oi.ReactCurrentBatchConfig,We=0,Xt=null,Rt=null,sn=0,Xn=0,io=ga(0),Wt=0,Lc=null,cs=0,Zh=0,lx=0,dc=null,Mn=null,cx=0,jo=1/0,hi=null,_f=!1,Oy=null,sa=null,pd=!1,Zi=null,jf=0,fc=0,Py=null,Jd=-1,ef=0;function An(){return We&6?Ct():Jd!==-1?Jd:Jd=Ct()}function oa(e){return e.mode&1?We&2&&sn!==0?sn&-sn:S$.transition!==null?(ef===0&&(ef=nA()),ef):(e=Qe,e!==0||(e=window.event,e=e===void 0?16:cA(e.type)),e):1}function Mr(e,t,n,r){if(50<fc)throw fc=0,Py=null,Error(se(185));ju(e,n,r),(!(We&2)||e!==Xt)&&(e===Xt&&(!(We&2)&&(Zh|=n),Wt===4&&qi(e,sn)),Bn(e,r),n===1&&We===0&&!(t.mode&1)&&(jo=Ct()+500,Kh&&ya()))}function Bn(e,t){var n=e.callbackNode;SI(e,t);var r=uf(e,e===Xt?sn:0);if(r===0)n!==null&&ww(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ww(n),t===1)e.tag===0?w$(h1.bind(null,e)):AA(h1.bind(null,e)),y$(function(){!(We&6)&&ya()}),n=null;else{switch(rA(r)){case 1:n=Ib;break;case 4:n=eA;break;case 16:n=cf;break;case 536870912:n=tA;break;default:n=cf}n=_C(n,bC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function bC(e,t){if(Jd=-1,ef=0,We&6)throw Error(se(327));var n=e.callbackNode;if(go()&&e.callbackNode!==n)return null;var r=uf(e,e===Xt?sn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Af(e,r);else{t=r;var i=We;We|=2;var a=wC();(Xt!==e||sn!==t)&&(hi=null,jo=Ct()+500,Qa(e,t));do try{U$();break}catch(l){xC(e,l)}while(!0);Vb(),Ef.current=a,We=i,Rt!==null?t=0:(Xt=null,sn=0,t=Wt)}if(t!==0){if(t===2&&(i=ay(e),i!==0&&(r=i,t=Ry(e,i))),t===1)throw n=Lc,Qa(e,0),qi(e,r),Bn(e,Ct()),n;if(t===6)qi(e,r);else{if(i=e.current.alternate,!(r&30)&&!z$(i)&&(t=Af(e,r),t===2&&(a=ay(e),a!==0&&(r=a,t=Ry(e,a))),t===1))throw n=Lc,Qa(e,0),qi(e,r),Bn(e,Ct()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(se(345));case 2:$a(e,Mn,hi);break;case 3:if(qi(e,r),(r&130023424)===r&&(t=cx+500-Ct(),10<t)){if(uf(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){An(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=hy($a.bind(null,e,Mn,hi),t);break}$a(e,Mn,hi);break;case 4:if(qi(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Rr(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=Ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*B$(r/1960))-r,10<r){e.timeoutHandle=hy($a.bind(null,e,Mn,hi),r);break}$a(e,Mn,hi);break;case 5:$a(e,Mn,hi);break;default:throw Error(se(329))}}}return Bn(e,Ct()),e.callbackNode===n?bC.bind(null,e):null}function Ry(e,t){var n=dc;return e.current.memoizedState.isDehydrated&&(Qa(e,t).flags|=256),e=Af(e,t),e!==2&&(t=Mn,Mn=n,t!==null&&My(t)),e}function My(e){Mn===null?Mn=e:Mn.push.apply(Mn,e)}function z$(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(!Dr(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 qi(e,t){for(t&=~lx,t&=~Zh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Rr(t),r=1<<n;e[n]=-1,t&=~r}}function h1(e){if(We&6)throw Error(se(327));go();var t=uf(e,0);if(!(t&1))return Bn(e,Ct()),null;var n=Af(e,t);if(e.tag!==0&&n===2){var r=ay(e);r!==0&&(t=r,n=Ry(e,r))}if(n===1)throw n=Lc,Qa(e,0),qi(e,t),Bn(e,Ct()),n;if(n===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,$a(e,Mn,hi),Bn(e,Ct()),null}function ux(e,t){var n=We;We|=1;try{return e(t)}finally{We=n,We===0&&(jo=Ct()+500,Kh&&ya())}}function us(e){Zi!==null&&Zi.tag===0&&!(We&6)&&go();var t=We;We|=1;var n=gr.transition,r=Qe;try{if(gr.transition=null,Qe=1,e)return e()}finally{Qe=r,gr.transition=n,We=t,!(We&6)&&ya()}}function dx(){Xn=io.current,yt(io)}function Qa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,g$(n)),Rt!==null)for(n=Rt.return;n!==null;){var r=n;switch(Gb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&mf();break;case 3:Eo(),yt(Ln),yt(bn),ex();break;case 5:Jb(r);break;case 4:Eo();break;case 13:yt(xt);break;case 19:yt(xt);break;case 10:Yb(r.type._context);break;case 22:case 23:dx()}n=n.return}if(Xt=e,Rt=e=la(e.current,null),sn=Xn=t,Wt=0,Lc=null,lx=Zh=cs=0,Mn=dc=null,Ga!==null){for(t=0;t<Ga.length;t++)if(n=Ga[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}Ga=null}return e}function xC(e,t){do{var n=Rt;try{if(Vb(),Xd.current=Nf,kf){for(var r=wt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}kf=!1}if(ls=0,Vt=Ut=wt=null,cc=!1,Mc=0,ox.current=null,n===null||n.return===null){Wt=1,Lc=t,Rt=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=sn,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=e1(o);if(p!==null){p.flags&=-257,t1(p,o,l,a,t),p.mode&1&&Jw(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)){Jw(a,u,t),fx();break e}c=Error(se(426))}}else if(vt&&l.mode&1){var v=e1(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),t1(v,o,l,a,t),qb(_o(c,l));break e}}a=c=_o(c,l),Wt!==4&&(Wt=2),dc===null?dc=[a]:dc.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=rC(a,c,t);Kw(a,y);break e;case 1:l=c;var b=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(sa===null||!sa.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var k=iC(a,l,t);Kw(a,k);break e}}a=a.return}while(a!==null)}kC(n)}catch(S){t=S,Rt===n&&n!==null&&(Rt=n=n.return);continue}break}while(!0)}function wC(){var e=Ef.current;return Ef.current=Nf,e===null?Nf:e}function fx(){(Wt===0||Wt===3||Wt===2)&&(Wt=4),Xt===null||!(cs&268435455)&&!(Zh&268435455)||qi(Xt,sn)}function Af(e,t){var n=We;We|=2;var r=wC();(Xt!==e||sn!==t)&&(hi=null,Qa(e,t));do try{F$();break}catch(i){xC(e,i)}while(!0);if(Vb(),We=n,Ef.current=r,Rt!==null)throw Error(se(261));return Xt=null,sn=0,Wt}function F$(){for(;Rt!==null;)SC(Rt)}function U$(){for(;Rt!==null&&!hI();)SC(Rt)}function SC(e){var t=EC(e.alternate,e,Xn);e.memoizedProps=e.pendingProps,t===null?kC(e):Rt=t,ox.current=null}function kC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=I$(n,t),n!==null){n.flags&=32767,Rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Wt=6,Rt=null;return}}else if(n=M$(n,t,Xn),n!==null){Rt=n;return}if(t=t.sibling,t!==null){Rt=t;return}Rt=t=e}while(t!==null);Wt===0&&(Wt=5)}function $a(e,t,n){var r=Qe,i=gr.transition;try{gr.transition=null,Qe=1,W$(e,t,n,r)}finally{gr.transition=i,Qe=r}return null}function W$(e,t,n,r){do go();while(Zi!==null);if(We&6)throw Error(se(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(se(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(kI(e,a),e===Xt&&(Rt=Xt=null,sn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||pd||(pd=!0,_C(cf,function(){return go(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=gr.transition,gr.transition=null;var o=Qe;Qe=1;var l=We;We|=4,ox.current=null,L$(e,n),yC(n,e),c$(dy),df=!!uy,dy=uy=null,e.current=n,D$(n),pI(),We=l,Qe=o,gr.transition=a}else e.current=n;if(pd&&(pd=!1,Zi=e,jf=i),a=e.pendingLanes,a===0&&(sa=null),yI(n.stateNode),Bn(e,Ct()),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(_f)throw _f=!1,e=Oy,Oy=null,e;return jf&1&&e.tag!==0&&go(),a=e.pendingLanes,a&1?e===Py?fc++:(fc=0,Py=e):fc=0,ya(),null}function go(){if(Zi!==null){var e=rA(jf),t=gr.transition,n=Qe;try{if(gr.transition=null,Qe=16>e?16:e,Zi===null)var r=!1;else{if(e=Zi,Zi=null,jf=0,We&6)throw Error(se(331));var i=We;for(We|=4,ye=e.current;ye!==null;){var a=ye,o=a.child;if(ye.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ye=u;ye!==null;){var d=ye;switch(d.tag){case 0:case 11:case 15:uc(8,d,a)}var f=d.child;if(f!==null)f.return=d,ye=f;else for(;ye!==null;){d=ye;var h=d.sibling,p=d.return;if(pC(d),d===u){ye=null;break}if(h!==null){h.return=p,ye=h;break}ye=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)}}ye=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,ye=o;else e:for(;ye!==null;){if(a=ye,a.flags&2048)switch(a.tag){case 0:case 11:case 15:uc(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,ye=y;break e}ye=a.return}}var b=e.current;for(ye=b;ye!==null;){o=ye;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,ye=w;else e:for(o=b;ye!==null;){if(l=ye,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Xh(9,l)}}catch(S){_t(l,l.return,S)}if(l===o){ye=null;break e}var k=l.sibling;if(k!==null){k.return=l.return,ye=k;break e}ye=l.return}}if(We=i,ya(),Jr&&typeof Jr.onPostCommitFiberRoot=="function")try{Jr.onPostCommitFiberRoot(Uh,e)}catch{}r=!0}return r}finally{Qe=n,gr.transition=t}}return!1}function p1(e,t,n){t=_o(n,t),t=rC(e,t,1),e=aa(e,t,1),t=An(),e!==null&&(ju(e,1,t),Bn(e,t))}function _t(e,t,n){if(e.tag===3)p1(e,e,n);else for(;t!==null;){if(t.tag===3){p1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(sa===null||!sa.has(r))){e=_o(n,e),e=iC(t,e,1),t=aa(t,e,1),e=An(),t!==null&&(ju(t,1,e),Bn(t,e));break}}t=t.return}}function H$(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=An(),e.pingedLanes|=e.suspendedLanes&n,Xt===e&&(sn&n)===n&&(Wt===4||Wt===3&&(sn&130023424)===sn&&500>Ct()-cx?Qa(e,0):lx|=n),Bn(e,t)}function NC(e,t){t===0&&(e.mode&1?(t=id,id<<=1,!(id&130023424)&&(id=4194304)):t=1);var n=An();e=_i(e,t),e!==null&&(ju(e,t,n),Bn(e,n))}function G$(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),NC(e,n)}function q$(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(se(314))}r!==null&&r.delete(t),NC(e,n)}var EC;EC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ln.current)In=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return In=!1,R$(e,t,n);In=!!(e.flags&131072)}else In=!1,vt&&t.flags&1048576&&CA(t,vf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Qd(e,t),e=t.pendingProps;var i=So(t,bn.current);mo(t,n),i=nx(null,t,r,e,i,n);var a=rx();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,Dn(r)?(a=!0,gf(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Zb(t),i.updater=Yh,t.stateNode=i,i._reactInternals=t,xy(t,r,e,n),t=ky(null,t,r,!0,a,n)):(t.tag=0,vt&&a&&Hb(t),En(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Qd(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=V$(r),e=jr(r,e),i){case 0:t=Sy(null,t,r,e,n);break e;case 1:t=i1(null,t,r,e,n);break e;case 11:t=n1(null,t,r,e,n);break e;case 14:t=r1(null,t,r,jr(r.type,e),n);break e}throw Error(se(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jr(r,i),Sy(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jr(r,i),i1(e,t,r,i,n);case 3:e:{if(lC(t),e===null)throw Error(se(387));r=t.pendingProps,a=t.memoizedState,i=a.element,IA(e,t),wf(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=_o(Error(se(423)),t),t=a1(e,t,r,n,i);break e}else if(r!==i){i=_o(Error(se(424)),t),t=a1(e,t,r,n,i);break e}else for(Jn=ia(t.stateNode.containerInfo.firstChild),er=t,vt=!0,Tr=null,n=RA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ko(),r===i){t=ji(e,t,n);break e}En(e,t,r,n)}t=t.child}return t;case 5:return $A(t),e===null&&yy(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,fy(r,i)?o=null:a!==null&&fy(r,a)&&(t.flags|=32),oC(e,t),En(e,t,o,n),t.child;case 6:return e===null&&yy(t),null;case 13:return cC(e,t,n);case 4:return Qb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=No(t,null,r,n):En(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jr(r,i),n1(e,t,r,i,n);case 7:return En(e,t,t.pendingProps,n),t.child;case 8:return En(e,t,t.pendingProps.children,n),t.child;case 12:return En(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,dt(bf,r._currentValue),r._currentValue=o,a!==null)if(Dr(a.value,o)){if(a.children===i.children&&!Ln.current){t=ji(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=xi(-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),vy(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(se(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),vy(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}En(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,mo(t,n),i=vr(i),r=r(i),t.flags|=1,En(e,t,r,n),t.child;case 14:return r=t.type,i=jr(r,t.pendingProps),i=jr(r.type,i),r1(e,t,r,i,n);case 15:return aC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jr(r,i),Qd(e,t),t.tag=1,Dn(r)?(e=!0,gf(t)):e=!1,mo(t,n),nC(t,r,i),xy(t,r,i,n),ky(null,t,r,!0,e,n);case 19:return uC(e,t,n);case 22:return sC(e,t,n)}throw Error(se(156,t.tag))};function _C(e,t){return Jj(e,t)}function K$(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 pr(e,t,n,r){return new K$(e,t,n,r)}function hx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function V$(e){if(typeof e=="function")return hx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pb)return 11;if(e===Rb)return 14}return 2}function la(e,t){var n=e.alternate;return n===null?(n=pr(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 tf(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")hx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Vs:return Ja(n.children,i,a,t);case Ob:o=8,i|=8;break;case Hg:return e=pr(12,n,t,i|2),e.elementType=Hg,e.lanes=a,e;case Gg:return e=pr(13,n,t,i),e.elementType=Gg,e.lanes=a,e;case qg:return e=pr(19,n,t,i),e.elementType=qg,e.lanes=a,e;case $j:return Qh(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mj:o=10;break e;case Ij:o=9;break e;case Pb:o=11;break e;case Rb:o=14;break e;case Ui:o=16,r=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=pr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Ja(e,t,n,r){return e=pr(7,e,r,t),e.lanes=n,e}function Qh(e,t,n,r){return e=pr(22,e,r,t),e.elementType=$j,e.lanes=n,e.stateNode={isHidden:!1},e}function Mm(e,t,n){return e=pr(6,e,null,t),e.lanes=n,e}function Im(e,t,n){return t=pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Y$(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=mm(0),this.expirationTimes=mm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mm(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function px(e,t,n,r,i,a,o,l,c){return e=new Y$(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=pr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zb(a),e}function X$(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function jC(e){if(!e)return ha;e=e._reactInternals;e:{if(vs(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Dn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var n=e.type;if(Dn(n))return jA(e,n,t)}return t}function AC(e,t,n,r,i,a,o,l,c){return e=px(n,r,!0,e,i,a,o,l,c),e.context=jC(null),n=e.current,r=An(),i=oa(n),a=xi(r,i),a.callback=t??null,aa(n,a,i),e.current.lanes=i,ju(e,i,r),Bn(e,r),e}function Jh(e,t,n,r){var i=t.current,a=An(),o=oa(i);return n=jC(n),t.context===null?t.context=n:t.pendingContext=n,t=xi(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=aa(i,t,o),e!==null&&(Mr(e,i,o,a),Yd(e,i,o)),o}function Cf(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 m1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mx(e,t){m1(e,t),(e=e.alternate)&&m1(e,t)}function Z$(){return null}var CC=typeof reportError=="function"?reportError:function(e){console.error(e)};function gx(e){this._internalRoot=e}ep.prototype.render=gx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));Jh(e,t,null,null)};ep.prototype.unmount=gx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;us(function(){Jh(null,e,null,null)}),t[Ei]=null}};function ep(e){this._internalRoot=e}ep.prototype.unstable_scheduleHydration=function(e){if(e){var t=sA();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Gi.length&&t!==0&&t<Gi[n].priority;n++);Gi.splice(n,0,e),n===0&&lA(e)}};function yx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function tp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function g1(){}function Q$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=Cf(o);a.call(u)}}var o=AC(t,r,e,0,null,!1,!1,"",g1);return e._reactRootContainer=o,e[Ei]=o.current,Cc(e.nodeType===8?e.parentNode:e),us(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=Cf(c);l.call(u)}}var c=px(e,0,!1,null,null,!1,!1,"",g1);return e._reactRootContainer=c,e[Ei]=c.current,Cc(e.nodeType===8?e.parentNode:e),us(function(){Jh(t,c,n,r)}),c}function np(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=Cf(o);l.call(c)}}Jh(t,o,e,i)}else o=Q$(n,t,e,i,r);return Cf(o)}iA=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ec(t.pendingLanes);n!==0&&($b(t,n|1),Bn(t,Ct()),!(We&6)&&(jo=Ct()+500,ya()))}break;case 13:us(function(){var r=_i(e,1);if(r!==null){var i=An();Mr(r,e,1,i)}}),mx(e,1)}};Lb=function(e){if(e.tag===13){var t=_i(e,134217728);if(t!==null){var n=An();Mr(t,e,134217728,n)}mx(e,134217728)}};aA=function(e){if(e.tag===13){var t=oa(e),n=_i(e,t);if(n!==null){var r=An();Mr(n,e,t,r)}mx(e,t)}};sA=function(){return Qe};oA=function(e,t){var n=Qe;try{return Qe=e,t()}finally{Qe=n}};ny=function(e,t,n){switch(t){case"input":if(Yg(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=qh(r);if(!i)throw Error(se(90));Dj(r),Yg(r,i)}}}break;case"textarea":zj(e,n);break;case"select":t=n.value,t!=null&&uo(e,!!n.multiple,t,!1)}};Kj=ux;Vj=us;var J$={usingClientEntryPoint:!1,Events:[Cu,Qs,qh,Gj,qj,ux]},$l={findFiberByHostInstance:Ha,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},eL={bundleType:$l.bundleType,version:$l.version,rendererPackageName:$l.rendererPackageName,rendererConfig:$l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Oi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Zj(e),e===null?null:e.stateNode},findFiberByHostInstance:$l.findFiberByHostInstance||Z$,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 md=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!md.isDisabled&&md.supportsFiber)try{Uh=md.inject(eL),Jr=md}catch{}}ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J$;ir.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yx(t))throw Error(se(200));return X$(e,t,null,n)};ir.createRoot=function(e,t){if(!yx(e))throw Error(se(299));var n=!1,r="",i=CC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=px(e,1,!1,null,null,n,!1,r,i),e[Ei]=t.current,Cc(e.nodeType===8?e.parentNode:e),new gx(t)};ir.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(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=Zj(t),e=e===null?null:e.stateNode,e};ir.flushSync=function(e){return us(e)};ir.hydrate=function(e,t,n){if(!tp(t))throw Error(se(200));return np(null,e,t,!0,n)};ir.hydrateRoot=function(e,t,n){if(!yx(e))throw Error(se(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=CC;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=AC(t,null,e,1,n??null,i,!1,a,o),e[Ei]=t.current,Cc(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 ep(t)};ir.render=function(e,t,n){if(!tp(t))throw Error(se(200));return np(null,e,t,!1,n)};ir.unmountComponentAtNode=function(e){if(!tp(e))throw Error(se(40));return e._reactRootContainer?(us(function(){np(null,null,e,!1,function(){e._reactRootContainer=null,e[Ei]=null})}),!0):!1};ir.unstable_batchedUpdates=ux;ir.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!tp(n))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return np(e,t,n,!1,r)};ir.version="18.3.1-next-f1338f8080-20240426";function TC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(TC)}catch(e){console.error(e)}}TC(),Tj.exports=ir;var tL=Tj.exports,OC,y1=tL;OC=y1.createRoot,y1.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 Dc(){return Dc=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},Dc.apply(null,arguments)}var Qi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qi||(Qi={}));const v1="popstate";function nL(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:o,hash:l}=r.location;return Iy("",{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:Tf(i)}return iL(t,n,null,e)}function St(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function rL(){return Math.random().toString(36).substr(2,8)}function b1(e,t){return{usr:e.state,key:e.key,idx:t}}function Iy(e,t,n,r){return n===void 0&&(n=null),Dc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?tl(t):t,{state:n,key:t&&t.key||r||rL()})}function Tf(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 tl(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 iL(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=Qi.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Dc({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Qi.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=Qi.Push;let b=Iy(m.location,v,y);u=d()+1;let w=b1(b,u),k=m.createHref(b);try{o.pushState(w,"",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=Qi.Replace;let b=Iy(m.location,v,y);u=d();let w=b1(b,u),k=m.createHref(b);o.replaceState(w,"",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:Tf(v);return b=b.replace(/ $/,"%20"),St(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(v1,f),c=v,()=>{i.removeEventListener(v1,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 x1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(x1||(x1={}));function aL(e,t,n){return n===void 0&&(n="/"),sL(e,t,n)}function sL(e,t,n,r){let i=typeof t=="string"?tl(t):t,a=Ao(i.pathname||"/",n);if(a==null)return null;let o=PC(e);oL(o);let l=null,c=vL(a);for(let u=0;l==null&&u<o.length;++u)l=gL(o[u],c);return l}function PC(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("/")&&(St(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=ca([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(St(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),PC(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:pL(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 RC(a.path))i(a,o,c)}),t}function RC(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=RC(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 oL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mL(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const lL=/^:[\w-]+$/,cL=3,uL=2,dL=1,fL=10,hL=-2,w1=e=>e==="*";function pL(e,t){let n=e.split("/"),r=n.length;return n.some(w1)&&(r+=hL),t&&(r+=uL),n.filter(i=>!w1(i)).reduce((i,a)=>i+(lL.test(a)?cL:a===""?dL:fL),r)}function mL(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 gL(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=$y({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:ca([a,f.pathname]),pathnameBase:kL(ca([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=ca([a,f.pathnameBase]))}return o}function $y(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=yL(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 yL(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),vx(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 vL(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return vx(!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 Ao(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 bL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xL=e=>bL.test(e);function wL(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?tl(e):e,a;if(n)if(xL(n))a=n;else{if(n.includes("//")){let o=n;n=MC(n),vx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=S1(n.substring(1),"/"):a=S1(n,t)}else a=t;return{pathname:a,search:NL(r),hash:EL(i)}}function S1(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 $m(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 SL(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function bx(e,t){let n=SL(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=tl(e):(i=Dc({},e),St(!i.pathname||!i.pathname.includes("?"),$m("?","pathname","search",i)),St(!i.pathname||!i.pathname.includes("#"),$m("#","pathname","hash",i)),St(!i.search||!i.search.includes("#"),$m("#","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=wL(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const MC=e=>e.replace(/\/\/+/g,"/"),ca=e=>MC(e.join("/")),kL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),NL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,EL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _L(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const IC=["post","put","patch","delete"];new Set(IC);const jL=["get",...IC];new Set(jL);/**
|
|
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 Bc(){return Bc=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},Bc.apply(null,arguments)}const rp=N.createContext(null),$C=N.createContext(null),Pi=N.createContext(null),ip=N.createContext(null),va=N.createContext({outlet:null,matches:[],isDataRoute:!1}),LC=N.createContext(null);function AL(e,t){let{relative:n}=t===void 0?{}:t;nl()||St(!1);let{basename:r,navigator:i}=N.useContext(Pi),{hash:a,pathname:o,search:l}=ap(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:ca([r,o])),i.createHref({pathname:c,search:l,hash:a})}function nl(){return N.useContext(ip)!=null}function rl(){return nl()||St(!1),N.useContext(ip).location}function DC(e){N.useContext(Pi).static||N.useLayoutEffect(e)}function BC(){let{isDataRoute:e}=N.useContext(va);return e?FL():CL()}function CL(){nl()||St(!1);let e=N.useContext(rp),{basename:t,future:n,navigator:r}=N.useContext(Pi),{matches:i}=N.useContext(va),{pathname:a}=rl(),o=JSON.stringify(bx(i,n.v7_relativeSplatPath)),l=N.useRef(!1);return DC(()=>{l.current=!0}),N.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=xx(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ca([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}function ap(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=N.useContext(Pi),{matches:i}=N.useContext(va),{pathname:a}=rl(),o=JSON.stringify(bx(i,r.v7_relativeSplatPath));return N.useMemo(()=>xx(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function TL(e,t){return OL(e,t)}function OL(e,t,n,r){nl()||St(!1);let{navigator:i}=N.useContext(Pi),{matches:a}=N.useContext(va),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=rl(),d;if(t){var f;let v=typeof t=="string"?tl(t):t;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||St(!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=aL(e,{pathname:p}),m=$L(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:ca([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:ca([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,r);return t&&m?N.createElement(ip.Provider,{value:{location:Bc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Qi.Pop}},m):m}function PL(){let e=zL(),t=_L(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 N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},t),n?N.createElement("pre",{style:i},n):null,null)}const RL=N.createElement(PL,null);class ML extends N.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?N.createElement(va.Provider,{value:this.props.routeContext},N.createElement(LC.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function IL(e){let{routeContext:t,match:n,children:r}=e,i=N.useContext(rp);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),N.createElement(va.Provider,{value:t},r)}function $L(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||St(!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||RL,c&&(u<0&&h===0?(UL("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 w;return p?w=m:g?w=v:f.route.Component?w=N.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,N.createElement(IL,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?N.createElement(ML,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var zC=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(zC||{}),FC=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}(FC||{});function LL(e){let t=N.useContext(rp);return t||St(!1),t}function DL(e){let t=N.useContext($C);return t||St(!1),t}function BL(e){let t=N.useContext(va);return t||St(!1),t}function UC(e){let t=BL(),n=t.matches[t.matches.length-1];return n.route.id||St(!1),n.route.id}function zL(){var e;let t=N.useContext(LC),n=DL(),r=UC();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function FL(){let{router:e}=LL(zC.UseNavigateStable),t=UC(FC.UseNavigateStable),n=N.useRef(!1);return DC(()=>{n.current=!0}),N.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Bc({fromRouteId:t},a)))},[e,t])}const k1={};function UL(e,t,n){k1[e]||(k1[e]=!0)}function WL(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function N1(e){let{to:t,replace:n,state:r,relative:i}=e;nl()||St(!1);let{future:a,static:o}=N.useContext(Pi),{matches:l}=N.useContext(va),{pathname:c}=rl(),u=BC(),d=xx(t,bx(l,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return N.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function tt(e){St(!1)}function HL(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Qi.Pop,navigator:a,static:o=!1,future:l}=e;nl()&&St(!1);let c=t.replace(/^\/*/,"/"),u=N.useMemo(()=>({basename:c,navigator:a,static:o,future:Bc({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=tl(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=N.useMemo(()=>{let v=Ao(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:N.createElement(Pi.Provider,{value:u},N.createElement(ip.Provider,{children:n,value:m}))}function GL(e){let{children:t,location:n}=e;return TL(Ly(t),n)}new Promise(()=>{});function Ly(e,t){t===void 0&&(t=[]);let n=[];return N.Children.forEach(e,(r,i)=>{if(!N.isValidElement(r))return;let a=[...t,i];if(r.type===N.Fragment){n.push.apply(n,Ly(r.props.children,a));return}r.type!==tt&&St(!1),!r.props.index||!r.props.children||St(!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=Ly(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 Of(){return Of=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},Of.apply(null,arguments)}function WC(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 qL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KL(e,t){return e.button===0&&(!t||t==="_self")&&!qL(e)}const VL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],YL=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],XL="6";try{window.__reactRouterVersion=XL}catch{}const ZL=N.createContext({isTransitioning:!1}),QL="startTransition",E1=H2[QL];function JL(e){let{basename:t,children:n,future:r,window:i}=e,a=N.useRef();a.current==null&&(a.current=nL({window:i,v5Compat:!0}));let o=a.current,[l,c]=N.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=N.useCallback(f=>{u&&E1?E1(()=>c(f)):c(f)},[c,u]);return N.useLayoutEffect(()=>o.listen(d),[o,d]),N.useEffect(()=>WL(r),[r]),N.createElement(HL,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const eD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dy=N.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=WC(t,VL),{basename:p}=N.useContext(Pi),g,m=!1;if(typeof u=="string"&&tD.test(u)&&(g=u,eD))try{let w=new URL(window.location.href),k=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=Ao(k.pathname,p);k.origin===w.origin&&S!=null?u=S+k.search+k.hash:m=!0}catch{}let v=AL(u,{relative:i}),y=iD(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||y(w)}return N.createElement("a",Of({},h,{href:g||v,onClick:m||a?r:b,ref:n,target:c}))}),nD=N.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=WC(t,YL),h=ap(c,{relative:f.relative}),p=rl(),g=N.useContext($C),{navigator:m,basename:v}=N.useContext(Pi),y=g!=null&&aD(h)&&u===!0,b=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,w=p.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(w=w.toLowerCase(),k=k?k.toLowerCase():null,b=b.toLowerCase()),k&&v&&(k=Ao(k,v)||k);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let x=w===b||!o&&w.startsWith(b)&&w.charAt(S)==="/",E=k!=null&&(k===b||!o&&k.startsWith(b)&&k.charAt(b.length)==="/"),_={isActive:x,isPending:E,isTransitioning:y},C=x?r:void 0,T;typeof a=="function"?T=a(_):T=[a,x?"active":null,E?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let L=typeof l=="function"?l(_):l;return N.createElement(Dy,Of({},f,{"aria-current":C,className:T,ref:n,style:L,to:c,viewTransition:u}),typeof d=="function"?d(_):d)});var By;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(By||(By={}));var _1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(_1||(_1={}));function rD(e){let t=N.useContext(rp);return t||St(!1),t}function iD(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=BC(),u=rl(),d=ap(e,{relative:o});return N.useCallback(f=>{if(KL(f,n)){f.preventDefault();let h=r!==void 0?r:Tf(u)===Tf(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,a,o,l])}function aD(e,t){t===void 0&&(t={});let n=N.useContext(ZL);n==null&&St(!1);let{basename:r}=rD(By.useViewTransitionState),i=ap(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Ao(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ao(n.nextLocation.pathname,r)||n.nextLocation.pathname;return $y(i.pathname,o)!=null||$y(i.pathname,a)!=null}async function ur(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 ao="buff-dashboard-admin-token";function HC(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{}return null}function sD(e){if(!e||typeof e!="object")return!1;const t=e,n=t.diff;return typeof t.dir=="string"&&typeof t.base=="string"&&typeof t.removed=="boolean"&&!!n&&typeof n=="object"&&Array.isArray(n.files)&&n.files.every(r=>typeof r=="string")&&typeof n.summary=="string"&&!!n.payload&&typeof n.payload=="object"&&typeof n.payload.summary=="string"&&Array.isArray(n.payload.files)&&n.payload.files.every(r=>!!r&&typeof r.path=="string"&&typeof r.body=="string")}function oD(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.replayed=="number"&&typeof t.modelCalls=="number"&&typeof t.saved=="boolean"&&typeof t.notice=="string"}const zy=new Map;function lD(){const e=HC();if(e)try{const t=e.getItem(ao);if(t)return t}catch{}return zy.get(ao)??null}function cD(e){const t=HC();if(t)try{e?t.setItem(ao,e):t.removeItem(ao);return}catch{}e?zy.set(ao,e):zy.delete(ao)}function tn(){return lD()}function Lm(e){cD(e)}function kn(){const e=tn();return e?{Authorization:`Bearer ${e}`}:{}}class uD{constructor(t=""){Hr(this,"sse",null);Hr(this,"listeners",new Set);Hr(this,"connectionListeners",new Set);Hr(this,"dagListeners",new Set);Hr(this,"typingListeners",new Set);Hr(this,"chatRetryListeners",new Set);Hr(this,"reconnectTimer",null);Hr(this,"baseUrl");Hr(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 ur(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 ur(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 ur(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 ur(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 ur(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 ur(n);return r&&Array.isArray(r.steps)?r:null}catch{return null}}async sendAdminRequest(t,n,r){try{const i=tn(),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"?(Lm(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"?(Lm(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"),Lm(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:kn()})).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",...kn()},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",...kn()},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=tn(),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=tn(),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=tn(),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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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=tn();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,...(r==null?void 0:r.worktree)===void 0?{}:{worktree:r.worktree},...(r==null?void 0:r.keepWorktree)===void 0?{}:{keepWorktree:r.keepWorktree},...(r==null?void 0:r.resume)===void 0?{}:{resume:r.resume}}),signal: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,...l.refused===!0?{refused:!0}:{},...sD(l.worktree)?{worktree:l.worktree}:{},...oD(l.resume)?{resume:l.resume}:{},...Array.isArray(l.findings)?{findings:l.findings}:{}}:{ok:!1,error:typeof l.error=="string"?l.error:"The agent could not answer.",unauthorized:o.status===401,forbidden:o.status===403}}catch{return{ok:!1,error:"Could not reach the dashboard server, or the turn timed out."}}}async chatReset(t){const n=await this.sendAdminRequest("/api/chat/reset","POST",{sessionId:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Reset failed."}}async chatSupportBundle(t){var r,i,a;const n=tn();try{const o=await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/support-bundle`,{method:"GET",headers:{...n?{Authorization:`Bearer ${n}`}:{}},signal:AbortSignal.timeout(3e4)});if(o.status===200&&((r=o.headers.get("content-type"))!=null&&r.includes("application/zip"))){const c=await o.blob(),u=URL.createObjectURL(c),d=document.createElement("a");return d.href=u,d.download=((a=(i=o.headers.get("content-disposition"))==null?void 0:i.match(/filename="(.+)"/))==null?void 0:a[1])||"nuvira-support.zip",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u),{ok:!0}}return{ok:!1,error:(await o.json().catch(()=>({}))).error||"Could not build the support bundle."}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"Could not reach the dashboard server."}}}subscribeChat(t,n){const r=tn(),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("finding",a=>{var o;try{const c=JSON.parse(a.data).finding;c&&typeof c.claim=="string"&&(c.verdict==="CONFIRMED"||c.verdict==="PLAUSIBLE")&&((o=n.onFinding)==null||o.call(n,{claim:c.claim,verdict:c.verdict,outcome:typeof c.outcome=="string"?c.outcome:"",evidence:Array.isArray(c.evidence)?c.evidence:[],source:typeof c.source=="string"?c.source:""}))}catch{}}),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",...kn()},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:{...kn()}})).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:{...kn()}})).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",...kn()},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:{...kn()}}),n=await ur(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",...kn()},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",...kn()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,usable:r.usable,detail:r.detail,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async fetchProcessEnv(){try{const t=await fetch(`${this.baseUrl}/api/process-env`,{headers:{...kn()}}),n=await ur(t);return(n==null?void 0:n.vars)??[]}catch{return[]}}async fetchVerifyBacklog(){try{const t=await fetch(`${this.baseUrl}/api/models/verify-next`,{headers:{...kn()}});return await ur(t)}catch{return null}}async startVerifyBacklog(t){try{const n=await fetch(`${this.baseUrl}/api/models/verify-next`,{method:"POST",headers:{"Content-Type":"application/json",...kn()},body:JSON.stringify({count:t})}),r=await ur(n);return r?{ok:r.ok===!0,error:r.error,refusal:r.refusal,state:r.state}:{ok:!1,error:"The dashboard server did not respond."}}catch(n){return{ok:!1,error:n instanceof Error?n.message:"Could not start the run."}}}async saveProcessEnvVar(t,n){try{const i=await(await fetch(`${this.baseUrl}/api/process-env`,{method:"POST",headers:{"Content-Type":"application/json",...kn()},body:JSON.stringify({name:t,value:n})})).json();return{ok:i.ok===!0,row:i.row,error:i.error,reason:i.reason}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async deleteProcessEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/process-env/delete`,{method:"POST",headers:{"Content-Type":"application/json",...kn()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,removed:r.removed,row:r.row,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}}const J=new uD,dD=[{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:"/process-env",label:"Process Env",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 fD({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:dD.map(a=>s.jsxs(nD,{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 GC(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=GC(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=GC(e))&&(r&&(r+=" "),r+=t);return r}var hD=Array.isArray,zn=hD,pD=typeof Yi=="object"&&Yi&&Yi.Object===Object&&Yi,qC=pD,mD=qC,gD=typeof self=="object"&&self&&self.Object===Object&&self,yD=mD||gD||Function("return this")(),ai=yD,vD=ai,bD=vD.Symbol,Ou=bD,j1=Ou,KC=Object.prototype,xD=KC.hasOwnProperty,wD=KC.toString,Ll=j1?j1.toStringTag:void 0;function SD(e){var t=xD.call(e,Ll),n=e[Ll];try{e[Ll]=void 0;var r=!0}catch{}var i=wD.call(e);return r&&(t?e[Ll]=n:delete e[Ll]),i}var kD=SD,ND=Object.prototype,ED=ND.toString;function _D(e){return ED.call(e)}var jD=_D,A1=Ou,AD=kD,CD=jD,TD="[object Null]",OD="[object Undefined]",C1=A1?A1.toStringTag:void 0;function PD(e){return e==null?e===void 0?OD:TD:C1&&C1 in Object(e)?AD(e):CD(e)}var Ri=PD;function RD(e){return e!=null&&typeof e=="object"}var Mi=RD,MD=Ri,ID=Mi,$D="[object Symbol]";function LD(e){return typeof e=="symbol"||ID(e)&&MD(e)==$D}var il=LD,DD=zn,BD=il,zD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,FD=/^\w*$/;function UD(e,t){if(DD(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||BD(e)?!0:FD.test(e)||!zD.test(e)||t!=null&&e in Object(t)}var wx=UD;function WD(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ba=WD;const al=Ze(ba);var HD=Ri,GD=ba,qD="[object AsyncFunction]",KD="[object Function]",VD="[object GeneratorFunction]",YD="[object Proxy]";function XD(e){if(!GD(e))return!1;var t=HD(e);return t==KD||t==VD||t==qD||t==YD}var Sx=XD;const Le=Ze(Sx);var ZD=ai,QD=ZD["__core-js_shared__"],JD=QD,Dm=JD,T1=function(){var e=/[^.]+$/.exec(Dm&&Dm.keys&&Dm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function eB(e){return!!T1&&T1 in e}var tB=eB,nB=Function.prototype,rB=nB.toString;function iB(e){if(e!=null){try{return rB.call(e)}catch{}try{return e+""}catch{}}return""}var VC=iB,aB=Sx,sB=tB,oB=ba,lB=VC,cB=/[\\^$.*+?()[\]{}|]/g,uB=/^\[object .+?Constructor\]$/,dB=Function.prototype,fB=Object.prototype,hB=dB.toString,pB=fB.hasOwnProperty,mB=RegExp("^"+hB.call(pB).replace(cB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gB(e){if(!oB(e)||sB(e))return!1;var t=aB(e)?mB:uB;return t.test(lB(e))}var yB=gB;function vB(e,t){return e==null?void 0:e[t]}var bB=vB,xB=yB,wB=bB;function SB(e,t){var n=wB(e,t);return xB(n)?n:void 0}var bs=SB,kB=bs,NB=kB(Object,"create"),sp=NB,O1=sp;function EB(){this.__data__=O1?O1(null):{},this.size=0}var _B=EB;function jB(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var AB=jB,CB=sp,TB="__lodash_hash_undefined__",OB=Object.prototype,PB=OB.hasOwnProperty;function RB(e){var t=this.__data__;if(CB){var n=t[e];return n===TB?void 0:n}return PB.call(t,e)?t[e]:void 0}var MB=RB,IB=sp,$B=Object.prototype,LB=$B.hasOwnProperty;function DB(e){var t=this.__data__;return IB?t[e]!==void 0:LB.call(t,e)}var BB=DB,zB=sp,FB="__lodash_hash_undefined__";function UB(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=zB&&t===void 0?FB:t,this}var WB=UB,HB=_B,GB=AB,qB=MB,KB=BB,VB=WB;function sl(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])}}sl.prototype.clear=HB;sl.prototype.delete=GB;sl.prototype.get=qB;sl.prototype.has=KB;sl.prototype.set=VB;var YB=sl;function XB(){this.__data__=[],this.size=0}var ZB=XB;function QB(e,t){return e===t||e!==e&&t!==t}var kx=QB,JB=kx;function ez(e,t){for(var n=e.length;n--;)if(JB(e[n][0],t))return n;return-1}var op=ez,tz=op,nz=Array.prototype,rz=nz.splice;function iz(e){var t=this.__data__,n=tz(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():rz.call(t,n,1),--this.size,!0}var az=iz,sz=op;function oz(e){var t=this.__data__,n=sz(t,e);return n<0?void 0:t[n][1]}var lz=oz,cz=op;function uz(e){return cz(this.__data__,e)>-1}var dz=uz,fz=op;function hz(e,t){var n=this.__data__,r=fz(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var pz=hz,mz=ZB,gz=az,yz=lz,vz=dz,bz=pz;function ol(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])}}ol.prototype.clear=mz;ol.prototype.delete=gz;ol.prototype.get=yz;ol.prototype.has=vz;ol.prototype.set=bz;var lp=ol,xz=bs,wz=ai,Sz=xz(wz,"Map"),Nx=Sz,P1=YB,kz=lp,Nz=Nx;function Ez(){this.size=0,this.__data__={hash:new P1,map:new(Nz||kz),string:new P1}}var _z=Ez;function jz(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Az=jz,Cz=Az;function Tz(e,t){var n=e.__data__;return Cz(t)?n[typeof t=="string"?"string":"hash"]:n.map}var cp=Tz,Oz=cp;function Pz(e){var t=Oz(this,e).delete(e);return this.size-=t?1:0,t}var Rz=Pz,Mz=cp;function Iz(e){return Mz(this,e).get(e)}var $z=Iz,Lz=cp;function Dz(e){return Lz(this,e).has(e)}var Bz=Dz,zz=cp;function Fz(e,t){var n=zz(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var Uz=Fz,Wz=_z,Hz=Rz,Gz=$z,qz=Bz,Kz=Uz;function ll(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])}}ll.prototype.clear=Wz;ll.prototype.delete=Hz;ll.prototype.get=Gz;ll.prototype.has=qz;ll.prototype.set=Kz;var Ex=ll,YC=Ex,Vz="Expected a function";function _x(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Vz);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(_x.Cache||YC),n}_x.Cache=YC;var XC=_x;const Yz=Ze(XC);var Xz=XC,Zz=500;function Qz(e){var t=Xz(e,function(r){return n.size===Zz&&n.clear(),r}),n=t.cache;return t}var Jz=Qz,e3=Jz,t3=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n3=/\\(\\)?/g,r3=e3(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(t3,function(n,r,i,a){t.push(i?a.replace(n3,"$1"):r||n)}),t}),i3=r3;function a3(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 jx=a3,R1=Ou,s3=jx,o3=zn,l3=il,M1=R1?R1.prototype:void 0,I1=M1?M1.toString:void 0;function ZC(e){if(typeof e=="string")return e;if(o3(e))return s3(e,ZC)+"";if(l3(e))return I1?I1.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var c3=ZC,u3=c3;function d3(e){return e==null?"":u3(e)}var QC=d3,f3=zn,h3=wx,p3=i3,m3=QC;function g3(e,t){return f3(e)?e:h3(e,t)?[e]:p3(m3(e))}var JC=g3,y3=il;function v3(e){if(typeof e=="string"||y3(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var up=v3,b3=JC,x3=up;function w3(e,t){t=b3(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[x3(t[n++])];return n&&n==r?e:void 0}var Ax=w3,S3=Ax;function k3(e,t,n){var r=e==null?void 0:S3(e,t);return r===void 0?n:r}var eT=k3;const yr=Ze(eT);function N3(e){return e==null}var E3=N3;const Ye=Ze(E3);var _3=Ri,j3=zn,A3=Mi,C3="[object String]";function T3(e){return typeof e=="string"||!j3(e)&&A3(e)&&_3(e)==C3}var O3=T3;const ds=Ze(O3);var tT={exports:{}},Je={};/**
|
|
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 Cx=Symbol.for("react.element"),Tx=Symbol.for("react.portal"),dp=Symbol.for("react.fragment"),fp=Symbol.for("react.strict_mode"),hp=Symbol.for("react.profiler"),pp=Symbol.for("react.provider"),mp=Symbol.for("react.context"),P3=Symbol.for("react.server_context"),gp=Symbol.for("react.forward_ref"),yp=Symbol.for("react.suspense"),vp=Symbol.for("react.suspense_list"),bp=Symbol.for("react.memo"),xp=Symbol.for("react.lazy"),R3=Symbol.for("react.offscreen"),nT;nT=Symbol.for("react.module.reference");function wr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Cx:switch(e=e.type,e){case dp:case hp:case fp:case yp:case vp:return e;default:switch(e=e&&e.$$typeof,e){case P3:case mp:case gp:case xp:case bp:case pp:return e;default:return t}}case Tx:return t}}}Je.ContextConsumer=mp;Je.ContextProvider=pp;Je.Element=Cx;Je.ForwardRef=gp;Je.Fragment=dp;Je.Lazy=xp;Je.Memo=bp;Je.Portal=Tx;Je.Profiler=hp;Je.StrictMode=fp;Je.Suspense=yp;Je.SuspenseList=vp;Je.isAsyncMode=function(){return!1};Je.isConcurrentMode=function(){return!1};Je.isContextConsumer=function(e){return wr(e)===mp};Je.isContextProvider=function(e){return wr(e)===pp};Je.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Cx};Je.isForwardRef=function(e){return wr(e)===gp};Je.isFragment=function(e){return wr(e)===dp};Je.isLazy=function(e){return wr(e)===xp};Je.isMemo=function(e){return wr(e)===bp};Je.isPortal=function(e){return wr(e)===Tx};Je.isProfiler=function(e){return wr(e)===hp};Je.isStrictMode=function(e){return wr(e)===fp};Je.isSuspense=function(e){return wr(e)===yp};Je.isSuspenseList=function(e){return wr(e)===vp};Je.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===dp||e===hp||e===fp||e===yp||e===vp||e===R3||typeof e=="object"&&e!==null&&(e.$$typeof===xp||e.$$typeof===bp||e.$$typeof===pp||e.$$typeof===mp||e.$$typeof===gp||e.$$typeof===nT||e.getModuleId!==void 0)};Je.typeOf=wr;tT.exports=Je;var M3=tT.exports,I3=Ri,$3=Mi,L3="[object Number]";function D3(e){return typeof e=="number"||$3(e)&&I3(e)==L3}var rT=D3;const B3=Ze(rT);var z3=rT;function F3(e){return z3(e)&&e!=+e}var U3=F3;const Pu=Ze(U3);var Pr=function(t){return t===0?0:t>0?1:-1},Ka=function(t){return ds(t)&&t.indexOf("%")===t.length-1},de=function(t){return B3(t)&&!Pu(t)},W3=function(t){return Ye(t)},Ht=function(t){return de(t)||ds(t)},H3=0,wp=function(t){var n=++H3;return"".concat(t||"").concat(n)},fs=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(!de(t)&&!ds(t))return r;var a;if(Ka(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return Pu(a)&&(a=r),i&&a>n&&(a=n),a},Ki=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},G3=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},Ls=function(t,n){return de(t)&&de(n)?function(r){return t+r*(n-t)}:function(){return n}};function Fy(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):yr(r,t))===n})}var q3=function(t,n){return de(t)&&de(n)?t-n:ds(t)&&ds(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function yo(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 Uy(e){"@babel/helpers - typeof";return Uy=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},Uy(e)}var K3=["viewBox","children"],V3=["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"],Bm={svg:K3,polygon:$1,polyline:$1},Ox=["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"],Pf=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(N.isValidElement(t)&&(r=t.props),!al(r))return null;var i={};return Object.keys(r).forEach(function(a){Ox.includes(a)&&(i[a]=n||function(o){return r[a](r,o)})}),i},Y3=function(t,n,r){return function(i){return t(n,r,i),null}},Rf=function(t,n,r){if(!al(t)||Uy(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var o=t[a];Ox.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=Y3(o,n,r))}),i},X3=["children"],Z3=["children"];function L1(e,t){if(e==null)return{};var n=Q3(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 Q3(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 D1={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"},wi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},B1=null,zm=null,Px=function e(t){if(t===B1&&Array.isArray(zm))return zm;var n=[];return N.Children.forEach(t,function(r){Ye(r)||(M3.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),zm=n,B1=t,n};function Ir(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return wi(i)}):r=[wi(t)],Px(e).forEach(function(i){var a=yr(i,"type.displayName")||yr(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Zn(e,t){var n=Ir(e,t);return n&&n[0]}var z1=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!de(r)||r<=0||!de(i)||i<=0)},J3=["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"],eF=function(t){return t&&t.type&&ds(t.type)&&J3.indexOf(t.type)>=0},tF=function(t,n,r,i){var a,o=(a=Bm==null?void 0:Bm[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!Le(t)&&(i&&o.includes(n)||V3.includes(n))||r&&Ox.includes(n)},Ke=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(N.isValidElement(t)&&(i=t.props),!al(i))return null;var a={};return Object.keys(i).forEach(function(o){var l;tF((l=i)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=i[o])}),a},Wy=function e(t,n){if(t===n)return!0;var r=N.Children.count(t);if(r!==N.Children.count(n))return!1;if(r===0)return!0;if(r===1)return F1(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(!F1(a,o))return!1}return!0},F1=function(t,n){if(Ye(t)&&Ye(n))return!0;if(!Ye(t)&&!Ye(n)){var r=t.props||{},i=r.children,a=L1(r,X3),o=n.props||{},l=o.children,c=L1(o,Z3);return i&&l?yo(a,c)&&Wy(i,l):!i&&!l?yo(a,c):!1}return!1},U1=function(t,n){var r=[],i={};return Px(t).forEach(function(a,o){if(eF(a))r.push(a);else if(a){var l=wi(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},nF=function(t){var n=t&&t.type;return n&&D1[n]?D1[n]:null},rF=function(t,n){return Px(n).indexOf(t)},iF=["children","width","height","viewBox","className","style","title","desc"];function Hy(){return Hy=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},Hy.apply(this,arguments)}function aF(e,t){if(e==null)return{};var n=sF(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 sF(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 Gy(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=aF(e,iF),d=i||{width:n,height:r,x:0,y:0},f=Ve("recharts-surface",a);return H.createElement("svg",Hy({},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 oF=["children","className"];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 lF(e,t){if(e==null)return{};var n=cF(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 cF(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=lF(e,oF),a=Ve("recharts-layer",r);return H.createElement("g",qy({className:a},Ke(i,!0),{ref:t}),n)}),Si=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 uF(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 dF=uF,fF=dF;function hF(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:fF(e,t,n)}var pF=hF,mF="\\ud800-\\udfff",gF="\\u0300-\\u036f",yF="\\ufe20-\\ufe2f",vF="\\u20d0-\\u20ff",bF=gF+yF+vF,xF="\\ufe0e\\ufe0f",wF="\\u200d",SF=RegExp("["+wF+mF+bF+xF+"]");function kF(e){return SF.test(e)}var iT=kF;function NF(e){return e.split("")}var EF=NF,aT="\\ud800-\\udfff",_F="\\u0300-\\u036f",jF="\\ufe20-\\ufe2f",AF="\\u20d0-\\u20ff",CF=_F+jF+AF,TF="\\ufe0e\\ufe0f",OF="["+aT+"]",Ky="["+CF+"]",Vy="\\ud83c[\\udffb-\\udfff]",PF="(?:"+Ky+"|"+Vy+")",sT="[^"+aT+"]",oT="(?:\\ud83c[\\udde6-\\uddff]){2}",lT="[\\ud800-\\udbff][\\udc00-\\udfff]",RF="\\u200d",cT=PF+"?",uT="["+TF+"]?",MF="(?:"+RF+"(?:"+[sT,oT,lT].join("|")+")"+uT+cT+")*",IF=uT+cT+MF,$F="(?:"+[sT+Ky+"?",Ky,oT,lT,OF].join("|")+")",LF=RegExp(Vy+"(?="+Vy+")|"+$F+IF,"g");function DF(e){return e.match(LF)||[]}var BF=DF,zF=EF,FF=iT,UF=BF;function WF(e){return FF(e)?UF(e):zF(e)}var HF=WF,GF=pF,qF=iT,KF=HF,VF=QC;function YF(e){return function(t){t=VF(t);var n=qF(t)?KF(t):void 0,r=n?n[0]:t.charAt(0),i=n?GF(n,1).join(""):t.slice(1);return r[e]()+i}}var XF=YF,ZF=XF,QF=ZF("toUpperCase"),JF=QF;const Sp=Ze(JF);function ut(e){return function(){return e}}const dT=Math.cos,Mf=Math.sin,Br=Math.sqrt,If=Math.PI,kp=2*If,Yy=Math.PI,Xy=2*Yy,La=1e-6,e6=Xy-La;function fT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function t6(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return fT;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 n6{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?fT:t6(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>La)if(!(Math.abs(f*c-u*d)>La)||!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),w=a*Math.tan((Yy-Math.acos((m+h-v)/(2*y*b)))/2),k=w/b,S=w/y;Math.abs(k-1)>La&&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)>La||Math.abs(this._y1-d)>La)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%Xy+Xy),h>e6?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>La&&this._append`A${r},${r},0,${+(h>=Yy)},${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 Rx(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 n6(t)}function Mx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function hT(e){this._context=e}hT.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 Np(e){return new hT(e)}function pT(e){return e[0]}function mT(e){return e[1]}function gT(e,t){var n=ut(!0),r=null,i=Np,a=null,o=Rx(l);e=typeof e=="function"?e:e===void 0?pT:ut(e),t=typeof t=="function"?t:t===void 0?mT:ut(t);function l(c){var u,d=(c=Mx(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:ut(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ut(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ut(!!c),l):n},l.curve=function(c){return arguments.length?(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 gd(e,t,n){var r=null,i=ut(!0),a=null,o=Np,l=null,c=Rx(u);e=typeof e=="function"?e:e===void 0?pT:ut(+e),t=typeof t=="function"?t:ut(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?mT:ut(+n);function u(f){var h,p,g,m=(f=Mx(f)).length,v,y=!1,b,w=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(w[g],k[g]);l.lineEnd(),l.areaEnd()}y&&(w[h]=+e(v,h,f),k[h]=+t(v,h,f),l.point(r?+r(v,h,f):w[h],n?+n(v,h,f):k[h]))}if(b)return l=null,b+""||null}function d(){return gT().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ut(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ut(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ut(!!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 yT{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 r6(e){return new yT(e,!0)}function i6(e){return new yT(e,!1)}const Ix={draw(e,t){const n=Br(t/If);e.moveTo(n,0),e.arc(0,0,n,0,kp)}},a6={draw(e,t){const n=Br(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()}},vT=Br(1/3),s6=vT*2,o6={draw(e,t){const n=Br(t/s6),r=n*vT;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},l6={draw(e,t){const n=Br(t),r=-n/2;e.rect(r,r,n,n)}},c6=.8908130915292852,bT=Mf(If/10)/Mf(7*If/10),u6=Mf(kp/10)*bT,d6=-dT(kp/10)*bT,f6={draw(e,t){const n=Br(t*c6),r=u6*n,i=d6*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=kp*a/5,l=dT(o),c=Mf(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},Fm=Br(3),h6={draw(e,t){const n=-Br(t/(Fm*3));e.moveTo(0,n*2),e.lineTo(-Fm*n,-n),e.lineTo(Fm*n,-n),e.closePath()}},or=-.5,lr=Br(3)/2,Zy=1/Br(12),p6=(Zy/2+1)*3,m6={draw(e,t){const n=Br(t/p6),r=n/2,i=n*Zy,a=r,o=n*Zy+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(or*r-lr*i,lr*r+or*i),e.lineTo(or*a-lr*o,lr*a+or*o),e.lineTo(or*l-lr*c,lr*l+or*c),e.lineTo(or*r+lr*i,or*i-lr*r),e.lineTo(or*a+lr*o,or*o-lr*a),e.lineTo(or*l+lr*c,or*c-lr*l),e.closePath()}};function g6(e,t){let n=null,r=Rx(i);e=typeof e=="function"?e:ut(e||Ix),t=typeof t=="function"?t:ut(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:ut(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ut(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function $f(){}function Lf(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 xT(e){this._context=e}xT.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:Lf(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:Lf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function y6(e){return new xT(e)}function wT(e){this._context=e}wT.prototype={areaStart:$f,areaEnd:$f,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:Lf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function v6(e){return new wT(e)}function ST(e){this._context=e}ST.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:Lf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function b6(e){return new ST(e)}function kT(e){this._context=e}kT.prototype={areaStart:$f,areaEnd:$f,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 x6(e){return new kT(e)}function W1(e){return e<0?-1:1}function H1(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(W1(a)+W1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function G1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Um(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 Df(e){this._context=e}Df.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:Um(this,this._t0,G1(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,Um(this,G1(this,n=H1(this,e,t)),n);break;default:Um(this,this._t0,n=H1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function NT(e){this._context=new ET(e)}(NT.prototype=Object.create(Df.prototype)).point=function(e,t){Df.prototype.point.call(this,t,e)};function ET(e){this._context=e}ET.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 w6(e){return new Df(e)}function S6(e){return new NT(e)}function _T(e){this._context=e}_T.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=q1(e),i=q1(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 q1(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 k6(e){return new _T(e)}function Ep(e,t){this._context=e,this._t=t}Ep.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 N6(e){return new Ep(e,.5)}function E6(e){return new Ep(e,0)}function _6(e){return new Ep(e,1)}function Co(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 Qy(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function j6(e,t){return e[t]}function A6(e){const t=[];return t.key=e,t}function C6(){var e=ut([]),t=Qy,n=Co,r=j6;function i(a){var o=Array.from(e.apply(this,arguments),A6),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=Mx(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:ut(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:ut(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Qy:typeof a=="function"?a:ut(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Co,i):n},i}function T6(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}Co(e,t)}}function O6(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}Co(e,t)}}function P6(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,Co(e,t)}}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)}var R6=["type","size","sizeType"];function Jy(){return Jy=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},Jy.apply(this,arguments)}function K1(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 V1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K1(Object(n),!0).forEach(function(r){M6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function M6(e,t,n){return t=I6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I6(e){var t=$6(e,"string");return zc(t)=="symbol"?t:t+""}function $6(e,t){if(zc(e)!="object"||!e)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)}function L6(e,t){if(e==null)return{};var n=D6(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 D6(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 jT={symbolCircle:Ix,symbolCross:a6,symbolDiamond:o6,symbolSquare:l6,symbolStar:f6,symbolTriangle:h6,symbolWye:m6},B6=Math.PI/180,z6=function(t){var n="symbol".concat(Sp(t));return jT[n]||Ix},F6=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}},U6=function(t,n){jT["symbol".concat(Sp(t))]=n},$x=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=L6(t,R6),u=V1(V1({},c),{},{type:r,size:a,sizeType:l}),d=function(){var v=z6(r),y=g6().type(v).size(F6(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",Jy({},g,{className:Ve("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};$x.registerSymbol=U6;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 ev(){return ev=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},ev.apply(this,arguments)}function Y1(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 W6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y1(Object(n),!0).forEach(function(r){Fc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function H6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G6(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,CT(r.key),r)}}function q6(e,t,n){return t&&G6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function K6(e,t,n){return t=Bf(t),V6(e,AT()?Reflect.construct(t,n||[],Bf(e).constructor):t.apply(e,n))}function V6(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 Y6(e)}function Y6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AT=function(){return!!e})()}function Bf(e){return Bf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bf(e)}function X6(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 Fc(e,t,n){return t=CT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CT(e){var t=Z6(e,"string");return To(t)=="symbol"?t:t+""}function Z6(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 cr=32,Lx=function(e){function t(){return H6(this,t),K6(this,t,arguments)}return X6(t,e),q6(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=cr/2,o=cr/6,l=cr/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:cr,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(cr,"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(cr/8,"h").concat(cr,"v").concat(cr*3/4,"h").concat(-cr,"z"),className:"recharts-legend-icon"});if(H.isValidElement(r.legendIcon)){var u=W6({},r);return delete u.legendIcon,H.cloneElement(r.legendIcon,u)}return H.createElement($x,{fill:c,cx:a,cy:a,size:cr,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:cr,height:cr},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(Fc(Fc({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var y=Le(p.value)?null:p.value;Si(!Le(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var b=p.inactive?u:p.color;return H.createElement("li",ev({className:v,style:f,key:"legend-item-".concat(g)},Rf(r.props,p,g)),H.createElement(Gy,{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())}}])}(N.PureComponent);Fc(Lx,"displayName","Legend");Fc(Lx,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Q6=lp;function J6(){this.__data__=new Q6,this.size=0}var e4=J6;function t4(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var n4=t4;function r4(e){return this.__data__.get(e)}var i4=r4;function a4(e){return this.__data__.has(e)}var s4=a4,o4=lp,l4=Nx,c4=Ex,u4=200;function d4(e,t){var n=this.__data__;if(n instanceof o4){var r=n.__data__;if(!l4||r.length<u4-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new c4(r)}return n.set(e,t),this.size=n.size,this}var f4=d4,h4=lp,p4=e4,m4=n4,g4=i4,y4=s4,v4=f4;function cl(e){var t=this.__data__=new h4(e);this.size=t.size}cl.prototype.clear=p4;cl.prototype.delete=m4;cl.prototype.get=g4;cl.prototype.has=y4;cl.prototype.set=v4;var TT=cl,b4="__lodash_hash_undefined__";function x4(e){return this.__data__.set(e,b4),this}var w4=x4;function S4(e){return this.__data__.has(e)}var k4=S4,N4=Ex,E4=w4,_4=k4;function zf(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new N4;++t<n;)this.add(e[t])}zf.prototype.add=zf.prototype.push=E4;zf.prototype.has=_4;var OT=zf;function j4(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 PT=j4;function A4(e,t){return e.has(t)}var RT=A4,C4=OT,T4=PT,O4=RT,P4=1,R4=2;function M4(e,t,n,r,i,a){var o=n&P4,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&R4?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(!T4(t,function(y,b){if(!O4(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 MT=M4,I4=ai,$4=I4.Uint8Array,L4=$4;function D4(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var B4=D4;function z4(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Dx=z4,X1=Ou,Z1=L4,F4=kx,U4=MT,W4=B4,H4=Dx,G4=1,q4=2,K4="[object Boolean]",V4="[object Date]",Y4="[object Error]",X4="[object Map]",Z4="[object Number]",Q4="[object RegExp]",J4="[object Set]",e9="[object String]",t9="[object Symbol]",n9="[object ArrayBuffer]",r9="[object DataView]",Q1=X1?X1.prototype:void 0,Wm=Q1?Q1.valueOf:void 0;function i9(e,t,n,r,i,a,o){switch(n){case r9:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case n9:return!(e.byteLength!=t.byteLength||!a(new Z1(e),new Z1(t)));case K4:case V4:case Z4:return F4(+e,+t);case Y4:return e.name==t.name&&e.message==t.message;case Q4:case e9:return e==t+"";case X4:var l=W4;case J4:var c=r&G4;if(l||(l=H4),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=q4,o.set(e,t);var d=U4(l(e),l(t),r,i,a,o);return o.delete(e),d;case t9:if(Wm)return Wm.call(e)==Wm.call(t)}return!1}var a9=i9;function s9(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var IT=s9,o9=IT,l9=zn;function c9(e,t,n){var r=t(e);return l9(e)?r:o9(r,n(e))}var u9=c9;function d9(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 f9=d9;function h9(){return[]}var p9=h9,m9=f9,g9=p9,y9=Object.prototype,v9=y9.propertyIsEnumerable,J1=Object.getOwnPropertySymbols,b9=J1?function(e){return e==null?[]:(e=Object(e),m9(J1(e),function(t){return v9.call(e,t)}))}:g9,x9=b9;function w9(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var S9=w9,k9=Ri,N9=Mi,E9="[object Arguments]";function _9(e){return N9(e)&&k9(e)==E9}var j9=_9,eS=j9,A9=Mi,$T=Object.prototype,C9=$T.hasOwnProperty,T9=$T.propertyIsEnumerable,O9=eS(function(){return arguments}())?eS:function(e){return A9(e)&&C9.call(e,"callee")&&!T9.call(e,"callee")},Bx=O9,Ff={exports:{}};function P9(){return!1}var R9=P9;Ff.exports;(function(e,t){var n=ai,r=R9,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})(Ff,Ff.exports);var LT=Ff.exports,M9=9007199254740991,I9=/^(?:0|[1-9]\d*)$/;function $9(e,t){var n=typeof e;return t=t??M9,!!t&&(n=="number"||n!="symbol"&&I9.test(e))&&e>-1&&e%1==0&&e<t}var zx=$9,L9=9007199254740991;function D9(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=L9}var Fx=D9,B9=Ri,z9=Fx,F9=Mi,U9="[object Arguments]",W9="[object Array]",H9="[object Boolean]",G9="[object Date]",q9="[object Error]",K9="[object Function]",V9="[object Map]",Y9="[object Number]",X9="[object Object]",Z9="[object RegExp]",Q9="[object Set]",J9="[object String]",eU="[object WeakMap]",tU="[object ArrayBuffer]",nU="[object DataView]",rU="[object Float32Array]",iU="[object Float64Array]",aU="[object Int8Array]",sU="[object Int16Array]",oU="[object Int32Array]",lU="[object Uint8Array]",cU="[object Uint8ClampedArray]",uU="[object Uint16Array]",dU="[object Uint32Array]",pt={};pt[rU]=pt[iU]=pt[aU]=pt[sU]=pt[oU]=pt[lU]=pt[cU]=pt[uU]=pt[dU]=!0;pt[U9]=pt[W9]=pt[tU]=pt[H9]=pt[nU]=pt[G9]=pt[q9]=pt[K9]=pt[V9]=pt[Y9]=pt[X9]=pt[Z9]=pt[Q9]=pt[J9]=pt[eU]=!1;function fU(e){return F9(e)&&z9(e.length)&&!!pt[B9(e)]}var hU=fU;function pU(e){return function(t){return e(t)}}var DT=pU,Uf={exports:{}};Uf.exports;(function(e,t){var n=qC,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})(Uf,Uf.exports);var mU=Uf.exports,gU=hU,yU=DT,tS=mU,nS=tS&&tS.isTypedArray,vU=nS?yU(nS):gU,BT=vU,bU=S9,xU=Bx,wU=zn,SU=LT,kU=zx,NU=BT,EU=Object.prototype,_U=EU.hasOwnProperty;function jU(e,t){var n=wU(e),r=!n&&xU(e),i=!n&&!r&&SU(e),a=!n&&!r&&!i&&NU(e),o=n||r||i||a,l=o?bU(e.length,String):[],c=l.length;for(var u in e)(t||_U.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||kU(u,c)))&&l.push(u);return l}var AU=jU,CU=Object.prototype;function TU(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||CU;return e===n}var OU=TU;function PU(e,t){return function(n){return e(t(n))}}var zT=PU,RU=zT,MU=RU(Object.keys,Object),IU=MU,$U=OU,LU=IU,DU=Object.prototype,BU=DU.hasOwnProperty;function zU(e){if(!$U(e))return LU(e);var t=[];for(var n in Object(e))BU.call(e,n)&&n!="constructor"&&t.push(n);return t}var FU=zU,UU=Sx,WU=Fx;function HU(e){return e!=null&&WU(e.length)&&!UU(e)}var Ru=HU,GU=AU,qU=FU,KU=Ru;function VU(e){return KU(e)?GU(e):qU(e)}var _p=VU,YU=u9,XU=x9,ZU=_p;function QU(e){return YU(e,ZU,XU)}var JU=QU,rS=JU,e8=1,t8=Object.prototype,n8=t8.hasOwnProperty;function r8(e,t,n,r,i,a){var o=n&e8,l=rS(e),c=l.length,u=rS(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:n8.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 w=o?r(b,y,h,t,e,a):r(y,b,h,e,t,a);if(!(w===void 0?y===b||i(y,b,n,r,a):w)){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 i8=r8,a8=bs,s8=ai,o8=a8(s8,"DataView"),l8=o8,c8=bs,u8=ai,d8=c8(u8,"Promise"),f8=d8,h8=bs,p8=ai,m8=h8(p8,"Set"),FT=m8,g8=bs,y8=ai,v8=g8(y8,"WeakMap"),b8=v8,nv=l8,rv=Nx,iv=f8,av=FT,sv=b8,UT=Ri,ul=VC,iS="[object Map]",x8="[object Object]",aS="[object Promise]",sS="[object Set]",oS="[object WeakMap]",lS="[object DataView]",w8=ul(nv),S8=ul(rv),k8=ul(iv),N8=ul(av),E8=ul(sv),Da=UT;(nv&&Da(new nv(new ArrayBuffer(1)))!=lS||rv&&Da(new rv)!=iS||iv&&Da(iv.resolve())!=aS||av&&Da(new av)!=sS||sv&&Da(new sv)!=oS)&&(Da=function(e){var t=UT(e),n=t==x8?e.constructor:void 0,r=n?ul(n):"";if(r)switch(r){case w8:return lS;case S8:return iS;case k8:return aS;case N8:return sS;case E8:return oS}return t});var _8=Da,Hm=TT,j8=MT,A8=a9,C8=i8,cS=_8,uS=zn,dS=LT,T8=BT,O8=1,fS="[object Arguments]",hS="[object Array]",yd="[object Object]",P8=Object.prototype,pS=P8.hasOwnProperty;function R8(e,t,n,r,i,a){var o=uS(e),l=uS(t),c=o?hS:cS(e),u=l?hS:cS(t);c=c==fS?yd:c,u=u==fS?yd:u;var d=c==yd,f=u==yd,h=c==u;if(h&&dS(e)){if(!dS(t))return!1;o=!0,d=!1}if(h&&!d)return a||(a=new Hm),o||T8(e)?j8(e,t,n,r,i,a):A8(e,t,c,n,r,i,a);if(!(n&O8)){var p=d&&pS.call(e,"__wrapped__"),g=f&&pS.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,v=g?t.value():t;return a||(a=new Hm),i(m,v,n,r,a)}}return h?(a||(a=new Hm),C8(e,t,n,r,i,a)):!1}var M8=R8,I8=M8,mS=Mi;function WT(e,t,n,r,i){return e===t?!0:e==null||t==null||!mS(e)&&!mS(t)?e!==e&&t!==t:I8(e,t,n,r,WT,i)}var Ux=WT,$8=TT,L8=Ux,D8=1,B8=2;function z8(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 $8;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?L8(d,u,D8|B8,r,f):h))return!1}}return!0}var F8=z8,U8=ba;function W8(e){return e===e&&!U8(e)}var HT=W8,H8=HT,G8=_p;function q8(e){for(var t=G8(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,H8(i)]}return t}var K8=q8;function V8(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var GT=V8,Y8=F8,X8=K8,Z8=GT;function Q8(e){var t=X8(e);return t.length==1&&t[0][2]?Z8(t[0][0],t[0][1]):function(n){return n===e||Y8(n,e,t)}}var J8=Q8;function e5(e,t){return e!=null&&t in Object(e)}var t5=e5,n5=JC,r5=Bx,i5=zn,a5=zx,s5=Fx,o5=up;function l5(e,t,n){t=n5(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=o5(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&&s5(i)&&a5(o,i)&&(i5(e)||r5(e)))}var c5=l5,u5=t5,d5=c5;function f5(e,t){return e!=null&&d5(e,t,u5)}var h5=f5,p5=Ux,m5=eT,g5=h5,y5=wx,v5=HT,b5=GT,x5=up,w5=1,S5=2;function k5(e,t){return y5(e)&&v5(t)?b5(x5(e),t):function(n){var r=m5(n,e);return r===void 0&&r===t?g5(n,e):p5(t,r,w5|S5)}}var N5=k5;function E5(e){return e}var dl=E5;function _5(e){return function(t){return t==null?void 0:t[e]}}var j5=_5,A5=Ax;function C5(e){return function(t){return A5(t,e)}}var T5=C5,O5=j5,P5=T5,R5=wx,M5=up;function I5(e){return R5(e)?O5(M5(e)):P5(e)}var $5=I5,L5=J8,D5=N5,B5=dl,z5=zn,F5=$5;function U5(e){return typeof e=="function"?e:e==null?B5:typeof e=="object"?z5(e)?D5(e[0],e[1]):L5(e):F5(e)}var xa=U5;function W5(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 qT=W5;function H5(e){return e!==e}var G5=H5;function q5(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var K5=q5,V5=qT,Y5=G5,X5=K5;function Z5(e,t,n){return t===t?X5(e,t,n):V5(e,Y5,n)}var Q5=Z5,J5=Q5;function eW(e,t){var n=e==null?0:e.length;return!!n&&J5(e,t,0)>-1}var tW=eW;function nW(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 rW=nW;function iW(){}var aW=iW,Gm=FT,sW=aW,oW=Dx,lW=1/0,cW=Gm&&1/oW(new Gm([,-0]))[1]==lW?function(e){return new Gm(e)}:sW,uW=cW,dW=OT,fW=tW,hW=rW,pW=RT,mW=uW,gW=Dx,yW=200;function vW(e,t,n){var r=-1,i=fW,a=e.length,o=!0,l=[],c=l;if(n)o=!1,i=hW;else if(a>=yW){var u=t?null:mW(e);if(u)return gW(u);o=!1,i=pW,c=new dW}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 bW=vW,xW=xa,wW=bW;function SW(e,t){return e&&e.length?wW(e,xW(t)):[]}var kW=SW;const gS=Ze(kW);function KT(e,t,n){return t===!0?gS(e,n):Le(t)?gS(e,t):e}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)}var NW=["ref"];function yS(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 fi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yS(Object(n),!0).forEach(function(r){jp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vS(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,YT(r.key),r)}}function _W(e,t,n){return t&&vS(e.prototype,t),n&&vS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jW(e,t,n){return t=Wf(t),AW(e,VT()?Reflect.construct(t,n||[],Wf(e).constructor):t.apply(e,n))}function AW(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 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 VT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VT=function(){return!!e})()}function Wf(e){return Wf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wf(e)}function TW(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 jp(e,t,n){return t=YT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YT(e){var t=OW(e,"string");return Oo(t)=="symbol"?t:t+""}function OW(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)}function PW(e,t){if(e==null)return{};var n=RW(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 RW(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 MW(e){return e.value}function IW(e,t){if(H.isValidElement(e))return H.cloneElement(e,t);if(typeof e=="function")return H.createElement(e,t);t.ref;var n=PW(t,NW);return H.createElement(Lx,n)}var bS=1,es=function(e){function t(){var n;EW(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=jW(this,t,[].concat(i)),jp(n,"lastBoundingBox",{width:-1,height:-1}),n}return TW(t,e),_W(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)>bS||Math.abs(i.height-this.lastBoundingBox.height)>bS)&&(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?fi({},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 fi(fi({},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=fi(fi({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}},IW(a,fi(fi({},this.props),{},{payload:KT(d,u,MW)})))}}],[{key:"getWithHeight",value:function(r,i){var a=fi(fi({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&de(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}])}(N.PureComponent);jp(es,"displayName","Legend");jp(es,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var xS=Ou,$W=Bx,LW=zn,wS=xS?xS.isConcatSpreadable:void 0;function DW(e){return LW(e)||$W(e)||!!(wS&&e&&e[wS])}var BW=DW,zW=IT,FW=BW;function XT(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=FW),i||(i=[]);++a<o;){var l=e[a];t>0&&n(l)?t>1?XT(l,t-1,n,r,i):zW(i,l):r||(i[i.length]=l)}return i}var ZT=XT;function UW(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 WW=UW,HW=WW,GW=HW(),qW=GW,KW=qW,VW=_p;function YW(e,t){return e&&KW(e,t,VW)}var QT=YW,XW=Ru;function ZW(e,t){return function(n,r){if(n==null)return n;if(!XW(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 QW=ZW,JW=QT,eH=QW,tH=eH(JW),Wx=tH,nH=Wx,rH=Ru;function iH(e,t){var n=-1,r=rH(e)?Array(e.length):[];return nH(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var JT=iH;function aH(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var sH=aH,SS=il;function oH(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=SS(e),o=t!==void 0,l=t===null,c=t===t,u=SS(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 lH=oH,cH=lH;function uH(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,l=n.length;++r<o;){var c=cH(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 dH=uH,qm=jx,fH=Ax,hH=xa,pH=JT,mH=sH,gH=DT,yH=dH,vH=dl,bH=zn;function xH(e,t,n){t.length?t=qm(t,function(a){return bH(a)?function(o){return fH(o,a.length===1?a[0]:a)}:a}):t=[vH];var r=-1;t=qm(t,gH(hH));var i=pH(e,function(a,o,l){var c=qm(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return mH(i,function(a,o){return yH(a,o,n)})}var wH=xH;function SH(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 kH=SH,NH=kH,kS=Math.max;function EH(e,t,n){return t=kS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=kS(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),NH(e,this,l)}}var _H=EH;function jH(e){return function(){return e}}var AH=jH,CH=bs,TH=function(){try{var e=CH(Object,"defineProperty");return e({},"",{}),e}catch{}}(),eO=TH,OH=AH,NS=eO,PH=dl,RH=NS?function(e,t){return NS(e,"toString",{configurable:!0,enumerable:!1,value:OH(t),writable:!0})}:PH,MH=RH,IH=800,$H=16,LH=Date.now;function DH(e){var t=0,n=0;return function(){var r=LH(),i=$H-(r-n);if(n=r,i>0){if(++t>=IH)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var BH=DH,zH=MH,FH=BH,UH=FH(zH),WH=UH,HH=dl,GH=_H,qH=WH;function KH(e,t){return qH(GH(e,t,HH),e+"")}var VH=KH,YH=kx,XH=Ru,ZH=zx,QH=ba;function JH(e,t,n){if(!QH(n))return!1;var r=typeof t;return(r=="number"?XH(n)&&ZH(t,n.length):r=="string"&&t in n)?YH(n[t],e):!1}var Ap=JH,eG=ZT,tG=wH,nG=VH,ES=Ap,rG=nG(function(e,t){if(e==null)return[];var n=t.length;return n>1&&ES(e,t[0],t[1])?t=[]:n>2&&ES(t[0],t[1],t[2])&&(t=[t[0]]),tG(e,eG(t,1),[])}),iG=rG;const Hx=Ze(iG);function Uc(e){"@babel/helpers - typeof";return Uc=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},Uc(e)}function lv(){return lv=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},lv.apply(this,arguments)}function aG(e,t){return cG(e)||lG(e,t)||oG(e,t)||sG()}function sG(){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 oG(e,t){if(e){if(typeof e=="string")return _S(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 _S(e,t)}}function _S(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 lG(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 cG(e){if(Array.isArray(e))return e}function jS(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 Km(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jS(Object(n),!0).forEach(function(r){uG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uG(e,t,n){return t=dG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dG(e){var t=fG(e,"string");return Uc(t)=="symbol"?t:t+""}function fG(e,t){if(Uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hG(e){return Array.isArray(e)&&Ht(e[0])&&Ht(e[1])?e.join(" ~ "):e}var pG=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,w=function(){if(d&&d.length){var M={padding:0,margin:0},B=(h?Hx(d,h):d).map(function(I,F){if(I.type==="none")return null;var z=Km({display:"block",paddingTop:4,paddingBottom:4,color:I.color||"#000"},l),R=I.formatter||f||hG,O=I.value,U=I.name,A=O,Z=U;if(R&&A!=null&&Z!=null){var $=R(O,U,I,F,d);if(Array.isArray($)){var P=aG($,2);A=P[0],Z=P[1]}else A=$}return H.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(F),style:z},Ht(Z)?H.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,Ht(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"},I.unit||""))});return H.createElement("ul",{className:"recharts-tooltip-item-list",style:M},B)}return null},k=Km({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),S=Km({margin:0},u),x=!Ye(m),E=x?m:"",_=Ve("recharts-default-tooltip",p),C=Ve("recharts-tooltip-label",g);x&&v&&d!==void 0&&d!==null&&(E=v(m,d));var T=b?{role:"status","aria-live":"assertive"}:{};return H.createElement("div",lv({className:_,style:k},T),H.createElement("p",{className:C,style:S},H.isValidElement(E)?E:"".concat(E)),w())};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 vd(e,t,n){return t=mG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mG(e){var t=gG(e,"string");return Wc(t)=="symbol"?t:t+""}function gG(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 Dl="recharts-tooltip-wrapper",yG={visibility:"hidden"};function vG(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ve(Dl,vd(vd(vd(vd({},"".concat(Dl,"-right"),de(n)&&t&&de(t.x)&&n>=t.x),"".concat(Dl,"-left"),de(n)&&t&&de(t.x)&&n<t.x),"".concat(Dl,"-bottom"),de(r)&&t&&de(t.y)&&r>=t.y),"".concat(Dl,"-top"),de(r)&&t&&de(t.y)&&r<t.y))}function AS(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&&de(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 bG(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 xG(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=AS({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=AS({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=bG({translateX:d,translateY:f,useTranslate3d:l})):u=yG,{cssProperties:u,cssClasses:vG({translateX:d,translateY:f,coordinate:n})}}function Po(e){"@babel/helpers - typeof";return Po=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},Po(e)}function CS(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 TS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CS(Object(n),!0).forEach(function(r){uv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SG(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,nO(r.key),r)}}function kG(e,t,n){return t&&SG(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function NG(e,t,n){return t=Hf(t),EG(e,tO()?Reflect.construct(t,n||[],Hf(e).constructor):t.apply(e,n))}function EG(e,t){if(t&&(Po(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _G(e)}function _G(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tO=function(){return!!e})()}function Hf(e){return Hf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hf(e)}function jG(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&&cv(e,t)}function cv(e,t){return cv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},cv(e,t)}function uv(e,t,n){return t=nO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nO(e){var t=AG(e,"string");return Po(t)=="symbol"?t:t+""}function AG(e,t){if(Po(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Po(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var OS=1,CG=function(e){function t(){var n;wG(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=NG(this,t,[].concat(i)),uv(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),uv(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 jG(t,e),kG(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>OS||Math.abs(r.height-this.state.lastBoundingBox.height)>OS)&&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,w=xG({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:y}),k=w.cssClasses,S=w.cssProperties,x=TS(TS({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:x,ref:function(_){r.wrapperNode=_}},u)}}])}(N.PureComponent),TG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Mu={isSsr:TG()};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 PS(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 RS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PS(Object(n),!0).forEach(function(r){Gx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iO(r.key),r)}}function RG(e,t,n){return t&&PG(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function MG(e,t,n){return t=Gf(t),IG(e,rO()?Reflect.construct(t,n||[],Gf(e).constructor):t.apply(e,n))}function IG(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 $G(e)}function $G(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rO=function(){return!!e})()}function Gf(e){return Gf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gf(e)}function LG(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 Gx(e,t,n){return t=iO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iO(e){var t=DG(e,"string");return Ro(t)=="symbol"?t:t+""}function DG(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 BG(e){return e.dataKey}function zG(e,t){return H.isValidElement(e)?H.cloneElement(e,t):typeof e=="function"?H.createElement(e,t):H.createElement(pG,t)}var pn=function(e){function t(){return OG(this,t),MG(this,t,arguments)}return LG(t,e),RG(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,w=i.viewBox,k=i.wrapperStyle,S=g??[];f&&S.length&&(S=KT(g.filter(function(E){return E.value!=null&&(E.hide!==!0||r.props.includeHidden)}),m,BG));var x=S.length>0;return H.createElement(CG,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:x,offset:p,position:v,reverseDirection:y,useTranslate3d:b,viewBox:w,wrapperStyle:k},zG(u,RS(RS({},this.props),{},{payload:S})))}}])}(N.PureComponent);Gx(pn,"displayName","Tooltip");Gx(pn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Mu.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 FG=ai,UG=function(){return FG.Date.now()},WG=UG,HG=/\s/;function GG(e){for(var t=e.length;t--&&HG.test(e.charAt(t)););return t}var qG=GG,KG=qG,VG=/^\s+/;function YG(e){return e&&e.slice(0,KG(e)+1).replace(VG,"")}var XG=YG,ZG=XG,MS=ba,QG=il,IS=NaN,JG=/^[-+]0x[0-9a-f]+$/i,eq=/^0b[01]+$/i,tq=/^0o[0-7]+$/i,nq=parseInt;function rq(e){if(typeof e=="number")return e;if(QG(e))return IS;if(MS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=MS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ZG(e);var n=eq.test(e);return n||tq.test(e)?nq(e.slice(2),n?2:8):JG.test(e)?IS:+e}var aO=rq,iq=ba,Vm=WG,$S=aO,aq="Expected a function",sq=Math.max,oq=Math.min;function lq(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(aq);t=$S(t)||0,iq(n)&&(d=!!n.leading,f="maxWait"in n,a=f?sq($S(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(x){var E=r,_=i;return r=i=void 0,u=x,o=e.apply(_,E),o}function g(x){return u=x,l=setTimeout(y,t),d?p(x):o}function m(x){var E=x-c,_=x-u,C=t-E;return f?oq(C,a-_):C}function v(x){var E=x-c,_=x-u;return c===void 0||E>=t||E<0||f&&_>=a}function y(){var x=Vm();if(v(x))return b(x);l=setTimeout(y,m(x))}function b(x){return l=void 0,h&&r?p(x):(r=i=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function k(){return l===void 0?o:b(Vm())}function S(){var x=Vm(),E=v(x);if(r=arguments,i=this,c=x,E){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=w,S.flush=k,S}var cq=lq,uq=cq,dq=ba,fq="Expected a function";function hq(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(fq);return dq(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),uq(e,t,{leading:r,maxWait:t,trailing:i})}var pq=hq;const sO=Ze(pq);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 LS(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 bd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LS(Object(n),!0).forEach(function(r){mq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mq(e,t,n){return t=gq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gq(e){var t=yq(e,"string");return Hc(t)=="symbol"?t:t+""}function yq(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 vq(e,t){return Sq(e)||wq(e,t)||xq(e,t)||bq()}function bq(){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 xq(e,t){if(e){if(typeof e=="string")return DS(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 DS(e,t)}}function DS(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 wq(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 Sq(e){if(Array.isArray(e))return e}var Fa=N.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,w=e.style,k=w===void 0?{}:w,S=N.useRef(null),x=N.useRef();x.current=b,N.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=N.useState({containerWidth:i.width,containerHeight:i.height}),_=vq(E,2),C=_[0],T=_[1],L=N.useCallback(function(B,I){T(function(F){var z=Math.round(B),R=Math.round(I);return F.containerWidth===z&&F.containerHeight===R?F:{containerWidth:z,containerHeight:R}})},[]);N.useEffect(function(){var B=function(U){var A,Z=U[0].contentRect,$=Z.width,P=Z.height;L($,P),(A=x.current)===null||A===void 0||A.call(x,$,P)};m>0&&(B=sO(B,m,{trailing:!0,leading:!1}));var I=new ResizeObserver(B),F=S.current.getBoundingClientRect(),z=F.width,R=F.height;return L(z,R),I.observe(S.current),function(){I.disconnect()}},[L,m]);var M=N.useMemo(function(){var B=C.containerWidth,I=C.containerHeight;if(B<0||I<0)return null;Si(Ka(o)||Ka(c),`The width(%s) and height(%s) are both fixed numbers,
|
|
81
|
-
maybe you don't need to use a ResponsiveContainer.`,o,c),Si(!n||n>0,"The aspect(%s) must be greater than zero.",n);var F=Ka(o)?B:o,z=Ka(c)?I:c;n&&n>0&&(F?z=F/n:z&&(F=z*n),h&&z>h&&(z=h)),Si(F>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
82
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
83
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
84
|
-
height and width.`,F,z,o,c,d,f,n);var R=!Array.isArray(p)&&wi(p.type).endsWith("Chart");return H.Children.map(p,function(O){return H.isValidElement(O)?N.cloneElement(O,bd({width:F,height:z},R?{style:bd({height:"100%",width:"100%",maxHeight:z,maxWidth:F},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:bd(bd({},k),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:S},M)}),Gc=function(t){return null};Gc.displayName="Cell";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 BS(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 fv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BS(Object(n),!0).forEach(function(r){kq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kq(e,t,n){return t=Nq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nq(e){var t=Eq(e,"string");return qc(t)=="symbol"?t:t+""}function Eq(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)}var Ds={widthCache:{},cacheCount:0},_q=2e3,jq={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},zS="recharts_measurement_span";function Aq(e){var t=fv({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var hc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Mu.isSsr)return{width:0,height:0};var r=Aq(n),i=JSON.stringify({text:t,copyStyle:r});if(Ds.widthCache[i])return Ds.widthCache[i];try{var a=document.getElementById(zS);a||(a=document.createElement("span"),a.setAttribute("id",zS),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=fv(fv({},jq),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Ds.widthCache[i]=c,++Ds.cacheCount>_q&&(Ds.cacheCount=0,Ds.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 Kc(e){"@babel/helpers - typeof";return Kc=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},Kc(e)}function qf(e,t){return Rq(e)||Pq(e,t)||Oq(e,t)||Tq()}function Tq(){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 Oq(e,t){if(e){if(typeof e=="string")return FS(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 FS(e,t)}}function FS(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 Pq(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 Rq(e){if(Array.isArray(e))return e}function Mq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function US(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,$q(r.key),r)}}function Iq(e,t,n){return t&&US(e.prototype,t),n&&US(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $q(e){var t=Lq(e,"string");return Kc(t)=="symbol"?t:t+""}function Lq(e,t){if(Kc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var WS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,HS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Dq=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Bq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,oO={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},zq=Object.keys(oO),so="NaN";function Fq(e,t){return e*oO[t]}var xd=function(){function e(t,n){Mq(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!Dq.test(n)&&(this.num=NaN,this.unit=""),zq.includes(n)&&(this.num=Fq(t,n),this.unit="px")}return Iq(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=qf(i,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function lO(e){if(e.includes(so))return so;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=WS.exec(t))!==null&&n!==void 0?n:[],i=qf(r,4),a=i[1],o=i[2],l=i[3],c=xd.parse(a??""),u=xd.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return so;t=t.replace(WS,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=HS.exec(t))!==null&&f!==void 0?f:[],p=qf(h,4),g=p[1],m=p[2],v=p[3],y=xd.parse(g??""),b=xd.parse(v??""),w=m==="+"?y.add(b):y.subtract(b);if(w.isNaN())return so;t=t.replace(HS,w.toString())}return t}var GS=/\(([^()]*)\)/;function Uq(e){for(var t=e;t.includes("(");){var n=GS.exec(t),r=qf(n,2),i=r[1];t=t.replace(GS,lO(i))}return t}function Wq(e){var t=e.replace(/\s+/g,"");return t=Uq(t),t=lO(t),t}function Hq(e){try{return Wq(e)}catch{return so}}function Ym(e){var t=Hq(e.slice(5,-1));return t===so?"":t}var Gq=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],qq=["dx","dy","angle","className","breakAll"];function hv(){return hv=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},hv.apply(this,arguments)}function qS(e,t){if(e==null)return{};var n=Kq(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 Kq(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 KS(e,t){return Zq(e)||Xq(e,t)||Yq(e,t)||Vq()}function Vq(){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 Yq(e,t){if(e){if(typeof e=="string")return VS(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 VS(e,t)}}function VS(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 Xq(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 Zq(e){if(Array.isArray(e))return e}var cO=/[ \f\n\r\t\v\u2028\u2029]+/,uO=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(cO));var o=a.map(function(c){return{word:c,width:hc(c,i).width}}),l=r?0:hc("ย ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},Qq=function(t,n,r,i,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=de(o),f=l,h=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(z,R){var O=R.word,U=R.width,A=z[z.length-1];if(A&&(i==null||a||A.width+U+r<Number(i)))A.words.push(O),A.width+=U+r;else{var Z={words:[O],width:U};z.push(Z)}return z},[])},p=h(n),g=function(F){return F.reduce(function(z,R){return z.width>R.width?z:R})};if(!d)return p;for(var m="โฆ",v=function(F){var z=f.slice(0,F),R=uO({breakAll:u,style:c,children:z+m}).wordsWithComputedWidth,O=h(R),U=O.length>o||g(O).width>Number(i);return[U,O]},y=0,b=f.length-1,w=0,k;y<=b&&w<=f.length-1;){var S=Math.floor((y+b)/2),x=S-1,E=v(x),_=KS(E,2),C=_[0],T=_[1],L=v(S),M=KS(L,1),B=M[0];if(!C&&!B&&(y=S+1),C&&B&&(b=S-1),!C&&B){k=T;break}w++}return k||p},YS=function(t){var n=Ye(t)?[]:t.toString().split(cO);return[{words:n}]},Jq=function(t){var n=t.width,r=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!Mu.isSsr){var c,u,d=uO({breakAll:o,children:i,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return YS(i);return Qq({breakAll:o,children:i,maxLines:l,style:a},c,u,n,r)}return YS(i)},XS="#808080",Kf=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?XS:v,b=qS(t,Gq),w=N.useMemo(function(){return Jq({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,x=b.angle,E=b.className,_=b.breakAll,C=qS(b,qq);if(!Ht(r)||!Ht(a))return null;var T=r+(de(k)?k:0),L=a+(de(S)?S:0),M;switch(m){case"start":M=Ym("calc(".concat(u,")"));break;case"middle":M=Ym("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:M=Ym("calc(".concat(w.length-1," * -").concat(l,")"));break}var B=[];if(f){var I=w[0].width,F=b.width;B.push("scale(".concat((de(F)?F/I:1)/I,")"))}return x&&B.push("rotate(".concat(x,", ").concat(T,", ").concat(L,")")),B.length&&(C.transform=B.join(" ")),H.createElement("text",hv({},Ke(C,!0),{x:T,y:L,className:Ve("recharts-text",E),textAnchor:p,fill:y.includes("url")?XS:y}),w.map(function(z,R){var O=z.words.join(_?"":" ");return H.createElement("tspan",{x:T,dy:R===0?M:l,key:"".concat(O,"-").concat(R)},O)}))};function ua(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function eK(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qx(e){let t,n,r;e.length!==2?(t=ua,n=(l,c)=>ua(e(l),c),r=(l,c)=>e(l)-c):(t=e===ua||e===eK?e:tK,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 tK(){return 0}function dO(e){return e===null?NaN:+e}function*nK(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const rK=qx(ua),Iu=rK.right;qx(dO).center;class ZS extends Map{constructor(t,n=sK){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(QS(this,t))}has(t){return super.has(QS(this,t))}set(t,n){return super.set(iK(this,t),n)}delete(t){return super.delete(aK(this,t))}}function QS({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function iK({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function aK({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function sK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function oK(e=ua){if(e===ua)return fO;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 fO(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const lK=Math.sqrt(50),cK=Math.sqrt(10),uK=Math.sqrt(2);function Vf(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>=lK?10:a>=cK?5:a>=uK?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?Vf(e,t,n*2):[l,c,u]}function pv(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?Vf(t,e,n):Vf(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 mv(e,t,n){return t=+t,e=+e,n=+n,Vf(e,t,n)[2]}function gv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?mv(t,e,n):mv(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function JS(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function ek(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function hO(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?fO:oK(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));hO(e,t,p,g,i)}const a=e[t];let o=n,l=r;for(Bl(e,n,t),i(e[r],a)>0&&Bl(e,n,r);o<l;){for(Bl(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?Bl(e,n,l):(++l,Bl(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Bl(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function dK(e,t,n){if(e=Float64Array.from(nK(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ek(e);if(t>=1)return JS(e);var r,i=(r-1)*t,a=Math.floor(i),o=JS(hO(e,a).subarray(0,a+1)),l=ek(e.subarray(a+1));return o+(l-o)*(i-a)}}function fK(e,t,n=dO){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 hK(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 Sr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ii(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 yv=Symbol("implicit");function Kx(){var e=new ZS,t=[],n=[],r=yv;function i(a){let o=e.get(a);if(o===void 0){if(r!==yv)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 Kx(t,n).unknown(r)},Sr.apply(i,arguments),i}function Vc(){var e=Kx().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=hK(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 Vc(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(d)},Sr.apply(f(),arguments)}function pO(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return pO(t())},e}function pc(){return pO(Vc.apply(null,arguments).paddingInner(1))}function Vx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mO(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function $u(){}var Yc=.7,Yf=1/Yc,vo="\\s*([+-]?\\d+)\\s*",Xc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ti="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pK=/^#([0-9a-f]{3,8})$/,mK=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),gK=new RegExp(`^rgb\\(${ti},${ti},${ti}\\)$`),yK=new RegExp(`^rgba\\(${vo},${vo},${vo},${Xc}\\)$`),vK=new RegExp(`^rgba\\(${ti},${ti},${ti},${Xc}\\)$`),bK=new RegExp(`^hsl\\(${Xc},${ti},${ti}\\)$`),xK=new RegExp(`^hsla\\(${Xc},${ti},${ti},${Xc}\\)$`),tk={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};Vx($u,Zc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:nk,formatHex:nk,formatHex8:wK,formatHsl:SK,formatRgb:rk,toString:rk});function nk(){return this.rgb().formatHex()}function wK(){return this.rgb().formatHex8()}function SK(){return gO(this).formatHsl()}function rk(){return this.rgb().formatRgb()}function Zc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pK.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ik(t):n===3?new $n(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wd(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=mK.exec(e))?new $n(t[1],t[2],t[3],1):(t=gK.exec(e))?new $n(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yK.exec(e))?wd(t[1],t[2],t[3],t[4]):(t=vK.exec(e))?wd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bK.exec(e))?ok(t[1],t[2]/100,t[3]/100,1):(t=xK.exec(e))?ok(t[1],t[2]/100,t[3]/100,t[4]):tk.hasOwnProperty(e)?ik(tk[e]):e==="transparent"?new $n(NaN,NaN,NaN,0):null}function ik(e){return new $n(e>>16&255,e>>8&255,e&255,1)}function wd(e,t,n,r){return r<=0&&(e=t=n=NaN),new $n(e,t,n,r)}function kK(e){return e instanceof $u||(e=Zc(e)),e?(e=e.rgb(),new $n(e.r,e.g,e.b,e.opacity)):new $n}function vv(e,t,n,r){return arguments.length===1?kK(e):new $n(e,t,n,r??1)}function $n(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Vx($n,vv,mO($u,{brighter(e){return e=e==null?Yf:Math.pow(Yf,e),new $n(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yc:Math.pow(Yc,e),new $n(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $n(ts(this.r),ts(this.g),ts(this.b),Xf(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:ak,formatHex:ak,formatHex8:NK,formatRgb:sk,toString:sk}));function ak(){return`#${Va(this.r)}${Va(this.g)}${Va(this.b)}`}function NK(){return`#${Va(this.r)}${Va(this.g)}${Va(this.b)}${Va((isNaN(this.opacity)?1:this.opacity)*255)}`}function sk(){const e=Xf(this.opacity);return`${e===1?"rgb(":"rgba("}${ts(this.r)}, ${ts(this.g)}, ${ts(this.b)}${e===1?")":`, ${e})`}`}function Xf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ts(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Va(e){return e=ts(e),(e<16?"0":"")+e.toString(16)}function ok(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Or(e,t,n,r)}function gO(e){if(e instanceof Or)return new Or(e.h,e.s,e.l,e.opacity);if(e instanceof $u||(e=Zc(e)),!e)return new Or;if(e instanceof Or)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 Or(o,l,c,e.opacity)}function EK(e,t,n,r){return arguments.length===1?gO(e):new Or(e,t,n,r??1)}function Or(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Vx(Or,EK,mO($u,{brighter(e){return e=e==null?Yf:Math.pow(Yf,e),new Or(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yc:Math.pow(Yc,e),new Or(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new $n(Xm(e>=240?e-240:e+120,i,r),Xm(e,i,r),Xm(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Or(lk(this.h),Sd(this.s),Sd(this.l),Xf(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=Xf(this.opacity);return`${e===1?"hsl(":"hsla("}${lk(this.h)}, ${Sd(this.s)*100}%, ${Sd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function lk(e){return e=(e||0)%360,e<0?e+360:e}function Sd(e){return Math.max(0,Math.min(1,e||0))}function Xm(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 Yx=e=>()=>e;function _K(e,t){return function(n){return e+n*t}}function jK(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 AK(e){return(e=+e)==1?yO:function(t,n){return n-t?jK(t,n,e):Yx(isNaN(t)?n:t)}}function yO(e,t){var n=t-e;return n?_K(e,n):Yx(isNaN(e)?t:e)}const ck=function e(t){var n=AK(t);function r(i,a){var o=n((i=vv(i)).r,(a=vv(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=yO(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 TK(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function OK(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]=fl(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 PK(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Zf(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function RK(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]=fl(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var bv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zm=new RegExp(bv.source,"g");function MK(e){return function(){return e}}function IK(e){return function(t){return e(t)+""}}function $K(e,t){var n=bv.lastIndex=Zm.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=bv.exec(e))&&(i=Zm.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:Zf(r,i)})),n=Zm.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?IK(c[0].x):MK(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 fl(e,t){var n=typeof t,r;return t==null||n==="boolean"?Yx(t):(n==="number"?Zf:n==="string"?(r=Zc(t))?(t=r,ck):$K:t instanceof Zc?ck:t instanceof Date?PK:TK(t)?CK:Array.isArray(t)?OK:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?RK:Zf)(e,t)}function Xx(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function LK(e,t){t===void 0&&(t=e,e=fl);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 DK(e){return function(){return e}}function Qf(e){return+e}var uk=[0,1];function jn(e){return e}function xv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:DK(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 zK(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=xv(i,r),a=n(o,a)):(r=xv(r,i),a=n(a,o)),function(l){return a(r(l))}}function FK(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]=xv(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=Iu(e,l,1,r)-1;return a[c](i[c](l))}}function Lu(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Cp(){var e=uk,t=uk,n=fl,r,i,a,o=jn,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==jn&&(o=BK(e[0],e[h-1])),l=h>2?FK:zK,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),Zf)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Qf),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=Xx,d()},f.clamp=function(h){return arguments.length?(o=h?!0:jn,d()):o!==jn},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 Zx(){return Cp()(jn,jn)}function UK(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Jf(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 Mo(e){return e=Jf(Math.abs(e)),e?e[1]:NaN}function WK(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 HK(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var GK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Qc(e){if(!(t=GK.exec(e)))throw new Error("invalid format: "+e);var t;return new Qx({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]})}Qc.prototype=Qx.prototype;function Qx(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+""}Qx.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 qK(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 eh;function KK(e,t){var n=Jf(e,t);if(!n)return eh=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(eh=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")+Jf(e,Math.max(0,t+a-1))[0]}function dk(e,t){var n=Jf(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 fk={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:UK,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)=>dk(e*100,t),r:dk,s:KK,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function hk(e){return e}var pk=Array.prototype.map,mk=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function VK(e){var t=e.grouping===void 0||e.thousands===void 0?hk:WK(pk.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?hk:HK(pk.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=Qc(f);var p=f.fill,g=f.align,m=f.sign,v=f.symbol,y=f.zero,b=f.width,w=f.comma,k=f.precision,S=f.trim,x=f.type;x==="n"?(w=!0,x="g"):fk[x]||(k===void 0&&(k=12),S=!0,x="g"),(y||p==="0"&&g==="=")&&(y=!0,p="0",g="=");var E=(h&&h.prefix!==void 0?h.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():""),_=(v==="$"?r:/[%p]/.test(x)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),C=fk[x],T=/[defgprs%]/.test(x);k=k===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function L(M){var B=E,I=_,F,z,R;if(x==="c")I=C(M)+I,M="";else{M=+M;var O=M<0||1/M<0;if(M=isNaN(M)?c:C(Math.abs(M),k),S&&(M=qK(M)),O&&+M==0&&m!=="+"&&(O=!1),B=(O?m==="("?m:l:m==="-"||m==="("?"":m)+B,I=(x==="s"&&!isNaN(M)&&eh!==void 0?mk[8+eh/3]:"")+I+(O&&m==="("?")":""),T){for(F=-1,z=M.length;++F<z;)if(R=M.charCodeAt(F),48>R||R>57){I=(R===46?i+M.slice(F+1):M.slice(F))+I,M=M.slice(0,F);break}}}w&&!y&&(M=t(M,1/0));var U=B.length+M.length+I.length,A=U<b?new Array(b-U+1).join(p):"";switch(w&&y&&(M=t(A+M,A.length?b-I.length:1/0),A=""),g){case"<":M=B+M+I+A;break;case"=":M=B+A+M+I;break;case"^":M=A.slice(0,U=A.length>>1)+B+M+I+A.slice(U);break;default:M=A+B+M+I;break}return a(M)}return L.toString=function(){return f+""},L}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(Mo(h)/3)))*3,g=Math.pow(10,-p),m=u((f=Qc(f),f.type="f",f),{suffix:mk[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:d}}var kd,Jx,vO;YK({thousands:",",grouping:[3],currency:["$",""]});function YK(e){return kd=VK(e),Jx=kd.format,vO=kd.formatPrefix,kd}function XK(e){return Math.max(0,-Mo(Math.abs(e)))}function ZK(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Mo(t)/3)))*3-Mo(Math.abs(e)))}function QK(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Mo(t)-Mo(e))+1}function bO(e,t,n,r){var i=gv(e,t,n),a;switch(r=Qc(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=ZK(i,o))&&(r.precision=a),vO(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=QK(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=XK(i))&&(r.precision=a-(r.type==="%")*2);break}}return Jx(r)}function wa(e){var t=e.domain;return e.ticks=function(n){var r=t();return pv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return bO(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=mv(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 th(){var e=Zx();return e.copy=function(){return Lu(e,th())},Sr.apply(e,arguments),wa(e)}function xO(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,Qf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return xO(e).unknown(t)},e=arguments.length?Array.from(e,Qf):[0,1],wa(n)}function wO(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 gk(e){return Math.log(e)}function yk(e){return Math.exp(e)}function JK(e){return-Math.log(-e)}function e7(e){return-Math.exp(-e)}function t7(e){return isFinite(e)?+("1e"+e):e<0?0:e}function n7(e){return e===10?t7:e===Math.E?Math.exp:t=>Math.pow(e,t)}function r7(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 vk(e){return(t,n)=>-e(-t,n)}function e0(e){const t=e(gk,yk),n=t.domain;let r=10,i,a;function o(){return i=r7(r),a=n7(r),n()[0]<0?(i=vk(i),a=vk(a),e(JK,e7)):e(gk,yk),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=pv(u,d,v))}else y=pv(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=Qc(c)).precision==null&&(c.trim=!0),c=Jx(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(wO(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function SO(){const e=e0(Cp()).domain([1,10]);return e.copy=()=>Lu(e,SO()).base(e.base()),Sr.apply(e,arguments),e}function bk(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function xk(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function t0(e){var t=1,n=e(bk(t),xk(t));return n.constant=function(r){return arguments.length?e(bk(t=+r),xk(t)):t},wa(n)}function kO(){var e=t0(Cp());return e.copy=function(){return Lu(e,kO()).constant(e.constant())},Sr.apply(e,arguments)}function wk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function i7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function a7(e){return e<0?-e*e:e*e}function n0(e){var t=e(jn,jn),n=1;function r(){return n===1?e(jn,jn):n===.5?e(i7,a7):e(wk(n),wk(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},wa(t)}function r0(){var e=n0(Cp());return e.copy=function(){return Lu(e,r0()).exponent(e.exponent())},Sr.apply(e,arguments),e}function s7(){return r0.apply(null,arguments).exponent(.5)}function Sk(e){return Math.sign(e)*e*e}function o7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function NO(){var e=Zx(),t=[0,1],n=!1,r;function i(a){var o=o7(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(Sk(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,Qf)).map(Sk)),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 NO(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Sr.apply(i,arguments),wa(i)}function EO(){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]=fK(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Iu(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(ua),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 EO().domain(e).range(t).unknown(r)},Sr.apply(a,arguments)}function _O(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[Iu(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 _O().domain([e,t]).range(i).unknown(a)},Sr.apply(wa(o),arguments)}function jO(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Iu(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 jO().domain(e).range(t).unknown(n)},Sr.apply(i,arguments)}const Qm=new Date,Jm=new Date;function Gt(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=>Gt(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)=>(Qm.setTime(+a),Jm.setTime(+o),e(Qm),e(Jm),Math.floor(n(Qm,Jm))),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 nh=Gt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);nh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Gt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):nh);nh.range;const yi=1e3,mr=yi*60,vi=mr*60,Ai=vi*24,i0=Ai*7,kk=Ai*30,eg=Ai*365,Ya=Gt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yi)},(e,t)=>(t-e)/yi,e=>e.getUTCSeconds());Ya.range;const a0=Gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yi)},(e,t)=>{e.setTime(+e+t*mr)},(e,t)=>(t-e)/mr,e=>e.getMinutes());a0.range;const s0=Gt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*mr)},(e,t)=>(t-e)/mr,e=>e.getUTCMinutes());s0.range;const o0=Gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yi-e.getMinutes()*mr)},(e,t)=>{e.setTime(+e+t*vi)},(e,t)=>(t-e)/vi,e=>e.getHours());o0.range;const l0=Gt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*vi)},(e,t)=>(t-e)/vi,e=>e.getUTCHours());l0.range;const Du=Gt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*mr)/Ai,e=>e.getDate()-1);Du.range;const Tp=Gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ai,e=>e.getUTCDate()-1);Tp.range;const AO=Gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ai,e=>Math.floor(e/Ai));AO.range;function xs(e){return Gt(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())*mr)/i0)}const Op=xs(0),rh=xs(1),l7=xs(2),c7=xs(3),Io=xs(4),u7=xs(5),d7=xs(6);Op.range;rh.range;l7.range;c7.range;Io.range;u7.range;d7.range;function ws(e){return Gt(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)/i0)}const Pp=ws(0),ih=ws(1),f7=ws(2),h7=ws(3),$o=ws(4),p7=ws(5),m7=ws(6);Pp.range;ih.range;f7.range;h7.range;$o.range;p7.range;m7.range;const c0=Gt(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());c0.range;const u0=Gt(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());u0.range;const Ci=Gt(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());Ci.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gt(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)});Ci.range;const Ti=Gt(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());Ti.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gt(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)});Ti.range;function CO(e,t,n,r,i,a){const o=[[Ya,1,yi],[Ya,5,5*yi],[Ya,15,15*yi],[Ya,30,30*yi],[a,1,mr],[a,5,5*mr],[a,15,15*mr],[a,30,30*mr],[i,1,vi],[i,3,3*vi],[i,6,6*vi],[i,12,12*vi],[r,1,Ai],[r,2,2*Ai],[n,1,i0],[t,1,kk],[t,3,3*kk],[e,1,eg]];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=qx(([,,v])=>v).right(o,h);if(p===o.length)return e.every(gv(u/eg,d/eg,f));if(p===0)return nh.every(Math.max(gv(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[g7,y7]=CO(Ti,u0,Pp,AO,l0,s0),[v7,b7]=CO(Ci,c0,Op,Du,o0,a0);function tg(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 ng(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function zl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function x7(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=Fl(i),d=Ul(i),f=Fl(a),h=Ul(a),p=Fl(o),g=Ul(o),m=Fl(l),v=Ul(l),y=Fl(c),b=Ul(c),w={a:R,A:O,b:U,B:A,c:null,d:Ck,e:Ck,f:W7,g:J7,G:tV,H:z7,I:F7,j:U7,L:TO,m:H7,M:G7,p:Z,q:$,Q:Pk,s:Rk,S:q7,u:K7,U:V7,V:Y7,w:X7,W:Z7,x:null,X:null,y:Q7,Y:eV,Z:nV,"%":Ok},k={a:P,A:oe,b:be,B:pe,c:null,d:Tk,e:Tk,f:sV,g:gV,G:vV,H:rV,I:iV,j:aV,L:PO,m:oV,M:lV,p:Ce,q:G,Q:Pk,s:Rk,S:cV,u:uV,U:dV,V:fV,w:hV,W:pV,x:null,X:null,y:mV,Y:yV,Z:bV,"%":Ok},S={a:T,A:L,b:M,B,c:I,d:jk,e:jk,f:$7,g:_k,G:Ek,H:Ak,I:Ak,j:P7,L:I7,m:O7,M:R7,p:C,q:T7,Q:D7,s:B7,S:M7,u:E7,U:_7,V:j7,w:N7,W:A7,x:F,X:z,y:_k,Y:Ek,Z:C7,"%":L7};w.x=x(n,w),w.X=x(r,w),w.c=x(t,w),k.x=x(n,k),k.X=x(r,k),k.c=x(t,k);function x(Y,ae){return function(le){var X=[],je=-1,Ne=0,_e=Y.length,ge,$e,fe;for(le instanceof Date||(le=new Date(+le));++je<_e;)Y.charCodeAt(je)===37&&(X.push(Y.slice(Ne,je)),($e=Nk[ge=Y.charAt(++je)])!=null?ge=Y.charAt(++je):$e=ge==="e"?" ":"0",(fe=ae[ge])&&(ge=fe(le,$e)),X.push(ge),Ne=je+1);return X.push(Y.slice(Ne,je)),X.join("")}}function E(Y,ae){return function(le){var X=zl(1900,void 0,1),je=_(X,Y,le+="",0),Ne,_e;if(je!=le.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(ae&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(Ne=ng(zl(X.y,0,1)),_e=Ne.getUTCDay(),Ne=_e>4||_e===0?ih.ceil(Ne):ih(Ne),Ne=Tp.offset(Ne,(X.V-1)*7),X.y=Ne.getUTCFullYear(),X.m=Ne.getUTCMonth(),X.d=Ne.getUTCDate()+(X.w+6)%7):(Ne=tg(zl(X.y,0,1)),_e=Ne.getDay(),Ne=_e>4||_e===0?rh.ceil(Ne):rh(Ne),Ne=Du.offset(Ne,(X.V-1)*7),X.y=Ne.getFullYear(),X.m=Ne.getMonth(),X.d=Ne.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),_e="Z"in X?ng(zl(X.y,0,1)).getUTCDay():tg(zl(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(_e+5)%7:X.w+X.U*7-(_e+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,ng(X)):tg(X)}}function _(Y,ae,le,X){for(var je=0,Ne=ae.length,_e=le.length,ge,$e;je<Ne;){if(X>=_e)return-1;if(ge=ae.charCodeAt(je++),ge===37){if(ge=ae.charAt(je++),$e=S[ge in Nk?ae.charAt(je++):ge],!$e||(X=$e(Y,le,X))<0)return-1}else if(ge!=le.charCodeAt(X++))return-1}return X}function C(Y,ae,le){var X=u.exec(ae.slice(le));return X?(Y.p=d.get(X[0].toLowerCase()),le+X[0].length):-1}function T(Y,ae,le){var X=p.exec(ae.slice(le));return X?(Y.w=g.get(X[0].toLowerCase()),le+X[0].length):-1}function L(Y,ae,le){var X=f.exec(ae.slice(le));return X?(Y.w=h.get(X[0].toLowerCase()),le+X[0].length):-1}function M(Y,ae,le){var X=y.exec(ae.slice(le));return X?(Y.m=b.get(X[0].toLowerCase()),le+X[0].length):-1}function B(Y,ae,le){var X=m.exec(ae.slice(le));return X?(Y.m=v.get(X[0].toLowerCase()),le+X[0].length):-1}function I(Y,ae,le){return _(Y,t,ae,le)}function F(Y,ae,le){return _(Y,n,ae,le)}function z(Y,ae,le){return _(Y,r,ae,le)}function R(Y){return o[Y.getDay()]}function O(Y){return a[Y.getDay()]}function U(Y){return c[Y.getMonth()]}function A(Y){return l[Y.getMonth()]}function Z(Y){return i[+(Y.getHours()>=12)]}function $(Y){return 1+~~(Y.getMonth()/3)}function P(Y){return o[Y.getUTCDay()]}function oe(Y){return a[Y.getUTCDay()]}function be(Y){return c[Y.getUTCMonth()]}function pe(Y){return l[Y.getUTCMonth()]}function Ce(Y){return i[+(Y.getUTCHours()>=12)]}function G(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var ae=x(Y+="",w);return ae.toString=function(){return Y},ae},parse:function(Y){var ae=E(Y+="",!1);return ae.toString=function(){return Y},ae},utcFormat:function(Y){var ae=x(Y+="",k);return ae.toString=function(){return Y},ae},utcParse:function(Y){var ae=E(Y+="",!0);return ae.toString=function(){return Y},ae}}}var Nk={"-":"",_:" ",0:"0"},Zt=/^\s*\d+/,w7=/^%/,S7=/[\\^$*+?|[\]().{}]/g;function Ge(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 k7(e){return e.replace(S7,"\\$&")}function Fl(e){return new RegExp("^(?:"+e.map(k7).join("|")+")","i")}function Ul(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function N7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function E7(e,t,n){var r=Zt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function _7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function j7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function A7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ek(e,t,n){var r=Zt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function _k(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 T7(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 O7(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 jk(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function P7(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 Ak(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function R7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function M7(e,t,n){var r=Zt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function I7(e,t,n){var r=Zt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function $7(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 L7(e,t,n){var r=w7.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function D7(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 Ck(e,t){return Ge(e.getDate(),t,2)}function z7(e,t){return Ge(e.getHours(),t,2)}function F7(e,t){return Ge(e.getHours()%12||12,t,2)}function U7(e,t){return Ge(1+Du.count(Ci(e),e),t,3)}function TO(e,t){return Ge(e.getMilliseconds(),t,3)}function W7(e,t){return TO(e,t)+"000"}function H7(e,t){return Ge(e.getMonth()+1,t,2)}function G7(e,t){return Ge(e.getMinutes(),t,2)}function q7(e,t){return Ge(e.getSeconds(),t,2)}function K7(e){var t=e.getDay();return t===0?7:t}function V7(e,t){return Ge(Op.count(Ci(e)-1,e),t,2)}function OO(e){var t=e.getDay();return t>=4||t===0?Io(e):Io.ceil(e)}function Y7(e,t){return e=OO(e),Ge(Io.count(Ci(e),e)+(Ci(e).getDay()===4),t,2)}function X7(e){return e.getDay()}function Z7(e,t){return Ge(rh.count(Ci(e)-1,e),t,2)}function Q7(e,t){return Ge(e.getFullYear()%100,t,2)}function J7(e,t){return e=OO(e),Ge(e.getFullYear()%100,t,2)}function eV(e,t){return Ge(e.getFullYear()%1e4,t,4)}function tV(e,t){var n=e.getDay();return e=n>=4||n===0?Io(e):Io.ceil(e),Ge(e.getFullYear()%1e4,t,4)}function nV(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ge(t/60|0,"0",2)+Ge(t%60,"0",2)}function Tk(e,t){return Ge(e.getUTCDate(),t,2)}function rV(e,t){return Ge(e.getUTCHours(),t,2)}function iV(e,t){return Ge(e.getUTCHours()%12||12,t,2)}function aV(e,t){return Ge(1+Tp.count(Ti(e),e),t,3)}function PO(e,t){return Ge(e.getUTCMilliseconds(),t,3)}function sV(e,t){return PO(e,t)+"000"}function oV(e,t){return Ge(e.getUTCMonth()+1,t,2)}function lV(e,t){return Ge(e.getUTCMinutes(),t,2)}function cV(e,t){return Ge(e.getUTCSeconds(),t,2)}function uV(e){var t=e.getUTCDay();return t===0?7:t}function dV(e,t){return Ge(Pp.count(Ti(e)-1,e),t,2)}function RO(e){var t=e.getUTCDay();return t>=4||t===0?$o(e):$o.ceil(e)}function fV(e,t){return e=RO(e),Ge($o.count(Ti(e),e)+(Ti(e).getUTCDay()===4),t,2)}function hV(e){return e.getUTCDay()}function pV(e,t){return Ge(ih.count(Ti(e)-1,e),t,2)}function mV(e,t){return Ge(e.getUTCFullYear()%100,t,2)}function gV(e,t){return e=RO(e),Ge(e.getUTCFullYear()%100,t,2)}function yV(e,t){return Ge(e.getUTCFullYear()%1e4,t,4)}function vV(e,t){var n=e.getUTCDay();return e=n>=4||n===0?$o(e):$o.ceil(e),Ge(e.getUTCFullYear()%1e4,t,4)}function bV(){return"+0000"}function Ok(){return"%"}function Pk(e){return+e}function Rk(e){return Math.floor(+e/1e3)}var Bs,MO,IO;xV({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 xV(e){return Bs=x7(e),MO=Bs.format,Bs.parse,IO=Bs.utcFormat,Bs.utcParse,Bs}function wV(e){return new Date(e)}function SV(e){return e instanceof Date?+e:+new Date(+e)}function d0(e,t,n,r,i,a,o,l,c,u){var d=Zx(),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"),w=u("%B"),k=u("%Y");function S(x){return(c(x)<x?p:l(x)<x?g:o(x)<x?m:a(x)<x?v:r(x)<x?i(x)<x?y:b:n(x)<x?w:k)(x)}return d.invert=function(x){return new Date(f(x))},d.domain=function(x){return arguments.length?h(Array.from(x,SV)):h().map(wV)},d.ticks=function(x){var E=h();return e(E[0],E[E.length-1],x??10)},d.tickFormat=function(x,E){return E==null?S:u(E)},d.nice=function(x){var E=h();return(!x||typeof x.range!="function")&&(x=t(E[0],E[E.length-1],x??10)),x?h(wO(E,x)):d},d.copy=function(){return Lu(d,d0(e,t,n,r,i,a,o,l,c,u))},d}function kV(){return Sr.apply(d0(v7,b7,Ci,c0,Op,Du,o0,a0,Ya,MO).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function NV(){return Sr.apply(d0(g7,y7,Ti,u0,Pp,Tp,l0,s0,Ya,IO).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Rp(){var e=0,t=1,n,r,i,a,o=jn,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(fl),u.rangeRound=d(Xx),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 Sa(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function $O(){var e=wa(Rp()(jn));return e.copy=function(){return Sa(e,$O())},Ii.apply(e,arguments)}function LO(){var e=e0(Rp()).domain([1,10]);return e.copy=function(){return Sa(e,LO()).base(e.base())},Ii.apply(e,arguments)}function DO(){var e=t0(Rp());return e.copy=function(){return Sa(e,DO()).constant(e.constant())},Ii.apply(e,arguments)}function f0(){var e=n0(Rp());return e.copy=function(){return Sa(e,f0()).exponent(e.exponent())},Ii.apply(e,arguments)}function EV(){return f0.apply(null,arguments).exponent(.5)}function BO(){var e=[],t=jn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Iu(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(ua),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)=>dK(e,a/r))},n.copy=function(){return BO(t).domain(e)},Ii.apply(n,arguments)}function Mp(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,u=jn,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,w;return arguments.length?([y,b,w]=v,u=LK(m,[y,b,w]),p):[u(0),u(.5),u(1)]}}return p.range=g(fl),p.rangeRound=g(Xx),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 zO(){var e=wa(Mp()(jn));return e.copy=function(){return Sa(e,zO())},Ii.apply(e,arguments)}function FO(){var e=e0(Mp()).domain([.1,1,10]);return e.copy=function(){return Sa(e,FO()).base(e.base())},Ii.apply(e,arguments)}function UO(){var e=t0(Mp());return e.copy=function(){return Sa(e,UO()).constant(e.constant())},Ii.apply(e,arguments)}function h0(){var e=n0(Mp());return e.copy=function(){return Sa(e,h0()).exponent(e.exponent())},Ii.apply(e,arguments)}function _V(){return h0.apply(null,arguments).exponent(.5)}const Mk=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Vc,scaleDiverging:zO,scaleDivergingLog:FO,scaleDivergingPow:h0,scaleDivergingSqrt:_V,scaleDivergingSymlog:UO,scaleIdentity:xO,scaleImplicit:yv,scaleLinear:th,scaleLog:SO,scaleOrdinal:Kx,scalePoint:pc,scalePow:r0,scaleQuantile:EO,scaleQuantize:_O,scaleRadial:NO,scaleSequential:$O,scaleSequentialLog:LO,scaleSequentialPow:f0,scaleSequentialQuantile:BO,scaleSequentialSqrt:EV,scaleSequentialSymlog:DO,scaleSqrt:s7,scaleSymlog:kO,scaleThreshold:jO,scaleTime:kV,scaleUtc:NV,tickFormat:bO},Symbol.toStringTag,{value:"Module"}));var jV=il;function AV(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&&!jV(o):n(o,l)))var l=o,c=a}return c}var WO=AV;function CV(e,t){return e>t}var TV=CV,OV=WO,PV=TV,RV=dl;function MV(e){return e&&e.length?OV(e,RV,PV):void 0}var IV=MV;const Ip=Ze(IV);function $V(e,t){return e<t}var LV=$V,DV=WO,BV=LV,zV=dl;function FV(e){return e&&e.length?DV(e,zV,BV):void 0}var UV=FV;const $p=Ze(UV);var WV=jx,HV=xa,GV=JT,qV=zn;function KV(e,t){var n=qV(e)?WV:GV;return n(e,HV(t))}var VV=KV,YV=ZT,XV=VV;function ZV(e,t){return YV(XV(e,t),1)}var QV=ZV;const JV=Ze(QV);var eY=Ux;function tY(e,t){return eY(e,t)}var nY=tY;const p0=Ze(nY);var hl=1e9,rY={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},g0,bt=!0,xr="[DecimalError] ",ns=xr+"Invalid argument: ",m0=xr+"Exponent out of range: ",pl=Math.floor,Ba=Math.pow,iY=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Qn,Kt=1e7,mt=7,HO=9007199254740991,ah=pl(HO/mt),ve={};ve.absoluteValue=ve.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ve.comparedTo=ve.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};ve.decimalPlaces=ve.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*mt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ve.dividedBy=ve.div=function(e){return ki(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.idiv=function(e){var t=this,n=t.constructor;return st(ki(t,new n(e),0,1),n.precision)};ve.equals=ve.eq=function(e){return!this.cmp(e)};ve.exponent=function(){return Mt(this)};ve.greaterThan=ve.gt=function(e){return this.cmp(e)>0};ve.greaterThanOrEqualTo=ve.gte=function(e){return this.cmp(e)>=0};ve.isInteger=ve.isint=function(){return this.e>this.d.length-2};ve.isNegative=ve.isneg=function(){return this.s<0};ve.isPositive=ve.ispos=function(){return this.s>0};ve.isZero=function(){return this.s===0};ve.lessThan=ve.lt=function(e){return this.cmp(e)<0};ve.lessThanOrEqualTo=ve.lte=function(e){return this.cmp(e)<1};ve.logarithm=ve.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(xr+"NaN");if(n.s<1)throw Error(xr+(n.s?"NaN":"-Infinity"));return n.eq(Qn)?new r(0):(bt=!1,t=ki(Jc(n,a),Jc(e,a),a),bt=!0,st(t,i))};ve.minus=ve.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?KO(t,e):GO(t,(e.s=-e.s,e))};ve.modulo=ve.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(xr+"NaN");return n.s?(bt=!1,t=ki(n,e,0,1).times(e),bt=!0,n.minus(t)):st(new r(n),i)};ve.naturalExponential=ve.exp=function(){return qO(this)};ve.naturalLogarithm=ve.ln=function(){return Jc(this)};ve.negated=ve.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ve.plus=ve.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?GO(t,e):KO(t,(e.s=-e.s,e))};ve.precision=ve.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ns+e);if(t=Mt(i)+1,r=i.d.length-1,n=r*mt+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};ve.squareRoot=ve.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(xr+"NaN")}for(e=Mt(l),bt=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Qr(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=pl((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(ki(l,a,o+2)).times(.5),Qr(a.d).slice(0,o)===(t=Qr(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(st(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return bt=!0,st(r,n)};ve.times=ve.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,bt?st(e,f.precision):e};ve.toDecimalPlaces=ve.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ri(e,0,hl),t===void 0?t=r.rounding:ri(t,0,8),st(n,e+Mt(n)+1,t))};ve.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=hs(r,!0):(ri(e,0,hl),t===void 0?t=i.rounding:ri(t,0,8),r=st(new i(r),e+1,t),n=hs(r,!0,e+1)),n};ve.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?hs(i):(ri(e,0,hl),t===void 0?t=a.rounding:ri(t,0,8),r=st(new a(i),e+Mt(i)+1,t),n=hs(r.abs(),!1,e+Mt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ve.toInteger=ve.toint=function(){var e=this,t=e.constructor;return st(new t(e),Mt(e)+1,t.rounding)};ve.toNumber=function(){return+this};ve.toPower=ve.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(xr+"Infinity");return l}if(l.eq(Qn))return l;if(r=c.precision,e.eq(Qn))return st(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=HO){for(i=new c(Qn),t=Math.ceil(r/mt+4),bt=!1;n%2&&(i=i.times(l),$k(i.d,t)),n=pl(n/2),n!==0;)l=l.times(l),$k(l.d,t);return bt=!0,e.s<0?new c(Qn).div(i):st(i,r)}}else if(a<0)throw Error(xr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,bt=!1,i=e.times(Jc(l,r+u)),bt=!0,i=qO(i),i.s=a,i};ve.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Mt(i),r=hs(i,n<=a.toExpNeg||n>=a.toExpPos)):(ri(e,1,hl),t===void 0?t=a.rounding:ri(t,0,8),i=st(new a(i),e,t),n=Mt(i),r=hs(i,e<=n||n<=a.toExpNeg,e)),r};ve.toSignificantDigits=ve.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ri(e,1,hl),t===void 0?t=r.rounding:ri(t,0,8)),st(new r(n),e,t)};ve.toString=ve.valueOf=ve.val=ve.toJSON=ve[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Mt(e),n=e.constructor;return hs(e,t<=n.toExpNeg||t>=n.toExpPos)};function GO(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)),bt?st(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/mt),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,bt?st(t,f):t}function ri(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ns+e)}function Qr(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=mt-r.length,n&&(a+=Hi(n)),a+=r;o=e[t],r=o+"",n=mt-r.length,n&&(a+=Hi(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ki=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,w,k,S,x,E,_,C=r.constructor,T=r.s==i.s?1:-1,L=r.d,M=i.d;if(!r.s)return new C(r);if(!i.s)throw Error(xr+"Division by zero");for(c=r.e-i.e,E=M.length,S=L.length,p=new C(T),g=p.d=[],u=0;M[u]==(L[u]||0);)++u;if(M[u]>(L[u]||0)&&--c,a==null?b=a=C.precision:o?b=a+(Mt(r)-Mt(i))+1:b=a,b<0)return new C(0);if(b=b/mt+2|0,u=0,E==1)for(d=0,M=M[0],b++;(u<S||d)&&b--;u++)w=d*Kt+(L[u]||0),g[u]=w/M|0,d=w%M|0;else{for(d=Kt/(M[0]+1)|0,d>1&&(M=e(M,d),L=e(L,d),E=M.length,S=L.length),k=E,m=L.slice(0,E),v=m.length;v<E;)m[v++]=0;_=M.slice(),_.unshift(0),x=M[0],M[1]>=Kt/2&&++x;do d=0,l=t(M,m,E,v),l<0?(y=m[0],E!=v&&(y=y*Kt+(m[1]||0)),d=y/x|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,E<h?_: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,E,v),l<1&&(d++,n(m,E<v?_:M,v))),v=m.length):l===0&&(d++,m=[0]),g[u++]=d,l&&m[0]?m[v++]=L[k]||0:(m=[L[k]],v=1);while((k++<S||m[0]!==void 0)&&b--)}return g[0]||g.shift(),p.e=c,st(p,o?a+Mt(p)+1:a)}}();function qO(e,t){var n,r,i,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Mt(e)>16)throw Error(m0+Mt(e));if(!e.s)return new d(Qn);for(bt=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Ba(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(Qn),d.precision=l;;){if(i=st(i.times(e),l),n=n.times(++c),o=a.plus(ki(i,n,l)),Qr(o.d).slice(0,l)===Qr(a.d).slice(0,l)){for(;u--;)a=st(a.times(a),l);return d.precision=f,t==null?(bt=!0,st(a,f)):a}a=o}}function Mt(e){for(var t=e.e*mt,n=e.d[0];n>=10;n/=10)t++;return t}function rg(e,t,n){if(t>e.LN10.sd())throw bt=!0,n&&(e.precision=n),Error(xr+"LN10 precision limit exceeded");return st(new e(e.LN10),t)}function Hi(e){for(var t="";e--;)t+="0";return t}function Jc(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(xr+(p.s?"NaN":"-Infinity"));if(p.eq(Qn))return new m(0);if(t==null?(bt=!1,u=v):u=t,p.eq(10))return t==null&&(bt=!0),rg(m,u);if(u+=h,m.precision=u,n=Qr(g),r=n.charAt(0),a=Mt(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=Qr(p.d),r=n.charAt(0),f++;a=Mt(p),r>1?(p=new m("0."+n),a++):p=new m(r+"."+n.slice(1))}else return c=rg(m,u+2,v).times(a+""),p=Jc(new m(r+"."+n.slice(1)),u-h).plus(c),m.precision=v,t==null?(bt=!0,st(p,v)):p;for(l=o=p=ki(p.minus(Qn),p.plus(Qn),u),d=st(p.times(p),u),i=3;;){if(o=st(o.times(d),u),c=l.plus(ki(o,new m(i),u)),Qr(c.d).slice(0,u)===Qr(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(rg(m,u+2,v).times(a+""))),l=ki(l,new m(f),u),m.precision=v,t==null?(bt=!0,st(l,v)):l;l=c,i+=2}}function Ik(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=pl(n/mt),e.d=[],r=(n+1)%mt,n<0&&(r+=mt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=mt;r<i;)e.d.push(+t.slice(r,r+=mt));t=t.slice(r),r=mt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),bt&&(e.e>ah||e.e<-ah))throw Error(m0+n)}else e.s=0,e.e=0,e.d=[0];return e}function st(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+=mt,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/mt),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=mt,i=r-mt+o}if(n!==void 0&&(a=Ba(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/Ba(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Mt(e),f.length=1,t=t-a-1,f[0]=Ba(10,(mt-t%mt)%mt),e.e=pl(-t/mt)||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=Ba(10,mt-r),f[d]=i>0?(u/Ba(10,o-i)%Ba(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(bt&&(e.e>ah||e.e<-ah))throw Error(m0+Mt(e));return e}function KO(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),bt?st(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/mt),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,bt?st(t,p):t):new h(0)}function hs(e,t,n){var r,i=Mt(e),a=Qr(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Hi(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Hi(-i-1)+a,n&&(r=n-o)>0&&(a+=Hi(r))):i>=o?(a+=Hi(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Hi(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Hi(r))),e.s<0?"-"+a:a}function $k(e,t){if(e.length>t)return e.length=t,!0}function VO(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(ns+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 Ik(o,a.toString())}else if(typeof a!="string")throw Error(ns+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,iY.test(a))Ik(o,a);else throw Error(ns+a)}if(i.prototype=ve,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=VO,i.config=i.set=aY,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 aY(e){if(!e||typeof e!="object")throw Error(xr+"Object expected");var t,n,r,i=["precision",1,hl,"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(pl(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ns+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ns+n+": "+r);return this}var g0=VO(rY);Qn=new g0(1);const rt=g0;function sY(e){return uY(e)||cY(e)||lY(e)||oY()}function oY(){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 lY(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 cY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function uY(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 dY=function(t){return t},YO={},XO=function(t){return t===YO},Lk=function(t){return function n(){return arguments.length===0||arguments.length===1&&XO(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},fY=function e(t,n){return t===1?n:Lk(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!==YO}).length;return o>=t?n.apply(void 0,i):e(t-o,Lk(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 XO(f)?c.shift():f});return n.apply(void 0,sY(d).concat(c))}))})},Lp=function(t){return fY(t.length,t)},Sv=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},hY=Lp(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),pY=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return dY;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))}},kv=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},ZO=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 mY(e){var t;return e===0?t=1:t=Math.floor(new rt(e).abs().log(10).toNumber())+1,t}function gY(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 yY=Lp(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),vY=Lp(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),bY=Lp(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Dp={rangeStep:gY,getDigitCount:mY,interpolateNumber:yY,uninterpolateNumber:vY,uninterpolateTruncation:bY};function Nv(e){return SY(e)||wY(e)||QO(e)||xY()}function xY(){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 wY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function SY(e){if(Array.isArray(e))return Ev(e)}function eu(e,t){return EY(e)||NY(e,t)||QO(e,t)||kY()}function kY(){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 QO(e,t){if(e){if(typeof e=="string")return Ev(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 Ev(e,t)}}function Ev(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 NY(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 EY(e){if(Array.isArray(e))return e}function JO(e){var t=eu(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function eP(e,t,n){if(e.lte(0))return new rt(0);var r=Dp.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 _Y(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(Dp.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=pY(hY(function(c){return i.add(new rt(c-o).mul(r)).toNumber()}),Sv);return l(0,t)}function tP(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=eP(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?tP(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 jY(e){var t=eu(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=JO([n,r]),c=eu(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Nv(Sv(0,i-1).map(function(){return 1/0}))):[].concat(Nv(Sv(0,i-1).map(function(){return-1/0})),[d]);return n>r?kv(f):f}if(u===d)return _Y(u,i,a);var h=tP(u,d,o,a),p=h.step,g=h.tickMin,m=h.tickMax,v=Dp.rangeStep(g,m.add(new rt(.1).mul(p)),p);return n>r?kv(v):v}function AY(e,t){var n=eu(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=JO([r,i]),l=eu(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=eP(new rt(u).sub(c).div(d-1),a,0),h=[].concat(Nv(Dp.rangeStep(new rt(c),new rt(u).sub(new rt(.99).mul(f)),f)),[u]);return r>i?kv(h):h}var CY=ZO(jY),TY=ZO(AY),OY="Invariant failed";function ps(e,t){throw new Error(OY)}var PY=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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 sh(){return sh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sh.apply(this,arguments)}function RY(e,t){return LY(e)||$Y(e,t)||IY(e,t)||MY()}function MY(){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 IY(e,t){if(e){if(typeof e=="string")return Dk(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 Dk(e,t)}}function Dk(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 $Y(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 LY(e){if(Array.isArray(e))return e}function DY(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 zY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FY(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,iP(r.key),r)}}function UY(e,t,n){return t&&FY(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function WY(e,t,n){return t=oh(t),HY(e,nP()?Reflect.construct(t,n||[],oh(e).constructor):t.apply(e,n))}function HY(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 GY(e)}function GY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nP=function(){return!!e})()}function oh(e){return oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},oh(e)}function qY(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&&_v(e,t)}function _v(e,t){return _v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},_v(e,t)}function rP(e,t,n){return t=iP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iP(e){var t=KY(e,"string");return Lo(t)=="symbol"?t:t+""}function KY(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 Bp=function(e){function t(){return zY(this,t),WY(this,t,arguments)}return qY(t,e),UY(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=DY(r,PY),p=Ke(h,!1);this.props.direction==="x"&&d.type!=="number"&&ps();var g=c.map(function(m){var v=u(m,l),y=v.x,b=v.y,w=v.value,k=v.errorVal;if(!k)return null;var S=[],x,E;if(Array.isArray(k)){var _=RY(k,2);x=_[0],E=_[1]}else x=E=k;if(a==="vertical"){var C=d.scale,T=b+i,L=T+o,M=T-o,B=C(w-x),I=C(w+E);S.push({x1:I,y1:L,x2:I,y2:M}),S.push({x1:B,y1:T,x2:I,y2:T}),S.push({x1:B,y1:L,x2:B,y2:M})}else if(a==="horizontal"){var F=f.scale,z=y+i,R=z-o,O=z+o,U=F(w-x),A=F(w+E);S.push({x1:R,y1:A,x2:O,y2:A}),S.push({x1:z,y1:U,x2:z,y2:A}),S.push({x1:R,y1:U,x2:O,y2:U})}return H.createElement(Yt,sh({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",sh({},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);rP(Bp,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});rP(Bp,"displayName","ErrorBar");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 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 Oa(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){VY(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 VY(e,t,n){return t=YY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YY(e){var t=XY(e,"string");return tu(t)=="symbol"?t:t+""}function XY(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 aP=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,o=Zn(n,es);if(!o)return null;var l=es.defaultProps,c=l!==void 0?Oa(Oa({},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?Oa(Oa({},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:y0(f),value:m||g,payload:p}}),Oa(Oa(Oa({},c),es.getWithHeight(o,i)),{},{payload:u,item:o})};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 zk(e){return eX(e)||JY(e)||QY(e)||ZY()}function ZY(){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 QY(e,t){if(e){if(typeof e=="string")return jv(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 jv(e,t)}}function JY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eX(e){if(Array.isArray(e))return jv(e)}function jv(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 Fk(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 jt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fk(Object(n),!0).forEach(function(r){bo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bo(e,t,n){return t=tX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tX(e){var t=nX(e,"string");return nu(t)=="symbol"?t:t+""}function nX(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 ii(e,t,n){return Ye(e)||Ye(t)?n:Ht(t)?yr(e,t,n):Le(t)?t(e):n}function mc(e,t,n,r){var i=JV(e,function(l){return ii(l,t)});if(n==="number"){var a=i.filter(function(l){return de(l)||parseFloat(l)});return a.length?[$p(a),Ip(a)]:[1/0,-1/0]}var o=r?i.filter(function(l){return!Ye(l)}):i;return o.map(function(l){return Ht(l)||l instanceof Date?l:""})}var rX=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(Pr(f-d)!==Pr(h-f)){var g=[];if(Pr(h-f)===Pr(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),w=Math.max(d,h);if(t>(b+f)/2&&t<=(w+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},y0=function(t){var n,r=t,i=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?jt(jt({},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},iX=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(E){return wi(E.type).indexOf("Bar")>=0});if(y&&y.length){var b=y[0].type.defaultProps,w=b!==void 0?jt(jt({},b),y[0].props):y[0].props,k=w.barSize,S=w[v];o[S]||(o[S]=[]);var x=Ye(k)?n:k;o[S].push({item:y[0],stackList:y.slice(1),barSize:Ye(x)?void 0:fs(x,r,0)})}}return o},aX=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=fs(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 x={item:S.item,position:{offset:v.offset+v.size+u,size:h?p:S.barSize}},E=[].concat(zk(k),[x]);return v=E[E.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(_){E.push({item:_,position:v})}),E},f)}else{var y=fs(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 w=l===+l?Math.min(b,l):b;d=o.reduce(function(k,S,x){var E=[].concat(zk(k),[{item:S.item,position:{offset:y+(b+u)*x+(b-w)/2,size:w}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(_){E.push({item:_,position:E[E.length-1].position})}),E},f)}return d},sX=function(t,n,r,i){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=aP({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"&&de(t[p]))return jt(jt({},t),{},bo({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&de(t[g]))return jt(jt({},t),{},bo({},g,t[g]+(h||0)))}return t},oX=function(t,n,r){return Ye(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},sP=function(t,n,r,i,a){var o=n.props.children,l=Ir(o,Bp).filter(function(u){return oX(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=ii(d,r);if(Ye(f))return u;var h=Array.isArray(f)?[$p(f),Ip(f)]:[f,f],p=c.reduce(function(g,m){var v=ii(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},lX=function(t,n,r,i,a){var o=n.map(function(l){return sP(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},oP=function(t,n,r,i,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&sP(t,c,u,i)||mc(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},[])},lP=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},cP=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},bi=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?Pr(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!Pu(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}})},ig=new WeakMap,Nd=function(t,n){if(typeof n!="function")return t;ig.has(t)||ig.set(t,new WeakMap);var r=ig.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},cX=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:Vc(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:th(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:pc(),realScaleType:"point"}:a==="category"?{scale:Vc(),realScaleType:"band"}:{scale:th(),realScaleType:"linear"};if(ds(i)){var c="scale".concat(Sp(i));return{scale:(Mk[c]||pc)(),realScaleType:Mk[c]?c:"point"}}return Le(i)?{scale:i}:{scale:pc(),realScaleType:"point"}},Uk=1e-4,uX=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])-Uk,o=Math.max(i[0],i[1])+Uk,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},dX=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},fX=function(t,n){if(!n||n.length!==2||!de(n[0])||!de(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(!de(t[0])||t[0]<r)&&(a[0]=r),(!de(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},hX=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=Pu(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])}},pX=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=Pu(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)}},mX={sign:hX,expand:T6,none:Co,silhouette:O6,wiggle:P6,positive:pX},gX=function(t,n,r){var i=n.map(function(l){return l.props.dataKey}),a=mX[r],o=C6().keys(i).value(function(l,c){return+ii(l,c,0)}).order(Qy).offset(a);return o(t)},yX=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?jt(jt({},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(Ht(m)){var w=b.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};w.items.push(h),b.hasStack=!0,b.stackGroups[m]=w}else b.stackGroups[wp("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return jt(jt({},f),{},bo({},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 jt(jt({},m),{},bo({},v,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:gX(t,y.items,a)}))},g)}return jt(jt({},f),{},bo({},h,p))},d)},vX=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([$p(d),Ip(d)]),{niceTicks:d}}if(a&&i==="number"){var f=t.domain(),h=TY(f,a,l);return{niceTicks:h}}return null},Wk=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=ii(o,n.dataKey,n.domain[l]);return Ye(c)?null:n.scale(c)-a/2+i},bX=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]},xX=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?jt(jt({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Ht(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},wX=function(t){return t.reduce(function(n,r){return[$p(r.concat([n[0]]).filter(de)),Ip(r.concat([n[1]]).filter(de))]},[1/0,-1/0])},uP=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=wX(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})},Hk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Gk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Av=function(t,n,r){if(Le(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(de(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(Hk.test(t[0])){var a=+Hk.exec(t[0])[1];i[0]=n[0]-a}else Le(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(de(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(Gk.test(t[1])){var o=+Gk.exec(t[1])[1];i[1]=n[1]+o}else Le(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},lh=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=Hx(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},qk=function(t,n,r){return!t||!t.length||p0(t,yr(r,"type.defaultProps.domain"))?n:t},dP=function(t,n){var r=t.type.defaultProps?jt(jt({},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 jt(jt({},Ke(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:a||i,color:y0(t),value:ii(n,i),type:c,payload:n,chartType:u,hide:d})};function ru(e){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(e)}function Kk(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 Vk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kk(Object(n),!0).forEach(function(r){SX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SX(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=NX(e,"string");return ru(t)=="symbol"?t:t+""}function NX(e,t){if(ru(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ru(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ch=Math.PI/180,EX=function(t){return t*180/Math.PI},an=function(t,n,r,i){return{x:t+Math.cos(-ch*i)*r,y:n+Math.sin(-ch*i)*r}},_X=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))},jX=function(t,n){var r=t.x,i=t.y,a=n.cx,o=n.cy,l=_X({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:EX(u),angleInRadian:u}},AX=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},Yk=function(t,n){var r=t.x,i=t.y,a=jX({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=AX(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?Vk(Vk({},n),{},{radius:o,angle:CX(p,n)}):null};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)}var TX=["offset"];function OX(e){return IX(e)||MX(e)||RX(e)||PX()}function PX(){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 RX(e,t){if(e){if(typeof e=="string")return Cv(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 Cv(e,t)}}function MX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IX(e){if(Array.isArray(e))return Cv(e)}function Cv(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 $X(e,t){if(e==null)return{};var n=LX(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 LX(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 Xk(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 Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xk(Object(n),!0).forEach(function(r){DX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DX(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=zX(e,"string");return iu(t)=="symbol"?t:t+""}function zX(e,t){if(iu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(iu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function au(){return au=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},au.apply(this,arguments)}var FX=function(t){var n=t.value,r=t.formatter,i=Ye(t.children)?n:t.children;return Le(r)?r(i):i},UX=function(t,n){var r=Pr(n-t),i=Math.min(Math.abs(n-t),360);return r*i},WX=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=UX(p,g),b=y>=0?1:-1,w,k;i==="insideStart"?(w=p+b*o,k=m):i==="insideEnd"?(w=g-b*o,k=!m):i==="end"&&(w=g+b*o,k=m),k=y<=0?k:!k;var S=an(u,d,v,w),x=an(u,d,v,w+(k?1:-1)*359),E="M".concat(S.x,",").concat(S.y,`
|
|
93
|
-
A`).concat(v,",").concat(v,",0,1,").concat(k?0:1,`,
|
|
94
|
-
`).concat(x.x,",").concat(x.y),_=Ye(t.id)?wp("recharts-radial-line-"):t.id;return H.createElement("text",au({},r,{dominantBaseline:"central",className:Ve("recharts-radial-bar-label",l)}),H.createElement("defs",null,H.createElement("path",{id:_,d:E})),H.createElement("textPath",{xlinkHref:"#".concat(_)},n))},HX=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=an(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=an(o,l,v,h),b=y.x,w=y.y;return{x:b,y:w,textAnchor:"middle",verticalAnchor:"middle"}},GX=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 w={x:l+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:p};return Ft(Ft({},w),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 Ft(Ft({},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 Ft(Ft({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(a==="right"){var x={x:l+u+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Ft(Ft({},x),r?{width:Math.max(r.x+r.width-x.x,0),height:d}:{})}var E=r?{width:u,height:d}:{};return a==="insideLeft"?Ft({x:l+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},E):a==="insideRight"?Ft({x:l+u-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},E):a==="insideTop"?Ft({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},E):a==="insideBottom"?Ft({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},E):a==="insideTopLeft"?Ft({x:l+v,y:c+h,textAnchor:b,verticalAnchor:g},E):a==="insideTopRight"?Ft({x:l+u-v,y:c+h,textAnchor:y,verticalAnchor:g},E):a==="insideBottomLeft"?Ft({x:l+v,y:c+d-h,textAnchor:b,verticalAnchor:p},E):a==="insideBottomRight"?Ft({x:l+u-v,y:c+d-h,textAnchor:y,verticalAnchor:p},E):al(a)&&(de(a.x)||Ka(a.x))&&(de(a.y)||Ka(a.y))?Ft({x:l+fs(a.x,u),y:c+fs(a.y,d),textAnchor:"end",verticalAnchor:"end"},E):Ft({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},E)},qX=function(t){return"cx"in t&&de(t.cx)};function gn(e){var t=e.offset,n=t===void 0?5:t,r=$X(e,TX),i=Ft({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)&&!N.isValidElement(u)&&!Le(u))return null;if(N.isValidElement(u))return N.cloneElement(u,i);var p;if(Le(u)){if(p=N.createElement(u,i),N.isValidElement(p))return p}else p=FX(i);var g=qX(a),m=Ke(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return WX(i,p,m);var v=g?HX(i):GX(i);return H.createElement(Kf,au({className:Ve("recharts-label",f)},m,v,{breakAll:h}),p)}gn.displayName="Label";var fP=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(de(m)&&de(v)){if(de(f)&&de(h))return{x:f,y:h,width:m,height:v};if(de(p)&&de(g))return{x:p,y:g,width:m,height:v}}return de(f)&&de(h)?{x:f,y:h,width:0,height:0}:de(n)&&de(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:{}},KX=function(t,n){return t?t===!0?H.createElement(gn,{key:"label-implicit",viewBox:n}):Ht(t)?H.createElement(gn,{key:"label-implicit",viewBox:n,value:t}):N.isValidElement(t)?t.type===gn?N.cloneElement(t,{key:"label-implicit",viewBox:n}):H.createElement(gn,{key:"label-implicit",content:t,viewBox:n}):Le(t)?H.createElement(gn,{key:"label-implicit",content:t,viewBox:n}):al(t)?H.createElement(gn,au({viewBox:n},t,{key:"label-implicit"})):null:null},VX=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=fP(t),o=Ir(i,gn).map(function(c,u){return N.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=KX(t.label,n||a);return[l].concat(OX(o))};gn.parseViewBox=fP;gn.renderCallByParent=VX;function YX(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var XX=YX;const ZX=Ze(XX);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)}var QX=["valueAccessor"],JX=["data","dataKey","clockWise","id","textBreakAll"];function eZ(e){return iZ(e)||rZ(e)||nZ(e)||tZ()}function tZ(){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 nZ(e,t){if(e){if(typeof e=="string")return Tv(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 Tv(e,t)}}function rZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iZ(e){if(Array.isArray(e))return Tv(e)}function Tv(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(){return uh=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},uh.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 Qk(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){aZ(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 aZ(e,t,n){return t=sZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sZ(e){var t=oZ(e,"string");return su(t)=="symbol"?t:t+""}function oZ(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)}function Jk(e,t){if(e==null)return{};var n=lZ(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 lZ(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 cZ=function(t){return Array.isArray(t.value)?ZX(t.value):t.value};function rs(e){var t=e.valueAccessor,n=t===void 0?cZ:t,r=Jk(e,QX),i=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=Jk(r,JX);return!i||!i.length?null:H.createElement(Yt,{className:"recharts-label-list"},i.map(function(d,f){var h=Ye(a)?n(d,f):ii(d&&d.payload,a),p=Ye(l)?{}:{id:"".concat(l,"-").concat(f)};return H.createElement(gn,uh({},Ke(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:gn.parseViewBox(Ye(o)?d:Qk(Qk({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}rs.displayName="LabelList";function uZ(e,t){return e?e===!0?H.createElement(rs,{key:"labelList-implicit",data:t}):H.isValidElement(e)||Le(e)?H.createElement(rs,{key:"labelList-implicit",data:t,content:e}):al(e)?H.createElement(rs,uh({data:t},e,{key:"labelList-implicit"})):null:null}function dZ(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=Ir(r,rs).map(function(o,l){return N.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return i;var a=uZ(e.label,t);return[a].concat(eZ(i))}rs.renderCallByParent=dZ;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 Ov(){return Ov=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},Ov.apply(this,arguments)}function eN(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?eN(Object(n),!0).forEach(function(r){fZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fZ(e,t,n){return t=hZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hZ(e){var t=pZ(e,"string");return ou(t)=="symbol"?t:t+""}function pZ(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)}var mZ=function(t,n){var r=Pr(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},Ed=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)/ch,h=u?a:a+o*f,p=an(n,r,d,h),g=an(n,r,i,h),m=u?a-o*f:a,v=an(n,r,d*Math.cos(f*ch),m);return{center:p,circleTangency:g,lineTangency:v,theta:f}},hP=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=mZ(o,l),u=o+c,d=an(n,r,a,o),f=an(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=an(n,r,i,o),g=an(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},gZ=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=Pr(d-u),h=Ed({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,m=h.theta,v=Ed({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),y=v.circleTangency,b=v.lineTangency,w=v.theta,k=c?Math.abs(u-d):Math.abs(u-d)-m-w;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
|
-
`):hP({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 x=Ed({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=x.circleTangency,_=x.lineTangency,C=x.theta,T=Ed({cx:n,cy:r,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),L=T.circleTangency,M=T.lineTangency,B=T.theta,I=c?Math.abs(u-d):Math.abs(u-d)-C-B;if(I<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(L.x,",").concat(L.y,`
|
|
111
|
-
A`).concat(i,",").concat(i,",0,").concat(+(I>180),",").concat(+(f>0),",").concat(E.x,",").concat(E.y,`
|
|
112
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},yZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pP=function(t){var n=tN(tN({},yZ),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=fs(l,g,0,!0),v;return m>0&&Math.abs(d-f)<360?v=gZ({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):v=hP({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),H.createElement("path",Ov({},Ke(n,!0),{className:p,d:v,role:"img"}))};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 Pv(){return Pv=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},Pv.apply(this,arguments)}function nN(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 rN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nN(Object(n),!0).forEach(function(r){vZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vZ(e,t,n){return t=bZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bZ(e){var t=xZ(e,"string");return lu(t)=="symbol"?t:t+""}function xZ(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(t==="string"?String:Number)(e)}var iN={curveBasisClosed:v6,curveBasisOpen:b6,curveBasis:y6,curveBumpX:r6,curveBumpY:i6,curveLinearClosed:x6,curveLinear:Np,curveMonotoneX:w6,curveMonotoneY:S6,curveNatural:k6,curveStep:N6,curveStepAfter:_6,curveStepBefore:E6},_d=function(t){return t.x===+t.x&&t.y===+t.y},Wl=function(t){return t.x},Hl=function(t){return t.y},wZ=function(t,n){if(Le(t))return t;var r="curve".concat(Sp(t));return(r==="curveMonotone"||r==="curveBump")&&n?iN["".concat(r).concat(n==="vertical"?"Y":"X")]:iN[r]||Np},SZ=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=wZ(r,l),f=u?a.filter(function(m){return _d(m)}):a,h;if(Array.isArray(o)){var p=u?o.filter(function(m){return _d(m)}):o,g=f.map(function(m,v){return rN(rN({},m),{},{base:p[v]})});return l==="vertical"?h=gd().y(Hl).x1(Wl).x0(function(m){return m.base.x}):h=gd().x(Wl).y1(Hl).y0(function(m){return m.base.y}),h.defined(_d).curve(d),h(g)}return l==="vertical"&&de(o)?h=gd().y(Hl).x1(Wl).x0(o):de(o)?h=gd().x(Wl).y1(Hl).y0(o):h=gT().x(Wl).y(Hl),h.defined(_d).curve(d),h(f)},aN=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?SZ(t):i;return N.createElement("path",Pv({},Ke(t,!1),Pf(t),{className:Ve("recharts-curve",n),d:o,ref:a}))},mP={exports:{}},kZ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",NZ=kZ,EZ=NZ;function gP(){}function yP(){}yP.resetWarningCache=gP;var _Z=function(){function e(r,i,a,o,l,c){if(c!==EZ){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:yP,resetWarningCache:gP};return n.PropTypes=n,n};mP.exports=_Z();var jZ=mP.exports;const Xe=Ze(jZ),{getOwnPropertyNames:AZ,getOwnPropertySymbols:CZ}=Object,{hasOwnProperty:TZ}=Object.prototype;function ag(e,t){return function(r,i,a){return e(r,i,a)&&t(r,i,a)}}function jd(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 OZ(e){return e!=null?e[Symbol.toStringTag]:void 0}function sN(e){return AZ(e).concat(CZ(e))}const PZ=Object.hasOwn||((e,t)=>TZ.call(e,t));function Ss(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const RZ="__v",MZ="__o",IZ="_owner",{getOwnPropertyDescriptor:oN,keys:lN}=Object;function $Z(e,t){return e.byteLength===t.byteLength&&dh(new Uint8Array(e),new Uint8Array(t))}function LZ(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 DZ(e,t){return e.byteLength===t.byteLength&&dh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function BZ(e,t){return Ss(e.getTime(),t.getTime())}function zZ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function FZ(e,t){return e===t}function cN(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 UZ=Ss;function WZ(e,t,n){const r=lN(e);let i=r.length;if(lN(t).length!==i)return!1;for(;i-- >0;)if(!vP(e,t,n,r[i]))return!1;return!0}function Gl(e,t,n){const r=sN(e);let i=r.length;if(sN(t).length!==i)return!1;let a,o,l;for(;i-- >0;)if(a=r[i],!vP(e,t,n,a)||(o=oN(e,a),l=oN(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function HZ(e,t){return Ss(e.valueOf(),t.valueOf())}function GZ(e,t){return e.source===t.source&&e.flags===t.flags}function uN(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 dh(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 qZ(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 vP(e,t,n,r){return(r===IZ||r===MZ||r===RZ)&&(e.$$typeof||t.$$typeof)?!0:PZ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const KZ="[object ArrayBuffer]",VZ="[object Arguments]",YZ="[object Boolean]",XZ="[object DataView]",ZZ="[object Date]",QZ="[object Error]",JZ="[object Map]",eQ="[object Number]",tQ="[object Object]",nQ="[object RegExp]",rQ="[object Set]",iQ="[object String]",aQ={"[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},sQ="[object URL]",oQ=Object.prototype.toString;function lQ({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 w=typeof v;if(w!==typeof y)return!1;if(w!=="object")return w==="number"?l(v,y,b):w==="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=oQ.call(v);if(S===ZZ)return r(v,y,b);if(S===nQ)return d(v,y,b);if(S===JZ)return o(v,y,b);if(S===rQ)return f(v,y,b);if(S===tQ)return typeof v.then!="function"&&typeof y.then!="function"&&c(v,y,b);if(S===sQ)return p(v,y,b);if(S===QZ)return i(v,y,b);if(S===VZ)return c(v,y,b);if(aQ[S])return h(v,y,b);if(S===KZ)return e(v,y,b);if(S===XZ)return n(v,y,b);if(S===YZ||S===eQ||S===iQ)return u(v,y,b);if(g){let x=g[S];if(!x){const E=OZ(v);E&&(x=g[E])}if(x)return x(v,y,b)}return!1}}function cQ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:$Z,areArraysEqual:n?Gl:LZ,areDataViewsEqual:DZ,areDatesEqual:BZ,areErrorsEqual:zZ,areFunctionsEqual:FZ,areMapsEqual:n?ag(cN,Gl):cN,areNumbersEqual:UZ,areObjectsEqual:n?Gl:WZ,arePrimitiveWrappersEqual:HZ,areRegExpsEqual:GZ,areSetsEqual:n?ag(uN,Gl):uN,areTypedArraysEqual:n?ag(dh,Gl):dh,areUrlsEqual:qZ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=jd(r.areArraysEqual),a=jd(r.areMapsEqual),o=jd(r.areObjectsEqual),l=jd(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:l})}return r}function uQ(e){return function(t,n,r,i,a,o,l){return e(t,n,l)}}function dQ({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 fQ=ka();ka({strict:!0});ka({circular:!0});ka({circular:!0,strict:!0});ka({createInternalComparator:()=>Ss});ka({strict:!0,createInternalComparator:()=>Ss});ka({circular:!0,createInternalComparator:()=>Ss});ka({circular:!0,createInternalComparator:()=>Ss,strict:!0});function ka(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=cQ(e),o=lQ(a),l=n?n(o):uQ(o);return dQ({circular:t,comparator:o,createState:r,equals:l,strict:i})}function hQ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function dN(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):hQ(i)};requestAnimationFrame(r)}function Rv(e){"@babel/helpers - typeof";return Rv=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},Rv(e)}function pQ(e){return vQ(e)||yQ(e)||gQ(e)||mQ()}function mQ(){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 gQ(e,t){if(e){if(typeof e=="string")return fN(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 fN(e,t)}}function fN(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 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 e}function bQ(){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=pQ(o),c=l[0],u=l.slice(1);if(typeof c=="number"){dN(i.bind(null,u),c);return}i(c),dN(i.bind(null,u));return}Rv(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 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 hN(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 pN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hN(Object(n),!0).forEach(function(r){bP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bP(e,t,n){return t=xQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xQ(e){var t=wQ(e,"string");return cu(t)==="symbol"?t:String(t)}function wQ(e,t){if(cu(e)!=="object"||e===null)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)}var SQ=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},kQ=function(t){return t},NQ=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},gc=function(t,n){return Object.keys(n).reduce(function(r,i){return pN(pN({},r),{},bP({},i,t(i,n[i])))},{})},mN=function(t,n,r){return t.map(function(i){return"".concat(NQ(i)," ").concat(n,"ms ").concat(r)}).join(",")};function EQ(e,t){return AQ(e)||jQ(e,t)||xP(e,t)||_Q()}function _Q(){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 jQ(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 AQ(e){if(Array.isArray(e))return e}function CQ(e){return PQ(e)||OQ(e)||xP(e)||TQ()}function TQ(){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 xP(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 OQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PQ(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}var fh=1e-4,wP=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})},gN=function(t,n){return function(r){var i=wP(t,n);return SP(i,r)}},RQ=function(t,n){return function(r){var i=wP(t,n),a=[].concat(CQ(i.map(function(o,l){return o*l}).slice(1)),[0]);return SP(a,r)}},yN=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=EQ(u,4);i=d[0],a=d[1],o=d[2],l=d[3]}}}var f=gN(i,o),h=gN(a,l),p=RQ(i,o),g=function(y){return y>1?1:y<0?0:y},m=function(y){for(var b=y>1?1:y,w=b,k=0;k<8;++k){var S=f(w)-b,x=p(w);if(Math.abs(S-b)<fh||x<fh)return h(w);w=g(w-S/x)}return h(w)};return m.isStepper=!1,m},MQ=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)<fh&&Math.abs(m)<fh?[f,0]:[v,m]};return c.isStepper=!0,c.dt=l,c},IQ=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 yN(i);case"spring":return MQ();default:if(i.split("(")[0]==="cubic-bezier")return yN(i)}return typeof i=="function"?i:null};function uu(e){"@babel/helpers - typeof";return uu=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},uu(e)}function vN(e){return DQ(e)||LQ(e)||kP(e)||$Q()}function $Q(){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 LQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function DQ(e){if(Array.isArray(e))return $v(e)}function bN(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 nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bN(Object(n),!0).forEach(function(r){Iv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iv(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=zQ(e,"string");return uu(t)==="symbol"?t:String(t)}function zQ(e,t){if(uu(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FQ(e,t){return HQ(e)||WQ(e,t)||kP(e,t)||UQ()}function UQ(){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 kP(e,t){if(e){if(typeof e=="string")return $v(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 $v(e,t)}}function $v(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 WQ(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 HQ(e){if(Array.isArray(e))return e}var hh=function(t,n,r){return t+(n-t)*r},Lv=function(t){var n=t.from,r=t.to;return n!==r},GQ=function e(t,n,r){var i=gc(function(a,o){if(Lv(o)){var l=t(o.from,o.to,o.velocity),c=FQ(l,2),u=c[0],d=c[1];return nn(nn({},o),{},{from:u,velocity:d})}return o},n);return r<1?gc(function(a,o){return Lv(o)?nn(nn({},o),{},{velocity:hh(o.velocity,i[a].velocity,r),from:hh(o.from,i[a].from,r)}):o},n):e(t,i,r-1)};const qQ=function(e,t,n,r,i){var a=SQ(e,t),o=a.reduce(function(v,y){return nn(nn({},v),{},Iv({},y,[e[y],t[y]]))},{}),l=a.reduce(function(v,y){return nn(nn({},v),{},Iv({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return gc(function(y,b){return b.from},l)},p=function(){return!Object.values(l).filter(Lv).length},g=function(y){u||(u=y);var b=y-u,w=b/n.dt;l=GQ(n,l,w),i(nn(nn(nn({},e),t),h())),u=y,p()||(c=requestAnimationFrame(f))},m=function(y){d||(d=y);var b=(y-d)/r,w=gc(function(S,x){return hh.apply(void 0,vN(x).concat([n(b)]))},o);if(i(nn(nn(nn({},e),t),w)),b<1)c=requestAnimationFrame(f);else{var k=gc(function(S,x){return hh.apply(void 0,vN(x).concat([n(1)]))},o);i(nn(nn(nn({},e),t),k))}};return f=n.isStepper?g:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};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)}var KQ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function VQ(e,t){if(e==null)return{};var n=YQ(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 YQ(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 sg(e){return JQ(e)||QQ(e)||ZQ(e)||XQ()}function XQ(){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 ZQ(e,t){if(e){if(typeof e=="string")return Dv(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 Dv(e,t)}}function QQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JQ(e){if(Array.isArray(e))return Dv(e)}function Dv(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 xN(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 _r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xN(Object(n),!0).forEach(function(r){nc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nc(e,t,n){return t=NP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tJ(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,NP(r.key),r)}}function nJ(e,t,n){return t&&tJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function NP(e){var t=rJ(e,"string");return Do(t)==="symbol"?t:String(t)}function rJ(e,t){if(Do(e)!=="object"||e===null)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(t==="string"?String:Number)(e)}function iJ(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 aJ(e){var t=sJ();return function(){var r=ph(e),i;if(t){var a=ph(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return zv(this,i)}}function zv(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 Fv(e)}function Fv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sJ(){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 ph(e){return ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ph(e)}var pa=function(e){iJ(n,e);var t=aJ(n);function n(r,i){var a;eJ(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(Fv(a)),a.changeStyle=a.changeStyle.bind(Fv(a)),!l||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),zv(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},zv(a);a.state={style:c?nc({},c,u):u}}else a.state={style:{}};return a}return nJ(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?nc({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(fQ(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?nc({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(v)}this.runAnimation(_r(_r({},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=qQ(o,l,IQ(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,w=v.easing,k=w===void 0?"ease":w,S=v.style,x=v.properties,E=v.onAnimationEnd,_=y>0?o[y-1]:v,C=x||Object.keys(S);if(typeof k=="function"||k==="spring")return[].concat(sg(m),[a.runJSAnimation.bind(a,{from:_.style,to:S,duration:b,easing:k}),b]);var T=mN(C,b,k),L=_r(_r(_r({},_.style),S),{},{transition:T});return[].concat(sg(m),[L,b,E]).filter(kQ)};return this.manager.start([c].concat(sg(o.reduce(p,[d,Math.max(h,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=bQ());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?nc({},l,c):c,v=mN(Object.keys(m),o,u);g.start([d,a,_r(_r({},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=VQ(i,KQ),u=N.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=N.cloneElement(p,_r(_r({},c),{},{style:_r(_r({},v),d),className:y}));return b};return u===1?f(N.Children.only(a)):H.createElement("div",null,N.Children.map(a,function(h){return f(h)}))}}]),n}(N.PureComponent);pa.displayName="Animate";pa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};pa.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 du(e){"@babel/helpers - typeof";return du=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},du(e)}function mh(){return mh=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},mh.apply(this,arguments)}function oJ(e,t){return dJ(e)||uJ(e,t)||cJ(e,t)||lJ()}function lJ(){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 cJ(e,t){if(e){if(typeof e=="string")return wN(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 wN(e,t)}}function wN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uJ(e,t){var n=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 dJ(e){if(Array.isArray(e))return e}function SN(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 kN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SN(Object(n),!0).forEach(function(r){fJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fJ(e,t,n){return t=hJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hJ(e){var t=pJ(e,"string");return du(t)=="symbol"?t:t+""}function pJ(e,t){if(du(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(du(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NN=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},mJ=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},gJ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},v0=function(t){var n=kN(kN({},gJ),t),r=N.useRef(),i=N.useState(-1),a=oJ(i,2),o=a[0],l=a[1];N.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 w=Ve("recharts-rectangle",p);return b?H.createElement(pa,{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,x=k.height,E=k.x,_=k.y;return H.createElement(pa,{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",mh({},Ke(n,!0),{className:w,d:NN(E,_,S,x,h),ref:r})))}):H.createElement("path",mh({},Ke(n,!0),{className:w,d:NN(c,u,d,f,h)}))};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 EP=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?N.createElement("circle",Uv({},Ke(t,!1),Pf(t),{className:o,cx:n,cy:r,r:i})):null};function fu(e){"@babel/helpers - typeof";return fu=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},fu(e)}var yJ=["x","y","top","left","width","height","className"];function Wv(){return Wv=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},Wv.apply(this,arguments)}function EN(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 vJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EN(Object(n),!0).forEach(function(r){bJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bJ(e,t,n){return t=xJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xJ(e){var t=wJ(e,"string");return fu(t)=="symbol"?t:t+""}function wJ(e,t){if(fu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SJ(e,t){if(e==null)return{};var n=kJ(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 kJ(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 NJ=function(t,n,r,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},EJ=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=SJ(t,yJ),v=vJ({x:r,y:a,top:l,left:u,width:f,height:p},m);return!de(r)||!de(a)||!de(f)||!de(p)||!de(l)||!de(u)?null:H.createElement("path",Wv({},Ke(v,!0),{className:Ve("recharts-cross",g),d:NJ(r,a,f,p,l,u)}))},_J=zT,jJ=_J(Object.getPrototypeOf,Object),AJ=jJ,CJ=Ri,TJ=AJ,OJ=Mi,PJ="[object Object]",RJ=Function.prototype,MJ=Object.prototype,_P=RJ.toString,IJ=MJ.hasOwnProperty,$J=_P.call(Object);function LJ(e){if(!OJ(e)||CJ(e)!=PJ)return!1;var t=TJ(e);if(t===null)return!0;var n=IJ.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&_P.call(n)==$J}var DJ=LJ;const BJ=Ze(DJ);var zJ=Ri,FJ=Mi,UJ="[object Boolean]";function WJ(e){return e===!0||e===!1||FJ(e)&&zJ(e)==UJ}var HJ=WJ;const GJ=Ze(HJ);function hu(e){"@babel/helpers - typeof";return hu=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},hu(e)}function gh(){return gh=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},gh.apply(this,arguments)}function qJ(e,t){return XJ(e)||YJ(e,t)||VJ(e,t)||KJ()}function KJ(){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 VJ(e,t){if(e){if(typeof e=="string")return _N(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 _N(e,t)}}function _N(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 YJ(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 XJ(e){if(Array.isArray(e))return e}function jN(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 AN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jN(Object(n),!0).forEach(function(r){ZJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZJ(e,t,n){return t=QJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QJ(e){var t=JJ(e,"string");return hu(t)=="symbol"?t:t+""}function JJ(e,t){if(hu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CN=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},eee={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},tee=function(t){var n=AN(AN({},eee),t),r=N.useRef(),i=N.useState(-1),a=qJ(i,2),o=a[0],l=a[1];N.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&l(w)}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(pa,{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(w){var k=w.upperWidth,S=w.lowerWidth,x=w.height,E=w.x,_=w.y;return H.createElement(pa,{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",gh({},Ke(n,!0),{className:b,d:CN(E,_,k,S,x),ref:r})))}):H.createElement("g",null,H.createElement("path",gh({},Ke(n,!0),{className:b,d:CN(c,u,d,f,h)})))},nee=["option","shapeType","propTransformer","activeClassName","isActive"];function pu(e){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pu(e)}function ree(e,t){if(e==null)return{};var n=iee(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 iee(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 TN(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 yh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TN(Object(n),!0).forEach(function(r){aee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aee(e,t,n){return t=see(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function see(e){var t=oee(e,"string");return pu(t)=="symbol"?t:t+""}function oee(e,t){if(pu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lee(e,t){return yh(yh({},t),e)}function cee(e,t){return e==="symbols"}function ON(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return H.createElement(v0,n);case"trapezoid":return H.createElement(tee,n);case"sector":return H.createElement(pP,n);case"symbols":if(cee(t))return H.createElement($x,n);break;default:return null}}function uee(e){return N.isValidElement(e)?e.props:e}function dee(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?lee:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=ree(e,nee),u;if(N.isValidElement(t))u=N.cloneElement(t,yh(yh({},c),uee(t)));else if(Le(t))u=t(c);else if(BJ(t)&&!GJ(t)){var d=i(t,c);u=H.createElement(ON,{shapeType:n,elementProps:d})}else{var f=c;u=H.createElement(ON,{shapeType:n,elementProps:f})}return l?H.createElement(Yt,{className:o},u):u}function zp(e,t){return t!=null&&"trapezoids"in e.props}function Fp(e,t){return t!=null&&"sectors"in e.props}function mu(e,t){return t!=null&&"points"in e.props}function fee(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 hee(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function pee(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function mee(e,t){var n;return zp(e,t)?n=fee:Fp(e,t)?n=hee:mu(e,t)&&(n=pee),n}function gee(e,t){var n;return zp(e,t)?n="trapezoids":Fp(e,t)?n="sectors":mu(e,t)&&(n="points"),n}function yee(e,t){if(zp(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(Fp(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 mu(e,t)?t.payload:{}}function vee(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=gee(n,t),a=yee(n,t),o=r.filter(function(c,u){var d=p0(a,c),f=n.props[i].filter(function(g){var m=mee(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 bee=Math.ceil,xee=Math.max;function wee(e,t,n,r){for(var i=-1,a=xee(bee((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}var See=wee,kee=aO,PN=1/0,Nee=17976931348623157e292;function Eee(e){if(!e)return e===0?e:0;if(e=kee(e),e===PN||e===-PN){var t=e<0?-1:1;return t*Nee}return e===e?e:0}var jP=Eee,_ee=See,jee=Ap,og=jP;function Aee(e){return function(t,n,r){return r&&typeof r!="number"&&jee(t,n,r)&&(n=r=void 0),t=og(t),n===void 0?(n=t,t=0):n=og(n),r=r===void 0?t<n?1:-1:og(r),_ee(t,n,r,e)}}var Cee=Aee,Tee=Cee,Oee=Tee(),Pee=Oee;const vh=Ze(Pee);function gu(e){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gu(e)}function RN(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 MN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RN(Object(n),!0).forEach(function(r){AP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AP(e,t,n){return t=Ree(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ree(e){var t=Mee(e,"string");return gu(t)=="symbol"?t:t+""}function Mee(e,t){if(gu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Iee=["Webkit","Moz","O","ms"],$ee=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=Iee.reduce(function(a,o){return MN(MN({},a),{},AP({},o+r,n))},{});return i[t]=n,i};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 bh(){return bh=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},bh.apply(this,arguments)}function IN(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 lg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IN(Object(n),!0).forEach(function(r){Yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $N(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,TP(r.key),r)}}function Dee(e,t,n){return t&&$N(e.prototype,t),n&&$N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bee(e,t,n){return t=xh(t),zee(e,CP()?Reflect.construct(t,n||[],xh(e).constructor):t.apply(e,n))}function zee(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 Fee(e)}function Fee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CP=function(){return!!e})()}function xh(e){return xh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xh(e)}function Uee(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&&Hv(e,t)}function Hv(e,t){return Hv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Hv(e,t)}function Yn(e,t,n){return t=TP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TP(e){var t=Wee(e,"string");return Bo(t)=="symbol"?t:t+""}function Wee(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)}var Hee=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=pc().domain(vh(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}},LN=function(t){return t.changedTouches&&!!t.changedTouches.length},zo=function(e){function t(n){var r;return Lee(this,t),r=Bee(this,t,[n]),Yn(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),Yn(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),Yn(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()}),Yn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Yn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Yn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Yn(r,"handleSlideDragStart",function(i){var a=LN(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 Uee(t,e),Dee(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=ii(a[r],l,r);return Le(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var 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=LN(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 w=this.getIndex(y),k=w.startIndex,S=w.endIndex,x=function(){var _=v.length-1;return o==="startX"&&(l>c?k%m===0:S%m===0)||l<c&&S===_||o==="endX"&&(l>c?S%m===0:k%m===0)||l>c&&S===_};this.setState(Yn(Yn({},o,u+b),"brushMoveStartX",r.pageX),function(){g&&x()&&g(w)})}},{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(Yn({},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=N.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=lg(lg({},Ke(this.props,!1)),{},{x:y,y:u,width:d,height:f}),w=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":w,"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(Kf,bh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},g),this.getTextOfTick(i)),H.createElement(Kf,bh({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||!de(l)||!de(c)||!de(u)||!de(d)||u<=0||d<=0)return null;var w=Ve("recharts-brush",a),k=H.Children.count(o)===1,S=$ee("userSelect","none");return H.createElement(Yt,{className:w,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):Le(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 lg({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?Hee({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}}])}(N.PureComponent);Yn(zo,"displayName","Brush");Yn(zo,"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 Gee=Wx;function qee(e,t){var n;return Gee(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}var Kee=qee,Vee=PT,Yee=xa,Xee=Kee,Zee=zn,Qee=Ap;function Jee(e,t,n){var r=Zee(e)?Vee:Xee;return n&&Qee(e,t,n)&&(t=void 0),r(e,Yee(t))}var ete=Jee;const tte=Ze(ete);var ni=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},DN=eO;function nte(e,t,n){t=="__proto__"&&DN?DN(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var rte=nte,ite=rte,ate=QT,ste=xa;function ote(e,t){var n={};return t=ste(t),ate(e,function(r,i,a){ite(n,i,t(r,i,a))}),n}var lte=ote;const cte=Ze(lte);function ute(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 dte=ute,fte=Wx;function hte(e,t){var n=!0;return fte(e,function(r,i,a){return n=!!t(r,i,a),n}),n}var pte=hte,mte=dte,gte=pte,yte=xa,vte=zn,bte=Ap;function xte(e,t,n){var r=vte(e)?mte:gte;return n&&bte(e,t,n)&&(t=void 0),r(e,yte(t))}var wte=xte;const OP=Ze(wte);var Ste=["x","y"];function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}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 BN(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 ql(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BN(Object(n),!0).forEach(function(r){kte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kte(e,t,n){return t=Nte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nte(e){var t=Ete(e,"string");return yu(t)=="symbol"?t:t+""}function Ete(e,t){if(yu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _te(e,t){if(e==null)return{};var n=jte(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 jte(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 Ate(e,t){var n=e.x,r=e.y,i=_te(e,Ste),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 ql(ql(ql(ql(ql({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function zN(e){return H.createElement(dee,Gv({shapeType:"rectangle",propTransformer:Ate,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=de(r)||W3(r);return a?t(r,i):(a||ps(),n)}},Tte=["value","background"],PP;function Fo(e){"@babel/helpers - typeof";return Fo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fo(e)}function Ote(e,t){if(e==null)return{};var n=Pte(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 Pte(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 wh(){return wh=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},wh.apply(this,arguments)}function FN(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 Ot(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FN(Object(n),!0).forEach(function(r){Ji(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UN(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,MP(r.key),r)}}function Mte(e,t,n){return t&&UN(e.prototype,t),n&&UN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ite(e,t,n){return t=Sh(t),$te(e,RP()?Reflect.construct(t,n||[],Sh(e).constructor):t.apply(e,n))}function $te(e,t){if(t&&(Fo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lte(e)}function Lte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RP=function(){return!!e})()}function Sh(e){return Sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sh(e)}function Dte(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&&qv(e,t)}function qv(e,t){return qv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},qv(e,t)}function Ji(e,t,n){return t=MP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MP(e){var t=Bte(e,"string");return Fo(t)=="symbol"?t:t+""}function Bte(e,t){if(Fo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var hn=function(e){function t(){var n;Rte(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Ite(this,t,[].concat(i)),Ji(n,"state",{isAnimationFinished:!1}),Ji(n,"id",wp("recharts-bar-")),Ji(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Ji(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return Dte(t,e),Mte(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=Ot(Ot(Ot({},d),f),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return H.createElement(Yt,wh({className:"recharts-bar-rectangle"},Rf(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(zN,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(pa,{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 w=Ls(b.x,v.x),k=Ls(b.y,v.y),S=Ls(b.width,v.width),x=Ls(b.height,v.height);return Ot(Ot({},v),{},{x:w(g),y:k(g),width:S(g),height:x(g)})}if(o==="horizontal"){var E=Ls(0,v.height),_=E(g);return Ot(Ot({},v),{},{y:v.y+v.height-_,height:_})}var C=Ls(0,v.width),T=C(g);return Ot(Ot({},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||!p0(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=Ote(u,Tte);if(!f)return null;var p=Ot(Ot(Ot(Ot(Ot({},h),{},{fill:"#eee"},f),c),Rf(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return H.createElement(zN,wh({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=Ir(d,Bp);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:ii(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,w=c&&c.allowDataOverflow,k=b||w,S=Ye(m)?this.id:m;return H.createElement(Yt,{className:y},b||w?H.createElement("defs",null,H.createElement("clipPath",{id:"clipPath-".concat(S)},H.createElement("rect",{x:b?u:u-f/2,y:w?d:d-h/2,width:b?f:f*2,height:w?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)&&rs.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}}])}(N.PureComponent);PP=hn;Ji(hn,"displayName","Bar");Ji(hn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Mu.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ji(hn,"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=dX(r,n);if(!p)return null;var g=t.layout,m=n.type.defaultProps,v=m!==void 0?Ot(Ot({},m),n.props):n.props,y=v.dataKey,b=v.children,w=v.minPointSize,k=g==="horizontal"?o:a,S=u?k.scale.domain():null,x=bX({numericAxis:k}),E=Ir(b,Gc),_=f.map(function(C,T){var L,M,B,I,F,z;u?L=fX(u[d+T],S):(L=ii(C,y),Array.isArray(L)||(L=[x,L]));var R=Cte(w,PP.defaultProps.minPointSize)(L[1],T);if(g==="horizontal"){var O,U=[o.scale(L[0]),o.scale(L[1])],A=U[0],Z=U[1];M=Wk({axis:a,ticks:l,bandSize:i,offset:p.offset,entry:C,index:T}),B=(O=Z??A)!==null&&O!==void 0?O:void 0,I=p.size;var $=A-Z;if(F=Number.isNaN($)?0:$,z={x:M,y:o.y,width:I,height:o.height},Math.abs(R)>0&&Math.abs(F)<Math.abs(R)){var P=Pr(F||R)*(Math.abs(R)-Math.abs(F));B-=P,F+=P}}else{var oe=[a.scale(L[0]),a.scale(L[1])],be=oe[0],pe=oe[1];if(M=be,B=Wk({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:C,index:T}),I=pe-be,F=p.size,z={x:a.x,y:B,width:a.width,height:F},Math.abs(R)>0&&Math.abs(I)<Math.abs(R)){var Ce=Pr(I||R)*(Math.abs(R)-Math.abs(I));I+=Ce}}return Ot(Ot(Ot({},C),{},{x:M,y:B,width:I,height:F,value:u?L:L[1],payload:C,background:z},E&&E[T]&&E[T].props),{},{tooltipPayload:[dP(n,C)],tooltipPosition:{x:M+I/2,y:B+F/2}})});return Ot({data:_,layout:g},h)});function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function zte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WN(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,IP(r.key),r)}}function Fte(e,t,n){return t&&WN(e.prototype,t),n&&WN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function HN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HN(Object(n),!0).forEach(function(r){Up(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Up(e,t,n){return t=IP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IP(e){var t=Ute(e,"string");return vu(t)=="symbol"?t:t+""}function Ute(e,t){if(vu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wte=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=!!Zn(u,hn);return d.reduce(function(p,g){var m=n[g],v=m.orientation,y=m.domain,b=m.padding,w=b===void 0?{}:b,k=m.mirror,S=m.reversed,x="".concat(v).concat(k?"Mirror":""),E,_,C,T,L;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var M=y[1]-y[0],B=1/0,I=m.categoricalDomain.sort(q3);if(I.forEach(function(oe,be){be>0&&(B=Math.min((oe||0)-(I[be-1]||0),B))}),Number.isFinite(B)){var F=B/M,z=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(E=F*z/2),m.padding==="no-gap"){var R=fs(t.barCategoryGap,F*z),O=F*z/2;E=O-R-(O-R)/z*R}}}i==="xAxis"?_=[r.left+(w.left||0)+(E||0),r.left+r.width-(w.right||0)-(E||0)]:i==="yAxis"?_=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(E||0),r.top+r.height-(w.bottom||0)-(E||0)]:_=m.range,S&&(_=[_[1],_[0]]);var U=cX(m,a,h),A=U.scale,Z=U.realScaleType;A.domain(y).range(_),uX(A);var $=vX(A,Cr(Cr({},m),{},{realScaleType:Z}));i==="xAxis"?(L=v==="top"&&!k||v==="bottom"&&k,C=r.left,T=f[x]-L*m.height):i==="yAxis"&&(L=v==="left"&&!k||v==="right"&&k,C=f[x]-L*m.width,T=r.top);var P=Cr(Cr(Cr({},m),$),{},{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=lh(P,$),!m.hide&&i==="xAxis"?f[x]+=(L?-1:1)*P.height:m.hide||(f[x]+=(L?-1:1)*P.width),Cr(Cr({},p),{},Up({},g,P))},{})},$P=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)}},Hte=function(t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2;return $P({x:n,y:r},{x:i,y:a})},LP=function(){function e(t){zte(this,e),this.scale=t}return Fte(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)}}])}();Up(LP,"EPS",1e-4);var b0=function(t){var n=Object.keys(t).reduce(function(r,i){return Cr(Cr({},r),{},Up({},i,LP.create(t[i])))},{});return Cr(Cr({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return cte(i,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return OP(i,function(a,o){return n[o].isInRange(a)})}})};function Gte(e){return(e%180+180)%180}var qte=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Gte(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)},Kte=xa,Vte=Ru,Yte=_p;function Xte(e){return function(t,n,r){var i=Object(t);if(!Vte(t)){var a=Kte(n);t=Yte(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 Zte=Xte,Qte=jP;function Jte(e){var t=Qte(e),n=t%1;return t===t?n?t-n:t:0}var ene=Jte,tne=qT,nne=xa,rne=ene,ine=Math.max;function ane(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:rne(n);return i<0&&(i=ine(r+i,0)),tne(e,nne(t),i)}var sne=ane,one=Zte,lne=sne,cne=one(lne),une=cne;const dne=Ze(une);var fne=Yz(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("")}),x0=N.createContext(void 0),w0=N.createContext(void 0),DP=N.createContext(void 0),BP=N.createContext({}),zP=N.createContext(void 0),FP=N.createContext(0),UP=N.createContext(0),GN=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=fne(a);return H.createElement(x0.Provider,{value:r},H.createElement(w0.Provider,{value:i},H.createElement(BP.Provider,{value:a},H.createElement(DP.Provider,{value:d},H.createElement(zP.Provider,{value:o},H.createElement(FP.Provider,{value:u},H.createElement(UP.Provider,{value:c},l)))))))},hne=function(){return N.useContext(zP)},WP=function(t){var n=N.useContext(x0);n==null&&ps();var r=n[t];return r==null&&ps(),r},pne=function(){var t=N.useContext(x0);return Ki(t)},mne=function(){var t=N.useContext(w0),n=dne(t,function(r){return OP(r.domain,Number.isFinite)});return n||Ki(t)},HP=function(t){var n=N.useContext(w0);n==null&&ps();var r=n[t];return r==null&&ps(),r},gne=function(){var t=N.useContext(DP);return t},yne=function(){return N.useContext(BP)},S0=function(){return N.useContext(UP)},k0=function(){return N.useContext(FP)};function Uo(e){"@babel/helpers - typeof";return Uo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uo(e)}function vne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bne(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 xne(e,t,n){return t&&bne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wne(e,t,n){return t=kh(t),Sne(e,GP()?Reflect.construct(t,n||[],kh(e).constructor):t.apply(e,n))}function Sne(e,t){if(t&&(Uo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kne(e)}function kne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GP=function(){return!!e})()}function kh(e){return kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kh(e)}function Nne(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&&Kv(e,t)}function Kv(e,t){return Kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Kv(e,t)}function qN(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 KN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qN(Object(n),!0).forEach(function(r){N0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N0(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=Ene(e,"string");return Uo(t)=="symbol"?t:t+""}function Ene(e,t){if(Uo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function _ne(e,t){return Tne(e)||Cne(e,t)||Ane(e,t)||jne()}function jne(){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 Ane(e,t){if(e){if(typeof e=="string")return VN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VN(e,t)}}function VN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function 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 Tne(e){if(Array.isArray(e))return e}function Vv(){return Vv=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},Vv.apply(this,arguments)}var One=function(t,n){var r;return H.isValidElement(t)?r=H.cloneElement(t,n):Le(t)?r=t(n):r=H.createElement("line",Vv({},n,{className:"recharts-reference-line-line"})),r},Pne=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(ni(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(ni(u,"discard")&&!t.x.isInRange(b))return null;var w=[{x:b,y:f+p},{x:b,y:f}];return l==="top"?w.reverse():w}if(i){var k=u.segment,S=k.map(function(x){return t.apply(x,{position:o})});return ni(u,"discard")&&tte(S,function(x){return!t.isInRange(x)})?null:S}return null};function Rne(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=hne(),d=WP(i),f=HP(a),h=gne();if(!u||!h)return null;Si(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=b0({x:d.scale,y:f.scale}),g=Ht(t),m=Ht(n),v=r&&r.length===2,y=Pne(p,g,m,v,h,e.position,d.orientation,f.orientation,e);if(!y)return null;var b=_ne(y,2),w=b[0],k=w.x,S=w.y,x=b[1],E=x.x,_=x.y,C=ni(e,"hidden")?"url(#".concat(u,")"):void 0,T=KN(KN({clipPath:C},Ke(e,!0)),{},{x1:k,y1:S,x2:E,y2:_});return H.createElement(Yt,{className:Ve("recharts-reference-line",l)},One(o,T),gn.renderCallByParent(e,Hte({x1:k,y1:S,x2:E,y2:_})))}var E0=function(e){function t(){return vne(this,t),wne(this,t,arguments)}return Nne(t,e),xne(t,[{key:"render",value:function(){return H.createElement(Rne,this.props)}}])}(H.Component);N0(E0,"displayName","ReferenceLine");N0(E0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});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 Wo(e){"@babel/helpers - typeof";return Wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wo(e)}function YN(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 XN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YN(Object(n),!0).forEach(function(r){Wp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ine(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 $ne(e,t,n){return t&&Ine(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lne(e,t,n){return t=Nh(t),Dne(e,KP()?Reflect.construct(t,n||[],Nh(e).constructor):t.apply(e,n))}function Dne(e,t){if(t&&(Wo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return 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 KP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KP=function(){return!!e})()}function Nh(e){return Nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nh(e)}function zne(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&&Xv(e,t)}function Xv(e,t){return Xv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Xv(e,t)}function Wp(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=Fne(e,"string");return Wo(t)=="symbol"?t:t+""}function Fne(e,t){if(Wo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Une=function(t){var n=t.x,r=t.y,i=t.xAxis,a=t.yAxis,o=b0({x:i.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return ni(t,"discard")&&!o.isInRange(l)?null:l},Hp=function(e){function t(){return Mne(this,t),Lne(this,t,arguments)}return zne(t,e),$ne(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=Ht(i),d=Ht(a);if(Si(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=Une(this.props);if(!f)return null;var h=f.x,p=f.y,g=this.props,m=g.shape,v=g.className,y=ni(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=XN(XN({clipPath:y},Ke(this.props,!0)),{},{cx:h,cy:p});return H.createElement(Yt,{className:Ve("recharts-reference-dot",v)},t.renderDot(m,b),gn.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(H.Component);Wp(Hp,"displayName","ReferenceDot");Wp(Hp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Wp(Hp,"renderDot",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):Le(e)?n=e(t):n=H.createElement(EP,Yv({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});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 Ho(e){"@babel/helpers - typeof";return Ho=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},Ho(e)}function ZN(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 QN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZN(Object(n),!0).forEach(function(r){Gp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hne(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 Gne(e,t,n){return t&&Hne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qne(e,t,n){return t=Eh(t),Kne(e,YP()?Reflect.construct(t,n||[],Eh(e).constructor):t.apply(e,n))}function Kne(e,t){if(t&&(Ho(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vne(e)}function Vne(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 Eh(e){return Eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Eh(e)}function Yne(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&&Qv(e,t)}function Qv(e,t){return Qv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Qv(e,t)}function Gp(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=Xne(e,"string");return Ho(t)=="symbol"?t:t+""}function Xne(e,t){if(Ho(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ho(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Zne=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=b0({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 ni(a,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:$P(p,g)},qp=function(e){function t(){return Wne(this,t),qne(this,t,arguments)}return Yne(t,e),Gne(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;Si(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Ht(i),h=Ht(a),p=Ht(o),g=Ht(l),m=this.props.shape;if(!f&&!h&&!p&&!g&&!m)return null;var v=Zne(f,h,p,g,this.props);if(!v&&!m)return null;var y=ni(this.props,"hidden")?"url(#".concat(d,")"):void 0;return H.createElement(Yt,{className:Ve("recharts-reference-area",c)},t.renderRect(m,QN(QN({clipPath:y},Ke(this.props,!0)),v)),gn.renderCallByParent(this.props,v))}}])}(H.Component);Gp(qp,"displayName","ReferenceArea");Gp(qp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Gp(qp,"renderRect",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):Le(e)?n=e(t):n=H.createElement(v0,Zv({},t,{className:"recharts-reference-area-rect"})),n});function ZP(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 Qne(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return qte(r,n)}function Jne(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 _h(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 ere(e,t){return ZP(e,t+1)}function tre(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:ZP(r,u)};var m=c,v,y=function(){return v===void 0&&(v=n(g,m)),v},b=g.coordinate,w=c===0||_h(e,b,y,d,l);w||(c=0,d=o,u+=1),w&&(d=b+e*(y()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function bu(e){"@babel/helpers - typeof";return bu=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},bu(e)}function JN(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 fn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JN(Object(n),!0).forEach(function(r){nre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nre(e,t,n){return t=rre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rre(e){var t=ire(e,"string");return bu(t)=="symbol"?t:t+""}function ire(e,t){if(bu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function are(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=fn(fn({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate})}else a[h]=p=fn(fn({},p),{},{tickCoord:p.coordinate});var y=_h(e,p.tickCoord,m,l,c);y&&(c=p.tickCoord-e*(m()/2+i),a[h]=fn(fn({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function sre(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=fn(fn({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=_h(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+i),o[l-1]=fn(fn({},d),{},{isShow:!0}))}for(var g=a?l-1:l,m=function(b){var w=o[b],k,S=function(){return k===void 0&&(k=n(w,b)),k};if(b===0){var x=e*(w.coordinate-e*S()/2-c);o[b]=w=fn(fn({},w),{},{tickCoord:x<0?w.coordinate-x*e:w.coordinate})}else o[b]=w=fn(fn({},w),{},{tickCoord:w.coordinate});var E=_h(e,w.tickCoord,S,c,u);E&&(c=w.tickCoord+e*(S()/2+i),o[b]=fn(fn({},w),{},{isShow:!0}))},v=0;v<g;v++)m(v);return o}function _0(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(de(c)||Mu.isSsr)return ere(i,typeof c=="number"&&de(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=d&&p==="width"?hc(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(w,k){var S=Le(u)?u(w.value,k):w.value;return p==="width"?Qne(hc(S,{fontSize:t,letterSpacing:n}),g,f):hc(S,{fontSize:t,letterSpacing:n})[p]},v=i.length>=2?Pr(i[1].coordinate-i[0].coordinate):1,y=Jne(a,v,p);return c==="equidistantPreserveStart"?tre(v,y,m,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=sre(v,y,m,i,o,c==="preserveStartEnd"):h=are(v,y,m,i,o),h.filter(function(b){return b.isShow}))}var ore=["viewBox"],lre=["viewBox"],cre=["ticks"];function Go(e){"@babel/helpers - typeof";return Go=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},Go(e)}function oo(){return oo=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},oo.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 zt(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){j0(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 cg(e,t){if(e==null)return{};var n=ure(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 ure(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 dre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tE(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,JP(r.key),r)}}function fre(e,t,n){return t&&tE(e.prototype,t),n&&tE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hre(e,t,n){return t=jh(t),pre(e,QP()?Reflect.construct(t,n||[],jh(e).constructor):t.apply(e,n))}function pre(e,t){if(t&&(Go(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mre(e)}function mre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QP=function(){return!!e})()}function jh(e){return jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jh(e)}function gre(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&&Jv(e,t)}function Jv(e,t){return Jv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Jv(e,t)}function j0(e,t,n){return t=JP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JP(e){var t=yre(e,"string");return Go(t)=="symbol"?t:t+""}function yre(e,t){if(Go(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Go(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ml=function(e){function t(n){var r;return dre(this,t),r=hre(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return gre(t,e),fre(t,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,o=cg(r,ore),l=this.props,c=l.viewBox,u=cg(l,lre);return!yo(a,c)||!yo(o,u)||!yo(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,w=f?-1:1,k=r.tickSize||d,S=de(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=g=r.coordinate,v=o+ +!f*c,m=v-w*k,b=m-w*h,y=S;break;case"left":m=v=r.coordinate,g=a+ +!f*l,p=g-w*k,y=p-w*h,b=S;break;case"right":m=v=r.coordinate,g=a+ +f*l,p=g+w*k,y=p+w*h,b=S;break;default:p=g=r.coordinate,v=o+ +f*c,m=v+w*k,b=m+w*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=zt(zt(zt({},Ke(this.props,!1)),Ke(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=zt(zt({},f),{},{x1:i,y1:a+h*l,x2:i+o,y2:a+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=zt(zt({},f),{},{x1:i+p*o,y1:a,x2:i+p*o,y2:a+l})}return H.createElement("line",oo({},f,{className:Ve("recharts-cartesian-axis-line",yr(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=_0(zt(zt({},this.props),{},{ticks:r}),i,a),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),v=Ke(this.props,!1),y=Ke(d,!1),b=zt(zt({},v),{},{fill:"none"},Ke(c,!1)),w=p.map(function(k,S){var x=o.getTickLineCoord(k),E=x.line,_=x.tick,C=zt(zt(zt(zt({textAnchor:g,verticalAnchor:m},v),{},{stroke:"none",fill:u},y),_),{},{index:S,payload:k,visibleTicksCount:p.length,tickFormatter:f});return H.createElement(Yt,oo({className:"recharts-cartesian-axis-tick",key:"tick-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},Rf(o.props,k,S)),c&&H.createElement("line",oo({},b,E,{className:Ve("recharts-cartesian-axis-tick-line",yr(c,"className"))})),d&&t.renderTickItem(d,C,"".concat(Le(f)?f(k.value,S):k.value).concat(h||"")))});return H.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{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=cg(f,cre),g=h;return Le(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),gn.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,zt(zt({},i),{},{className:l})):Le(r)?o=r(zt(zt({},i),{},{className:l})):o=H.createElement(Kf,oo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(N.Component);j0(ml,"displayName","CartesianAxis");j0(ml,"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 vre=["x1","y1","x2","y2","key"],bre=["offset"];function ms(e){"@babel/helpers - typeof";return ms=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},ms(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 yn(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){xre(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 xre(e,t,n){return t=wre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wre(e){var t=Sre(e,"string");return ms(t)=="symbol"?t:t+""}function Sre(e,t){if(ms(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ms(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xa(){return Xa=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},Xa.apply(this,arguments)}function rE(e,t){if(e==null)return{};var n=kre(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 kre(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 Nre=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 eR(e,t){var n;if(H.isValidElement(e))n=H.cloneElement(e,t);else if(Le(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,o=t.y2,l=t.key,c=rE(t,vre),u=Ke(c,!1);u.offset;var d=rE(u,bre);n=H.createElement("line",Xa({},d,{x1:r,y1:i,x2:a,y2:o,fill:"none",key:l}))}return n}function Ere(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=yn(yn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return eR(i,u)});return H.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function _re(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=yn(yn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return eR(i,u)});return H.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function jre(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 Are(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 cP(_0(yn(yn(yn({},ml.defaultProps),r),{},{ticks:bi(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,n)},Tre=function(t,n){var r=t.yAxis,i=t.width,a=t.height,o=t.offset;return cP(_0(yn(yn(yn({},ml.defaultProps),r),{},{ticks:bi(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,n)},zs={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Vi(e){var t,n,r,i,a,o,l=S0(),c=k0(),u=yne(),d=yn(yn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:zs.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:zs.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:zs.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:zs.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:zs.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:zs.verticalFill,x:de(e.x)?e.x:u.left,y:de(e.y)?e.y:u.top,width:de(e.width)?e.width:u.width,height:de(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=pne(),w=mne();if(!de(p)||p<=0||!de(g)||g<=0||!de(f)||f!==+f||!de(h)||h!==+h)return null;var k=d.verticalCoordinatesGenerator||Cre,S=d.horizontalCoordinatesGenerator||Tre,x=d.horizontalPoints,E=d.verticalPoints;if((!x||!x.length)&&Le(S)){var _=v&&v.length,C=S({yAxis:w?yn(yn({},w),{},{ticks:_?v:w.ticks}):void 0,width:l,height:c,offset:u},_?!0:m);Si(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ms(C),"]")),Array.isArray(C)&&(x=C)}if((!E||!E.length)&&Le(k)){var T=y&&y.length,L=k({xAxis:b?yn(yn({},b),{},{ticks:T?y:b.ticks}):void 0,width:l,height:c,offset:u},T?!0:m);Si(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ms(L),"]")),Array.isArray(L)&&(E=L)}return H.createElement("g",{className:"recharts-cartesian-grid"},H.createElement(Nre,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),H.createElement(Ere,Xa({},d,{offset:u,horizontalPoints:x,xAxis:b,yAxis:w})),H.createElement(_re,Xa({},d,{offset:u,verticalPoints:E,xAxis:b,yAxis:w})),H.createElement(jre,Xa({},d,{horizontalPoints:x})),H.createElement(Are,Xa({},d,{verticalPoints:E})))}Vi.displayName="CartesianGrid";function qo(e){"@babel/helpers - typeof";return qo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qo(e)}function Ore(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rR(r.key),r)}}function Rre(e,t,n){return t&&Pre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mre(e,t,n){return t=Ah(t),Ire(e,tR()?Reflect.construct(t,n||[],Ah(e).constructor):t.apply(e,n))}function Ire(e,t){if(t&&(qo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $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 tR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tR=function(){return!!e})()}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ah(e)}function Lre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eb(e,t)}function eb(e,t){return eb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},eb(e,t)}function nR(e,t,n){return t=rR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rR(e){var t=Dre(e,"string");return qo(t)=="symbol"?t:t+""}function Dre(e,t){if(qo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function tb(){return tb=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},tb.apply(this,arguments)}function Bre(e){var t=e.xAxisId,n=S0(),r=k0(),i=WP(t);return i==null?null:N.createElement(ml,tb({},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 bi(o,!0)}}))}var Xr=function(e){function t(){return Ore(this,t),Mre(this,t,arguments)}return Lre(t,e),Rre(t,[{key:"render",value:function(){return N.createElement(Bre,this.props)}}])}(N.Component);nR(Xr,"displayName","XAxis");nR(Xr,"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 Ko(e){"@babel/helpers - typeof";return Ko=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ko(e)}function zre(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,sR(r.key),r)}}function Ure(e,t,n){return t&&Fre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wre(e,t,n){return t=Ch(t),Hre(e,iR()?Reflect.construct(t,n||[],Ch(e).constructor):t.apply(e,n))}function Hre(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 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 iR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iR=function(){return!!e})()}function Ch(e){return Ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ch(e)}function qre(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&&nb(e,t)}function nb(e,t){return nb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},nb(e,t)}function aR(e,t,n){return t=sR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sR(e){var t=Kre(e,"string");return Ko(t)=="symbol"?t:t+""}function Kre(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 rb(){return rb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rb.apply(this,arguments)}var Vre=function(t){var n=t.yAxisId,r=S0(),i=k0(),a=HP(n);return a==null?null:N.createElement(ml,rb({},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 bi(l,!0)}}))},Zr=function(e){function t(){return zre(this,t),Wre(this,t,arguments)}return qre(t,e),Ure(t,[{key:"render",value:function(){return N.createElement(Vre,this.props)}}])}(N.Component);aR(Zr,"displayName","YAxis");aR(Zr,"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 iE(e){return Qre(e)||Zre(e)||Xre(e)||Yre()}function Yre(){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 Xre(e,t){if(e){if(typeof e=="string")return ib(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 ib(e,t)}}function Zre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qre(e){if(Array.isArray(e))return ib(e)}function ib(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 ab=function(t,n,r,i,a){var o=Ir(t,E0),l=Ir(t,Hp),c=[].concat(iE(o),iE(l)),u=Ir(t,qp),d="".concat(i,"Id"),f=i[0],h=n;if(c.length&&(h=c.reduce(function(m,v){if(v.props[d]===r&&ni(v.props,"extendDomain")&&de(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&&ni(v.props,"extendDomain")&&de(v.props[p])&&de(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 de(v)?[Math.min(m[0],v),Math.max(m[1],v)]:m},h)),h},oR={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,w;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(w=1,b=new Array(y-1);w<y;w++)b[w-1]=arguments[w];v.fn.apply(v.context,b)}else{var k=v.length,S;for(w=0;w<k;w++)switch(v[w].once&&this.removeListener(u,v[w].fn,void 0,!0),y){case 1:v[w].fn.call(v[w].context);break;case 2:v[w].fn.call(v[w].context,d);break;case 3:v[w].fn.call(v[w].context,d,f);break;case 4:v[w].fn.call(v[w].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[w].fn.apply(v[w].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})(oR);var Jre=oR.exports;const eie=Ze(Jre);var ug=new eie,dg="recharts.syncMouseEvents";function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function tie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nie(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,lR(r.key),r)}}function rie(e,t,n){return t&&nie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fg(e,t,n){return t=lR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lR(e){var t=iie(e,"string");return xu(t)=="symbol"?t:t+""}function iie(e,t){if(xu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var aie=function(){function e(){tie(this,e),fg(this,"activeIndex",0),fg(this,"coordinateList",[]),fg(this,"layout","horizontal")}return rie(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 sie(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&&de(r)&&de(i))return!0}return!1}function oie(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 cR(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,o=an(t,n,r,i),l=an(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function lie(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=an(l,c,u,f),p=an(l,c,d,f);r=h.x,i=h.y,a=p.x,o=p.y}else return cR(t);return[{x:r,y:i},{x:a,y:o}]}function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function 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 Ad(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){cie(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 cie(e,t,n){return t=uie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uie(e){var t=die(e,"string");return wu(t)=="symbol"?t:t+""}function die(e,t){if(wu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fie(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=aN;if(h==="ScatterChart")g=o,m=EJ;else if(h==="BarChart")g=oie(f,o,c,d),m=v0;else if(f==="radial"){var v=cR(o),y=v.cx,b=v.cy,w=v.radius,k=v.startAngle,S=v.endAngle;g={cx:y,cy:b,startAngle:k,endAngle:S,innerRadius:w,outerRadius:w},m=pP}else g={points:lie(f,o,c)},m=aN;var x=Ad(Ad(Ad(Ad({stroke:"#ccc",pointerEvents:"none"},c),g),Ke(p,!1)),{},{payload:l,payloadIndex:u,className:Ve("recharts-tooltip-cursor",p.className)});return N.isValidElement(p)?N.cloneElement(p,x):N.createElement(m,x)}var hie=["item"],pie=["children","className","width","height","style","compact","title","desc"];function Vo(e){"@babel/helpers - typeof";return Vo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vo(e)}function lo(){return lo=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},lo.apply(this,arguments)}function sE(e,t){return yie(e)||gie(e,t)||dR(e,t)||mie()}function mie(){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 gie(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 yie(e){if(Array.isArray(e))return e}function oE(e,t){if(e==null)return{};var n=vie(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 vie(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 bie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fR(r.key),r)}}function wie(e,t,n){return t&&xie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sie(e,t,n){return t=Th(t),kie(e,uR()?Reflect.construct(t,n||[],Th(e).constructor):t.apply(e,n))}function kie(e,t){if(t&&(Vo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nie(e)}function Nie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uR=function(){return!!e})()}function Th(e){return Th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Th(e)}function Eie(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&&sb(e,t)}function sb(e,t){return sb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},sb(e,t)}function Yo(e){return Aie(e)||jie(e)||dR(e)||_ie()}function _ie(){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 dR(e,t){if(e){if(typeof e=="string")return ob(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 ob(e,t)}}function jie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Aie(e){if(Array.isArray(e))return ob(e)}function ob(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 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 Q(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){Oe(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 Oe(e,t,n){return t=fR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fR(e){var t=Cie(e,"string");return Vo(t)=="symbol"?t:t+""}function Cie(e,t){if(Vo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tie={xAxis:["bottom","top"],yAxis:["left","right"]},Oie={width:"100%",height:"100%"},hR={x:0,y:0};function Cd(e){return e}var Pie=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Rie=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),an(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=i.angle;return Q(Q(Q({},i),an(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return hR},Kp=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(Yo(l),Yo(u)):l},[]);return o.length>0?o:t&&t.length&&de(i)&&de(a)?t.slice(i,a+1):[]};function pR(e){return e==="number"?[0,"auto"]:void 0}var lb=function(t,n,r,i){var a=t.graphicalItems,o=t.tooltipAxis,l=Kp(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=Fy(p,o.dataKey,i)}else h=f&&f[r]||l[r];return h?[].concat(Yo(c),[dP(u,h)]):c},[])},cE=function(t,n,r,i){var a=i||{x:t.chartX,y:t.chartY},o=Pie(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=rX(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=lb(t,n,d,f),p=Rie(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},Mie=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=lP(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,w=y.dataKey,k=y.allowDataOverflow,S=y.allowDuplicatedCategory,x=y.scale,E=y.ticks,_=y.includeHidden,C=y[o];if(g[C])return g;var T=Kp(t.data,{graphicalItems:i.filter(function($){var P,oe=o in $.props?$.props[o]:(P=$.type.defaultProps)===null||P===void 0?void 0:P[o];return oe===C}),dataStartIndex:c,dataEndIndex:u}),L=T.length,M,B,I;sie(y.domain,k,b)&&(M=Av(y.domain,null,k),p&&(b==="number"||x!=="auto")&&(I=mc(T,w,"category")));var F=pR(b);if(!M||M.length===0){var z,R=(z=y.domain)!==null&&z!==void 0?z:F;if(w){if(M=mc(T,w,b),b==="category"&&p){var O=G3(M);S&&O?(B=M,M=vh(0,L)):S||(M=qk(R,M,m).reduce(function($,P){return $.indexOf(P)>=0?$:[].concat(Yo($),[P])},[]))}else if(b==="category")S?M=M.filter(function($){return $!==""&&!Ye($)}):M=qk(R,M,m).reduce(function($,P){return $.indexOf(P)>=0||P===""||Ye(P)?$:[].concat(Yo($),[P])},[]);else if(b==="number"){var U=lX(T,i.filter(function($){var P,oe,be=o in $.props?$.props[o]:(P=$.type.defaultProps)===null||P===void 0?void 0:P[o],pe="hide"in $.props?$.props.hide:(oe=$.type.defaultProps)===null||oe===void 0?void 0:oe.hide;return be===C&&(_||!pe)}),w,a,d);U&&(M=U)}p&&(b==="number"||x!=="auto")&&(I=mc(T,w,"category"))}else p?M=vh(0,L):l&&l[C]&&l[C].hasStack&&b==="number"?M=h==="expand"?[0,1]:uP(l[C].stackGroups,c,u):M=oP(T,i.filter(function($){var P=o in $.props?$.props[o]:$.type.defaultProps[o],oe="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return P===C&&(_||!oe)}),b,d,!0);if(b==="number")M=ab(f,M,C,a,E),R&&(M=Av(R,M,k));else if(b==="category"&&R){var A=R,Z=M.every(function($){return A.indexOf($)>=0});Z&&(M=A)}}return Q(Q({},g),{},Oe({},C,Q(Q({},y),{},{axisType:a,domain:M,categoricalDomain:I,duplicateDomain:B,originalDomain:(v=y.domain)!==null&&v!==void 0?v:F,isCategorical:p,layout:d})))},{})},Iie=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=Kp(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=lP(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,w=b[o],k=pR("number");if(!v[w]){m++;var S;return g?S=vh(0,p):l&&l[w]&&l[w].hasStack?(S=uP(l[w].stackGroups,c,u),S=ab(f,S,w,a)):(S=Av(k,oP(h,r.filter(function(x){var E,_,C=o in x.props?x.props[o]:(E=x.type.defaultProps)===null||E===void 0?void 0:E[o],T="hide"in x.props?x.props.hide:(_=x.type.defaultProps)===null||_===void 0?void 0:_.hide;return C===w&&!T}),"number",d),i.defaultProps.allowDataOverflow),S=ab(f,S,w,a)),Q(Q({},v),{},Oe({},w,Q(Q({axisType:a},i.defaultProps),{},{hide:!0,orientation:yr(Tie,"".concat(a,".").concat(m%2),null),domain:S,originalDomain:k,isCategorical:g,layout:d})))}return v},{})},$ie=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=Ir(d,a),p={};return h&&h.length?p=Mie(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=Iie(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},Lie=function(t){var n=Ki(t),r=bi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Hx(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:lh(n,r)}},uE=function(t){var n=t.children,r=t.defaultShowTooltip,i=Zn(n,zo),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}},Die=function(t){return!t||!t.length?!1:t.some(function(n){var r=wi(n&&n.type);return r&&r.indexOf("Bar")>=0})},dE=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=Zn(f,zo),g=Zn(f,es),m=Object.keys(c).reduce(function(S,x){var E=c[x],_=E.orientation;return!E.mirror&&!E.hide?Q(Q({},S),{},Oe({},_,S[_]+E.width)):S},{left:h.left||0,right:h.right||0}),v=Object.keys(o).reduce(function(S,x){var E=o[x],_=E.orientation;return!E.mirror&&!E.hide?Q(Q({},S),{},Oe({},_,yr(S,"".concat(_))+E.height)):S},{top:h.top||0,bottom:h.bottom||0}),y=Q(Q({},v),m),b=y.bottom;p&&(y.bottom+=p.props.height||zo.defaultProps.height),g&&n&&(y=sX(y,i,r,n));var w=u-y.left-y.right,k=d-y.top-y.bottom;return Q(Q({brushBottom:b},y),{},{width:Math.max(w,0),height:Math.max(k,0)})},zie=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Fie=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 w=b.graphicalItems,k=b.stackGroups,S=b.offset,x=b.updateId,E=b.dataStartIndex,_=b.dataEndIndex,C=y.barSize,T=y.layout,L=y.barGap,M=y.barCategoryGap,B=y.maxBarSize,I=dE(T),F=I.numericAxisName,z=I.cateAxisName,R=Die(w),O=[];return w.forEach(function(U,A){var Z=Kp(y.data,{graphicalItems:[U],dataStartIndex:E,dataEndIndex:_}),$=U.type.defaultProps!==void 0?Q(Q({},U.type.defaultProps),U.props):U.props,P=$.dataKey,oe=$.maxBarSize,be=$["".concat(F,"Id")],pe=$["".concat(z,"Id")],Ce={},G=c.reduce(function(Ee,qe){var It=b["".concat(qe.axisType,"Map")],On=$["".concat(qe.axisType,"Id")];It&&It[On]||qe.axisType==="zAxis"||ps();var Qt=It[On];return Q(Q({},Ee),{},Oe(Oe({},qe.axisType,Qt),"".concat(qe.axisType,"Ticks"),bi(Qt)))},Ce),Y=G[z],ae=G["".concat(z,"Ticks")],le=k&&k[be]&&k[be].hasStack&&xX(U,k[be].stackGroups),X=wi(U.type).indexOf("Bar")>=0,je=lh(Y,ae),Ne=[],_e=R&&iX({barSize:C,stackGroups:k,totalSize:zie(G,z)});if(X){var ge,$e,fe=Ye(oe)?B:oe,et=(ge=($e=lh(Y,ae,!0))!==null&&$e!==void 0?$e:fe)!==null&&ge!==void 0?ge:0;Ne=aX({barGap:L,barCategoryGap:M,bandSize:et!==je?et:je,sizeList:_e[pe],maxBarSize:fe}),et!==je&&(Ne=Ne.map(function(Ee){return Q(Q({},Ee),{},{position:Q(Q({},Ee.position),{},{offset:Ee.position.offset-et/2})})}))}var De=U&&U.type&&U.type.getComposedData;De&&O.push({props:Q(Q({},De(Q(Q({},G),{},{displayedData:Z,props:y,dataKey:P,item:U,bandSize:je,barPosition:Ne,offset:S,stackedData:le,layout:T,dataStartIndex:E,dataEndIndex:_}))),{},Oe(Oe(Oe({key:U.key||"item-".concat(A)},F,G[F]),z,G[z]),"animationId",x)),childIndex:rF(U,y.children),item:U})}),O},p=function(y,b){var w=y.props,k=y.dataStartIndex,S=y.dataEndIndex,x=y.updateId;if(!z1({props:w}))return null;var E=w.children,_=w.layout,C=w.stackOffset,T=w.data,L=w.reverseStackOrder,M=dE(_),B=M.numericAxisName,I=M.cateAxisName,F=Ir(E,r),z=yX(T,F,"".concat(B,"Id"),"".concat(I,"Id"),C,L),R=c.reduce(function($,P){var oe="".concat(P.axisType,"Map");return Q(Q({},$),{},Oe({},oe,$ie(w,Q(Q({},P),{},{graphicalItems:F,stackGroups:P.axisType===B&&z,dataStartIndex:k,dataEndIndex:S}))))},{}),O=Bie(Q(Q({},R),{},{props:w,graphicalItems:F}),b==null?void 0:b.legendBBox);Object.keys(R).forEach(function($){R[$]=d(w,R[$],O,$.replace("Map",""),n)});var U=R["".concat(I,"Map")],A=Lie(U),Z=h(w,Q(Q({},R),{},{dataStartIndex:k,dataEndIndex:S,updateId:x,graphicalItems:F,stackGroups:z,offset:O}));return Q(Q({formattedGraphicalItems:Z,graphicalItems:F,offset:O,stackGroups:z},A),R)},g=function(v){function y(b){var w,k,S;return bie(this,y),S=Sie(this,y,[b]),Oe(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Oe(S,"accessibilityManager",new aie),Oe(S,"handleLegendBBoxUpdate",function(x){if(x){var E=S.state,_=E.dataStartIndex,C=E.dataEndIndex,T=E.updateId;S.setState(Q({legendBBox:x},p({props:S.props,dataStartIndex:_,dataEndIndex:C,updateId:T},Q(Q({},S.state),{},{legendBBox:x}))))}}),Oe(S,"handleReceiveSyncEvent",function(x,E,_){if(S.props.syncId===x){if(_===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(E)}}),Oe(S,"handleBrushChange",function(x){var E=x.startIndex,_=x.endIndex;if(E!==S.state.dataStartIndex||_!==S.state.dataEndIndex){var C=S.state.updateId;S.setState(function(){return Q({dataStartIndex:E,dataEndIndex:_},p({props:S.props,dataStartIndex:E,dataEndIndex:_,updateId:C},S.state))}),S.triggerSyncEvent({dataStartIndex:E,dataEndIndex:_})}}),Oe(S,"handleMouseEnter",function(x){var E=S.getMouseInfo(x);if(E){var _=Q(Q({},E),{},{isTooltipActive:!0});S.setState(_),S.triggerSyncEvent(_);var C=S.props.onMouseEnter;Le(C)&&C(_,x)}}),Oe(S,"triggeredAfterMouseMove",function(x){var E=S.getMouseInfo(x),_=E?Q(Q({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(_),S.triggerSyncEvent(_);var C=S.props.onMouseMove;Le(C)&&C(_,x)}),Oe(S,"handleItemMouseEnter",function(x){S.setState(function(){return{isTooltipActive:!0,activeItem:x,activePayload:x.tooltipPayload,activeCoordinate:x.tooltipPosition||{x:x.cx,y:x.cy}}})}),Oe(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Oe(S,"handleMouseMove",function(x){x.persist(),S.throttleTriggeredAfterMouseMove(x)}),Oe(S,"handleMouseLeave",function(x){S.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};S.setState(E),S.triggerSyncEvent(E);var _=S.props.onMouseLeave;Le(_)&&_(E,x)}),Oe(S,"handleOuterEvent",function(x){var E=nF(x),_=yr(S.props,"".concat(E));if(E&&Le(_)){var C,T;/.*touch.*/i.test(E)?T=S.getMouseInfo(x.changedTouches[0]):T=S.getMouseInfo(x),_((C=T)!==null&&C!==void 0?C:{},x)}}),Oe(S,"handleClick",function(x){var E=S.getMouseInfo(x);if(E){var _=Q(Q({},E),{},{isTooltipActive:!0});S.setState(_),S.triggerSyncEvent(_);var C=S.props.onClick;Le(C)&&C(_,x)}}),Oe(S,"handleMouseDown",function(x){var E=S.props.onMouseDown;if(Le(E)){var _=S.getMouseInfo(x);E(_,x)}}),Oe(S,"handleMouseUp",function(x){var E=S.props.onMouseUp;if(Le(E)){var _=S.getMouseInfo(x);E(_,x)}}),Oe(S,"handleTouchMove",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(x.changedTouches[0])}),Oe(S,"handleTouchStart",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.handleMouseDown(x.changedTouches[0])}),Oe(S,"handleTouchEnd",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.handleMouseUp(x.changedTouches[0])}),Oe(S,"handleDoubleClick",function(x){var E=S.props.onDoubleClick;if(Le(E)){var _=S.getMouseInfo(x);E(_,x)}}),Oe(S,"handleContextMenu",function(x){var E=S.props.onContextMenu;if(Le(E)){var _=S.getMouseInfo(x);E(_,x)}}),Oe(S,"triggerSyncEvent",function(x){S.props.syncId!==void 0&&ug.emit(dg,S.props.syncId,x,S.eventEmitterSymbol)}),Oe(S,"applySyncEvent",function(x){var E=S.props,_=E.layout,C=E.syncMethod,T=S.state.updateId,L=x.dataStartIndex,M=x.dataEndIndex;if(x.dataStartIndex!==void 0||x.dataEndIndex!==void 0)S.setState(Q({dataStartIndex:L,dataEndIndex:M},p({props:S.props,dataStartIndex:L,dataEndIndex:M,updateId:T},S.state)));else if(x.activeTooltipIndex!==void 0){var B=x.chartX,I=x.chartY,F=x.activeTooltipIndex,z=S.state,R=z.offset,O=z.tooltipTicks;if(!R)return;if(typeof C=="function")F=C(O,x);else if(C==="value"){F=-1;for(var U=0;U<O.length;U++)if(O[U].value===x.activeLabel){F=U;break}}var A=Q(Q({},R),{},{x:R.left,y:R.top}),Z=Math.min(B,A.x+A.width),$=Math.min(I,A.y+A.height),P=O[F]&&O[F].value,oe=lb(S.state,S.props.data,F),be=O[F]?{x:_==="horizontal"?O[F].coordinate:Z,y:_==="horizontal"?$:O[F].coordinate}:hR;S.setState(Q(Q({},x),{},{activeLabel:P,activeCoordinate:be,activePayload:oe,activeTooltipIndex:F}))}else S.setState(x)}),Oe(S,"renderCursor",function(x){var E,_=S.state,C=_.isTooltipActive,T=_.activeCoordinate,L=_.activePayload,M=_.offset,B=_.activeTooltipIndex,I=_.tooltipAxisBandSize,F=S.getTooltipEventType(),z=(E=x.props.active)!==null&&E!==void 0?E:C,R=S.props.layout,O=x.key||"_recharts-cursor";return H.createElement(fie,{key:O,activeCoordinate:T,activePayload:L,activeTooltipIndex:B,chartName:n,element:x,isActive:z,layout:R,offset:M,tooltipAxisBandSize:I,tooltipEventType:F})}),Oe(S,"renderPolarAxis",function(x,E,_){var C=yr(x,"type.axisType"),T=yr(S.state,"".concat(C,"Map")),L=x.type.defaultProps,M=L!==void 0?Q(Q({},L),x.props):x.props,B=T&&T[M["".concat(C,"Id")]];return N.cloneElement(x,Q(Q({},B),{},{className:Ve(C,B.className),key:x.key||"".concat(E,"-").concat(_),ticks:bi(B,!0)}))}),Oe(S,"renderPolarGrid",function(x){var E=x.props,_=E.radialLines,C=E.polarAngles,T=E.polarRadius,L=S.state,M=L.radiusAxisMap,B=L.angleAxisMap,I=Ki(M),F=Ki(B),z=F.cx,R=F.cy,O=F.innerRadius,U=F.outerRadius;return N.cloneElement(x,{polarAngles:Array.isArray(C)?C:bi(F,!0).map(function(A){return A.coordinate}),polarRadius:Array.isArray(T)?T:bi(I,!0).map(function(A){return A.coordinate}),cx:z,cy:R,innerRadius:O,outerRadius:U,key:x.key||"polar-grid",radialLines:_})}),Oe(S,"renderLegend",function(){var x=S.state.formattedGraphicalItems,E=S.props,_=E.children,C=E.width,T=E.height,L=S.props.margin||{},M=C-(L.left||0)-(L.right||0),B=aP({children:_,formattedGraphicalItems:x,legendWidth:M,legendContent:u});if(!B)return null;var I=B.item,F=oE(B,hie);return N.cloneElement(I,Q(Q({},F),{},{chartWidth:C,chartHeight:T,margin:L,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Oe(S,"renderTooltip",function(){var x,E=S.props,_=E.children,C=E.accessibilityLayer,T=Zn(_,pn);if(!T)return null;var L=S.state,M=L.isTooltipActive,B=L.activeCoordinate,I=L.activePayload,F=L.activeLabel,z=L.offset,R=(x=T.props.active)!==null&&x!==void 0?x:M;return N.cloneElement(T,{viewBox:Q(Q({},z),{},{x:z.left,y:z.top}),active:R,label:F,payload:R?I:[],coordinate:B,accessibilityLayer:C})}),Oe(S,"renderBrush",function(x){var E=S.props,_=E.margin,C=E.data,T=S.state,L=T.offset,M=T.dataStartIndex,B=T.dataEndIndex,I=T.updateId;return N.cloneElement(x,{key:x.key||"_recharts-brush",onChange:Nd(S.handleBrushChange,x.props.onChange),data:C,x:de(x.props.x)?x.props.x:L.left,y:de(x.props.y)?x.props.y:L.top+L.height+L.brushBottom-(_.bottom||0),width:de(x.props.width)?x.props.width:L.width,startIndex:M,endIndex:B,updateId:"brush-".concat(I)})}),Oe(S,"renderReferenceElement",function(x,E,_){if(!x)return null;var C=S,T=C.clipPathId,L=S.state,M=L.xAxisMap,B=L.yAxisMap,I=L.offset,F=x.type.defaultProps||{},z=x.props,R=z.xAxisId,O=R===void 0?F.xAxisId:R,U=z.yAxisId,A=U===void 0?F.yAxisId:U;return N.cloneElement(x,{key:x.key||"".concat(E,"-").concat(_),xAxis:M[O],yAxis:B[A],viewBox:{x:I.left,y:I.top,width:I.width,height:I.height},clipPathId:T})}),Oe(S,"renderActivePoints",function(x){var E=x.item,_=x.activePoint,C=x.basePoint,T=x.childIndex,L=x.isRange,M=[],B=E.props.key,I=E.item.type.defaultProps!==void 0?Q(Q({},E.item.type.defaultProps),E.item.props):E.item.props,F=I.activeDot,z=I.dataKey,R=Q(Q({index:T,dataKey:z,cx:_.x,cy:_.y,r:4,fill:y0(E.item),strokeWidth:2,stroke:"#fff",payload:_.payload,value:_.value},Ke(F,!1)),Pf(F));return M.push(y.renderActiveDot(F,R,"".concat(B,"-activePoint-").concat(T))),C?M.push(y.renderActiveDot(F,Q(Q({},R),{},{cx:C.x,cy:C.y}),"".concat(B,"-basePoint-").concat(T))):L&&M.push(null),M}),Oe(S,"renderGraphicChild",function(x,E,_){var C=S.filterFormatItem(x,E,_);if(!C)return null;var T=S.getTooltipEventType(),L=S.state,M=L.isTooltipActive,B=L.tooltipAxis,I=L.activeTooltipIndex,F=L.activeLabel,z=S.props.children,R=Zn(z,pn),O=C.props,U=O.points,A=O.isRange,Z=O.baseLine,$=C.item.type.defaultProps!==void 0?Q(Q({},C.item.type.defaultProps),C.item.props):C.item.props,P=$.activeDot,oe=$.hide,be=$.activeBar,pe=$.activeShape,Ce=!!(!oe&&M&&R&&(P||be||pe)),G={};T!=="axis"&&R&&R.props.trigger==="click"?G={onClick:Nd(S.handleItemMouseEnter,x.props.onClick)}:T!=="axis"&&(G={onMouseLeave:Nd(S.handleItemMouseLeave,x.props.onMouseLeave),onMouseEnter:Nd(S.handleItemMouseEnter,x.props.onMouseEnter)});var Y=N.cloneElement(x,Q(Q({},C.props),G));function ae(qe){return typeof B.dataKey=="function"?B.dataKey(qe.payload):null}if(Ce)if(I>=0){var le,X;if(B.dataKey&&!B.allowDuplicatedCategory){var je=typeof B.dataKey=="function"?ae:"payload.".concat(B.dataKey.toString());le=Fy(U,je,F),X=A&&Z&&Fy(Z,je,F)}else le=U==null?void 0:U[I],X=A&&Z&&Z[I];if(pe||be){var Ne=x.props.activeIndex!==void 0?x.props.activeIndex:I;return[N.cloneElement(x,Q(Q(Q({},C.props),G),{},{activeIndex:Ne})),null,null]}if(!Ye(le))return[Y].concat(Yo(S.renderActivePoints({item:C,activePoint:le,basePoint:X,childIndex:I,isRange:A})))}else{var _e,ge=(_e=S.getItemByXY(S.state.activeCoordinate))!==null&&_e!==void 0?_e:{graphicalItem:Y},$e=ge.graphicalItem,fe=$e.item,et=fe===void 0?x:fe,De=$e.childIndex,Ee=Q(Q(Q({},C.props),G),{},{activeIndex:De});return[N.cloneElement(et,Ee),null,null]}return A?[Y,null,null]:[Y,null]}),Oe(S,"renderCustomized",function(x,E,_){return N.cloneElement(x,Q(Q({key:"recharts-customized-".concat(_)},S.props),S.state))}),Oe(S,"renderMap",{CartesianGrid:{handler:Cd,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:Cd},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:Cd},YAxis:{handler:Cd},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((w=b.id)!==null&&w!==void 0?w:wp("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=sO(S.triggeredAfterMouseMove,(k=b.throttleDelay)!==null&&k!==void 0?k:1e3/60),S.state={},S}return Eie(y,v),wie(y,[{key:"componentDidMount",value:function(){var w,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w: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 w=this.props,k=w.children,S=w.data,x=w.height,E=w.layout,_=Zn(k,pn);if(_){var C=_.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,L=lb(this.state,S,C,T),M=this.state.tooltipTicks[C].coordinate,B=(this.state.offset.top+x)/2,I=E==="horizontal",F=I?{x:M,y:B}:{y:M,x:B},z=this.state.formattedGraphicalItems.find(function(O){var U=O.item;return U.type.name==="Scatter"});z&&(F=Q(Q({},F),z.props.points[C].tooltipPosition),L=z.props.points[C].tooltipPayload);var R={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:T,activePayload:L,activeCoordinate:F};this.setState(R),this.renderCursor(_),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var S,x;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0}})}return null}},{key:"componentDidUpdate",value:function(w){Wy([Zn(w.children,pn)],[Zn(this.props.children,pn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Zn(this.props.children,pn);if(w&&typeof w.props.shared=="boolean"){var k=w.props.shared?"axis":"item";return l.indexOf(k)>=0?k:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var k=this.container,S=k.getBoundingClientRect(),x=Cq(S),E={chartX:Math.round(w.pageX-x.left),chartY:Math.round(w.pageY-x.top)},_=S.width/k.offsetWidth||1,C=this.inRange(E.chartX,E.chartY,_);if(!C)return null;var T=this.state,L=T.xAxisMap,M=T.yAxisMap,B=this.getTooltipEventType(),I=cE(this.state,this.props.data,this.props.layout,C);if(B!=="axis"&&L&&M){var F=Ki(L).scale,z=Ki(M).scale,R=F&&F.invert?F.invert(E.chartX):null,O=z&&z.invert?z.invert(E.chartY):null;return Q(Q({},E),{},{xValue:R,yValue:O},I)}return I?Q(Q({},E),I):null}},{key:"inRange",value:function(w,k){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,x=this.props.layout,E=w/S,_=k/S;if(x==="horizontal"||x==="vertical"){var C=this.state.offset,T=E>=C.left&&E<=C.left+C.width&&_>=C.top&&_<=C.top+C.height;return T?{x:E,y:_}:null}var L=this.state,M=L.angleAxisMap,B=L.radiusAxisMap;if(M&&B){var I=Ki(M);return Yk({x:E,y:_},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,k=this.getTooltipEventType(),S=Zn(w,pn),x={};S&&k==="axis"&&(S.props.trigger==="click"?x={onClick:this.handleClick}:x={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 E=Pf(this.props,this.handleOuterEvent);return Q(Q({},E),x)}},{key:"addListener",value:function(){ug.on(dg,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){ug.removeListener(dg,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,k,S){for(var x=this.state.formattedGraphicalItems,E=0,_=x.length;E<_;E++){var C=x[E];if(C.item===w||C.props.key===w.key||k===wi(C.item.type)&&S===C.childIndex)return C}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,k=this.state.offset,S=k.left,x=k.top,E=k.height,_=k.width;return H.createElement("defs",null,H.createElement("clipPath",{id:w},H.createElement("rect",{x:S,y:x,height:E,width:_})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(k,S){var x=sE(S,2),E=x[0],_=x[1];return Q(Q({},k),{},Oe({},E,_.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(k,S){var x=sE(S,2),E=x[0],_=x[1];return Q(Q({},k),{},Oe({},E,_.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[w])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(w){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[w])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(w){var k=this.state,S=k.formattedGraphicalItems,x=k.activeItem;if(S&&S.length)for(var E=0,_=S.length;E<_;E++){var C=S[E],T=C.props,L=C.item,M=L.type.defaultProps!==void 0?Q(Q({},L.type.defaultProps),L.props):L.props,B=wi(L.type);if(B==="Bar"){var I=(T.data||[]).find(function(O){return mJ(w,O)});if(I)return{graphicalItem:C,payload:I}}else if(B==="RadialBar"){var F=(T.data||[]).find(function(O){return Yk(w,O)});if(F)return{graphicalItem:C,payload:F}}else if(zp(C,x)||Fp(C,x)||mu(C,x)){var z=vee({graphicalItem:C,activeTooltipItem:x,itemData:M.data}),R=M.activeIndex===void 0?z:M.activeIndex;return{graphicalItem:Q(Q({},C),{},{childIndex:R}),payload:mu(C,x)?M.data[z]:C.props.data[z]}}}return null}},{key:"render",value:function(){var w=this;if(!z1(this))return null;var k=this.props,S=k.children,x=k.className,E=k.width,_=k.height,C=k.style,T=k.compact,L=k.title,M=k.desc,B=oE(k,pie),I=Ke(B,!1);if(T)return H.createElement(GN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement(Gy,lo({},I,{width:E,height:_,title:L,desc:M}),this.renderClipPath(),U1(S,this.renderMap)));if(this.props.accessibilityLayer){var F,z;I.tabIndex=(F=this.props.tabIndex)!==null&&F!==void 0?F:0,I.role=(z=this.props.role)!==null&&z!==void 0?z:"application",I.onKeyDown=function(O){w.accessibilityManager.keyboardEvent(O)},I.onFocus=function(){w.accessibilityManager.focus()}}var R=this.parseEventsOfWrapper();return H.createElement(GN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement("div",lo({className:Ve("recharts-wrapper",x),style:Q({position:"relative",cursor:"default",width:E,height:_},C)},R,{ref:function(U){w.container=U}}),H.createElement(Gy,lo({},I,{width:E,height:_,title:L,desc:M,style:Oie}),this.renderClipPath(),U1(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(N.Component);Oe(g,"displayName",n),Oe(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)),Oe(g,"getDerivedStateFromProps",function(v,y){var b=v.dataKey,w=v.data,k=v.children,S=v.width,x=v.height,E=v.layout,_=v.stackOffset,C=v.margin,T=y.dataStartIndex,L=y.dataEndIndex;if(y.updateId===void 0){var M=uE(v);return Q(Q(Q({},M),{},{updateId:0},p(Q(Q({props:v},M),{},{updateId:0}),y)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:x,prevLayout:E,prevStackOffset:_,prevMargin:C,prevChildren:k})}if(b!==y.prevDataKey||w!==y.prevData||S!==y.prevWidth||x!==y.prevHeight||E!==y.prevLayout||_!==y.prevStackOffset||!yo(C,y.prevMargin)){var B=uE(v),I={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},F=Q(Q({},cE(y,w,E)),{},{updateId:y.updateId+1}),z=Q(Q(Q({},B),I),F);return Q(Q(Q({},z),p(Q({props:v},z),y)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:x,prevLayout:E,prevStackOffset:_,prevMargin:C,prevChildren:k})}if(!Wy(k,y.prevChildren)){var R,O,U,A,Z=Zn(k,zo),$=Z&&(R=(O=Z.props)===null||O===void 0?void 0:O.startIndex)!==null&&R!==void 0?R:T,P=Z&&(U=(A=Z.props)===null||A===void 0?void 0:A.endIndex)!==null&&U!==void 0?U:L,oe=$!==T||P!==L,be=!Ye(w),pe=be&&!oe?y.updateId:y.updateId+1;return Q(Q({updateId:pe},p(Q(Q({props:v},y),{},{updateId:pe,dataStartIndex:$,dataEndIndex:P}),y)),{},{prevChildren:k,dataStartIndex:$,dataEndIndex:P})}return null}),Oe(g,"renderActiveDot",function(v,y,b){var w;return N.isValidElement(v)?w=N.cloneElement(v,y):Le(v)?w=v(y):w=H.createElement(EP,y),H.createElement(Yt,{className:"recharts-active-dot",key:b},w)});var m=N.forwardRef(function(y,b){return H.createElement(g,lo({},y,{ref:b}))});return m.displayName=g.displayName,m},Ua=Fie({chartName:"BarChart",GraphicalChild:hn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Xr},{axisType:"yAxis",AxisComp:Zr}],formatAxisMap:Wte});const Uie=new Intl.NumberFormat("en-US");function gt(e){return Uie.format(e)}function fE(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Bi(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}const Wie={local:"#3fb950",groq:"#58a6ff",gemini:"#bc8cff",nim:"#39d2c0",openrouter:"#d29922"};function Hie({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:fE(t.totalCost),label:"Total Cost"},{icon:"๐",value:Bi(t.totalRequests),label:"API Requests"},{icon:"๐ง ",value:Bi(i.total),label:"Trajectories"},{icon:"๐",value:Bi(n.total),label:"Chat Sessions"},{icon:"๐",value:Bi(r.totalRuns),label:"Benchmark Runs"},{icon:"๐ฆ",value:Bi(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:Bi(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:Bi(((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:Bi(((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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:h=>"$"+h.toFixed(4)}),s.jsx(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:h=>[fE(h),"Cost"]}),s.jsx(hn,{dataKey:"value",radius:[4,4,0,0],children:l.map(h=>s.jsx(Gc,{fill:Wie[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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(hn,{dataKey:"value",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})}):s.jsx("div",{className:"empty-state",children:"No trajectory data yet."})})]})}const hE={planner:"๐","context-gatherer":"๐",writer:"โ๏ธ",reviewer:"๐๏ธ",tester:"๐งช",debugger:"๐",runner:"โถ๏ธ",git:"๐",package:"๐ฆ","github-release":"๐ท๏ธ",security:"๐",orchestrator:"๐ฏ"},pE={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"},hg={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"},mE={pending:{icon:"โณ",label:"Pending"},running:{icon:"โถ๏ธ",label:"Running"},completed:{icon:"โ
",label:"Done"},failed:{icon:"โ",label:"Failed"}},Gie={pending:"#6e7681",running:"#58a6ff",completed:"#3fb950",failed:"#f85149"};function qie(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 Kie(e,t){const n=[],r=new Set,i=qie(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 zi(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 gE(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Vie(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 Yie({runs:e,selectedRunId:t,onSelectRun:n,onScrub:r}){const[i,a]=N.useState(null),o=e.find(E=>E.id===(t??i))??e[0]??null,[l,c]=N.useState(0),[u,d]=N.useState(!1),f=N.useRef(null),h=N.useRef(!1),p=N.useRef(r);N.useEffect(()=>{p.current=r},[r]),N.useEffect(()=>{var E;!o&&e.length>0?a(e[0].id):o&&!e.some(_=>_.id===o.id)&&a(((E=e[0])==null?void 0:E.id)??null)},[e,o]);const{laid:g,total:m}=N.useMemo(()=>Vie((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=N.useMemo(()=>{if(m<=0)return null;const E=v*m;return g.find(_=>E>=_.start*m&&E<(_.start+_.width)*m)||null},[g,v,m]);N.useEffect(()=>{var E;(E=p.current)==null||E.call(p,(y==null?void 0:y.id)??null)},[y==null?void 0:y.id]),N.useEffect(()=>{if(!u)return;const E=setInterval(()=>{c(_=>_+m/2e3*50)},50);return()=>clearInterval(E)},[u,m]),N.useEffect(()=>{u&&m>0&&l>=m&&(d(!1),c(0))},[u,m,l]);const b=N.useCallback(E=>{const _=f.current;if(!_||m<=0)return;const C=_.getBoundingClientRect(),T=C.width||1,L=Math.min(1,Math.max(0,(E-C.left)/T));c(L*m)},[m]),w=E=>{h.current=!0,d(!1),b(E.clientX)};if(N.useEffect(()=>{const E=C=>{h.current&&b(C.clientX)},_=()=>{h.current=!1};return window.addEventListener("pointermove",E),window.addEventListener("pointerup",_),()=>{window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",_)}},[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(E=>E.status==="completed").length,x=o.phases.filter(E=>E.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(E=>s.jsxs("button",{className:`phase-run-chip ${E.id===o.id?"active":""} ${E.id.startsWith("live-")?"live":""}`,onClick:()=>{a(E.id),c(0),d(!1),n==null||n(E.id)},title:E.goal,children:[E.id.startsWith("live-")&&s.jsx("span",{className:"dag-live-dot"}),E.engine&&s.jsx("span",{className:`phase-run-chip-engine phase-run-chip-engine-${E.engine}`,children:E.engine==="loop"?"๐":"โฌก"}),E.goal.length>32?E.goal.slice(0,30)+"โฆ":E.goal,s.jsx("span",{className:"phase-run-chip-time",children:gE(E.startedAt)})]},E.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]}),x>0&&s.jsxs("span",{className:"phase-meta-item phase-meta-bad",children:["โ ",x]}),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:["โฑ ",zi(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:[zi(l)," / ",zi(m)]}),s.jsx("input",{className:"phase-range",type:"range",min:0,max:m||1,step:1,value:Math.min(l,m||1),onChange:E=>{d(!1),c(Number(E.target.value))},"aria-label":"Scrub pipeline timeline"})]}),s.jsxs("div",{className:"phase-track-wrap",children:[s.jsxs("div",{ref:f,className:"phase-track",onPointerDown:w,style:{cursor:"grab"},children:[g.map(E=>{const _=pE[E.agentType]||"#58a6ff",C=Gie[E.status],T=(y==null?void 0:y.id)===E.id;return s.jsxs("button",{className:`phase-block phase-block-${E.status} ${T?"active":""}`,style:{left:`${E.start*100}%`,width:`${Math.max(E.width*100,2)}%`,background:`linear-gradient(180deg, ${_}cc, ${_}66)`,boxShadow:T?`0 0 0 2px ${C}`:void 0},onClick:L=>{L.stopPropagation(),d(!1),c((E.start+E.width/2)*m)},title:`${hg[E.agentType]||E.agentType}: ${E.description}`,children:[s.jsx("span",{className:"phase-block-icon",children:hE[E.agentType]||"โ๏ธ"}),s.jsx("span",{className:"phase-block-label",children:hg[E.agentType]||E.agentType})]},E.id)}),s.jsx("div",{className:"phase-caret",style:{left:`${v*100}%`},onPointerDown:E=>{E.stopPropagation(),w(E)},title:`${zi(l)} elapsed`})]}),s.jsxs("div",{className:"phase-ticks",children:[s.jsx("span",{children:"0"}),s.jsx("span",{children:zi(Math.round(m/2))}),s.jsx("span",{children:zi(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:hE[y.agentType]||"โ๏ธ"}),s.jsx("span",{className:"phase-detail-agent",style:{color:pE[y.agentType]||"#58a6ff"},children:hg[y.agentType]||y.agentType}),s.jsxs("span",{className:`phase-status-badge phase-status-${y.status}`,children:[mE[y.status].icon," ",mE[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?zi(y.dur):`~${zi(y.dur)}`]}),y.startedAt?s.jsxs("span",{children:["๐ ",gE(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 pg(e){return e===void 0?"โ":`$${e.toFixed(5)}`}function yE(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 mg(e){return e===void 0?"โ":e.toLocaleString("en-US")}function Xie({jobs:e}){const t=N.useMemo(()=>e.filter(u=>u.batchStats.length>0),[e]),[n,r]=N.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:[mg(i.tokens)," tokens ยท ",pg(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:mg(u.tokens)}),s.jsx("td",{children:pg(u.costUsd)}),s.jsx("td",{children:yE(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:mg(i.tokens)})}),s.jsx("td",{children:s.jsx("strong",{children:pg(i.costUsd)})}),s.jsx("td",{children:s.jsx("strong",{children:c===void 0?"โ":`~${yE(c)} avg`})})]})]})]})})]})}const vE={planner:"๐","context-gatherer":"๐",writer:"โ๏ธ",reviewer:"๐๏ธ",tester:"๐งช",debugger:"๐",runner:"โถ๏ธ",git:"๐",package:"๐ฆ","github-release":"๐ท๏ธ",security:"๐",orchestrator:"๐ฏ"},gg={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"},Zie={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"}},bE={pending:"โณ Pending",running:"โถ๏ธ Running",completed:"โ
Done",failed:"โ Failed"},Fs={trivial:{icon:"๐ข",color:"#3fb950"},simple:{icon:"๐ต",color:"#58a6ff"},moderate:{icon:"๐ก",color:"#d29922"},complex:{icon:"๐ ",color:"#f0883e"},critical:{icon:"๐ด",color:"#f85149"}},yg={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 Qie(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 w=Math.max(...y.map(k=>u(k.from)))+1;return l.set(v,w),w}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),w=b.indexOf(v),k=b.length,S=k*(r+a)-a,x=g/2-S/2;m.push({...v,x:o+y*(n+i),y:x+w*(r+a),w:n,h:r,step:y,totalInStep:k,indexInStep:w})}return{layoutNodes:m,svgW:p,svgH:g}}function vg(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 xE(e){return e?new Date(e).toLocaleTimeString("en-US",{minute:"2-digit",second:"2-digit"}):""}function Jie({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 eae({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]=N.useState(null),[a,o]=N.useState(null),[l,c]=N.useState(void 0),[u,d]=N.useState(void 0),[f,h]=N.useState(void 0);N.useEffect(()=>J.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=N.useMemo(()=>Kie(p,e==null?void 0:e.pipelineRuns),[p,e==null?void 0:e.pipelineRuns]),b=$=>{o($)},w=!!(p&&(p.nodes.length>0||p.active)),k=y.length>0,S=!!v,x=((Z=e==null?void 0:e.unattendedJobs)==null?void 0:Z.jobs)??[],E=x.some($=>$.batchStats.length>0);if(!w&&!k&&!S&&!E)return s.jsx(Jie,{memoryTotal:n});const{nodes:_,edges:C,pipeline:T,active:L}=p??{nodes:[],edges:[],pipeline:null,active:!1},{layoutNodes:M,svgW:B,svgH:I}=Qie(_,C),F=_.filter($=>$.status==="running").length,z=_.filter($=>$.status==="completed").length,R=_.filter($=>$.status==="failed").length,O=_.filter($=>$.status==="pending").length,U=_.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(Yie,{runs:y,onScrub:b})]}),s.jsx(Xie,{jobs:x}),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:["โฑ ",vg(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(($,P)=>s.jsxs("span",{className:`dag-loop-tool ${$.ok===!1?"dag-loop-tool-error":""}`,title:$.error||`${$.tool}${$.durationMs!==void 0?` ยท ${$.durationMs}ms`:""}`,children:[$.ok===!1?"โ":"โ"," ",$.tool]},`${$.tool}-${P}`))})]}),w&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`dag-status-bar ${L?"active":""}`,children:[s.jsxs("div",{className:"dag-pipeline-name",children:[L&&s.jsx("span",{className:"dag-live-dot"}),T||"Execution Pipeline"]}),s.jsxs("div",{className:"dag-pipeline-meta",children:[L&&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:[U," steps"]}),F>0&&s.jsxs("span",{className:"dag-running-badge",children:["โถ ",F," running"]}),O>0&&s.jsxs("span",{className:"dag-pending-badge",children:["โณ ",O," pending"]}),s.jsxs("span",{className:"dag-completed-badge",children:["โ
",z," done"]}),R>0&&s.jsxs("span",{className:"dag-failed-badge",children:["โ ",R," failed"]})]})]}),s.jsx("div",{className:"dag-container",children:s.jsxs("svg",{width:B,height:I,viewBox:`0 0 ${B} ${I}`,children:[s.jsxs("defs",{children:[C.map($=>s.jsx("marker",{id:`arrow-${$.from}-${$.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-${$.from}-${$.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($=>{const P=M.find(X=>X.id===$.from),oe=M.find(X=>X.id===$.to);if(!P||!oe)return null;const be=P.x+P.w,pe=P.y+P.h/2,Ce=oe.x,G=oe.y+oe.h/2,Y=(be+Ce)/2,ae=oe.status,le=ae==="failed"?"#f85149":ae==="running"?"#58a6ff":ae==="completed"?"#3fb950":"#30363d";return s.jsx("g",{children:s.jsx("path",{d:`M ${be} ${pe} C ${Y} ${pe}, ${Y} ${G}, ${Ce} ${G}`,fill:"none",stroke:le,strokeWidth:ae==="pending"?1.5:2.5,strokeOpacity:ae==="pending"?.3:.8,markerEnd:`url(#arrow-${$.from}-${$.to})`,className:"dag-edge"})},`edge-${$.from}-${$.to}`)}),M.map($=>{const P=Zie[$.status];gg[$.agentType];const oe=vE[$.agentType]||"โ๏ธ",be=yg[$.agentType]||$.agentType,pe=a===$.id,Ce=$.status==="running";return s.jsxs("g",{onClick:()=>o(pe?null:$.id),style:{cursor:"pointer"},className:"dag-node-group",children:[pe&&s.jsx("rect",{x:$.x-4,y:$.y-4,width:$.w+8,height:$.h+8,rx:10,ry:10,fill:"none",stroke:"#58a6ff",strokeWidth:2,strokeOpacity:.5}),s.jsx("rect",{x:$.x,y:$.y,width:$.w,height:$.h,rx:8,ry:8,fill:P.bg,stroke:P.stroke,strokeWidth:Ce?2.5:1.5,strokeOpacity:.9,className:Ce?"dag-node-running":"",filter:Ce?"url(#glow)":void 0}),s.jsxs("text",{x:$.x+10,y:$.y+22,fill:"#e6edf3",fontSize:10,fontWeight:600,children:[oe," ",be]}),s.jsx("text",{x:$.x+$.w-10,y:$.y+22,textAnchor:"end",fill:P.text,fontSize:9,fontWeight:500,children:bE[$.status]}),s.jsx("text",{x:$.x+10,y:$.y+40,fill:"#8b949e",fontSize:9,children:$.description.length>28?$.description.slice(0,26)+"..":$.description}),$.complexity&&Fs[$.complexity]&&s.jsxs("text",{x:$.x+10,y:$.y+54,fill:Fs[$.complexity].color,fontSize:8,fontWeight:600,children:[Fs[$.complexity].icon," ",$.complexity]}),s.jsx("text",{x:$.x+10,y:$.y+56,fill:"#6e7681",fontSize:8,children:vg($.startedAt,$.completedAt)}),s.jsx("text",{x:$.x+$.w-10,y:$.y+56,textAnchor:"end",fill:"#6e7681",fontSize:8,children:xE($.startedAt||$.completedAt)}),($.status==="failed"||pe)&&$.summary&&s.jsx("foreignObject",{x:Math.max(10,$.x-80),y:$.y+$.h+6,width:$.w+160,height:36,children:s.jsx("div",{className:"dag-node-summary",style:{color:$.status==="failed"?"#f85149":"#8b949e",fontSize:"10px",lineHeight:1.4,background:"rgba(13,17,23,0.9)",padding:"4px 8px",borderRadius:"4px",border:`1px solid ${$.status==="failed"?"rgba(248,81,73,0.3)":"rgba(48,54,61,0.5)"}`,maxHeight:"32px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$.summary})})]},`node-${$.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($=>s.jsxs("tr",{className:`dag-row dag-row-${$.status}`,children:[s.jsx("td",{className:"dag-cell-step",children:$.step}),s.jsxs("td",{className:"dag-cell-agent",children:[s.jsx("span",{className:"dag-agent-dot",style:{background:gg[$.agentType]||"#58a6ff"}}),yg[$.agentType]||$.agentType]}),s.jsx("td",{className:"dag-cell-complexity",children:$.complexity&&Fs[$.complexity]?s.jsxs("span",{style:{color:Fs[$.complexity].color,fontSize:12},children:[Fs[$.complexity].icon," ",$.complexity]}):s.jsx("span",{style:{color:"#6e7681",fontSize:12},children:"โ"})}),s.jsx("td",{className:`dag-cell-status dag-status-${$.status}`,children:bE[$.status]}),s.jsx("td",{className:"dag-cell-duration",children:vg($.startedAt,$.completedAt)}),s.jsx("td",{className:"dag-cell-time",children:xE($.startedAt||$.completedAt)}),s.jsx("td",{className:"dag-cell-summary",children:$.summary||$.description||"--"})]},$.id))})]})}),s.jsx("h3",{className:"section-subtitle",children:"Agent Types"}),s.jsxs("div",{className:"dag-legend",children:[Object.entries(vE).map(([$,P])=>s.jsxs("div",{className:"legend-item",children:[s.jsx("span",{className:"legend-dot",style:{background:gg[$]||"#58a6ff"}}),s.jsx("span",{className:"legend-icon",children:P}),s.jsx("span",{className:"legend-label",children:yg[$]||$})]},$)),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 Us(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Kl(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function tae(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function nae({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:Us(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:Kl(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:Kl(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:Us(t.measuredCost)}),s.jsxs("span",{className:"cost-label",children:[Kl(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:Us(t.estimatedCost)}),s.jsxs("span",{className:"cost-label",children:[Kl(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:Us(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:Us(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:tae(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:Us(a.costUsd)}),s.jsxs("span",{className:"request-tokens",children:[Kl(a.totalTokens)," tok"]})]},o))})]})}function rae(e){return e==null?"$0.00":"$"+e.toFixed(6)}function Td(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function iae({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:Td(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:rae(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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Zr,{domain:[0,100],tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"%"}),s.jsx(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Pass Rate"]}),s.jsx(hn,{dataKey:"passRate",radius:[4,4,0,0],children:c.map((u,d)=>s.jsx(Gc,{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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"ms"}),s.jsx(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"ms","Latency"]}),s.jsx(hn,{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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>"$"+u.toFixed(6)}),s.jsx(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>["$"+u.toFixed(6),"Cost"]}),s.jsx(hn,{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:Td(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:Td(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:Td(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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Zr,{domain:[0,100],tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"%"}),s.jsx(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Composite Score"]}),s.jsx(hn,{dataKey:"score",radius:[4,4,0,0],children:l.map((u,d)=>s.jsx(Gc,{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(Fa,{width:"100%",height:260,children:s.jsxs(Ua,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Vi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Xr,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(Zr,{domain:[0,100],tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:u=>u+"%"}),s.jsx(pn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(es,{wrapperStyle:{color:"#8b949e"}}),s.jsx(hn,{dataKey:"completion",name:"Completion",fill:"#3fb950",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(hn,{dataKey:"tests",name:"Tests",fill:"#58a6ff",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(hn,{dataKey:"recovery",name:"Recovery",fill:"#d29922",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(hn,{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)})})]})}const aae={pass:"โ
",warn:"โ ๏ธ",fail:"โ"},sae={pass:"PASS",warn:"WARN",fail:"FAIL"};function mR(e){const t={pass:0,warn:0,fail:0};for(const n of e)t[n.status]!==void 0&&(t[n.status]+=1);return t}function gR(e){const t=[];return e.fail>0&&t.push(`${e.fail} failing`),e.warn>0&&t.push(`${e.warn} warning${e.warn===1?"":"s"}`),e.pass>0&&t.push(`${e.pass} passing`),t.length>0?t.join(" ยท "):"no checks"}function cb({check:e}){return s.jsxs("div",{className:"admin-check-row","data-status":e.status,"data-testid":`check-${e.name}`,children:[s.jsxs("span",{className:`admin-check-badge admin-check-${e.status}`,children:[aae[e.status]," ",sae[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 wE(e){return`${(e*100).toFixed(1)}%`}function Vl(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function oae(e){if(!e)return"never";const t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m ago`:`${Math.floor(r/24)}d ago`}function SE({title:e,blurb:t,checks:n,testId:r}){const i=mR(n);return s.jsxs("section",{style:{marginBottom:18},"data-testid":r,children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[s.jsx("h3",{className:"section-subtitle",style:{margin:0},children:e}),s.jsx("span",{style:{fontSize:12,color:i.fail>0?"#f85149":i.warn>0?"#d29922":"#3fb950"},"data-testid":`${r}-summary`,children:gR(i)})]}),s.jsx("p",{style:{fontSize:11,color:"#8b949e",margin:"4px 0 10px"},children:t}),s.jsx("div",{className:"admin-check-list",children:n.length>0?n.map(a=>s.jsx(cb,{check:a},a.name)):s.jsxs("div",{className:"empty-state",children:["No ",e.toLowerCase()," checks returned."]})})]})}function lae({data:e,connected:t,lastUpdated:n}){const[r,i]=N.useState(null),[a,o]=N.useState(null),[l,c]=N.useState(!1),u=N.useCallback(async()=>{c(!0),o(null);const y=await J.fetchAdminChecks();y?i(y):o("Could not reach the dashboard server, or it is older than this page. Run `nuvira dashboard` to start it."),c(!1)},[]);N.useEffect(()=>{u()},[u]);const d=e==null?void 0:e.health,f=(d==null?void 0:d.agentStats)??null,h=[...(r==null?void 0:r.system)??[],...(r==null?void 0:r.enterprise)??[]],p=mR(h),g=((r==null?void 0:r.providers)??[]).filter(y=>y.configured).length,m=((r==null?void 0:r.providers)??[]).length,v=f?Object.entries(f.agents).map(([y,b])=>({agent:y,...b})).sort((y,b)=>b.totalRuns-y.totalRuns||y.agent.localeCompare(b.agent)):[];return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"โ๏ธ System Health"}),s.jsxs("p",{className:"section-description",style:{fontSize:12,color:"#8b949e",marginBottom:14},children:["The same checks ",s.jsx("code",{children:"nuvira doctor"})," runs, executed on demand โ pass / warn / fail, with the fix for anything that is not passing. The store counters at the bottom are how big the agent's memory files are; they are not a health verdict."]}),s.jsxs("div",{className:"health-grid",style:{marginBottom:18},children:[s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:t?"๐ข":"๐ "}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Live Stream"}),s.jsx("div",{className:"health-value","data-testid":"connection-state",children:t?"โ Connected":"โ Reconnectingโฆ"})]})]}),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:"Last Update"}),s.jsx("div",{className:"health-value",children:n})]})]}),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:"Doctor"}),s.jsx("div",{className:"health-value","data-testid":"doctor-verdict",style:{color:p.fail>0?"#f85149":p.warn>0?"#d29922":"#3fb950"},children:r?gR(p):l?"runningโฆ":"--"})]})]})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:6},children:[s.jsx("h3",{className:"section-subtitle",style:{margin:0},children:"Doctor Checks"}),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:l,onClick:()=>void u(),"data-testid":"run-checks",children:l?"โณ Runningโฆ":"โป Run checks again"}),m>0?s.jsxs("span",{style:{fontSize:11,color:"#8b949e"},children:[g," of ",m," providers configured โ per-provider detail is on the Admin tab"]}):null]}),a?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",style:{marginBottom:12},children:a}):null,!r&&!a?s.jsx("div",{className:"loading-state",children:"Running checksโฆ"}):null,r?s.jsxs(s.Fragment,{children:[s.jsx(SE,{title:"System",blurb:"Runtime, filesystem, configuration and the local model surface.",checks:r.system,testId:"checks-system"}),s.jsx(SE,{title:"Enterprise",blurb:"Governance, audit, RBAC and the controls an operator is accountable for.",checks:r.enterprise,testId:"checks-enterprise"})]}):null,s.jsx("h3",{className:"section-subtitle",children:"Agent Performance"}),f?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"stats-grid",style:{marginBottom:10},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:Vl(f.totalRuns)}),s.jsx("div",{className:"stat-label",children:"Recorded runs"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:wE(f.overallSuccessRate)}),s.jsx("div",{className:"stat-label",children:"Overall success rate"})]})]}),v.length>0?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:18},children:v.map(y=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:12,padding:"4px 0",borderBottom:"1px solid #21262d"},"data-testid":`agent-stats-${y.agent}`,children:[s.jsx("span",{style:{flex:1,color:"#e6edf3"},children:y.agent}),s.jsxs("span",{style:{color:"#8b949e"},children:[Vl(y.totalRuns)," runs"]}),s.jsx("span",{style:{color:y.successRate>=.9?"#3fb950":y.successRate>=.7?"#d29922":"#f85149"},children:wE(y.successRate)}),s.jsx("span",{style:{color:"#8b949e",minWidth:78,textAlign:"right"},children:oae(y.lastRun)})]},y.agent))}):s.jsx("p",{style:{fontSize:11,color:"#8b949e",marginBottom:18},children:"No agent runs recorded yet โ this fills in as agents execute."})]}):s.jsx("p",{style:{fontSize:11,color:"#8b949e",marginBottom:18},children:"No agent-stats file yet. Run a task and the per-agent success rates appear here."}),s.jsx("h3",{className:"section-subtitle",children:"Learning Stores"}),s.jsx("p",{style:{fontSize:11,color:"#8b949e",margin:"4px 0 10px"},children:"What the agent has learned into disk. Sizes, not verdicts."}),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:(d==null?void 0:d.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:Vl(d==null?void 0:d.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:[Vl(d==null?void 0:d.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:[Vl(d==null?void 0:d.vectors)," entries"]})]})]})]}),e?null:s.jsx("p",{style:{fontSize:11,color:"#8b949e",marginTop:10},children:"Waiting for the first data frame from the dashboard server โ the checks above do not depend on it."}),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:"Stream"}),s.jsx("span",{className:"info-value",children:t?"โ Connected":"โ Reconnectingโฆ"})]}),s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Last Updated"}),s.jsx("span",{className:"info-value",children:n})]}),s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Checks run at"}),s.jsx("span",{className:"info-value",children:r!=null&&r.serverTime?new Date(r.serverTime).toLocaleString():"--"})]}),s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Data Directory"}),s.jsx("span",{className:"info-value",children:(d==null?void 0:d.memoryDir)||"~/.buff/memory/"})]})]})]})}const cae=new Set(["local","lmstudio","vllm"]),uae=new Set([]),Oh={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"}},dae=[3,4,5],yR=12e3,kE=[300,700],fae=6e4,hae=5e3;function pae(e){return new Promise(t=>setTimeout(t,e))}async function vR(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{return await fetch(e,{signal:n.signal})}finally{clearTimeout(r)}}function bR(e){return e instanceof TypeError||e instanceof Error&&e.name==="AbortError"}async function mae(e){let t=null,n=!1;for(let r=0;;r++){try{const i=await vR("/api/models",yR);if(!i.ok)t=i.status;else{const a=await ur(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(!bR(i))throw i;n=!0,e==null||e()}if(r>=kE.length)throw new Error(n?"Dashboard server unreachable โ is it still running? Retrying automaticallyโฆ":`Model health endpoint failed (HTTP ${t})`);await pae(kE[r])}}async function gae(e){for(let t=0;;t++)try{const n=await vR("/api/model-registry",yR);return n.ok?await ur(n):null}catch(n){if(!bR(n)||t>=1)return null;e==null||e()}}function yae(e){return e==="available"?"Available":e==="limited"?"Limited":"Unavailable"}function vae(e){return e==="available"?"Ready":e==="limited"?"Limited":"Down"}function xR(e){return{local:"๐ป",groq:"๐ข",nim:"๐ถ",gemini:"๐ท",openrouter:"๐ฃ",openai:"๐ค",anthropic:"๐ฎ",mistral:"๐",cohere:"๐ง ",together:"๐ข",deepinfra:"๐",fireworks:"๐",perplexity:"โ",azure:"๐ต",anyscale:"๐ท",lmstudio:"๐จ",vllm:"โก"}[e]||"๐"}function A0(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 NE({status:e,label:t}){const n=Oh[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 bae({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 xae({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 Od({provider:e}){const[t,n]=N.useState(!1),r=Oh[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(NE,{status:e.overallStatus,label:yae(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:Oh[a.status].dot,marginRight:8}}),a.name]}),s.jsx("td",{style:{padding:"8px 12px"},children:s.jsx(NE,{status:a.status,label:vae(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 wR(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 wae(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 Sae({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 kae({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 ${gt(e)} tokens โ live from the provider's model list (v1.60.x); feeds the router's context preflight`,style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"#0a1e2e",border:"1px solid #58a6ff",color:"#58a6ff"},children:["โณ ",t]})}function Nae({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 Eae({entry:e}){const t=wae(e.status),n=e.remainingTokens>=0?`${gt(e.remainingTokens)} 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(Sae,{rate:e.partialRate??0}),e.partialHistory&&e.partialHistory.length>=2&&s.jsx(Nae,{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(kae,{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?wR(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 _ae({provider:e}){const[t,n]=N.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:xR(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:A0(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(Eae,{entry:i},i.model))})]})})]})}function jae(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 Aae({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"})]})]})]}),jae(e.keyHygiene),e.providers.map(t=>s.jsx(_ae,{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 Cae={chat:"๐ฌ",execute:"โ๏ธ",plan:"๐บ๏ธ",edit:"โ๏ธ",skill:"๐งฉ",learn:"๐",ci:"๐",doctor:"๐ฉบ",probe:"๐ญ","spot-check":"๐งช",telemetry:"๐ก",usage:"๐งฎ"};function Tae(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 Cae[e]||"๐ฏ"}function Pae(e){return e?new Date(e).toLocaleDateString()+" "+new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"โ"}function Za({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 Rae(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 Mae(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 Iae({timeline:e}){const[t,n]=N.useState(()=>Mae(e||[])),[r,i]=N.useState(!1),a=N.useRef(null),o=N.useRef(!1),l=(e==null?void 0:e.length)??0,c=Math.max(0,Math.min(t,l-1));N.useEffect(()=>{n(m=>Math.min(m,Math.max(0,l-1)))},[l]);const u=N.useCallback(m=>{const v=a.current;if(!v||l<=0)return;const y=v.getBoundingClientRect(),b=y.width||1,w=Math.min(1,Math.max(0,(m-y.left)/b));n(Math.min(l-1,Math.floor(w*l)))},[l]),d=m=>{o.current=!0,i(!1),u(m.clientX)};if(N.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]),N.useEffect(()=>{if(!r||l<=1)return;const m=setInterval(()=>{n(v=>Math.min(l-1,v+1))},300);return()=>clearInterval(m)},[r,l]),N.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?Rae(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,w=m.killed/f*56,k=m.transient/f*56,S=(m.partial||0)/f*56,x=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:x?"visible":"hidden",background:y===0?"#21262d":"transparent",height:y===0?4:56,display:"flex",flexDirection:"column-reverse",boxShadow:x?"0 0 0 1.5px #58a6ff":void 0,opacity:y===0?.5:1,transition:"box-shadow 0.15s"},children:[x&&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:w,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:x?"#58a6ff":"#6e7681",marginTop:4,whiteSpace:"nowrap",fontWeight:x?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(Za,{provider:m.provider,model:m.model,reason:m.errorType,killed:!0},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="verified"?s.jsx(Za,{provider:m.provider,model:m.model},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="partial"?s.jsx(Za,{provider:m.provider,model:m.model,reason:m.errorType,partial:!0,streamedChunks:m.streamedChunks},`${m.provider}|${m.model}|${m.outcome}`):s.jsx(Za,{provider:m.provider,model:m.model,reason:m.errorType,transient:!0},`${m.provider}|${m.model}|${m.outcome}`))})]})]})}function $ae({entry:e}){var i,a;const[t,n]=N.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:Tae(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(Za,{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(Za,{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(Za,{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(Iae,{timeline:e.timeline})]})]})}function Lae({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:Pae(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($ae,{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 Pd({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 Dae({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 Bae({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:"}),dae.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 zae({model:e,provider:t}){const n=Oh[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:[xR(t)," ",A0(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 ",wR(e.resetsInMs)]})]})})}function Fae({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)||A0(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(zae,{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 Uae(){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-documentation/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 Wae(){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 Hae(){const[e,t]=N.useState(null),[n,r]=N.useState(null),[i,a]=N.useState(!0),[o,l]=N.useState(null),[c,u]=N.useState(4),[d,f]=N.useState(""),h=N.useRef(!0),p=N.useRef(null),g=N.useRef(!1);function m(){p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h.current&&v()},hae)}async function v(){a(!0),l(null),g.current=!1;try{const[b,w]=await Promise.all([mae(()=>{g.current=!0}),gae(()=>{g.current=!0})]);if(!h.current)return;t(b),r(w),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)}}N.useEffect(()=>{h.current=!0,v();const b=setInterval(v,fae);return()=>{h.current=!1,clearInterval(b),p.current&&clearTimeout(p.current)}},[]);function y(b){const w=[],k=[],S=[],x=[],E={available:0,limited:1,unavailable:2};for(const _ of b.providers)uae.has(_.provider)?S.push(_):cae.has(_.provider)?k.push(_):_.overallStatus==="available"?w.push(_):x.push(_);return w.sort((_,C)=>E[_.overallStatus]-E[C.overallStatus]),k.sort((_,C)=>E[_.overallStatus]-E[C.overallStatus]),S.sort((_,C)=>E[_.overallStatus]-E[C.overallStatus]),x.sort((_,C)=>E[_.overallStatus]-E[C.overallStatus]),{available:w,local:k,speech:S,unavailable:x}}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(bae,{onRefresh:v,loading:i}),s.jsx(Wae,{}),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(xae,{data:e}),(()=>{const{available:b,local:w,speech:k,unavailable:S}=y(e);return s.jsxs(s.Fragment,{children:[s.jsx(Pd,{icon:"โ
",title:"Available Cloud Providers",count:b.length}),b.map(x=>s.jsx(Od,{provider:x},x.provider)),s.jsx(Pd,{icon:"๐ ",title:"Local Providers",count:w.length}),w.map(x=>s.jsx(Od,{provider:x},x.provider)),s.jsx(Pd,{icon:"โ",title:"Unavailable Providers",count:S.length}),S.map(x=>s.jsx(Od,{provider:x},x.provider)),s.jsx(Pd,{icon:"๐๏ธ",title:"Speech / TTS Providers",count:k.length}),k.map(x=>s.jsx(Od,{provider:x},x.provider))]})})(),s.jsx(Dae,{value:d,onChange:f,totalCount:e.providers.reduce((b,w)=>b+w.models.length,0)}),s.jsx(Bae,{value:c,onChange:u}),s.jsx(Fae,{providers:e.providers,colsPerRow:c,searchQuery:d}),n&&s.jsx(Aae,{data:n}),n&&s.jsx(Lae,{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(Uae,{}),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 Gae={local:"๐ป",groq:"๐ข",nim:"๐ถ",gemini:"๐ท",openrouter:"๐ฃ"},qae={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},Kae={trivial:"๐ข",simple:"๐ต",moderate:"๐ก",complex:"๐ ",critical:"๐ด"},SR={trivial:"๐ข trivial",simple:"๐ต simple",moderate:"๐ก moderate",complex:"๐ complex",critical:"๐ด critical"},Vae={chat:"๐ฌ chat",orchestrator:"๐ orchestrator",explain:"๐ explain",benchmark:"๐ benchmark",eval:"๐ฏ eval"},Pa=[{key:"request",icon:"๐ฏ",title:"Request"},{key:"candidates",icon:"โ๏ธ",title:"Candidates"},{key:"exclusions",icon:"๐ซ",title:"Exclusions"},{key:"pick",icon:"โ
",title:"Pick"}],Yae=2400;function bg(e){return Gae[e]||"๐"}function EE(e){return qae[e]||e}function C0(e){return e&&Vae[e]||e||"unknown"}function Xae(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 _E(e){const t=Math.ceil(e/6e4);return t>=60?`${Math.floor(t/60)}h ${t%60}m`:`${t}m`}const Zae=8;function jE(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 ${_E(r.resetsInMs)}`:"quota exhausted โ parked":r&&r.cooldownRemaining>0?`circuit-breaker cooldown โ ${_E(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 Qae(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,Zae)){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:jE(g,e)})),p=(o=d.find(g=>g.provider===c.provider))==null?void 0:o.reason;r.push({id:c.id,label:`${C0(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:jE(g,e)})),p=u[0];r.push({id:`profile-${c.complexity}`,label:`${SR[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 Jae(e,t){switch(e){case"request":return`A ${t.complexity} task arrives${t.source?` from ${C0(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 ese({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 tse({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 nse({routing:e}){const t=N.useMemo(()=>Qae(e),[e]),[n,r]=N.useState(""),[i,a]=N.useState(0),[o,l]=N.useState(!1);if(N.useEffect(()=>{t.length!==0&&(t.some(p=>p.id===n)||(r(t[0].id),a(0)))},[t,n]),N.useEffect(()=>{if(!o||t.length===0)return;const p=setInterval(()=>{a(g=>(g+1)%Pa.length)},Yae);return()=>clearInterval(p)},[o,t.length]),t.length===0)return null;const c=t.find(p=>p.id===n)??t[0],u=Pa[i],d=()=>{a(p=>(p+Pa.length-1)%Pa.length),l(!1)},f=()=>{a(p=>(p+1)%Pa.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(tse,{icon:u.icon,title:`${i+1}. ${u.title}${i>0?` โ ${c.complexity}`:""}`,narration:Jae(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]||"โข"," ",SR[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:C0(c.source)}),c.timestamp&&s.jsx("span",{style:{fontSize:11,color:"#6e7681",marginLeft:"auto"},children:Xae(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:[bg(p.provider)," ",EE(p.provider).split(" ")[0],m&&" ๐"]}),s.jsx(ese,{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:[bg(p.provider)," ",EE(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:[bg(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:xg,children:"โ"}),s.jsx("button",{onClick:h,"aria-label":o?"Pause playback":"Play playback",style:{...xg,minWidth:84,color:o?"#d29922":"#3fb950"},children:o?"โธ Pause":"โถ Play"}),s.jsx("button",{onClick:f,"aria-label":"Next step",style:xg,children:"โถ"}),s.jsx("div",{style:{display:"flex",gap:6,marginLeft:8},children:Pa.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,"/",Pa.length]})]})]})}const xg={background:"#21262d",color:"#e6edf3",border:"1px solid #30363d",borderRadius:8,padding:"6px 12px",fontSize:13,cursor:"pointer",transition:"background 0.15s"},rse={local:"๐ป",groq:"๐ข",nim:"๐ถ",gemini:"๐ท",openrouter:"๐ฃ"},ise={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},kR={trivial:"๐ข",simple:"๐ต",moderate:"๐ก",complex:"๐ ",critical:"๐ด"};function $r(e){return rse[e]||"๐"}function da(e){return ise[e]||e}function Ph(e,t=1){return`${(e*100).toFixed(t)}%`}function ase(e){return`$${e.toFixed(6)}`}function rr({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 T0({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 co(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 sse(){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 ose={chat:"๐ฌ chat",orchestrator:"๐ orchestrator",explain:"๐ explain",benchmark:"๐ benchmark",eval:"๐ฏ eval"},lse={trivial:"๐ข trivial",simple:"๐ต simple",moderate:"๐ก moderate",complex:"๐ complex",critical:"๐ด critical"};function NR(e){return ose[e]||e}function ER(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 AE(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 cse({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 use({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(rr,{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(cse,{label:`${$r(i)} ${da(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:[NR(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 dse({history:e}){return e.length?s.jsx(rr,{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:ER(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:NR(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:[$r(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:lse[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 fse({routing:e}){return e.preference.length?s.jsx(rr,{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:[kR[t.complexity]||"โข"," ",t.complexity]}),s.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:s.jsxs("span",{style:{color:"#3fb950",fontWeight:600},children:[$r(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:[$r(n.provider)," ",da(n.provider).split(" ")[0]]}),s.jsx(T0,{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:co("#1c2128","#6e7681"),children:["๐ฏ fit ",n.capabilityFit,"%"]}),n.costSource==="measured"&&n.costBasis?s.jsxs("span",{style:co("#12291a","#3fb950","#3fb950"),children:["๐ measured ",gt(n.costBasis.inputTokens),"โ",gt(n.costBasis.outputTokens)," tok"]}):s.jsx("span",{style:co("#1c2128","#8b949e"),children:"๐ estimated"}),n.contextUtilization!==void 0&&n.contextWindowTokens!==void 0&&s.jsxs("span",{style:co("#1c2128","#58a6ff","#58a6ff"),children:["โณ ctx ",n.contextUtilization,"% (",gt(n.contextWindowTokens)," tok)"]})]})]},n.provider))})]},t.complexity))})]})})}):null}function hse({routing:e}){return e.providers.length?s.jsx(rr,{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:[$r(t.provider)," ",da(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(T0,{value:t.avgQuality,color:"#58a6ff"}),s.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"#8b949e",width:44,textAlign:"right"},children:Ph(t.avgQuality)})]})}),s.jsx("td",{style:{padding:"10px 12px",color:t.passRate>=.8?"#3fb950":"#d29922"},children:Ph(t.passRate)}),s.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:ase(t.totalCostUsd)})]},t.provider))})]})})}):null}const CE=["trivial","simple","moderate","complex","critical"];function pse(e){return e>=.7?"#3fb950":e>=.45?"#d29922":"#f85149"}function mse({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(rr,{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"}),CE.map(r=>s.jsxs("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:[kR[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:[$r(r)," ",da(r).split(" ")[0]]}),CE.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:pse(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 gse(e,t=1){return`${e>0?"+":""}${(e*100).toFixed(t)}%`}function yse({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 vse({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(rr,{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:gse(i.delta)}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",flex:1},children:i.note}),s.jsx(yse,{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 bse({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(rr,{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:gt(e.recordCount)}),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:$r(r.provider)}),s.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#e6edf3"},children:da(r.provider)}),r.trusted?s.jsxs("span",{style:co("#3fb95026","#238636","#3fb950"),children:["trusted ยท ",r.samples," samples"]}):s.jsxs("span",{style:co("#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 ",Ph(r.winRate,0)]}),s.jsx(T0,{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 xse({routing:e}){return e.bestModels.length?s.jsx(rr,{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:[$r(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:[Ph(t.successRate,0)," success"]})," ยท ",t.runs," run",t.runs!==1?"s":""]})]},`${t.agentType}-${t.model}`))})}):null}function wse({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(rr,{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:gt(t)}),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:gt(e.repoChunks)}),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 โ ",gt(r.originalTokens)," โ ",gt(r.reducedTokens)," 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 Sse({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(rr,{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:gt(t)}),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:gt(i)}),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:gt(a)}),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:[$r(u.provider)," ",da(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:gt(u.tokensConsumed)}),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:AE(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:[$r(u.provider)," ",da(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 ",AE(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:[$r(u.provider)," ",da(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:ER(u.timestamp)})]},`${u.timestamp}-${d}`)})})]})]})}function nf({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 kse({governance:e}){var r,i,a,o,l;if(!e.enabled)return s.jsx(rr,{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(rr,{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(nf,{ok:!c.deny,children:[c.deny?"โ":"โ
"," ",c.label,": ",c.items.join(", ")]},c.label)),n.map(c=>s.jsx(nf,{children:c},c)),t.length===0&&n.length===0&&s.jsx(nf,{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 Nse({rbac:e}){const t=n=>n==="admin"?"#d29922":n==="operator"?"#3fb950":"#8b949e";return s.jsxs(rr,{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(nf,{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 Ese({data:e}){var p,g,m,v,y,b,w,k,S,x;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=!!((w=t==null?void 0:t.ml)!=null&&w.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)||!!((x=t==null?void 0:t.retrieval)!=null&&x.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(sse,{}):s.jsxs(s.Fragment,{children:[a&&t&&s.jsx(nse,{routing:t}),f&&t.governance&&s.jsx(kse,{governance:t.governance}),(t==null?void 0:t.rbac)&&s.jsx(Nse,{rbac:t.rbac}),r&&s.jsx(use,{usage:t.usage}),i&&s.jsx(dse,{history:t.history}),o&&s.jsx(mse,{bandit:t.bandit}),l&&s.jsx(vse,{promotion:t.promotion}),c&&t.ml&&s.jsx(bse,{ml:t.ml}),u&&s.jsx(Sse,{quota:t.quota}),d&&s.jsx(wse,{retrieval:t.retrieval}),s.jsx(fse,{routing:t}),s.jsx(hse,{routing:t}),s.jsx(xse,{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 TE={chat:"๐ฌ",execute:"โ๏ธ",plan:"๐บ๏ธ",edit:"โ๏ธ",skill:"๐งฉ",learn:"๐",ci:"๐",doctor:"๐ฉบ",probe:"๐ญ","spot-check":"๐งช",telemetry:"๐ก",usage:"๐งฎ","ide-chat":"๐ฌ","ide-inline":"โ๏ธ","ide-execute":"โ๏ธ"};function _se(e){return new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Rd(e){return e!==void 0?`${e}ms`:"โ"}function _R(e){return e===0?"#3fb950":e<.2?"#d29922":"#f85149"}function jse({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:gt(n)}),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:_R(n>0?r/n:0)},children:n>0?`${(r/n*100).toFixed(1)}%`:"โ"}),s.jsxs("div",{className:"stat-label",children:["Overall error rate (",gt(r)," 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 Ase({data:e}){const[t,n]=N.useState(""),[r,i]=N.useState("all"),a=e==null?void 0:e.requests,o=N.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(jse,{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:[TE[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:[TE[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:_R(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:Rd((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?Rd(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?Rd(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?Rd(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:_se(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 Cse={local:"๐ป",groq:"๐ข",nim:"๐ถ",gemini:"๐ท",openrouter:"๐ฃ"},Tse={planner:"๐บ๏ธ",writer:"โ๏ธ",reviewer:"๐",tester:"๐งช",debugger:"๐",runner:"๐","context-gatherer":"๐",memory:"๐ง ","self-improver":"๐"};function Ose(e){return Cse[e]||"๐"}function Pse(e){return Tse[e]||"๐ค"}function jR(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 O0(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 yc(e){return e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Rse(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 OE(e){const t=e.filter(n=>n.verdict==="CONFIRMED"&&P0(n).length>0).length;return`${e.length} finding${e.length===1?"":"s"}: ${t} confirmed, ${e.length-t} plausible`}function P0(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function Mse({finding:e}){const t=P0(e),n=e.verdict==="CONFIRMED"&&t.length>0;return s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderLeft:`3px solid ${n?"#238636":"#d29922"}`,borderRadius:8,padding:"8px 12px",marginBottom:8},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[s.jsx("span",{style:{fontSize:13},children:n?"โ
":"๐"}),s.jsx("span",{style:{flex:1,fontSize:12.5,fontWeight:600,color:"#e6edf3"},children:e.claim}),s.jsx("span",{style:{fontSize:9.5,fontWeight:700,letterSpacing:"0.04em",padding:"1px 7px",borderRadius:10,border:"1px solid",color:n?"#3fb950":"#d29922",background:n?"#0d2818":"#3d2c00",borderColor:n?"#238636":"#d29922"},children:n?"CONFIRMED":"PLAUSIBLE"})]}),e.outcome?s.jsx("div",{style:{marginTop:3,fontSize:11.5,color:"#8b949e"},children:e.outcome}):null,t.length>0?s.jsx("ul",{style:{listStyle:"none",margin:"5px 0 0",padding:0},children:t.map((r,i)=>s.jsxs("li",{style:{fontSize:11,color:"#8b949e",marginBottom:3},children:[s.jsx("span",{style:{fontSize:9.5,textTransform:"uppercase",letterSpacing:"0.04em",color:"#58a6ff",marginRight:5},children:r.kind}),s.jsx("span",{style:{color:"#c9d1d9",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.ref}),r.detail?s.jsxs("span",{style:{marginLeft:5},children:["(",r.detail,")"]}):null]},i))}):s.jsx("div",{style:{marginTop:5,fontSize:11,color:"#d29922"},children:"no evidence โ reported as PLAUSIBLE, not verified"}),e.source?s.jsxs("div",{style:{marginTop:4,fontSize:10,color:"#6e7681"},children:["source: ",e.source]}):null]})}function ub({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 Ise(){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 $se({step:e}){const[t,n]=N.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:Pse(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:O0(e.latencyMs)}),s.jsxs("span",{style:{width:86,fontSize:11,color:"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace",textAlign:"right"},children:[yc(e.inputTokens),"โ",yc(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 (",yc(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 Lse({trace:e}){const[t,n]=N.useState(e.steps??null),[r,i]=N.useState(!1);N.useEffect(()=>{if(e.steps){n(e.steps);return}let l=!1;return J.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(ub,{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:["๐ ",jR(e.startedAt)]}),(()=>{const l=Rse(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:["โฑ ",O0(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:["๐งฎ ",yc(e.totalTokens)," tok"]}),e.findings&&e.findings.length>0&&s.jsx("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:`๐ ${OE(e.findings)}`})]}),e.findings&&e.findings.length>0?s.jsxs("div",{style:{marginBottom:12},children:[s.jsx("div",{style:{fontSize:12,color:"#8b949e",marginBottom:6},children:`๐ Findings โ ${OE(e.findings)}`}),e.findings.map((l,c)=>s.jsx(Mse,{finding:l},`finding-${c}`))]}):null,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($se,{step:l},l.seq))]})}function Dse({traces:e}){const[t,n]=N.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(Lse,{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:jR(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:["โฑ ",O0(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:["๐งฎ ",yc(r.totalTokens)," tok"]}),r.findings&&r.findings.length>0&&s.jsx("span",{style:{color:"#d29922"},children:`๐ ${r.findings.filter(o=>o.verdict==="CONFIRMED"&&P0(o).length>0).length}/${r.findings.length} confirmed`}),a&&s.jsxs("span",{children:["๐ค ",a.slice(0,60)]})]})]},r.id)})})}function Bse(){const[e,t]=N.useState(null),[n,r]=N.useState(!1),i=N.useCallback(()=>{J.fetchTraces().then(a=>{a?(t(a),r(!1)):r(!0)})},[]);return N.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(ub,{icon:"โณ",title:"Loadingโฆ",children:s.jsx("div",{style:{color:"#8b949e",fontSize:13},children:"Fetching reasoning tracesโฆ"})}),n&&e===null&&s.jsx(ub,{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(Ise,{}),e!==null&&e.length>0&&s.jsx(Dse,{traces:e})]})}function wg(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function zse({authed:e,role:t}){const[n,r]=N.useState(null),[i,a]=N.useState({}),[o,l]=N.useState(""),[c,u]=N.useState(!1),[d,f]=N.useState(null),[h,p]=N.useState(null),g=e&&(t==="admin"||t==="operator"),m=e&&t==="admin",v=N.useCallback(async()=>{var E,_,C;const S=await J.fetchAdminQuota();if(!S){p("Could not load budget config.");return}p(null),r(S);const x={};for(const T of S.providers){const L=S.quota[T]||{};x[T]={provider:T,tokens:((E=L.tokensPerWindow)==null?void 0:E.toString())??"",requests:((_=L.requestsPerWindow)==null?void 0:_.toString())??"",windowMs:((C=L.windowMs)==null?void 0:C.toString())??""}}a(x),l(S.costUsd===null?"":String(S.costUsd))},[]);N.useEffect(()=>{v()},[v]);const y=(S,x,E)=>{a(_=>({..._,[S]:{..._[S]||{provider:S},[x]:E}}))},b=async()=>{u(!0),f(null);const S={};for(const _ of Object.values(i)){const C={},T=wg(_.tokens),L=wg(_.requests),M=wg(_.windowMs);T!==null&&(C.tokensPerWindow=T),L!==null&&(C.requestsPerWindow=L),M!==null&&(C.windowMs=M),S[_.provider]=Object.keys(C).length>0?C:null}const x={quota:S};if(m)if(o.trim()!==""){const _=Number(o);if(!Number.isFinite(_)||_<0){f({ok:!1,text:"Cost cap must be a non-negative number."}),u(!1);return}x.costUsd=_}else x.costUsd=null;const E=await J.saveAdminQuota(x);u(!1),E.ok?(f({ok:!0,text:"Budget saved โ the quota ledger + auto-router will enforce it."}),v()):f({ok:!1,text:E.error||"Save failed."})},w=S=>{const x=n==null?void 0:n.quota[S];return!!x&&(x.tokensPerWindow!==void 0||x.requestsPerWindow!==void 0||x.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 x,E,_;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:((x=i[S])==null?void 0:x.tokens)??"",onChange:C=>y(S,"tokens",C.target.value)}),s.jsx("input",{className:k(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((E=i[S])==null?void 0:E.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:((_=i[S])==null?void 0:_.windowMs)??"",onChange:C=>y(S,"windowMs",C.target.value)}),s.jsx("span",{className:`admin-role-badge ${w(S)?"admin-role-admin":"admin-role-viewer"}`,children:w(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 Fse={env:"Environment",config:"Config",vault:"Vault",local:"Local (no key)",none:"Not configured"};function Use(){const[e,t]=N.useState(null),[n,r]=N.useState(!0),[i,a]=N.useState(null),[o,l]=N.useState(null),[c,u]=N.useState(!1),[d,f]=N.useState(!1),[h,p]=N.useState(""),[g,m]=N.useState(""),[v,y]=N.useState(null),[b,w]=N.useState(null),[k,S]=N.useState(""),[x,E]=N.useState(""),[_,C]=N.useState(""),[T,L]=N.useState(null),[M,B]=N.useState(!1),[I,F]=N.useState([]),[z,R]=N.useState(null),[O,U]=N.useState(""),[A,Z]=N.useState(""),[$,P]=N.useState("viewer"),[oe,be]=N.useState([]),[pe,Ce]=N.useState({}),[G,Y]=N.useState(null),[ae,le]=N.useState({}),[X,je]=N.useState(""),[Ne,_e]=N.useState(null),[ge,$e]=N.useState(null),fe=N.useCallback(async()=>{r(!0),a(null);const q=await J.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)},[]),et=N.useCallback(async()=>{const q=await J.fetchAdminCatalog();q&&q.length>0&&be(q)},[]),De=N.useCallback(async()=>{const q=await J.fetchAdminUsers();q.ok&&q.users&&F(q.users)},[]);N.useEffect(()=>{let q=!0;return J.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),w(me.user??null),f(me.mustChangePassword===!0),me.authenticated?(fe(),et(),De()):r(!1)}}),()=>{q=!1}},[fe,et,De]);const Ee=v==="admin",qe=()=>{u(!1),l(q=>q&&{...q,authenticated:!1}),L("Session expired โ log in again.")},It=async q=>{q.preventDefault(),B(!0),L(null);const me=await J.adminLogin(k,x);me.ok?(u(!0),l({configured:!0,authenticated:!0}),y(me.role??"admin"),w(me.user??null),S(""),E(""),J.fetchAdminAuthStatus().then(Me=>{Me&&f(Me.mustChangePassword===!0)}),fe(),et(),De()):L(me.error||"Login failed."),B(!1)},On=async q=>{if(q.preventDefault(),B(!0),L(null),x.length<8){L("Password must be at least 8 characters."),B(!1);return}if(x!==_){L("Passwords do not match."),B(!1);return}const me=await J.adminSetup(k,x);me.ok?(u(!0),l({configured:!0,authenticated:!0}),y(me.role??"admin"),w(me.user??null),S(""),E(""),C(""),fe(),et(),De()):L(me.error||"Setup failed."),B(!1)},Qt=async()=>{await J.adminLogout(),u(!1),l(q=>q&&{...q,authenticated:!1}),y(null),w(null),t(null),Ce({}),le({}),F([])},W=async()=>{if(!window.confirm("Stop the running gateway? Channels will stop responding until you restart it with `buff gateway start`."))return;$e("gateway"),_e(null);const q=await J.shutdown("gateway");$e(null),q.ok?_e(q.stopped?"โ
Gateway stopped.":`โน๏ธ ${q.reason||"No running gateway found โ nothing to stop."}`):(_e(`โ ${q.error||"Stop failed."}`),q.unauthorized&&qe())},V=async()=>{window.confirm("Shut down the dashboard? This page will disconnect and the server will exit. Restart with `buff dashboard`.")&&($e("dashboard"),_e("๐ Shutting down the dashboard โ this page will disconnectโฆ"),await J.shutdown("dashboard"),$e(null),_e("โน๏ธ The dashboard server did not stop (see the server terminal). You can also stop it with `buff dashboard stop`."))},ie=async q=>{if(q.preventDefault(),R(null),A.length<8){R("Password must be at least 8 characters.");return}const me=await J.addAdminUser(O,A,$);me.ok?(U(""),Z(""),R("โ
User added"),De()):(R(`โ ${me.error||"Failed to add user"}`),me.unauthorized&&qe())},he=async q=>{if(!window.confirm(`Remove dashboard user '${q}'?`))return;R(null);const me=await J.removeAdminUser(q);me.ok?(R(`โ
Removed ${q}`),De()):(R(`โ ${me.error||"Failed to remove user"}`),me.unauthorized&&qe())},we=(q,me,Me)=>{Ce(Te=>({...Te,[q]:{...Te[q]||{},[me]:Me}}))},He=async q=>{Y(q),le({});const me=pe[q]||{},Me=await J.saveProvider(q,me);Me.ok?(t(Te=>{if(!Te)return Te;const cn=Te.providers.some(zr=>zr.type===q)?Te.providers.map(zr=>zr.type===q&&Me.provider?Me.provider:zr):Me.provider?[...Te.providers,Me.provider]:Te.providers;return{...Te,providers:cn}}),Ce(Te=>{const Hn={...Te};return delete Hn[q],Hn}),le(Te=>({...Te,[q]:"โ
Saved"}))):(le(Te=>({...Te,[q]:`โ ${Me.error||"Save failed"}`})),Me.unauthorized&&qe()),Y(null)},ln=async q=>{if(!window.confirm(`Remove ${q}'s API key and configuration? This cannot be undone.`))return;Y(q),le({});const me=await J.deleteProvider(q);me.ok?me.envSourced?(t(Me=>Me&&{...Me,providers:Me.providers.map(Te=>Te.type===q&&me.provider||Te)}),le(Me=>({...Me,[q]:`โ ๏ธ Key comes from ${me.envVar?`$${me.envVar}`:"an env var"} โ unset it there to remove it (config can't override the env).`}))):(t(Me=>Me&&{...Me,providers:Me.providers.filter(Te=>Te.type!==q)}),Ce(Me=>{const Te={...Me};return delete Te[q],Te})):(le(Me=>({...Me,[q]:`โ ${me.error||"Remove failed"}`})),me.unauthorized&&qe()),Y(null)},Tt=async q=>{Y(q);const me=await J.testProvider(q);le(Me=>{var Te;return{...Me,[q]:me.ok?`โ
Connected โ ${((Te=me.models)==null?void 0:Te.length)??0} model(s) reachable`:`โ ${me.error||"Connection failed"}`}}),Y(null)},Un=()=>{X&&(Ce(q=>({...q,[X]:{}})),je(""))};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?On:It,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:x,onChange:me=>E(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:_,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||!x,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,Me=async Te=>{if(Te.preventDefault(),q||me||!h)return;B(!0),L(null);const Hn=await J.changeAdminPassword(x,h);Hn.ok?(f(!1),E(""),p(""),m(""),fe(),et(),De()):L(Hn.error||"Could not change the password."),B(!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:Me,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Current password"}),s.jsx("input",{type:"password",value:x,onChange:Te=>E(Te.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:Te=>p(Te.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:Te=>m(Te.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||!x||!h||q||me,children:M?"โณ โฆ":"๐ Save new password"})]})]})}const wn=(e==null?void 0:e.system.filter(q=>q.status==="pass").length)??0,Re=(e==null?void 0:e.system.filter(q=>q.status==="warn").length)??0,Wn=(e==null?void 0:e.system.filter(q=>q.status==="fail").length)??0,$t=(e==null?void 0:e.enterprise.filter(q=>q.status==="pass").length)??0,oi=(e==null?void 0:e.enterprise.filter(q=>q.status==="warn").length)??0,Ea=(e==null?void 0:e.enterprise.filter(q=>q.status==="fail").length)??0,sr=(e==null?void 0:e.providers)??[],Jt=q=>{const me=oe.find(Me=>Me.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)"}),Ee||v==="operator"?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void W(),disabled:ge!==null,title:"Stop the running gateway (buff gateway stop)",children:ge==="gateway"?"โณ Stoppingโฆ":"โป Stop gateway"}):null,Ee?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void V(),disabled:ge!==null,title:"Shut down this dashboard server (buff dashboard stop)",children:ge==="dashboard"?"โณ Stoppingโฆ":"๐ Stop dashboard"}):null,s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Qt(),children:"๐ช Log out"})]})]}),Ne?s.jsx("div",{className:"admin-error",children:Ne}):null,Ee?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:wn+$t}),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:Re+oi}),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:Wn+Ea}),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:sr.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(cb,{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(cb,{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:[sr.map(q=>{const me=Jt(q.type),Me=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," ยท ",Fse[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)"}):Ee?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:Me.apiKey??"",onChange:Te=>we(q.type,"apiKey",Te.target.value),autoComplete:"new-password"}):s.jsx("div",{className:"admin-hint",children:q.keyMasked||"โ"})}),s.jsx("td",{children:Ee?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${q.type} base URL`,placeholder:q.baseUrl||"default endpoint",value:Me.baseUrl??"",onChange:Te=>we(q.type,"baseUrl",Te.target.value)}):s.jsx("div",{className:"admin-hint",children:q.baseUrl?q.baseUrl.replace(/^https?:\/\/(?:[^@/]*@)?/,""):"default endpoint"})}),s.jsx("td",{children:Ee?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${q.type} model`,placeholder:q.model||"default model",value:Me.model??"",onChange:Te=>we(q.type,"model",Te.target.value)}):s.jsx("div",{className:"admin-hint",children:q.model||"default model"})}),s.jsx("td",{children:Ee?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 He(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 Tt(q.type),children:"๐ Test"}),s.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:G===q.type,onClick:()=>void ln(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)}),sr.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"admin-empty-cell",children:"No providers configured yet."})}):null]})]})}),Ee&&oe.length>0?s.jsxs("div",{className:"admin-add-provider",children:[s.jsxs("select",{className:"admin-input",value:X,onChange:q=>je(q.target.value),children:[s.jsx("option",{value:"",children:"Add a providerโฆ"}),oe.filter(q=>!sr.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:!X,onClick:Un,children:"โ Add"})]}):null,s.jsx(zse,{authed:c,role:v||"viewer"}),Ee?s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"๐ฅ Dashboard Users (role.manage)"}),s.jsxs("div",{className:"admin-users-list",children:[I.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)),I.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:ie,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:O,onChange:q=>U(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:$,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"})]})]}),z?s.jsx("div",{className:"admin-row-msg",children:z}):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 AR(e){return String(e??"").replace(/\d{3,}/g,t=>t.slice(0,2)+"***")}const Wse={idle:"Not paired",pairing:"โณ Pairingโฆ",paired:"โ
Paired",failed:"โ Pairing failed",cancelled:"โน Cancelled",error:"๐ฅ Pairing error"};function Hse({authed:e,canWrite:t,sessionExpired:n,reveal:r=!1}){const[i,a]=N.useState(null),[o,l]=N.useState({}),[c,u]=N.useState(""),[d,f]=N.useState(!1),[h,p]=N.useState(null),g=N.useRef(null),m=N.useCallback(async()=>{const x=await J.getWhatsAppStatus();x&&(a(x.status),l(x.contacts??{}))},[]);N.useEffect(()=>{if(m(),!e||typeof EventSource>"u")return;const x=J.subscribeWhatsApp({onQr:E=>a(_=>_&&{..._,qr:E,state:"pairing"}),onCode:E=>a(_=>_&&{..._,pairingCode:E}),onStatus:E=>{a(E),(E.state==="paired"||E.state==="failed"||E.state==="error"||E.state==="cancelled")&&f(!1)}});return g.current=x,()=>{x(),g.current=null}},[e,m]);const v=async x=>{f(!0),p(null);const E=await x();if(!E.ok&&E.error&&/Not authenticated|Session expired/i.test(E.error)){n(),f(!1);return}E.ok?(p({kind:"ok",text:"Done."}),await m()):p({kind:"err",text:E.error||"Action failed."}),f(!1)},y=x=>{p(null),v(()=>J.startWhatsAppPair(x?c.trim():void 0)).then(()=>u(""))},b=()=>{p(null),v(()=>J.cancelWhatsAppPair())},w=()=>{window.confirm("Remove the paired WhatsApp session from this machine? You will need to scan a QR to pair again.")&&(p(null),v(()=>J.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:Wse[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:w,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:x=>u(x.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(([x,E])=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:x}),s.jsxs("span",{className:"admin-hint",children:["โ ",r?E:AR(E)]})]},x))}),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 Gse({canWrite:e,sessionExpired:t,mode:n="grid"}){const[r,i]=N.useState(null),[a,o]=N.useState(null),[l,c]=N.useState(null),[u,d]=N.useState(null),[f,h]=N.useState(null),[p,g]=N.useState(0),[m,v]=N.useState({}),[y,b]=N.useState(!1),[w,k]=N.useState(null),S=N.useRef(!0),x=N.useCallback(async()=>{const B=await J.getPlatformConfigs();S.current&&i(B)},[t]);N.useEffect(()=>(x(),()=>{S.current=!1}),[x]);const E=async(B,I)=>{c(B),d(null);const F=await J.setPlatformConfig(B,I);if(S.current){if(c(null),F.unauthorized||F.forbidden){t(F.error);return}d({kind:F.ok?"ok":"err",text:F.ok?"Saved โ transport active.":F.error||"Save failed."}),F.ok&&(o(null),x())}},_=async B=>{if(!window.confirm(`Remove ${B} transport config? Tokens will be deleted from ~/.buff/.env.`))return;c(B),d(null);const I=await J.removePlatformConfig(B);if(S.current){if(c(null),I.unauthorized||I.forbidden){t(I.error);return}d({kind:I.ok?"ok":"err",text:I.ok?"Removed.":I.error||"Remove failed."}),I.ok&&x()}},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=B=>{e&&(h(B),g(0),v(Object.fromEntries(B.envVars.map(I=>[I.varName,I.value]))),k(null))},L=async()=>{if(!f||!e)return;b(!0),k(null);const B=await J.setPlatformConfig(f.platform,m);if(b(!1),B.unauthorized||B.forbidden){t(B.error);return}B.ok?(k({kind:"ok",text:"โ
Token saved! The transport is now active."}),x()):k({kind:"err",text:B.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:B=>B.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((B,I)=>s.jsx("li",{children:B},I))}),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(B=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:B.prompt}),s.jsx("input",{type:B.secret?"password":"text",value:m[B.varName]??"",onChange:I=>v(F=>({...F,[B.varName]:I.target.value})),placeholder:B.secret?"โขโขโขโขโขโขโขโข":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},B.varName)),w?s.jsx("div",{className:`admin-row-msg${w.kind==="ok"?"":" 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:()=>g(0),children:"โ Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void L(),disabled:y||!e,children:y?"โณ Savingโฆ":"๐พ Save token"})]}),(w==null?void 0:w.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((B,I)=>s.jsx("li",{children:B},I))})]}):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(B=>s.jsxs(H.Fragment,{children:[s.jsxs("tr",{className:`platform-config-row ${B.configured?"configured":""}`,children:[s.jsxs("td",{className:"platform-config-name",children:[s.jsx("span",{className:"hub-platform-label",children:B.label}),s.jsx("span",{className:"hub-card-id",children:B.platform})]}),s.jsxs("td",{children:[s.jsx("span",{className:`status-dot ${B.configured?"connected":"reconnecting"}`}),s.jsx("span",{className:"platform-config-status-text",children:B.configured?"Active":"Not configured"})]}),s.jsxs("td",{className:"platform-config-actions",children:[B.configured?null:s.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>T(B),disabled:!e,children:"๐ Getting Started"}),B.setupUrl?s.jsx("a",{href:B.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===B.platform?null:B.platform),disabled:!e,children:a===B.platform?"โด Close":B.configured?"โ Edit":"โ Configure"}),B.configured?s.jsx("button",{type:"button",className:"admin-mini-btn contact-delete-btn",onClick:()=>void _(B.platform),disabled:!e,children:"๐๏ธ"}):null]}),s.jsx("td",{className:"platform-config-cli",children:s.jsxs("code",{children:["buff gateway setup ",B.platform]})})]}),a===B.platform?s.jsx("tr",{className:"platform-config-expanded",children:s.jsx("td",{colSpan:4,children:s.jsxs("div",{className:"platform-config-form",children:[B.envVars.map(I=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:I.prompt}),s.jsx("input",{type:I.secret?"password":"text",value:I.value,readOnly:!0,className:"platform-config-readonly",placeholder:I.secret?"โขโขโขโขโขโขโขโข":"value"})]},I.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]},B.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:B=>B.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((B,I)=>s.jsx("li",{children:B},I))}),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(B=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:B.prompt}),s.jsx("input",{type:B.secret?"password":"text",value:m[B.varName]??"",onChange:I=>v(F=>({...F,[B.varName]:I.target.value})),placeholder:B.secret?"โขโขโขโขโขโขโขโข":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},B.varName)),w?s.jsx("div",{className:`admin-row-msg${w.kind==="ok"?"":" 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:()=>g(0),children:"โ Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void L(),disabled:y||!e,children:y?"โณ Savingโฆ":"๐พ Save token"})]}),(w==null?void 0:w.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((B,I)=>s.jsx("li",{children:B},I))})]}):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(B=>s.jsx(qse,{entry:B,canWrite:e,busy:l===B.platform,expanded:a===B.platform,onToggle:()=>o(a===B.platform?null:B.platform),onSave:I=>void E(B.platform,I),onRemove:()=>void _(B.platform),onStartWizard:()=>T(B)},B.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 qse(e){const{entry:t,canWrite:n,busy:r,expanded:i,onToggle:a,onSave:o,onRemove:l,onStartWizard:c}=e,[u,d]=N.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 Kse=[{id:"tools",label:"Tools",icon:"๐งฐ"},{id:"channels",label:"Channels",icon:"๐ก"},{id:"conversations",label:"Conversations",icon:"๐ฌ"},{id:"artifacts",label:"Artifacts",icon:"๐ฆ"},{id:"skills",label:"Skills",icon:"๐ง "},{id:"subagents",label:"Subagents",icon:"๐ค"}],Vse={pending:"โณ pending",sent:"โ
sent",failed:"โ failed"},Yse=5e3,Xse={spawning:"โณ spawning",running:"โถ running",completed:"โ
completed",failed:"โ failed",timeout:"โฐ timed out",killed:"โ killed"};function Zse(){var Bt,Pn,Nt,Wr,Kn,Se,Fe,ct,At,en,iw,aw,sw,ow,lw;const[e,t]=N.useState("tools"),[n,r]=N.useState(null),[i,a]=N.useState(!0),[o,l]=N.useState(null),[c,u]=N.useState(!1),[d,f]=N.useState(null),[h,p]=N.useState(!1),[g,m]=N.useState(null),[v,y]=N.useState(null),[b,w]=N.useState(""),[k,S]=N.useState(""),[x,E]=N.useState(null),[_,C]=N.useState(!1),[T,L]=N.useState(null),[M,B]=N.useState(null),[I,F]=N.useState({}),[z,R]=N.useState(""),[O,U]=N.useState(""),[A,Z]=N.useState(!1),[$,P]=N.useState(null),[oe,be]=N.useState(!1),[pe,Ce]=N.useState({}),[G,Y]=N.useState(!1),[ae,le]=N.useState(null),[X,je]=N.useState({}),[Ne,_e]=N.useState({}),[ge,$e]=N.useState({}),[fe,et]=N.useState(!1),[De,Ee]=N.useState(null),[qe,It]=N.useState(""),[On,Qt]=N.useState(null),[W,V]=N.useState(!1),[ie,he]=N.useState(new Map),[we,He]=N.useState(new Set),[ln,Tt]=N.useState(!1),[Un,wn]=N.useState([]),[Re,Wn]=N.useState(""),[$t,oi]=N.useState(null),[Ea,sr]=N.useState(""),[Jt,q]=N.useState([]),[me,Me]=N.useState(0),[Te,Hn]=N.useState(0),[cn,zr]=N.useState(!0),[Sn,_s]=N.useState(!1),[vl,Wu]=N.useState(!1),Hu=20,_a=N.useRef(null),li=N.useCallback(async(j=!1)=>{if(Sn)return;const K=j?0:Te;_s(!0);try{const ne=await J.fetchGatewayConversations({offset:K,limit:Hu,q:qe||void 0});ne.ok&&ne.conversations&&(q(re=>j?ne.conversations:[...re,...ne.conversations]),Me(ne.total??0),Hn(K+ne.conversations.length),zr(ne.hasMore??!1))}catch{}_s(!1)},[Sn,Te,qe]);N.useEffect(()=>{e==="conversations"&&!vl&&!Sn&&(Wu(!0),li(!0))},[e,vl,Sn,li]),N.useEffect(()=>{const j=_a.current;if(!j)return;const K=new IntersectionObserver(ne=>{var re;(re=ne[0])!=null&&re.isIntersecting&&cn&&!Sn&&li(!1)},{threshold:.1});return K.observe(j),()=>K.disconnect()},[cn,Sn,li]),N.useEffect(()=>{const j=setTimeout(()=>{e==="conversations"&&vl&&(q([]),Hn(0),zr(!0),li(!0))},300);return()=>clearTimeout(j)},[qe]),N.useEffect(()=>J.onTypingEvent(K=>{he(ne=>{const re=new Map(ne),ue=`${K.platform}:${K.channelId}`;return K.typing?re.set(ue,{platform:K.platform,channelId:K.channelId,startedAt:Date.now()}):re.delete(ue),re})}),[]);const tm=N.useCallback((j,K)=>{K.stopPropagation(),He(ne=>{const re=new Set(ne);return re.has(j)?re.delete(j):re.add(j),re})},[]),nm=N.useCallback(()=>{He(j=>j.size===Jt.length?new Set:new Set(Jt.map(K=>K.key)))},[Jt]),Gu=N.useCallback(async()=>{if(we.size!==0){Tt(!0);try{await J.exportGatewayConversations([...we])}catch{}Tt(!1)}},[we]);N.useEffect(()=>{e==="conversations"&&J.getAllConversationTags().then(j=>{j.ok&&j.tags&&wn(j.tags)})},[e]);const bl=N.useCallback(async(j,K)=>{if(!K.trim())return;(await J.addConversationTag(j,K.trim())).ok&&(q(re=>re.map(ue=>ue.key===j?{...ue,tags:[...ue.tags??[],K.trim().toLowerCase()]}:ue)),wn(re=>re.includes(K.trim().toLowerCase())?re:[...re,K.trim().toLowerCase()].sort())),oi(null),sr("")},[]),xl=N.useCallback(async(j,K)=>{(await J.removeConversationTag(j,K)).ok&&q(re=>re.map(ue=>ue.key===j?{...ue,tags:(ue.tags??[]).filter(Pe=>Pe!==K)}:ue))},[]),wl=N.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 ft of j.messages){const xe=ft.role==="user"?ne:"Agent",Et=new Date(ft.ts).toLocaleString();re.push(`[${Et}] ${xe}:`),re.push(ft.content),re.push("")}const ue=new Blob([re.join(`
|
|
135
|
-
`)],{type:"text/plain;charset=utf-8"}),Pe=URL.createObjectURL(ue),it=document.createElement("a");it.href=Pe,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(Pe)},[]),lt=N.useCallback((j,K)=>{K.stopPropagation();const ne=j.contactName||j.channelId,re=j.messages??[],ue=`<!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 ft=it.role==="user"?"user":"assistant",xe=it.role==="user"?ne:"Agent";return`<div class="msg msg-${ft}">
|
|
158
|
-
<div class="bubble bubble-${ft}">${it.content.replace(/</g,"<").replace(/>/g,">")}</div>
|
|
159
|
-
<div class="timestamp">${xe} ยท ${new Date(it.ts).toLocaleString()}</div>
|
|
160
|
-
</div>`}).join(`
|
|
161
|
-
`)}
|
|
162
|
-
</body>
|
|
163
|
-
</html>`,Pe=window.open("","_blank");Pe&&(Pe.document.write(ue),Pe.document.close(),setTimeout(()=>Pe.print(),300))},[]);N.useEffect(()=>{var K;const j=(K=n==null?void 0:n.conversations)==null?void 0:K.recent;!j||j.length===0||vl&&(Te>Hu||qe||q(ne=>{const re=new Set(ne.map(xe=>xe.key)),ue=j.map(xe=>({...xe})),Pe=new Map(ne.map(xe=>[xe.key,xe]));for(const xe of ue)Pe.has(xe.key)&&Pe.set(xe.key,xe);const ft=[...ue.filter(xe=>!re.has(xe.key)),...Pe.values()];return ft.sort((xe,Et)=>Et.lastActiveAt-xe.lastActiveAt),ft}))},[(Bt=n==null?void 0:n.conversations)==null?void 0:Bt.recent]);const[ja,js]=N.useState(""),[Lt,Aa]=N.useState([]),[Ca,qu]=N.useState(!1),[Sl,As]=N.useState(!1),[ci,Gn]=N.useState(null),[Cs,Ts]=N.useState(null),[Ku,Vu]=N.useState({}),[ui,kl]=N.useState([]),[Fr,qn]=N.useState([]),[di,Os]=N.useState(""),kr=j=>fe?String(j??""):AR(j),rm=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}`},Dt=j=>{const K=rm(j.channelId);return j.contactName?{name:j.contactName,phone:K}:{name:K||kr(j.channelId),phone:""}},Ps=N.useCallback(j=>{var K,ne;r(j),(K=j==null?void 0:j.channels)!=null&&K.statusRecipients&&qn(j.channels.statusRecipients),(ne=j==null?void 0:j.channels)!=null&&ne.contacts&&kl(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)},[]),Ur=N.useCallback(async()=>{u(!0),l(null),Ps(await J.fetchHub()),u(!1)},[Ps]);N.useEffect(()=>{Ur(),J.fetchAdminAuthStatus().then(j=>{j&&(f({configured:j.configured,authenticated:j.authenticated}),p(j.authenticated),m(j.role??null),y(j.user??null))})},[Ur]);const Nl=((Pn=n==null?void 0:n.subagents)==null?void 0:Pn.running)??0;N.useEffect(()=>{if(Nl===0)return;const j=setInterval(()=>{J.fetchHub().then(K=>{K&&Ps(K)})},Yse);return()=>clearInterval(j)},[Nl,Ps]);const qt=h&&(g==="admin"||g==="operator"),Yu=async j=>{j==null||j.preventDefault();const K=ja.trim();if(!K)return;As(!0),Gn(null);const ne=await J.marketplaceSearch(K);Aa(ne),qu(!0),As(!1)},im=async j=>{if(!h){Gn({kind:"err",text:"๐ Log in (or set up admin access) to install skills."});return}if(!qt){Gn({kind:"err",text:"Your role cannot install skills โ admin or operator only."});return}Ts(j),Gn(null);const K=await J.marketplaceInstall(j);K.ok?(Gn({kind:"ok",text:`โ
Installed ${j} (quarantine checked) โ it appears in the Skills list and loads via the skill tool next turn.`}),Ur()):Gn({kind:"err",text:K.quarantined?`โ ${K.error||"checksum mismatch โ quarantined"}`:`โ ${K.error||"Install failed."}`}),Ts(null)},am=async j=>{if(!h){Gn({kind:"err",text:"๐ Log in (or set up admin access) to uninstall skills."});return}if(!qt){Gn({kind:"err",text:"Your role cannot uninstall skills โ admin or operator only."});return}Ts(j),Gn(null);const K=await J.marketplaceUninstall(j);K.ok?(Gn({kind:"ok",text:`๐๏ธ Uninstalled ${j} โ removed from .agents/skills/ and provenance.`}),Ur()):Gn({kind:"err",text:`โ ${K.error||"Uninstall failed."}`}),Ts(null)},Ta=()=>{p(!1),f(j=>j&&{...j,authenticated:!1}),E("Session expired โ log in again to toggle capabilities.")},Xu=async j=>{j.preventDefault(),C(!0),E(null);const K=await J.adminLogin(b,k);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),y(K.user??null),w(""),S("");const ne=T;L(null),ne&&await Rs(ne.kind,ne.name,ne.enabled)}else E(K.error||"Login failed.");C(!1)},sm=async j=>{if(j.preventDefault(),C(!0),E(null),k.length<8){E("Password must be at least 8 characters."),C(!1);return}const K=await J.adminSetup(b,k);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),y(K.user??null),w(""),S("");const ne=T;L(null),ne&&await Rs(ne.kind,ne.name,ne.enabled)}else E(K.error||"Setup failed.");C(!1)},Li=async()=>{await J.adminLogout(),p(!1),f(j=>j&&{...j,authenticated:!1}),m(null),y(null)},Rs=async(j,K,ne)=>{B(K);const re=j==="skill"?await J.setSkillEnabled(K,ne):await J.setToolsetEnabled(K,ne);re.ok?(F(ue=>({...ue,[K]:`โ
${ne?"Enabled":"Disabled"} โ live for new agent runs`})),Ur()):re.unauthorized?Ta():(F(ue=>({...ue,[K]:`โ ${re.error||"Toggle failed"}`})),re.forbidden&&E(re.error||"Your role cannot change capabilities.")),B(null)},om=(j,K)=>{if(!h){L({kind:"toolset",name:j,enabled:K});return}Rs("toolset",j,K)},Zu=(j,K)=>{if(!h){L({kind:"skill",name:j,enabled:K});return}Rs("skill",j,K)},lm=async j=>{if(j.preventDefault(),!h){P({kind:"err",text:"๐ Log in (or set up admin access) to send test messages."});return}if(!qt){P({kind:"err",text:"๐ Your role cannot send channel messages โ requires the admin or operator role."});return}Z(!0),P(null);const K=await J.sendChannelMessage(z.trim(),O);K.ok?(P({kind:"ok",text:`โ
Sent to ${z.trim()} (${K.platform}:${kr(K.channelId??"")})`}),U("")):K.unauthorized?(Ta(),P({kind:"err",text:K.error||"Session expired โ log in again."})):P({kind:"err",text:K.error||"Send failed."}),Z(!1)},El=(j,K)=>{var re,ue;return(((ue=(re=n==null?void 0:n.channels)==null?void 0:re.policies)==null?void 0:ue[j])??{})[K]??[]},_l=j=>j==="user"?"allowedUsers":j==="group"?"allowedGroups":"outboundSenders",Ms=(j,K,ne)=>{const re=ne.trim();re&&Ce(ue=>{var Et;const Pe={...ue[j]??{}},it=_l(K),xe=[...((Et=ue[j])==null?void 0:Et[it])??El(j,it)];return xe.includes(re)||xe.push(re),Pe[it]=xe,{...ue,[j]:Pe}})},Is=(j,K,ne)=>{Ce(re=>{var Et;const ue=_l(K),Pe=El(j,ue),ft=(((Et=re[j])==null?void 0:Et[ue])??Pe).filter(Al=>Al!==ne);if(ft.length===0&&Pe.length===0){const Al={...re[j]??{}};delete Al[ue];const cm={...re};return Object.keys(Al).length===0?delete cm[j]:cm[j]=Al,cm}const xe={...re[j]??{}};return xe[ue]=ft,{...re,[j]:xe}})},jl=(j,K)=>{const ne=j.trim().toLowerCase(),re=K.trim().toLowerCase();if(ne==="*"||re==="*"||ne===re)return!0;const ue=ne.replace(/\D+/g,""),Pe=re.replace(/\D+/g,"");return ue.length>0&&ue===Pe},Qu=j=>{const K=(Ku[j]??"").trim(),ne=(X[j]??"").trim();ne&&(Ms(j,"user",ne),K&&kl(re=>[...re.filter(Pe=>!(Pe.platform===j&&(jl(Pe.id,ne)||Pe.name.toLowerCase()===K.toLowerCase()))),{name:K,platform:j,id:ne,addedAt:Date.now()}]),je(re=>({...re,[j]:""})),Vu(re=>({...re,[j]:""})))},D=(j,K)=>{Is(j,"user",K),kl(ne=>ne.filter(re=>!(re.platform===j&&jl(re.id,K))))},te=(j,K)=>{Ce(ne=>{const re={...ne[j]??{}};return K==="silentDrop"?re.silentDrop=re.silentDrop===!1:re[K]?delete re[K]:re[K]=!0,{...ne,[j]:re}})},ee=Object.keys(pe).length>0||ui.length!==(((Wr=(Nt=n==null?void 0:n.channels)==null?void 0:Nt.contacts)==null?void 0:Wr.length)??0)||ui.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})||Fr.length!==(((Se=(Kn=n==null?void 0:n.channels)==null?void 0:Kn.statusRecipients)==null?void 0:Se.length)??0)||Fr.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])}),ke=async()=>{var K;if(!h){le({kind:"err",text:"๐ Log in (or set up admin access) to change permissions."});return}if(!qt){le({kind:"err",text:"๐ Your role cannot change permissions โ requires the admin or operator role."});return}Y(!0),le(null);const j=await J.saveGatewayPolicies(pe,Fr,ui);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}`}),Ce({}),Ur()}else j.unauthorized?(Ta(),le({kind:"err",text:j.error||"Session expired โ log in again."})):le({kind:"err",text:j.error||"Failed to save permissions."});Y(!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 Nr=!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 Ur(),disabled:c,children:c?"โณ Refreshingโฆ":"๐ Refresh"}),h?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Li(),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,Nr?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?Xu:sm,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:b,onChange:j=>w(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:"โขโขโขโขโขโขโขโข"})]}),x?s.jsx("div",{className:"admin-error",children:x}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:_||!b||!k,children:_?"โณ โฆ":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,!Nr&&!qt&&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:Kse.map(j=>{var ne,re,ue;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):"":j.id==="subagents"?n?`${((re=n.subagents)==null?void 0:re.running)??0}/${((ue=n.subagents)==null?void 0:ue.total)??0}`:"":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&&!qt,onClick:()=>om(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)"})}),I[j.name]?s.jsx("div",{className:"admin-row-msg",children:I[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=>et(j.target.checked),disabled:!qt}),"Show full sender ids ",s.jsx("span",{className:"admin-hint",children:"(masks phone numbers by default)"})]}),qt?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:kr(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:Vse[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:kr(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,j.handled==="attachment_failed"?160: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 ยท"," ",n.channels.inbox.attachmentFailed??0," attachment(s) could not be read."]}),s.jsx("h3",{className:"section-subtitle",children:"๐ Platform transports"}),s.jsx(Gse,{canWrite:qt,sessionExpired:Ta,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,":",kr(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>"}),"."]}),ee?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 ke(),children:G?"โณ Savingโฆ":"๐พ Save permissions"})]}):null,s.jsx("div",{style:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:8,marginBottom:8},onClick:()=>be(!oe),children:s.jsxs("h3",{className:"section-subtitle",style:{margin:0},children:[oe?"โผ":"โถ"," ๐ Permissions โ who can TRIGGER the agent"]})}),s.jsxs("p",{className:"admin-hint",style:{marginBottom:oe?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 ",oe?"collapse":"expand"," and manage permissions."]}),oe?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(ue=>{var it,ft,xe,Et;const Pe=(((it=pe[j.platform])==null?void 0:it.allowedUsers)??[]).includes(ue)&&!(((Et=(xe=(ft=n==null?void 0:n.channels)==null?void 0:ft.policies)==null?void 0:xe[j.platform])==null?void 0:Et.allowedUsers)??[]).includes(ue);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Pe?" hub-chip-pending":""}`,title:Pe?"Not saved yet โ press ๐พ Save permissions":void 0,children:[kr(ue),Pe?" ยท unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>D(j.platform,ue),children:"โ"})]},`u-${ue}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:Ku[j.platform]??"",onChange:ue=>Vu(Pe=>({...Pe,[j.platform]:ue.target.value})),placeholder:"Name (optional)",disabled:G}),s.jsx("input",{type:"text",value:X[j.platform]??"",onChange:ue=>je(Pe=>({...Pe,[j.platform]:ue.target.value})),placeholder:"Contact no / sender id, or Allow-All",disabled:G}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!(X[j.platform]??"").trim(),onClick:()=>Qu(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(ue=>{var it,ft,xe,Et;const Pe=(((it=pe[j.platform])==null?void 0:it.allowedGroups)??[]).includes(ue)&&!(((Et=(xe=(ft=n==null?void 0:n.channels)==null?void 0:ft.policies)==null?void 0:xe[j.platform])==null?void 0:Et.allowedGroups)??[]).includes(ue);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Pe?" hub-chip-pending":""}`,title:Pe?"Not saved yet โ press ๐พ Save permissions":void 0,children:[ue,Pe?" ยท unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>Is(j.platform,"group",ue),children:"โ"})]},`g-${ue}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:Ne[j.platform]??"",onChange:ue=>_e(Pe=>({...Pe,[j.platform]:ue.target.value})),placeholder:"group id, e.g. 1203630283471234@g.us",disabled:G}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!(Ne[j.platform]??"").trim(),onClick:()=>{Ms(j.platform,"group",Ne[j.platform]??""),_e(ue=>({...ue,[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(ue=>{var it,ft,xe,Et;const Pe=(((it=pe[j.platform])==null?void 0:it.outboundSenders)??[]).includes(ue)&&!(((Et=(xe=(ft=n==null?void 0:n.channels)==null?void 0:ft.policies)==null?void 0:xe[j.platform])==null?void 0:Et.outboundSenders)??[]).includes(ue);return s.jsxs("div",{className:"hub-alias-row",children:[s.jsxs("span",{className:`hub-chip${Pe?" hub-chip-pending":""}`,title:Pe?"Not saved yet โ press ๐พ Save permissions":void 0,children:[kr(ue),Pe?" ยท unsaved":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>Is(j.platform,"send",ue),children:"โ"})]},`s-${ue}`)})}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:ge[j.platform]??"",onChange:ue=>$e(Pe=>({...Pe,[j.platform]:ue.target.value})),placeholder:"sender id, or Allow-All",disabled:G}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!(ge[j.platform]??"").trim(),onClick:()=>{Ms(j.platform,"send",ge[j.platform]??""),$e(ue=>({...ue,[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:()=>te(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:()=>te(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:()=>te(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:()=>te(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=ui.filter(re=>re.status==="pending").length,K=ui.filter(re=>re.status==="approved").length,ne=ui.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"}),"."]}),Fr.length>0?s.jsx("div",{className:"hub-alias-list",children:Fr.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:()=>qn(re=>re.filter(ue=>ue!==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:di,onChange:j=>Os(j.target.value),placeholder:"whatsapp:Name or whatsapp:+91***",disabled:G,maxLength:128}),s.jsx("button",{className:"admin-refresh-btn",disabled:G||!di.trim()||Fr.includes(di.trim()),onClick:()=>{qn(j=>[...j,di.trim()]),Os("")},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 ke(),children:G?"โณ Savingโฆ":"๐พ Save permissions"}),Object.keys(pe).length>0?s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:G,onClick:()=>Ce({}),children:"Discard draft"}):null]}),ae?s.jsx("div",{className:`admin-row-msg${ae.kind==="err"?" 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 lm(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:z,onChange:j=>R(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=>U(j.target.value),placeholder:"nightly build done ๐",disabled:A,maxLength:4e3})]}),s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:A||!z.trim()||!O,children:A?"โณ Sendingโฆ":"๐ค Send test message"})]}),$?s.jsx("div",{className:`admin-row-msg${$.kind==="ok"?"":" admin-row-msg-err"}`,children:$.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(Hse,{authed:h,canWrite:qt,sessionExpired:Ta,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:((Fe=n.conversations)==null?void 0:Fe.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"})]})]}),((ct=n.conversations)==null?void 0:ct.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 ue;const ne=((ue=n.conversations.analytics.topContacts[0])==null?void 0:ue.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(ue=>ue.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(ue=>ue.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:(At=n.conversations.analytics.dailyVolume[0])==null?void 0:At.date}),s.jsx("span",{children:(en=n.conversations.analytics.dailyVolume[n.conversations.analytics.dailyVolume.length-1])==null?void 0:en.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||Sn?s.jsxs(s.Fragment,{children:[Un.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:"}),Un.map(j=>s.jsxs("button",{type:"button",onClick:()=>Wn(Re===j?"":j),style:{padding:"2px 10px",borderRadius:12,fontSize:11,cursor:"pointer",border:`1px solid ${Re===j?"#3b82f6":"var(--border)"}`,background:Re===j?"#3b82f620":"transparent",color:Re===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:qe,onChange:j=>It(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",qe?` matching "${qe}"`:""]}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:nm,style:{fontSize:12,padding:"4px 10px"},children:we.size===Jt.length?"โ Deselect All":"โ Select All"}),we.size>0&&s.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:ln,onClick:()=>void Gu(),style:{fontSize:12,padding:"4px 10px",background:"#3b82f6",color:"#fff",border:"none"},children:ln?"โณ Exportingโฆ":`๐ฆ Export ${we.size} as ZIP`})]}),s.jsxs("div",{className:"hub-session-list",children:[Jt.filter(j=>!Re||(j.tags??[]).includes(Re)).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=De===j.key,{name:ue,phone:Pe}=Dt(j),it=async xe=>{if(xe.stopPropagation(),!h||!qt){le({kind:"err",text:"๐ Log in (admin/operator) to clear conversations."});return}Qt(j.key);try{await J.clearGatewayConversation(j.key),Ur()}catch{}Qt(null)},ft=we.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:we.size>0&&!ft?.5:1,transition:"opacity 0.2s"},onClick:()=>Ee(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:ft,onClick:xe=>tm(j.key,xe),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"?"โ๏ธ":"๐ฌ"," ",ue]}),s.jsxs("span",{className:"hub-card-id",children:[Pe&&s.jsx("span",{style:{color:"var(--text-secondary, #8b949e)",marginRight:6},children:Pe}),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:xe=>wl(j,xe),title:"Export as text file",children:"๐"}),s.jsx("button",{type:"button",className:"hub-mini-btn",onClick:xe=>lt(j,xe),title:"Export as PDF (opens print dialog)",children:"๐"})]}),s.jsx("button",{type:"button",className:"hub-mini-btn",disabled:On===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(xe=>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:["๐ท๏ธ ",xe,s.jsx("button",{type:"button",onClick:Et=>{Et.stopPropagation(),xl(j.key,xe)},style:{background:"none",border:"none",color:"#3b82f6",cursor:"pointer",padding:0,fontSize:12,lineHeight:1},children:"ร"})]},xe)),$t===j.key?s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:s.jsx("input",{type:"text",value:Ea,onChange:xe=>sr(xe.target.value),onKeyDown:xe=>{xe.key==="Enter"&&bl(j.key,Ea),xe.key==="Escape"&&(oi(null),sr(""))},placeholder:"tag name",autoFocus:!0,onClick:xe=>xe.stopPropagation(),style:{width:80,padding:"1px 6px",fontSize:11,borderRadius:8,border:"1px solid var(--border)"}})}):s.jsx("button",{type:"button",onClick:xe=>{xe.stopPropagation(),oi(j.key),sr("")},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((xe,Et)=>s.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:xe.role==="user"?"flex-end":"flex-start"},children:[s.jsxs("div",{style:{maxWidth:"80%",padding:"8px 12px",borderRadius:12,backgroundColor:xe.role==="user"?"#007bff":"var(--bg-card, #1a1f2e)",color:xe.role==="user"?"#fff":"var(--text-primary, #e6edf3)",fontSize:13,lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[xe.content.slice(0,500),xe.content.length>500?"โฆ":""]}),s.jsxs("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:[xe.role==="user"?"๐ค":"๐ค"," ",new Date(xe.ts).toLocaleString()]})]},Et)),ie.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)}),cn&&!Sn&&s.jsx("div",{ref:_a,style:{height:1}}),Sn&&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โฆ"})]}),!Sn&&!cn&&Jt.length>0&&s.jsxs("p",{className:"admin-hint",style:{textAlign:"center",padding:12},children:["All ",me," conversation",me===1?"":"s"," loaded."]})]})]}):Sn?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&&!qt,onClick:()=>Zu(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"})]}),I[j.id]?s.jsx("div",{className:"admin-row-msg",children:I[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:Cs===j.id||h&&!qt,onClick:()=>void am(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&&!qt,onClick:()=>Zu(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"})]}),I[j.id]?s.jsx("div",{className:"admin-row-msg",children:I[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:Yu,children:[s.jsx("input",{type:"text",value:ja,onChange:j=>js(j.target.value),placeholder:"Search community skills (e.g. code-assist, deploy, testing)โฆ"}),s.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:Sl,children:Sl?"Searchingโฆ":"๐ Search"})]}),ci?s.jsx("div",{className:`admin-row-msg${ci.kind==="err"?" admin-row-msg-err":""}`,children:ci.text}):null,Ca&&!Sl?Lt.length>0?s.jsx("div",{className:"hub-session-list",children:Lt.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:Cs===j.name||h&&!qt,onClick:()=>void im(j.name),children:Cs===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 "',ja,'" โ try a broader term, or add a registry to ',s.jsx("code",{children:"skills.registries"})," in config."]}):null]}):null,e==="subagents"&&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:((iw=n.subagents)==null?void 0:iw.total)??0}),s.jsx("div",{className:"admin-summary-label",children:"Runs recorded"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:((aw=n.subagents)==null?void 0:aw.running)??0}),s.jsx("div",{className:"admin-summary-label",children:"Running now"})]}),s.jsxs("div",{className:"admin-summary-card",children:[s.jsx("div",{className:"admin-summary-value",children:((sw=n.subagents)==null?void 0:sw.failed)??0}),s.jsx("div",{className:"admin-summary-label",children:"Failed"})]})]}),s.jsxs("p",{className:"admin-hint",children:["Each run is a separate child process. A transport of ",s.jsx("code",{children:"json"})," means the provider has no native tool protocol and the shared JSON fallback carried the tool calls; a refusal code means the run stopped deliberately instead of returning an answer."]}),(((ow=n.subagents)==null?void 0:ow.recent)??[]).length>0?s.jsx("div",{className:"hub-session-list",children:(((lw=n.subagents)==null?void 0:lw.recent)??[]).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.goal||"(no goal recorded)"}),s.jsxs("span",{className:"hub-card-id",children:[j.id.slice(0,8),j.startedAt?` ยท ${new Date(j.startedAt).toLocaleString()}`:""]})]}),s.jsx("div",{className:"hub-card-actions",children:s.jsx("span",{className:"hub-chip",children:Xse[j.status]??j.status})})]}),s.jsxs("div",{className:"hub-card-tools",children:[s.jsxs("span",{className:"hub-chip",children:["๐ ",j.provider??"provider unknown",j.model?` ยท ${j.model}`:""]}),s.jsxs("span",{className:"hub-chip",children:["๐ ",j.transport??"transport unknown"," transport"]}),s.jsxs("span",{className:"hub-chip",children:[j.llmCalls," model call",j.llmCalls===1?"":"s"]}),s.jsxs("span",{className:"hub-chip",children:[j.toolCalls," tool call",j.toolCalls===1?"":"s"]}),typeof j.durationMs=="number"?s.jsxs("span",{className:"hub-chip",children:[(j.durationMs/1e3).toFixed(1),"s"]}):null]}),j.refusalCode?s.jsxs("div",{className:"hub-card-note",children:["โ Refused before answering โ code ",s.jsx("code",{children:j.refusalCode})]}):null,j.error?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:j.error}):null,j.resultPreview?s.jsx("div",{className:"hub-artifact-preview",children:j.resultPreview}):null]},j.id))}):s.jsxs("div",{className:"empty-state",children:["No subagent runs recorded yet โ a run shows up here once the agent spawns one (the ",s.jsx("code",{children:"subagent"})," tool), and only if it actually started."]})]}):null]})}const PE={running:"โณ running",done:"โ
done",failed:"โ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐ฅ error"};function RE(e){switch(e){case"done":return"task-status-done";case"running":return"task-status-running";case"failed":return"task-status-failed";case"cancelled":return"task-status-cancelled";case"timeout":return"task-status-timeout";default:return"task-status-error"}}function Qse(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 ME(e){return e===null?"โ":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Jse(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 eoe(){const[e,t]=N.useState(null),[n,r]=N.useState(""),[i,a]=N.useState(300),[o,l]=N.useState(!1),[c,u]=N.useState(""),[d,f]=N.useState(null),[h,p]=N.useState([]),[g,m]=N.useState(!0),v=N.useRef(null),y=N.useRef(null),b=N.useCallback(async()=>{const _=await J.listTasks();_&&p(_.tasks)},[]);N.useEffect(()=>{J.fetchAdminAuthStatus().then(_=>{t(_?{configured:_.configured,authenticated:_.authenticated,role:_.role??null}:{configured:!1,authenticated:!1,role:null}),_!=null&&_.authenticated&&b()})},[b]),N.useEffect(()=>{var _,C;if(g&&(d==null?void 0:d.status)==="running")try{(C=(_=v.current)==null?void 0:_.scrollIntoView)==null||C.call(_,{block:"end"})}catch{}},[d==null?void 0:d.logs.length,d==null?void 0:d.status,g]),N.useEffect(()=>()=>{var _;return(_=y.current)==null?void 0:_.call(y)},[]);const w=N.useCallback((_,C)=>{var L;if((L=y.current)==null||L.call(y),f(_),u(""),!C)return;const T=J.subscribeTask(_.id,{onLog:M=>f(B=>B&&B.id===_.id?{...B,logs:[...B.logs,M]}:B),onStatus:M=>f(B=>B&&B.id===_.id?{...B,status:M}:B)});y.current=T},[]),k=N.useCallback(async()=>{const _=Qse(n);if(_.length===0){u("Type a command first โ e.g. `eval run --task smoke-test` or `gateway status`.");return}l(!0),u("");const C=await J.startTask(_,i*1e3);if(l(!1),!C.ok||!C.task){u(C.error||"Failed to start task.");return}r(""),b(),w(C.task,!0)},[n,i,w,b]),S=N.useCallback(async _=>{await J.cancelTask(_)},[]),x=N.useCallback(async _=>{const C=await J.getTask(_);C!=null&&C.task&&w(C.task,!1)},[w]),E=N.useCallback(()=>{var _;(_=y.current)==null||_.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:_=>{_.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:_=>r(_.target.value),autoComplete:"off",spellCheck:!1}),s.jsxs("select",{className:"admin-input task-timeout-select",title:"Task timeout",value:i,onChange:_=>a(Number(_.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 ${RE(d.status)}`,children:PE[d.status]}),s.jsxs("span",{className:"task-meta",children:["exit ",d.exitCode??"โ"," ยท ",ME(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:E,children:"โ Close"})]}),s.jsxs("div",{className:"task-console",children:[d.logs.map((_,C)=>s.jsx("div",{className:`task-line task-line-${_.stream}`,children:_.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:_=>m(_.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(_=>s.jsxs("tr",{className:(d==null?void 0:d.id)===_.id?"task-row-active":"",onClick:()=>void x(_.id),children:[s.jsx("td",{children:s.jsx("code",{children:_.command})}),s.jsx("td",{children:s.jsx("span",{className:`task-status ${RE(_.status)}`,children:PE[_.status]})}),s.jsx("td",{children:_.exitCode??"โ"}),s.jsx("td",{children:ME(_.durationMs)}),s.jsx("td",{children:Jse(_.startedAt)})]},_.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(Dy,{className:"admin-refresh-btn",to:"/admin",children:"๐ Log in"}):s.jsx(Dy,{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 toe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const noe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,roe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ioe={};function IE(e,t){return(ioe.jsx?roe:noe).test(e)}const aoe=/[ \t\n\f\r]/g;function soe(e){return typeof e=="object"?e.type==="text"?$E(e.value):!1:$E(e)}function $E(e){return e.replace(aoe,"")===""}class Bu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bu.prototype.normal={};Bu.prototype.property={};Bu.prototype.space=void 0;function CR(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Bu(n,r,t)}function db(e){return e.toLowerCase()}class Fn{constructor(t,n){this.attribute=n,this.property=t}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let ooe=0;const Ie=ks(),Pt=ks(),fb=ks(),ce=ks(),at=ks(),is=ks(),Vn=ks();function ks(){return 2**++ooe}const hb=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Pt,commaOrSpaceSeparated:Vn,commaSeparated:is,number:ce,overloadedBoolean:fb,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),Sg=Object.keys(hb);class R0 extends Fn{constructor(t,n,r,i){let a=-1;if(super(t,n),LE(this,"space",i),typeof r=="number")for(;++a<Sg.length;){const o=Sg[a];LE(this,Sg[a],(r&hb[o])===hb[o])}}}R0.prototype.defined=!0;function LE(e,t,n){n&&(e[t]=n)}function gl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new R0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[db(r)]=r,n[db(a.attribute)]=r}return new Bu(t,n,e.space)}const TR=gl({properties:{ariaActiveDescendant:null,ariaAtomic:Pt,ariaAutoComplete:null,ariaBusy:Pt,ariaChecked:Pt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:Pt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:Pt,ariaFlowTo:at,ariaGrabbed:Pt,ariaHasPopup:null,ariaHidden:Pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:ce,ariaLive:null,ariaModal:Pt,ariaMultiLine:Pt,ariaMultiSelectable:Pt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:Pt,ariaReadOnly:Pt,ariaRelevant:null,ariaRequired:Pt,ariaRoleDescription:at,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:Pt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function OR(e,t){return t in e?e[t]:t}function PR(e,t){return OR(e,t.toLowerCase())}const loe=gl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:is,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:at,autoFocus:Ie,autoPlay:Ie,blocking:at,capture:null,charSet:null,checked:Ie,cite:null,className:at,closedBy:null,colorSpace:null,cols:ce,colSpan:ce,command:null,commandFor:null,content:null,contentEditable:Pt,controls:Ie,controlsList:at,coords:ce|is,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:fb,draggable:Pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:at,height:ce,hidden:fb,high:ce,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:at,itemRef:at,itemScope:Ie,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:ce,pattern:null,ping:at,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:at,required:Ie,reversed:Ie,rows:ce,rowSpan:ce,sandbox:at,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:Pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Pt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:Pt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:is,part:at,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:PR}),coe=gl({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:Vn,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:at,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:is,g2:is,glyphName:is,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:Vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vn,rev:Vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vn,requiredFeatures:Vn,requiredFonts:Vn,requiredFormats:Vn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:Vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vn,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:OR}),RR=gl({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()}}),MR=gl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:PR}),IR=gl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uoe={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"},doe=/[A-Z]/g,DE=/-[a-z]/g,foe=/^data[-\w.:]+$/i;function hoe(e,t){const n=db(t);let r=t,i=Fn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&foe.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(DE,moe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!DE.test(a)){let o=a.replace(doe,poe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=R0}return new i(r,t)}function poe(e){return"-"+e.toLowerCase()}function moe(e){return e.charAt(1).toUpperCase()}const goe=CR([TR,loe,RR,MR,IR],"html"),M0=CR([TR,coe,RR,MR,IR],"svg");function yoe(e){return e.join(" ").trim()}var I0={},BE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,voe=/\n/g,boe=/^\s*/,xoe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,woe=/^:\s*/,Soe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,koe=/^[;\s]*/,Noe=/^\s+|\s+$/g,Eoe=`
|
|
165
|
-
`,zE="/",FE="*",Wa="",_oe="comment",joe="declaration";function Aoe(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(voe);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(boe)}function d(g){var m;for(g=g||[];m=f();)m!==!1&&g.push(m);return g}function f(){var g=a();if(!(zE!=e.charAt(0)||FE!=e.charAt(1))){for(var m=2;Wa!=e.charAt(m)&&(FE!=e.charAt(m)||zE!=e.charAt(m+1));)++m;if(m+=2,Wa===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:_oe,comment:v})}}function h(){var g=a(),m=c(xoe);if(m){if(f(),!c(woe))return l("property missing ':'");var v=c(Soe),y=g({type:joe,property:UE(m[0].replace(BE,Wa)),value:v?UE(v[0].replace(BE,Wa)):Wa});return c(koe),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 UE(e){return e?e.replace(Noe,Wa):Wa}var Coe=Aoe,Toe=Yi&&Yi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I0,"__esModule",{value:!0});I0.default=Poe;const Ooe=Toe(Coe);function Poe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Ooe.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 Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});Vp.camelCase=void 0;var Roe=/^--[a-zA-Z0-9_-]+$/,Moe=/-([a-z])/g,Ioe=/^[^-]+$/,$oe=/^-(webkit|moz|ms|o|khtml)-/,Loe=/^-(ms)-/,Doe=function(e){return!e||Ioe.test(e)||Roe.test(e)},Boe=function(e,t){return t.toUpperCase()},WE=function(e,t){return"".concat(t,"-")},zoe=function(e,t){return t===void 0&&(t={}),Doe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Loe,WE):e=e.replace($oe,WE),e.replace(Moe,Boe))};Vp.camelCase=zoe;var Foe=Yi&&Yi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Uoe=Foe(I0),Woe=Vp;function pb(e,t){var n={};return!e||typeof e!="string"||(0,Uoe.default)(e,function(r,i){r&&i&&(n[(0,Woe.camelCase)(r,t)]=i)}),n}pb.default=pb;var Hoe=pb;const Goe=Ze(Hoe),$R=LR("end"),$0=LR("start");function LR(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 qoe(e){const t=$0(e),n=$R(e);if(t&&n)return{start:t,end:n}}function vc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?HE(e.position):"start"in e||"end"in e?HE(e):"line"in e||"column"in e?mb(e):""}function mb(e){return GE(e&&e.line)+":"+GE(e&&e.column)}function HE(e){return mb(e&&e.start)+"-"+mb(e&&e.end)}function GE(e){return e&&typeof e=="number"?e:1}class xn 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=vc(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}}xn.prototype.file="";xn.prototype.name="";xn.prototype.reason="";xn.prototype.message="";xn.prototype.stack="";xn.prototype.column=void 0;xn.prototype.line=void 0;xn.prototype.ancestors=void 0;xn.prototype.cause=void 0;xn.prototype.fatal=void 0;xn.prototype.place=void 0;xn.prototype.ruleId=void 0;xn.prototype.source=void 0;const L0={}.hasOwnProperty,Koe=new Map,Voe=/[A-Z]/g,Yoe=new Set(["table","tbody","thead","tfoot","tr"]),Xoe=new Set(["td","th"]),DR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Zoe(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=ale(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=ile(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"?M0:goe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=BR(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function BR(e,t,n){if(t.type==="element")return Qoe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Joe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return tle(e,t,n);if(t.type==="mdxjsEsm")return ele(e,t);if(t.type==="root")return nle(e,t,n);if(t.type==="text")return rle(e,t)}function Qoe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=M0,e.schema=i),e.ancestors.push(t);const a=FR(e,t.tagName,!1),o=sle(e,t);let l=B0(e,t);return Yoe.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!soe(c):!0})),zR(e,o,a,t),D0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Joe(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)}Su(e,t.position)}function ele(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Su(e,t.position)}function tle(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=M0,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:FR(e,t.name,!0),o=ole(e,t),l=B0(e,t);return zR(e,o,a,t),D0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function nle(e,t,n){const r={};return D0(r,B0(e,t)),e.create(t,e.Fragment,r,n)}function rle(e,t){return t.value}function zR(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function D0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ile(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 ale(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=$0(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 sle(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&L0.call(t.properties,i)){const a=lle(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Xoe.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 ole(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 Su(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 Su(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function B0(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Koe;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=BR(e,a,o);l!==void 0&&n.push(l)}return n}function lle(e,t,n){const r=hoe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?toe(n):yoe(n)),r.property==="style"){let i=typeof n=="object"?n:cle(e,String(n));return e.stylePropertyNameCase==="css"&&(i=ule(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?uoe[r.property]||r.property:r.attribute,n]}}function cle(e,t){try{return Goe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new xn("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=DR+"#cannot-parse-style-attribute",i}}function FR(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=IE(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=IE(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return L0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Su(e)}function Su(e,t){const n=new xn("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=DR+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ule(e){const t={};let n;for(n in e)L0.call(e,n)&&(t[dle(n)]=e[n]);return t}function dle(e){let t=e.replace(Voe,fle);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function fle(e){return"-"+e.toLowerCase()}const kg={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"]},hle={};function z0(e,t){const n=hle,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return UR(e,r,i)}function UR(e,t,n){if(ple(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 qE(e.children,t,n)}return Array.isArray(e)?qE(e,t,n):""}function qE(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=UR(e[i],t,n);return r.join("")}function ple(e){return!!(e&&typeof e=="object")}const KE=document.createElement("i");function F0(e){const t="&"+e+";";KE.innerHTML=t;const n=KE.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function tr(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 hr(e,t){return e.length>0?(tr(e,e.length,0,t),e):t}const VE={}.hasOwnProperty;function WR(e){const t={};let n=-1;for(;++n<e.length;)mle(t,e[n]);return t}function mle(e,t){let n;for(n in t){const i=(VE.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){VE.call(i,o)||(i[o]=[]);const l=a[o];gle(i[o],Array.isArray(l)?l:l?[l]:[])}}}function gle(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);tr(e,0,0,r)}function HR(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 Lr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _n=Na(/[A-Za-z]/),vn=Na(/[\dA-Za-z]/),yle=Na(/[#-'*+\--9=?A-Z^-~]/);function Rh(e){return e!==null&&(e<32||e===127)}const gb=Na(/\d/),vle=Na(/[\dA-Fa-f]/),ble=Na(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function ot(e){return e!==null&&(e<0||e===32)}function Be(e){return e===-2||e===-1||e===32}const Yp=Na(new RegExp("\\p{P}|\\p{S}","u")),gs=Na(/\s/);function Na(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function yl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&vn(e.charCodeAt(n+1))&&vn(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 Ue(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 xle={tokenize:wle};function wle(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"),Ue(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 Ae(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const Sle={tokenize:kle},YE={tokenize:Nle};function kle(e){const t=this,n=[];let r=0,i,a,o;return l;function l(w){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const k=t.events.length;let S=k,x;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){x=t.events[S][1].end;break}y(r);let E=k;for(;E<t.events.length;)t.events[E][1].end={...x},E++;return tr(t.events,S+1,0,t.events.slice(k)),t.events.length=E,u(w)}return l(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(YE,d,f)(w)}function d(w){return i&&b(),y(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(w)}function h(w){return t.containerState={},e.attempt(YE,p,g)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function g(w){if(w===null){i&&b(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),m(w)}function m(w){if(w===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return Ae(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),m)}function v(w,k){const S=t.sliceStream(w);if(k&&S.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(S),t.parser.lazy[w.start.line]){let x=i.events.length;for(;x--;)if(i.events[x][1].start.offset<o&&(!i.events[x][1].end||i.events[x][1].end.offset>o))return;const E=t.events.length;let _=E,C,T;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(C){T=t.events[_][1].end;break}C=!0}for(y(r),x=E;x<t.events.length;)t.events[x][1].end={...T},x++;tr(t.events,_+1,0,t.events.slice(E)),t.events.length=x}}function y(w){let k=n.length;for(;k-- >w;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Nle(e,t,n){return Ue(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xo(e){if(e===null||ot(e)||gs(e))return 1;if(Yp(e))return 2}function Xp(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 yb={name:"attention",resolveAll:Ele,tokenize:_le};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};XE(f,-c),XE(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},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=hr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=hr(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=hr(u,Xp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=hr(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=hr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,tr(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 _le(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Xo(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=Xo(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 XE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jle={name:"autolink",tokenize:Ale};function Ale(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 _n(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||vn(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||vn(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||Rh(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):yle(p)?(e.consume(p),u):n(p)}function d(p){return vn(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||vn(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const zu={partial:!0,tokenize:Cle};function Cle(e,t,n){return r;function r(a){return Be(a)?Ue(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ae(a)?t(a):n(a)}}const GR={continuation:{tokenize:Ole},exit:Ple,name:"blockQuote",tokenize:Tle};function Tle(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 Ole(e,t,n){const r=this;return i;function i(o){return Be(o)?Ue(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(GR,t,n)(o)}}function Ple(e){e.exit("blockQuote")}const qR={name:"characterEscape",tokenize:Rle};function Rle(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 ble(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const KR={name:"characterReference",tokenize:Mle};function Mle(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=vn,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=vle,d):(e.enter("characterReferenceValue"),a=7,o=gb,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return o===vn&&!F0(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 ZE={partial:!0,tokenize:$le},QE={concrete:!0,name:"codeFenced",tokenize:Ile};function Ile(e,t,n){const r=this,i={partial:!0,tokenize:S};let a=0,o=0,l;return c;function c(x){return u(x)}function u(x){const E=r.events[r.events.length-1];return a=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,l=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(x)}function d(x){return x===l?(o++,e.consume(x),d):o<3?n(x):(e.exit("codeFencedFenceSequence"),Be(x)?Ue(e,f,"whitespace")(x):f(x))}function f(x){return x===null||Ae(x)?(e.exit("codeFencedFence"),r.interrupt?t(x):e.check(ZE,m,k)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||Ae(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(x)):Be(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ue(e,p,"whitespace")(x)):x===96&&x===l?n(x):(e.consume(x),h)}function p(x){return x===null||Ae(x)?f(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||Ae(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(x)):x===96&&x===l?n(x):(e.consume(x),g)}function m(x){return e.attempt(i,k,v)(x)}function v(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y}function y(x){return a>0&&Be(x)?Ue(e,b,"linePrefix",a+1)(x):b(x)}function b(x){return x===null||Ae(x)?e.check(ZE,m,k)(x):(e.enter("codeFlowValue"),w(x))}function w(x){return x===null||Ae(x)?(e.exit("codeFlowValue"),b(x)):(e.consume(x),w)}function k(x){return e.exit("codeFenced"),t(x)}function S(x,E,_){let C=0;return T;function T(F){return x.enter("lineEnding"),x.consume(F),x.exit("lineEnding"),L}function L(F){return x.enter("codeFencedFence"),Be(F)?Ue(x,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):M(F)}function M(F){return F===l?(x.enter("codeFencedFenceSequence"),B(F)):_(F)}function B(F){return F===l?(C++,x.consume(F),B):C>=o?(x.exit("codeFencedFenceSequence"),Be(F)?Ue(x,I,"whitespace")(F):I(F)):_(F)}function I(F){return F===null||Ae(F)?(x.exit("codeFencedFence"),E(F)):_(F)}}}function $le(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 Ng={name:"codeIndented",tokenize:Dle},Lle={partial:!0,tokenize:Ble};function Dle(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Ue(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):Ae(u)?e.attempt(Lle,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ae(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Ble(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ae(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ue(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):Ae(o)?i(o):n(o)}}const zle={name:"codeText",previous:Ule,resolve:Fle,tokenize:Wle};function Fle(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 Ule(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Wle(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)):Ae(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||Ae(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 Hle{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&&Yl(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),Yl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Yl(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);Yl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Yl(this.left,n.reverse())}}}function Yl(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 VR(e){const t={};let n=-1,r,i,a,o,l,c,u;const d=new Hle(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,Gle(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 tr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Gle(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 qle={resolve:Vle,tokenize:Yle},Kle={partial:!0,tokenize:Xle};function Vle(e){return VR(e),e}function Yle(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):Ae(l)?e.check(Kle,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 Xle(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ue(e,a,"linePrefix")}function a(o){if(o===null||Ae(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 YR(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||Rh(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||Ae(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||ot(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||Rh(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 XR(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):Ae(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||Ae(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 ZR(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):Ae(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ue(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Ae(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 bc(e,t){let n;return r;function r(i){return Ae(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Be(i)?Ue(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Zle={name:"definition",tokenize:Jle},Qle={partial:!0,tokenize:ece};function Jle(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return XR.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Lr(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 ot(p)?bc(e,u)(p):u(p)}function u(p){return YR(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Qle,f,f)(p)}function f(p){return Be(p)?Ue(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Ae(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function ece(e,t,n){return r;function r(l){return ot(l)?bc(e,i)(l):n(l)}function i(l){return ZR(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Be(l)?Ue(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ae(l)?t(l):n(l)}}const tce={name:"hardBreakEscape",tokenize:nce};function nce(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ae(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const rce={name:"headingAtx",resolve:ice,tokenize:ace};function ice(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"},tr(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function ace(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||ot(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ae(d)?(e.exit("atxHeading"),t(d)):Be(d)?Ue(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||ot(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const sce=["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"],JE=["pre","script","style","textarea"],oce={concrete:!0,name:"htmlFlow",resolveTo:uce,tokenize:dce},lce={partial:!0,tokenize:hce},cce={partial:!0,tokenize:fce};function uce(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 dce(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):_n(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):_n(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 oe="CDATA[";return P===oe.charCodeAt(l++)?(e.consume(P),l===oe.length?r.interrupt?t:M:g):n(P)}function m(P){return _n(P)?(e.consume(P),o=String.fromCharCode(P),v):n(P)}function v(P){if(P===null||P===47||P===62||ot(P)){const oe=P===47,be=o.toLowerCase();return!oe&&!a&&JE.includes(be)?(i=1,r.interrupt?t(P):M(P)):sce.includes(o.toLowerCase())?(i=6,oe?(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):w(P))}return P===45||vn(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 w(P){return P===47?(e.consume(P),T):P===58||P===95||_n(P)?(e.consume(P),k):Be(P)?(e.consume(P),w):T(P)}function k(P){return P===45||P===46||P===58||P===95||vn(P)?(e.consume(P),k):S(P)}function S(P){return P===61?(e.consume(P),x):Be(P)?(e.consume(P),S):w(P)}function x(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,E):Be(P)?(e.consume(P),x):_(P)}function E(P){return P===c?(e.consume(P),c=null,C):P===null||Ae(P)?n(P):(e.consume(P),E)}function _(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||ot(P)?S(P):(e.consume(P),_)}function C(P){return P===47||P===62||Be(P)?w(P):n(P)}function T(P){return P===62?(e.consume(P),L):n(P)}function L(P){return P===null||Ae(P)?M(P):Be(P)?(e.consume(P),L):n(P)}function M(P){return P===45&&i===2?(e.consume(P),z):P===60&&i===1?(e.consume(P),R):P===62&&i===4?(e.consume(P),Z):P===63&&i===3?(e.consume(P),A):P===93&&i===5?(e.consume(P),U):Ae(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(lce,$,B)(P)):P===null||Ae(P)?(e.exit("htmlFlowData"),B(P)):(e.consume(P),M)}function B(P){return e.check(cce,I,$)(P)}function I(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),F}function F(P){return P===null||Ae(P)?B(P):(e.enter("htmlFlowData"),M(P))}function z(P){return P===45?(e.consume(P),A):M(P)}function R(P){return P===47?(e.consume(P),o="",O):M(P)}function O(P){if(P===62){const oe=o.toLowerCase();return JE.includes(oe)?(e.consume(P),Z):M(P)}return _n(P)&&o.length<8?(e.consume(P),o+=String.fromCharCode(P),O):M(P)}function U(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||Ae(P)?(e.exit("htmlFlowData"),$(P)):(e.consume(P),Z)}function $(P){return e.exit("htmlFlow"),t(P)}}function fce(e,t,n){const r=this;return i;function i(o){return Ae(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 hce(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(zu,t,n)}}const pce={name:"htmlText",tokenize:mce};function mce(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),w):_n(A)?(e.consume(A),_):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),a=0,g):_n(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):Ae(A)?(o=f,R(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?z(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):Ae(A)?(o=m,R(A)):(e.consume(A),m)}function v(A){return A===93?(e.consume(A),y):m(A)}function y(A){return A===62?z(A):A===93?(e.consume(A),y):m(A)}function b(A){return A===null||A===62?z(A):Ae(A)?(o=b,R(A)):(e.consume(A),b)}function w(A){return A===null?n(A):A===63?(e.consume(A),k):Ae(A)?(o=w,R(A)):(e.consume(A),w)}function k(A){return A===62?z(A):w(A)}function S(A){return _n(A)?(e.consume(A),x):n(A)}function x(A){return A===45||vn(A)?(e.consume(A),x):E(A)}function E(A){return Ae(A)?(o=E,R(A)):Be(A)?(e.consume(A),E):z(A)}function _(A){return A===45||vn(A)?(e.consume(A),_):A===47||A===62||ot(A)?C(A):n(A)}function C(A){return A===47?(e.consume(A),z):A===58||A===95||_n(A)?(e.consume(A),T):Ae(A)?(o=C,R(A)):Be(A)?(e.consume(A),C):z(A)}function T(A){return A===45||A===46||A===58||A===95||vn(A)?(e.consume(A),T):L(A)}function L(A){return A===61?(e.consume(A),M):Ae(A)?(o=L,R(A)):Be(A)?(e.consume(A),L):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,B):Ae(A)?(o=M,R(A)):Be(A)?(e.consume(A),M):(e.consume(A),I)}function B(A){return A===i?(e.consume(A),i=void 0,F):A===null?n(A):Ae(A)?(o=B,R(A)):(e.consume(A),B)}function I(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||ot(A)?C(A):(e.consume(A),I)}function F(A){return A===47||A===62||ot(A)?C(A):n(A)}function z(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function R(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return Be(A)?Ue(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):U(A)}function U(A){return e.enter("htmlTextData"),o(A)}}const U0={name:"labelEnd",resolveAll:bce,resolveTo:xce,tokenize:wce},gce={tokenize:Sce},yce={tokenize:kce},vce={tokenize:Nce};function bce(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&&tr(e,0,e.length,n),e}function xce(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=hr(l,e.slice(a+1,a+r+3)),l=hr(l,[["enter",d,t]]),l=hr(l,Xp(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=hr(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=hr(l,e.slice(o+1)),l=hr(l,[["exit",c,t]]),tr(e,a,e.length,l),e}function wce(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(Lr(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(gce,d,o?d:f)(h):h===91?e.attempt(yce,d,o?u:f)(h):o?d(h):f(h)}function u(h){return e.attempt(vce,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function Sce(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 ot(f)?bc(e,a)(f):a(f)}function a(f){return f===41?d(f):YR(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return ot(f)?bc(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?ZR(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return ot(f)?bc(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 kce(e,t,n){const r=this;return i;function i(l){return XR.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Lr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function Nce(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:U0.resolveAll,tokenize:_ce};function _ce(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 jce={name:"labelStartLink",resolveAll:U0.resolveAll,tokenize:Ace};function Ace(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 Eg={name:"lineEnding",tokenize:Cce};function Cce(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ue(e,t,"linePrefix")}}const rf={name:"thematicBreak",tokenize:Tce};function Tce(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||Ae(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Be(u)?Ue(e,l,"whitespace")(u):l(u))}}const Rn={continuation:{tokenize:Mce},exit:$ce,name:"list",tokenize:Rce},Oce={partial:!0,tokenize:Lce},Pce={partial:!0,tokenize:Ice};function Rce(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:gb(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(rf,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 gb(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(zu,r.interrupt?n:d,e.attempt(Oce,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 Mce(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(zu,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ue(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(Pce,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ue(e,e.attempt(Rn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Ice(e,t,n){const r=this;return Ue(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 $ce(e){e.exit(this.containerState.type)}function Lce(e,t,n){const r=this;return Ue(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 e_={name:"setextUnderline",resolveTo:Dce,tokenize:Bce};function Dce(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 Bce(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)?Ue(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ae(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const zce={tokenize:Fce};function Fce(e){const t=this,n=e.attempt(zu,r,e.attempt(this.parser.constructs.flowInitial,i,Ue(e,e.attempt(this.parser.constructs.flow,i,e.attempt(qle,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 Uce={resolveAll:JR()},Wce=QR("string"),Hce=QR("text");function QR(e){return{resolveAll:JR(e==="text"?Gce: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 JR(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 Gce(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 qce={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:GR},Kce={91:Zle},Vce={[-2]:Ng,[-1]:Ng,32:Ng},Yce={35:rce,42:rf,45:[e_,rf],60:oce,61:e_,95:rf,96:QE,126:QE},Xce={38:KR,92:qR},Zce={[-5]:Eg,[-4]:Eg,[-3]:Eg,33:Ece,38:KR,42:yb,60:[jle,pce],91:jce,92:[tce,qR],93:U0,95:yb,96:zle},Qce={null:[yb,Uce]},Jce={null:[42,95]},eue={null:[]},tue=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Jce,contentInitial:Kce,disable:eue,document:qce,flow:Yce,flowInitial:Vce,insideSpan:Qce,string:Xce,text:Zce},Symbol.toStringTag,{value:"Module"}));function nue(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:E(S),check:E(x),consume:b,enter:w,exit:k,interrupt:E(x,{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(L){return o=hr(o,L),v(),o[o.length-1]!==null?[]:(_(t,0),u.events=Xp(a,u.events,u),u.events)}function h(L,M){return iue(p(L),M)}function p(L){return rue(o,L)}function g(){const{_bufferIndex:L,_index:M,line:B,column:I,offset:F}=r;return{_bufferIndex:L,_index:M,line:B,column:I,offset:F}}function m(L){i[L.line]=L.column,T()}function v(){let L;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<M.length;)y(M.charCodeAt(r._bufferIndex));else y(M)}}function y(L){d=d(L)}function b(L){Ae(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,T()):L!==-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=L}function w(L,M){const B=M||{};return B.type=L,B.start=g(),u.events.push(["enter",B,u]),l.push(B),B}function k(L){const M=l.pop();return M.end=g(),u.events.push(["exit",M,u]),M}function S(L,M){_(L,M.from)}function x(L,M){M.restore()}function E(L,M){return B;function B(I,F,z){let R,O,U,A;return Array.isArray(I)?$(I):"tokenize"in I?$([I]):Z(I);function Z(pe){return Ce;function Ce(G){const Y=G!==null&&pe[G],ae=G!==null&&pe.null,le=[...Array.isArray(Y)?Y:Y?[Y]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return $(le)(G)}}function $(pe){return R=pe,O=0,pe.length===0?z:P(pe[O])}function P(pe){return Ce;function Ce(G){return A=C(),U=pe,pe.partial||(u.currentConstruct=pe),pe.name&&u.parser.constructs.disable.null.includes(pe.name)?be():pe.tokenize.call(M?Object.assign(Object.create(u),M):u,c,oe,be)(G)}}function oe(pe){return L(U,A),F}function be(pe){return A.restore(),++O<R.length?P(R[O]):z}}}function _(L,M){L.resolveAll&&!a.includes(L)&&a.push(L),L.resolve&&tr(u.events,M,u.events.length-M,L.resolve(u.events.slice(M),u)),L.resolveTo&&(u.events=L.resolveTo(u.events,u))}function C(){const L=g(),M=u.previous,B=u.currentConstruct,I=u.events.length,F=Array.from(l);return{from:I,restore:z};function z(){r=L,u.previous=M,u.currentConstruct=B,u.events.length=I,l=F,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function rue(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 iue(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 aue(e){const r={constructs:WR([tue,...(e||{}).extensions||[]]),content:i(xle),defined:[],document:i(Sle),flow:i(zce),lazy:{},string:i(Wce),text:i(Hce)};return r;function i(a){return o;function o(l){return nue(r,a,l)}}}function sue(e){for(;!VR(e););return e}const t_=/[\0\t\n\r]/g;function oue(){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(t_.lastIndex=f,u=t_.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 lue=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function cue(e){return e.replace(lue,uue)}function uue(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return HR(n.slice(a?2:1),a?16:10)}return F0(n)||e}const eM={}.hasOwnProperty;function due(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),fue(n)(sue(aue(n).document().write(oue()(e,t,!0))))}function fue(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(et),autolinkProtocol:C,autolinkEmail:C,atxHeading:a(_e),blockQuote:a(ae),characterEscape:C,characterReference:C,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(X,o),codeTextData:C,data:C,codeFlowValue:C,definition:a(je),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ne),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a($e,o),htmlFlowData:C,htmlText:a($e,o),htmlTextData:C,image:a(fe),label:o,link:a(et),listItem:a(Ee),listItemValue:h,listOrdered:a(De,f),listUnordered:a(De),paragraph:a(qe),reference:P,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(It),thematicBreak:a(Qt)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:Y,autolinkProtocol:G,blockQuote:c(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:pe,characterReference:Ce,codeFenced:c(v),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:T,codeIndented:c(y),codeText:c(F),codeTextData:T,data:T,definition:c(),definitionDestinationString:k,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(M),hardBreakTrailing:c(M),htmlFlow:c(B),htmlFlowData:T,htmlText:c(I),htmlTextData:T,image:c(R),label:U,labelText:O,lineEnding:L,link:c(z),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:A,resourceTitleString:Z,resource:$,setextHeading:c(_),setextHeadingLineSequence:E,setextHeadingText:x,strong:c(),thematicBreak:c()}};tM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(W){let V={type:"root",children:[]};const ie={stack:[V],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:d,data:n},he=[];let we=-1;for(;++we<W.length;)if(W[we][1].type==="listOrdered"||W[we][1].type==="listUnordered")if(W[we][0]==="enter")he.push(we);else{const He=he.pop();we=i(W,He,we)}for(we=-1;++we<W.length;){const He=t[W[we][0]];eM.call(He,W[we][1].type)&&He[W[we][1].type].call(Object.assign({sliceSerialize:W[we][2].sliceSerialize},ie),W[we][1])}if(ie.tokenStack.length>0){const He=ie.tokenStack[ie.tokenStack.length-1];(He[1]||n_).call(ie,void 0,He[0])}for(V.position={start:Fi(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Fi(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<t.transforms.length;)V=t.transforms[we](V)||V;return V}function i(W,V,ie){let he=V-1,we=-1,He=!1,ln,Tt,Un,wn;for(;++he<=ie;){const Re=W[he];switch(Re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Re[0]==="enter"?we++:we--,wn=void 0;break}case"lineEndingBlank":{Re[0]==="enter"&&(ln&&!wn&&!we&&!Un&&(Un=he),wn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wn=void 0}if(!we&&Re[0]==="enter"&&Re[1].type==="listItemPrefix"||we===-1&&Re[0]==="exit"&&(Re[1].type==="listUnordered"||Re[1].type==="listOrdered")){if(ln){let Wn=he;for(Tt=void 0;Wn--;){const $t=W[Wn];if($t[1].type==="lineEnding"||$t[1].type==="lineEndingBlank"){if($t[0]==="exit")continue;Tt&&(W[Tt][1].type="lineEndingBlank",He=!0),$t[1].type="lineEnding",Tt=Wn}else if(!($t[1].type==="linePrefix"||$t[1].type==="blockQuotePrefix"||$t[1].type==="blockQuotePrefixWhitespace"||$t[1].type==="blockQuoteMarker"||$t[1].type==="listItemIndent"))break}Un&&(!Tt||Un<Tt)&&(ln._spread=!0),ln.end=Object.assign({},Tt?W[Tt][1].start:Re[1].end),W.splice(Tt||he,0,["exit",ln,Re[2]]),he++,ie++}if(Re[1].type==="listItemPrefix"){const Wn={type:"listItem",_spread:!1,start:Object.assign({},Re[1].start),end:void 0};ln=Wn,W.splice(he,0,["enter",Wn,Re[2]]),he++,ie++,Un=void 0,wn=!0}}}return W[V][1]._spread=He,ie}function a(W,V){return ie;function ie(he){l.call(this,W(he),he),V&&V.call(this,he)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(W,V,ie){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([V,ie||void 0]),W.position={start:Fi(V.start),end:void 0}}function c(W){return V;function V(ie){W&&W.call(this,ie),u.call(this,ie)}}function u(W,V){const ie=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==W.type&&(V?V.call(this,W,he[0]):(he[1]||n_).call(this,W,he[0]));else throw new Error("Cannot close `"+W.type+"` ("+vc({start:W.start,end:W.end})+"): itโs not open");ie.position.end=Fi(W.end)}function d(){return z0(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(),ie=this.stack[this.stack.length-1];ie.label=V,ie.identifier=Lr(this.sliceSerialize(W)).toLowerCase()}function w(){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 ie=this.sliceSerialize(W).length;V.depth=ie}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function E(W){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function C(W){const ie=this.stack[this.stack.length-1].children;let he=ie[ie.length-1];(!he||he.type!=="text")&&(he=On(),he.position={start:Fi(W.start),end:void 0},ie.push(he)),this.stack.push(he)}function T(W){const V=this.stack.pop();V.value+=this.sliceSerialize(W),V.position.end=Fi(W.end)}function L(W){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ie=V.children[V.children.length-1];ie.position.end=Fi(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 B(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function I(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function F(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function z(){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 R(){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),ie=this.stack[this.stack.length-2];ie.label=cue(V),ie.identifier=Lr(V).toLowerCase()}function U(){const W=this.stack[this.stack.length-1],V=this.resume(),ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,ie.type==="link"){const he=W.children;ie.children=he}else ie.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 $(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function oe(W){const V=this.resume(),ie=this.stack[this.stack.length-1];ie.label=V,ie.identifier=Lr(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function be(W){this.data.characterReferenceType=W.type}function pe(W){const V=this.sliceSerialize(W),ie=this.data.characterReferenceType;let he;ie?(he=HR(V,ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=F0(V);const we=this.stack[this.stack.length-1];we.value+=he}function Ce(W){const V=this.stack.pop();V.position.end=Fi(W.end)}function G(W){T.call(this,W);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(W)}function Y(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 X(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ne(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function $e(){return{type:"html",value:""}}function fe(){return{type:"image",title:null,url:"",alt:null}}function et(){return{type:"link",title:null,url:"",children:[]}}function De(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Ee(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function qe(){return{type:"paragraph",children:[]}}function It(){return{type:"strong",children:[]}}function On(){return{type:"text",value:""}}function Qt(){return{type:"thematicBreak"}}}function Fi(e){return{line:e.line,column:e.column,offset:e.offset}}function tM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?tM(e,r):hue(e,r)}}function hue(e,t){let n;for(n in t)if(eM.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 n_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+vc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+vc({start:t.start,end:t.end})+") is still open")}function pue(e){const t=this;t.parser=n;function n(r){return due(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function mue(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 gue(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
168
|
-
`}]}function yue(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 vue(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bue(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xue(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=yl(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 wue(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 Sue(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function nM(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 kue(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nM(e,t);const i={src:yl(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 Nue(e,t){const n={src:yl(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 _ue(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nM(e,t);const i={href:yl(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 jue(e,t){const n={href:yl(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 Aue(e,t,n){const r=e.all(t),i=n?Cue(n):rM(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 Cue(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=rM(n[r])}return t}function rM(e){const t=e.spread;return t??e.children.length>1}function Tue(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 Oue(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pue(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Rue(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mue(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=$0(t.children[1]),c=$R(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 Iue(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 $ue(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const r_=9,i_=32;function Lue(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(a_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(a_(t.slice(i),i>0,!1)),a.join("")}function a_(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===r_||a===i_;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===r_||a===i_;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Due(e,t){const n={type:"text",value:Lue(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Bue(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zue={blockquote:mue,break:gue,code:yue,delete:vue,emphasis:bue,footnoteReference:xue,heading:wue,html:Sue,imageReference:kue,image:Nue,inlineCode:Eue,linkReference:_ue,link:jue,listItem:Aue,list:Tue,paragraph:Oue,root:Pue,strong:Rue,table:Mue,tableCell:$ue,tableRow:Iue,text:Due,thematicBreak:Bue,toml:Md,yaml:Md,definition:Md,footnoteDefinition:Md};function Md(){}const iM=-1,Zp=0,xc=1,Mh=2,W0=3,H0=4,G0=5,q0=6,aM=7,sM=8,oM=typeof self=="object"?self:globalThis,s_=(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 oM[e](t)},Fue=(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 Zp:case iM:return n(o,i);case xc:{const l=n([],i);for(const c of o)l.push(r(c));return l}case Mh:{const l=n({},i);for(const[c,u]of o)l[r(c)]=r(u);return l}case W0:return n(new Date(o),i);case H0:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case G0:{const l=n(new Map,i);for(const[c,u]of o)l.set(r(c),r(u));return l}case q0:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case aM:{const{name:l,message:c}=o;return n(typeof oM[l]=="function"?s_(l,c):new Error(c),i)}case sM: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(s_(a,o),i)};return r},o_=e=>Fue(new Map,e)(0),za="",{toString:Uue}={},{keys:Wue}=Object,Xl=e=>{const t=typeof e;if(t!=="object"||!e)return[Zp,t];const n=Uue.call(e).slice(8,-1);switch(n){case"Array":return[xc,za];case"Object":return[Mh,za];case"Date":return[W0,za];case"RegExp":return[H0,za];case"Map":return[G0,za];case"Set":return[q0,za];case"DataView":return[xc,n]}return n.includes("Array")?[xc,n]:e instanceof Error?[aM,e.name||"Error"]:[Mh,n]},Id=([e,t])=>e===Zp&&(t==="function"||t==="symbol"),Hue=(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]=Xl(o);switch(l){case Zp:{let d=o;switch(c){case"bigint":l=sM,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([iM],o)}return i([l,d],o)}case xc:{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 Mh:{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 Wue(o))(e||!Id(Xl(o[h])))&&d.push([a(h),a(o[h])]);return f}case W0:return i([l,isNaN(o.getTime())?za:o.toISOString()],o);case H0:{const{source:d,flags:f}=o;return i([l,{source:d,flags:f}],o)}case G0:{const d=[],f=i([l,d],o);for(const[h,p]of o)(e||!(Id(Xl(h))||Id(Xl(p))))&&d.push([a(h),a(p)]);return f}case q0:{const d=[],f=i([l,d],o);for(const h of o)(e||!Id(Xl(h)))&&d.push(a(h));return f}}const{message:u}=o;return i([l,{name:c,message:u}],o)};return a},l_=(e,{json:t,lossy:n}={})=>{const r=[];return Hue(!(t||n),!!t,new Map,r)(e),r},Ih=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?o_(l_(e,t)):structuredClone(e):(e,t)=>o_(l_(e,t));function Gue(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 que(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Kue(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Gue,r=e.options.footnoteBackLabel||que,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=yl(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:{...Ih(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 Fu=function(e){if(e==null)return Zue;if(typeof e=="function")return Qp(e);if(typeof e=="object")return Array.isArray(e)?Vue(e):Yue(e);if(typeof e=="string")return Xue(e);throw new Error("Expected function, string, or object as test")};function Vue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Fu(e[n]);return Qp(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Yue(e){const t=e;return Qp(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Xue(e){return Qp(t);function t(n){return n&&n.type===e}}function Qp(e){return t;function t(n,r,i){return!!(Que(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Zue(){return!0}function Que(e){return e!==null&&typeof e=="object"&&"type"in e}const lM=[],Jue=!0,vb=!1,ede="skip";function cM(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Fu(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=lM,g,m,v;if((!t||a(c,u,d[d.length-1]||void 0))&&(p=tde(n(c,d)),p[0]===vb))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==ede)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]===vb)return g;m=typeof g[1]=="number"?g[1]:m+o}}return p}}}function tde(e){return Array.isArray(e)?e:typeof e=="number"?[Jue,e]:e==null?lM:[e]}function Jp(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),cM(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 bb={}.hasOwnProperty,nde={};function rde(e,t){const n=t||nde,r=new Map,i=new Map,a=new Map,o={...zue,...n.handlers},l={all:u,applyData:ade,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:ide,wrap:ode};return Jp(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(bb.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=Ih(v);return y.children=l.all(d),y}return Ih(d)}return(l.options.unknownHandler||sde)(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=c_(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=c_(m.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function ide(e,t){e.position&&(t.position=qoe(e))}function ade(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,Ih(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function sde(e,t){const n=t.data||{},r="value"in t&&!(bb.call(n,"hProperties")||bb.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 ode(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 c_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function u_(e,t){const n=rde(e,t),r=n.one(e,void 0),i=Kue(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 lde(e,t){return e&&"run"in e?async function(n,r){const i=u_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return u_(n,{file:r,...e||t})}}function d_(e){if(e)throw e}var af=Object.prototype.hasOwnProperty,uM=Object.prototype.toString,f_=Object.defineProperty,h_=Object.getOwnPropertyDescriptor,p_=function(t){return typeof Array.isArray=="function"?Array.isArray(t):uM.call(t)==="[object Array]"},m_=function(t){if(!t||uM.call(t)!=="[object Object]")return!1;var n=af.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&af.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||af.call(t,i)},g_=function(t,n){f_&&n.name==="__proto__"?f_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},y_=function(t,n){if(n==="__proto__")if(af.call(t,n)){if(h_)return h_(t,n).value}else return;return t[n]},cde=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=y_(l,n),i=y_(t,n),l!==i&&(d&&i&&(m_(i)||(a=p_(i)))?(a?(a=!1,o=r&&p_(r)?r:[]):o=r&&m_(r)?r:{},g_(l,{name:n,newValue:e(d,o,i)})):typeof i<"u"&&g_(l,{name:n,newValue:i}));return l};const _g=Ze(cde);function xb(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 ude(){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?dde(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 dde(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 Vr={basename:fde,dirname:hde,extname:pde,join:mde,sep:"/"};function fde(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Uu(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 hde(e){if(Uu(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 pde(e){Uu(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 mde(...e){let t=-1,n;for(;++t<e.length;)Uu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":gde(n)}function gde(e){Uu(e);const t=e.codePointAt(0)===47;let n=yde(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yde(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 Uu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vde={cwd:bde};function bde(){return"/"}function wb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xde(e){if(typeof e=="string")e=new URL(e);else if(!wb(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 wde(e)}function wde(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 jg=["history","path","basename","stem","extname","dirname"];class dM{constructor(t){let n;t?wb(t)?n={path:t}:typeof t=="string"||Sde(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":vde.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<jg.length;){const a=jg[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)jg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Vr.basename(this.path):void 0}set basename(t){Cg(t,"basename"),Ag(t,"basename"),this.path=Vr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Vr.dirname(this.path):void 0}set dirname(t){v_(this.basename,"dirname"),this.path=Vr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Vr.extname(this.path):void 0}set extname(t){if(Ag(t,"extname"),v_(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=Vr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wb(t)&&(t=xde(t)),Cg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Vr.basename(this.path,this.extname):void 0}set stem(t){Cg(t,"stem"),Ag(t,"stem"),this.path=Vr.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 xn(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 Ag(e,t){if(e&&e.includes(Vr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Vr.sep+"`")}function Cg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function v_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Sde(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kde=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},Nde={}.hasOwnProperty;class K0 extends kde{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=ude()}copy(){const t=new K0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(_g(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Pg("data",this.frozen),this.namespace[t]=n,this):Nde.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pg("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=$d(t),r=this.parser||this.Parser;return Tg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Tg("process",this.parser||this.Parser),Og("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=$d(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);jde(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(),Tg("processSync",this.parser||this.Parser),Og("processSync",this.compiler||this.Compiler),this.process(t,i),x_("processSync","process",n),r;function i(a,o){n=!0,d_(a),r=o}}run(t,n,r){b_(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=$d(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),x_("runSync","run",r),i;function a(o,l){d_(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=$d(n),i=this.compiler||this.Compiler;return Og("stringify",i),b_(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Pg("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=_g(!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];xb(m)&&xb(p)&&(p=_g(!0,m,p)),r[h]=[u,p,...g]}}}}const Ede=new K0().freeze();function Tg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Og(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pg(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 b_(e){if(!xb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function x_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $d(e){return _de(e)?e:new dM(e)}function _de(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jde(e){return typeof e=="string"||Ade(e)}function Ade(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Cde="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",w_=[],S_={allowDangerousHtml:!0},Tde=/^(https?|ircs?|mailto|xmpp)$/i,Ode=[{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 Pde(e){const t=Rde(e),n=Mde(e);return Ide(t.runSync(t.parse(n),n),e)}function Rde(e){const t=e.rehypePlugins||w_,n=e.remarkPlugins||w_,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...S_}:S_;return Ede().use(pue).use(n).use(lde,r).use(t)}function Mde(e){const t=e.children||"",n=new dM;return typeof t=="string"&&(n.value=t),n}function Ide(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||$de;for(const d of Ode)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Cde+d.id,void 0);return Jp(e,u),Zoe(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 kg)if(Object.hasOwn(kg,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],m=kg[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 $de(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||Tde.test(e.slice(0,t))?e:""}function k_(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 Lde(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Dde(e,t,n){const i=Fu((n||{}).ignore||[]),a=Bde(t);let o=-1;for(;++o<a.length;)cM(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 w=h.exec(u.value);for(;w;){const k=w.index,S={index:w.index,input:w.input,stack:[...d,u]};let x=p(...w,S);if(typeof x=="string"&&(x=x.length>0?{type:"text",value:x}:void 0),x===!1?h.lastIndex=k+1:(g!==k&&b.push({type:"text",value:u.value.slice(g,k)}),Array.isArray(x)?b.push(...x):x&&b.push(x),g=k+w[0].length,y=!0),!h.global)break;w=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 Bde(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([zde(i[0]),Fde(i[1])])}return t}function zde(e){return typeof e=="string"?new RegExp(Lde(e),"g"):e}function Fde(e){return typeof e=="function"?e:function(){return e}}const Rg="phrasing",Mg=["autolink","link","image","label"];function Ude(){return{transforms:[Yde],enter:{literalAutolink:Hde,literalAutolinkEmail:Ig,literalAutolinkHttp:Ig,literalAutolinkWww:Ig},exit:{literalAutolink:Vde,literalAutolinkEmail:Kde,literalAutolinkHttp:Gde,literalAutolinkWww:qde}}}function Wde(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Rg,notInConstruct:Mg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Rg,notInConstruct:Mg},{character:":",before:"[ps]",after:"\\/",inConstruct:Rg,notInConstruct:Mg}]}}function Hde(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ig(e){this.config.enter.autolinkProtocol.call(this,e)}function Gde(e){this.config.exit.autolinkProtocol.call(this,e)}function qde(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 Kde(e){this.config.exit.autolinkEmail.call(this,e)}function Vde(e){this.exit(e)}function Yde(e){Dde(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Xde],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Zde]],{ignore:["link","linkReference"]})}function Xde(e,t,n,r,i){let a="";if(!fM(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!Qde(n)))return!1;const o=Jde(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 Zde(e,t,n,r){return!fM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Qde(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 Jde(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=k_(e,"(");let a=k_(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 fM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gs(n)||Yp(n))&&(!t||n!==47)}hM.peek=lfe;function efe(){this.buffer()}function tfe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function nfe(){this.buffer()}function rfe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ife(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function afe(e){this.exit(e)}function sfe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Lr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ofe(e){this.exit(e)}function lfe(){return"["}function hM(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 cfe(){return{enter:{gfmFootnoteCallString:efe,gfmFootnoteCall:tfe,gfmFootnoteDefinitionLabelString:nfe,gfmFootnoteDefinition:rfe},exit:{gfmFootnoteCallString:ife,gfmFootnoteCall:afe,gfmFootnoteDefinitionLabelString:sfe,gfmFootnoteDefinition:ofe}}}function ufe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:hM},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?pM:dfe))),u(),c}}function dfe(e,t,n){return t===0?e:pM(e,t,n)}function pM(e,t,n){return(n?"":" ")+e}const ffe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mM.peek=yfe;function hfe(){return{canContainEols:["delete"],enter:{strikethrough:mfe},exit:{strikethrough:gfe}}}function pfe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ffe}],handlers:{delete:mM}}}function mfe(e){this.enter({type:"delete",children:[]},e)}function gfe(e){this.exit(e)}function mM(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 yfe(){return"~"}function vfe(e){return e.length}function bfe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||vfe,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=xfe(e[d][y]);if(n.alignDelimiters!==!1){const w=i(b);v[y]=w,(c[y]===void 0||w>c[y])&&(c[y]=w)}m.push(b)}o[d]=m,l[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)a[f]=N_(r[f]);else{const m=N_(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 w=v+"-".repeat(b)+y;n.alignDelimiters!==!1&&(b=v.length+b+y.length,b>c[f]&&(c[f]=b),p[f]=b),h[f]=w}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 w="",k="";if(n.alignDelimiters!==!1){const S=c[f]-(v[f]||0),x=a[f];x===114?w=" ".repeat(S):x===99?S%2?(w=" ".repeat(S/2+.5),k=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),k=w):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(w),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 xfe(e){return e==null?"":String(e)}function N_(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 wfe(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()),Sfe);return i(),o}function Sfe(e,t,n){return">"+(n?"":" ")+e}function kfe(e,t){return E_(e,t.inConstruct,!0)&&!E_(e,t.notInConstruct,!1)}function E_(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 __(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
180
|
-
`&&kfe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
181
|
-
`}function Nfe(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 _fe(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 jfe(e,t,n,r){const i=_fe(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Efe(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,Afe);return f(),h}const l=n.createTracker(r),c=i.repeat(Math.max(Nfe(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 Afe(e,t,n){return(n?"":" ")+e}function V0(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 Cfe(e,t,n,r){const i=V0(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 Tfe(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 ku(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $h(e,t,n){const r=Xo(e),i=Xo(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}}gM.peek=Ofe;function gM(e,t,n,r){const i=Tfe(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=$h(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=ku(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=$h(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+ku(f));const p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function Ofe(e,t,n){return n.options.emphasis||"*"}function Pfe(e,t){let n=!1;return Jp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,vb}),!!((!e.depth||e.depth<3)&&z0(e)&&(t.options.setext||n))}function Rfe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Pfe(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=ku(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}yM.peek=Mfe;function yM(e){return e.value||""}function Mfe(){return"<"}vM.peek=Ife;function vM(e,t,n,r){const i=V0(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 Ife(){return"!"}bM.peek=$fe;function bM(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 $fe(){return"!"}xM.peek=Lfe;function xM(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 Lfe(){return"`"}function wM(e,t){const n=z0(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))}SM.peek=Dfe;function SM(e,t,n,r){const i=V0(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(wM(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 Dfe(e,t,n){return wM(e,n)?"<":"["}kM.peek=Bfe;function kM(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 Bfe(){return"["}function Y0(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 zfe(e){const t=Y0(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 Ffe(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 NM(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 Ufe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?Ffe(n):Y0(n);const l=e.ordered?o==="."?")":".":zfe(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),NM(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 Wfe(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 Hfe(e,t,n,r){const i=Wfe(n);let a=n.bulletCurrent||Y0(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 Gfe(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const qfe=Fu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Kfe(e,t,n,r){return(e.children.some(function(o){return qfe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Vfe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}EM.peek=Yfe;function EM(e,t,n,r){const i=Vfe(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=$h(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=ku(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=$h(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+ku(f));const p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function Yfe(e,t,n){return n.options.strong||"*"}function Xfe(e,t,n,r){return n.safe(e.value,r)}function Zfe(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 Qfe(e,t,n){const r=(NM(n)+(n.options.ruleSpaces?" ":"")).repeat(Zfe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const _M={blockquote:wfe,break:__,code:jfe,definition:Cfe,emphasis:gM,hardBreak:__,heading:Rfe,html:yM,image:vM,imageReference:bM,inlineCode:xM,link:SM,linkReference:kM,list:Ufe,listItem:Hfe,paragraph:Gfe,root:Kfe,strong:EM,text:Xfe,thematicBreak:Qfe};function Jfe(){return{enter:{table:ehe,tableData:j_,tableHeader:j_,tableRow:nhe},exit:{codeText:rhe,table:the,tableData:$g,tableHeader:$g,tableRow:$g}}}function ehe(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 the(e){this.exit(e),this.data.inTable=void 0}function nhe(e){this.enter({type:"tableRow",children:[]},e)}function $g(e){this.exit(e)}function j_(e){this.enter({type:"tableCell",children:[]},e)}function rhe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ihe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ihe(e,t){return t==="|"?t:e}function ahe(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"),w=m.containerPhrasing(p,{...v,before:a,after:a});return b(),y(),w}function u(p,g){return bfe(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,m){const v=p.children;let y=-1;const b=[],w=g.enter("table");for(;++y<v.length;)b[y]=f(v[y],g,m);return w(),b}function f(p,g,m){const v=p.children;let y=-1;const b=[],w=g.enter("tableRow");for(;++y<v.length;)b[y]=c(v[y],p,g,m);return w(),b}function h(p,g,m){let v=_M.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function she(){return{exit:{taskListCheckValueChecked:A_,taskListCheckValueUnchecked:A_,paragraph:lhe}}}function ohe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:che}}}function A_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function lhe(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 che(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=_M.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 uhe(){return[Ude(),cfe(),hfe(),Jfe(),she()]}function dhe(e){return{extensions:[Wde(),ufe(e),pfe(),ahe(e),ohe()]}}const fhe={tokenize:vhe,partial:!0},jM={tokenize:bhe,partial:!0},AM={tokenize:xhe,partial:!0},CM={tokenize:whe,partial:!0},hhe={tokenize:She,partial:!0},TM={name:"wwwAutolink",tokenize:ghe,previous:PM},OM={name:"protocolAutolink",tokenize:yhe,previous:RM},$i={name:"emailAutolink",tokenize:mhe,previous:MM},si={};function phe(){return{text:si}}let Ra=48;for(;Ra<123;)si[Ra]=$i,Ra++,Ra===58?Ra=65:Ra===91&&(Ra=97);si[43]=$i;si[45]=$i;si[46]=$i;si[95]=$i;si[72]=[$i,OM];si[104]=[$i,OM];si[87]=[$i,TM];si[119]=[$i,TM];function mhe(e,t,n){const r=this;let i,a;return o;function o(f){return!Sb(f)||!MM.call(r,r.previous)||X0(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(hhe,d,u)(f):f===45||f===95||vn(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&&_n(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function ghe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!PM.call(r,r.previous)||X0(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(fhe,e.attempt(jM,e.attempt(AM,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function yhe(e,t,n){const r=this;let i="",a=!1;return o;function o(f){return(f===72||f===104)&&RM.call(r,r.previous)&&!X0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(_n(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||Rh(f)||ot(f)||gs(f)||Yp(f)?n(f):e.attempt(jM,e.attempt(AM,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function vhe(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 bhe(e,t,n){let r,i,a;return o;function o(u){return u===46||u===95?e.check(CM,c,l)(u):u===null||ot(u)||gs(u)||u!==45&&Yp(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 xhe(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(CM,t,a)(o):o===null||ot(o)||gs(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function whe(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||ot(l)||gs(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||ot(l)||gs(l)?t(l):r(l)}function a(l){return _n(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):_n(l)?(e.consume(l),o):n(l)}}function She(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return vn(a)?n(a):t(a)}}function PM(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ot(e)}function RM(e){return!_n(e)}function MM(e){return!(e===47||Sb(e))}function Sb(e){return e===43||e===45||e===46||e===95||vn(e)}function X0(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 khe={tokenize:Ohe,partial:!0};function Nhe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ahe,continuation:{tokenize:Che},exit:The}},text:{91:{name:"gfmFootnoteCall",tokenize:jhe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ehe,resolveTo:_he}}}}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=Lr(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 _he(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 jhe(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||ot(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Lr(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ot(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 Ahe(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||ot(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return a=Lr(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ot(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),Ue(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function Che(e,t,n){return e.check(zu,t,e.attempt(khe,t,n))}function The(e){e.exit("gfmFootnoteDefinition")}function Ohe(e,t,n){const r=this;return Ue(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 Phe(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&&tr(h,h.length,0,Xp(p,o.slice(u+1,c),l)),tr(h,h.length,0,[["exit",f,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),tr(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=Xo(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=Xo(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,l(g)}}}class Rhe{constructor(){this.map=[]}add(t,n,r){Mhe(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 Mhe(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 Ihe(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 $he(){return{flow:{null:{name:"table",tokenize:Lhe,resolveAll:Dhe}}}}function Lhe(e,t,n){const r=this;let i=0,a=0,o;return l;function l(T){let L=r.events.length-1;for(;L>-1;){const I=r.events[L][1].type;if(I==="lineEnding"||I==="linePrefix")L--;else break}const M=L>-1?r.events[L][1].type:null,B=M==="tableHead"||M==="tableRow"?x:c;return B===x&&r.parser.lazy[r.now().line]?n(T):B(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):Ae(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)?Ue(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||ot(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)?Ue(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)?Ue(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||Ae(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"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return Be(T)?Ue(e,k,"whitespace")(T):k(T)}function k(T){return T===124?g(T):T===null||Ae(T)?!o||i!==a?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function x(T){return e.enter("tableRow"),E(T)}function E(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),E):T===null||Ae(T)?(e.exit("tableRow"),t(T)):Be(T)?Ue(e,E,"whitespace")(T):(e.enter("data"),_(T))}function _(T){return T===null||T===124||ot(T)?(e.exit("data"),E(T)):(e.consume(T),T===92?C:_)}function C(T){return T===92||T===124?(e.consume(T),_):_(T)}}function Dhe(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 Rhe;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(C_(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=Ld(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=Ld(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=Ld(h,t,a,i,n,f)):o[1]!==0&&(f=Ld(h,t,o,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&C_(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=Ihe(t.events,n))}return e}function Ld(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Hs(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Hs(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=Hs(t.events,n[2]),d=Hs(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({},Hs(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function C_(e,t,n,r,i){const a=[],o=Hs(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 Hs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Bhe={name:"tasklistCheck",tokenize:Fhe};function zhe(){return{text:{91:Bhe}}}function Fhe(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 ot(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 Ae(c)?t(c):Be(c)?e.check({tokenize:Uhe},t,n)(c):n(c)}}function Uhe(e,t,n){return Ue(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Whe(e){return WR([phe(),Nhe(),Phe(e),$he(),zhe()])}const Hhe={};function Ghe(e){const t=this,n=e||Hhe,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Whe(n)),a.push(uhe()),o.push(dhe(n))}const T_=function(e,t,n){const r=Fu(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]},Ns=function(e){if(e==null)return Vhe;if(typeof e=="string")return Khe(e);if(typeof e=="object")return qhe(e);if(typeof e=="function")return Z0(e);throw new Error("Expected function, string, or array as `test`")};function qhe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ns(e[n]);return Z0(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Khe(e){return Z0(t);function t(n){return n.tagName===e}}function Z0(e){return t;function t(n,r,i){return!!(Yhe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Vhe(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Yhe(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const O_=/\n/g,P_=/[\t ]+/g,kb=Ns("br"),R_=Ns(rpe),Xhe=Ns("p"),M_=Ns("tr"),Zhe=Ns(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",npe,ipe]),IM=Ns(["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 Qhe(e,t){const n=t||{},r="children"in e?e.children:[],i=IM(e),a=DM(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...LM(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)o.push(...$M(r[l],e,{whitespace:a,breakBefore:l?void 0:i,breakAfter:l<r.length-1?kb(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 $M(e,t,n){return e.type==="element"?Jhe(e,t,n):e.type==="text"?n.whitespace==="normal"?LM(e,n):epe(e):[]}function Jhe(e,t,n){const r=DM(e,n),i=e.children||[];let a=-1,o=[];if(Zhe(e))return o;let l,c;for(kb(e)||M_(e)&&T_(t,e,M_)?c=`
|
|
194
|
-
`:Xhe(e)?(l=2,c=2):IM(e)&&(l=1,c=1);++a<i.length;)o=o.concat($M(i[a],e,{whitespace:r,breakBefore:a?void 0:l,breakAfter:a<i.length-1?kb(i[a+1]):c}));return R_(e)&&T_(t,e,R_)&&o.push(" "),l&&o.unshift(l),c&&o.push(c),o}function LM(e,t){const n=String(e.value),r=[],i=[];let a=0;for(;a<=n.length;){O_.lastIndex=a;const c=O_.exec(n),u=c&&"index"in c?c.index:n.length;r.push(tpe(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 epe(e){return[String(e.value)]}function tpe(e,t,n){const r=[];let i=0,a;for(;i<e.length;){P_.lastIndex=i;const o=P_.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 DM(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 npe(e){return!!(e.properties||{}).hidden}function rpe(e){return e.tagName==="td"||e.tagName==="th"}function ipe(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function ape(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*\(/))},x=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:x.concat([{begin:/\(/,end:/\)/,keywords:k,contains:x.concat(["self"]),relevance:0}]),relevance:0},_={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(E,_,S,x,[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 spe(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=ape(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 ope(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"],w=["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,...w,"set","shopt",...k,...S]},contains:[p,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function lpe(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},w={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,w,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 cpe(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*\(/))},x=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:x.concat([{begin:/\(/,end:/\)/,keywords:k,contains:x.concat(["self"]),relevance:0}]),relevance:0},_={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(E,_,S,x,[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 upe(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]},w=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:"("+w+"\\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 dpe=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_-]*/}}),fpe=["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"],hpe=["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"],ppe=[...fpe,...hpe],mpe=["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(),gpe=["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(),ype=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vpe=["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=e.regex,n=dpe(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:":("+gpe.join("|")+")"},{begin:":(:)?("+ype.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vpe.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:mpe.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ppe.join("|")+")\\b"}]}}function xpe(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 wpe(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 Spe(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 kpe(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 Gs="[0-9](_*[0-9])*",Dd=`\\.(${Gs})`,Bd="[0-9a-fA-F](_*[0-9a-fA-F])*",I_={className:"number",variants:[{begin:`(\\b(${Gs})((${Dd})|\\.)?|(${Dd}))[eE][+-]?(${Gs})[fFdD]?\\b`},{begin:`\\b(${Gs})((${Dd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Dd})[fFdD]?\\b`},{begin:`\\b(${Gs})[fFdD]\\b`},{begin:`\\b0[xX]((${Bd})\\.?|(${Bd})?\\.(${Bd}))[pP][+-]?(${Gs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Bd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function BM(e,t,n){return n===-1?"":e.replace(t,r=>BM(e,t,n-1))}function Npe(e){const t=e.regex,n="[ร-สธa-zA-Z_$][ร-สธa-zA-Z_$0-9]*",r=n+BM("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,I_,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},I_,u]}}const $_="[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"],_pe=["true","false","null","undefined","NaN","Infinity"],zM=["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"],FM=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],UM=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],jpe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ape=[].concat(UM,zM,FM);function Cpe(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=$_,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let $;const P=O.input.substring(A);if($=P.match(/^\s*=/)){U.ignoreMatch();return}if(($=P.match(/^\s+extends\s+/))&&$.index===0){U.ignoreMatch();return}}},l={$pattern:$_,keyword:Epe,literal:_pe,built_in:Ape,"variable.language":jpe},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]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={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"}}]},_={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:{_:[...zM,...FM]}},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:[x],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,M([...UM,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:_},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,_,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{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:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains: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:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},B,L,E,F,{match:/\$[(.]/}]}}const Tpe="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",Ope={scope:"number",match:Tpe,relevance:0};function Ppe(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,Ope,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var qs="[0-9](_*[0-9])*",zd=`\\.(${qs})`,Fd="[0-9a-fA-F](_*[0-9a-fA-F])*",Rpe={className:"number",variants:[{begin:`(\\b(${qs})((${zd})|\\.)?|(${zd}))[eE][+-]?(${qs})[fFdD]?\\b`},{begin:`\\b(${qs})((${zd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${zd})[fFdD]?\\b`},{begin:`\\b(${qs})[fFdD]\\b`},{begin:`\\b0[xX]((${Fd})\\.?|(${Fd})?\\.(${Fd}))[pP][+-]?(${qs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Fd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Mpe(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=Rpe,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 Ipe=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_-]*/}}),$pe=["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"],Lpe=["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"],Dpe=[...$pe,...Lpe],Bpe=["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(),WM=["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(),HM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),zpe=["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(),Fpe=WM.concat(HM).sort().reverse();function Upe(e){const t=Ipe(e),n=Fpe,r="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",o=[],l=[],c=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},u=function(w,k,S){return{className:w,begin:k,relevance:S}},d={$pattern:/[a-z-]+/,keyword:r,attribute:Bpe.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("+zpe.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("+Dpe.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:":("+WM.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+HM.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 Wpe(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 Hpe(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 Gpe(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 qpe(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 Kpe(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 Vpe(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":(I,F)=>{F.data._beginMatch=I[1]||I[2]},"on:end":(I,F)=>{F.data._beginMatch!==I[1]&&F.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
|
|
196
|
-
]`,g={scope:"string",variants:[d,u,f,h]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},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:(I=>{const F=[];return I.forEach(z=>{F.push(z),z.toLowerCase()===z?F.push(z.toUpperCase()):F.push(z.toLowerCase())}),F})(v),built_in:b},S=I=>I.map(F=>F.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",S(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},E=t.concat(r,"\\b(?!\\()"),_={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),E],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,_,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,x]},L={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(L);const M=[C,_,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,x],B={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:[B,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,L,_,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{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",B,o,_,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 Ype(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 Xpe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Zpe(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 Qpe(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Jpe(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 eme(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}]},x=[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=x,m.contains=x;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:x}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:x}}];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(x)}}function tme(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 nme=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_-]*/}}),rme=["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"],ime=["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"],ame=[...rme,...ime],sme=["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(),ome=["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(),lme=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cme=["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 ume(e){const t=nme(e),n=lme,r=ome,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("+ame.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("+cme.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:sme.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 dme(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function fme(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(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:b(h),relevance:0};function k(S,{exceptions:x,when:E}={}){const _=E;return x=x||[],S.map(C=>C.match(/\|\d+$/)||x.includes(C)?C:_(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)},w,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function GM(e){return e?typeof e=="string"?e:e.source:null}function Zl(e){return nt("(?=",e,")")}function nt(...e){return e.map(n=>GM(n)).join("")}function hme(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Nn(...e){return"("+(hme(e).capture?"":"?:")+e.map(r=>GM(r)).join("|")+")"}const Q0=e=>nt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),pme=["Protocol","Type"].map(Q0),L_=["init","self"].map(Q0),mme=["Any","Self"],Lg=["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"],D_=["false","nil","true"],gme=["assignment","associativity","higherThan","left","lowerThan","none","right"],yme=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],B_=["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"],qM=Nn(/[/=\-+!*%<>&|^~?]/,/[\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]/),KM=Nn(qM,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Dg=nt(qM,KM,"*"),VM=Nn(/[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]/),Lh=Nn(VM,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qr=nt(VM,Lh,"*"),Ud=nt(/[A-Z]/,Lh,"*"),vme=["attached","autoclosure",nt(/convention\(/,Nn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,qr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],bme=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function xme(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Nn(...pme,...L_)],className:{2:"keyword"}},a={match:nt(/\./,Nn(...Lg)),relevance:0},o=Lg.filter(ge=>typeof ge=="string").concat(["_|0"]),l=Lg.filter(ge=>typeof ge!="string").concat(mme).map(Q0),c={variants:[{className:"keyword",match:Nn(...l,...L_)}]},u={$pattern:Nn(/\b\w+/,/#\w+/),keyword:o.concat(yme),literal:D_},d=[i,a,c],f={match:nt(/\./,Nn(...B_)),relevance:0},h={className:"built_in",match:nt(/\b/,Nn(...B_),/(?=\()/)},p=[f,h],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:Dg},{match:`\\.(\\.|${KM})+`}]},v=[g,m],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",w={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=(ge="")=>({className:"subst",variants:[{match:nt(/\\/,ge,/[0\\tnr"']/)},{match:nt(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(ge="")=>({className:"subst",match:nt(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),x=(ge="")=>({className:"subst",label:"interpol",begin:nt(/\\/,ge,/\(/),end:/\)/}),E=(ge="")=>({begin:nt(ge,/"""/),end:nt(/"""/,ge),contains:[k(ge),S(ge),x(ge)]}),_=(ge="")=>({begin:nt(ge,/"/),end:nt(/"/,ge),contains:[k(ge),x(ge)]}),C={className:"string",variants:[E(),E("#"),E("##"),E("###"),_(),_("#"),_("##"),_("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],L={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},M=ge=>{const $e=nt(ge,/\//),fe=nt(/\//,ge);return{begin:$e,end:fe,contains:[...T,{scope:"comment",begin:`#(?!.*${fe})`,end:/$/}]}},B={scope:"regexp",variants:[M("###"),M("##"),M("#"),L]},I={match:nt(/`/,qr,/`/)},F={className:"variable",match:/\$\d+/},z={className:"variable",match:`\\$${Lh}+`},R=[I,F,z],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:bme,contains:[...v,w,C]}]}},U={scope:"keyword",match:nt(/@/,Nn(...vme),Zl(Nn(/\(/,/\s+/)))},A={scope:"meta",match:nt(/@/,qr)},Z=[O,U,A],$={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)/,Lh,"+")},{className:"type",match:Ud,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,Zl(Ud)),relevance:0}]},P={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...Z,g,$]};$.contains.push(P);const oe={match:nt(qr,/\s*:/),keywords:"_|0",relevance:0},be={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",oe,...r,B,...d,...p,...v,w,C,...R,...Z,$]},pe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,$]},Ce={begin:Nn(Zl(nt(qr,/\s*:/)),Zl(nt(qr,/\s+/,qr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qr}]},G={begin:/\(/,end:/\)/,keywords:u,contains:[Ce,...r,...d,...v,w,C,...Z,$,be],endsParent:!0,illegal:/["']/},Y={match:[/(func|macro)/,/\s+/,Nn(I.match,qr,Dg)],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+/,Dg],className:{1:"keyword",3:"title"}},X={begin:[/precedencegroup/,/\s+/,Ud],className:{1:"keyword",3:"title"},contains:[$],keywords:[...gme,...D_],end:/}/},je={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ne={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},_e={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[pe,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Ud},...d],relevance:0}]};for(const ge of C.variants){const $e=ge.contains.find(et=>et.label==="interpol");$e.keywords=u;const fe=[...d,...p,...v,w,C,...R];$e.contains=[...fe,{begin:/\(/,end:/\)/,contains:["self",...fe]}]}return{name:"Swift",keywords:u,contains:[...r,Y,ae,je,Ne,_e,le,X,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},B,...d,...p,...v,w,C,...R,...Z,$,be]}}const Dh="[A-Za-z$_][0-9A-Za-z$_]*",YM=["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"],XM=["true","false","null","undefined","NaN","Infinity"],ZM=["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"],QM=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],JM=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],e2=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],t2=[].concat(JM,ZM,QM);function wme(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=Dh,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let $;const P=O.input.substring(A);if($=P.match(/^\s*=/)){U.ignoreMatch();return}if(($=P.match(/^\s+extends\s+/))&&$.index===0){U.ignoreMatch();return}}},l={$pattern:Dh,keyword:YM,literal:XM,built_in:t2,"variable.language":e2},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]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={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"}}]},_={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:{_:[...ZM,...QM]}},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:[x],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,M([...JM,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:_},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,_,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{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:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains: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:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},B,L,E,F,{match:/\$[(.]/}]}}function Sme(e){const t=e.regex,n=wme(e),r=Dh,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:Dh,keyword:YM.concat(c),literal:XM,built_in:t2.concat(i),"variable.language":e2},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(w=>w.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 kme(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 Nme(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 _me(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 jme={arduino:spe,bash:ope,c:lpe,cpp:cpe,csharp:upe,css:bpe,diff:xpe,go:wpe,graphql:Spe,ini:kpe,java:Npe,javascript:Cpe,json:Ppe,kotlin:Mpe,less:Upe,lua:Wpe,makefile:Hpe,markdown:Gpe,objectivec:qpe,perl:Kpe,php:Vpe,"php-template":Ype,plaintext:Xpe,python:Zpe,"python-repl":Qpe,r:Jpe,ruby:eme,rust:tme,scss:ume,shell:dme,sql:fme,swift:xme,typescript:Sme,vbnet:kme,wasm:Nme,xml:Eme,yaml:_me};function n2(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)&&n2(n)}),e}class z_{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r2(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ea(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 Ame="</span>",F_=e=>!!e.scope,Cme=(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 Tme{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=r2(t)}openNode(t){if(!F_(t))return;const n=Cme(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){F_(t)&&(this.buffer+=Ame)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const U_=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class J0{constructor(){this.rootNode=U_(),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=U_({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=>{J0._collapse(n)}))}}class Ome extends J0{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 Tme(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Nu(e){return e?typeof e=="string"?e:e.source:null}function i2(e){return Es("(?=",e,")")}function Pme(e){return Es("(?:",e,")*")}function Rme(e){return Es("(?:",e,")?")}function Es(...e){return e.map(n=>Nu(n)).join("")}function Mme(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ew(...e){return"("+(Mme(e).capture?"":"?:")+e.map(r=>Nu(r)).join("|")+")"}function a2(e){return new RegExp(e.toString()+"|").exec("").length-1}function Ime(e,t){const n=e&&e.exec(t);return n&&n.index===0}const $me=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function tw(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let a=Nu(r),o="";for(;a.length>0;){const l=$me.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 Lme=/\b\B/,s2="[a-zA-Z]\\w*",nw="[a-zA-Z_]\\w*",o2="\\b\\d+(\\.\\d+)?",l2="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",c2="\\b(0b[01]+)",Dme="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Bme=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Es(t,/.*\b/,e.binary,/\b.*/)),ea({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Eu={begin:"\\\\[\\s\\S]",relevance:0},zme={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Eu]},Fme={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Eu]},Ume={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/},em=function(e,t,n={}){const r=ea({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=ew("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Es(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Wme=em("//","$"),Hme=em("/\\*","\\*/"),Gme=em("#","$"),qme={scope:"number",begin:o2,relevance:0},Kme={scope:"number",begin:l2,relevance:0},Vme={scope:"number",begin:c2,relevance:0},Yme={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Eu,{begin:/\[/,end:/\]/,relevance:0,contains:[Eu]}]},Xme={scope:"title",begin:s2,relevance:0},Zme={scope:"title",begin:nw,relevance:0},Qme={begin:"\\.\\s*"+nw,relevance:0},Jme=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 Wd=Object.freeze({__proto__:null,APOS_STRING_MODE:zme,BACKSLASH_ESCAPE:Eu,BINARY_NUMBER_MODE:Vme,BINARY_NUMBER_RE:c2,COMMENT:em,C_BLOCK_COMMENT_MODE:Hme,C_LINE_COMMENT_MODE:Wme,C_NUMBER_MODE:Kme,C_NUMBER_RE:l2,END_SAME_AS_BEGIN:Jme,HASH_COMMENT_MODE:Gme,IDENT_RE:s2,MATCH_NOTHING_RE:Lme,METHOD_GUARD:Qme,NUMBER_MODE:qme,NUMBER_RE:o2,PHRASAL_WORDS_MODE:Ume,QUOTE_STRING_MODE:Fme,REGEXP_MODE:Yme,RE_STARTERS_RE:Dme,SHEBANG:Bme,TITLE_MODE:Xme,UNDERSCORE_IDENT_RE:nw,UNDERSCORE_TITLE_MODE:Zme});function ege(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function tge(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function nge(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ege,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function rge(e,t){Array.isArray(e.illegal)&&(e.illegal=ew(...e.illegal))}function ige(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 age(e,t){e.relevance===void 0&&(e.relevance=1)}const sge=(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=Es(n.beforeMatch,i2(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},oge=["of","and","for","in","not","or","if","then","parent","list","value"],lge="keyword";function u2(e,t,n=lge){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,u2(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,cge(c[0],c[1])]})}}function cge(e,t){return t?Number(t):uge(e)?0:1}function uge(e){return oge.includes(e.toLowerCase())}const W_={},as=e=>{console.error(e)},H_=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ws=(e,t)=>{W_[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),W_[`${e}/${t}`]=!0)},Bh=new Error;function d2(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+=a2(t[l-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function dge(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw as("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Bh;if(typeof e.beginScope!="object"||e.beginScope===null)throw as("beginScope must be object"),Bh;d2(e,e.begin,{key:"beginScope"}),e.begin=tw(e.begin,{joinWith:""})}}function fge(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw as("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Bh;if(typeof e.endScope!="object"||e.endScope===null)throw as("endScope must be object"),Bh;d2(e,e.end,{key:"endScope"}),e.end=tw(e.end,{joinWith:""})}}function hge(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function pge(e){hge(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),dge(e),fge(e)}function mge(e){function t(o,l){return new RegExp(Nu(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+=a2(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(tw(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class 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;[tge,ige,pge,sge].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[nge,rge,age].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=u2(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=Nu(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 gge(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=ea(e.classNameAliases||{}),a(e)}function f2(e){return e?e.endsWithParent||f2(e.starts):!1}function gge(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ea(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:f2(e)?ea(e,{starts:e.starts?ea(e.starts):null}):Object.isFrozen(e)?ea(e):e}var yge="11.11.2";class vge extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Bg=r2,G_=ea,q_=Symbol("nomatch"),bge=7,h2=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:Ome};function c(z){return l.noHighlightRe.test(z)}function u(z){let R=z.className+" ";R+=z.parentNode?z.parentNode.className:"";const O=l.languageDetectRe.exec(R);if(O){const U=_(O[1]);return U||(H_(a.replace("{}",O[1])),H_("Falling back to no-highlight mode for this block.",z)),U?O[1]:"no-highlight"}return R.split(/\s+/).find(U=>c(U)||_(U))}function d(z,R,O){let U="",A="";typeof R=="object"?(U=z,O=R.ignoreIllegals,A=R.language):(Ws("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ws("10.7.0",`Please use highlight(code, options) instead.
|
|
197
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),A=z,U=R),O===void 0&&(O=!0);const Z={code:U,language:A};I("before:highlight",Z);const $=Z.result?Z.result:f(Z.language,Z.code,O);return $.code=Z.code,I("after:highlight",$),$}function f(z,R,O,U){const A=Object.create(null);function Z(W,V){return W.keywords[V]}function $(){if(!fe.keywords){De.addText(Ee);return}let W=0;fe.keywordPatternRe.lastIndex=0;let V=fe.keywordPatternRe.exec(Ee),ie="";for(;V;){ie+=Ee.substring(W,V.index);const he=_e.case_insensitive?V[0].toLowerCase():V[0],we=Z(fe,he);if(we){const[He,ln]=we;if(De.addText(ie),ie="",A[he]=(A[he]||0)+1,A[he]<=bge&&(qe+=ln),He.startsWith("_"))ie+=V[0];else{const Tt=_e.classNameAliases[He]||He;be(V[0],Tt)}}else ie+=V[0];W=fe.keywordPatternRe.lastIndex,V=fe.keywordPatternRe.exec(Ee)}ie+=Ee.substring(W),De.addText(ie)}function P(){if(Ee==="")return;let W=null;if(typeof fe.subLanguage=="string"){if(!t[fe.subLanguage]){De.addText(Ee);return}W=f(fe.subLanguage,Ee,!0,et[fe.subLanguage]),et[fe.subLanguage]=W._top}else W=p(Ee,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(qe+=W.relevance),De.__addSublanguage(W._emitter,W.language)}function oe(){fe.subLanguage!=null?P():$(),Ee=""}function be(W,V){W!==""&&(De.startScope(V),De.addText(W),De.endScope())}function pe(W,V){let ie=1;const he=V.length-1;for(;ie<=he;){if(!W._emit[ie]){ie++;continue}const we=_e.classNameAliases[W[ie]]||W[ie],He=V[ie];we?be(He,we):(Ee=He,$(),Ee=""),ie++}}function Ce(W,V){return W.scope&&typeof W.scope=="string"&&De.openNode(_e.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(be(Ee,_e.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Ee=""):W.beginScope._multi&&(pe(W.beginScope,V),Ee="")),fe=Object.create(W,{parent:{value:fe}}),fe}function G(W,V,ie){let he=Ime(W.endRe,ie);if(he){if(W["on:end"]){const we=new z_(W);W["on:end"](V,we),we.isMatchIgnored&&(he=!1)}if(he){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return G(W.parent,V,ie)}function Y(W){return fe.matcher.regexIndex===0?(Ee+=W[0],1):(Qt=!0,0)}function ae(W){const V=W[0],ie=W.rule,he=new z_(ie),we=[ie.__beforeBegin,ie["on:begin"]];for(const He of we)if(He&&(He(W,he),he.isMatchIgnored))return Y(V);return ie.skip?Ee+=V:(ie.excludeBegin&&(Ee+=V),oe(),!ie.returnBegin&&!ie.excludeBegin&&(Ee=V)),Ce(ie,W),ie.returnBegin?0:V.length}function le(W){const V=W[0],ie=R.substring(W.index),he=G(fe,W,ie);if(!he)return q_;const we=fe;fe.endScope&&fe.endScope._wrap?(oe(),be(V,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(oe(),pe(fe.endScope,W)):we.skip?Ee+=V:(we.returnEnd||we.excludeEnd||(Ee+=V),oe(),we.excludeEnd&&(Ee=V));do fe.scope&&De.closeNode(),!fe.skip&&!fe.subLanguage&&(qe+=fe.relevance),fe=fe.parent;while(fe!==he.parent);return he.starts&&Ce(he.starts,W),we.returnEnd?0:V.length}function X(){const W=[];for(let V=fe;V!==_e;V=V.parent)V.scope&&W.unshift(V.scope);W.forEach(V=>De.openNode(V))}let je={};function Ne(W,V){const ie=V&&V[0];if(Ee+=W,ie==null)return oe(),0;if(je.type==="begin"&&V.type==="end"&&je.index===V.index&&ie===""){if(Ee+=R.slice(V.index,V.index+1),!i){const he=new Error(`0 width match regex (${z})`);throw he.languageName=z,he.badRule=je.rule,he}return 1}if(je=V,V.type==="begin")return ae(V);if(V.type==="illegal"&&!O){const he=new Error('Illegal lexeme "'+ie+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw he.mode=fe,he}else if(V.type==="end"){const he=le(V);if(he!==q_)return he}if(V.type==="illegal"&&ie==="")return V.index===R.length||(Ee+=`
|
|
198
|
-
`),1;if(On>1e5&&On>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ee+=ie,ie.length}const _e=_(z);if(!_e)throw as(a.replace("{}",z)),new Error('Unknown language: "'+z+'"');const ge=mge(_e);let $e="",fe=U||ge;const et={},De=new l.__emitter(l);X();let Ee="",qe=0,It=0,On=0,Qt=!1;try{if(_e.__emitTokens)_e.__emitTokens(R,De);else{for(fe.matcher.considerAll();;){On++,Qt?Qt=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=It;const W=fe.matcher.exec(R);if(!W)break;const V=R.substring(It,W.index),ie=Ne(V,W);It=W.index+ie}Ne(R.substring(It))}return De.finalize(),$e=De.toHTML(),{language:z,value:$e,relevance:qe,illegal:!1,_emitter:De,_top:fe}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:z,value:Bg(R),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:It,context:R.slice(It-100,It+100),mode:W.mode,resultSoFar:$e},_emitter:De};if(i)return{language:z,value:Bg(R),illegal:!1,relevance:0,errorRaised:W,_emitter:De,_top:fe};throw W}}function h(z){const R={value:Bg(z),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return R._emitter.addText(z),R}function p(z,R){R=R||l.languages||Object.keys(t);const O=h(z),U=R.filter(_).filter(T).map(oe=>f(oe,z,!1));U.unshift(O);const A=U.sort((oe,be)=>{if(oe.relevance!==be.relevance)return be.relevance-oe.relevance;if(oe.language&&be.language){if(_(oe.language).supersetOf===be.language)return 1;if(_(be.language).supersetOf===oe.language)return-1}return 0}),[Z,$]=A,P=Z;return P.secondBest=$,P}function g(z,R,O){const U=R&&n[R]||O;z.classList.add("hljs"),z.classList.add(`language-${U}`)}function m(z){let R=null;const O=u(z);if(c(O))return;if(I("before:highlightElement",{el:z,language:O}),z.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",z);return}if(z.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(z)),l.throwUnescapedHTML))throw new vge("One of your code blocks includes unescaped HTML.",z.innerHTML);R=z;const U=R.textContent,A=O?d(U,{language:O,ignoreIllegals:!0}):p(U);z.innerHTML=A.value,z.dataset.highlighted="yes",g(z,O,A.language),z.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(z.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),I("after:highlightElement",{el:z,result:A,text:U})}function v(z){l=G_(l,z)}const y=()=>{k(),Ws("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){k(),Ws("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function k(){function z(){k()}if(document.readyState==="loading"){w||window.addEventListener("DOMContentLoaded",z,!1),w=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function S(z,R){let O=null;try{O=R(e)}catch(U){if(as("Language definition for '{}' could not be registered.".replace("{}",z)),i)as(U);else throw U;O=o}O.name||(O.name=z),t[z]=O,O.rawDefinition=R.bind(null,e),O.aliases&&C(O.aliases,{languageName:z})}function x(z){delete t[z];for(const R of Object.keys(n))n[R]===z&&delete n[R]}function E(){return Object.keys(t)}function _(z){return z=(z||"").toLowerCase(),t[z]||t[n[z]]}function C(z,{languageName:R}){typeof z=="string"&&(z=[z]),z.forEach(O=>{n[O.toLowerCase()]=R})}function T(z){const R=_(z);return R&&!R.disableAutodetect}function L(z){z["before:highlightBlock"]&&!z["before:highlightElement"]&&(z["before:highlightElement"]=R=>{z["before:highlightBlock"](Object.assign({block:R.el},R))}),z["after:highlightBlock"]&&!z["after:highlightElement"]&&(z["after:highlightElement"]=R=>{z["after:highlightBlock"](Object.assign({block:R.el},R))})}function M(z){L(z),r.push(z)}function B(z){const R=r.indexOf(z);R!==-1&&r.splice(R,1)}function I(z,R){const O=z;r.forEach(function(U){U[O]&&U[O](R)})}function F(z){return Ws("10.7.0","highlightBlock will be removed entirely in v12.0"),Ws("10.7.0","Please use highlightElement now."),m(z)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:k,highlightElement:m,highlightBlock:F,configure:v,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:S,unregisterLanguage:x,listLanguages:E,getLanguage:_,registerAliases:C,autoDetection:T,inherit:G_,addPlugin:M,removePlugin:B}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=yge,e.regex={concat:Es,lookahead:i2,either:ew,optional:Rme,anyNumberOfTimes:Pme};for(const z in Wd)typeof Wd[z]=="object"&&n2(Wd[z]);return Object.assign(e,Wd),e},Zo=h2({});Zo.newInstance=()=>h2({});var xge=Zo;Zo.HighlightJS=Zo;Zo.default=Zo;const wge=Ze(xge),K_={},Sge="hljs-";function kge(e){const t=wge.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||K_,h=typeof f.prefix=="string"?f.prefix:Sge;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Nge,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||K_).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 Nge{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 _ge(e){const t=e||Ege,n=t.aliases,r=t.detect||!1,i=t.languages||jme,a=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=kge(i);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){Jp(d,"element",function(h,p,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=jge(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=Qhe(h,{whitespace:"pre"});let y;try{y=m?u.highlight(m,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(b){const w=b;if(m&&/Unknown language/.test(w.message)){f.message("Cannot highlight as `"+m+"`, itโs not registered",{ancestors:[g,h],cause:w,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw w}!m&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function jge(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 zh="[A-Za-z$_][0-9A-Za-z$_]*",p2=["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"],m2=["true","false","null","undefined","NaN","Infinity"],g2=["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"],y2=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],v2=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],b2=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],x2=[].concat(v2,g2,y2);function Age(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=zh,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let $;const P=O.input.substring(A);if($=P.match(/^\s*=/)){U.ignoreMatch();return}if(($=P.match(/^\s+extends\s+/))&&$.index===0){U.ignoreMatch();return}}},l={$pattern:zh,keyword:p2,literal:m2,built_in:x2,"variable.language":b2},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]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={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"}}]},_={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:{_:[...g2,...y2]}},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:[x],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,M([...v2,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:_},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,_,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{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:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains: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:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},B,L,E,F,{match:/\$[(.]/}]}}function V_(e){const t=e.regex,n=Age(e),r=zh,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:zh,keyword:p2.concat(c),literal:m2,built_in:x2.concat(i),"variable.language":b2},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(w=>w.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 Y_="[A-Za-z$_][0-9A-Za-z$_]*",Cge=["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"],Tge=["true","false","null","undefined","NaN","Infinity"],w2=["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"],S2=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],k2=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Oge=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],Pge=[].concat(k2,w2,S2);function X_(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=Y_,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let $;const P=O.input.substring(A);if($=P.match(/^\s*=/)){U.ignoreMatch();return}if(($=P.match(/^\s+extends\s+/))&&$.index===0){U.ignoreMatch();return}}},l={$pattern:Y_,keyword:Cge,literal:Tge,built_in:Pge,"variable.language":Oge},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]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(b,h.contains),S=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={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"}}]},_={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:{_:[...w2,...S2]}},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:[x],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const B={match:t.concat(/\b/,M([...k2,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:_},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,_,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{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:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains: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:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},B,L,E,F,{match:/\$[(.]/}]}}const Rge="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",Mge={scope:"number",match:Rge,relevance:0};function Ige(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,Mge,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function $ge(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"],w=["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,...w,"set","shopt",...k,...S]},contains:[p,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function Z_(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Q_(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 J_(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 ej(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 Lge(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 Dge(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(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:b(h),relevance:0};function k(S,{exceptions:x,when:E}={}){const _=E;return x=x||[],S.map(C=>C.match(/\|\d+$/)||x.includes(C)?C:_(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)},w,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function tj(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 Bge=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_-]*/}}),zge=["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"],Fge=["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"],Uge=[...zge,...Fge],Wge=["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(),Hge=["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(),Gge=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),qge=["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 Kge(e){const t=e.regex,n=Bge(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:":("+Hge.join("|")+")"},{begin:":(:)?("+Gge.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+qge.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:Wge.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Uge.join("|")+")\\b"}]}}function nj(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}const Vge={ts:V_,typescript:V_,js:X_,javascript:X_,json:Ige,bash:$ge,shell:Z_,sh:Z_,python:Q_,py:Q_,markdown:J_,md:J_,yaml:ej,yml:ej,diff:Lge,sql:Dge,html:tj,xml:tj,css:Kge,text:nj,plaintext:nj};function N2(e){if(e==null)return"";const t=e;return typeof t.value=="string"?t.value:Array.isArray(t.children)?t.children.map(N2).join(""):""}function Yge({lang:e,code:t,children:n}){const[r,i]=N.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 Xge({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=N.useMemo(()=>N2(n),[n]);return s.jsx(Yge,{lang:i,code:a,children:t})}function rj({text:e}){const t=N.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:Xge}),[]);return s.jsx("div",{className:"md-root",children:s.jsx(Pde,{remarkPlugins:[Ghe],rehypePlugins:[[_ge,{languages:Vge}]],components:t,children:e??""})})}const ij=/```([\w+-]*)\n([\s\S]*?)```/g;function Zge(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 Qge(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 Jge(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 eye(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 aj=/https?:\/\/[^\s)\]}"'<>]+/i,sj=/(๐|deploy(?:ed|ment|ing)?|live at|published|available at|open the)/i;function tye(e){return e.replace(/[.,;:!?]+$/,"")}function nye(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(sj);!o&&i+1<t.length&&/deploy(?:ed|ment|ing)?:\s*$/i.test(a.trim())&&(o=t[i+1].match(sj));const l=a.match(aj)||(i+1<t.length?t[i+1].match(aj):null);if(!o||!l)continue;const c=tye(l[0]);r.has(c)||(r.add(c),n.push({url:c,title:a.trim().slice(0,80)||"Deployment"}))}return n}function oj(e){const t=[],n=[],r=[];ij.lastIndex=0;let i;for(;(i=ij.exec(e))!==null;){const a=(i[1]||"").toLowerCase(),o=i[2];if(a==="diff"||o.includes("diff --git ")){const l=Zge(o);l.length>0&&t.push({files:l,summary:`${l.length} file${l.length===1?"":"s"} changed`})}else Qge(o)&&n.push({verdict:Jge(o),title:eye(o),body:o})}for(const a of nye(e))r.push(a);return{diffs:t,results:n,deploys:r}}const rye=/\x1b(?:\[[0-9;?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-Z\\-_])/g;function lj(e){return e?e.replace(rye,""):""}const cj=3e5,iye=2e3,aye=/\.(pdf|docx|xlsx|pptx)$/i,sye=/\.(png|jpe?g|gif|webp|bmp|tiff?)$/i,oye=/\.(txt|md|markdown|text|log|csv|tsv|json|xml|yaml|yml|html?|htaccess|css|js|mjs|cjs|jsx|ts|tsx|py|rb|go|rs|java|kt|c|h|cpp|cs|php|sh|bash|zsh|sql|ini|toml|cfg|conf|env)$/i;function lye(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function cye(e,t){const n=t.includes(0),r=t.length===0?1:t.reduce((i,a)=>a===9||a===10||a===13||a>=32&&a<127||a>=128?i+1:i,0)/t.length;return!n&&r>.9?{how:"text"}:aye.test(e)?{how:"binary"}:oye.test(e)?{how:"text"}:sye.test(e)?{how:"unsupported",reason:`"${e}" is an image, and this composer only sends text and documents. Save it into the project folder and ask me to describe it โ I can read images from there.`}:{how:"unsupported",reason:`"${e}" is not a text file and not a document type I can read. Attach a PDF, DOCX, XLSX, PPTX, or a text/CSV/JSON/Markdown file โ or put the file in the project folder and ask me to read it.`}}function uye(e){const t=["pending","running","done","blocked"].includes(e.status);return{id:e.id,description:e.description,status:t?e.status:"pending"}}function dye(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 fye={running:"โณ running",done:"โ
done",failed:"โ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐ฅ error"};function rc({diff:e,selectable:t=!1,onCommitAccepted:n,lockedHint:r}){const[i,a]=N.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 rw({text:e,label:t}){const[n,r]=N.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 hye({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(rw,{text:e.body,label:"result output"})]}),s.jsx("pre",{className:"chat-result-body",children:e.body})]})}function pye({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(rw,{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 mye({children:e}){const t=N.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 gye({task:e,onCancel:t}){const n=e.status==="running",r=e.logs.map(i=>lj(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:fye[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(rw,{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=lj(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 uj({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 yye({request:e,onSave:t}){const[n,r]=N.useState({}),[i,a]=N.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 vye({result:e}){const[t,n]=N.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 bye(e){return e==="done"?"โ
":e==="running"?"๐":e==="blocked"?"โ":"โฌ"}function dj({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:bye(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 fj({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:dye(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 xye(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function hj({findings:e}){return!e||e.length===0?null:s.jsx("div",{className:"chat-finding-cards",children:e.map((t,n)=>{const r=xye(t),i=t.verdict==="CONFIRMED"&&r.length>0;return s.jsxs("div",{className:`chat-finding-card ${i?"chat-finding-confirmed":"chat-finding-plausible"}`,children:[s.jsxs("div",{className:"chat-finding-head",children:[s.jsx("span",{className:"chat-finding-icon","aria-hidden":"true",children:i?"โ
":"๐"}),s.jsx("span",{className:"chat-finding-claim",children:t.claim}),s.jsx("span",{className:`chat-finding-verdict ${i?"chat-finding-verdict-ok":"chat-finding-verdict-guess"}`,title:i?"a check was performed and is shown below":"reasoned, not verified",children:i?"CONFIRMED":"PLAUSIBLE"})]}),t.outcome?s.jsx("div",{className:"chat-finding-outcome",children:t.outcome}):null,r.length>0?s.jsx("ul",{className:"chat-finding-evidence",children:r.map((a,o)=>s.jsxs("li",{children:[s.jsx("span",{className:"chat-finding-kind",children:a.kind}),s.jsx("code",{className:"chat-finding-ref",children:a.ref}),a.detail?s.jsxs("span",{className:"chat-finding-detail",children:["(",a.detail,")"]}):null]},o))}):s.jsx("div",{className:"chat-finding-noevidence",children:"no evidence โ reported as PLAUSIBLE, not verified"}),t.source?s.jsxs("div",{className:"chat-finding-source",children:["source: ",t.source]}):null]},`${n}-${t.claim}`)})})}function wye({worktree:e}){return s.jsxs("div",{className:"chat-worktree-card",children:[s.jsxs("div",{className:"chat-worktree-head",children:[s.jsx("span",{className:"chat-worktree-icon","aria-hidden":"true",children:"๐ฟ"}),s.jsx("span",{className:"chat-worktree-title",children:"Ran in an isolated worktree"}),s.jsx("span",{className:`chat-worktree-state ${e.removed?"chat-worktree-gone":"chat-worktree-kept"}`,children:e.removed?"removed":"kept"})]}),s.jsxs("div",{className:"chat-worktree-meta",children:[s.jsx("code",{className:"chat-worktree-dir",title:e.dir,children:e.dir}),s.jsxs("span",{className:"admin-hint",children:["base ",e.base.slice(0,7)]})]}),s.jsx("div",{className:"chat-worktree-note admin-hint",children:e.removed?"the diff below is what is left of it โ nothing was written into the project tree":"the directory above is still on disk"}),s.jsx(rc,{diff:e.diff.payload})]})}function Sye({resume:e}){return s.jsxs("div",{className:"chat-resume-card",children:[s.jsxs("div",{className:"chat-resume-head",children:[s.jsx("span",{className:"chat-resume-icon","aria-hidden":"true",children:"โฉ๏ธ"}),s.jsx("span",{className:"chat-resume-title",children:"Resumed a recorded run"}),s.jsx("span",{className:`chat-resume-state ${e.saved?"chat-resume-saved":"chat-resume-unsaved"}`,title:e.saved?"the record was written back, so a later resume can replay this run":"the record could NOT be written โ a later resume will replay nothing from this run",children:e.saved?"recorded":"not recorded"})]}),s.jsxs("div",{className:"chat-resume-meta",children:[s.jsxs("span",{children:[e.replayed," step",e.replayed===1?"":"s"," replayed"]}),s.jsxs("span",{children:[e.modelCalls," model call",e.modelCalls===1?"":"s"," made"]}),s.jsx("code",{className:"chat-resume-id",title:"the checkpoint record this run used",children:e.id})]}),s.jsx("div",{className:"chat-resume-note",children:e.notice})]})}function zg(){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 kye(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 pj(){var _l,Ms,Is,jl,Qu;const[e,t]=N.useState(null),[n,r]=N.useState([]),[i,a]=N.useState(""),[o,l]=N.useState(!1),[c,u]=N.useState(""),[d,f]=N.useState(null),[h,p]=N.useState(!1),[g,m]=N.useState(!1),[v,y]=N.useState(!1),[b,w]=N.useState(""),[k,S]=N.useState(null),[x,E]=N.useState([]),[_,C]=N.useState([]),[T,L]=N.useState(null),[M,B]=N.useState(null),[I,F]=N.useState(null),[z,R]=N.useState([]),[O,U]=N.useState([]),[A,Z]=N.useState([]),[$,P]=N.useState(null),oe=N.useRef([]),be=N.useRef([]),pe=N.useRef(null),Ce=N.useRef(null),G=N.useRef(null),Y=N.useRef([]),[ae,le]=N.useState(""),X=N.useRef(""),je=N.useRef(null),[Ne,_e]=N.useState(null),ge=N.useRef(zg()),$e=N.useRef(""),[fe,et]=N.useState([]),[De,Ee]=N.useState(!0),[qe,It]=N.useState(""),[On,Qt]=N.useState(null),[W,V]=N.useState(""),[ie,he]=N.useState([]),[we,He]=N.useState(null),[ln,Tt]=N.useState(!1),Un=N.useRef(null),wn=N.useRef(null),[Re,Wn]=N.useState(null),[$t,oi]=N.useState(null),[Ea,sr]=N.useState([]),[Jt,q]=N.useState(""),[me,Me]=N.useState(""),[Te,Hn]=N.useState(!1),[cn,zr]=N.useState(""),[Sn,_s]=N.useState([]),[vl,Wu]=N.useState(null),[Hu,_a]=N.useState(!1),[li,tm]=N.useState([]),[nm,Gu]=N.useState([]),[bl,xl]=N.useState(""),wl=N.useRef(null),lt=N.useRef(null),ja=N.useRef(null),js=N.useRef(null),[Lt,Aa]=N.useState(null),[Ca,qu]=N.useState(new Set);N.useEffect(()=>{J.fetchAdminAuthStatus().then(D=>{t(D?{configured:D.configured,authenticated:D.authenticated,role:D.role??null}:{configured:!1,authenticated:!1,role:null})})},[]),N.useEffect(()=>{var D,te;try{(te=(D=ja.current)==null?void 0:D.scrollTo)==null||te.call(D,{top:ja.current.scrollHeight})}catch{}},[n,o,x]),N.useEffect(()=>()=>{var D;(D=lt.current)==null||D.call(lt),lt.current=null},[]);const Sl=N.useCallback(async D=>{var ke,Nr;(ke=lt.current)==null||ke.call(lt),lt.current=null;const te=await J.getChatSession(D);if(!te)return;ge.current=D,r(te.turns.map(Bt=>({role:Bt.role,content:Bt.content,...Bt.role==="assistant"?{followups:[],artifacts:oj(Bt.content)}:{}}))),E([]),oe.current=[],C([]),be.current=[],L(null),pe.current=null,B(null),Ce.current=null,F(null),G.current=null,R([]),Y.current=[],X.current="",le(""),_e(null),u(""),S(null),P(null),Aa(null),Ee(!0);const ee=te.projectPath;if(ee){if(oi(ee),(Re==null?void 0:Re.path)===ee)return;(Nr=js.current)==null||Nr.call(js,ee)}else oi(null)},[Re]),As=N.useCallback(()=>{var D;(D=lt.current)==null||D.call(lt),lt.current=null,ge.current=zg(),oi(null),r([]),E([]),oe.current=[],C([]),be.current=[],L(null),pe.current=null,B(null),Ce.current=null,F(null),G.current=null,R([]),Y.current=[],X.current="",le(""),_e(null),u(""),S(null),P(null),Aa(null),he([]),He(null),a(""),Ee(!0)},[]),ci=N.useCallback(D=>{he(te=>[...te,D].slice(-10))},[]),Gn=N.useCallback(D=>{he(te=>te.filter((ee,ke)=>ke!==D))},[]),Cs=N.useCallback(async D=>{if(!D)return;if(D.size>cj){u(`Attachment "${D.name}" is too large (max ${Math.round(cj/1024)} KB).`);return}const te=new Uint8Array(await D.slice(0,8192).arrayBuffer()),ee=cye(D.name,te);if(ee.how==="unsupported"){u(ee.reason);return}if(ee.how==="binary"){const Nr=new Uint8Array(await D.arrayBuffer());ci({name:D.name,content:lye(Nr),kind:"file",encoding:"base64"});return}const ke=await D.text();ci({name:D.name,content:ke,kind:"file",encoding:"text"})},[ci]),Ts=N.useCallback(D=>{const te=D.currentTarget,ee=D.clipboardData.getData("text")||"";ee.length>=iye&&(wn.current={start:te.selectionStart,end:te.selectionEnd},He({text:ee}))},[]),Ku=N.useCallback(()=>{const D=we;if(!D)return;const te=wn.current;a(ee=>te?ee.slice(0,te.start)+ee.slice(te.end):ee),ci({name:"pasted-text.txt",content:D.text,kind:"paste",encoding:"text"}),He(null),wn.current=null},[we,ci]),Vu=N.useCallback(D=>{Qt(D.id),V(D.title==="(untitled conversation)"?"":D.title)},[]),ui=N.useCallback(async D=>{const te=await J.renameChatSession(D,W);te.ok?et(ee=>ee.map(ke=>ke.id===D?{...ke,title:W.trim()||ke.title}:ke)):u(te.error||"Could not rename the session."),Qt(null),V("")},[W]),kl=N.useCallback(async D=>{const te=await J.deleteChatSession(D);te.ok?(et(ee=>ee.filter(ke=>ke.id!==D)),ge.current===D&&As()):u(te.error||"Could not delete the session.")},[As]),Fr=(e==null?void 0:e.authenticated)===!0&&(e.role==="admin"||e.role==="operator");N.useEffect(()=>{Fr&&(J.listChatSessions().then(D=>{Array.isArray(D)&&et(D)}),J.listProjects().then(D=>{Array.isArray(D)&&sr(D)}))},[Fr]);const qn=N.useCallback(async D=>{const te=D.trim();if(!te)return;Me("");const ee=await J.attachProject(te);if(ee.ok&&ee.project){Wn(ee.project),q("");const ke=await J.listProjects();Array.isArray(ke)&&sr(ke)}else Me(ee.error||"Could not attach that directory.")},[]);js.current=qn;const di=N.useCallback(async D=>{Hn(!0),_a(!0),xl("");const te=await J.browseDirectories(D,{showDrives:!D});te.ok&&(zr(te.path),_s(te.entries),Wu(te.parent),te.drives&&tm(te.drives),te.breadcrumbs&&Gu(te.breadcrumbs)),_a(!1)},[]),Os=N.useCallback(async D=>{_a(!0),xl("");const te=await J.browseDirectories(D);te.ok&&(zr(te.path),_s(te.entries),Wu(te.parent),te.breadcrumbs&&Gu(te.breadcrumbs)),_a(!1)},[]),kr=N.useCallback(async()=>{if(!cn)return;const D=await J.browseDirectories(cn);D.ok&&_s(D.entries)},[cn]);N.useEffect(()=>J.onChatRetryEvent(te=>{if(te.sessionId!==ge.current){J.listChatSessions().then(ee=>{Array.isArray(ee)&&et(ee)});return}r(ee=>[...ee,{role:"assistant",content:te.content}]),te.kind==="answer"&&_e(null)}),[]),N.useEffect(()=>(Te&&cn&&(wl.current=setInterval(()=>{kr()},5e3)),()=>{wl.current&&clearInterval(wl.current)}),[Te,cn,kr]);const rm=N.useCallback(async()=>{if(typeof window<"u"&&"showDirectoryPicker"in window)try{const ee=(await window.showDirectoryPicker({mode:"read"})).name;if(!ee){di();return}Me(""),l(!0);const ke=await J.resolveFolder(ee);l(!1),ke.ok&&ke.path?(q(ke.path),qn(ke.path)):Me('Folder "'+ee+'" found โ selecting it now. If this is wrong, type the full path below.');return}catch(te){if((te==null?void 0:te.name)==="AbortError")return}di()},[di,qn]),Dt=N.useCallback(async(D,te)=>{var Wr,Kn;const ee=D.trim(),ke=Array.isArray(te)?te:ie,Nr=!Array.isArray(te)&&(te==null?void 0:te.skipResolve)===!0;if(!ee&&ke.length===0||o)return;if(u(""),S(null),E([]),oe.current=[],C([]),be.current=[],L(null),pe.current=null,B(null),Ce.current=null,F(null),G.current=null,R([]),Y.current=[],r(Se=>[...Se,{role:"user",content:ee,attachments:ke.length>0?ke:void 0}]),a(""),he([]),He(null),$e.current=ee||`[${ke.length} attachment(s)]`,l(!0),Ee(!1),!Nr){const ct=((await J.chatResolve(ee)).matches??[])[0]??null;if(ct&&ct.command&&!ct.ambiguous&&ct.score>=.6){P({ask:ee,top:ct}),l(!1);return}if(ct&&ct.ambiguous&&!$){P({ask:ee,top:ct}),l(!1);return}}const Bt=ge.current,Pn=new AbortController;je.current=Pn,_e(null),(Wr=lt.current)==null||Wr.call(lt),lt.current=J.subscribeChat(Bt,{onToken:Se=>{X.current+=Se,le(X.current)},onProgress:Se=>{oe.current=[...oe.current,Se],E(oe.current)},onQuestion:Se=>{Aa(Se),qu(new Set)},onTool:Se=>{const Fe=[...be.current],ct=Fe.findIndex(en=>en.id===Se.id),At={id:Se.id,tool:Se.tool,phase:Se.phase,args:Se.args,ok:Se.ok,result:Se.result,error:Se.error,durationMs:Se.durationMs};ct>=0?Fe[ct]=At:Fe.push(At),be.current=Fe,C(Fe)},onPlan:Se=>{const Fe={goal:Se.goal,steps:Se.steps.map(uye),revision:Se.revision};pe.current=Fe,L(Fe)},onDiff:Se=>{const Fe={files:Se.files,summary:Se.summary};Ce.current=Fe,B(Fe)},onSkillDraft:Se=>{const Fe={name:Se.name,description:Se.description,markdown:Se.markdown,updatedAt:Se.updatedAt,status:"pending"};G.current=Fe,F(Fe)},onFinding:Se=>{Y.current=[...Y.current,Se],R(Y.current)},onSecretRequest:Se=>{U(Fe=>{const ct=Fe.findIndex(At=>At.skillName===Se.skillName);if(ct>=0){const At=[...Fe];return At[ct]=Se,At}return[...Fe,Se]})},onExecutionResult:Se=>{Z(Fe=>[...Fe,Se])}});const Nt=await J.chatSend(Bt,ee||`(see ${ke.length} attachment${ke.length===1?"":"s"})`,{projectPath:Re==null?void 0:Re.path,attachments:ke.map(Se=>({name:Se.name,content:Se.content,kind:Se.kind,encoding:Se.encoding??"text"})),...h?{worktree:!0,keepWorktree:g}:{},...v?{resume:b.trim()||!0}:{}},Pn.signal);if(je.current=null,(Kn=lt.current)==null||Kn.call(lt),lt.current=null,X.current="",le(""),Nt.ok){S(Nt.generationFailed?null:`${Nt.provider??"provider"}${Nt.model?` / ${Nt.model}`:" (auto-routed)"}`),_e(Nt.generationFailed&&!Nt.retryQueued&&!Nt.refused?ee:null);const Se=Nt.content||"(the agent produced no text โ try rephrasing)";r(Fe=>[...Fe,{role:"assistant",content:Se,error:Nt.generationFailed,followups:Nt.followups,steps:oe.current,tools:be.current,plan:pe.current,diff:Ce.current,draft:G.current,findings:Nt.findings??Y.current,worktree:Nt.worktree,resume:Nt.resume,refused:Nt.refused,artifacts:oj(Se)}])}else Pn.signal.aborted?(u(""),_e(null)):Nt.unauthorized?(t(Se=>Se&&{...Se,authenticated:!1}),u("Session expired โ log in again to chat.")):(u(Nt.error||"The agent could not answer โ check that a provider API key is set for the dashboard process."),_e(ee));l(!1),Ee(!0)},[o,Re,ie,h,g,v,b]),Ps=N.useCallback(()=>{var D;(D=je.current)==null||D.abort()},[]),Ur=N.useCallback(async()=>{f(null);const D=await J.chatSupportBundle(ge.current);f(D.ok?{kind:"ok",text:"Support bundle downloaded โ attach it to your bug report."}:{kind:"err",text:D.error||"Could not build the support bundle."})},[]),Nl=N.useCallback(async D=>{F(ee=>ee&&{...ee,status:"saving"});const te=await J.skillDraftAccept(D);F(ee=>ee&&{...ee,status:te.ok?"saved":"error"}),te.ok||u(te.error||"Could not accept the draft.")},[]),qt=N.useCallback(async D=>{const te=await J.skillDraftReject(D);te.ok?F(ee=>ee&&{...ee,status:"rejected"}):u(te.error||"Could not reject the draft.")},[]),Yu=N.useCallback(D=>{Dt(`Revise the skill draft "${D}" โ improve it per your best judgment and present it again.`)},[Dt]),im=N.useCallback(async D=>{const te=await J.saveSecrets(D);if(!te.ok){u(te.error||"Could not save secrets.");return}const ee=te.refused??[];ee.length>0&&u(ee.map(ke=>ke.reason==="provider-credential"?`${ke.name} is a provider credential โ set it up as a provider, skills never receive it.`:`${ke.name} was not saved (${ke.reason}).`).join(" "))},[]),am=N.useCallback(async D=>{const ke=((await J.chatResolve(D)).matches??[])[0]??null;if(!(ke!=null&&ke.command)){P(null);return}P(null),l(!0);const Nr=ke.command.split(/\s+/),Bt=await J.startTask(Nr,6e4);if(!Bt.ok||!Bt.task){u(Bt.error||"The command could not be started."),l(!1);return}const Pn=Bt.task.id,Nt={id:Pn,command:ke.command,status:Bt.task.status,exitCode:Bt.task.exitCode,durationMs:Bt.task.durationMs,logs:Bt.task.logs??[]};r(ct=>[...ct,{role:"assistant",content:"",task:Nt}]);const Wr=ct=>r(At=>At.map(en=>en.task&&en.task.id===Pn?{...en,task:{...en.task,...ct}}:en));let Kn=null;Kn=J.subscribeTask(Pn,{onLog:ct=>r(At=>At.map(en=>en.task&&en.task.id===Pn?{...en,task:{...en.task,logs:[...en.task.logs,ct]}}:en)),onStatus:ct=>{Wr({status:ct}),ct!=="running"&&(J.getTask(Pn).then(At=>{At!=null&&At.task&&Wr({exitCode:At.task.exitCode,durationMs:At.task.durationMs,logs:At.task.logs??[]})}),Kn==null||Kn(),l(!1))}});const Se=await J.getTask(Pn);Se!=null&&Se.task&&Wr({status:Se.task.status,exitCode:Se.task.exitCode,durationMs:Se.task.durationMs,logs:Se.task.logs??[]});const Fe=await J.getTask(Pn);Fe!=null&&Fe.task&&Fe.task.status!=="running"&&(Kn==null||Kn(),Wr({status:Fe.task.status,exitCode:Fe.task.exitCode,durationMs:Fe.task.durationMs,logs:Fe.task.logs??[]}),l(!1))},[]),Ta=N.useCallback(D=>{P(null),Dt(D,{skipResolve:!0})},[Dt]),Xu=N.useCallback(D=>{if(D.length===0)return;const te=Re?` in the attached project ${Re.path}`:"";Dt(`Commit exactly these files that I accepted on the diff card (and nothing else)${te}: ${D.join(", ")}. Show me a short confirmation before finishing.`)},[Dt,Re]),sm=N.useCallback(async D=>{await J.cancelTask(D)},[]),Li=N.useCallback(async D=>{const te=Lt;if(!te)return;Aa(null);const ee=await J.chatRespond(ge.current,te.questionId,D);ee.ok||u(ee.error||"The question could not be answered โ try sending your message again.")},[Lt]),Rs=N.useCallback(()=>{if(!Lt)return;const D=Lt.multiSelect?[...Ca]:[...Ca][0];Lt.multiSelect?Li({index:[...Ca]}):Li(D!==void 0?{index:D}:{index:-1})},[Lt,Ca,Li]),om=N.useCallback(()=>{Lt&&Li({index:-1})},[Lt,Li]),Zu=N.useCallback(D=>{qu(te=>{const ee=new Set(te);return Lt!=null&&Lt.multiSelect?ee.has(D)?ee.delete(D):ee.add(D):(ee.clear(),ee.add(D)),ee})},[Lt]),lm=N.useCallback(async()=>{var te;(te=lt.current)==null||te.call(lt),lt.current=null,ge.current=zg(),r([]),E([]),oe.current=[],C([]),be.current=[],L(null),pe.current=null,B(null),Ce.current=null,F(null),G.current=null,R([]),Y.current=[],X.current="",le(""),_e(null),u(""),S(null),P(null),Aa(null);const D=await J.listChatSessions();Array.isArray(D)&&et(D)},[]),El=((_l=[...n].reverse().find(D=>{var te;return D.role==="assistant"&&!D.error&&(((te=D.followups)==null?void 0:te.length)??0)>0}))==null?void 0:_l.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:[k?s.jsx("span",{className:"admin-hint",children:k}):null,s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void lm(),disabled:o||n.length===0,children:"๐ New conversation"})]})]}),e!=null&&e.authenticated?Fr?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-project-bar",children:Re?s.jsxs("div",{className:"chat-project-attached",children:[s.jsx("span",{className:"chat-project-icon",children:"๐"}),s.jsx("span",{className:"chat-project-name",children:Re.name}),s.jsxs("span",{className:"chat-project-meta",children:[Re.fileCount," files ยท ",Re.symbolCount," symbols",Re.truncated?" ยท truncated map":""]}),s.jsx("span",{className:"chat-project-path",title:Re.path,children:Re.path}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>Wn(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"}),Ea.length>0?s.jsx("span",{className:"chat-project-chips",children:Ea.filter(D=>D.kind!=="cwd").slice(0,3).map(D=>s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void qn(D.path),children:D.name},D.path))}):null,s.jsx("input",{className:"chat-project-input",value:Jt,onChange:D=>q(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),qn(Jt))},placeholder:"or type a path, e.g. ~/code/my-app",disabled:o}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void qn(Jt),disabled:o||!Jt.trim(),children:"Attach"}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void rm(),title:"Pick a project folder using your system's folder picker (Finder / Explorer)",children:"๐๏ธ Browse"}),me?s.jsx("span",{className:"chat-project-error",children:me}):null,Te?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:()=>Hn(!1),title:"Close",children:"โ"}),s.jsx("div",{className:"chat-browse-breadcrumbs",children:li.length>0&&!cn?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 di(),children:"๐ "}),nm.map((D,te)=>s.jsxs("span",{children:[s.jsx("span",{className:"chat-breadcrumb-sep",children:"/"}),s.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void Os(D.path),children:D.name})]},D.path))]})})]}),li.length>0&&!cn?s.jsx("div",{className:"chat-browse-drives",children:li.map(D=>s.jsx("button",{type:"button",className:"chat-browse-drive",onClick:()=>void Os(D.path),children:D.name},D.path))}):null,Sn.length>5?s.jsx("div",{className:"chat-browse-search",children:s.jsx("input",{type:"text",className:"chat-browse-filter",placeholder:"๐ Filter foldersโฆ",value:bl,onChange:D=>xl(D.target.value),autoFocus:!0})}):null,s.jsx("div",{className:"chat-browse-list",children:Hu?s.jsx("span",{className:"admin-hint",children:"Loadingโฆ"}):Sn.length===0?s.jsx("span",{className:"admin-hint",children:"No subdirectories found"}):Sn.filter(D=>!bl||D.name.toLowerCase().includes(bl.toLowerCase())).map(D=>s.jsxs("button",{type:"button",className:"chat-browse-entry",onClick:()=>void Os(D.path),children:[s.jsx("span",{className:"chat-browse-entry-icon",children:"๐"}),s.jsx("span",{className:"chat-browse-entry-name",children:D.name}),D.modified?s.jsx("span",{className:"chat-browse-entry-date",children:new Date(D.modified).toLocaleDateString()}):null]},D.path))}),s.jsxs("div",{className:"chat-browse-foot",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void kr(),title:"Refresh folder list",children:"๐"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>{Hn(!1),qn(cn)},disabled:!cn,children:"๐ Select this folder"})]})]}):null]})}),$t&&(!Re||Re.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})]}),Re?s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void qn($t),children:"๐ Switch to it"}):s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void qn($t),children:"๐ Attach it"})]}):null,s.jsxs("div",{className:"chat-layout",children:[De?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:As,children:"๏ผ New"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Collapse history",onClick:()=>Ee(!1),children:"โธ"})]})]}),s.jsx("input",{className:"chat-session-search",placeholder:"Search conversationsโฆ",value:qe,onChange:D=>It(D.target.value)}),fe.length===0?s.jsx("div",{className:"chat-sidebar-empty",children:"No past conversations yet."}):s.jsx("div",{className:"chat-sidebar-list",children:kye(fe,qe).map(({label:D,items:te})=>s.jsxs("div",{className:"chat-session-group",children:[s.jsx("div",{className:"chat-session-group-label",children:D}),te.map(ee=>s.jsx("div",{className:`chat-session-item${ee.id===ge.current?" chat-session-active":""}`,children:On===ee.id?s.jsxs("div",{className:"chat-session-rename",children:[s.jsx("input",{autoFocus:!0,value:W,onChange:ke=>V(ke.target.value),onKeyDown:ke=>{ke.key==="Enter"&&ui(ee.id),ke.key==="Escape"&&Qt(null)},placeholder:"Session title"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>void ui(ee.id),children:"โ"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"chat-session-main",onClick:()=>void Sl(ee.id),title:ee.preview||ee.title,children:[s.jsx("span",{className:"chat-session-title",children:ee.title}),s.jsx("span",{className:"chat-session-preview",children:ee.firstUser||ee.preview}),s.jsxs("span",{className:"chat-session-meta",children:[ee.projectPath?`๐ ${ee.projectPath.split("/").pop()} ยท `:"",ee.turnCount," msg",ee.turnCount===1?"":"s"," ยท ",new Date(ee.updatedAt).toLocaleString()]})]}),s.jsxs("span",{className:"chat-session-actions",children:[s.jsx("button",{type:"button",className:"chat-mini-action",title:"Rename",onClick:()=>Vu(ee),children:"โ๏ธ"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Delete",onClick:()=>void kl(ee.id),children:"๐"})]})]})},ee.id))]},D))})]}):s.jsx("div",{className:"chat-rail",children:s.jsx("button",{type:"button",className:"chat-rail-btn",onClick:()=>Ee(!0),title:"Show history",children:"๐"})}),s.jsxs("div",{className:"chat-main",children:[s.jsxs("div",{className:"chat-thread",ref:ja,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 Dt("what's the state of this project?"),children:"๐ assess this project"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Dt("run the test suite"),children:"๐งช run the tests"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Dt("stop the gateway"),children:"โน stop the gateway"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Dt("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 Dt("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 Dt("publish the current version"),children:"๐ publish the release"})]})]}):n.map((D,te)=>s.jsxs("div",{className:`chat-bubble chat-${D.role}${D.error?" chat-error":""}`,children:[s.jsx("div",{className:"chat-bubble-role",children:D.role==="user"?"You":"๐ค Agent"}),D.role==="assistant"?s.jsx("div",{className:"chat-bubble-text",children:s.jsx(rj,{text:D.content})}):s.jsx("div",{className:"chat-bubble-text",children:D.content}),D.role==="user"&&D.attachments&&D.attachments.length>0?s.jsxs("details",{className:"chat-steps",open:D.attachments.length===1,children:[s.jsxs("summary",{children:["๐ ",D.attachments.length," attachment",D.attachments.length===1?"":"s",":"," ",D.attachments.map(ee=>ee.name).join(", ")]}),D.attachments.map((ee,ke)=>s.jsxs("div",{className:"chat-attach-content",children:[s.jsxs("div",{className:"admin-hint",children:[ee.name," โ ",gt(ee.content.length)," chars"]}),s.jsx("pre",{children:ee.content})]},ke))]}):null,D.role==="assistant"&&D.diff?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Changes: ",D.diff.summary]}),s.jsx(rc,{diff:D.diff,selectable:!0,onCommitAccepted:Xu})]}):null,D.role==="assistant"&&D.artifacts&&(D.artifacts.diffs.length>0||D.artifacts.results.length>0||D.artifacts.deploys.length>0)?s.jsxs(mye,{children:[D.artifacts.diffs.map((ee,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Diff: ${ee.summary}`,className:"chat-artifact-item",children:Re?s.jsx(rc,{diff:ee,selectable:!0,onCommitAccepted:Xu}):s.jsx(rc,{diff:ee,lockedHint:"Attach a project to review and commit these changes."})},`diff-${ke}`)),D.artifacts.results.map((ee,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Result: ${ee.title}`,className:"chat-artifact-item",children:s.jsx(hye,{result:ee})},`result-${ke}`)),D.artifacts.deploys.map((ee,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Deployment: ${ee.url}`,className:"chat-artifact-item",children:s.jsx(pye,{deploy:ee})},`deploy-${ke}`))]}):null,D.role==="assistant"&&D.task?s.jsx(gye,{task:D.task,onCancel:D.task.status==="running"?()=>void sm(D.task.id):void 0}):null,D.role==="assistant"&&D.draft?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Skill draft: ",D.draft.name]}),s.jsx(uj,{draft:D.draft,onAccept:Nl,onReject:qt,onEdit:Yu})]}):null,D.role==="assistant"&&D.plan?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:["Plan: ",D.plan.goal]}),s.jsx(dj,{plan:D.plan})]}):null,D.role==="assistant"&&D.refused?s.jsx("div",{className:"chat-refused-line",children:"โ This turn did not run โ the isolation it asked for could not be made. Nothing was written, and the reason is above."}):null,D.role==="assistant"&&D.worktree?s.jsx(wye,{worktree:D.worktree}):null,D.role==="assistant"&&D.resume?s.jsx(Sye,{resume:D.resume}):null,D.role==="assistant"&&D.findings&&D.findings.length>0?s.jsx(hj,{findings:D.findings}):null,D.role==="assistant"&&D.tools&&D.tools.length>0?s.jsxs("details",{className:"chat-steps",open:!0,children:[s.jsxs("summary",{children:[D.tools.length," tool call",D.tools.length===1?"":"s"]}),s.jsx(fj,{tools:D.tools})]}):null,D.role==="assistant"&&D.steps&&D.steps.length>0?s.jsxs("details",{className:"chat-steps",children:[s.jsxs("summary",{children:[D.steps.length," step",D.steps.length===1?"":"s"]}),s.jsx("div",{className:"chat-step-line",children:D.steps.map((ee,ke)=>s.jsx("div",{children:ee.trim()},ke))})]}):null]},te)),o?s.jsxs("div",{className:"chat-bubble chat-assistant",children:[s.jsx("div",{className:"chat-bubble-role",children:"๐ค Agent"}),T?s.jsx(dj,{plan:T}):null,M?s.jsx(rc,{diff:M}):null,h&&o?s.jsx("div",{className:"chat-resume-line",children:"๐ฟ this turn is running in its own git worktree โ the diff arrives with the answer"}):null,v&&o?s.jsx("div",{className:"chat-resume-line",children:"โฉ๏ธ this turn is replaying the recorded steps of this ask that are unchanged โ the count arrives with the answer"}):null,z.length>0?s.jsx(hj,{findings:z}):null,I?s.jsx(uj,{draft:I,onAccept:Nl,onReject:qt,onEdit:Yu}):null,O.map(D=>s.jsx(yye,{request:D,onSave:im},D.skillName)),A.map((D,te)=>s.jsx(vye,{result:D},`${D.skillName}-${te}`)),s.jsx(fj,{tools:_,live:!0}),ae?s.jsx("div",{className:"chat-bubble-text chat-streaming",children:s.jsx(rj,{text:ae})}):null,s.jsx("div",{className:"chat-working",children:x.length>0?s.jsx("span",{className:"chat-working-lines",children:x.map((D,te)=>s.jsx("div",{className:"chat-step-line",children:D.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,d?s.jsx("div",{className:`admin-row-msg${d.kind==="err"?" admin-row-msg-err":""}`,children:d.text}):null,Ne&&!o?s.jsxs("div",{className:"chat-retry-row",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void Dt(Ne),children:"โป Retry"}),s.jsx("span",{className:"admin-hint",children:"Re-send the last message โ the turn failed."})]}):null,$&&!o?s.jsx("div",{className:"chat-resolve-card",children:(Ms=$.top)!=null&&Ms.ambiguous&&((Is=$.top.options)!=null&&Is.length)?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"chat-resolve-head",children:[s.jsx("strong",{children:"๐ค Which do you mean?"}),' โ "',$.ask,'" maps to more than one action.']}),s.jsx("div",{className:"chat-resolve-options",children:$.top.options.map(D=>s.jsxs("button",{className:"chat-chip",type:"button",onClick:()=>void Dt(D.command),children:[D.summary," โ ",s.jsx("code",{children:D.command})]},D.command))}),s.jsx("div",{className:"chat-resolve-foot",children:s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{P(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?"}),' โ "',$.ask,'"']}),s.jsx("div",{className:"chat-resolve-cmd",children:s.jsx("code",{children:(jl=$.top)==null?void 0:jl.command})}),(Qu=$.top)!=null&&Qu.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 am($.ask),children:"โถ Run"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>Ta($.ask),children:"โ No โ ask the agent"})]})]})}):null,Lt?s.jsxs("div",{className:"chat-resolve-card chat-question-card",children:[s.jsx("div",{className:"chat-resolve-head",children:s.jsxs("strong",{children:["๐ค ",Lt.question]})}),s.jsx("div",{className:"chat-resolve-options",children:Lt.choices.map((D,te)=>s.jsxs("button",{type:"button",className:`chat-chip${Ca.has(te)?" chat-chip-selected":""}`,onClick:()=>Zu(te),children:[D.label,D.description?s.jsxs("span",{className:"admin-hint",children:[" โ ",D.description]}):null]},`${D.label}-${te}`))}),s.jsxs("div",{className:"chat-resolve-foot",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:Rs,children:Lt.multiSelect?"Submit":"Choose"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:om,children:"Skip โ best judgment"})]})]}):null,El.length>0&&!o?s.jsxs("div",{className:"chat-followups",children:[s.jsx("span",{className:"admin-hint",children:"Next steps:"}),El.map((D,te)=>s.jsx("button",{className:"chat-chip",type:"button",onClick:()=>void Dt(D.prompt),children:D.label||D.prompt},te))]}):null,s.jsxs("form",{className:`chat-composer${ln?" chat-composer-drag":""}`,onSubmit:D=>{D.preventDefault(),Dt(i)},onDragOver:D=>{D.preventDefault(),Tt(!0)},onDragLeave:()=>Tt(!1),onDrop:D=>{var ee;D.preventDefault(),Tt(!1);const te=Array.from(((ee=D.dataTransfer)==null?void 0:ee.files)??[]);for(const ke of te.slice(0,10))Cs(ke)},children:[we?s.jsxs("div",{className:"chat-paste-offer",children:[s.jsxs("span",{className:"admin-hint",children:["๐ You pasted ",gt(we.text.length)," characters. Attach it as a file instead?"]}),s.jsx("button",{type:"button",className:"chat-chip",onClick:Ku,children:"Attach as text"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>{He(null),wn.current=null},children:"Keep inline"})]}):null,ie.length>0?s.jsx("div",{className:"chat-attach-row",children:ie.map((D,te)=>s.jsxs("span",{className:"chat-attach-chip",title:D.encoding==="base64"?`${D.name} (${gt(D.content.length)} base64 chars โ read on the server)`:`${D.name} (${gt(D.content.length)} chars)`,children:["๐ ",D.name,s.jsx("span",{className:"admin-hint",children:D.encoding==="base64"?`${Math.round(D.content.length*3/4096)} KB`:`${gt(D.content.length)}c`}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>Gn(te),children:"โ"})]},`${D.name}-${te}`))}):null,s.jsxs("div",{className:"chat-input-row",children:[s.jsx("input",{ref:Un,type:"file",accept:".pdf,.docx,.xlsx,.pptx,.txt,.md,.markdown,.text,.log,.csv,.tsv,.json,.xml,.yaml,.yml,.html,.htm,text/*",style:{display:"none"},onChange:D=>{var ee;const te=(ee=D.target.files)==null?void 0:ee[0];te&&Cs(te),D.target.value=""}}),s.jsx("button",{type:"button",className:"chat-attach-btn",title:"Attach a file (up to 300 KB): PDF, DOCX, XLSX, PPTX or text โ documents are read on the server",disabled:o||ie.length>=10,onClick:()=>{var D;return(D=Un.current)==null?void 0:D.click()},children:"๐"}),s.jsx("button",{type:"button",className:"chat-attach-btn","aria-label":"Download support bundle",title:"Download a support bundle for this chat: the session debug log (which backend served each turn) plus the conversation. Needs NUVIRA_DEBUG_LOG=1 in the dashboard process.",onClick:()=>void Ur(),children:"๐"}),s.jsxs("button",{type:"button",className:`chat-attach-btn${h?" chat-attach-btn-on":""}`,"aria-label":"Run turns in an isolated git worktree","aria-pressed":h,title:h?"Turns run in their own git worktree and report the diff โ click to run in the project tree again":"Run turns in their own git worktree of the attached project, and report the diff against the base commit. Refuses rather than running in your tree when the directory cannot be isolated. Needs an attached project (or the server's own git working directory).",onClick:()=>{p(D=>!D),f(null)},children:["๐ฟ",h?" isolated":" isolate"]}),s.jsxs("button",{type:"button",className:`chat-attach-btn${v?" chat-attach-btn-on":""}`,"aria-label":"Replay this ask's recorded steps instead of paying for them again","aria-pressed":v,title:v?"Recorded steps whose input is unchanged are replayed instead of paid for โ click to run fresh again":"Replay the steps of an earlier run of this same ask whose input is unchanged, instead of paying for them again. The record is keyed by the ask and the directory; name a checkpoint id below to resume a specific one. A step whose input CHANGED is paid for again.",onClick:()=>{y(D=>!D),f(null)},children:["โฉ๏ธ",v?" resuming":" resume"]}),v?s.jsx("input",{className:"chat-resume-input",value:b,onChange:D=>w(D.target.value),placeholder:"checkpoint id (blank = this ask's record)",title:"Resume this specific checkpoint record. Blank resumes the record for this ask in this directory.","aria-label":"Checkpoint id to resume",disabled:o}):null,h?s.jsxs("button",{type:"button",className:`chat-attach-btn${g?" chat-attach-btn-on":""}`,"aria-pressed":g,title:g?"The worktree is KEPT after the turn so you can look inside it":"The worktree is measured and removed after each turn",onClick:()=>m(D=>!D),children:["๐",g?" keep":" drop"]}):null,s.jsx("textarea",{className:"chat-input-box",value:i,onChange:D=>a(D.target.value),onPaste:Ts,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey?(D.preventDefault(),Dt(i)):D.key==="ArrowUp"&&i===""&&$e.current&&(D.preventDefault(),a($e.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:Ps,children:"โน Cancel"}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||!i.trim()&&ie.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 Nye={running:"โณ running",done:"โ
done",failed:"โ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐ฅ error"};function E2({presets:e,customPlaceholder:t,timeoutMs:n=3e5,hint:r}){const[i,a]=N.useState(null),[o,l]=N.useState(!1),[c,u]=N.useState(""),[d,f]=N.useState(""),[h,p]=N.useState(null),[g,m]=N.useState([]),v=N.useRef(null),y=N.useRef(null);N.useEffect(()=>{J.fetchAdminAuthStatus().then(S=>{a(S?{authenticated:S.authenticated,role:S.role??null}:{authenticated:!1,role:null})})},[]),N.useEffect(()=>{var S,x;try{(x=(S=v.current)==null?void 0:S.scrollIntoView)==null||x.call(S,{block:"end"})}catch{}},[g]),N.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"),w=N.useCallback(async(S,x)=>{var T;if(o)return;l(!0),u(""),m([]);const E=await J.startTask(S,x??n);if(!E.ok||!E.task){u(E.error||"Could not start the command."),l(!1);return}const _=E.task;p(_);const C=await J.getTask(_.id);C!=null&&C.task&&m(C.task.logs.map(L=>({stream:L.stream,text:L.text}))),(T=y.current)==null||T.call(y),y.current=J.subscribeTask(_.id,{onLog:L=>m(M=>[...M,{stream:L.stream,text:L.text}]),onStatus:L=>{p(M=>M&&{...M,status:L}),L!=="running"&&l(!1)}})},[o,n]),k=N.useCallback(async()=>{h&&await J.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 w(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 w(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:Nye[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,x)=>s.jsx("div",{children:S.text},x)):s.jsx("div",{className:"admin-hint",children:"Waiting for outputโฆ"}),s.jsx("div",{ref:v})]})]}):null]})}const Eye=[{label:"โก Quick smoke",args:["eval","run","--tasks","quick","--format","text"]},{label:"โฑ Medium suite",args:["eval","run","--tasks","medium","--format","text"]},{label:"๐ข Slow suite",args:["eval","run","--tasks","slow","--format","text"]},{label:"๐ M2B parity",args:["eval","run","--suite","m2b","--format","text"]},{label:"๐ฆ Full suite",args:["eval","run","--suite","full","--format","text"]}];function mj(e){return typeof e!="number"?"โ":`${Math.round(e*100)}%`}function _ye(e){return new Date(e).toLocaleString()}function jye({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(E2,{presets:Eye,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:_ye(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:mj(r.summary.completionRate)}),s.jsx("td",{children:mj(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 Aye=[{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 Cye(){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(E2,{presets:Aye,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 Fg={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 Tye(){const[e,t]=N.useState(null),[n,r]=N.useState("all"),[i,a]=N.useState(null),[o,l]=N.useState(0),[c,u]=N.useState({}),[d,f]=N.useState(!1),[h,p]=N.useState(null),[g,m]=N.useState({status:"idle"}),[v,y]=N.useState(""),[b,w]=N.useState("Hello from agent-nuvira!"),[k,S]=N.useState(!1),[x,E]=N.useState(null),_=N.useRef(!0),C=N.useCallback(async()=>{const O=await J.getPlatformConfigs();_.current&&t(O)},[]);N.useEffect(()=>(C(),()=>{_.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 U=Fg[O.platform];y((U==null?void 0:U.testTarget)??""),w("Hello from agent-nuvira!"),E(null)},L=async()=>{if(!i)return;m({status:"checking"});const O=await J.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 J.setPlatformConfig(i.platform,c);f(!1),O.ok?(p({kind:"ok",text:"Token saved! Verifying..."}),C(),l(2),L()):p({kind:"err",text:O.error||"Save failed."})},B=async()=>{if(!i||!v)return;S(!0),E(null);const O=await J.sendChannelMessage(v,b);S(!1),O.ok?E({kind:"ok",text:"Message sent via "+O.platform+"! Check your "+i.label+" app."}):E({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 I=e.filter(O=>O.configured).length,F=e.filter(O=>n==="configured"?O.configured:n==="unconfigured"?!O.configured:!0),z=i?Fg[i.platform]:null;function R(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:I}),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-I}),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:F.map(O=>{const U=Fg[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:(U==null?void 0:U.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:(U==null?void 0:U.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&&z?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:z.icon}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",i.label]}),s.jsxs("div",{className:"wizard-steps-indicator",children:[s.jsx("span",{className:R(0),children:"1"}),s.jsx("span",{className:R(1),children:"2"}),s.jsx("span",{className:R(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:z.steps.map((O,U)=>s.jsx("li",{children:O},U))}),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:U=>u(A=>({...A,[O.varName]:U.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=>w(O.target.value),placeholder:"Hello from agent-nuvira!"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void B(),disabled:k||!v,children:k?"Sending...":"Send test"})]}),x?s.jsx("div",{className:x.kind==="ok"?"admin-row-msg":"admin-row-msg 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:()=>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 Oye=[{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)"}],gj=[{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 Pye({canWrite:e,sessionExpired:t}){const[n,r]=N.useState(null),[i,a]=N.useState(null),[o,l]=N.useState(!1),[c,u]=N.useState("overview"),d=N.useRef(!0),[f,h]=N.useState("bearer"),[p,g]=N.useState(""),[m,v]=N.useState(""),[y,b]=N.useState(""),[w,k]=N.useState("us-east-1"),[S,x]=N.useState(gj.filter(I=>I.checked).map(I=>I.name)),[E,_]=N.useState(!1),[C,T]=N.useState(null),L=N.useCallback(async()=>{const I=await J.getBedrockStatus();d.current&&r(I)},[]);N.useEffect(()=>(L(),()=>{d.current=!1}),[L]);const M=async()=>{l(!0),a(null);try{const I=await J.probeBedrock((n==null?void 0:n.region)||"us-east-1");if(!d.current)return;I.ok&&I.models&&(a(I.models),u("test"))}catch{}finally{d.current&&l(!1)}},B=async()=>{_(!0),T(null);try{const I={BEDROCK_REGION:w};f==="bearer"&&p?I.AWS_BEARER_TOKEN=p:f==="iam"&&(m&&(I.AWS_ACCESS_KEY_ID=m),y&&(I.AWS_SECRET_ACCESS_KEY=y));const F=await J.setupBedrock(I);if(!d.current)return;F.ok?(T({kind:"ok",text:"โ
Configuration saved! Running connectivity testโฆ"}),u("overview"),await L(),setTimeout(()=>void M(),500)):T({kind:"err",text:F.error||"Save failed"})}catch{d.current&&T({kind:"err",text:"Could not reach the dashboard server."})}finally{d.current&&_(!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:I=>g(I.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:I=>v(I.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:I=>b(I.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:w,onChange:I=>k(I.target.value),children:Oye.map(I=>s.jsx("option",{value:I.value,children:I.label},I.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=${w}#/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:gj.map(I=>s.jsxs("label",{className:`bedrock-family-card ${S.includes(I.name)?"selected":""}`,children:[s.jsx("input",{type:"checkbox",checked:S.includes(I.name),onChange:F=>{F.target.checked?x(z=>[...z,I.name]):x(z=>z.filter(R=>R!==I.name))}}),s.jsxs("div",{children:[s.jsx("strong",{children:I.name}),s.jsxs("span",{children:[I.models.length," model(s)"]})]})]},I.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 B(),disabled:E||f==="bearer"&&!p||f==="iam"&&(!m||!y),children:E?"โณ 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(I=>s.jsxs("div",{className:`bedrock-probe-card bedrock-probe-${I.status}`,children:[s.jsx("span",{className:"bedrock-probe-icon",children:I.status==="accessible"?"โ
":I.status==="permission-denied"?"๐":I.status==="not-found"?"โซ":"โ"}),s.jsx("span",{className:"bedrock-probe-id",children:I.modelId}),s.jsx("span",{className:"bedrock-probe-status",children:I.status==="accessible"?"Ready":I.status==="permission-denied"?`Need access (HTTP ${I.httpStatus})`:I.status==="not-found"?"Not in this region":"Error"})]},I.modelId))}),i.some(I=>I.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 Ug=["whatsapp","whatsapp_cloud","telegram","signal","slack","discord","email"];function Rye(){const[e,t]=N.useState([]),[n,r]=N.useState(!0),[i,a]=N.useState("all"),[o,l]=N.useState(null),[c,u]=N.useState(""),[d,f]=N.useState(""),[h,p]=N.useState(null),[g,m]=N.useState({}),[v,y]=N.useState({}),[b,w]=N.useState({}),[k,S]=N.useState(null),[x,E]=N.useState(!1),[_,C]=N.useState(!1),[T,L]=N.useState(!1),[M,B]=N.useState(12e4),I=N.useCallback(async()=>{r(!0);const G=await J.getContacts();G.ok&&G.contacts&&t(G.contacts);const Y=await J.gatewayPolicies();if(Y.ok&&Y.policies){const ae={};for(const le of Ug){const X=Y.policies[le];X&&(ae[le]={...X.outboundSenders!==void 0?{outboundSenders:X.outboundSenders}:{},...X.requireApprovedTarget!==void 0?{requireApprovedTarget:X.requireApprovedTarget}:{}})}m(ae),y(ae)}C(Y.askUserWait===!0),L(Y.askUserWait===!0),typeof Y.askUserTimeoutMs=="number"&&B(Y.askUserTimeoutMs),r(!1)},[]);N.useEffect(()=>{I()},[I]);const F=e.filter(G=>i==="all"||G.status===i),z=async G=>{p(null);const Y=await J.approveContact(G.platform,G.name);p(Y.ok?{kind:"ok",text:`โ
${G.name} approved.`}:{kind:"err",text:Y.error||"Failed."}),I()},R=async G=>{p(null);const Y=await J.rejectContact(G.platform,G.name);p(Y.ok?{kind:"ok",text:`๐ซ ${G.name} rejected.`}:{kind:"err",text:Y.error||"Failed."}),I()},O=async G=>{p(null);const Y=await J.deleteContact(G.platform,G.name);p(Y.ok?{kind:"ok",text:`๐๏ธ ${G.name} deleted.`}:{kind:"err",text:Y.error||"Failed."}),I()},U=async()=>{if(!o)return;p(null);const G=await J.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),I()},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]||"๐",$=G=>G?new Date(G).toLocaleString():"โ",P=G=>{const Y=(b[G]??"").trim();Y&&(m(ae=>{var je;const le={...ae[G]??{}},X=le.outboundSenders??((je=v[G])==null?void 0:je.outboundSenders)??[];return X.some(Ne=>Ne.toLowerCase()===Y.toLowerCase())||(le.outboundSenders=[...X,Y]),{...ae,[G]:le}}),w(ae=>({...ae,[G]:""})))},oe=(G,Y)=>{m(ae=>{var je;const le={...ae[G]??{}},X=le.outboundSenders??((je=v[G])==null?void 0:je.outboundSenders)??[];return le.outboundSenders=X.filter(Ne=>Ne.toLowerCase()!==Y.toLowerCase()),{...ae,[G]:le}})},be=G=>{m(Y=>{const ae={...Y[G]??{}};return ae.requireApprovedTarget=ae.requireApprovedTarget!==!0,{...Y,[G]:ae}})},pe=G=>{m(Y=>{const ae={...Y[G]??{}};return delete ae.outboundSenders,{...Y,[G]:ae}})},Ce=async()=>{E(!0),S(null);const G={};for(const le of Ug){const X=g[le]??{},je=v[le]??{};(JSON.stringify(X.outboundSenders??null)!==JSON.stringify(je.outboundSenders??null)||!!X.requireApprovedTarget!=!!je.requireApprovedTarget)&&(G[le]={...X.outboundSenders!==void 0?{outboundSenders:X.outboundSenders}:{outboundSenders:null},requireApprovedTarget:!!X.requireApprovedTarget})}const Y=_!==T;if(Object.keys(G).length===0&&!Y){E(!1),S({kind:"ok",text:"No changes to save."});return}const ae=await J.saveGatewayPolicies(G,void 0,void 0,{wait:_,timeoutMs:M});ae.ok?(S({kind:"ok",text:"โ
Send authority saved."}),I()):S({kind:"err",text:ae.error||"Failed to save send authority."}),E(!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(Y=>Y.status==="approved").length})`:G==="pending"?`โณ Pending (${e.filter(Y=>Y.status==="pending").length})`:`๐ซ Rejected (${e.filter(Y=>Y.status==="rejected").length})`},G)),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void I(),children:"๐ Refresh"})]}),n?s.jsx("div",{className:"empty-state",children:"Loading contacts..."}):F.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:F.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:$(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 z(G),children:"โ
Approve"}),G.status!=="rejected"&&s.jsx("button",{className:"admin-mini-btn contact-reject-btn",onClick:()=>void R(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:Ug.map(G=>{const Y=g[G]??{},ae=Y.outboundSenders??[],le=Y.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(X=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:X}),s.jsx("button",{className:"admin-refresh-btn",disabled:x,onClick:()=>oe(G,X),children:"โ"})]},`sa-${G}-${X}`))}),s.jsxs("div",{className:"hub-send-form",children:[s.jsx("input",{type:"text",value:b[G]??"",onChange:X=>w(je=>({...je,[G]:X.target.value})),placeholder:"sender id, or Allow-All",disabled:x}),s.jsx("button",{className:"admin-refresh-btn",disabled:x||!(b[G]??"").trim(),onClick:()=>P(G),children:"+ Sender"}),le?null:s.jsx("button",{className:"admin-refresh-btn",disabled:x,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:!!Y.requireApprovedTarget,disabled:x,onChange:()=>be(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"}),_?s.jsx("span",{className:"hub-chip",children:"wait for reply"}):s.jsx("span",{className:"hub-chip",children:"assume option 1"}),_!==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:_,disabled:x,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."]})]}),_?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:x,onChange:G=>B(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:x,onClick:()=>void Ce(),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 U(),children:"Save"})]})]})]})})]})}const yj=["proven-dead","proof-expired","parked","never-verified"];function xo(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 Mye(e){if(e<=0)return"never";const t=(Date.now()-e)/(24*60*60*1e3);return t<1?`${(t*24).toFixed(1)}h`:`${t.toFixed(2)}d`}function Iye({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: ${xo(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: ${xo(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: ${xo(i)}`,children:s.jsx("div",{className:"timeline-bar-fill use",style:{width:`${l}%`}})})]})}function vj(e){return{fontSize:11,padding:"2px 8px",borderRadius:4,background:`${e}20`,color:e,border:`1px solid ${e}40`,whiteSpace:"nowrap"}}function $ye(){const[e,t]=N.useState(null),[n,r]=N.useState(!0),[i,a]=N.useState(null),[o,l]=N.useState("all"),[c,u]=N.useState("provider"),d=N.useRef(!0),f=N.useCallback(async()=>{try{const R=await fetch("/api/model-timeline");if(!R.ok)throw new Error("Failed to fetch timeline data");const O=await R.json();d.current&&(t(O),a(null))}catch(R){d.current&&a(R instanceof Error?R.message:"Failed to load timeline")}finally{d.current&&r(!1)}},[]),[h,p]=N.useState(null),[g,m]=N.useState(10),[v,y]=N.useState(!1),[b,w]=N.useState(null),k=N.useRef(!1),S=N.useCallback(async()=>{const R=await J.fetchVerifyBacklog();if(!d.current)return;p(R);const O=(R==null?void 0:R.status)==="running";k.current&&!O&&f(),k.current=O},[f]);N.useEffect(()=>{d.current=!0,f(),S();const R=setInterval(()=>void f(),3e4);return()=>{d.current=!1,clearInterval(R)}},[f,S]);const x=(h==null?void 0:h.status)==="running";N.useEffect(()=>{if(!x)return;const R=setInterval(()=>void S(),1e3);return()=>clearInterval(R)},[x,S]);const E=N.useCallback(async()=>{y(!0),w(null);const R=await J.startVerifyBacklog(g);if(d.current){if(R.state&&p(R.state),!R.ok){const O=R.refusal??R.error??"Could not start the run.";w({text:O,kind:R.refusal?"info":"error"})}y(!1)}},[g]);if(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})]});if(e&&!e.counts)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"๐
Model Discovery Timeline"}),s.jsxs("div",{className:"admin-row-msg admin-row-msg-err",children:["This dashboard server predates the reachability view. Restart it (",s.jsx("code",{children:"nuvira dashboard stop"}),", then start it again) and reload this page."]})]});const _=(e==null?void 0:e.entries)??[],C=e==null?void 0:e.counts,T=e==null?void 0:e.reachabilityCopy,L=e==null?void 0:e.freshnessCopy,M=C?yj.reduce((R,O)=>R+(C[O]??0),0):0,B=_.filter(R=>o==="routable"?R.reachability==="routable":o==="not-routable"?R.reachability!=="routable":!0),I=[...B].sort((R,O)=>c==="provider"?R.provider.localeCompare(O.provider)||R.model.localeCompare(O.model):O.lastProbedAt-R.lastProbedAt),F=new Map;for(const R of I){const O=F.get(R.provider);O?O.push(R):F.set(R.provider,[R])}const z=R=>({background:R?"#238636":"#21262d",border:`1px solid ${R?"#3fb950":"#30363d"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"});return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"๐
Model Discovery Timeline"}),s.jsxs("p",{className:"section-description",children:["The registry's age profile: when each tracked model was last probed, last ",s.jsx("em",{children:"verified"}),", and last used โ and which ones routing can actually reach. The Models page answers โis it usable right nowโ; this one answers โwhat is ageing outโ."]}),s.jsxs("div",{className:"stats-grid",style:{marginBottom:8},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:"Tracked models"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#3fb950"},children:[s.jsx("div",{className:"stat-value",style:{color:"#3fb950"},children:(C==null?void 0:C.routable)??0}),s.jsx("div",{className:"stat-label",children:"Routable now"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#8b949e"},children:[s.jsx("div",{className:"stat-value",style:{color:"#8b949e"},children:M}),s.jsx("div",{className:"stat-label",children:"Not routable"})]})]}),C?s.jsx("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginBottom:14,fontSize:11},children:yj.map(R=>{const O=T==null?void 0:T[R];return s.jsxs("span",{title:O==null?void 0:O.blurb,children:[s.jsx("span",{style:{color:(O==null?void 0:O.color)??"#8b949e"},children:"โ "})," ",s.jsxs("span",{style:{color:"#8b949e"},children:[(O==null?void 0:O.label)??R,": ",s.jsx("strong",{style:{color:"#e6edf3"},children:C[R]??0})]})]},R)})}):null,h?s.jsxs("div",{style:{background:"#161b22",border:"1px solid #30363d",borderRadius:8,padding:"12px 14px",marginBottom:16},"data-testid":"verify-backlog-panel",children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[s.jsx("span",{style:{fontWeight:600,color:"#e6edf3"},children:"Work the backlog down"}),s.jsxs("span",{style:{fontSize:11,color:"#8b949e",flex:1,minWidth:260},children:["Each check is a real 1-token generation against one of your provider keys โ not a listing lookup. A never-verified model is an ",s.jsx("em",{children:"unknown"}),", not a broken one: a check either proves it routable or marks it proven dead. Runs are bounded and one at a time."]}),s.jsxs("label",{style:{fontSize:11,color:"#8b949e",display:"flex",alignItems:"center",gap:6},children:["How many",s.jsx("input",{type:"number",min:1,max:h.maxCount??25,value:g,disabled:v||x,"aria-label":"how many models to verify",onChange:R=>m(Number(R.target.value)),style:{width:64,background:"#0d1117",color:"#e6edf3",border:"1px solid #30363d",borderRadius:4,padding:"3px 6px",fontSize:12}})]}),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:v||x||!(g>0),onClick:()=>void E(),style:{background:"#238636",border:"1px solid #3fb950",padding:"4px 12px",fontSize:12,cursor:v||x?"default":"pointer"},"data-testid":"verify-backlog-start",children:x?"โณ Verifyingโฆ":v?"Startingโฆ":`โถ Verify next ${g} now`})]}),x?s.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-progress",children:["Probing"," ",s.jsx("code",{children:h.current?`${h.current.provider}/${h.current.model}`:"โฆ"})," ","โ ",h.processed,"/",h.planned," done ยท ",h.verified," verified ยท ",h.unavailable," proven dead"]}):null,!x&&h.status==="done"?s.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-summary",children:["โ
",h.verified," verified ยท โ ",h.unavailable," proven unavailable ยท โ ๏ธ ",h.errored," errored ยท โญ"," ",h.skipped," skipped",h.remaining!==null?` โ ${h.remaining} still never verified`:""]}):null,(h.results??[]).length>0?s.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:8},children:(h.results??[]).map(R=>s.jsxs("span",{style:{fontSize:11,color:"#8b949e"},title:R.outcome==="verified"?"Proven routable โ a 1-token call succeeded":R.outcome==="unavailable"?"Proven dead โ the provider refused it (403/404), re-probing will not help":R.outcome==="skipped"?"Skipped โ verified recently enough":"Errored โ transient, still unknown, will be retried next run",children:[R.outcome==="verified"?"โ
":R.outcome==="unavailable"?"โ":R.outcome==="skipped"?"โญ":"โ ๏ธ"," ",s.jsxs("code",{children:[R.provider,"/",R.model]})]},`${R.provider}:${R.model}`))}):null,b?s.jsx("div",{className:`env-var-notice${b.kind==="error"?" env-var-notice-error":""}`,"data-testid":"verify-backlog-message",children:b.text}):h.status==="idle"&&h.refusal?s.jsx("div",{className:"env-var-notice","data-testid":"verify-backlog-message",children:h.refusal}):null]}):null,s.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:[s.jsx("div",{style:{display:"flex",gap:4},children:["all","routable","not-routable"].map(R=>s.jsx("button",{className:`admin-refresh-btn ${o===R?"active":""}`,onClick:()=>l(R),style:z(o===R),children:R==="all"?"All":R==="routable"?"Routable":"Not routable"},R))}),s.jsx("div",{style:{display:"flex",gap:4},children:["provider","lastProbed"].map(R=>s.jsxs("button",{className:`admin-refresh-btn ${c===R?"active":""}`,onClick:()=>u(R),style:z(c===R),children:["Sort: ",R==="lastProbed"?"Last seen":"Provider"]},R))}),s.jsx("button",{className:"admin-refresh-btn",onClick:()=>void 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:4,fontSize:11,color:"#8b949e",flexWrap:"wrap"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#58a6ff"},children:"โ "})," Probe (last seen in the provider's catalog)"]}),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.jsxs("div",{style:{marginBottom:12,fontSize:11,color:"#8b949e"},children:[s.jsx("strong",{style:{color:"#e6edf3"},children:"Fresh"})," means the provider still lists it."," ",s.jsx("strong",{style:{color:"#e6edf3"},children:"Routable"})," means a turn has been proven to work on it within"," ",(e==null?void 0:e.freshDays)??7," days. A fresh model that was never verified is an unknown, not a failure โ background spot-checks work through those a few at a time."]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from(F.entries()).map(([R,O])=>{const U=O.filter(A=>A.reachability==="routable").length;return 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:R==="groq"?"โก":R==="gemini"?"๐":R==="local"?"๐ป":"๐ค"}),s.jsx("span",{style:{fontWeight:600,color:"#e6edf3"},children:R}),s.jsxs("span",{style:{fontSize:12,color:"#8b949e"},children:["(",O.length," shown ยท ",U," routable)"]})]}),s.jsx("div",{style:{padding:"8px 14px"},children:O.map(A=>{const Z=Date.now(),$=T==null?void 0:T[A.reachability],P=L==null?void 0:L[A.freshness],oe=($==null?void 0:$.color)??"#8b949e";return s.jsxs("div",{"data-testid":`timeline-row-${A.provider}-${A.model}`,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:A.model}),s.jsxs("div",{style:{fontSize:11,color:"#8b949e",display:"flex",gap:12,flexWrap:"wrap"},children:[s.jsxs("span",{children:["Probed: ",xo(Z-A.lastProbedAt)]}),s.jsxs("span",{children:["Verified: ",A.lastVerifiedAt>0?xo(Z-A.lastVerifiedAt):"never"]}),A.lastUsedAt>0&&s.jsxs("span",{children:["Used: ",xo(Z-A.lastUsedAt)]}),A.latencyMs!==void 0&&s.jsxs("span",{children:[A.latencyMs,"ms"]}),A.errorRate>0&&s.jsxs("span",{style:{color:A.errorRate>.5?"#f85149":"#d29922"},children:["err ",(A.errorRate*100).toFixed(0),"%"]}),A.daysSinceVerify!==null&&A.daysSinceVerify>7&&s.jsxs("span",{style:{color:"#d29922"},children:["proof ",Mye(A.lastVerifiedAt)," old"]})]})]}),s.jsx(Iye,{entry:A}),P&&s.jsx("span",{style:vj(P.color),title:P.blurb,children:P.label}),s.jsx("span",{style:vj(oe),title:($==null?void 0:$.blurb)??A.reachability,"data-testid":`reachability-${A.provider}-${A.model}`,children:(($==null?void 0:$.label)??A.reachability).toUpperCase()})]},A.model)})})]},R)})}),B.length===0&&s.jsx("div",{style:{textAlign:"center",padding:"40px 20px",color:"#8b949e"},children:o==="routable"&&_.length>0?"No model is routable right now โ every tracked model is unverified, parked, expired or dead. The Models page shows what each provider would offer live.":"No models match the current filter"})]})}function Ma(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":gt(e)}function Lye(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function Dye({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:Ma(t.total)}),s.jsx("div",{className:"stat-label",children:"Trajectories"})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:Lye(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:Ma((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:Ma(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:Ma(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:Ma(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?` ยท ${Ma(a.last7d)} recall(s) this week, ${Ma(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 Bye(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function zye({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:["๐
",Bye(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 Fye({onFetch:e,onClear:t,onExport:n}){const[r,i]=N.useState([]),[a,o]=N.useState(!1),[l,c]=N.useState(""),[u,d]=N.useState(""),[f,h]=N.useState(null),[p,g]=N.useState(null);N.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,x=k.filter(C=>C.status==="success").length,E=k.filter(C=>C.status==="failure").length,_=S>0?Math.round(k.reduce((C,T)=>C+T.durationMs,0)/S):0;g({total:S,success:x,failure:E,avgDuration:_})}catch(k){console.error("Failed to fetch execution history:",k)}finally{o(!1)}},v=async k=>{if(n)try{const S=await n(k),x=new Blob([S],{type:k==="json"?"application/json":"text/csv"}),E=URL.createObjectURL(x),_=document.createElement("a");_.href=E,_.download=`execution-history.${k}`,_.click(),URL.revokeObjectURL(E)}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"โ"}},w=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:[w(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 Uye({envVars:e,onSave:t,onDelete:n,onTest:r,readOnly:i=!1}){const[a,o]=N.useState(null),[l,c]=N.useState(""),[u,d]=N.useState(!1),[f,h]=N.useState(""),[p,g]=N.useState(""),[m,v]=N.useState(null),[y,b]=N.useState({}),w=[...e].sort((E,_)=>E.requiredBy&&!_.requiredBy?-1:!E.requiredBy&&_.requiredBy?1:E.name.localeCompare(_.name)),k=E=>{t(E,l),o(null),c("")},S=()=>{f&&p&&(t(f,p),h(""),g(""),d(!1))},x=async E=>{if(r){v(E);try{const _=await r(E);b(C=>({...C,[E]:_}))}catch{b(_=>({..._,[E]:!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:E=>h(E.target.value)}),s.jsx("input",{className:"env-var-input",type:"password",placeholder:"Value",value:p,onChange:E=>g(E.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:w.length===0?s.jsx("div",{className:"env-var-empty",children:"No environment variables configured. Add one to get started."}):w.map(E=>s.jsxs("div",{className:`env-var-row ${E.isSet?"env-var-set":"env-var-missing"} ${E.isProviderCredential?"env-var-blocked":""}`,children:[s.jsxs("div",{className:"env-var-row-header",children:[s.jsxs("span",{className:"env-var-name",children:[E.name,E.requiredBy&&s.jsxs("span",{className:"env-var-required-badge",children:["required by ",E.requiredBy]}),E.isProviderCredential&&s.jsx("span",{className:"env-var-blocked-badge",children:"๐ provider credential (blocked)"})]}),s.jsx("span",{className:"env-var-status",children:E.isSet?"โ
Set":"โ Not set"})]}),E.description&&s.jsx("div",{className:"env-var-description",children:E.description}),a===E.name?s.jsxs("div",{className:"env-var-edit",children:[s.jsx("input",{className:"env-var-input",type:"password",value:l,onChange:_=>c(_.target.value),placeholder:"Enter new value..."}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>k(E.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&&!E.isProviderCredential&&s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{o(E.name),c("")},children:"โ๏ธ Edit"}),r&&s.jsx("button",{className:"admin-mini-btn",type:"button",disabled:m===E.name,onClick:()=>x(E.name),children:m===E.name?"โณ Testing...":"๐งช Test"}),!i&&s.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:()=>n(E.name),children:"๐๏ธ Delete"}),y[E.name]!==void 0&&s.jsx("span",{className:`env-var-test-result ${y[E.name]?"env-var-test-pass":"env-var-test-fail"}`,children:y[E.name]?"โ
Valid":"โ Invalid"})]})]},E.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 Wye(){const[e,t]=N.useState({configured:!1,authenticated:!1,role:null}),[n,r]=N.useState([]),[i,a]=N.useState(!0),[o,l]=N.useState(null),[c,u]=N.useState(null),d=e.authenticated&&(e.role==="admin"||e.role==="operator"),f=N.useCallback(async()=>{a(!0);const m=await J.fetchSkillEnv();r(m),a(!1)},[]);N.useEffect(()=>{J.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=N.useCallback(async(m,v)=>{var w;l(null),u(null);const y=await J.saveSecrets({[m]:v}),b=(w=y.refused)==null?void 0:w.find(k=>k.name===m);!y.ok||b?l(b?Hye(m,b.reason):y.error||`Could not save ${m}.`):u(`Saved ${m}.`),await f()},[f]),p=N.useCallback(async m=>{l(null),u(null);const v=await J.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=N.useCallback(async m=>{const v=await J.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(Uye,{envVars:n,onSave:(m,v)=>void h(m,v),onDelete:m=>void p(m),onTest:g,readOnly:!d})]})}function Hye(e,t){switch(t){case"provider-credential":return`${e} is a provider credential โ configure it in provider setup instead. Skills never receive it.`;case"invalid-name":return`${e} is not a valid environment variable name.`;case"write-failed":return`${e} could not be written to the env file.`;default:return`${e} was not saved (${t}).`}}const Gye=[{id:"turn",title:"Turn behaviour",blurb:"How each turn runs. Unset means nobody has asked for anything, which is not the same as asking for no."},{id:"observability",title:"Observability",blurb:"What a run records about itself. Both are off by default and off unless asked for."},{id:"hooks",title:"Tool hooks",blurb:"A command run around every tool call, with the call on stdin as JSON. For a phase, a value here REPLACES the hooks declared in tools.hooks."}];function qye(){const[e,t]=N.useState({configured:!1,authenticated:!1,role:null}),[n,r]=N.useState([]),[i,a]=N.useState(!0),[o,l]=N.useState(null),[c,u]=N.useState(null),[d,f]=N.useState({}),[h,p]=N.useState(null),g=e.authenticated&&(e.role==="admin"||e.role==="operator"),m=N.useCallback(async()=>{a(!0),r(await J.fetchProcessEnv()),a(!1)},[]);N.useEffect(()=>{J.fetchAdminAuthStatus().then(b=>{t(b?{configured:b.configured,authenticated:b.authenticated,role:b.role??null}:{configured:!1,authenticated:!1,role:null})}),m()},[m]);const v=N.useCallback(async(b,w)=>{p(b),l(null),u(null);const k=await J.saveProcessEnvVar(b,w);if(!k.ok||!k.row)l(k.error||`Could not set ${b}.`);else{const S=k.row;r(x=>x.map(E=>E.name===S.name?S:E)),f(x=>({...x,[b]:""})),u(`${b} = ${S.fileValue}. Takes effect on the next turn; the dashboard picked it up immediately.`)}p(null)},[]),y=N.useCallback(async b=>{p(b),l(null),u(null);const w=await J.deleteProcessEnvVar(b);if(!w.ok||!w.row)l(w.error||`Could not unset ${b}.`);else{const k=w.row;r(S=>S.map(x=>x.name===k.name?k:x)),f(S=>({...S,[b]:""})),u(w.removed?`${b} removed from the env file. ${k.unsetMeans}`:`${b} had no line in the env file. ${k.unsetMeans}`)}p(null)},[]);return s.jsxs("div",{children:[s.jsx("h2",{className:"section-title",children:"๐ฑ Process Environment"}),s.jsxs("div",{className:"env-var-header",children:[s.jsx("span",{className:"env-var-title",children:"These are the switches Agent-Nuvira reads for how a run behaves. Values are written to the credential env file and are not masked โ do not put a secret in a hook command."}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void m(),children:"โป Refresh"})]}),s.jsxs("div",{className:"admin-hint",children:["A value exported in your shell ",s.jsx("strong",{children:"wins over this file"}),", for the dashboard and for every CLI run in that shell. A row that says ",s.jsx("em",{children:"shell value wins"})," is reporting exactly that, and writes here will not change it."]}),e.authenticated?null:s.jsx("div",{className:"admin-hint",children:e.configured?"Log in to view or change the process environment.":"Set up an admin account to change the process environment."}),e.authenticated&&!g?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โฆ"}):Gye.map(b=>{const w=n.filter(k=>k.group===b.id);return w.length===0?null:s.jsxs("section",{className:"process-env-group",children:[s.jsx("h3",{className:"process-env-group-title",children:b.title}),s.jsx("p",{className:"process-env-group-blurb",children:b.blurb}),s.jsx("div",{className:"env-var-list",children:w.map(k=>s.jsx(Kye,{row:k,draft:d[k.name]??"",busy:h===k.name,readOnly:!g,onDraft:S=>f(x=>({...x,[k.name]:S})),onSet:S=>void v(k.name,S),onUnset:()=>void y(k.name)},k.name))})]},b.id)})]})}function Kye({row:e,draft:t,busy:n,readOnly:r,onDraft:i,onSet:a,onUnset:o}){const l=e.state==="on",c=e.state!=="unset",u=f=>`admin-mini-btn${f?" process-env-active":""}`,d=e.kind==="flag"&&e.fileValue!==null&&e.fileValue!=="1"&&e.fileValue!=="0"?e.fileValue:null;return s.jsxs("div",{className:`env-var-row ${c?"env-var-set":"env-var-missing"}`,"data-testid":`process-env-row-${e.name}`,children:[s.jsxs("div",{className:"env-var-row-header",children:[s.jsxs("span",{className:"env-var-name",children:[e.name,e.shadowed?s.jsxs("span",{className:"env-var-blocked-badge",children:["โ ๏ธ shell value wins: ",e.processValue]}):null]}),s.jsxs("span",{className:"env-var-status",children:[e.kind==="flag"?l?"โ
On":c?"โญ Off":"โ Unset":c?"โ
Set":"โ Unset",d?` (${d})`:""]})]}),s.jsxs("div",{className:"env-var-description",children:[s.jsx("strong",{children:e.label})," โ ",e.description]}),s.jsxs("div",{className:"env-var-description",children:["Unset: ",e.unsetMeans]}),e.cliEquivalent?s.jsxs("div",{className:"env-var-description",children:["Same switch: ",s.jsx("code",{children:e.cliEquivalent})]}):null,e.warning?s.jsxs("div",{className:"env-var-warning",children:["โ ๏ธ ",e.warning]}):null,r?null:s.jsxs("div",{className:"env-var-actions",children:[e.kind==="flag"?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:u(l),type:"button",disabled:n,onClick:()=>a("1"),children:"On"}),s.jsx("button",{className:u(c&&!l),type:"button",disabled:n,onClick:()=>a("0"),children:"Off"}),s.jsx("button",{className:u(!c),type:"button",disabled:n,onClick:o,children:"Unset"})]}):null,e.kind==="text"||e.acceptsValue?s.jsxs(s.Fragment,{children:[s.jsx("input",{className:"env-var-input",type:"text",value:t,placeholder:e.placeholder,disabled:n,onChange:f=>i(f.target.value),"aria-label":`${e.name} value`}),s.jsxs("button",{className:"admin-mini-btn",type:"button",disabled:n||t.trim()==="",onClick:()=>a(t),children:["๐พ ",e.valueLabel??"Save"]})]}):null,e.kind==="text"?s.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:n,onClick:o,children:"๐๏ธ Unset"}):null]})]})}function Vye(){const[e,t]=N.useState(null),[n,r]=N.useState(!1),[i,a]=N.useState("--"),o=N.useCallback(c=>{t(c),a(new Date().toLocaleTimeString())},[]),l=N.useCallback(c=>{r(c)},[]);return N.useEffect(()=>{J.fetchAll().then(d=>{d&&o(d)});const c=J.subscribe(o),u=J.onConnectionChange(l);return J.connect(),()=>{c(),u(),J.disconnect()}},[o,l]),s.jsx(fD,{connected:n,lastUpdated:i,children:s.jsxs(GL,{children:[s.jsx(tt,{path:"/",element:s.jsx(pj,{})}),s.jsx(tt,{path:"/overview",element:s.jsx(Hie,{data:e})}),s.jsx(tt,{path:"/chat",element:s.jsx(N1,{to:"/",replace:!0})}),s.jsx(tt,{path:"/dag",element:s.jsx(eae,{data:e})}),s.jsx(tt,{path:"/costs",element:s.jsx(nae,{data:e})}),s.jsx(tt,{path:"/benchmarks",element:s.jsx(iae,{data:e})}),s.jsx(tt,{path:"/models",element:s.jsx(Hae,{})}),s.jsx(tt,{path:"/models/timeline",element:s.jsx($ye,{})}),s.jsx(tt,{path:"/routing",element:s.jsx(Ese,{data:e})}),s.jsx(tt,{path:"/requests",element:s.jsx(Ase,{data:e})}),s.jsx(tt,{path:"/traces",element:s.jsx(Bse,{})}),s.jsx(tt,{path:"/hub",element:s.jsx(Zse,{})}),s.jsx(tt,{path:"/tasks",element:s.jsx(eoe,{})}),s.jsx(tt,{path:"/chat",element:s.jsx(pj,{})}),s.jsx(tt,{path:"/evals",element:s.jsx(jye,{data:e})}),s.jsx(tt,{path:"/platforms",element:s.jsx(Tye,{})}),s.jsx(tt,{path:"/bedrock",element:s.jsx(Pye,{canWrite:!0,sessionExpired:c=>console.error(c)})}),s.jsx(tt,{path:"/contacts",element:s.jsx(Rye,{})}),s.jsx(tt,{path:"/gateway",element:s.jsx(Cye,{})}),s.jsx(tt,{path:"/env",element:s.jsx(Wye,{})}),s.jsx(tt,{path:"/process-env",element:s.jsx(qye,{})}),s.jsx(tt,{path:"/memory",element:s.jsx(Dye,{data:e})}),s.jsx(tt,{path:"/history",element:s.jsx(zye,{data:e})}),s.jsx(tt,{path:"/executions",element:s.jsx(Fye,{onFetch:c=>J.fetchExecutionAudit(c)})}),s.jsx(tt,{path:"/system",element:s.jsx(lae,{data:e,connected:n,lastUpdated:i})}),s.jsx(tt,{path:"/admin",element:s.jsx(Use,{})}),s.jsx(tt,{path:"*",element:s.jsx(N1,{to:"/",replace:!0})})]})})}OC(document.getElementById("root")).render(s.jsx(N.StrictMode,{children:s.jsx(JL,{children:s.jsx(Vye,{})})}));
|
|
207
|
-
//# sourceMappingURL=index-BFquuwq9.js.map
|