agent-nuvira 2.6.6 โ†’ 2.6.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.
@@ -1,207 +0,0 @@
1
- var QR=Object.defineProperty;var JR=(e,t,n)=>t in e?QR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qr=(e,t,n)=>JR(e,typeof t!="symbol"?t+"":t,n);function e2(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 zi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var KN={exports:{}},Ep={},VN={exports:{}},Le={};/**
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 su=Symbol.for("react.element"),t2=Symbol.for("react.portal"),n2=Symbol.for("react.fragment"),r2=Symbol.for("react.strict_mode"),i2=Symbol.for("react.profiler"),a2=Symbol.for("react.provider"),o2=Symbol.for("react.context"),s2=Symbol.for("react.forward_ref"),l2=Symbol.for("react.suspense"),c2=Symbol.for("react.memo"),u2=Symbol.for("react.lazy"),U0=Symbol.iterator;function d2(e){return e===null||typeof e!="object"?null:(e=U0&&e[U0]||e["@@iterator"],typeof e=="function"?e:null)}var YN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},XN=Object.assign,ZN={};function Fs(e,t,n){this.props=e,this.context=t,this.refs=ZN,this.updater=n||YN}Fs.prototype.isReactComponent={};Fs.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")};Fs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function QN(){}QN.prototype=Fs.prototype;function rb(e,t,n){this.props=e,this.context=t,this.refs=ZN,this.updater=n||YN}var ib=rb.prototype=new QN;ib.constructor=rb;XN(ib,Fs.prototype);ib.isPureReactComponent=!0;var W0=Array.isArray,JN=Object.prototype.hasOwnProperty,ab={current:null},ej={key:!0,ref:!0,__self:!0,__source:!0};function tj(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)JN.call(t,r)&&!ej.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:su,type:e,key:a,ref:o,props:i,_owner:ab.current}}function f2(e,t){return{$$typeof:su,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ob(e){return typeof e=="object"&&e!==null&&e.$$typeof===su}function p2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var H0=/\/+/g;function Kh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?p2(""+e.key):t.toString(36)}function Ad(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 su:case t2:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Kh(o,0):r,W0(i)?(n="",e!=null&&(n=e.replace(H0,"$&/")+"/"),Ad(i,t,n,"",function(u){return u})):i!=null&&(ob(i)&&(i=f2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(H0,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",W0(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+Kh(a,l);o+=Ad(a,t,n,c,i)}else if(c=d2(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+Kh(a,l++),o+=Ad(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 $u(e,t,n){if(e==null)return e;var r=[],i=0;return Ad(e,r,"","",function(a){return t.call(n,a,i++)}),r}function h2(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Nn={current:null},Td={transition:null},m2={ReactCurrentDispatcher:Nn,ReactCurrentBatchConfig:Td,ReactCurrentOwner:ab};function nj(){throw Error("act(...) is not supported in production builds of React.")}Le.Children={map:$u,forEach:function(e,t,n){$u(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $u(e,function(){t++}),t},toArray:function(e){return $u(e,function(t){return t})||[]},only:function(e){if(!ob(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Le.Component=Fs;Le.Fragment=n2;Le.Profiler=i2;Le.PureComponent=rb;Le.StrictMode=r2;Le.Suspense=l2;Le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=m2;Le.act=nj;Le.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=XN({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=ab.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)JN.call(t,c)&&!ej.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:su,type:e.type,key:i,ref:a,props:r,_owner:o}};Le.createContext=function(e){return e={$$typeof:o2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:a2,_context:e},e.Consumer=e};Le.createElement=tj;Le.createFactory=function(e){var t=tj.bind(null,e);return t.type=e,t};Le.createRef=function(){return{current:null}};Le.forwardRef=function(e){return{$$typeof:s2,render:e}};Le.isValidElement=ob;Le.lazy=function(e){return{$$typeof:u2,_payload:{_status:-1,_result:e},_init:h2}};Le.memo=function(e,t){return{$$typeof:c2,type:e,compare:t===void 0?null:t}};Le.startTransition=function(e){var t=Td.transition;Td.transition={};try{e()}finally{Td.transition=t}};Le.unstable_act=nj;Le.useCallback=function(e,t){return Nn.current.useCallback(e,t)};Le.useContext=function(e){return Nn.current.useContext(e)};Le.useDebugValue=function(){};Le.useDeferredValue=function(e){return Nn.current.useDeferredValue(e)};Le.useEffect=function(e,t){return Nn.current.useEffect(e,t)};Le.useId=function(){return Nn.current.useId()};Le.useImperativeHandle=function(e,t,n){return Nn.current.useImperativeHandle(e,t,n)};Le.useInsertionEffect=function(e,t){return Nn.current.useInsertionEffect(e,t)};Le.useLayoutEffect=function(e,t){return Nn.current.useLayoutEffect(e,t)};Le.useMemo=function(e,t){return Nn.current.useMemo(e,t)};Le.useReducer=function(e,t,n){return Nn.current.useReducer(e,t,n)};Le.useRef=function(e){return Nn.current.useRef(e)};Le.useState=function(e){return Nn.current.useState(e)};Le.useSyncExternalStore=function(e,t,n){return Nn.current.useSyncExternalStore(e,t,n)};Le.useTransition=function(){return Nn.current.useTransition()};Le.version="18.3.1";VN.exports=Le;var E=VN.exports;const W=Ye(E),g2=e2({__proto__:null,default:W},[E]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var y2=E,v2=Symbol.for("react.element"),b2=Symbol.for("react.fragment"),x2=Object.prototype.hasOwnProperty,w2=y2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S2={key:!0,ref:!0,__self:!0,__source:!0};function rj(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)x2.call(t,r)&&!S2.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:v2,type:e,key:a,ref:o,props:i,_owner:w2.current}}Ep.Fragment=b2;Ep.jsx=rj;Ep.jsxs=rj;KN.exports=Ep;var s=KN.exports,ij={exports:{}},Zn={},aj={exports:{}},oj={};/**
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,z){var T=O.length;O.push(z);e:for(;0<T;){var V=T-1>>>1,q=O[V];if(0<i(q,z))O[V]=z,O[T]=q,T=V;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var z=O[0],T=O.pop();if(T!==z){O[0]=T;e:for(var V=0,q=O.length,P=q>>>1;V<P;){var ce=2*(V+1)-1,me=O[ce],ue=ce+1,He=O[ue];if(0>i(me,T))ue<q&&0>i(He,me)?(O[V]=He,O[ue]=T,V=ue):(O[V]=me,O[ce]=T,V=ce);else if(ue<q&&0>i(He,T))O[V]=He,O[ue]=T,V=ue;else break e}}return z}function i(O,z){var T=O.sortIndex-z.sortIndex;return T!==0?T:O.id-z.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,p=3,h=!1,g=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=O)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function _(O){if(m=!1,x(O),!g)if(n(c)!==null)g=!0,L(S);else{var z=n(u);z!==null&&U(_,z.startTime-O)}}function S(O,z){g=!1,m&&(m=!1,y(N),N=-1),h=!0;var T=p;try{for(x(z),f=n(c);f!==null&&(!(f.expirationTime>z)||O&&!I());){var V=f.callback;if(typeof V=="function"){f.callback=null,p=f.priorityLevel;var q=V(f.expirationTime<=z);z=e.unstable_now(),typeof q=="function"?f.callback=q:f===n(c)&&r(c),x(z)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var ce=n(u);ce!==null&&U(_,ce.startTime-z),P=!1}return P}finally{f=null,p=T,h=!1}}var w=!1,k=null,N=-1,j=5,C=-1;function I(){return!(e.unstable_now()-C<j)}function M(){if(k!==null){var O=e.unstable_now();C=O;var z=!0;try{z=k(!0,O)}finally{z?$():(w=!1,k=null)}}else w=!1}var $;if(typeof b=="function")$=function(){b(M)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,B=R.port2;R.port1.onmessage=M,$=function(){B.postMessage(null)}}else $=function(){v(M,0)};function L(O){k=O,w||(w=!0,$())}function U(O,z){N=v(function(){O(e.unstable_now())},z)}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||h||(g=!0,L(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"):j=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(O){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var T=p;p=z;try{return O()}finally{p=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,z){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var T=p;p=O;try{return z()}finally{p=T}},e.unstable_scheduleCallback=function(O,z,T){var V=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?V+T:V):T=V,O){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=T+q,O={id:d++,callback:z,priorityLevel:O,startTime:T,expirationTime:q,sortIndex:-1},T>V?(O.sortIndex=T,t(u,O),n(c)===null&&O===n(u)&&(m?(y(N),N=-1):m=!0,U(_,T-V))):(O.sortIndex=q,t(c,O),g||h||(g=!0,L(S))),O},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(O){var z=p;return function(){var T=p;p=z;try{return O.apply(this,arguments)}finally{p=T}}}})(oj);aj.exports=oj;var k2=aj.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 _2=E,Yn=k2;function re(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 sj=new Set,nc={};function lo(e,t){us(e,t),us(e+"Capture",t)}function us(e,t){for(nc[e]=t,e=0;e<t.length;e++)sj.add(t[e])}var di=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kg=Object.prototype.hasOwnProperty,E2=/^[: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]*$/,G0={},q0={};function N2(e){return kg.call(q0,e)?!0:kg.call(G0,e)?!1:E2.test(e)?q0[e]=!0:(G0[e]=!0,!1)}function j2(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 A2(e,t,n,r){if(t===null||typeof t>"u"||j2(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function jn(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var on={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){on[e]=new jn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];on[t]=new jn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){on[e]=new jn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){on[e]=new jn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){on[e]=new jn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){on[e]=new jn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){on[e]=new jn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){on[e]=new jn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){on[e]=new jn(e,5,!1,e.toLowerCase(),null,!1,!1)});var sb=/[\-:]([a-z])/g;function lb(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(sb,lb);on[t]=new jn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(sb,lb);on[t]=new jn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(sb,lb);on[t]=new jn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){on[e]=new jn(e,1,!1,e.toLowerCase(),null,!1,!1)});on.xlinkHref=new jn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){on[e]=new jn(e,1,!1,e.toLowerCase(),null,!0,!0)});function cb(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")&&(A2(t,n,i,r)&&(n=null),r||i===null?N2(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 vi=_2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Lu=Symbol.for("react.element"),Lo=Symbol.for("react.portal"),Do=Symbol.for("react.fragment"),ub=Symbol.for("react.strict_mode"),_g=Symbol.for("react.profiler"),lj=Symbol.for("react.provider"),cj=Symbol.for("react.context"),db=Symbol.for("react.forward_ref"),Eg=Symbol.for("react.suspense"),Ng=Symbol.for("react.suspense_list"),fb=Symbol.for("react.memo"),Mi=Symbol.for("react.lazy"),uj=Symbol.for("react.offscreen"),K0=Symbol.iterator;function fl(e){return e===null||typeof e!="object"?null:(e=K0&&e[K0]||e["@@iterator"],typeof e=="function"?e:null)}var St=Object.assign,Vh;function Rl(e){if(Vh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Vh=t&&t[1]||""}return`
34
- `+Vh+e}var Yh=!1;function Xh(e,t){if(!e||Yh)return"";Yh=!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{Yh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Rl(e):""}function T2(e){switch(e.tag){case 5:return Rl(e.type);case 16:return Rl("Lazy");case 13:return Rl("Suspense");case 19:return Rl("SuspenseList");case 0:case 2:case 15:return e=Xh(e.type,!1),e;case 11:return e=Xh(e.type.render,!1),e;case 1:return e=Xh(e.type,!0),e;default:return""}}function jg(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 Do:return"Fragment";case Lo:return"Portal";case _g:return"Profiler";case ub:return"StrictMode";case Eg:return"Suspense";case Ng:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case cj:return(e.displayName||"Context")+".Consumer";case lj:return(e._context.displayName||"Context")+".Provider";case db:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fb:return t=e.displayName||null,t!==null?t:jg(e.type)||"Memo";case Mi:t=e._payload,e=e._init;try{return jg(e(t))}catch{}}return null}function C2(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 jg(t);case 8:return t===ub?"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 ra(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function O2(e){var t=dj(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 Du(e){e._valueTracker||(e._valueTracker=O2(e))}function fj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=dj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Wd(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 Ag(e,t){var n=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function V0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ra(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 pj(e,t){t=t.checked,t!=null&&cb(e,"checked",t,!1)}function Tg(e,t){pj(e,t);var n=ra(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")?Cg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Cg(e,t.type,ra(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Y0(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 Cg(e,t,n){(t!=="number"||Wd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Il=Array.isArray;function es(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=""+ra(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 Og(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(re(91));return St({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function X0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(re(92));if(Il(n)){if(1<n.length)throw Error(re(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ra(n)}}function hj(e,t){var n=ra(t.value),r=ra(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 Z0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function mj(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 Pg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?mj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Bu,gj=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(Bu=Bu||document.createElement("div"),Bu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Bu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bl={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},P2=["Webkit","ms","Moz","O"];Object.keys(Bl).forEach(function(e){P2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bl[t]=Bl[e]})});function yj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Bl.hasOwnProperty(e)&&Bl[e]?(""+t).trim():t+"px"}function vj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=yj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var M2=St({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 Mg(e,t){if(t){if(M2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(re(62))}}function Rg(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 Ig=null;function pb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $g=null,ts=null,ns=null;function Q0(e){if(e=uu(e)){if(typeof $g!="function")throw Error(re(280));var t=e.stateNode;t&&(t=Cp(t),$g(e.stateNode,e.type,t))}}function bj(e){ts?ns?ns.push(e):ns=[e]:ts=e}function xj(){if(ts){var e=ts,t=ns;if(ns=ts=null,Q0(e),t)for(e=0;e<t.length;e++)Q0(t[e])}}function wj(e,t){return e(t)}function Sj(){}var Zh=!1;function kj(e,t,n){if(Zh)return e(t,n);Zh=!0;try{return wj(e,t,n)}finally{Zh=!1,(ts!==null||ns!==null)&&(Sj(),xj())}}function ic(e,t){var n=e.stateNode;if(n===null)return null;var r=Cp(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(re(231,t,typeof n));return n}var Lg=!1;if(di)try{var pl={};Object.defineProperty(pl,"passive",{get:function(){Lg=!0}}),window.addEventListener("test",pl,pl),window.removeEventListener("test",pl,pl)}catch{Lg=!1}function R2(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 zl=!1,Hd=null,Gd=!1,Dg=null,I2={onError:function(e){zl=!0,Hd=e}};function $2(e,t,n,r,i,a,o,l,c){zl=!1,Hd=null,R2.apply(I2,arguments)}function L2(e,t,n,r,i,a,o,l,c){if($2.apply(this,arguments),zl){if(zl){var u=Hd;zl=!1,Hd=null}else throw Error(re(198));Gd||(Gd=!0,Dg=u)}}function co(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 _j(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 J0(e){if(co(e)!==e)throw Error(re(188))}function D2(e){var t=e.alternate;if(!t){if(t=co(e),t===null)throw Error(re(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 J0(i),e;if(a===r)return J0(i),t;a=a.sibling}throw Error(re(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(re(189))}}if(n.alternate!==r)throw Error(re(190))}if(n.tag!==3)throw Error(re(188));return n.stateNode.current===n?e:t}function Ej(e){return e=D2(e),e!==null?Nj(e):null}function Nj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Nj(e);if(t!==null)return t;e=e.sibling}return null}var jj=Yn.unstable_scheduleCallback,ew=Yn.unstable_cancelCallback,B2=Yn.unstable_shouldYield,z2=Yn.unstable_requestPaint,At=Yn.unstable_now,F2=Yn.unstable_getCurrentPriorityLevel,hb=Yn.unstable_ImmediatePriority,Aj=Yn.unstable_UserBlockingPriority,qd=Yn.unstable_NormalPriority,U2=Yn.unstable_LowPriority,Tj=Yn.unstable_IdlePriority,Np=null,Ur=null;function W2(e){if(Ur&&typeof Ur.onCommitFiberRoot=="function")try{Ur.onCommitFiberRoot(Np,e,void 0,(e.current.flags&128)===128)}catch{}}var Er=Math.clz32?Math.clz32:q2,H2=Math.log,G2=Math.LN2;function q2(e){return e>>>=0,e===0?32:31-(H2(e)/G2|0)|0}var zu=64,Fu=4194304;function $l(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 Kd(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=$l(l):(a&=o,a!==0&&(r=$l(a)))}else o=n&~i,o!==0?r=$l(o):a!==0&&(r=$l(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-Er(t),i=1<<n,r|=e[n],t&=~i;return r}function K2(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 V2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Er(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&r)&&(i[o]=K2(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Bg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Cj(){var e=zu;return zu<<=1,!(zu&4194240)&&(zu=64),e}function Qh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Er(t),e[t]=n}function Y2(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-Er(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function mb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Er(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ze=0;function Oj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Pj,gb,Mj,Rj,Ij,zg=!1,Uu=[],qi=null,Ki=null,Vi=null,ac=new Map,oc=new Map,$i=[],X2="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 tw(e,t){switch(e){case"focusin":case"focusout":qi=null;break;case"dragenter":case"dragleave":Ki=null;break;case"mouseover":case"mouseout":Vi=null;break;case"pointerover":case"pointerout":ac.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oc.delete(t.pointerId)}}function hl(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=uu(t),t!==null&&gb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Z2(e,t,n,r,i){switch(t){case"focusin":return qi=hl(qi,e,t,n,r,i),!0;case"dragenter":return Ki=hl(Ki,e,t,n,r,i),!0;case"mouseover":return Vi=hl(Vi,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return ac.set(a,hl(ac.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,oc.set(a,hl(oc.get(a)||null,e,t,n,r,i)),!0}return!1}function $j(e){var t=Ia(e.target);if(t!==null){var n=co(t);if(n!==null){if(t=n.tag,t===13){if(t=_j(n),t!==null){e.blockedOn=t,Ij(e.priority,function(){Mj(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 Cd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Fg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ig=r,n.target.dispatchEvent(r),Ig=null}else return t=uu(n),t!==null&&gb(t),e.blockedOn=n,!1;t.shift()}return!0}function nw(e,t,n){Cd(e)&&n.delete(t)}function Q2(){zg=!1,qi!==null&&Cd(qi)&&(qi=null),Ki!==null&&Cd(Ki)&&(Ki=null),Vi!==null&&Cd(Vi)&&(Vi=null),ac.forEach(nw),oc.forEach(nw)}function ml(e,t){e.blockedOn===t&&(e.blockedOn=null,zg||(zg=!0,Yn.unstable_scheduleCallback(Yn.unstable_NormalPriority,Q2)))}function sc(e){function t(i){return ml(i,e)}if(0<Uu.length){ml(Uu[0],e);for(var n=1;n<Uu.length;n++){var r=Uu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(qi!==null&&ml(qi,e),Ki!==null&&ml(Ki,e),Vi!==null&&ml(Vi,e),ac.forEach(t),oc.forEach(t),n=0;n<$i.length;n++)r=$i[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<$i.length&&(n=$i[0],n.blockedOn===null);)$j(n),n.blockedOn===null&&$i.shift()}var rs=vi.ReactCurrentBatchConfig,Vd=!0;function J2(e,t,n,r){var i=Ze,a=rs.transition;rs.transition=null;try{Ze=1,yb(e,t,n,r)}finally{Ze=i,rs.transition=a}}function eI(e,t,n,r){var i=Ze,a=rs.transition;rs.transition=null;try{Ze=4,yb(e,t,n,r)}finally{Ze=i,rs.transition=a}}function yb(e,t,n,r){if(Vd){var i=Fg(e,t,n,r);if(i===null)lm(e,t,r,Yd,n),tw(e,r);else if(Z2(i,e,t,n,r))r.stopPropagation();else if(tw(e,r),t&4&&-1<X2.indexOf(e)){for(;i!==null;){var a=uu(i);if(a!==null&&Pj(a),a=Fg(e,t,n,r),a===null&&lm(e,t,r,Yd,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else lm(e,t,r,null,n)}}var Yd=null;function Fg(e,t,n,r){if(Yd=null,e=pb(r),e=Ia(e),e!==null)if(t=co(e),t===null)e=null;else if(n=t.tag,n===13){if(e=_j(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 Yd=e,null}function Lj(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(F2()){case hb:return 1;case Aj:return 4;case qd:case U2:return 16;case Tj:return 536870912;default:return 16}default:return 16}}var Fi=null,vb=null,Od=null;function Dj(){if(Od)return Od;var e,t=vb,n=t.length,r,i="value"in Fi?Fi.value:Fi.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 Od=i.slice(e,1<r?1-r:void 0)}function Pd(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 Wu(){return!0}function rw(){return!1}function Qn(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)?Wu:rw,this.isPropagationStopped=rw,this}return St(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=Wu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Wu)},persist:function(){},isPersistent:Wu}),t}var Us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bb=Qn(Us),cu=St({},Us,{view:0,detail:0}),tI=Qn(cu),Jh,em,gl,jp=St({},cu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xb,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==gl&&(gl&&e.type==="mousemove"?(Jh=e.screenX-gl.screenX,em=e.screenY-gl.screenY):em=Jh=0,gl=e),Jh)},movementY:function(e){return"movementY"in e?e.movementY:em}}),iw=Qn(jp),nI=St({},jp,{dataTransfer:0}),rI=Qn(nI),iI=St({},cu,{relatedTarget:0}),tm=Qn(iI),aI=St({},Us,{animationName:0,elapsedTime:0,pseudoElement:0}),oI=Qn(aI),sI=St({},Us,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lI=Qn(sI),cI=St({},Us,{data:0}),aw=Qn(cI),uI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dI={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"},fI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fI[e])?!!t[e]:!1}function xb(){return pI}var hI=St({},cu,{key:function(e){if(e.key){var t=uI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Pd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xb,charCode:function(e){return e.type==="keypress"?Pd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mI=Qn(hI),gI=St({},jp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ow=Qn(gI),yI=St({},cu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xb}),vI=Qn(yI),bI=St({},Us,{propertyName:0,elapsedTime:0,pseudoElement:0}),xI=Qn(bI),wI=St({},jp,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),SI=Qn(wI),kI=[9,13,27,32],wb=di&&"CompositionEvent"in window,Fl=null;di&&"documentMode"in document&&(Fl=document.documentMode);var _I=di&&"TextEvent"in window&&!Fl,Bj=di&&(!wb||Fl&&8<Fl&&11>=Fl),sw=" ",lw=!1;function zj(e,t){switch(e){case"keyup":return kI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bo=!1;function EI(e,t){switch(e){case"compositionend":return Fj(t);case"keypress":return t.which!==32?null:(lw=!0,sw);case"textInput":return e=t.data,e===sw&&lw?null:e;default:return null}}function NI(e,t){if(Bo)return e==="compositionend"||!wb&&zj(e,t)?(e=Dj(),Od=vb=Fi=null,Bo=!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 Bj&&t.locale!=="ko"?null:t.data;default:return null}}var jI={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 cw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!jI[e.type]:t==="textarea"}function Uj(e,t,n,r){bj(r),t=Xd(t,"onChange"),0<t.length&&(n=new bb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ul=null,lc=null;function AI(e){Jj(e,0)}function Ap(e){var t=Uo(e);if(fj(t))return e}function TI(e,t){if(e==="change")return t}var Wj=!1;if(di){var nm;if(di){var rm="oninput"in document;if(!rm){var uw=document.createElement("div");uw.setAttribute("oninput","return;"),rm=typeof uw.oninput=="function"}nm=rm}else nm=!1;Wj=nm&&(!document.documentMode||9<document.documentMode)}function dw(){Ul&&(Ul.detachEvent("onpropertychange",Hj),lc=Ul=null)}function Hj(e){if(e.propertyName==="value"&&Ap(lc)){var t=[];Uj(t,lc,e,pb(e)),kj(AI,t)}}function CI(e,t,n){e==="focusin"?(dw(),Ul=t,lc=n,Ul.attachEvent("onpropertychange",Hj)):e==="focusout"&&dw()}function OI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ap(lc)}function PI(e,t){if(e==="click")return Ap(t)}function MI(e,t){if(e==="input"||e==="change")return Ap(t)}function RI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Cr=typeof Object.is=="function"?Object.is:RI;function cc(e,t){if(Cr(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(!kg.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function fw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pw(e,t){var n=fw(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=fw(n)}}function Gj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qj(){for(var e=window,t=Wd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wd(e.document)}return t}function Sb(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 II(e){var t=qj(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gj(n.ownerDocument.documentElement,n)){if(r!==null&&Sb(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=pw(n,a);var o=pw(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 $I=di&&"documentMode"in document&&11>=document.documentMode,zo=null,Ug=null,Wl=null,Wg=!1;function hw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wg||zo==null||zo!==Wd(r)||(r=zo,"selectionStart"in r&&Sb(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}),Wl&&cc(Wl,r)||(Wl=r,r=Xd(Ug,"onSelect"),0<r.length&&(t=new bb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=zo)))}function Hu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Fo={animationend:Hu("Animation","AnimationEnd"),animationiteration:Hu("Animation","AnimationIteration"),animationstart:Hu("Animation","AnimationStart"),transitionend:Hu("Transition","TransitionEnd")},im={},Kj={};di&&(Kj=document.createElement("div").style,"AnimationEvent"in window||(delete Fo.animationend.animation,delete Fo.animationiteration.animation,delete Fo.animationstart.animation),"TransitionEvent"in window||delete Fo.transitionend.transition);function Tp(e){if(im[e])return im[e];if(!Fo[e])return e;var t=Fo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Kj)return im[e]=t[n];return e}var Vj=Tp("animationend"),Yj=Tp("animationiteration"),Xj=Tp("animationstart"),Zj=Tp("transitionend"),Qj=new Map,mw="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 oa(e,t){Qj.set(e,t),lo(t,[e])}for(var am=0;am<mw.length;am++){var om=mw[am],LI=om.toLowerCase(),DI=om[0].toUpperCase()+om.slice(1);oa(LI,"on"+DI)}oa(Vj,"onAnimationEnd");oa(Yj,"onAnimationIteration");oa(Xj,"onAnimationStart");oa("dblclick","onDoubleClick");oa("focusin","onFocus");oa("focusout","onBlur");oa(Zj,"onTransitionEnd");us("onMouseEnter",["mouseout","mouseover"]);us("onMouseLeave",["mouseout","mouseover"]);us("onPointerEnter",["pointerout","pointerover"]);us("onPointerLeave",["pointerout","pointerover"]);lo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));lo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));lo("onBeforeInput",["compositionend","keypress","textInput","paste"]);lo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));lo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));lo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ll="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(" "),BI=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ll));function gw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,L2(r,t,void 0,e),e.currentTarget=null}function Jj(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;gw(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;gw(i,l,u),a=c}}}if(Gd)throw e=Dg,Gd=!1,Dg=null,e}function ct(e,t){var n=t[Vg];n===void 0&&(n=t[Vg]=new Set);var r=e+"__bubble";n.has(r)||(eA(t,e,2,!1),n.add(r))}function sm(e,t,n){var r=0;t&&(r|=4),eA(n,e,r,t)}var Gu="_reactListening"+Math.random().toString(36).slice(2);function uc(e){if(!e[Gu]){e[Gu]=!0,sj.forEach(function(n){n!=="selectionchange"&&(BI.has(n)||sm(n,!1,e),sm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gu]||(t[Gu]=!0,sm("selectionchange",!1,t))}}function eA(e,t,n,r){switch(Lj(t)){case 1:var i=J2;break;case 4:i=eI;break;default:i=yb}n=i.bind(null,t,n,e),i=void 0,!Lg||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 lm(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=Ia(l),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue e}l=l.parentNode}}r=r.return}kj(function(){var u=a,d=pb(n),f=[];e:{var p=Qj.get(e);if(p!==void 0){var h=bb,g=e;switch(e){case"keypress":if(Pd(n)===0)break e;case"keydown":case"keyup":h=mI;break;case"focusin":g="focus",h=tm;break;case"focusout":g="blur",h=tm;break;case"beforeblur":case"afterblur":h=tm;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":h=iw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=rI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=vI;break;case Vj:case Yj:case Xj:h=oI;break;case Zj:h=xI;break;case"scroll":h=tI;break;case"wheel":h=SI;break;case"copy":case"cut":case"paste":h=lI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=ow}var m=(t&4)!==0,v=!m&&e==="scroll",y=m?p!==null?p+"Capture":null:p;m=[];for(var b=u,x;b!==null;){x=b;var _=x.stateNode;if(x.tag===5&&_!==null&&(x=_,y!==null&&(_=ic(b,y),_!=null&&m.push(dc(b,_,x)))),v)break;b=b.return}0<m.length&&(p=new h(p,g,null,n,d),f.push({event:p,listeners:m}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Ig&&(g=n.relatedTarget||n.fromElement)&&(Ia(g)||g[fi]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=u,g=g?Ia(g):null,g!==null&&(v=co(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=u),h!==g)){if(m=iw,_="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(m=ow,_="onPointerLeave",y="onPointerEnter",b="pointer"),v=h==null?p:Uo(h),x=g==null?p:Uo(g),p=new m(_,b+"leave",h,n,d),p.target=v,p.relatedTarget=x,_=null,Ia(d)===u&&(m=new m(y,b+"enter",g,n,d),m.target=x,m.relatedTarget=v,_=m),v=_,h&&g)t:{for(m=h,y=g,b=0,x=m;x;x=No(x))b++;for(x=0,_=y;_;_=No(_))x++;for(;0<b-x;)m=No(m),b--;for(;0<x-b;)y=No(y),x--;for(;b--;){if(m===y||y!==null&&m===y.alternate)break t;m=No(m),y=No(y)}m=null}else m=null;h!==null&&yw(f,p,h,m,!1),g!==null&&v!==null&&yw(f,v,g,m,!0)}}e:{if(p=u?Uo(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var S=TI;else if(cw(p))if(Wj)S=MI;else{S=OI;var w=CI}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=PI);if(S&&(S=S(e,u))){Uj(f,S,n,d);break e}w&&w(e,p,u),e==="focusout"&&(w=p._wrapperState)&&w.controlled&&p.type==="number"&&Cg(p,"number",p.value)}switch(w=u?Uo(u):window,e){case"focusin":(cw(w)||w.contentEditable==="true")&&(zo=w,Ug=u,Wl=null);break;case"focusout":Wl=Ug=zo=null;break;case"mousedown":Wg=!0;break;case"contextmenu":case"mouseup":case"dragend":Wg=!1,hw(f,n,d);break;case"selectionchange":if($I)break;case"keydown":case"keyup":hw(f,n,d)}var k;if(wb)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Bo?zj(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(Bj&&n.locale!=="ko"&&(Bo||N!=="onCompositionStart"?N==="onCompositionEnd"&&Bo&&(k=Dj()):(Fi=d,vb="value"in Fi?Fi.value:Fi.textContent,Bo=!0)),w=Xd(u,N),0<w.length&&(N=new aw(N,e,null,n,d),f.push({event:N,listeners:w}),k?N.data=k:(k=Fj(n),k!==null&&(N.data=k)))),(k=_I?EI(e,n):NI(e,n))&&(u=Xd(u,"onBeforeInput"),0<u.length&&(d=new aw("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=k))}Jj(f,t)})}function dc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xd(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=ic(e,n),a!=null&&r.unshift(dc(e,a,i)),a=ic(e,t),a!=null&&r.push(dc(e,a,i))),e=e.return}return r}function No(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yw(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=ic(n,a),c!=null&&o.unshift(dc(n,c,l))):i||(c=ic(n,a),c!=null&&o.push(dc(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var zI=/\r\n?/g,FI=/\u0000|\uFFFD/g;function vw(e){return(typeof e=="string"?e:""+e).replace(zI,`
38
- `).replace(FI,"")}function qu(e,t,n){if(t=vw(t),vw(e)!==t&&n)throw Error(re(425))}function Zd(){}var Hg=null,Gg=null;function qg(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 Kg=typeof setTimeout=="function"?setTimeout:void 0,UI=typeof clearTimeout=="function"?clearTimeout:void 0,bw=typeof Promise=="function"?Promise:void 0,WI=typeof queueMicrotask=="function"?queueMicrotask:typeof bw<"u"?function(e){return bw.resolve(null).then(e).catch(HI)}:Kg;function HI(e){setTimeout(function(){throw e})}function cm(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),sc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);sc(t)}function Yi(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 xw(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 Ws=Math.random().toString(36).slice(2),Dr="__reactFiber$"+Ws,fc="__reactProps$"+Ws,fi="__reactContainer$"+Ws,Vg="__reactEvents$"+Ws,GI="__reactListeners$"+Ws,qI="__reactHandles$"+Ws;function Ia(e){var t=e[Dr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fi]||n[Dr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xw(e);e!==null;){if(n=e[Dr])return n;e=xw(e)}return t}e=n,n=e.parentNode}return null}function uu(e){return e=e[Dr]||e[fi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Uo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(re(33))}function Cp(e){return e[fc]||null}var Yg=[],Wo=-1;function sa(e){return{current:e}}function ft(e){0>Wo||(e.current=Yg[Wo],Yg[Wo]=null,Wo--)}function st(e,t){Wo++,Yg[Wo]=e.current,e.current=t}var ia={},yn=sa(ia),Mn=sa(!1),Za=ia;function ds(e,t){var n=e.type.contextTypes;if(!n)return ia;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 Rn(e){return e=e.childContextTypes,e!=null}function Qd(){ft(Mn),ft(yn)}function ww(e,t,n){if(yn.current!==ia)throw Error(re(168));st(yn,t),st(Mn,n)}function tA(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(re(108,C2(e)||"Unknown",i));return St({},n,r)}function Jd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ia,Za=yn.current,st(yn,e),st(Mn,Mn.current),!0}function Sw(e,t,n){var r=e.stateNode;if(!r)throw Error(re(169));n?(e=tA(e,t,Za),r.__reactInternalMemoizedMergedChildContext=e,ft(Mn),ft(yn),st(yn,e)):ft(Mn),st(Mn,n)}var ti=null,Op=!1,um=!1;function nA(e){ti===null?ti=[e]:ti.push(e)}function KI(e){Op=!0,nA(e)}function la(){if(!um&&ti!==null){um=!0;var e=0,t=Ze;try{var n=ti;for(Ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ti=null,Op=!1}catch(i){throw ti!==null&&(ti=ti.slice(e+1)),jj(hb,la),i}finally{Ze=t,um=!1}}return null}var Ho=[],Go=0,ef=null,tf=0,rr=[],ir=0,Qa=null,ni=1,ri="";function Ea(e,t){Ho[Go++]=tf,Ho[Go++]=ef,ef=e,tf=t}function rA(e,t,n){rr[ir++]=ni,rr[ir++]=ri,rr[ir++]=Qa,Qa=e;var r=ni;e=ri;var i=32-Er(r)-1;r&=~(1<<i),n+=1;var a=32-Er(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ni=1<<32-Er(t)+i|n<<i|r,ri=a+e}else ni=1<<a|n<<i|r,ri=e}function kb(e){e.return!==null&&(Ea(e,1),rA(e,1,0))}function _b(e){for(;e===ef;)ef=Ho[--Go],Ho[Go]=null,tf=Ho[--Go],Ho[Go]=null;for(;e===Qa;)Qa=rr[--ir],rr[ir]=null,ri=rr[--ir],rr[ir]=null,ni=rr[--ir],rr[ir]=null}var Kn=null,qn=null,mt=!1,Sr=null;function iA(e,t){var n=or(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 kw(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,Kn=e,qn=Yi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Kn=e,qn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qa!==null?{id:ni,overflow:ri}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=or(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Kn=e,qn=null,!0):!1;default:return!1}}function Xg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zg(e){if(mt){var t=qn;if(t){var n=t;if(!kw(e,t)){if(Xg(e))throw Error(re(418));t=Yi(n.nextSibling);var r=Kn;t&&kw(e,t)?iA(r,n):(e.flags=e.flags&-4097|2,mt=!1,Kn=e)}}else{if(Xg(e))throw Error(re(418));e.flags=e.flags&-4097|2,mt=!1,Kn=e}}}function _w(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Kn=e}function Ku(e){if(e!==Kn)return!1;if(!mt)return _w(e),mt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qg(e.type,e.memoizedProps)),t&&(t=qn)){if(Xg(e))throw aA(),Error(re(418));for(;t;)iA(e,t),t=Yi(t.nextSibling)}if(_w(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){qn=Yi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}qn=null}}else qn=Kn?Yi(e.stateNode.nextSibling):null;return!0}function aA(){for(var e=qn;e;)e=Yi(e.nextSibling)}function fs(){qn=Kn=null,mt=!1}function Eb(e){Sr===null?Sr=[e]:Sr.push(e)}var VI=vi.ReactCurrentBatchConfig;function yl(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(re(309));var r=n.stateNode}if(!r)throw Error(re(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(re(284));if(!n._owner)throw Error(re(290,e))}return e}function Vu(e,t){throw e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ew(e){var t=e._init;return t(e._payload)}function oA(e){function t(y,b){if(e){var x=y.deletions;x===null?(y.deletions=[b],y.flags|=16):x.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function i(y,b){return y=Ji(y,b),y.index=0,y.sibling=null,y}function a(y,b,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<b?(y.flags|=2,b):x):(y.flags|=2,b)):(y.flags|=1048576,b)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,x,_){return b===null||b.tag!==6?(b=ym(x,y.mode,_),b.return=y,b):(b=i(b,x),b.return=y,b)}function c(y,b,x,_){var S=x.type;return S===Do?d(y,b,x.props.children,_,x.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Mi&&Ew(S)===b.type)?(_=i(b,x.props),_.ref=yl(y,b,x),_.return=y,_):(_=Bd(x.type,x.key,x.props,null,y.mode,_),_.ref=yl(y,b,x),_.return=y,_)}function u(y,b,x,_){return b===null||b.tag!==4||b.stateNode.containerInfo!==x.containerInfo||b.stateNode.implementation!==x.implementation?(b=vm(x,y.mode,_),b.return=y,b):(b=i(b,x.children||[]),b.return=y,b)}function d(y,b,x,_,S){return b===null||b.tag!==7?(b=Ha(x,y.mode,_,S),b.return=y,b):(b=i(b,x),b.return=y,b)}function f(y,b,x){if(typeof b=="string"&&b!==""||typeof b=="number")return b=ym(""+b,y.mode,x),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Lu:return x=Bd(b.type,b.key,b.props,null,y.mode,x),x.ref=yl(y,null,b),x.return=y,x;case Lo:return b=vm(b,y.mode,x),b.return=y,b;case Mi:var _=b._init;return f(y,_(b._payload),x)}if(Il(b)||fl(b))return b=Ha(b,y.mode,x,null),b.return=y,b;Vu(y,b)}return null}function p(y,b,x,_){var S=b!==null?b.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return S!==null?null:l(y,b,""+x,_);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Lu:return x.key===S?c(y,b,x,_):null;case Lo:return x.key===S?u(y,b,x,_):null;case Mi:return S=x._init,p(y,b,S(x._payload),_)}if(Il(x)||fl(x))return S!==null?null:d(y,b,x,_,null);Vu(y,x)}return null}function h(y,b,x,_,S){if(typeof _=="string"&&_!==""||typeof _=="number")return y=y.get(x)||null,l(b,y,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Lu:return y=y.get(_.key===null?x:_.key)||null,c(b,y,_,S);case Lo:return y=y.get(_.key===null?x:_.key)||null,u(b,y,_,S);case Mi:var w=_._init;return h(y,b,x,w(_._payload),S)}if(Il(_)||fl(_))return y=y.get(x)||null,d(b,y,_,S,null);Vu(b,_)}return null}function g(y,b,x,_){for(var S=null,w=null,k=b,N=b=0,j=null;k!==null&&N<x.length;N++){k.index>N?(j=k,k=null):j=k.sibling;var C=p(y,k,x[N],_);if(C===null){k===null&&(k=j);break}e&&k&&C.alternate===null&&t(y,k),b=a(C,b,N),w===null?S=C:w.sibling=C,w=C,k=j}if(N===x.length)return n(y,k),mt&&Ea(y,N),S;if(k===null){for(;N<x.length;N++)k=f(y,x[N],_),k!==null&&(b=a(k,b,N),w===null?S=k:w.sibling=k,w=k);return mt&&Ea(y,N),S}for(k=r(y,k);N<x.length;N++)j=h(k,y,N,x[N],_),j!==null&&(e&&j.alternate!==null&&k.delete(j.key===null?N:j.key),b=a(j,b,N),w===null?S=j:w.sibling=j,w=j);return e&&k.forEach(function(I){return t(y,I)}),mt&&Ea(y,N),S}function m(y,b,x,_){var S=fl(x);if(typeof S!="function")throw Error(re(150));if(x=S.call(x),x==null)throw Error(re(151));for(var w=S=null,k=b,N=b=0,j=null,C=x.next();k!==null&&!C.done;N++,C=x.next()){k.index>N?(j=k,k=null):j=k.sibling;var I=p(y,k,C.value,_);if(I===null){k===null&&(k=j);break}e&&k&&I.alternate===null&&t(y,k),b=a(I,b,N),w===null?S=I:w.sibling=I,w=I,k=j}if(C.done)return n(y,k),mt&&Ea(y,N),S;if(k===null){for(;!C.done;N++,C=x.next())C=f(y,C.value,_),C!==null&&(b=a(C,b,N),w===null?S=C:w.sibling=C,w=C);return mt&&Ea(y,N),S}for(k=r(y,k);!C.done;N++,C=x.next())C=h(k,y,N,C.value,_),C!==null&&(e&&C.alternate!==null&&k.delete(C.key===null?N:C.key),b=a(C,b,N),w===null?S=C:w.sibling=C,w=C);return e&&k.forEach(function(M){return t(y,M)}),mt&&Ea(y,N),S}function v(y,b,x,_){if(typeof x=="object"&&x!==null&&x.type===Do&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Lu:e:{for(var S=x.key,w=b;w!==null;){if(w.key===S){if(S=x.type,S===Do){if(w.tag===7){n(y,w.sibling),b=i(w,x.props.children),b.return=y,y=b;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Mi&&Ew(S)===w.type){n(y,w.sibling),b=i(w,x.props),b.ref=yl(y,w,x),b.return=y,y=b;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===Do?(b=Ha(x.props.children,y.mode,_,x.key),b.return=y,y=b):(_=Bd(x.type,x.key,x.props,null,y.mode,_),_.ref=yl(y,b,x),_.return=y,y=_)}return o(y);case Lo:e:{for(w=x.key;b!==null;){if(b.key===w)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=i(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=vm(x,y.mode,_),b.return=y,y=b}return o(y);case Mi:return w=x._init,v(y,b,w(x._payload),_)}if(Il(x))return g(y,b,x,_);if(fl(x))return m(y,b,x,_);Vu(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=i(b,x),b.return=y,y=b):(n(y,b),b=ym(x,y.mode,_),b.return=y,y=b),o(y)):n(y,b)}return v}var ps=oA(!0),sA=oA(!1),nf=sa(null),rf=null,qo=null,Nb=null;function jb(){Nb=qo=rf=null}function Ab(e){var t=nf.current;ft(nf),e._currentValue=t}function Qg(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 is(e,t){rf=e,Nb=qo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(On=!0),e.firstContext=null)}function ur(e){var t=e._currentValue;if(Nb!==e)if(e={context:e,memoizedValue:t,next:null},qo===null){if(rf===null)throw Error(re(308));qo=e,rf.dependencies={lanes:0,firstContext:e}}else qo=qo.next=e;return t}var $a=null;function Tb(e){$a===null?$a=[e]:$a.push(e)}function lA(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Tb(t)):(n.next=i.next,i.next=n),t.interleaved=n,pi(e,r)}function pi(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 Ri=!1;function Cb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cA(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 si(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ue&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,pi(e,n)}return i=r.interleaved,i===null?(t.next=t,Tb(r)):(t.next=i.next,i.next=t),r.interleaved=t,pi(e,n)}function Md(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,mb(e,n)}}function Nw(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 af(e,t,n,r){var i=e.updateQueue;Ri=!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 p=l.lane,h=l.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,m=l;switch(p=t,h=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(h,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,p=typeof g=="function"?g.call(h,f,p):g,p==null)break e;f=St({},f,p);break e;case 2:Ri=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[l]:p.push(l))}else h={eventTime:h,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=h,c=f):d=d.next=h,o|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,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);eo|=o,e.lanes=o,e.memoizedState=f}}function jw(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(re(191,i));i.call(r)}}}var du={},Wr=sa(du),pc=sa(du),hc=sa(du);function La(e){if(e===du)throw Error(re(174));return e}function Ob(e,t){switch(st(hc,t),st(pc,e),st(Wr,du),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Pg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Pg(t,e)}ft(Wr),st(Wr,t)}function hs(){ft(Wr),ft(pc),ft(hc)}function uA(e){La(hc.current);var t=La(Wr.current),n=Pg(t,e.type);t!==n&&(st(pc,e),st(Wr,n))}function Pb(e){pc.current===e&&(ft(Wr),ft(pc))}var bt=sa(0);function of(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 dm=[];function Mb(){for(var e=0;e<dm.length;e++)dm[e]._workInProgressVersionPrimary=null;dm.length=0}var Rd=vi.ReactCurrentDispatcher,fm=vi.ReactCurrentBatchConfig,Ja=0,xt=null,zt=null,Kt=null,sf=!1,Hl=!1,mc=0,YI=0;function sn(){throw Error(re(321))}function Rb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Ib(e,t,n,r,i,a){if(Ja=a,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Rd.current=e===null||e.memoizedState===null?JI:e$,e=n(r,i),Hl){a=0;do{if(Hl=!1,mc=0,25<=a)throw Error(re(301));a+=1,Kt=zt=null,t.updateQueue=null,Rd.current=t$,e=n(r,i)}while(Hl)}if(Rd.current=lf,t=zt!==null&&zt.next!==null,Ja=0,Kt=zt=xt=null,sf=!1,t)throw Error(re(300));return e}function $b(){var e=mc!==0;return mc=0,e}function $r(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?xt.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function dr(){if(zt===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var t=Kt===null?xt.memoizedState:Kt.next;if(t!==null)Kt=t,zt=e;else{if(e===null)throw Error(re(310));zt=e,e={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},Kt===null?xt.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function gc(e,t){return typeof t=="function"?t(e):t}function pm(e){var t=dr(),n=t.queue;if(n===null)throw Error(re(311));n.lastRenderedReducer=e;var r=zt,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((Ja&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,xt.lanes|=d,eo|=d}u=u.next}while(u!==null&&u!==a);c===null?o=r:c.next=l,Cr(r,t.memoizedState)||(On=!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,xt.lanes|=a,eo|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function hm(e){var t=dr(),n=t.queue;if(n===null)throw Error(re(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);Cr(a,t.memoizedState)||(On=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function dA(){}function fA(e,t){var n=xt,r=dr(),i=t(),a=!Cr(r.memoizedState,i);if(a&&(r.memoizedState=i,On=!0),r=r.queue,Lb(mA.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Kt!==null&&Kt.memoizedState.tag&1){if(n.flags|=2048,yc(9,hA.bind(null,n,r,i,t),void 0,null),Yt===null)throw Error(re(349));Ja&30||pA(n,t,i)}return i}function pA(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hA(e,t,n,r){t.value=n,t.getSnapshot=r,gA(t)&&yA(e)}function mA(e,t,n){return n(function(){gA(t)&&yA(e)})}function gA(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function yA(e){var t=pi(e,1);t!==null&&Nr(t,e,1,-1)}function Aw(e){var t=$r();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gc,lastRenderedState:e},t.queue=e,e=e.dispatch=QI.bind(null,xt,e),[t.memoizedState,e]}function yc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.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 vA(){return dr().memoizedState}function Id(e,t,n,r){var i=$r();xt.flags|=e,i.memoizedState=yc(1|t,n,void 0,r===void 0?null:r)}function Pp(e,t,n,r){var i=dr();r=r===void 0?null:r;var a=void 0;if(zt!==null){var o=zt.memoizedState;if(a=o.destroy,r!==null&&Rb(r,o.deps)){i.memoizedState=yc(t,n,a,r);return}}xt.flags|=e,i.memoizedState=yc(1|t,n,a,r)}function Tw(e,t){return Id(8390656,8,e,t)}function Lb(e,t){return Pp(2048,8,e,t)}function bA(e,t){return Pp(4,2,e,t)}function xA(e,t){return Pp(4,4,e,t)}function wA(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 SA(e,t,n){return n=n!=null?n.concat([e]):null,Pp(4,4,wA.bind(null,t,e),n)}function Db(){}function kA(e,t){var n=dr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Rb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _A(e,t){var n=dr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Rb(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function EA(e,t,n){return Ja&21?(Cr(n,t)||(n=Cj(),xt.lanes|=n,eo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,On=!0),e.memoizedState=n)}function XI(e,t){var n=Ze;Ze=n!==0&&4>n?n:4,e(!0);var r=fm.transition;fm.transition={};try{e(!1),t()}finally{Ze=n,fm.transition=r}}function NA(){return dr().memoizedState}function ZI(e,t,n){var r=Qi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},jA(e))AA(t,n);else if(n=lA(e,t,n,r),n!==null){var i=En();Nr(n,e,r,i),TA(n,t,r)}}function QI(e,t,n){var r=Qi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(jA(e))AA(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,Cr(l,o)){var c=t.interleaved;c===null?(i.next=i,Tb(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=lA(e,t,i,r),n!==null&&(i=En(),Nr(n,e,r,i),TA(n,t,r))}}function jA(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function AA(e,t){Hl=sf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function TA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mb(e,n)}}var lf={readContext:ur,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useInsertionEffect:sn,useLayoutEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useMutableSource:sn,useSyncExternalStore:sn,useId:sn,unstable_isNewReconciler:!1},JI={readContext:ur,useCallback:function(e,t){return $r().memoizedState=[e,t===void 0?null:t],e},useContext:ur,useEffect:Tw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Id(4194308,4,wA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Id(4194308,4,e,t)},useInsertionEffect:function(e,t){return Id(4,2,e,t)},useMemo:function(e,t){var n=$r();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$r();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=ZI.bind(null,xt,e),[r.memoizedState,e]},useRef:function(e){var t=$r();return e={current:e},t.memoizedState=e},useState:Aw,useDebugValue:Db,useDeferredValue:function(e){return $r().memoizedState=e},useTransition:function(){var e=Aw(!1),t=e[0];return e=XI.bind(null,e[1]),$r().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xt,i=$r();if(mt){if(n===void 0)throw Error(re(407));n=n()}else{if(n=t(),Yt===null)throw Error(re(349));Ja&30||pA(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Tw(mA.bind(null,r,a,e),[e]),r.flags|=2048,yc(9,hA.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=$r(),t=Yt.identifierPrefix;if(mt){var n=ri,r=ni;n=(r&~(1<<32-Er(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=mc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=YI++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},e$={readContext:ur,useCallback:kA,useContext:ur,useEffect:Lb,useImperativeHandle:SA,useInsertionEffect:bA,useLayoutEffect:xA,useMemo:_A,useReducer:pm,useRef:vA,useState:function(){return pm(gc)},useDebugValue:Db,useDeferredValue:function(e){var t=dr();return EA(t,zt.memoizedState,e)},useTransition:function(){var e=pm(gc)[0],t=dr().memoizedState;return[e,t]},useMutableSource:dA,useSyncExternalStore:fA,useId:NA,unstable_isNewReconciler:!1},t$={readContext:ur,useCallback:kA,useContext:ur,useEffect:Lb,useImperativeHandle:SA,useInsertionEffect:bA,useLayoutEffect:xA,useMemo:_A,useReducer:hm,useRef:vA,useState:function(){return hm(gc)},useDebugValue:Db,useDeferredValue:function(e){var t=dr();return zt===null?t.memoizedState=e:EA(t,zt.memoizedState,e)},useTransition:function(){var e=hm(gc)[0],t=dr().memoizedState;return[e,t]},useMutableSource:dA,useSyncExternalStore:fA,useId:NA,unstable_isNewReconciler:!1};function br(e,t){if(e&&e.defaultProps){t=St({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Jg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:St({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Mp={isMounted:function(e){return(e=e._reactInternals)?co(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=En(),i=Qi(e),a=si(r,i);a.payload=t,n!=null&&(a.callback=n),t=Xi(e,a,i),t!==null&&(Nr(t,e,i,r),Md(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=En(),i=Qi(e),a=si(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Xi(e,a,i),t!==null&&(Nr(t,e,i,r),Md(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=En(),r=Qi(e),i=si(n,r);i.tag=2,t!=null&&(i.callback=t),t=Xi(e,i,r),t!==null&&(Nr(t,e,r,n),Md(t,e,r))}};function Cw(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?!cc(n,r)||!cc(i,a):!0}function CA(e,t,n){var r=!1,i=ia,a=t.contextType;return typeof a=="object"&&a!==null?a=ur(a):(i=Rn(t)?Za:yn.current,r=t.contextTypes,a=(r=r!=null)?ds(e,i):ia),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Mp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ow(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&&Mp.enqueueReplaceState(t,t.state,null)}function ey(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Cb(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=ur(a):(a=Rn(t)?Za:yn.current,i.context=ds(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Jg(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&&Mp.enqueueReplaceState(i,i.state,null),af(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ms(e,t){try{var n="",r=t;do n+=T2(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 mm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ty(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var n$=typeof WeakMap=="function"?WeakMap:Map;function OA(e,t,n){n=si(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){uf||(uf=!0,dy=r),ty(e,t)},n}function PA(e,t,n){n=si(-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(){ty(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ty(e,t),typeof r!="function"&&(Zi===null?Zi=new Set([this]):Zi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Pw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new n$;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=g$.bind(null,e,t,n),t.then(e,e))}function Mw(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 Rw(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=si(-1,1),t.tag=2,Xi(n,t,1))),n.lanes|=1),e)}var r$=vi.ReactCurrentOwner,On=!1;function Sn(e,t,n,r){t.child=e===null?sA(t,null,n,r):ps(t,e.child,n,r)}function Iw(e,t,n,r,i){n=n.render;var a=t.ref;return is(t,i),r=Ib(e,t,n,r,a,i),n=$b(),e!==null&&!On?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hi(e,t,i)):(mt&&n&&kb(t),t.flags|=1,Sn(e,t,r,i),t.child)}function $w(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!qb(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,MA(e,t,a,r,i)):(e=Bd(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:cc,n(o,r)&&e.ref===t.ref)return hi(e,t,i)}return t.flags|=1,e=Ji(a,r),e.ref=t.ref,e.return=t,t.child=e}function MA(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(cc(a,r)&&e.ref===t.ref)if(On=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(On=!0);else return t.lanes=e.lanes,hi(e,t,i)}return ny(e,t,n,r,i)}function RA(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},st(Vo,Wn),Wn|=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,st(Vo,Wn),Wn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,st(Vo,Wn),Wn|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,st(Vo,Wn),Wn|=r;return Sn(e,t,i,n),t.child}function IA(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ny(e,t,n,r,i){var a=Rn(n)?Za:yn.current;return a=ds(t,a),is(t,i),n=Ib(e,t,n,r,a,i),r=$b(),e!==null&&!On?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hi(e,t,i)):(mt&&r&&kb(t),t.flags|=1,Sn(e,t,n,i),t.child)}function Lw(e,t,n,r,i){if(Rn(n)){var a=!0;Jd(t)}else a=!1;if(is(t,i),t.stateNode===null)$d(e,t),CA(t,n,r),ey(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=ur(u):(u=Rn(n)?Za:yn.current,u=ds(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)&&Ow(t,o,r,u),Ri=!1;var p=t.memoizedState;o.state=p,af(t,r,o,i),c=t.memoizedState,l!==r||p!==c||Mn.current||Ri?(typeof d=="function"&&(Jg(t,n,d,r),c=t.memoizedState),(l=Ri||Cw(t,n,l,r,p,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,cA(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:br(t.type,l),o.props=u,f=t.pendingProps,p=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=ur(c):(c=Rn(n)?Za:yn.current,c=ds(t,c));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||p!==c)&&Ow(t,o,r,c),Ri=!1,p=t.memoizedState,o.state=p,af(t,r,o,i);var g=t.memoizedState;l!==f||p!==g||Mn.current||Ri?(typeof h=="function"&&(Jg(t,n,h,r),g=t.memoizedState),(u=Ri||Cw(t,n,u,r,p,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&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===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&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return ry(e,t,n,r,a,i)}function ry(e,t,n,r,i,a){IA(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Sw(t,n,!1),hi(e,t,a);r=t.stateNode,r$.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ps(t,e.child,null,a),t.child=ps(t,null,l,a)):Sn(e,t,l,a),t.memoizedState=r.state,i&&Sw(t,n,!0),t.child}function $A(e){var t=e.stateNode;t.pendingContext?ww(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ww(e,t.context,!1),Ob(e,t.containerInfo)}function Dw(e,t,n,r,i){return fs(),Eb(i),t.flags|=256,Sn(e,t,n,r),t.child}var iy={dehydrated:null,treeContext:null,retryLane:0};function ay(e){return{baseLanes:e,cachePool:null,transitions:null}}function LA(e,t,n){var r=t.pendingProps,i=bt.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),st(bt,i&1),e===null)return Zg(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=$p(o,r,0,null),e=Ha(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ay(n),t.memoizedState=iy,e):Bb(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return i$(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=Ji(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Ji(l,a):(a=Ha(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?ay(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=iy,r}return a=e.child,e=a.sibling,r=Ji(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 Bb(e,t){return t=$p({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Yu(e,t,n,r){return r!==null&&Eb(r),ps(t,e.child,null,n),e=Bb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function i$(e,t,n,r,i,a,o){if(n)return t.flags&256?(t.flags&=-257,r=mm(Error(re(422))),Yu(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=$p({mode:"visible",children:r.children},i,0,null),a=Ha(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&ps(t,e.child,null,o),t.child.memoizedState=ay(o),t.memoizedState=iy,a);if(!(t.mode&1))return Yu(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(re(419)),r=mm(a,r,void 0),Yu(e,t,o,r)}if(l=(o&e.childLanes)!==0,On||l){if(r=Yt,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,pi(e,i),Nr(r,e,i,-1))}return Gb(),r=mm(Error(re(421))),Yu(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=y$.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,qn=Yi(i.nextSibling),Kn=t,mt=!0,Sr=null,e!==null&&(rr[ir++]=ni,rr[ir++]=ri,rr[ir++]=Qa,ni=e.id,ri=e.overflow,Qa=t),t=Bb(t,r.children),t.flags|=4096,t)}function Bw(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qg(e.return,t,n)}function gm(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 DA(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Sn(e,t,r.children,n),r=bt.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&&Bw(e,n,t);else if(e.tag===19)Bw(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(st(bt,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&&of(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),gm(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&&of(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}gm(t,!0,n,null,a);break;case"together":gm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $d(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function hi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,n=Ji(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ji(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function a$(e,t,n){switch(t.tag){case 3:$A(t),fs();break;case 5:uA(t);break;case 1:Rn(t.type)&&Jd(t);break;case 4:Ob(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;st(nf,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(st(bt,bt.current&1),t.flags|=128,null):n&t.child.childLanes?LA(e,t,n):(st(bt,bt.current&1),e=hi(e,t,n),e!==null?e.sibling:null);st(bt,bt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return DA(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),st(bt,bt.current),r)break;return null;case 22:case 23:return t.lanes=0,RA(e,t,n)}return hi(e,t,n)}var BA,oy,zA,FA;BA=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}};oy=function(){};zA=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,La(Wr.current);var a=null;switch(n){case"input":i=Ag(e,i),r=Ag(e,r),a=[];break;case"select":i=St({},i,{value:void 0}),r=St({},r,{value:void 0}),a=[];break;case"textarea":i=Og(e,i),r=Og(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Zd)}Mg(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"&&(nc.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"&&(nc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ct("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)}};FA=function(e,t,n,r){n!==r&&(t.flags|=4)};function vl(e,t){if(!mt)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 ln(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 o$(e,t,n){var r=t.pendingProps;switch(_b(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(t),null;case 1:return Rn(t.type)&&Qd(),ln(t),null;case 3:return r=t.stateNode,hs(),ft(Mn),ft(yn),Mb(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ku(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Sr!==null&&(hy(Sr),Sr=null))),oy(e,t),ln(t),null;case 5:Pb(t);var i=La(hc.current);if(n=t.type,e!==null&&t.stateNode!=null)zA(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(re(166));return ln(t),null}if(e=La(Wr.current),Ku(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Dr]=t,r[fc]=a,e=(t.mode&1)!==0,n){case"dialog":ct("cancel",r),ct("close",r);break;case"iframe":case"object":case"embed":ct("load",r);break;case"video":case"audio":for(i=0;i<Ll.length;i++)ct(Ll[i],r);break;case"source":ct("error",r);break;case"img":case"image":case"link":ct("error",r),ct("load",r);break;case"details":ct("toggle",r);break;case"input":V0(r,a),ct("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},ct("invalid",r);break;case"textarea":X0(r,a),ct("invalid",r)}Mg(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&&qu(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&qu(r.textContent,l,e),i=["children",""+l]):nc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ct("scroll",r)}switch(n){case"input":Du(r),Y0(r,a,!0);break;case"textarea":Du(r),Z0(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Zd)}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=mj(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[Dr]=t,e[fc]=r,BA(e,t,!1,!1),t.stateNode=e;e:{switch(o=Rg(n,r),n){case"dialog":ct("cancel",e),ct("close",e),i=r;break;case"iframe":case"object":case"embed":ct("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ll.length;i++)ct(Ll[i],e);i=r;break;case"source":ct("error",e),i=r;break;case"img":case"image":case"link":ct("error",e),ct("load",e),i=r;break;case"details":ct("toggle",e),i=r;break;case"input":V0(e,r),i=Ag(e,r),ct("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=St({},r,{value:void 0}),ct("invalid",e);break;case"textarea":X0(e,r),i=Og(e,r),ct("invalid",e);break;default:i=r}Mg(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?vj(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&gj(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&rc(e,c):typeof c=="number"&&rc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(nc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ct("scroll",e):c!=null&&cb(e,a,c,o))}switch(n){case"input":Du(e),Y0(e,r,!1);break;case"textarea":Du(e),Z0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ra(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?es(e,!!r.multiple,a,!1):r.defaultValue!=null&&es(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Zd)}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 ln(t),null;case 6:if(e&&t.stateNode!=null)FA(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(re(166));if(n=La(hc.current),La(Wr.current),Ku(t)){if(r=t.stateNode,n=t.memoizedProps,r[Dr]=t,(a=r.nodeValue!==n)&&(e=Kn,e!==null))switch(e.tag){case 3:qu(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&qu(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Dr]=t,t.stateNode=r}return ln(t),null;case 13:if(ft(bt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(mt&&qn!==null&&t.mode&1&&!(t.flags&128))aA(),fs(),t.flags|=98560,a=!1;else if(a=Ku(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(re(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(re(317));a[Dr]=t}else fs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ln(t),a=!1}else Sr!==null&&(hy(Sr),Sr=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||bt.current&1?Ft===0&&(Ft=3):Gb())),t.updateQueue!==null&&(t.flags|=4),ln(t),null);case 4:return hs(),oy(e,t),e===null&&uc(t.stateNode.containerInfo),ln(t),null;case 10:return Ab(t.type._context),ln(t),null;case 17:return Rn(t.type)&&Qd(),ln(t),null;case 19:if(ft(bt),a=t.memoizedState,a===null)return ln(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)vl(a,!1);else{if(Ft!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=of(e),o!==null){for(t.flags|=128,vl(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 st(bt,bt.current&1|2),t.child}e=e.sibling}a.tail!==null&&At()>gs&&(t.flags|=128,r=!0,vl(a,!1),t.lanes=4194304)}else{if(!r)if(e=of(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),vl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!mt)return ln(t),null}else 2*At()-a.renderingStartTime>gs&&n!==1073741824&&(t.flags|=128,r=!0,vl(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=At(),t.sibling=null,n=bt.current,st(bt,r?n&1|2:n&1),t):(ln(t),null);case 22:case 23:return Hb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Wn&1073741824&&(ln(t),t.subtreeFlags&6&&(t.flags|=8192)):ln(t),null;case 24:return null;case 25:return null}throw Error(re(156,t.tag))}function s$(e,t){switch(_b(t),t.tag){case 1:return Rn(t.type)&&Qd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hs(),ft(Mn),ft(yn),Mb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pb(t),null;case 13:if(ft(bt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(bt),null;case 4:return hs(),null;case 10:return Ab(t.type._context),null;case 22:case 23:return Hb(),null;case 24:return null;default:return null}}var Xu=!1,pn=!1,l$=typeof WeakSet=="function"?WeakSet:Set,pe=null;function Ko(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 sy(e,t,n){try{n()}catch(r){_t(e,t,r)}}var zw=!1;function c$(e,t){if(Hg=Vd,e=qj(),Sb(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,p=null;t:for(;;){for(var h;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),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===i&&(l=o),p===a&&++d===r&&(c=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gg={focusedElem:e,selectionRange:n},Vd=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;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:br(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(re(163))}}catch(_){_t(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return g=zw,zw=!1,g}function Gl(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&&sy(t,n,a)}i=i.next}while(i!==r)}}function Rp(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 ly(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 UA(e){var t=e.alternate;t!==null&&(e.alternate=null,UA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Dr],delete t[fc],delete t[Vg],delete t[GI],delete t[qI])),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 WA(e){return e.tag===5||e.tag===3||e.tag===4}function Fw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||WA(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=Zd));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 uy(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(uy(e,t,n),e=e.sibling;e!==null;)uy(e,t,n),e=e.sibling}var nn=null,xr=!1;function Ti(e,t,n){for(n=n.child;n!==null;)HA(e,t,n),n=n.sibling}function HA(e,t,n){if(Ur&&typeof Ur.onCommitFiberUnmount=="function")try{Ur.onCommitFiberUnmount(Np,n)}catch{}switch(n.tag){case 5:pn||Ko(n,t);case 6:var r=nn,i=xr;nn=null,Ti(e,t,n),nn=r,xr=i,nn!==null&&(xr?(e=nn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):nn.removeChild(n.stateNode));break;case 18:nn!==null&&(xr?(e=nn,n=n.stateNode,e.nodeType===8?cm(e.parentNode,n):e.nodeType===1&&cm(e,n),sc(e)):cm(nn,n.stateNode));break;case 4:r=nn,i=xr,nn=n.stateNode.containerInfo,xr=!0,Ti(e,t,n),nn=r,xr=i;break;case 0:case 11:case 14:case 15:if(!pn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&sy(n,t,o),i=i.next}while(i!==r)}Ti(e,t,n);break;case 1:if(!pn&&(Ko(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)}Ti(e,t,n);break;case 21:Ti(e,t,n);break;case 22:n.mode&1?(pn=(r=pn)||n.memoizedState!==null,Ti(e,t,n),pn=r):Ti(e,t,n);break;default:Ti(e,t,n)}}function Uw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new l$),t.forEach(function(r){var i=v$.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function yr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:nn=l.stateNode,xr=!1;break e;case 3:nn=l.stateNode.containerInfo,xr=!0;break e;case 4:nn=l.stateNode.containerInfo,xr=!0;break e}l=l.return}if(nn===null)throw Error(re(160));HA(a,o,i),nn=null,xr=!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;)GA(t,e),t=t.sibling}function GA(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(yr(t,e),Rr(e),r&4){try{Gl(3,e,e.return),Rp(3,e)}catch(m){_t(e,e.return,m)}try{Gl(5,e,e.return)}catch(m){_t(e,e.return,m)}}break;case 1:yr(t,e),Rr(e),r&512&&n!==null&&Ko(n,n.return);break;case 5:if(yr(t,e),Rr(e),r&512&&n!==null&&Ko(n,n.return),e.flags&32){var i=e.stateNode;try{rc(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&&pj(i,a),Rg(l,o);var u=Rg(l,a);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?vj(i,f):d==="dangerouslySetInnerHTML"?gj(i,f):d==="children"?rc(i,f):cb(i,d,f,u)}switch(l){case"input":Tg(i,a);break;case"textarea":hj(i,a);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var h=a.value;h!=null?es(i,!!a.multiple,h,!1):p!==!!a.multiple&&(a.defaultValue!=null?es(i,!!a.multiple,a.defaultValue,!0):es(i,!!a.multiple,a.multiple?[]:"",!1))}i[fc]=a}catch(m){_t(e,e.return,m)}}break;case 6:if(yr(t,e),Rr(e),r&4){if(e.stateNode===null)throw Error(re(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){_t(e,e.return,m)}}break;case 3:if(yr(t,e),Rr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{sc(t.containerInfo)}catch(m){_t(e,e.return,m)}break;case 4:yr(t,e),Rr(e);break;case 13:yr(t,e),Rr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Ub=At())),r&4&&Uw(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(pn=(u=pn)||d,yr(t,e),pn=u):yr(t,e),Rr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(pe=e,d=e.child;d!==null;){for(f=pe=d;pe!==null;){switch(p=pe,h=p.child,p.tag){case 0:case 11:case 14:case 15:Gl(4,p,p.return);break;case 1:Ko(p,p.return);var g=p.stateNode;if(typeof g.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(m){_t(r,n,m)}}break;case 5:Ko(p,p.return);break;case 22:if(p.memoizedState!==null){Hw(f);continue}}h!==null?(h.return=p,pe=h):Hw(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=yj("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:yr(t,e),Rr(e),r&4&&Uw(e);break;case 21:break;default:yr(t,e),Rr(e)}}function Rr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(WA(n)){var r=n;break e}n=n.return}throw Error(re(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(rc(i,""),r.flags&=-33);var a=Fw(e);uy(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Fw(e);cy(e,l,o);break;default:throw Error(re(161))}}catch(c){_t(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function u$(e,t,n){pe=e,qA(e)}function qA(e,t,n){for(var r=(e.mode&1)!==0;pe!==null;){var i=pe,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Xu;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||pn;l=Xu;var u=pn;if(Xu=o,(pn=c)&&!u)for(pe=i;pe!==null;)o=pe,c=o.child,o.tag===22&&o.memoizedState!==null?Gw(i):c!==null?(c.return=o,pe=c):Gw(i);for(;a!==null;)pe=a,qA(a),a=a.sibling;pe=i,Xu=l,pn=u}Ww(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,pe=a):Ww(e)}}function Ww(e){for(;pe!==null;){var t=pe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pn||Rp(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!pn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:br(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&jw(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}jw(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&&sc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(re(163))}pn||t.flags&512&&ly(t)}catch(p){_t(t,t.return,p)}}if(t===e){pe=null;break}if(n=t.sibling,n!==null){n.return=t.return,pe=n;break}pe=t.return}}function Hw(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,pe=n;break}pe=t.return}}function Gw(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Rp(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{ly(t)}catch(c){_t(t,a,c)}break;case 5:var o=t.return;try{ly(t)}catch(c){_t(t,o,c)}}}catch(c){_t(t,t.return,c)}if(t===e){pe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,pe=l;break}pe=t.return}}var d$=Math.ceil,cf=vi.ReactCurrentDispatcher,zb=vi.ReactCurrentOwner,lr=vi.ReactCurrentBatchConfig,Ue=0,Yt=null,Mt=null,an=0,Wn=0,Vo=sa(0),Ft=0,vc=null,eo=0,Ip=0,Fb=0,ql=null,Cn=null,Ub=0,gs=1/0,ei=null,uf=!1,dy=null,Zi=null,Zu=!1,Ui=null,df=0,Kl=0,fy=null,Ld=-1,Dd=0;function En(){return Ue&6?At():Ld!==-1?Ld:Ld=At()}function Qi(e){return e.mode&1?Ue&2&&an!==0?an&-an:VI.transition!==null?(Dd===0&&(Dd=Cj()),Dd):(e=Ze,e!==0||(e=window.event,e=e===void 0?16:Lj(e.type)),e):1}function Nr(e,t,n,r){if(50<Kl)throw Kl=0,fy=null,Error(re(185));lu(e,n,r),(!(Ue&2)||e!==Yt)&&(e===Yt&&(!(Ue&2)&&(Ip|=n),Ft===4&&Li(e,an)),In(e,r),n===1&&Ue===0&&!(t.mode&1)&&(gs=At()+500,Op&&la()))}function In(e,t){var n=e.callbackNode;V2(e,t);var r=Kd(e,e===Yt?an:0);if(r===0)n!==null&&ew(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ew(n),t===1)e.tag===0?KI(qw.bind(null,e)):nA(qw.bind(null,e)),WI(function(){!(Ue&6)&&la()}),n=null;else{switch(Oj(r)){case 1:n=hb;break;case 4:n=Aj;break;case 16:n=qd;break;case 536870912:n=Tj;break;default:n=qd}n=eT(n,KA.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function KA(e,t){if(Ld=-1,Dd=0,Ue&6)throw Error(re(327));var n=e.callbackNode;if(as()&&e.callbackNode!==n)return null;var r=Kd(e,e===Yt?an:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ff(e,r);else{t=r;var i=Ue;Ue|=2;var a=YA();(Yt!==e||an!==t)&&(ei=null,gs=At()+500,Wa(e,t));do try{h$();break}catch(l){VA(e,l)}while(!0);jb(),cf.current=a,Ue=i,Mt!==null?t=0:(Yt=null,an=0,t=Ft)}if(t!==0){if(t===2&&(i=Bg(e),i!==0&&(r=i,t=py(e,i))),t===1)throw n=vc,Wa(e,0),Li(e,r),In(e,At()),n;if(t===6)Li(e,r);else{if(i=e.current.alternate,!(r&30)&&!f$(i)&&(t=ff(e,r),t===2&&(a=Bg(e),a!==0&&(r=a,t=py(e,a))),t===1))throw n=vc,Wa(e,0),Li(e,r),In(e,At()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(re(345));case 2:Na(e,Cn,ei);break;case 3:if(Li(e,r),(r&130023424)===r&&(t=Ub+500-At(),10<t)){if(Kd(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){En(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Kg(Na.bind(null,e,Cn,ei),t);break}Na(e,Cn,ei);break;case 4:if(Li(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Er(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=At()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*d$(r/1960))-r,10<r){e.timeoutHandle=Kg(Na.bind(null,e,Cn,ei),r);break}Na(e,Cn,ei);break;case 5:Na(e,Cn,ei);break;default:throw Error(re(329))}}}return In(e,At()),e.callbackNode===n?KA.bind(null,e):null}function py(e,t){var n=ql;return e.current.memoizedState.isDehydrated&&(Wa(e,t).flags|=256),e=ff(e,t),e!==2&&(t=Cn,Cn=n,t!==null&&hy(t)),e}function hy(e){Cn===null?Cn=e:Cn.push.apply(Cn,e)}function f$(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(!Cr(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 Li(e,t){for(t&=~Fb,t&=~Ip,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Er(t),r=1<<n;e[n]=-1,t&=~r}}function qw(e){if(Ue&6)throw Error(re(327));as();var t=Kd(e,0);if(!(t&1))return In(e,At()),null;var n=ff(e,t);if(e.tag!==0&&n===2){var r=Bg(e);r!==0&&(t=r,n=py(e,r))}if(n===1)throw n=vc,Wa(e,0),Li(e,t),In(e,At()),n;if(n===6)throw Error(re(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Na(e,Cn,ei),In(e,At()),null}function Wb(e,t){var n=Ue;Ue|=1;try{return e(t)}finally{Ue=n,Ue===0&&(gs=At()+500,Op&&la())}}function to(e){Ui!==null&&Ui.tag===0&&!(Ue&6)&&as();var t=Ue;Ue|=1;var n=lr.transition,r=Ze;try{if(lr.transition=null,Ze=1,e)return e()}finally{Ze=r,lr.transition=n,Ue=t,!(Ue&6)&&la()}}function Hb(){Wn=Vo.current,ft(Vo)}function Wa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,UI(n)),Mt!==null)for(n=Mt.return;n!==null;){var r=n;switch(_b(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Qd();break;case 3:hs(),ft(Mn),ft(yn),Mb();break;case 5:Pb(r);break;case 4:hs();break;case 13:ft(bt);break;case 19:ft(bt);break;case 10:Ab(r.type._context);break;case 22:case 23:Hb()}n=n.return}if(Yt=e,Mt=e=Ji(e.current,null),an=Wn=t,Ft=0,vc=null,Fb=Ip=eo=0,Cn=ql=null,$a!==null){for(t=0;t<$a.length;t++)if(n=$a[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}$a=null}return e}function VA(e,t){do{var n=Mt;try{if(jb(),Rd.current=lf,sf){for(var r=xt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}sf=!1}if(Ja=0,Kt=zt=xt=null,Hl=!1,mc=0,zb.current=null,n===null||n.return===null){Ft=1,vc=t,Mt=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=an,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=Mw(o);if(h!==null){h.flags&=-257,Rw(h,o,l,a,t),h.mode&1&&Pw(a,u,t),t=h,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)){Pw(a,u,t),Gb();break e}c=Error(re(426))}}else if(mt&&l.mode&1){var v=Mw(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),Rw(v,o,l,a,t),Eb(ms(c,l));break e}}a=c=ms(c,l),Ft!==4&&(Ft=2),ql===null?ql=[a]:ql.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=OA(a,c,t);Nw(a,y);break e;case 1:l=c;var b=a.type,x=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Zi===null||!Zi.has(x)))){a.flags|=65536,t&=-t,a.lanes|=t;var _=PA(a,l,t);Nw(a,_);break e}}a=a.return}while(a!==null)}ZA(n)}catch(S){t=S,Mt===n&&n!==null&&(Mt=n=n.return);continue}break}while(!0)}function YA(){var e=cf.current;return cf.current=lf,e===null?lf:e}function Gb(){(Ft===0||Ft===3||Ft===2)&&(Ft=4),Yt===null||!(eo&268435455)&&!(Ip&268435455)||Li(Yt,an)}function ff(e,t){var n=Ue;Ue|=2;var r=YA();(Yt!==e||an!==t)&&(ei=null,Wa(e,t));do try{p$();break}catch(i){VA(e,i)}while(!0);if(jb(),Ue=n,cf.current=r,Mt!==null)throw Error(re(261));return Yt=null,an=0,Ft}function p$(){for(;Mt!==null;)XA(Mt)}function h$(){for(;Mt!==null&&!B2();)XA(Mt)}function XA(e){var t=JA(e.alternate,e,Wn);e.memoizedProps=e.pendingProps,t===null?ZA(e):Mt=t,zb.current=null}function ZA(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=s$(n,t),n!==null){n.flags&=32767,Mt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ft=6,Mt=null;return}}else if(n=o$(n,t,Wn),n!==null){Mt=n;return}if(t=t.sibling,t!==null){Mt=t;return}Mt=t=e}while(t!==null);Ft===0&&(Ft=5)}function Na(e,t,n){var r=Ze,i=lr.transition;try{lr.transition=null,Ze=1,m$(e,t,n,r)}finally{lr.transition=i,Ze=r}return null}function m$(e,t,n,r){do as();while(Ui!==null);if(Ue&6)throw Error(re(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(re(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(Y2(e,a),e===Yt&&(Mt=Yt=null,an=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Zu||(Zu=!0,eT(qd,function(){return as(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=lr.transition,lr.transition=null;var o=Ze;Ze=1;var l=Ue;Ue|=4,zb.current=null,c$(e,n),GA(n,e),II(Gg),Vd=!!Hg,Gg=Hg=null,e.current=n,u$(n),z2(),Ue=l,Ze=o,lr.transition=a}else e.current=n;if(Zu&&(Zu=!1,Ui=e,df=i),a=e.pendingLanes,a===0&&(Zi=null),W2(n.stateNode),In(e,At()),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(uf)throw uf=!1,e=dy,dy=null,e;return df&1&&e.tag!==0&&as(),a=e.pendingLanes,a&1?e===fy?Kl++:(Kl=0,fy=e):Kl=0,la(),null}function as(){if(Ui!==null){var e=Oj(df),t=lr.transition,n=Ze;try{if(lr.transition=null,Ze=16>e?16:e,Ui===null)var r=!1;else{if(e=Ui,Ui=null,df=0,Ue&6)throw Error(re(331));var i=Ue;for(Ue|=4,pe=e.current;pe!==null;){var a=pe,o=a.child;if(pe.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(pe=u;pe!==null;){var d=pe;switch(d.tag){case 0:case 11:case 15:Gl(8,d,a)}var f=d.child;if(f!==null)f.return=d,pe=f;else for(;pe!==null;){d=pe;var p=d.sibling,h=d.return;if(UA(d),d===u){pe=null;break}if(p!==null){p.return=h,pe=p;break}pe=h}}}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)}}pe=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,pe=o;else e:for(;pe!==null;){if(a=pe,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Gl(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,pe=y;break e}pe=a.return}}var b=e.current;for(pe=b;pe!==null;){o=pe;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,pe=x;else e:for(o=b;pe!==null;){if(l=pe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Rp(9,l)}}catch(S){_t(l,l.return,S)}if(l===o){pe=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,pe=_;break e}pe=l.return}}if(Ue=i,la(),Ur&&typeof Ur.onPostCommitFiberRoot=="function")try{Ur.onPostCommitFiberRoot(Np,e)}catch{}r=!0}return r}finally{Ze=n,lr.transition=t}}return!1}function Kw(e,t,n){t=ms(n,t),t=OA(e,t,1),e=Xi(e,t,1),t=En(),e!==null&&(lu(e,1,t),In(e,t))}function _t(e,t,n){if(e.tag===3)Kw(e,e,n);else for(;t!==null;){if(t.tag===3){Kw(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Zi===null||!Zi.has(r))){e=ms(n,e),e=PA(t,e,1),t=Xi(t,e,1),e=En(),t!==null&&(lu(t,1,e),In(t,e));break}}t=t.return}}function g$(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=En(),e.pingedLanes|=e.suspendedLanes&n,Yt===e&&(an&n)===n&&(Ft===4||Ft===3&&(an&130023424)===an&&500>At()-Ub?Wa(e,0):Fb|=n),In(e,t)}function QA(e,t){t===0&&(e.mode&1?(t=Fu,Fu<<=1,!(Fu&130023424)&&(Fu=4194304)):t=1);var n=En();e=pi(e,t),e!==null&&(lu(e,t,n),In(e,n))}function y$(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),QA(e,n)}function v$(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(re(314))}r!==null&&r.delete(t),QA(e,n)}var JA;JA=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Mn.current)On=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return On=!1,a$(e,t,n);On=!!(e.flags&131072)}else On=!1,mt&&t.flags&1048576&&rA(t,tf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;$d(e,t),e=t.pendingProps;var i=ds(t,yn.current);is(t,n),i=Ib(null,t,r,e,i,n);var a=$b();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,Rn(r)?(a=!0,Jd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Cb(t),i.updater=Mp,t.stateNode=i,i._reactInternals=t,ey(t,r,e,n),t=ry(null,t,r,!0,a,n)):(t.tag=0,mt&&a&&kb(t),Sn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch($d(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=x$(r),e=br(r,e),i){case 0:t=ny(null,t,r,e,n);break e;case 1:t=Lw(null,t,r,e,n);break e;case 11:t=Iw(null,t,r,e,n);break e;case 14:t=$w(null,t,r,br(r.type,e),n);break e}throw Error(re(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:br(r,i),ny(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:br(r,i),Lw(e,t,r,i,n);case 3:e:{if($A(t),e===null)throw Error(re(387));r=t.pendingProps,a=t.memoizedState,i=a.element,cA(e,t),af(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=ms(Error(re(423)),t),t=Dw(e,t,r,n,i);break e}else if(r!==i){i=ms(Error(re(424)),t),t=Dw(e,t,r,n,i);break e}else for(qn=Yi(t.stateNode.containerInfo.firstChild),Kn=t,mt=!0,Sr=null,n=sA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fs(),r===i){t=hi(e,t,n);break e}Sn(e,t,r,n)}t=t.child}return t;case 5:return uA(t),e===null&&Zg(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,qg(r,i)?o=null:a!==null&&qg(r,a)&&(t.flags|=32),IA(e,t),Sn(e,t,o,n),t.child;case 6:return e===null&&Zg(t),null;case 13:return LA(e,t,n);case 4:return Ob(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ps(t,null,r,n):Sn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:br(r,i),Iw(e,t,r,i,n);case 7:return Sn(e,t,t.pendingProps,n),t.child;case 8:return Sn(e,t,t.pendingProps.children,n),t.child;case 12:return Sn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,st(nf,r._currentValue),r._currentValue=o,a!==null)if(Cr(a.value,o)){if(a.children===i.children&&!Mn.current){t=hi(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=si(-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),Qg(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(re(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Qg(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Sn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,is(t,n),i=ur(i),r=r(i),t.flags|=1,Sn(e,t,r,n),t.child;case 14:return r=t.type,i=br(r,t.pendingProps),i=br(r.type,i),$w(e,t,r,i,n);case 15:return MA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:br(r,i),$d(e,t),t.tag=1,Rn(r)?(e=!0,Jd(t)):e=!1,is(t,n),CA(t,r,i),ey(t,r,i,n),ry(null,t,r,!0,e,n);case 19:return DA(e,t,n);case 22:return RA(e,t,n)}throw Error(re(156,t.tag))};function eT(e,t){return jj(e,t)}function b$(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 or(e,t,n,r){return new b$(e,t,n,r)}function qb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function x$(e){if(typeof e=="function")return qb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===db)return 11;if(e===fb)return 14}return 2}function Ji(e,t){var n=e.alternate;return n===null?(n=or(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 Bd(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")qb(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Do:return Ha(n.children,i,a,t);case ub:o=8,i|=8;break;case _g:return e=or(12,n,t,i|2),e.elementType=_g,e.lanes=a,e;case Eg:return e=or(13,n,t,i),e.elementType=Eg,e.lanes=a,e;case Ng:return e=or(19,n,t,i),e.elementType=Ng,e.lanes=a,e;case uj:return $p(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case lj:o=10;break e;case cj:o=9;break e;case db:o=11;break e;case fb:o=14;break e;case Mi:o=16,r=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=or(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Ha(e,t,n,r){return e=or(7,e,r,t),e.lanes=n,e}function $p(e,t,n,r){return e=or(22,e,r,t),e.elementType=uj,e.lanes=n,e.stateNode={isHidden:!1},e}function ym(e,t,n){return e=or(6,e,null,t),e.lanes=n,e}function vm(e,t,n){return t=or(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function w$(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=Qh(0),this.expirationTimes=Qh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Kb(e,t,n,r,i,a,o,l,c){return e=new w$(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=or(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cb(a),e}function S$(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Lo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function tT(e){if(!e)return ia;e=e._reactInternals;e:{if(co(e)!==e||e.tag!==1)throw Error(re(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Rn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(re(171))}if(e.tag===1){var n=e.type;if(Rn(n))return tA(e,n,t)}return t}function nT(e,t,n,r,i,a,o,l,c){return e=Kb(n,r,!0,e,i,a,o,l,c),e.context=tT(null),n=e.current,r=En(),i=Qi(n),a=si(r,i),a.callback=t??null,Xi(n,a,i),e.current.lanes=i,lu(e,i,r),In(e,r),e}function Lp(e,t,n,r){var i=t.current,a=En(),o=Qi(i);return n=tT(n),t.context===null?t.context=n:t.pendingContext=n,t=si(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Xi(i,t,o),e!==null&&(Nr(e,i,o,a),Md(e,i,o)),o}function pf(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 Vw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Vb(e,t){Vw(e,t),(e=e.alternate)&&Vw(e,t)}function k$(){return null}var rT=typeof reportError=="function"?reportError:function(e){console.error(e)};function Yb(e){this._internalRoot=e}Dp.prototype.render=Yb.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));Lp(e,t,null,null)};Dp.prototype.unmount=Yb.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;to(function(){Lp(null,e,null,null)}),t[fi]=null}};function Dp(e){this._internalRoot=e}Dp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$i.length&&t!==0&&t<$i[n].priority;n++);$i.splice(n,0,e),n===0&&$j(e)}};function Xb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Yw(){}function _$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=pf(o);a.call(u)}}var o=nT(t,r,e,0,null,!1,!1,"",Yw);return e._reactRootContainer=o,e[fi]=o.current,uc(e.nodeType===8?e.parentNode:e),to(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=pf(c);l.call(u)}}var c=Kb(e,0,!1,null,null,!1,!1,"",Yw);return e._reactRootContainer=c,e[fi]=c.current,uc(e.nodeType===8?e.parentNode:e),to(function(){Lp(t,c,n,r)}),c}function zp(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=pf(o);l.call(c)}}Lp(t,o,e,i)}else o=_$(n,t,e,i,r);return pf(o)}Pj=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$l(t.pendingLanes);n!==0&&(mb(t,n|1),In(t,At()),!(Ue&6)&&(gs=At()+500,la()))}break;case 13:to(function(){var r=pi(e,1);if(r!==null){var i=En();Nr(r,e,1,i)}}),Vb(e,1)}};gb=function(e){if(e.tag===13){var t=pi(e,134217728);if(t!==null){var n=En();Nr(t,e,134217728,n)}Vb(e,134217728)}};Mj=function(e){if(e.tag===13){var t=Qi(e),n=pi(e,t);if(n!==null){var r=En();Nr(n,e,t,r)}Vb(e,t)}};Rj=function(){return Ze};Ij=function(e,t){var n=Ze;try{return Ze=e,t()}finally{Ze=n}};$g=function(e,t,n){switch(t){case"input":if(Tg(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=Cp(r);if(!i)throw Error(re(90));fj(r),Tg(r,i)}}}break;case"textarea":hj(e,n);break;case"select":t=n.value,t!=null&&es(e,!!n.multiple,t,!1)}};wj=Wb;Sj=to;var E$={usingClientEntryPoint:!1,Events:[uu,Uo,Cp,bj,xj,Wb]},bl={findFiberByHostInstance:Ia,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},N$={bundleType:bl.bundleType,version:bl.version,rendererPackageName:bl.rendererPackageName,rendererConfig:bl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ej(e),e===null?null:e.stateNode},findFiberByHostInstance:bl.findFiberByHostInstance||k$,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 Qu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qu.isDisabled&&Qu.supportsFiber)try{Np=Qu.inject(N$),Ur=Qu}catch{}}Zn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=E$;Zn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xb(t))throw Error(re(200));return S$(e,t,null,n)};Zn.createRoot=function(e,t){if(!Xb(e))throw Error(re(299));var n=!1,r="",i=rT;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Kb(e,1,!1,null,null,n,!1,r,i),e[fi]=t.current,uc(e.nodeType===8?e.parentNode:e),new Yb(t)};Zn.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(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=Ej(t),e=e===null?null:e.stateNode,e};Zn.flushSync=function(e){return to(e)};Zn.hydrate=function(e,t,n){if(!Bp(t))throw Error(re(200));return zp(null,e,t,!0,n)};Zn.hydrateRoot=function(e,t,n){if(!Xb(e))throw Error(re(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=rT;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=nT(t,null,e,1,n??null,i,!1,a,o),e[fi]=t.current,uc(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 Dp(t)};Zn.render=function(e,t,n){if(!Bp(t))throw Error(re(200));return zp(null,e,t,!1,n)};Zn.unmountComponentAtNode=function(e){if(!Bp(e))throw Error(re(40));return e._reactRootContainer?(to(function(){zp(null,null,e,!1,function(){e._reactRootContainer=null,e[fi]=null})}),!0):!1};Zn.unstable_batchedUpdates=Wb;Zn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Bp(n))throw Error(re(200));if(e==null||e._reactInternals===void 0)throw Error(re(38));return zp(e,t,n,!1,r)};Zn.version="18.3.1-next-f1338f8080-20240426";function iT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iT)}catch(e){console.error(e)}}iT(),ij.exports=Zn;var j$=ij.exports,aT,Xw=j$;aT=Xw.createRoot,Xw.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 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)}var Wi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Wi||(Wi={}));const Zw="popstate";function A$(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:o,hash:l}=r.location;return my("",{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:hf(i)}return C$(t,n,null,e)}function wt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zb(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function T$(){return Math.random().toString(36).substr(2,8)}function Qw(e,t){return{usr:e.state,key:e.key,idx:t}}function my(e,t,n,r){return n===void 0&&(n=null),bc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Hs(t):t,{state:n,key:t&&t.key||r||T$()})}function hf(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 Hs(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 C$(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=Wi.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(bc({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Wi.Pop;let v=d(),y=v==null?null:v-u;u=v,c&&c({action:l,location:m.location,delta:y})}function p(v,y){l=Wi.Push;let b=my(m.location,v,y);u=d()+1;let x=Qw(b,u),_=m.createHref(b);try{o.pushState(x,"",_)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(_)}a&&c&&c({action:l,location:m.location,delta:1})}function h(v,y){l=Wi.Replace;let b=my(m.location,v,y);u=d();let x=Qw(b,u),_=m.createHref(b);o.replaceState(x,"",_),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:hf(v);return b=b.replace(/ $/,"%20"),wt(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(Zw,f),c=v,()=>{i.removeEventListener(Zw,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:p,replace:h,go(v){return o.go(v)}};return m}var Jw;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Jw||(Jw={}));function O$(e,t,n){return n===void 0&&(n="/"),P$(e,t,n)}function P$(e,t,n,r){let i=typeof t=="string"?Hs(t):t,a=ys(i.pathname||"/",n);if(a==null)return null;let o=oT(e);M$(o);let l=null,c=H$(a);for(let u=0;l==null&&u<o.length;++u)l=U$(o[u],c);return l}function oT(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("/")&&(wt(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=ea([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(wt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),oT(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:z$(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 sT(a.path))i(a,o,c)}),t}function sT(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=sT(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 M$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:F$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const R$=/^:[\w-]+$/,I$=3,$$=2,L$=1,D$=10,B$=-2,e1=e=>e==="*";function z$(e,t){let n=e.split("/"),r=n.length;return n.some(e1)&&(r+=B$),t&&(r+=$$),n.filter(i=>!e1(i)).reduce((i,a)=>i+(R$.test(a)?I$:a===""?L$:D$),r)}function F$(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 U$(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=gy({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),p=c.route;if(!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:ea([a,f.pathname]),pathnameBase:Y$(ea([a,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(a=ea([a,f.pathnameBase]))}return o}function gy(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=W$(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:p,isOptional:h}=d;if(p==="*"){let m=l[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=l[f];return h&&!g?u[p]=void 0:u[p]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function W$(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Zb(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 H$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zb(!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 ys(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 G$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,q$=e=>G$.test(e);function K$(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Hs(e):e,a;if(n)if(q$(n))a=n;else{if(n.includes("//")){let o=n;n=lT(n),Zb(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=t1(n.substring(1),"/"):a=t1(n,t)}else a=t;return{pathname:a,search:X$(r),hash:Z$(i)}}function t1(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 bm(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 V$(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Qb(e,t){let n=V$(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Jb(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Hs(e):(i=bc({},e),wt(!i.pathname||!i.pathname.includes("?"),bm("?","pathname","search",i)),wt(!i.pathname||!i.pathname.includes("#"),bm("#","pathname","hash",i)),wt(!i.search||!i.search.includes("#"),bm("#","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 p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}l=f>=0?t[f]:"/"}let c=K$(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const lT=e=>e.replace(/\/\/+/g,"/"),ea=e=>lT(e.join("/")),Y$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),X$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Z$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Q$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const cT=["post","put","patch","delete"];new Set(cT);const J$=["get",...cT];new Set(J$);/**
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 xc(){return xc=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},xc.apply(null,arguments)}const Fp=E.createContext(null),uT=E.createContext(null),bi=E.createContext(null),Up=E.createContext(null),ca=E.createContext({outlet:null,matches:[],isDataRoute:!1}),dT=E.createContext(null);function eL(e,t){let{relative:n}=t===void 0?{}:t;Gs()||wt(!1);let{basename:r,navigator:i}=E.useContext(bi),{hash:a,pathname:o,search:l}=Wp(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:ea([r,o])),i.createHref({pathname:c,search:l,hash:a})}function Gs(){return E.useContext(Up)!=null}function qs(){return Gs()||wt(!1),E.useContext(Up).location}function fT(e){E.useContext(bi).static||E.useLayoutEffect(e)}function pT(){let{isDataRoute:e}=E.useContext(ca);return e?pL():tL()}function tL(){Gs()||wt(!1);let e=E.useContext(Fp),{basename:t,future:n,navigator:r}=E.useContext(bi),{matches:i}=E.useContext(ca),{pathname:a}=qs(),o=JSON.stringify(Qb(i,n.v7_relativeSplatPath)),l=E.useRef(!1);return fT(()=>{l.current=!0}),E.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=Jb(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ea([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}function Wp(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=E.useContext(bi),{matches:i}=E.useContext(ca),{pathname:a}=qs(),o=JSON.stringify(Qb(i,r.v7_relativeSplatPath));return E.useMemo(()=>Jb(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function nL(e,t){return rL(e,t)}function rL(e,t,n,r){Gs()||wt(!1);let{navigator:i}=E.useContext(bi),{matches:a}=E.useContext(ca),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=qs(),d;if(t){var f;let v=typeof t=="string"?Hs(t):t;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||wt(!1),d=v}else d=u;let p=d.pathname||"/",h=p;if(c!=="/"){let v=c.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=O$(e,{pathname:h}),m=lL(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:ea([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:ea([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,r);return t&&m?E.createElement(Up.Provider,{value:{location:xc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Wi.Pop}},m):m}function iL(){let e=fL(),t=Q$(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},t),n?E.createElement("pre",{style:i},n):null,null)}const aL=E.createElement(iL,null);class oL extends E.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?E.createElement(ca.Provider,{value:this.props.routeContext},E.createElement(dT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function sL(e){let{routeContext:t,match:n,children:r}=e,i=E.useContext(Fp);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(ca.Provider,{value:t},r)}function lL(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||wt(!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:p,errors:h}=n,g=f.route.loader&&p[f.route.id]===void 0&&(!h||h[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,p)=>{let h,g=!1,m=null,v=null;n&&(h=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||aL,c&&(u<0&&p===0?(hL("route-fallback"),g=!0,v=null):u===p&&(g=!0,v=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,p+1)),b=()=>{let x;return h?x=m:g?x=v:f.route.Component?x=E.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,E.createElement(sL,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?E.createElement(oL,{location:n.location,revalidation:n.revalidation,component:m,error:h,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var hT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(hT||{}),mT=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}(mT||{});function cL(e){let t=E.useContext(Fp);return t||wt(!1),t}function uL(e){let t=E.useContext(uT);return t||wt(!1),t}function dL(e){let t=E.useContext(ca);return t||wt(!1),t}function gT(e){let t=dL(),n=t.matches[t.matches.length-1];return n.route.id||wt(!1),n.route.id}function fL(){var e;let t=E.useContext(dT),n=uL(),r=gT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function pL(){let{router:e}=cL(hT.UseNavigateStable),t=gT(mT.UseNavigateStable),n=E.useRef(!1);return fT(()=>{n.current=!0}),E.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,xc({fromRouteId:t},a)))},[e,t])}const n1={};function hL(e,t,n){n1[e]||(n1[e]=!0)}function mL(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function r1(e){let{to:t,replace:n,state:r,relative:i}=e;Gs()||wt(!1);let{future:a,static:o}=E.useContext(bi),{matches:l}=E.useContext(ca),{pathname:c}=qs(),u=pT(),d=Jb(t,Qb(l,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return E.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function vt(e){wt(!1)}function gL(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Wi.Pop,navigator:a,static:o=!1,future:l}=e;Gs()&&wt(!1);let c=t.replace(/^\/*/,"/"),u=E.useMemo(()=>({basename:c,navigator:a,static:o,future:xc({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=Hs(r));let{pathname:d="/",search:f="",hash:p="",state:h=null,key:g="default"}=r,m=E.useMemo(()=>{let v=ys(d,c);return v==null?null:{location:{pathname:v,search:f,hash:p,state:h,key:g},navigationType:i}},[c,d,f,p,h,g,i]);return m==null?null:E.createElement(bi.Provider,{value:u},E.createElement(Up.Provider,{children:n,value:m}))}function yL(e){let{children:t,location:n}=e;return nL(yy(t),n)}new Promise(()=>{});function yy(e,t){t===void 0&&(t=[]);let n=[];return E.Children.forEach(e,(r,i)=>{if(!E.isValidElement(r))return;let a=[...t,i];if(r.type===E.Fragment){n.push.apply(n,yy(r.props.children,a));return}r.type!==vt&&wt(!1),!r.props.index||!r.props.children||wt(!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=yy(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 mf(){return mf=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},mf.apply(null,arguments)}function yT(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 vL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bL(e,t){return e.button===0&&(!t||t==="_self")&&!vL(e)}const xL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],wL=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],SL="6";try{window.__reactRouterVersion=SL}catch{}const kL=E.createContext({isTransitioning:!1}),_L="startTransition",i1=g2[_L];function EL(e){let{basename:t,children:n,future:r,window:i}=e,a=E.useRef();a.current==null&&(a.current=A$({window:i,v5Compat:!0}));let o=a.current,[l,c]=E.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=E.useCallback(f=>{u&&i1?i1(()=>c(f)):c(f)},[c,u]);return E.useLayoutEffect(()=>o.listen(d),[o,d]),E.useEffect(()=>mL(r),[r]),E.createElement(gL,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const NL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vy=E.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,p=yT(t,xL),{basename:h}=E.useContext(bi),g,m=!1;if(typeof u=="string"&&jL.test(u)&&(g=u,NL))try{let x=new URL(window.location.href),_=u.startsWith("//")?new URL(x.protocol+u):new URL(u),S=ys(_.pathname,h);_.origin===x.origin&&S!=null?u=S+_.search+_.hash:m=!0}catch{}let v=eL(u,{relative:i}),y=CL(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(x){r&&r(x),x.defaultPrevented||y(x)}return E.createElement("a",mf({},p,{href:g||v,onClick:m||a?r:b,ref:n,target:c}))}),AL=E.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=yT(t,wL),p=Wp(c,{relative:f.relative}),h=qs(),g=E.useContext(uT),{navigator:m,basename:v}=E.useContext(bi),y=g!=null&&OL(p)&&u===!0,b=m.encodeLocation?m.encodeLocation(p).pathname:p.pathname,x=h.pathname,_=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(x=x.toLowerCase(),_=_?_.toLowerCase():null,b=b.toLowerCase()),_&&v&&(_=ys(_,v)||_);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let w=x===b||!o&&x.startsWith(b)&&x.charAt(S)==="/",k=_!=null&&(_===b||!o&&_.startsWith(b)&&_.charAt(b.length)==="/"),N={isActive:w,isPending:k,isTransitioning:y},j=w?r:void 0,C;typeof a=="function"?C=a(N):C=[a,w?"active":null,k?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let I=typeof l=="function"?l(N):l;return E.createElement(vy,mf({},f,{"aria-current":j,className:C,ref:n,style:I,to:c,viewTransition:u}),typeof d=="function"?d(N):d)});var by;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(by||(by={}));var a1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(a1||(a1={}));function TL(e){let t=E.useContext(Fp);return t||wt(!1),t}function CL(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=pT(),u=qs(),d=Wp(e,{relative:o});return E.useCallback(f=>{if(bL(f,n)){f.preventDefault();let p=r!==void 0?r:hf(u)===hf(d);c(e,{replace:p,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,a,o,l])}function OL(e,t){t===void 0&&(t={});let n=E.useContext(kL);n==null&&wt(!1);let{basename:r}=TL(by.useViewTransitionState),i=Wp(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=ys(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ys(n.nextLocation.pathname,r)||n.nextLocation.pathname;return gy(i.pathname,o)!=null||gy(i.pathname,a)!=null}async function Oa(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 Yo="buff-dashboard-admin-token";function vT(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{}return null}const xy=new Map;function PL(){const e=vT();if(e)try{const t=e.getItem(Yo);if(t)return t}catch{}return xy.get(Yo)??null}function ML(e){const t=vT();if(t)try{e?t.setItem(Yo,e):t.removeItem(Yo);return}catch{}e?xy.set(Yo,e):xy.delete(Yo)}function cn(){return PL()}function xm(e){ML(e)}function wa(){const e=cn();return e?{Authorization:`Bearer ${e}`}:{}}class RL{constructor(t=""){Qr(this,"sse",null);Qr(this,"listeners",new Set);Qr(this,"connectionListeners",new Set);Qr(this,"dagListeners",new Set);Qr(this,"typingListeners",new Set);Qr(this,"reconnectTimer",null);Qr(this,"baseUrl");Qr(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)}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.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 Oa(t);return n?(this.lastData=n,n):null}catch{return null}}async fetchTraces(){try{const t=await fetch(`${this.baseUrl}/api/traces`,{signal:AbortSignal.timeout(8e3)}),n=await Oa(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 Oa(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 Oa(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 Oa(n);return r&&Array.isArray(r.steps)?r:null}catch{return null}}async sendAdminRequest(t,n,r){try{const i=cn(),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}}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"?(xm(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"?(xm(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"),xm(null)}async shutdown(t){const n=await this.sendAdminRequest("/api/admin/shutdown","POST",{target:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Shutdown failed.",unauthorized:n.status===401,forbidden:n.status===403}}async saveProvider(t,n){const r=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}`,"PUT",n);if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const 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:wa()})).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",...wa()},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",...wa()},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}:{ok:!1,error:n.error||"Failed to read policies.",unauthorized:t.status===401,forbidden:t.status===403}}async saveGatewayPolicies(t,n,r){const i={policies:t};Array.isArray(n)&&(i.statusRecipients=n),Array.isArray(r)&&(i.contacts=r);const a=await this.sendAdminRequest("/api/admin/gateway/policies","PUT",i);if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const o=a.data??{};return a.status===200&&o.ok?o:{ok:!1,error:o.error||"Failed to save policies.",unauthorized:a.status===401,forbidden:a.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=cn(),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=cn(),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=cn(),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=cn();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=cn();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=cn();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=cn();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=cn();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=cn();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=cn();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=cn();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=cn();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=cn();try{const o=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},body:JSON.stringify({sessionId:t,message:n,provider:r==null?void 0:r.provider,model:r==null?void 0:r.model,projectPath:r==null?void 0:r.projectPath,attachments:r==null?void 0:r.attachments}),signal:i?AbortSignal.any([AbortSignal.timeout(3e5),i]):AbortSignal.timeout(3e5)}),l=await o.json();return o.status===200&&l.ok?{ok:!0,content:typeof l.content=="string"?l.content:"",followups:Array.isArray(l.followups)?l.followups:[],provider:typeof l.provider=="string"?l.provider:null,model:typeof l.model=="string"?l.model:null,generationFailed:l.generationFailed===!0}:{ok:!1,error:typeof l.error=="string"?l.error:"The agent could not answer.",unauthorized:o.status===401,forbidden:o.status===403}}catch{return{ok:!1,error:"Could not reach the dashboard server, or the turn timed out."}}}async chatReset(t){const n=await this.sendAdminRequest("/api/chat/reset","POST",{sessionId:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Reset failed."}}subscribeChat(t,n){const r=cn(),i=new EventSource(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return i.addEventListener("progress",a=>{var o;try{const l=JSON.parse(a.data);l.line&&((o=n.onProgress)==null||o.call(n,l.line))}catch{}}),i.addEventListener("status",a=>{var o;try{const l=JSON.parse(a.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),i.addEventListener("token",a=>{var o;try{const l=JSON.parse(a.data);typeof l.text=="string"&&l.text.length>0&&((o=n.onToken)==null||o.call(n,l.text))}catch{}}),i.addEventListener("tool",a=>{var o;try{const l=JSON.parse(a.data);l.tool&&(l.phase==="started"||l.phase==="called")&&((o=n.onTool)==null||o.call(n,{id:l.id||`call_${Math.random().toString(36).slice(2,8)}`,tool:l.tool,phase:l.phase,args:l.args,ok:l.ok,result:l.result,error:l.error,durationMs:l.durationMs}))}catch{}}),i.addEventListener("plan",a=>{var o;try{const l=JSON.parse(a.data);l.goal&&Array.isArray(l.steps)&&((o=n.onPlan)==null||o.call(n,{goal:l.goal,steps:l.steps,revision:l.revision??0}))}catch{}}),i.addEventListener("diff",a=>{var o;try{const l=JSON.parse(a.data);Array.isArray(l.files)&&((o=n.onDiff)==null||o.call(n,{files:l.files,summary:l.summary??""}))}catch{}}),i.addEventListener("skill_draft",a=>{var o;try{const l=JSON.parse(a.data);l.name&&l.markdown&&((o=n.onSkillDraft)==null||o.call(n,{name:l.name,description:l.description??"",markdown:l.markdown,updatedAt:l.updatedAt??0}))}catch{}}),i.addEventListener("secret_request",a=>{var o;try{const l=JSON.parse(a.data);l.skillName&&Array.isArray(l.missing)&&((o=n.onSecretRequest)==null||o.call(n,{skillName:l.skillName,missing:l.missing,persisted:l.persisted??{}}))}catch{}}),i.addEventListener("execution_result",a=>{var o;try{const l=JSON.parse(a.data);l.skillName&&l.runtime!==void 0&&((o=n.onExecutionResult)==null||o.call(n,{skillName:l.skillName,runtime:l.runtime,success:l.success??!1,durationMs:l.durationMs??0,exitCode:l.exitCode??0,stdout:l.stdout??"",stderr:l.stderr??"",timestamp:l.timestamp??Date.now()}))}catch{}}),i.addEventListener("question",a=>{var o;try{const l=JSON.parse(a.data);l.questionId&&l.question&&((o=n.onQuestion)==null||o.call(n,{questionId:l.questionId,question:l.question,choices:l.choices??[],multiSelect:l.multiSelect===!0}))}catch{}}),()=>i.close()}async chatRespond(t,n,r={}){try{const a=await(await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/respond`,{method:"POST",headers:{"Content-Type":"application/json",...wa()},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:{...wa()}})).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:{...wa()}})).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",...wa()},body:JSON.stringify({vars:t})})).json();return{ok:r.ok===!0,error:r.error,saved:r.saved}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}}const ee=new RL,IL=[{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:"/costs",label:"Costs",icon:"๐Ÿ’ฐ"},{path:"/benchmarks",label:"Benchmarks",icon:"๐Ÿ“ˆ"},{path:"/system",label:"System",icon:"โš™๏ธ"},{path:"/admin",label:"Admin",icon:"๐Ÿ› ๏ธ"}];function $L({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:IL.map(a=>s.jsxs(AL,{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 bT(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=bT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function qe(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bT(e))&&(r&&(r+=" "),r+=t);return r}var LL=Array.isArray,$n=LL,DL=typeof zi=="object"&&zi&&zi.Object===Object&&zi,xT=DL,BL=xT,zL=typeof self=="object"&&self&&self.Object===Object&&self,FL=BL||zL||Function("return this")(),Vr=FL,UL=Vr,WL=UL.Symbol,fu=WL,o1=fu,wT=Object.prototype,HL=wT.hasOwnProperty,GL=wT.toString,xl=o1?o1.toStringTag:void 0;function qL(e){var t=HL.call(e,xl),n=e[xl];try{e[xl]=void 0;var r=!0}catch{}var i=GL.call(e);return r&&(t?e[xl]=n:delete e[xl]),i}var KL=qL,VL=Object.prototype,YL=VL.toString;function XL(e){return YL.call(e)}var ZL=XL,s1=fu,QL=KL,JL=ZL,eD="[object Null]",tD="[object Undefined]",l1=s1?s1.toStringTag:void 0;function nD(e){return e==null?e===void 0?tD:eD:l1&&l1 in Object(e)?QL(e):JL(e)}var xi=nD;function rD(e){return e!=null&&typeof e=="object"}var wi=rD,iD=xi,aD=wi,oD="[object Symbol]";function sD(e){return typeof e=="symbol"||aD(e)&&iD(e)==oD}var Ks=sD,lD=$n,cD=Ks,uD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dD=/^\w*$/;function fD(e,t){if(lD(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||cD(e)?!0:dD.test(e)||!uD.test(e)||t!=null&&e in Object(t)}var ex=fD;function pD(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ua=pD;const Vs=Ye(ua);var hD=xi,mD=ua,gD="[object AsyncFunction]",yD="[object Function]",vD="[object GeneratorFunction]",bD="[object Proxy]";function xD(e){if(!mD(e))return!1;var t=hD(e);return t==yD||t==vD||t==gD||t==bD}var tx=xD;const Ie=Ye(tx);var wD=Vr,SD=wD["__core-js_shared__"],kD=SD,wm=kD,c1=function(){var e=/[^.]+$/.exec(wm&&wm.keys&&wm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _D(e){return!!c1&&c1 in e}var ED=_D,ND=Function.prototype,jD=ND.toString;function AD(e){if(e!=null){try{return jD.call(e)}catch{}try{return e+""}catch{}}return""}var ST=AD,TD=tx,CD=ED,OD=ua,PD=ST,MD=/[\\^$.*+?()[\]{}|]/g,RD=/^\[object .+?Constructor\]$/,ID=Function.prototype,$D=Object.prototype,LD=ID.toString,DD=$D.hasOwnProperty,BD=RegExp("^"+LD.call(DD).replace(MD,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zD(e){if(!OD(e)||CD(e))return!1;var t=TD(e)?BD:RD;return t.test(PD(e))}var FD=zD;function UD(e,t){return e==null?void 0:e[t]}var WD=UD,HD=FD,GD=WD;function qD(e,t){var n=GD(e,t);return HD(n)?n:void 0}var uo=qD,KD=uo,VD=KD(Object,"create"),Hp=VD,u1=Hp;function YD(){this.__data__=u1?u1(null):{},this.size=0}var XD=YD;function ZD(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var QD=ZD,JD=Hp,eB="__lodash_hash_undefined__",tB=Object.prototype,nB=tB.hasOwnProperty;function rB(e){var t=this.__data__;if(JD){var n=t[e];return n===eB?void 0:n}return nB.call(t,e)?t[e]:void 0}var iB=rB,aB=Hp,oB=Object.prototype,sB=oB.hasOwnProperty;function lB(e){var t=this.__data__;return aB?t[e]!==void 0:sB.call(t,e)}var cB=lB,uB=Hp,dB="__lodash_hash_undefined__";function fB(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=uB&&t===void 0?dB:t,this}var pB=fB,hB=XD,mB=QD,gB=iB,yB=cB,vB=pB;function Ys(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])}}Ys.prototype.clear=hB;Ys.prototype.delete=mB;Ys.prototype.get=gB;Ys.prototype.has=yB;Ys.prototype.set=vB;var bB=Ys;function xB(){this.__data__=[],this.size=0}var wB=xB;function SB(e,t){return e===t||e!==e&&t!==t}var nx=SB,kB=nx;function _B(e,t){for(var n=e.length;n--;)if(kB(e[n][0],t))return n;return-1}var Gp=_B,EB=Gp,NB=Array.prototype,jB=NB.splice;function AB(e){var t=this.__data__,n=EB(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():jB.call(t,n,1),--this.size,!0}var TB=AB,CB=Gp;function OB(e){var t=this.__data__,n=CB(t,e);return n<0?void 0:t[n][1]}var PB=OB,MB=Gp;function RB(e){return MB(this.__data__,e)>-1}var IB=RB,$B=Gp;function LB(e,t){var n=this.__data__,r=$B(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var DB=LB,BB=wB,zB=TB,FB=PB,UB=IB,WB=DB;function Xs(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])}}Xs.prototype.clear=BB;Xs.prototype.delete=zB;Xs.prototype.get=FB;Xs.prototype.has=UB;Xs.prototype.set=WB;var qp=Xs,HB=uo,GB=Vr,qB=HB(GB,"Map"),rx=qB,d1=bB,KB=qp,VB=rx;function YB(){this.size=0,this.__data__={hash:new d1,map:new(VB||KB),string:new d1}}var XB=YB;function ZB(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var QB=ZB,JB=QB;function ez(e,t){var n=e.__data__;return JB(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Kp=ez,tz=Kp;function nz(e){var t=tz(this,e).delete(e);return this.size-=t?1:0,t}var rz=nz,iz=Kp;function az(e){return iz(this,e).get(e)}var oz=az,sz=Kp;function lz(e){return sz(this,e).has(e)}var cz=lz,uz=Kp;function dz(e,t){var n=uz(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var fz=dz,pz=XB,hz=rz,mz=oz,gz=cz,yz=fz;function Zs(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])}}Zs.prototype.clear=pz;Zs.prototype.delete=hz;Zs.prototype.get=mz;Zs.prototype.has=gz;Zs.prototype.set=yz;var ix=Zs,kT=ix,vz="Expected a function";function ax(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(ax.Cache||kT),n}ax.Cache=kT;var _T=ax;const bz=Ye(_T);var xz=_T,wz=500;function Sz(e){var t=xz(e,function(r){return n.size===wz&&n.clear(),r}),n=t.cache;return t}var kz=Sz,_z=kz,Ez=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nz=/\\(\\)?/g,jz=_z(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ez,function(n,r,i,a){t.push(i?a.replace(Nz,"$1"):r||n)}),t}),Az=jz;function Tz(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 ox=Tz,f1=fu,Cz=ox,Oz=$n,Pz=Ks,p1=f1?f1.prototype:void 0,h1=p1?p1.toString:void 0;function ET(e){if(typeof e=="string")return e;if(Oz(e))return Cz(e,ET)+"";if(Pz(e))return h1?h1.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Mz=ET,Rz=Mz;function Iz(e){return e==null?"":Rz(e)}var NT=Iz,$z=$n,Lz=ex,Dz=Az,Bz=NT;function zz(e,t){return $z(e)?e:Lz(e,t)?[e]:Dz(Bz(e))}var jT=zz,Fz=Ks;function Uz(e){if(typeof e=="string"||Fz(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Vp=Uz,Wz=jT,Hz=Vp;function Gz(e,t){t=Wz(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Hz(t[n++])];return n&&n==r?e:void 0}var sx=Gz,qz=sx;function Kz(e,t,n){var r=e==null?void 0:qz(e,t);return r===void 0?n:r}var AT=Kz;const cr=Ye(AT);function Vz(e){return e==null}var Yz=Vz;const Ke=Ye(Yz);var Xz=xi,Zz=$n,Qz=wi,Jz="[object String]";function e3(e){return typeof e=="string"||!Zz(e)&&Qz(e)&&Xz(e)==Jz}var t3=e3;const no=Ye(t3);var TT={exports:{}},Qe={};/**
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 lx=Symbol.for("react.element"),cx=Symbol.for("react.portal"),Yp=Symbol.for("react.fragment"),Xp=Symbol.for("react.strict_mode"),Zp=Symbol.for("react.profiler"),Qp=Symbol.for("react.provider"),Jp=Symbol.for("react.context"),n3=Symbol.for("react.server_context"),eh=Symbol.for("react.forward_ref"),th=Symbol.for("react.suspense"),nh=Symbol.for("react.suspense_list"),rh=Symbol.for("react.memo"),ih=Symbol.for("react.lazy"),r3=Symbol.for("react.offscreen"),CT;CT=Symbol.for("react.module.reference");function pr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case lx:switch(e=e.type,e){case Yp:case Zp:case Xp:case th:case nh:return e;default:switch(e=e&&e.$$typeof,e){case n3:case Jp:case eh:case ih:case rh:case Qp:return e;default:return t}}case cx:return t}}}Qe.ContextConsumer=Jp;Qe.ContextProvider=Qp;Qe.Element=lx;Qe.ForwardRef=eh;Qe.Fragment=Yp;Qe.Lazy=ih;Qe.Memo=rh;Qe.Portal=cx;Qe.Profiler=Zp;Qe.StrictMode=Xp;Qe.Suspense=th;Qe.SuspenseList=nh;Qe.isAsyncMode=function(){return!1};Qe.isConcurrentMode=function(){return!1};Qe.isContextConsumer=function(e){return pr(e)===Jp};Qe.isContextProvider=function(e){return pr(e)===Qp};Qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===lx};Qe.isForwardRef=function(e){return pr(e)===eh};Qe.isFragment=function(e){return pr(e)===Yp};Qe.isLazy=function(e){return pr(e)===ih};Qe.isMemo=function(e){return pr(e)===rh};Qe.isPortal=function(e){return pr(e)===cx};Qe.isProfiler=function(e){return pr(e)===Zp};Qe.isStrictMode=function(e){return pr(e)===Xp};Qe.isSuspense=function(e){return pr(e)===th};Qe.isSuspenseList=function(e){return pr(e)===nh};Qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Yp||e===Zp||e===Xp||e===th||e===nh||e===r3||typeof e=="object"&&e!==null&&(e.$$typeof===ih||e.$$typeof===rh||e.$$typeof===Qp||e.$$typeof===Jp||e.$$typeof===eh||e.$$typeof===CT||e.getModuleId!==void 0)};Qe.typeOf=pr;TT.exports=Qe;var i3=TT.exports,a3=xi,o3=wi,s3="[object Number]";function l3(e){return typeof e=="number"||o3(e)&&a3(e)==s3}var OT=l3;const c3=Ye(OT);var u3=OT;function d3(e){return u3(e)&&e!=+e}var f3=d3;const pu=Ye(f3);var _r=function(t){return t===0?0:t>0?1:-1},Da=function(t){return no(t)&&t.indexOf("%")===t.length-1},se=function(t){return c3(t)&&!pu(t)},p3=function(t){return Ke(t)},Ut=function(t){return se(t)||no(t)},h3=0,ah=function(t){var n=++h3;return"".concat(t||"").concat(n)},ro=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(!se(t)&&!no(t))return r;var a;if(Da(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},Di=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},m3=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},jo=function(t,n){return se(t)&&se(n)?function(r){return t+r*(n-t)}:function(){return n}};function wy(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):cr(r,t))===n})}var g3=function(t,n){return se(t)&&se(n)?t-n:no(t)&&no(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function os(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 Sy(e){"@babel/helpers - typeof";return Sy=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},Sy(e)}var y3=["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"],m1=["points","pathLength"],Sm={svg:y3,polygon:m1,polyline:m1},ux=["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"],gf=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(E.isValidElement(t)&&(r=t.props),!Vs(r))return null;var i={};return Object.keys(r).forEach(function(a){ux.includes(a)&&(i[a]=n||function(o){return r[a](r,o)})}),i},b3=function(t,n,r){return function(i){return t(n,r,i),null}},yf=function(t,n,r){if(!Vs(t)||Sy(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var o=t[a];ux.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=b3(o,n,r))}),i},x3=["children"],w3=["children"];function g1(e,t){if(e==null)return{};var n=S3(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 S3(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 y1={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"},li=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},v1=null,km=null,dx=function e(t){if(t===v1&&Array.isArray(km))return km;var n=[];return E.Children.forEach(t,function(r){Ke(r)||(i3.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),km=n,v1=t,n};function jr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return li(i)}):r=[li(t)],dx(e).forEach(function(i){var a=cr(i,"type.displayName")||cr(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Hn(e,t){var n=jr(e,t);return n&&n[0]}var b1=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!se(r)||r<=0||!se(i)||i<=0)},k3=["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"],_3=function(t){return t&&t.type&&no(t.type)&&k3.indexOf(t.type)>=0},E3=function(t,n,r,i){var a,o=(a=Sm==null?void 0:Sm[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!Ie(t)&&(i&&o.includes(n)||v3.includes(n))||r&&ux.includes(n)},Ge=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(E.isValidElement(t)&&(i=t.props),!Vs(i))return null;var a={};return Object.keys(i).forEach(function(o){var l;E3((l=i)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=i[o])}),a},ky=function e(t,n){if(t===n)return!0;var r=E.Children.count(t);if(r!==E.Children.count(n))return!1;if(r===0)return!0;if(r===1)return x1(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(!x1(a,o))return!1}return!0},x1=function(t,n){if(Ke(t)&&Ke(n))return!0;if(!Ke(t)&&!Ke(n)){var r=t.props||{},i=r.children,a=g1(r,x3),o=n.props||{},l=o.children,c=g1(o,w3);return i&&l?os(a,c)&&ky(i,l):!i&&!l?os(a,c):!1}return!1},w1=function(t,n){var r=[],i={};return dx(t).forEach(function(a,o){if(_3(a))r.push(a);else if(a){var l=li(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},N3=function(t){var n=t&&t.type;return n&&y1[n]?y1[n]:null},j3=function(t,n){return dx(n).indexOf(t)},A3=["children","width","height","viewBox","className","style","title","desc"];function _y(){return _y=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},_y.apply(this,arguments)}function T3(e,t){if(e==null)return{};var n=C3(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 C3(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 Ey(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=T3(e,A3),d=i||{width:n,height:r,x:0,y:0},f=qe("recharts-surface",a);return W.createElement("svg",_y({},Ge(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),W.createElement("title",null,l),W.createElement("desc",null,c),t)}var O3=["children","className"];function Ny(){return Ny=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},Ny.apply(this,arguments)}function P3(e,t){if(e==null)return{};var n=M3(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 M3(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 Vt=W.forwardRef(function(e,t){var n=e.children,r=e.className,i=P3(e,O3),a=qe("recharts-layer",r);return W.createElement("g",Ny({className:a},Ge(i,!0),{ref:t}),n)}),ci=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 R3(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 I3=R3,$3=I3;function L3(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:$3(e,t,n)}var D3=L3,B3="\\ud800-\\udfff",z3="\\u0300-\\u036f",F3="\\ufe20-\\ufe2f",U3="\\u20d0-\\u20ff",W3=z3+F3+U3,H3="\\ufe0e\\ufe0f",G3="\\u200d",q3=RegExp("["+G3+B3+W3+H3+"]");function K3(e){return q3.test(e)}var PT=K3;function V3(e){return e.split("")}var Y3=V3,MT="\\ud800-\\udfff",X3="\\u0300-\\u036f",Z3="\\ufe20-\\ufe2f",Q3="\\u20d0-\\u20ff",J3=X3+Z3+Q3,eF="\\ufe0e\\ufe0f",tF="["+MT+"]",jy="["+J3+"]",Ay="\\ud83c[\\udffb-\\udfff]",nF="(?:"+jy+"|"+Ay+")",RT="[^"+MT+"]",IT="(?:\\ud83c[\\udde6-\\uddff]){2}",$T="[\\ud800-\\udbff][\\udc00-\\udfff]",rF="\\u200d",LT=nF+"?",DT="["+eF+"]?",iF="(?:"+rF+"(?:"+[RT,IT,$T].join("|")+")"+DT+LT+")*",aF=DT+LT+iF,oF="(?:"+[RT+jy+"?",jy,IT,$T,tF].join("|")+")",sF=RegExp(Ay+"(?="+Ay+")|"+oF+aF,"g");function lF(e){return e.match(sF)||[]}var cF=lF,uF=Y3,dF=PT,fF=cF;function pF(e){return dF(e)?fF(e):uF(e)}var hF=pF,mF=D3,gF=PT,yF=hF,vF=NT;function bF(e){return function(t){t=vF(t);var n=gF(t)?yF(t):void 0,r=n?n[0]:t.charAt(0),i=n?mF(n,1).join(""):t.slice(1);return r[e]()+i}}var xF=bF,wF=xF,SF=wF("toUpperCase"),kF=SF;const oh=Ye(kF);function ot(e){return function(){return e}}const BT=Math.cos,vf=Math.sin,Or=Math.sqrt,bf=Math.PI,sh=2*bf,Ty=Math.PI,Cy=2*Ty,ja=1e-6,_F=Cy-ja;function zT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function EF(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return zT;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 NF{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?zT:EF(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,p=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(p>ja)if(!(Math.abs(f*c-u*d)>ja)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-o,g=i-l,m=c*c+u*u,v=h*h+g*g,y=Math.sqrt(m),b=Math.sqrt(p),x=a*Math.tan((Ty-Math.acos((m+p-v)/(2*y*b)))/2),_=x/b,S=x/y;Math.abs(_-1)>ja&&this._append`L${t+_*d},${n+_*f}`,this._append`A${a},${a},0,0,${+(f*h>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,p=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>ja||Math.abs(this._y1-d)>ja)&&this._append`L${u},${d}`,r&&(p<0&&(p=p%Cy+Cy),p>_F?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:p>ja&&this._append`A${r},${r},0,${+(p>=Ty)},${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 fx(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 NF(t)}function px(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function FT(e){this._context=e}FT.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 lh(e){return new FT(e)}function UT(e){return e[0]}function WT(e){return e[1]}function HT(e,t){var n=ot(!0),r=null,i=lh,a=null,o=fx(l);e=typeof e=="function"?e:e===void 0?UT:ot(e),t=typeof t=="function"?t:t===void 0?WT:ot(t);function l(c){var u,d=(c=px(c)).length,f,p=!1,h;for(r==null&&(a=i(h=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===p&&((p=!p)?a.lineStart():a.lineEnd()),p&&a.point(+e(f,u,c),+t(f,u,c));if(h)return a=null,h+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ot(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ot(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ot(!!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 Ju(e,t,n){var r=null,i=ot(!0),a=null,o=lh,l=null,c=fx(u);e=typeof e=="function"?e:e===void 0?UT:ot(+e),t=typeof t=="function"?t:ot(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?WT:ot(+n);function u(f){var p,h,g,m=(f=px(f)).length,v,y=!1,b,x=new Array(m),_=new Array(m);for(a==null&&(l=o(b=c())),p=0;p<=m;++p){if(!(p<m&&i(v=f[p],p,f))===y)if(y=!y)h=p,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=p-1;g>=h;--g)l.point(x[g],_[g]);l.lineEnd(),l.areaEnd()}y&&(x[p]=+e(v,p,f),_[p]=+t(v,p,f),l.point(r?+r(v,p,f):x[p],n?+n(v,p,f):_[p]))}if(b)return l=null,b+""||null}function d(){return HT().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ot(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ot(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ot(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ot(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ot(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ot(+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:ot(!!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 GT{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 jF(e){return new GT(e,!0)}function AF(e){return new GT(e,!1)}const hx={draw(e,t){const n=Or(t/bf);e.moveTo(n,0),e.arc(0,0,n,0,sh)}},TF={draw(e,t){const n=Or(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},qT=Or(1/3),CF=qT*2,OF={draw(e,t){const n=Or(t/CF),r=n*qT;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},PF={draw(e,t){const n=Or(t),r=-n/2;e.rect(r,r,n,n)}},MF=.8908130915292852,KT=vf(bf/10)/vf(7*bf/10),RF=vf(sh/10)*KT,IF=-BT(sh/10)*KT,$F={draw(e,t){const n=Or(t*MF),r=RF*n,i=IF*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=sh*a/5,l=BT(o),c=vf(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},_m=Or(3),LF={draw(e,t){const n=-Or(t/(_m*3));e.moveTo(0,n*2),e.lineTo(-_m*n,-n),e.lineTo(_m*n,-n),e.closePath()}},er=-.5,tr=Or(3)/2,Oy=1/Or(12),DF=(Oy/2+1)*3,BF={draw(e,t){const n=Or(t/DF),r=n/2,i=n*Oy,a=r,o=n*Oy+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(er*r-tr*i,tr*r+er*i),e.lineTo(er*a-tr*o,tr*a+er*o),e.lineTo(er*l-tr*c,tr*l+er*c),e.lineTo(er*r+tr*i,er*i-tr*r),e.lineTo(er*a+tr*o,er*o-tr*a),e.lineTo(er*l+tr*c,er*c-tr*l),e.closePath()}};function zF(e,t){let n=null,r=fx(i);e=typeof e=="function"?e:ot(e||hx),t=typeof t=="function"?t:ot(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:ot(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ot(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function xf(){}function wf(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 VT(e){this._context=e}VT.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:wf(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:wf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function FF(e){return new VT(e)}function YT(e){this._context=e}YT.prototype={areaStart:xf,areaEnd:xf,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:wf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function UF(e){return new YT(e)}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(){(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:wf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function WF(e){return new XT(e)}function ZT(e){this._context=e}ZT.prototype={areaStart:xf,areaEnd:xf,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 HF(e){return new ZT(e)}function S1(e){return e<0?-1:1}function k1(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(S1(a)+S1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function _1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Em(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 Sf(e){this._context=e}Sf.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:Em(this,this._t0,_1(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,Em(this,_1(this,n=k1(this,e,t)),n);break;default:Em(this,this._t0,n=k1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function QT(e){this._context=new JT(e)}(QT.prototype=Object.create(Sf.prototype)).point=function(e,t){Sf.prototype.point.call(this,t,e)};function JT(e){this._context=e}JT.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 GF(e){return new Sf(e)}function qF(e){return new QT(e)}function eC(e){this._context=e}eC.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=E1(e),i=E1(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 E1(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 KF(e){return new eC(e)}function ch(e,t){this._context=e,this._t=t}ch.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 VF(e){return new ch(e,.5)}function YF(e){return new ch(e,0)}function XF(e){return new ch(e,1)}function vs(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 Py(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ZF(e,t){return e[t]}function QF(e){const t=[];return t.key=e,t}function JF(){var e=ot([]),t=Py,n=vs,r=ZF;function i(a){var o=Array.from(e.apply(this,arguments),QF),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=px(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:ot(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:ot(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Py:typeof a=="function"?a:ot(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??vs,i):n},i}function e6(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}vs(e,t)}}function t6(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}vs(e,t)}}function n6(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,p=d[r-1][1]||0,h=(f-p)/2,g=0;g<l;++g){var m=e[t[g]],v=m[r][1]||0,y=m[r-1][1]||0;h+=v-y}c+=f,u+=h*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,vs(e,t)}}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)}var r6=["type","size","sizeType"];function My(){return My=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},My.apply(this,arguments)}function N1(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 j1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N1(Object(n),!0).forEach(function(r){i6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function i6(e,t,n){return t=a6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a6(e){var t=o6(e,"string");return wc(t)=="symbol"?t:t+""}function o6(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)}function s6(e,t){if(e==null)return{};var n=l6(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 l6(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 tC={symbolCircle:hx,symbolCross:TF,symbolDiamond:OF,symbolSquare:PF,symbolStar:$F,symbolTriangle:LF,symbolWye:BF},c6=Math.PI/180,u6=function(t){var n="symbol".concat(oh(t));return tC[n]||hx},d6=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*c6;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}},f6=function(t,n){tC["symbol".concat(oh(t))]=n},mx=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=s6(t,r6),u=j1(j1({},c),{},{type:r,size:a,sizeType:l}),d=function(){var v=u6(r),y=zF().type(v).size(d6(a,l,r));return y()},f=u.className,p=u.cx,h=u.cy,g=Ge(u,!0);return p===+p&&h===+h&&a===+a?W.createElement("path",My({},g,{className:qe("recharts-symbols",f),transform:"translate(".concat(p,", ").concat(h,")"),d:d()})):null};mx.registerSymbol=f6;function bs(e){"@babel/helpers - typeof";return bs=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},bs(e)}function Ry(){return Ry=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},Ry.apply(this,arguments)}function A1(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 p6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A1(Object(n),!0).forEach(function(r){Sc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A1(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 m6(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,rC(r.key),r)}}function g6(e,t,n){return t&&m6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function y6(e,t,n){return t=kf(t),v6(e,nC()?Reflect.construct(t,n||[],kf(e).constructor):t.apply(e,n))}function v6(e,t){if(t&&(bs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return b6(e)}function b6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nC=function(){return!!e})()}function kf(e){return kf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kf(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&&Iy(e,t)}function Iy(e,t){return Iy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Iy(e,t)}function Sc(e,t,n){return t=rC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rC(e){var t=w6(e,"string");return bs(t)=="symbol"?t:t+""}function w6(e,t){if(bs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var nr=32,gx=function(e){function t(){return h6(this,t),y6(this,t,arguments)}return x6(t,e),g6(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=nr/2,o=nr/6,l=nr/3,c=r.inactive?i:r.color;if(r.type==="plainline")return W.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:nr,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return W.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
76
- A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,`
77
- H`).concat(nr,"M").concat(2*l,",").concat(a,`
78
- A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return W.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(nr/8,"h").concat(nr,"v").concat(nr*3/4,"h").concat(-nr,"z"),className:"recharts-legend-icon"});if(W.isValidElement(r.legendIcon)){var u=p6({},r);return delete u.legendIcon,W.cloneElement(r.legendIcon,u)}return W.createElement(mx,{fill:c,cx:a,cy:a,size:nr,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,a=i.payload,o=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:nr,height:nr},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(h,g){var m=h.formatter||c,v=qe(Sc(Sc({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",h.inactive));if(h.type==="none")return null;var y=Ie(h.value)?null:h.value;ci(!Ie(h.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=h.inactive?u:h.color;return W.createElement("li",Ry({className:v,style:f,key:"legend-item-".concat(g)},yf(r.props,h,g)),W.createElement(Ey,{width:o,height:o,viewBox:d,style:p},r.renderIcon(h)),W.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},m?m(y,h,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 W.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(E.PureComponent);Sc(gx,"displayName","Legend");Sc(gx,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var S6=qp;function k6(){this.__data__=new S6,this.size=0}var _6=k6;function E6(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var N6=E6;function j6(e){return this.__data__.get(e)}var A6=j6;function T6(e){return this.__data__.has(e)}var C6=T6,O6=qp,P6=rx,M6=ix,R6=200;function I6(e,t){var n=this.__data__;if(n instanceof O6){var r=n.__data__;if(!P6||r.length<R6-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new M6(r)}return n.set(e,t),this.size=n.size,this}var $6=I6,L6=qp,D6=_6,B6=N6,z6=A6,F6=C6,U6=$6;function Qs(e){var t=this.__data__=new L6(e);this.size=t.size}Qs.prototype.clear=D6;Qs.prototype.delete=B6;Qs.prototype.get=z6;Qs.prototype.has=F6;Qs.prototype.set=U6;var iC=Qs,W6="__lodash_hash_undefined__";function H6(e){return this.__data__.set(e,W6),this}var G6=H6;function q6(e){return this.__data__.has(e)}var K6=q6,V6=ix,Y6=G6,X6=K6;function _f(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new V6;++t<n;)this.add(e[t])}_f.prototype.add=_f.prototype.push=Y6;_f.prototype.has=X6;var aC=_f;function Z6(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 oC=Z6;function Q6(e,t){return e.has(t)}var sC=Q6,J6=aC,e4=oC,t4=sC,n4=1,r4=2;function i4(e,t,n,r,i,a){var o=n&n4,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,p=!0,h=n&r4?new J6: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;p=!1;break}if(h){if(!e4(t,function(y,b){if(!t4(h,b)&&(g===y||i(g,y,n,r,a)))return h.push(b)})){p=!1;break}}else if(!(g===m||i(g,m,n,r,a))){p=!1;break}}return a.delete(e),a.delete(t),p}var lC=i4,a4=Vr,o4=a4.Uint8Array,s4=o4;function l4(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var c4=l4;function u4(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var yx=u4,T1=fu,C1=s4,d4=nx,f4=lC,p4=c4,h4=yx,m4=1,g4=2,y4="[object Boolean]",v4="[object Date]",b4="[object Error]",x4="[object Map]",w4="[object Number]",S4="[object RegExp]",k4="[object Set]",_4="[object String]",E4="[object Symbol]",N4="[object ArrayBuffer]",j4="[object DataView]",O1=T1?T1.prototype:void 0,Nm=O1?O1.valueOf:void 0;function A4(e,t,n,r,i,a,o){switch(n){case j4:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case N4:return!(e.byteLength!=t.byteLength||!a(new C1(e),new C1(t)));case y4:case v4:case w4:return d4(+e,+t);case b4:return e.name==t.name&&e.message==t.message;case S4:case _4:return e==t+"";case x4:var l=p4;case k4:var c=r&m4;if(l||(l=h4),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=g4,o.set(e,t);var d=f4(l(e),l(t),r,i,a,o);return o.delete(e),d;case E4:if(Nm)return Nm.call(e)==Nm.call(t)}return!1}var T4=A4;function C4(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var cC=C4,O4=cC,P4=$n;function M4(e,t,n){var r=t(e);return P4(e)?r:O4(r,n(e))}var R4=M4;function I4(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 $4=I4;function L4(){return[]}var D4=L4,B4=$4,z4=D4,F4=Object.prototype,U4=F4.propertyIsEnumerable,P1=Object.getOwnPropertySymbols,W4=P1?function(e){return e==null?[]:(e=Object(e),B4(P1(e),function(t){return U4.call(e,t)}))}:z4,H4=W4;function G4(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var q4=G4,K4=xi,V4=wi,Y4="[object Arguments]";function X4(e){return V4(e)&&K4(e)==Y4}var Z4=X4,M1=Z4,Q4=wi,uC=Object.prototype,J4=uC.hasOwnProperty,eU=uC.propertyIsEnumerable,tU=M1(function(){return arguments}())?M1:function(e){return Q4(e)&&J4.call(e,"callee")&&!eU.call(e,"callee")},vx=tU,Ef={exports:{}};function nU(){return!1}var rU=nU;Ef.exports;(function(e,t){var n=Vr,r=rU,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})(Ef,Ef.exports);var dC=Ef.exports,iU=9007199254740991,aU=/^(?:0|[1-9]\d*)$/;function oU(e,t){var n=typeof e;return t=t??iU,!!t&&(n=="number"||n!="symbol"&&aU.test(e))&&e>-1&&e%1==0&&e<t}var bx=oU,sU=9007199254740991;function lU(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=sU}var xx=lU,cU=xi,uU=xx,dU=wi,fU="[object Arguments]",pU="[object Array]",hU="[object Boolean]",mU="[object Date]",gU="[object Error]",yU="[object Function]",vU="[object Map]",bU="[object Number]",xU="[object Object]",wU="[object RegExp]",SU="[object Set]",kU="[object String]",_U="[object WeakMap]",EU="[object ArrayBuffer]",NU="[object DataView]",jU="[object Float32Array]",AU="[object Float64Array]",TU="[object Int8Array]",CU="[object Int16Array]",OU="[object Int32Array]",PU="[object Uint8Array]",MU="[object Uint8ClampedArray]",RU="[object Uint16Array]",IU="[object Uint32Array]",ut={};ut[jU]=ut[AU]=ut[TU]=ut[CU]=ut[OU]=ut[PU]=ut[MU]=ut[RU]=ut[IU]=!0;ut[fU]=ut[pU]=ut[EU]=ut[hU]=ut[NU]=ut[mU]=ut[gU]=ut[yU]=ut[vU]=ut[bU]=ut[xU]=ut[wU]=ut[SU]=ut[kU]=ut[_U]=!1;function $U(e){return dU(e)&&uU(e.length)&&!!ut[cU(e)]}var LU=$U;function DU(e){return function(t){return e(t)}}var fC=DU,Nf={exports:{}};Nf.exports;(function(e,t){var n=xT,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})(Nf,Nf.exports);var BU=Nf.exports,zU=LU,FU=fC,R1=BU,I1=R1&&R1.isTypedArray,UU=I1?FU(I1):zU,pC=UU,WU=q4,HU=vx,GU=$n,qU=dC,KU=bx,VU=pC,YU=Object.prototype,XU=YU.hasOwnProperty;function ZU(e,t){var n=GU(e),r=!n&&HU(e),i=!n&&!r&&qU(e),a=!n&&!r&&!i&&VU(e),o=n||r||i||a,l=o?WU(e.length,String):[],c=l.length;for(var u in e)(t||XU.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 QU=ZU,JU=Object.prototype;function e9(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||JU;return e===n}var t9=e9;function n9(e,t){return function(n){return e(t(n))}}var hC=n9,r9=hC,i9=r9(Object.keys,Object),a9=i9,o9=t9,s9=a9,l9=Object.prototype,c9=l9.hasOwnProperty;function u9(e){if(!o9(e))return s9(e);var t=[];for(var n in Object(e))c9.call(e,n)&&n!="constructor"&&t.push(n);return t}var d9=u9,f9=tx,p9=xx;function h9(e){return e!=null&&p9(e.length)&&!f9(e)}var hu=h9,m9=QU,g9=d9,y9=hu;function v9(e){return y9(e)?m9(e):g9(e)}var uh=v9,b9=R4,x9=H4,w9=uh;function S9(e){return b9(e,w9,x9)}var k9=S9,$1=k9,_9=1,E9=Object.prototype,N9=E9.hasOwnProperty;function j9(e,t,n,r,i,a){var o=n&_9,l=$1(e),c=l.length,u=$1(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var p=l[f];if(!(o?p in t:N9.call(t,p)))return!1}var h=a.get(e),g=a.get(t);if(h&&g)return h==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=o;++f<c;){p=l[f];var y=e[p],b=t[p];if(r)var x=o?r(b,y,p,t,e,a):r(y,b,p,e,t,a);if(!(x===void 0?y===b||i(y,b,n,r,a):x)){m=!1;break}v||(v=p=="constructor")}if(m&&!v){var _=e.constructor,S=t.constructor;_!=S&&"constructor"in e&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof S=="function"&&S instanceof S)&&(m=!1)}return a.delete(e),a.delete(t),m}var A9=j9,T9=uo,C9=Vr,O9=T9(C9,"DataView"),P9=O9,M9=uo,R9=Vr,I9=M9(R9,"Promise"),$9=I9,L9=uo,D9=Vr,B9=L9(D9,"Set"),mC=B9,z9=uo,F9=Vr,U9=z9(F9,"WeakMap"),W9=U9,$y=P9,Ly=rx,Dy=$9,By=mC,zy=W9,gC=xi,Js=ST,L1="[object Map]",H9="[object Object]",D1="[object Promise]",B1="[object Set]",z1="[object WeakMap]",F1="[object DataView]",G9=Js($y),q9=Js(Ly),K9=Js(Dy),V9=Js(By),Y9=Js(zy),Aa=gC;($y&&Aa(new $y(new ArrayBuffer(1)))!=F1||Ly&&Aa(new Ly)!=L1||Dy&&Aa(Dy.resolve())!=D1||By&&Aa(new By)!=B1||zy&&Aa(new zy)!=z1)&&(Aa=function(e){var t=gC(e),n=t==H9?e.constructor:void 0,r=n?Js(n):"";if(r)switch(r){case G9:return F1;case q9:return L1;case K9:return D1;case V9:return B1;case Y9:return z1}return t});var X9=Aa,jm=iC,Z9=lC,Q9=T4,J9=A9,U1=X9,W1=$n,H1=dC,e8=pC,t8=1,G1="[object Arguments]",q1="[object Array]",ed="[object Object]",n8=Object.prototype,K1=n8.hasOwnProperty;function r8(e,t,n,r,i,a){var o=W1(e),l=W1(t),c=o?q1:U1(e),u=l?q1:U1(t);c=c==G1?ed:c,u=u==G1?ed:u;var d=c==ed,f=u==ed,p=c==u;if(p&&H1(e)){if(!H1(t))return!1;o=!0,d=!1}if(p&&!d)return a||(a=new jm),o||e8(e)?Z9(e,t,n,r,i,a):Q9(e,t,c,n,r,i,a);if(!(n&t8)){var h=d&&K1.call(e,"__wrapped__"),g=f&&K1.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,v=g?t.value():t;return a||(a=new jm),i(m,v,n,r,a)}}return p?(a||(a=new jm),J9(e,t,n,r,i,a)):!1}var i8=r8,a8=i8,V1=wi;function yC(e,t,n,r,i){return e===t?!0:e==null||t==null||!V1(e)&&!V1(t)?e!==e&&t!==t:a8(e,t,n,r,yC,i)}var wx=yC,o8=iC,s8=wx,l8=1,c8=2;function u8(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 o8;if(r)var p=r(u,d,c,e,t,f);if(!(p===void 0?s8(d,u,l8|c8,r,f):p))return!1}}return!0}var d8=u8,f8=ua;function p8(e){return e===e&&!f8(e)}var vC=p8,h8=vC,m8=uh;function g8(e){for(var t=m8(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,h8(i)]}return t}var y8=g8;function v8(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var bC=v8,b8=d8,x8=y8,w8=bC;function S8(e){var t=x8(e);return t.length==1&&t[0][2]?w8(t[0][0],t[0][1]):function(n){return n===e||b8(n,e,t)}}var k8=S8;function _8(e,t){return e!=null&&t in Object(e)}var E8=_8,N8=jT,j8=vx,A8=$n,T8=bx,C8=xx,O8=Vp;function P8(e,t,n){t=N8(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=O8(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&&C8(i)&&T8(o,i)&&(A8(e)||j8(e)))}var M8=P8,R8=E8,I8=M8;function $8(e,t){return e!=null&&I8(e,t,R8)}var L8=$8,D8=wx,B8=AT,z8=L8,F8=ex,U8=vC,W8=bC,H8=Vp,G8=1,q8=2;function K8(e,t){return F8(e)&&U8(t)?W8(H8(e),t):function(n){var r=B8(n,e);return r===void 0&&r===t?z8(n,e):D8(t,r,G8|q8)}}var V8=K8;function Y8(e){return e}var el=Y8;function X8(e){return function(t){return t==null?void 0:t[e]}}var Z8=X8,Q8=sx;function J8(e){return function(t){return Q8(t,e)}}var e5=J8,t5=Z8,n5=e5,r5=ex,i5=Vp;function a5(e){return r5(e)?t5(i5(e)):n5(e)}var o5=a5,s5=k8,l5=V8,c5=el,u5=$n,d5=o5;function f5(e){return typeof e=="function"?e:e==null?c5:typeof e=="object"?u5(e)?l5(e[0],e[1]):s5(e):d5(e)}var da=f5;function p5(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 xC=p5;function h5(e){return e!==e}var m5=h5;function g5(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var y5=g5,v5=xC,b5=m5,x5=y5;function w5(e,t,n){return t===t?x5(e,t,n):v5(e,b5,n)}var S5=w5,k5=S5;function _5(e,t){var n=e==null?0:e.length;return!!n&&k5(e,t,0)>-1}var E5=_5;function N5(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 j5=N5;function A5(){}var T5=A5,Am=mC,C5=T5,O5=yx,P5=1/0,M5=Am&&1/O5(new Am([,-0]))[1]==P5?function(e){return new Am(e)}:C5,R5=M5,I5=aC,$5=E5,L5=j5,D5=sC,B5=R5,z5=yx,F5=200;function U5(e,t,n){var r=-1,i=$5,a=e.length,o=!0,l=[],c=l;if(n)o=!1,i=L5;else if(a>=F5){var u=t?null:B5(e);if(u)return z5(u);o=!1,i=D5,c=new I5}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 p=c.length;p--;)if(c[p]===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 W5=U5,H5=da,G5=W5;function q5(e,t){return e&&e.length?G5(e,H5(t)):[]}var K5=q5;const Y1=Ye(K5);function wC(e,t,n){return t===!0?Y1(e,n):Ie(t)?Y1(e,t):e}function xs(e){"@babel/helpers - typeof";return xs=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},xs(e)}var V5=["ref"];function X1(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 Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X1(Object(n),!0).forEach(function(r){dh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Y5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z1(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,kC(r.key),r)}}function X5(e,t,n){return t&&Z1(e.prototype,t),n&&Z1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Z5(e,t,n){return t=jf(t),Q5(e,SC()?Reflect.construct(t,n||[],jf(e).constructor):t.apply(e,n))}function Q5(e,t){if(t&&(xs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return J5(e)}function J5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SC=function(){return!!e})()}function jf(e){return jf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jf(e)}function eW(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fy(e,t)}function Fy(e,t){return Fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Fy(e,t)}function dh(e,t,n){return t=kC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kC(e){var t=tW(e,"string");return xs(t)=="symbol"?t:t+""}function tW(e,t){if(xs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function nW(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 iW(e){return e.value}function aW(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=nW(t,V5);return W.createElement(gx,n)}var Q1=1,Ga=function(e){function t(){var n;Y5(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Z5(this,t,[].concat(i)),dh(n,"lastBoundingBox",{width:-1,height:-1}),n}return eW(t,e),X5(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)>Q1||Math.abs(i.height-this.lastBoundingBox.height)>Q1)&&(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?Jr({},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,p;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();f={left:((u||0)-h.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();p={top:((d||0)-g.height)/2}}else p=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Jr(Jr({},f),p)}},{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=Jr(Jr({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return W.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},aW(a,Jr(Jr({},this.props),{},{payload:wC(d,u,iW)})))}}],[{key:"getWithHeight",value:function(r,i){var a=Jr(Jr({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&se(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}])}(E.PureComponent);dh(Ga,"displayName","Legend");dh(Ga,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var J1=fu,oW=vx,sW=$n,eS=J1?J1.isConcatSpreadable:void 0;function lW(e){return sW(e)||oW(e)||!!(eS&&e&&e[eS])}var cW=lW,uW=cC,dW=cW;function _C(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=dW),i||(i=[]);++a<o;){var l=e[a];t>0&&n(l)?t>1?_C(l,t-1,n,r,i):uW(i,l):r||(i[i.length]=l)}return i}var EC=_C;function fW(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 pW=fW,hW=pW,mW=hW(),gW=mW,yW=gW,vW=uh;function bW(e,t){return e&&yW(e,t,vW)}var NC=bW,xW=hu;function wW(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 SW=wW,kW=NC,_W=SW,EW=_W(kW),Sx=EW,NW=Sx,jW=hu;function AW(e,t){var n=-1,r=jW(e)?Array(e.length):[];return NW(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var jC=AW;function TW(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var CW=TW,tS=Ks;function OW(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=tS(e),o=t!==void 0,l=t===null,c=t===t,u=tS(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 PW=OW,MW=PW;function RW(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,l=n.length;++r<o;){var c=MW(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 IW=RW,Tm=ox,$W=sx,LW=da,DW=jC,BW=CW,zW=fC,FW=IW,UW=el,WW=$n;function HW(e,t,n){t.length?t=Tm(t,function(a){return WW(a)?function(o){return $W(o,a.length===1?a[0]:a)}:a}):t=[UW];var r=-1;t=Tm(t,zW(LW));var i=DW(e,function(a,o,l){var c=Tm(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return BW(i,function(a,o){return FW(a,o,n)})}var GW=HW;function qW(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 KW=qW,VW=KW,nS=Math.max;function YW(e,t,n){return t=nS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=nS(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),VW(e,this,l)}}var XW=YW;function ZW(e){return function(){return e}}var QW=ZW,JW=uo,eH=function(){try{var e=JW(Object,"defineProperty");return e({},"",{}),e}catch{}}(),AC=eH,tH=QW,rS=AC,nH=el,rH=rS?function(e,t){return rS(e,"toString",{configurable:!0,enumerable:!1,value:tH(t),writable:!0})}:nH,iH=rH,aH=800,oH=16,sH=Date.now;function lH(e){var t=0,n=0;return function(){var r=sH(),i=oH-(r-n);if(n=r,i>0){if(++t>=aH)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var cH=lH,uH=iH,dH=cH,fH=dH(uH),pH=fH,hH=el,mH=XW,gH=pH;function yH(e,t){return gH(mH(e,t,hH),e+"")}var vH=yH,bH=nx,xH=hu,wH=bx,SH=ua;function kH(e,t,n){if(!SH(n))return!1;var r=typeof t;return(r=="number"?xH(n)&&wH(t,n.length):r=="string"&&t in n)?bH(n[t],e):!1}var fh=kH,_H=EC,EH=GW,NH=vH,iS=fh,jH=NH(function(e,t){if(e==null)return[];var n=t.length;return n>1&&iS(e,t[0],t[1])?t=[]:n>2&&iS(t[0],t[1],t[2])&&(t=[t[0]]),EH(e,_H(t,1),[])}),AH=jH;const kx=Ye(AH);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 Uy(){return Uy=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},Uy.apply(this,arguments)}function TH(e,t){return MH(e)||PH(e,t)||OH(e,t)||CH()}function CH(){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 OH(e,t){if(e){if(typeof e=="string")return aS(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 aS(e,t)}}function aS(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 PH(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 MH(e){if(Array.isArray(e))return e}function oS(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 Cm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oS(Object(n),!0).forEach(function(r){RH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RH(e,t,n){return t=IH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IH(e){var t=$H(e,"string");return kc(t)=="symbol"?t:t+""}function $H(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(t==="string"?String:Number)(e)}function LH(e){return Array.isArray(e)&&Ut(e[0])&&Ut(e[1])?e.join(" ~ "):e}var DH=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,p=t.itemSorter,h=t.wrapperClassName,g=t.labelClassName,m=t.label,v=t.labelFormatter,y=t.accessibilityLayer,b=y===void 0?!1:y,x=function(){if(d&&d.length){var M={padding:0,margin:0},$=(p?kx(d,p):d).map(function(R,B){if(R.type==="none")return null;var L=Cm({display:"block",paddingTop:4,paddingBottom:4,color:R.color||"#000"},l),U=R.formatter||f||LH,O=R.value,z=R.name,T=O,V=z;if(U&&T!=null&&V!=null){var q=U(O,z,R,B,d);if(Array.isArray(q)){var P=TH(q,2);T=P[0],V=P[1]}else T=q}return W.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(B),style:L},Ut(V)?W.createElement("span",{className:"recharts-tooltip-item-name"},V):null,Ut(V)?W.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,W.createElement("span",{className:"recharts-tooltip-item-value"},T),W.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return W.createElement("ul",{className:"recharts-tooltip-item-list",style:M},$)}return null},_=Cm({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),S=Cm({margin:0},u),w=!Ke(m),k=w?m:"",N=qe("recharts-default-tooltip",h),j=qe("recharts-tooltip-label",g);w&&v&&d!==void 0&&d!==null&&(k=v(m,d));var C=b?{role:"status","aria-live":"assertive"}:{};return W.createElement("div",Uy({className:N,style:_},C),W.createElement("p",{className:j,style:S},W.isValidElement(k)?k:"".concat(k)),x())};function _c(e){"@babel/helpers - typeof";return _c=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},_c(e)}function td(e,t,n){return t=BH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BH(e){var t=zH(e,"string");return _c(t)=="symbol"?t:t+""}function zH(e,t){if(_c(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wl="recharts-tooltip-wrapper",FH={visibility:"hidden"};function UH(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return qe(wl,td(td(td(td({},"".concat(wl,"-right"),se(n)&&t&&se(t.x)&&n>=t.x),"".concat(wl,"-left"),se(n)&&t&&se(t.x)&&n<t.x),"".concat(wl,"-bottom"),se(r)&&t&&se(t.y)&&r>=t.y),"".concat(wl,"-top"),se(r)&&t&&se(t.y)&&r<t.y))}function sS(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&&se(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 p=d,h=c[r];return p<h?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 WH(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 HH(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=sS({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=sS({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=WH({translateX:d,translateY:f,useTranslate3d:l})):u=FH,{cssProperties:u,cssClasses:UH({translateX:d,translateY:f,coordinate:n})}}function ws(e){"@babel/helpers - typeof";return ws=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},ws(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 cS(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){Hy(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 GH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qH(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,CC(r.key),r)}}function KH(e,t,n){return t&&qH(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function VH(e,t,n){return t=Af(t),YH(e,TC()?Reflect.construct(t,n||[],Af(e).constructor):t.apply(e,n))}function YH(e,t){if(t&&(ws(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XH(e)}function XH(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TC=function(){return!!e})()}function Af(e){return Af=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Af(e)}function ZH(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&&Wy(e,t)}function Wy(e,t){return Wy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Wy(e,t)}function Hy(e,t,n){return t=CC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CC(e){var t=QH(e,"string");return ws(t)=="symbol"?t:t+""}function QH(e,t){if(ws(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ws(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var uS=1,JH=function(e){function t(){var n;GH(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=VH(this,t,[].concat(i)),Hy(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Hy(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 ZH(t,e),KH(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>uS||Math.abs(r.height-this.state.lastBoundingBox.height)>uS)&&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,p=i.isAnimationActive,h=i.offset,g=i.position,m=i.reverseDirection,v=i.useTranslate3d,y=i.viewBox,b=i.wrapperStyle,x=HH({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:h,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:y}),_=x.cssClasses,S=x.cssProperties,w=cS(cS({transition:p&&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 W.createElement("div",{tabIndex:-1,className:_,style:w,ref:function(N){r.wrapperNode=N}},u)}}])}(E.PureComponent),eG=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},mu={isSsr:eG()};function Ss(e){"@babel/helpers - typeof";return Ss=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},Ss(e)}function dS(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 fS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dS(Object(n),!0).forEach(function(r){_x(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,PC(r.key),r)}}function rG(e,t,n){return t&&nG(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function iG(e,t,n){return t=Tf(t),aG(e,OC()?Reflect.construct(t,n||[],Tf(e).constructor):t.apply(e,n))}function aG(e,t){if(t&&(Ss(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oG(e)}function oG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OC=function(){return!!e})()}function Tf(e){return Tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tf(e)}function sG(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gy(e,t)}function Gy(e,t){return Gy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Gy(e,t)}function _x(e,t,n){return t=PC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PC(e){var t=lG(e,"string");return Ss(t)=="symbol"?t:t+""}function lG(e,t){if(Ss(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ss(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function cG(e){return e.dataKey}function uG(e,t){return W.isValidElement(e)?W.cloneElement(e,t):typeof e=="function"?W.createElement(e,t):W.createElement(DH,t)}var fn=function(e){function t(){return tG(this,t),iG(this,t,arguments)}return sG(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,p=i.isAnimationActive,h=i.offset,g=i.payload,m=i.payloadUniqBy,v=i.position,y=i.reverseDirection,b=i.useTranslate3d,x=i.viewBox,_=i.wrapperStyle,S=g??[];f&&S.length&&(S=wC(g.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),m,cG));var w=S.length>0;return W.createElement(JH,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:p,active:a,coordinate:d,hasPayload:w,offset:h,position:v,reverseDirection:y,useTranslate3d:b,viewBox:x,wrapperStyle:_},uG(u,fS(fS({},this.props),{},{payload:S})))}}])}(E.PureComponent);_x(fn,"displayName","Tooltip");_x(fn,"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 dG=Vr,fG=function(){return dG.Date.now()},pG=fG,hG=/\s/;function mG(e){for(var t=e.length;t--&&hG.test(e.charAt(t)););return t}var gG=mG,yG=gG,vG=/^\s+/;function bG(e){return e&&e.slice(0,yG(e)+1).replace(vG,"")}var xG=bG,wG=xG,pS=ua,SG=Ks,hS=NaN,kG=/^[-+]0x[0-9a-f]+$/i,_G=/^0b[01]+$/i,EG=/^0o[0-7]+$/i,NG=parseInt;function jG(e){if(typeof e=="number")return e;if(SG(e))return hS;if(pS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=pS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=wG(e);var n=_G.test(e);return n||EG.test(e)?NG(e.slice(2),n?2:8):kG.test(e)?hS:+e}var MC=jG,AG=ua,Om=pG,mS=MC,TG="Expected a function",CG=Math.max,OG=Math.min;function PG(e,t,n){var r,i,a,o,l,c,u=0,d=!1,f=!1,p=!0;if(typeof e!="function")throw new TypeError(TG);t=mS(t)||0,AG(n)&&(d=!!n.leading,f="maxWait"in n,a=f?CG(mS(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p);function h(w){var k=r,N=i;return r=i=void 0,u=w,o=e.apply(N,k),o}function g(w){return u=w,l=setTimeout(y,t),d?h(w):o}function m(w){var k=w-c,N=w-u,j=t-k;return f?OG(j,a-N):j}function v(w){var k=w-c,N=w-u;return c===void 0||k>=t||k<0||f&&N>=a}function y(){var w=Om();if(v(w))return b(w);l=setTimeout(y,m(w))}function b(w){return l=void 0,p&&r?h(w):(r=i=void 0,o)}function x(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function _(){return l===void 0?o:b(Om())}function S(){var w=Om(),k=v(w);if(r=arguments,i=this,c=w,k){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(y,t),h(c)}return l===void 0&&(l=setTimeout(y,t)),o}return S.cancel=x,S.flush=_,S}var MG=PG,RG=MG,IG=ua,$G="Expected a function";function LG(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError($G);return IG(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),RG(e,t,{leading:r,maxWait:t,trailing:i})}var DG=LG;const RC=Ye(DG);function Ec(e){"@babel/helpers - typeof";return Ec=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},Ec(e)}function gS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gS(Object(n),!0).forEach(function(r){BG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BG(e,t,n){return t=zG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zG(e){var t=FG(e,"string");return Ec(t)=="symbol"?t:t+""}function FG(e,t){if(Ec(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ec(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UG(e,t){return qG(e)||GG(e,t)||HG(e,t)||WG()}function WG(){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 HG(e,t){if(e){if(typeof e=="string")return yS(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 yS(e,t)}}function yS(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 GG(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 qG(e){if(Array.isArray(e))return e}var Pa=E.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,p=e.maxHeight,h=e.children,g=e.debounce,m=g===void 0?0:g,v=e.id,y=e.className,b=e.onResize,x=e.style,_=x===void 0?{}:x,S=E.useRef(null),w=E.useRef();w.current=b,E.useImperativeHandle(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),S.current},configurable:!0})});var k=E.useState({containerWidth:i.width,containerHeight:i.height}),N=UG(k,2),j=N[0],C=N[1],I=E.useCallback(function($,R){C(function(B){var L=Math.round($),U=Math.round(R);return B.containerWidth===L&&B.containerHeight===U?B:{containerWidth:L,containerHeight:U}})},[]);E.useEffect(function(){var $=function(z){var T,V=z[0].contentRect,q=V.width,P=V.height;I(q,P),(T=w.current)===null||T===void 0||T.call(w,q,P)};m>0&&($=RC($,m,{trailing:!0,leading:!1}));var R=new ResizeObserver($),B=S.current.getBoundingClientRect(),L=B.width,U=B.height;return I(L,U),R.observe(S.current),function(){R.disconnect()}},[I,m]);var M=E.useMemo(function(){var $=j.containerWidth,R=j.containerHeight;if($<0||R<0)return null;ci(Da(o)||Da(c),`The width(%s) and height(%s) are both fixed numbers,
81
- maybe you don't need to use a ResponsiveContainer.`,o,c),ci(!n||n>0,"The aspect(%s) must be greater than zero.",n);var B=Da(o)?$:o,L=Da(c)?R:c;n&&n>0&&(B?L=B/n:L&&(B=L*n),p&&L>p&&(L=p)),ci(B>0||L>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.`,B,L,o,c,d,f,n);var U=!Array.isArray(h)&&li(h.type).endsWith("Chart");return W.Children.map(h,function(O){return W.isValidElement(O)?E.cloneElement(O,nd({width:B,height:L},U?{style:nd({height:"100%",width:"100%",maxHeight:L,maxWidth:B},O.props.style)}:{})):O})},[n,h,c,p,f,d,j,o]);return W.createElement("div",{id:v?"".concat(v):void 0,className:qe("recharts-responsive-container",y),style:nd(nd({},_),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:p}),ref:S},M)}),Nc=function(t){return null};Nc.displayName="Cell";function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function vS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vS(Object(n),!0).forEach(function(r){KG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KG(e,t,n){return t=VG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VG(e){var t=YG(e,"string");return jc(t)=="symbol"?t:t+""}function YG(e,t){if(jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ao={widthCache:{},cacheCount:0},XG=2e3,ZG={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},bS="recharts_measurement_span";function QG(e){var t=qy({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Vl=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=QG(n),i=JSON.stringify({text:t,copyStyle:r});if(Ao.widthCache[i])return Ao.widthCache[i];try{var a=document.getElementById(bS);a||(a=document.createElement("span"),a.setAttribute("id",bS),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=qy(qy({},ZG),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Ao.widthCache[i]=c,++Ao.cacheCount>XG&&(Ao.cacheCount=0,Ao.widthCache={}),c}catch{return{width:0,height:0}}},JG=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Ac(e){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(e)}function Cf(e,t){return rq(e)||nq(e,t)||tq(e,t)||eq()}function eq(){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 tq(e,t){if(e){if(typeof e=="string")return xS(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 xS(e,t)}}function xS(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 nq(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 iq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wS(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,oq(r.key),r)}}function aq(e,t,n){return t&&wS(e.prototype,t),n&&wS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oq(e){var t=sq(e,"string");return Ac(t)=="symbol"?t:t+""}function sq(e,t){if(Ac(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ac(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var SS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,kS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,lq=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,cq=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,IC={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},uq=Object.keys(IC),Xo="NaN";function dq(e,t){return e*IC[t]}var rd=function(){function e(t,n){iq(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!lq.test(n)&&(this.num=NaN,this.unit=""),uq.includes(n)&&(this.num=dq(t,n),this.unit="px")}return aq(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=cq.exec(n))!==null&&r!==void 0?r:[],a=Cf(i,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function $C(e){if(e.includes(Xo))return Xo;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=SS.exec(t))!==null&&n!==void 0?n:[],i=Cf(r,4),a=i[1],o=i[2],l=i[3],c=rd.parse(a??""),u=rd.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return Xo;t=t.replace(SS,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,p=(f=kS.exec(t))!==null&&f!==void 0?f:[],h=Cf(p,4),g=h[1],m=h[2],v=h[3],y=rd.parse(g??""),b=rd.parse(v??""),x=m==="+"?y.add(b):y.subtract(b);if(x.isNaN())return Xo;t=t.replace(kS,x.toString())}return t}var _S=/\(([^()]*)\)/;function fq(e){for(var t=e;t.includes("(");){var n=_S.exec(t),r=Cf(n,2),i=r[1];t=t.replace(_S,$C(i))}return t}function pq(e){var t=e.replace(/\s+/g,"");return t=fq(t),t=$C(t),t}function hq(e){try{return pq(e)}catch{return Xo}}function Pm(e){var t=hq(e.slice(5,-1));return t===Xo?"":t}var mq=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],gq=["dx","dy","angle","className","breakAll"];function Ky(){return Ky=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ky.apply(this,arguments)}function ES(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={};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 NS(e,t){return wq(e)||xq(e,t)||bq(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 bq(e,t){if(e){if(typeof e=="string")return jS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jS(e,t)}}function jS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function 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 wq(e){if(Array.isArray(e))return e}var LC=/[ \f\n\r\t\v\u2028\u2029]+/,DC=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var a=[];Ke(n)||(r?a=n.toString().split(""):a=n.toString().split(LC));var o=a.map(function(c){return{word:c,width:Vl(c,i).width}}),l=r?0:Vl("ย ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},Sq=function(t,n,r,i,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=se(o),f=l,p=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return B.reduce(function(L,U){var O=U.word,z=U.width,T=L[L.length-1];if(T&&(i==null||a||T.width+z+r<Number(i)))T.words.push(O),T.width+=z+r;else{var V={words:[O],width:z};L.push(V)}return L},[])},h=p(n),g=function(B){return B.reduce(function(L,U){return L.width>U.width?L:U})};if(!d)return h;for(var m="โ€ฆ",v=function(B){var L=f.slice(0,B),U=DC({breakAll:u,style:c,children:L+m}).wordsWithComputedWidth,O=p(U),z=O.length>o||g(O).width>Number(i);return[z,O]},y=0,b=f.length-1,x=0,_;y<=b&&x<=f.length-1;){var S=Math.floor((y+b)/2),w=S-1,k=v(w),N=NS(k,2),j=N[0],C=N[1],I=v(S),M=NS(I,1),$=M[0];if(!j&&!$&&(y=S+1),j&&$&&(b=S-1),!j&&$){_=C;break}x++}return _||h},AS=function(t){var n=Ke(t)?[]:t.toString().split(LC);return[{words:n}]},kq=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=DC({breakAll:o,children:i,style:a});if(d){var f=d.wordsWithComputedWidth,p=d.spaceWidth;c=f,u=p}else return AS(i);return Sq({breakAll:o,children:i,maxLines:l,style:a},c,u,n,r)}return AS(i)},TS="#808080",Of=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,p=t.textAnchor,h=p===void 0?"start":p,g=t.verticalAnchor,m=g===void 0?"end":g,v=t.fill,y=v===void 0?TS:v,b=ES(t,mq),x=E.useMemo(function(){return kq({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]),_=b.dx,S=b.dy,w=b.angle,k=b.className,N=b.breakAll,j=ES(b,gq);if(!Ut(r)||!Ut(a))return null;var C=r+(se(_)?_:0),I=a+(se(S)?S:0),M;switch(m){case"start":M=Pm("calc(".concat(u,")"));break;case"middle":M=Pm("calc(".concat((x.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:M=Pm("calc(".concat(x.length-1," * -").concat(l,")"));break}var $=[];if(f){var R=x[0].width,B=b.width;$.push("scale(".concat((se(B)?B/R:1)/R,")"))}return w&&$.push("rotate(".concat(w,", ").concat(C,", ").concat(I,")")),$.length&&(j.transform=$.join(" ")),W.createElement("text",Ky({},Ge(j,!0),{x:C,y:I,className:qe("recharts-text",k),textAnchor:h,fill:y.includes("url")?TS:y}),x.map(function(L,U){var O=L.words.join(N?"":" ");return W.createElement("tspan",{x:C,dy:U===0?M:l,key:"".concat(O,"-").concat(U)},O)}))};function ta(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _q(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ex(e){let t,n,r;e.length!==2?(t=ta,n=(l,c)=>ta(e(l),c),r=(l,c)=>e(l)-c):(t=e===ta||e===_q?e:Eq,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 Eq(){return 0}function BC(e){return e===null?NaN:+e}function*Nq(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const jq=Ex(ta),gu=jq.right;Ex(BC).center;class CS extends Map{constructor(t,n=Cq){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(OS(this,t))}has(t){return super.has(OS(this,t))}set(t,n){return super.set(Aq(this,t),n)}delete(t){return super.delete(Tq(this,t))}}function OS({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Aq({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Tq({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Cq(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Oq(e=ta){if(e===ta)return zC;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 zC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Pq=Math.sqrt(50),Mq=Math.sqrt(10),Rq=Math.sqrt(2);function Pf(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>=Pq?10:a>=Mq?5:a>=Rq?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?Pf(e,t,n*2):[l,c,u]}function Vy(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?Pf(t,e,n):Pf(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 Yy(e,t,n){return t=+t,e=+e,n=+n,Pf(e,t,n)[2]}function Xy(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Yy(t,e,n):Yy(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function PS(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function MS(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function FC(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?zC:Oq(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),p=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/c+p)),g=Math.min(r,Math.floor(t+(c-u)*f/c+p));FC(e,t,h,g,i)}const a=e[t];let o=n,l=r;for(Sl(e,n,t),i(e[r],a)>0&&Sl(e,n,r);o<l;){for(Sl(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?Sl(e,n,l):(++l,Sl(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Sl(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Iq(e,t,n){if(e=Float64Array.from(Nq(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return MS(e);if(t>=1)return PS(e);var r,i=(r-1)*t,a=Math.floor(i),o=PS(FC(e,a).subarray(0,a+1)),l=MS(e.subarray(a+1));return o+(l-o)*(i-a)}}function $q(e,t,n=BC){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 Lq(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 hr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Si(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 Zy=Symbol("implicit");function Nx(){var e=new CS,t=[],n=[],r=Zy;function i(a){let o=e.get(a);if(o===void 0){if(r!==Zy)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 CS;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 Nx(t,n).unknown(r)},hr.apply(i,arguments),i}function Tc(){var e=Nx().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 p=t().length,h=i<r,g=h?i:r,m=h?r:i;a=(m-g)/Math.max(1,p-c+u*2),l&&(a=Math.floor(a)),g+=(m-g-a*(p-c))*d,o=a*(1-c),l&&(g=Math.round(g),o=Math.round(o));var v=Lq(p).map(function(y){return g+a*y});return n(h?v.reverse():v)}return e.domain=function(p){return arguments.length?(t(p),f()):t()},e.range=function(p){return arguments.length?([r,i]=p,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(p){return[r,i]=p,r=+r,i=+i,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(p){return arguments.length?(l=!!p,f()):l},e.padding=function(p){return arguments.length?(c=Math.min(1,u=+p),f()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),f()):c},e.paddingOuter=function(p){return arguments.length?(u=+p,f()):u},e.align=function(p){return arguments.length?(d=Math.max(0,Math.min(1,p)),f()):d},e.copy=function(){return Tc(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(d)},hr.apply(f(),arguments)}function UC(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return UC(t())},e}function Yl(){return UC(Tc.apply(null,arguments).paddingInner(1))}function jx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function WC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yu(){}var Cc=.7,Mf=1/Cc,ss="\\s*([+-]?\\d+)\\s*",Oc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dq=/^#([0-9a-f]{3,8})$/,Bq=new RegExp(`^rgb\\(${ss},${ss},${ss}\\)$`),zq=new RegExp(`^rgb\\(${Hr},${Hr},${Hr}\\)$`),Fq=new RegExp(`^rgba\\(${ss},${ss},${ss},${Oc}\\)$`),Uq=new RegExp(`^rgba\\(${Hr},${Hr},${Hr},${Oc}\\)$`),Wq=new RegExp(`^hsl\\(${Oc},${Hr},${Hr}\\)$`),Hq=new RegExp(`^hsla\\(${Oc},${Hr},${Hr},${Oc}\\)$`),RS={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};jx(yu,Pc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:IS,formatHex:IS,formatHex8:Gq,formatHsl:qq,formatRgb:$S,toString:$S});function IS(){return this.rgb().formatHex()}function Gq(){return this.rgb().formatHex8()}function qq(){return HC(this).formatHsl()}function $S(){return this.rgb().formatRgb()}function Pc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Dq.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?LS(t):n===3?new Pn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?id(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?id(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=Bq.exec(e))?new Pn(t[1],t[2],t[3],1):(t=zq.exec(e))?new Pn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Fq.exec(e))?id(t[1],t[2],t[3],t[4]):(t=Uq.exec(e))?id(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Wq.exec(e))?zS(t[1],t[2]/100,t[3]/100,1):(t=Hq.exec(e))?zS(t[1],t[2]/100,t[3]/100,t[4]):RS.hasOwnProperty(e)?LS(RS[e]):e==="transparent"?new Pn(NaN,NaN,NaN,0):null}function LS(e){return new Pn(e>>16&255,e>>8&255,e&255,1)}function id(e,t,n,r){return r<=0&&(e=t=n=NaN),new Pn(e,t,n,r)}function Kq(e){return e instanceof yu||(e=Pc(e)),e?(e=e.rgb(),new Pn(e.r,e.g,e.b,e.opacity)):new Pn}function Qy(e,t,n,r){return arguments.length===1?Kq(e):new Pn(e,t,n,r??1)}function Pn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jx(Pn,Qy,WC(yu,{brighter(e){return e=e==null?Mf:Math.pow(Mf,e),new Pn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cc:Math.pow(Cc,e),new Pn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pn(qa(this.r),qa(this.g),qa(this.b),Rf(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:DS,formatHex:DS,formatHex8:Vq,formatRgb:BS,toString:BS}));function DS(){return`#${Ba(this.r)}${Ba(this.g)}${Ba(this.b)}`}function Vq(){return`#${Ba(this.r)}${Ba(this.g)}${Ba(this.b)}${Ba((isNaN(this.opacity)?1:this.opacity)*255)}`}function BS(){const e=Rf(this.opacity);return`${e===1?"rgb(":"rgba("}${qa(this.r)}, ${qa(this.g)}, ${qa(this.b)}${e===1?")":`, ${e})`}`}function Rf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ba(e){return e=qa(e),(e<16?"0":"")+e.toString(16)}function zS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new kr(e,t,n,r)}function HC(e){if(e instanceof kr)return new kr(e.h,e.s,e.l,e.opacity);if(e instanceof yu||(e=Pc(e)),!e)return new kr;if(e instanceof kr)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 kr(o,l,c,e.opacity)}function Yq(e,t,n,r){return arguments.length===1?HC(e):new kr(e,t,n,r??1)}function kr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jx(kr,Yq,WC(yu,{brighter(e){return e=e==null?Mf:Math.pow(Mf,e),new kr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cc:Math.pow(Cc,e),new kr(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 Pn(Mm(e>=240?e-240:e+120,i,r),Mm(e,i,r),Mm(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new kr(FS(this.h),ad(this.s),ad(this.l),Rf(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=Rf(this.opacity);return`${e===1?"hsl(":"hsla("}${FS(this.h)}, ${ad(this.s)*100}%, ${ad(this.l)*100}%${e===1?")":`, ${e})`}`}}));function FS(e){return e=(e||0)%360,e<0?e+360:e}function ad(e){return Math.max(0,Math.min(1,e||0))}function Mm(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 Ax=e=>()=>e;function Xq(e,t){return function(n){return e+n*t}}function Zq(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 Qq(e){return(e=+e)==1?GC:function(t,n){return n-t?Zq(t,n,e):Ax(isNaN(t)?n:t)}}function GC(e,t){var n=t-e;return n?Xq(e,n):Ax(isNaN(e)?t:e)}const US=function e(t){var n=Qq(t);function r(i,a){var o=n((i=Qy(i)).r,(a=Qy(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=GC(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 Jq(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 eK(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function tK(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]=tl(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 nK(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function If(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]=tl(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Jy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rm=new RegExp(Jy.source,"g");function iK(e){return function(){return e}}function aK(e){return function(t){return e(t)+""}}function oK(e,t){var n=Jy.lastIndex=Rm.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Jy.exec(e))&&(i=Rm.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:If(r,i)})),n=Rm.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?aK(c[0].x):iK(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 tl(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ax(t):(n==="number"?If:n==="string"?(r=Pc(t))?(t=r,US):oK:t instanceof Pc?US:t instanceof Date?nK:eK(t)?Jq:Array.isArray(t)?tK:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?rK:If)(e,t)}function Tx(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function sK(e,t){t===void 0&&(t=e,e=tl);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 lK(e){return function(){return e}}function $f(e){return+e}var WS=[0,1];function _n(e){return e}function ev(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:lK(isNaN(t)?NaN:.5)}function cK(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function uK(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=ev(i,r),a=n(o,a)):(r=ev(r,i),a=n(a,o)),function(l){return a(r(l))}}function dK(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]=ev(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=gu(e,l,1,r)-1;return a[c](i[c](l))}}function vu(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ph(){var e=WS,t=WS,n=tl,r,i,a,o=_n,l,c,u;function d(){var p=Math.min(e.length,t.length);return o!==_n&&(o=cK(e[0],e[p-1])),l=p>2?dK:uK,c=u=null,f}function f(p){return p==null||isNaN(p=+p)?a:(c||(c=l(e.map(r),t,n)))(r(o(p)))}return f.invert=function(p){return o(i((u||(u=l(t,e.map(r),If)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,$f),d()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),n=Tx,d()},f.clamp=function(p){return arguments.length?(o=p?!0:_n,d()):o!==_n},f.interpolate=function(p){return arguments.length?(n=p,d()):n},f.unknown=function(p){return arguments.length?(a=p,f):a},function(p,h){return r=p,i=h,d()}}function Cx(){return ph()(_n,_n)}function fK(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Lf(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 ks(e){return e=Lf(Math.abs(e)),e?e[1]:NaN}function pK(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 mK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Mc(e){if(!(t=mK.exec(e)))throw new Error("invalid format: "+e);var t;return new Ox({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]})}Mc.prototype=Ox.prototype;function Ox(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+""}Ox.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 gK(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 Df;function yK(e,t){var n=Lf(e,t);if(!n)return Df=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Df=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")+Lf(e,Math.max(0,t+a-1))[0]}function HS(e,t){var n=Lf(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 GS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:fK,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)=>HS(e*100,t),r:HS,s:yK,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qS(e){return e}var KS=Array.prototype.map,VS=["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?qS:pK(KS.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?qS:hK(KS.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,p){f=Mc(f);var h=f.fill,g=f.align,m=f.sign,v=f.symbol,y=f.zero,b=f.width,x=f.comma,_=f.precision,S=f.trim,w=f.type;w==="n"?(x=!0,w="g"):GS[w]||(_===void 0&&(_=12),S=!0,w="g"),(y||h==="0"&&g==="=")&&(y=!0,h="0",g="=");var k=(p&&p.prefix!==void 0?p.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),N=(v==="$"?r:/[%p]/.test(w)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),j=GS[w],C=/[defgprs%]/.test(w);_=_===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function I(M){var $=k,R=N,B,L,U;if(w==="c")R=j(M)+R,M="";else{M=+M;var O=M<0||1/M<0;if(M=isNaN(M)?c:j(Math.abs(M),_),S&&(M=gK(M)),O&&+M==0&&m!=="+"&&(O=!1),$=(O?m==="("?m:l:m==="-"||m==="("?"":m)+$,R=(w==="s"&&!isNaN(M)&&Df!==void 0?VS[8+Df/3]:"")+R+(O&&m==="("?")":""),C){for(B=-1,L=M.length;++B<L;)if(U=M.charCodeAt(B),48>U||U>57){R=(U===46?i+M.slice(B+1):M.slice(B))+R,M=M.slice(0,B);break}}}x&&!y&&(M=t(M,1/0));var z=$.length+M.length+R.length,T=z<b?new Array(b-z+1).join(h):"";switch(x&&y&&(M=t(T+M,T.length?b-R.length:1/0),T=""),g){case"<":M=$+M+R+T;break;case"=":M=$+T+M+R;break;case"^":M=T.slice(0,z=T.length>>1)+$+M+R+T.slice(z);break;default:M=T+$+M+R;break}return a(M)}return I.toString=function(){return f+""},I}function d(f,p){var h=Math.max(-8,Math.min(8,Math.floor(ks(p)/3)))*3,g=Math.pow(10,-h),m=u((f=Mc(f),f.type="f",f),{suffix:VS[8+h/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:d}}var od,Px,qC;bK({thousands:",",grouping:[3],currency:["$",""]});function bK(e){return od=vK(e),Px=od.format,qC=od.formatPrefix,od}function xK(e){return Math.max(0,-ks(Math.abs(e)))}function wK(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ks(t)/3)))*3-ks(Math.abs(e)))}function SK(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ks(t)-ks(e))+1}function KC(e,t,n,r){var i=Xy(e,t,n),a;switch(r=Mc(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=wK(i,o))&&(r.precision=a),qC(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=SK(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 Px(r)}function fa(e){var t=e.domain;return e.ticks=function(n){var r=t();return Vy(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return KC(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=Yy(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 Bf(){var e=Cx();return e.copy=function(){return vu(e,Bf())},hr.apply(e,arguments),fa(e)}function VC(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,$f),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return VC(e).unknown(t)},e=arguments.length?Array.from(e,$f):[0,1],fa(n)}function YC(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 YS(e){return Math.log(e)}function XS(e){return Math.exp(e)}function kK(e){return-Math.log(-e)}function _K(e){return-Math.exp(-e)}function EK(e){return isFinite(e)?+("1e"+e):e<0?0:e}function NK(e){return e===10?EK:e===Math.E?Math.exp:t=>Math.pow(e,t)}function jK(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 ZS(e){return(t,n)=>-e(-t,n)}function Mx(e){const t=e(YS,XS),n=t.domain;let r=10,i,a;function o(){return i=jK(r),a=NK(r),n()[0]<0?(i=ZS(i),a=ZS(a),e(kK,_K)):e(YS,XS),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 p=i(u),h=i(d),g,m;const v=l==null?10:+l;let y=[];if(!(r%1)&&h-p<v){if(p=Math.floor(p),h=Math.ceil(h),u>0){for(;p<=h;++p)for(g=1;g<r;++g)if(m=p<0?g/a(-p):g*a(p),!(m<u)){if(m>d)break;y.push(m)}}else for(;p<=h;++p)for(g=r-1;g>=1;--g)if(m=p>0?g/a(-p):g*a(p),!(m<u)){if(m>d)break;y.push(m)}y.length*2<v&&(y=Vy(u,d,v))}else y=Vy(p,h,Math.min(h-p,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=Mc(c)).precision==null&&(c.trim=!0),c=Px(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(YC(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function XC(){const e=Mx(ph()).domain([1,10]);return e.copy=()=>vu(e,XC()).base(e.base()),hr.apply(e,arguments),e}function QS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function JS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Rx(e){var t=1,n=e(QS(t),JS(t));return n.constant=function(r){return arguments.length?e(QS(t=+r),JS(t)):t},fa(n)}function ZC(){var e=Rx(ph());return e.copy=function(){return vu(e,ZC()).constant(e.constant())},hr.apply(e,arguments)}function ek(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function AK(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function TK(e){return e<0?-e*e:e*e}function Ix(e){var t=e(_n,_n),n=1;function r(){return n===1?e(_n,_n):n===.5?e(AK,TK):e(ek(n),ek(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},fa(t)}function $x(){var e=Ix(ph());return e.copy=function(){return vu(e,$x()).exponent(e.exponent())},hr.apply(e,arguments),e}function CK(){return $x.apply(null,arguments).exponent(.5)}function tk(e){return Math.sign(e)*e*e}function OK(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function QC(){var e=Cx(),t=[0,1],n=!1,r;function i(a){var o=OK(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(tk(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,$f)).map(tk)),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 QC(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},hr.apply(i,arguments),fa(i)}function JC(){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]=$q(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[gu(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(ta),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 JC().domain(e).range(t).unknown(r)},hr.apply(a,arguments)}function eO(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[gu(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 eO().domain([e,t]).range(i).unknown(a)},hr.apply(fa(o),arguments)}function tO(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[gu(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 tO().domain(e).range(t).unknown(n)},hr.apply(i,arguments)}const Im=new Date,$m=new Date;function Wt(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o<l-a?o:l},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},i.filter=a=>Wt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(Im.setTime(+a),$m.setTime(+o),e(Im),e($m),Math.floor(n(Im,$m))),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 zf=Wt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);zf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):zf);zf.range;const ii=1e3,sr=ii*60,ai=sr*60,mi=ai*24,Lx=mi*7,nk=mi*30,Lm=mi*365,za=Wt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ii)},(e,t)=>(t-e)/ii,e=>e.getUTCSeconds());za.range;const Dx=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ii)},(e,t)=>{e.setTime(+e+t*sr)},(e,t)=>(t-e)/sr,e=>e.getMinutes());Dx.range;const Bx=Wt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*sr)},(e,t)=>(t-e)/sr,e=>e.getUTCMinutes());Bx.range;const zx=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ii-e.getMinutes()*sr)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getHours());zx.range;const Fx=Wt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getUTCHours());Fx.range;const bu=Wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*sr)/mi,e=>e.getDate()-1);bu.range;const hh=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mi,e=>e.getUTCDate()-1);hh.range;const nO=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mi,e=>Math.floor(e/mi));nO.range;function fo(e){return Wt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*sr)/Lx)}const mh=fo(0),Ff=fo(1),PK=fo(2),MK=fo(3),_s=fo(4),RK=fo(5),IK=fo(6);mh.range;Ff.range;PK.range;MK.range;_s.range;RK.range;IK.range;function po(e){return Wt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Lx)}const gh=po(0),Uf=po(1),$K=po(2),LK=po(3),Es=po(4),DK=po(5),BK=po(6);gh.range;Uf.range;$K.range;LK.range;Es.range;DK.range;BK.range;const Ux=Wt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Ux.range;const Wx=Wt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Wx.range;const gi=Wt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());gi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});gi.range;const yi=Wt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());yi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});yi.range;function rO(e,t,n,r,i,a){const o=[[za,1,ii],[za,5,5*ii],[za,15,15*ii],[za,30,30*ii],[a,1,sr],[a,5,5*sr],[a,15,15*sr],[a,30,30*sr],[i,1,ai],[i,3,3*ai],[i,6,6*ai],[i,12,12*ai],[r,1,mi],[r,2,2*mi],[n,1,Lx],[t,1,nk],[t,3,3*nk],[e,1,Lm]];function l(u,d,f){const p=d<u;p&&([u,d]=[d,u]);const h=f&&typeof f.range=="function"?f:c(u,d,f),g=h?h.range(u,+d+1):[];return p?g.reverse():g}function c(u,d,f){const p=Math.abs(d-u)/f,h=Ex(([,,v])=>v).right(o,p);if(h===o.length)return e.every(Xy(u/Lm,d/Lm,f));if(h===0)return zf.every(Math.max(Xy(u,d,f),1));const[g,m]=o[p/o[h-1][2]<o[h][2]/p?h-1:h];return g.every(m)}return[l,c]}const[zK,FK]=rO(yi,Wx,gh,nO,Fx,Bx),[UK,WK]=rO(gi,Ux,mh,bu,zx,Dx);function Dm(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 Bm(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 kl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function HK(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=_l(i),d=El(i),f=_l(a),p=El(a),h=_l(o),g=El(o),m=_l(l),v=El(l),y=_l(c),b=El(c),x={a:U,A:O,b:z,B:T,c:null,d:lk,e:lk,f:p7,g:k7,G:E7,H:u7,I:d7,j:f7,L:iO,m:h7,M:m7,p:V,q,Q:dk,s:fk,S:g7,u:y7,U:v7,V:b7,w:x7,W:w7,x:null,X:null,y:S7,Y:_7,Z:N7,"%":uk},_={a:P,A:ce,b:me,B:ue,c:null,d:ck,e:ck,f:C7,g:z7,G:U7,H:j7,I:A7,j:T7,L:oO,m:O7,M:P7,p:He,q:Ce,Q:dk,s:fk,S:M7,u:R7,U:I7,V:$7,w:L7,W:D7,x:null,X:null,y:B7,Y:F7,Z:W7,"%":uk},S={a:C,A:I,b:M,B:$,c:R,d:ok,e:ok,f:o7,g:ak,G:ik,H:sk,I:sk,j:n7,L:a7,m:t7,M:r7,p:j,q:e7,Q:l7,s:c7,S:i7,u:YK,U:XK,V:ZK,w:VK,W:QK,x:B,X:L,y:ak,Y:ik,Z:JK,"%":s7};x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),_.x=w(n,_),_.X=w(r,_),_.c=w(t,_);function w(te,ye){return function(be){var X=[],Ae=-1,we=0,Se=te.length,ge,De,le;for(be instanceof Date||(be=new Date(+be));++Ae<Se;)te.charCodeAt(Ae)===37&&(X.push(te.slice(we,Ae)),(De=rk[ge=te.charAt(++Ae)])!=null?ge=te.charAt(++Ae):De=ge==="e"?" ":"0",(le=ye[ge])&&(ge=le(be,De)),X.push(ge),we=Ae+1);return X.push(te.slice(we,Ae)),X.join("")}}function k(te,ye){return function(be){var X=kl(1900,void 0,1),Ae=N(X,te,be+="",0),we,Se;if(Ae!=be.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(ye&&!("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?(we=Bm(kl(X.y,0,1)),Se=we.getUTCDay(),we=Se>4||Se===0?Uf.ceil(we):Uf(we),we=hh.offset(we,(X.V-1)*7),X.y=we.getUTCFullYear(),X.m=we.getUTCMonth(),X.d=we.getUTCDate()+(X.w+6)%7):(we=Dm(kl(X.y,0,1)),Se=we.getDay(),we=Se>4||Se===0?Ff.ceil(we):Ff(we),we=bu.offset(we,(X.V-1)*7),X.y=we.getFullYear(),X.m=we.getMonth(),X.d=we.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),Se="Z"in X?Bm(kl(X.y,0,1)).getUTCDay():Dm(kl(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(Se+5)%7:X.w+X.U*7-(Se+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,Bm(X)):Dm(X)}}function N(te,ye,be,X){for(var Ae=0,we=ye.length,Se=be.length,ge,De;Ae<we;){if(X>=Se)return-1;if(ge=ye.charCodeAt(Ae++),ge===37){if(ge=ye.charAt(Ae++),De=S[ge in rk?ye.charAt(Ae++):ge],!De||(X=De(te,be,X))<0)return-1}else if(ge!=be.charCodeAt(X++))return-1}return X}function j(te,ye,be){var X=u.exec(ye.slice(be));return X?(te.p=d.get(X[0].toLowerCase()),be+X[0].length):-1}function C(te,ye,be){var X=h.exec(ye.slice(be));return X?(te.w=g.get(X[0].toLowerCase()),be+X[0].length):-1}function I(te,ye,be){var X=f.exec(ye.slice(be));return X?(te.w=p.get(X[0].toLowerCase()),be+X[0].length):-1}function M(te,ye,be){var X=y.exec(ye.slice(be));return X?(te.m=b.get(X[0].toLowerCase()),be+X[0].length):-1}function $(te,ye,be){var X=m.exec(ye.slice(be));return X?(te.m=v.get(X[0].toLowerCase()),be+X[0].length):-1}function R(te,ye,be){return N(te,t,ye,be)}function B(te,ye,be){return N(te,n,ye,be)}function L(te,ye,be){return N(te,r,ye,be)}function U(te){return o[te.getDay()]}function O(te){return a[te.getDay()]}function z(te){return c[te.getMonth()]}function T(te){return l[te.getMonth()]}function V(te){return i[+(te.getHours()>=12)]}function q(te){return 1+~~(te.getMonth()/3)}function P(te){return o[te.getUTCDay()]}function ce(te){return a[te.getUTCDay()]}function me(te){return c[te.getUTCMonth()]}function ue(te){return l[te.getUTCMonth()]}function He(te){return i[+(te.getUTCHours()>=12)]}function Ce(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var ye=w(te+="",x);return ye.toString=function(){return te},ye},parse:function(te){var ye=k(te+="",!1);return ye.toString=function(){return te},ye},utcFormat:function(te){var ye=w(te+="",_);return ye.toString=function(){return te},ye},utcParse:function(te){var ye=k(te+="",!0);return ye.toString=function(){return te},ye}}}var rk={"-":"",_:" ",0:"0"},Xt=/^\s*\d+/,GK=/^%/,qK=/[\\^$*+?|[\]().{}]/g;function We(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 KK(e){return e.replace(qK,"\\$&")}function _l(e){return new RegExp("^(?:"+e.map(KK).join("|")+")","i")}function El(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function VK(e,t,n){var r=Xt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function YK(e,t,n){var r=Xt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function XK(e,t,n){var r=Xt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ZK(e,t,n){var r=Xt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function QK(e,t,n){var r=Xt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ik(e,t,n){var r=Xt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ak(e,t,n){var r=Xt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function JK(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 e7(e,t,n){var r=Xt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function t7(e,t,n){var r=Xt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ok(e,t,n){var r=Xt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function n7(e,t,n){var r=Xt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function sk(e,t,n){var r=Xt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function r7(e,t,n){var r=Xt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function i7(e,t,n){var r=Xt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function a7(e,t,n){var r=Xt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function o7(e,t,n){var r=Xt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function s7(e,t,n){var r=GK.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function l7(e,t,n){var r=Xt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function c7(e,t,n){var r=Xt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function lk(e,t){return We(e.getDate(),t,2)}function u7(e,t){return We(e.getHours(),t,2)}function d7(e,t){return We(e.getHours()%12||12,t,2)}function f7(e,t){return We(1+bu.count(gi(e),e),t,3)}function iO(e,t){return We(e.getMilliseconds(),t,3)}function p7(e,t){return iO(e,t)+"000"}function h7(e,t){return We(e.getMonth()+1,t,2)}function m7(e,t){return We(e.getMinutes(),t,2)}function g7(e,t){return We(e.getSeconds(),t,2)}function y7(e){var t=e.getDay();return t===0?7:t}function v7(e,t){return We(mh.count(gi(e)-1,e),t,2)}function aO(e){var t=e.getDay();return t>=4||t===0?_s(e):_s.ceil(e)}function b7(e,t){return e=aO(e),We(_s.count(gi(e),e)+(gi(e).getDay()===4),t,2)}function x7(e){return e.getDay()}function w7(e,t){return We(Ff.count(gi(e)-1,e),t,2)}function S7(e,t){return We(e.getFullYear()%100,t,2)}function k7(e,t){return e=aO(e),We(e.getFullYear()%100,t,2)}function _7(e,t){return We(e.getFullYear()%1e4,t,4)}function E7(e,t){var n=e.getDay();return e=n>=4||n===0?_s(e):_s.ceil(e),We(e.getFullYear()%1e4,t,4)}function N7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+We(t/60|0,"0",2)+We(t%60,"0",2)}function ck(e,t){return We(e.getUTCDate(),t,2)}function j7(e,t){return We(e.getUTCHours(),t,2)}function A7(e,t){return We(e.getUTCHours()%12||12,t,2)}function T7(e,t){return We(1+hh.count(yi(e),e),t,3)}function oO(e,t){return We(e.getUTCMilliseconds(),t,3)}function C7(e,t){return oO(e,t)+"000"}function O7(e,t){return We(e.getUTCMonth()+1,t,2)}function P7(e,t){return We(e.getUTCMinutes(),t,2)}function M7(e,t){return We(e.getUTCSeconds(),t,2)}function R7(e){var t=e.getUTCDay();return t===0?7:t}function I7(e,t){return We(gh.count(yi(e)-1,e),t,2)}function sO(e){var t=e.getUTCDay();return t>=4||t===0?Es(e):Es.ceil(e)}function $7(e,t){return e=sO(e),We(Es.count(yi(e),e)+(yi(e).getUTCDay()===4),t,2)}function L7(e){return e.getUTCDay()}function D7(e,t){return We(Uf.count(yi(e)-1,e),t,2)}function B7(e,t){return We(e.getUTCFullYear()%100,t,2)}function z7(e,t){return e=sO(e),We(e.getUTCFullYear()%100,t,2)}function F7(e,t){return We(e.getUTCFullYear()%1e4,t,4)}function U7(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Es(e):Es.ceil(e),We(e.getUTCFullYear()%1e4,t,4)}function W7(){return"+0000"}function uk(){return"%"}function dk(e){return+e}function fk(e){return Math.floor(+e/1e3)}var To,lO,cO;H7({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 H7(e){return To=HK(e),lO=To.format,To.parse,cO=To.utcFormat,To.utcParse,To}function G7(e){return new Date(e)}function q7(e){return e instanceof Date?+e:+new Date(+e)}function Hx(e,t,n,r,i,a,o,l,c,u){var d=Cx(),f=d.invert,p=d.domain,h=u(".%L"),g=u(":%S"),m=u("%I:%M"),v=u("%I %p"),y=u("%a %d"),b=u("%b %d"),x=u("%B"),_=u("%Y");function S(w){return(c(w)<w?h:l(w)<w?g:o(w)<w?m:a(w)<w?v:r(w)<w?i(w)<w?y:b:n(w)<w?x:_)(w)}return d.invert=function(w){return new Date(f(w))},d.domain=function(w){return arguments.length?p(Array.from(w,q7)):p().map(G7)},d.ticks=function(w){var k=p();return e(k[0],k[k.length-1],w??10)},d.tickFormat=function(w,k){return k==null?S:u(k)},d.nice=function(w){var k=p();return(!w||typeof w.range!="function")&&(w=t(k[0],k[k.length-1],w??10)),w?p(YC(k,w)):d},d.copy=function(){return vu(d,Hx(e,t,n,r,i,a,o,l,c,u))},d}function K7(){return hr.apply(Hx(UK,WK,gi,Ux,mh,bu,zx,Dx,za,lO).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function V7(){return hr.apply(Hx(zK,FK,yi,Wx,gh,hh,Fx,Bx,za,cO).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function yh(){var e=0,t=1,n,r,i,a,o=_n,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(p){var h,g;return arguments.length?([h,g]=p,o=f(h,g),u):[o(0),o(1)]}}return u.range=d(tl),u.rangeRound=d(Tx),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 pa(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function uO(){var e=fa(yh()(_n));return e.copy=function(){return pa(e,uO())},Si.apply(e,arguments)}function dO(){var e=Mx(yh()).domain([1,10]);return e.copy=function(){return pa(e,dO()).base(e.base())},Si.apply(e,arguments)}function fO(){var e=Rx(yh());return e.copy=function(){return pa(e,fO()).constant(e.constant())},Si.apply(e,arguments)}function Gx(){var e=Ix(yh());return e.copy=function(){return pa(e,Gx()).exponent(e.exponent())},Si.apply(e,arguments)}function Y7(){return Gx.apply(null,arguments).exponent(.5)}function pO(){var e=[],t=_n;function n(r){if(r!=null&&!isNaN(r=+r))return t((gu(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(ta),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)=>Iq(e,a/r))},n.copy=function(){return pO(t).domain(e)},Si.apply(n,arguments)}function vh(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,u=_n,d,f=!1,p;function h(m){return isNaN(m=+m)?p:(m=.5+((m=+d(m))-a)*(r*m<r*a?l:c),u(f?Math.max(0,Math.min(1,m)):m))}h.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,h):[e,t,n]},h.clamp=function(m){return arguments.length?(f=!!m,h):f},h.interpolator=function(m){return arguments.length?(u=m,h):u};function g(m){return function(v){var y,b,x;return arguments.length?([y,b,x]=v,u=sK(m,[y,b,x]),h):[u(0),u(.5),u(1)]}}return h.range=g(tl),h.rangeRound=g(Tx),h.unknown=function(m){return arguments.length?(p=m,h):p},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,h}}function hO(){var e=fa(vh()(_n));return e.copy=function(){return pa(e,hO())},Si.apply(e,arguments)}function mO(){var e=Mx(vh()).domain([.1,1,10]);return e.copy=function(){return pa(e,mO()).base(e.base())},Si.apply(e,arguments)}function gO(){var e=Rx(vh());return e.copy=function(){return pa(e,gO()).constant(e.constant())},Si.apply(e,arguments)}function qx(){var e=Ix(vh());return e.copy=function(){return pa(e,qx()).exponent(e.exponent())},Si.apply(e,arguments)}function X7(){return qx.apply(null,arguments).exponent(.5)}const pk=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Tc,scaleDiverging:hO,scaleDivergingLog:mO,scaleDivergingPow:qx,scaleDivergingSqrt:X7,scaleDivergingSymlog:gO,scaleIdentity:VC,scaleImplicit:Zy,scaleLinear:Bf,scaleLog:XC,scaleOrdinal:Nx,scalePoint:Yl,scalePow:$x,scaleQuantile:JC,scaleQuantize:eO,scaleRadial:QC,scaleSequential:uO,scaleSequentialLog:dO,scaleSequentialPow:Gx,scaleSequentialQuantile:pO,scaleSequentialSqrt:Y7,scaleSequentialSymlog:fO,scaleSqrt:CK,scaleSymlog:ZC,scaleThreshold:tO,scaleTime:K7,scaleUtc:V7,tickFormat:KC},Symbol.toStringTag,{value:"Module"}));var Z7=Ks;function Q7(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&&!Z7(o):n(o,l)))var l=o,c=a}return c}var yO=Q7;function J7(e,t){return e>t}var eV=J7,tV=yO,nV=eV,rV=el;function iV(e){return e&&e.length?tV(e,rV,nV):void 0}var aV=iV;const bh=Ye(aV);function oV(e,t){return e<t}var sV=oV,lV=yO,cV=sV,uV=el;function dV(e){return e&&e.length?lV(e,uV,cV):void 0}var fV=dV;const xh=Ye(fV);var pV=ox,hV=da,mV=jC,gV=$n;function yV(e,t){var n=gV(e)?pV:mV;return n(e,hV(t))}var vV=yV,bV=EC,xV=vV;function wV(e,t){return bV(xV(e,t),1)}var SV=wV;const kV=Ye(SV);var _V=wx;function EV(e,t){return _V(e,t)}var NV=EV;const Kx=Ye(NV);var nl=1e9,jV={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Yx,gt=!0,fr="[DecimalError] ",Ka=fr+"Invalid argument: ",Vx=fr+"Exponent out of range: ",rl=Math.floor,Ta=Math.pow,AV=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Gn,qt=1e7,dt=7,vO=9007199254740991,Wf=rl(vO/dt),he={};he.absoluteValue=he.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};he.comparedTo=he.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};he.decimalPlaces=he.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*dt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};he.dividedBy=he.div=function(e){return ui(this,new this.constructor(e))};he.dividedToIntegerBy=he.idiv=function(e){var t=this,n=t.constructor;return rt(ui(t,new n(e),0,1),n.precision)};he.equals=he.eq=function(e){return!this.cmp(e)};he.exponent=function(){return Rt(this)};he.greaterThan=he.gt=function(e){return this.cmp(e)>0};he.greaterThanOrEqualTo=he.gte=function(e){return this.cmp(e)>=0};he.isInteger=he.isint=function(){return this.e>this.d.length-2};he.isNegative=he.isneg=function(){return this.s<0};he.isPositive=he.ispos=function(){return this.s>0};he.isZero=function(){return this.s===0};he.lessThan=he.lt=function(e){return this.cmp(e)<0};he.lessThanOrEqualTo=he.lte=function(e){return this.cmp(e)<1};he.logarithm=he.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(Gn))throw Error(fr+"NaN");if(n.s<1)throw Error(fr+(n.s?"NaN":"-Infinity"));return n.eq(Gn)?new r(0):(gt=!1,t=ui(Rc(n,a),Rc(e,a),a),gt=!0,rt(t,i))};he.minus=he.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?wO(t,e):bO(t,(e.s=-e.s,e))};he.modulo=he.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(fr+"NaN");return n.s?(gt=!1,t=ui(n,e,0,1).times(e),gt=!0,n.minus(t)):rt(new r(n),i)};he.naturalExponential=he.exp=function(){return xO(this)};he.naturalLogarithm=he.ln=function(){return Rc(this)};he.negated=he.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};he.plus=he.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?bO(t,e):wO(t,(e.s=-e.s,e))};he.precision=he.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ka+e);if(t=Rt(i)+1,r=i.d.length-1,n=r*dt+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};he.squareRoot=he.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(fr+"NaN")}for(e=Rt(l),gt=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Fr(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=rl((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(ui(l,a,o+2)).times(.5),Fr(a.d).slice(0,o)===(t=Fr(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(rt(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return gt=!0,rt(r,n)};he.times=he.mul=function(e){var t,n,r,i,a,o,l,c,u,d=this,f=d.constructor,p=d.d,h=(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=p.length,u=h.length,c<u&&(a=p,p=h,h=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]+h[r]*p[i-r-1]+t,a[i--]=l%qt|0,t=l/qt|0;a[i]=(a[i]+t)%qt|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,gt?rt(e,f.precision):e};he.toDecimalPlaces=he.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(qr(e,0,nl),t===void 0?t=r.rounding:qr(t,0,8),rt(n,e+Rt(n)+1,t))};he.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=io(r,!0):(qr(e,0,nl),t===void 0?t=i.rounding:qr(t,0,8),r=rt(new i(r),e+1,t),n=io(r,!0,e+1)),n};he.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?io(i):(qr(e,0,nl),t===void 0?t=a.rounding:qr(t,0,8),r=rt(new a(i),e+Rt(i)+1,t),n=io(r.abs(),!1,e+Rt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};he.toInteger=he.toint=function(){var e=this,t=e.constructor;return rt(new t(e),Rt(e)+1,t.rounding)};he.toNumber=function(){return+this};he.toPower=he.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(Gn);if(l=new c(l),!l.s){if(e.s<1)throw Error(fr+"Infinity");return l}if(l.eq(Gn))return l;if(r=c.precision,e.eq(Gn))return rt(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=vO){for(i=new c(Gn),t=Math.ceil(r/dt+4),gt=!1;n%2&&(i=i.times(l),mk(i.d,t)),n=rl(n/2),n!==0;)l=l.times(l),mk(l.d,t);return gt=!0,e.s<0?new c(Gn).div(i):rt(i,r)}}else if(a<0)throw Error(fr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,gt=!1,i=e.times(Rc(l,r+u)),gt=!0,i=xO(i),i.s=a,i};he.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Rt(i),r=io(i,n<=a.toExpNeg||n>=a.toExpPos)):(qr(e,1,nl),t===void 0?t=a.rounding:qr(t,0,8),i=rt(new a(i),e,t),n=Rt(i),r=io(i,e<=n||n<=a.toExpNeg,e)),r};he.toSignificantDigits=he.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(qr(e,1,nl),t===void 0?t=r.rounding:qr(t,0,8)),rt(new r(n),e,t)};he.toString=he.valueOf=he.val=he.toJSON=he[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Rt(e),n=e.constructor;return io(e,t<=n.toExpNeg||t>=n.toExpPos)};function bO(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)),gt?rt(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/dt),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)/qt|0,c[a]%=qt;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,gt?rt(t,f):t}function qr(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ka+e)}function Fr(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=dt-r.length,n&&(a+=Ii(n)),a+=r;o=e[t],r=o+"",n=dt-r.length,n&&(a+=Ii(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ui=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%qt|0,o=a/qt|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*qt+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,c,u,d,f,p,h,g,m,v,y,b,x,_,S,w,k,N,j=r.constructor,C=r.s==i.s?1:-1,I=r.d,M=i.d;if(!r.s)return new j(r);if(!i.s)throw Error(fr+"Division by zero");for(c=r.e-i.e,k=M.length,S=I.length,h=new j(C),g=h.d=[],u=0;M[u]==(I[u]||0);)++u;if(M[u]>(I[u]||0)&&--c,a==null?b=a=j.precision:o?b=a+(Rt(r)-Rt(i))+1:b=a,b<0)return new j(0);if(b=b/dt+2|0,u=0,k==1)for(d=0,M=M[0],b++;(u<S||d)&&b--;u++)x=d*qt+(I[u]||0),g[u]=x/M|0,d=x%M|0;else{for(d=qt/(M[0]+1)|0,d>1&&(M=e(M,d),I=e(I,d),k=M.length,S=I.length),_=k,m=I.slice(0,k),v=m.length;v<k;)m[v++]=0;N=M.slice(),N.unshift(0),w=M[0],M[1]>=qt/2&&++w;do d=0,l=t(M,m,k,v),l<0?(y=m[0],k!=v&&(y=y*qt+(m[1]||0)),d=y/w|0,d>1?(d>=qt&&(d=qt-1),f=e(M,d),p=f.length,v=m.length,l=t(f,m,p,v),l==1&&(d--,n(f,k<p?N:M,p))):(d==0&&(l=d=1),f=M.slice()),p=f.length,p<v&&f.unshift(0),n(m,f,v),l==-1&&(v=m.length,l=t(M,m,k,v),l<1&&(d++,n(m,k<v?N:M,v))),v=m.length):l===0&&(d++,m=[0]),g[u++]=d,l&&m[0]?m[v++]=I[_]||0:(m=[I[_]],v=1);while((_++<S||m[0]!==void 0)&&b--)}return g[0]||g.shift(),h.e=c,rt(h,o?a+Rt(h)+1:a)}}();function xO(e,t){var n,r,i,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Rt(e)>16)throw Error(Vx+Rt(e));if(!e.s)return new d(Gn);for(gt=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Ta(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(Gn),d.precision=l;;){if(i=rt(i.times(e),l),n=n.times(++c),o=a.plus(ui(i,n,l)),Fr(o.d).slice(0,l)===Fr(a.d).slice(0,l)){for(;u--;)a=rt(a.times(a),l);return d.precision=f,t==null?(gt=!0,rt(a,f)):a}a=o}}function Rt(e){for(var t=e.e*dt,n=e.d[0];n>=10;n/=10)t++;return t}function zm(e,t,n){if(t>e.LN10.sd())throw gt=!0,n&&(e.precision=n),Error(fr+"LN10 precision limit exceeded");return rt(new e(e.LN10),t)}function Ii(e){for(var t="";e--;)t+="0";return t}function Rc(e,t){var n,r,i,a,o,l,c,u,d,f=1,p=10,h=e,g=h.d,m=h.constructor,v=m.precision;if(h.s<1)throw Error(fr+(h.s?"NaN":"-Infinity"));if(h.eq(Gn))return new m(0);if(t==null?(gt=!1,u=v):u=t,h.eq(10))return t==null&&(gt=!0),zm(m,u);if(u+=p,m.precision=u,n=Fr(g),r=n.charAt(0),a=Rt(h),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=Fr(h.d),r=n.charAt(0),f++;a=Rt(h),r>1?(h=new m("0."+n),a++):h=new m(r+"."+n.slice(1))}else return c=zm(m,u+2,v).times(a+""),h=Rc(new m(r+"."+n.slice(1)),u-p).plus(c),m.precision=v,t==null?(gt=!0,rt(h,v)):h;for(l=o=h=ui(h.minus(Gn),h.plus(Gn),u),d=rt(h.times(h),u),i=3;;){if(o=rt(o.times(d),u),c=l.plus(ui(o,new m(i),u)),Fr(c.d).slice(0,u)===Fr(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(zm(m,u+2,v).times(a+""))),l=ui(l,new m(f),u),m.precision=v,t==null?(gt=!0,rt(l,v)):l;l=c,i+=2}}function hk(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=rl(n/dt),e.d=[],r=(n+1)%dt,n<0&&(r+=dt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=dt;r<i;)e.d.push(+t.slice(r,r+=dt));t=t.slice(r),r=dt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),gt&&(e.e>Wf||e.e<-Wf))throw Error(Vx+n)}else e.s=0,e.e=0,e.d=[0];return e}function rt(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+=dt,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/dt),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=dt,i=r-dt+o}if(n!==void 0&&(a=Ta(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/Ta(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Rt(e),f.length=1,t=t-a-1,f[0]=Ta(10,(dt-t%dt)%dt),e.e=rl(-t/dt)||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=Ta(10,dt-r),f[d]=i>0?(u/Ta(10,o-i)%Ta(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==qt&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=qt)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(gt&&(e.e>Wf||e.e<-Wf))throw Error(Vx+Rt(e));return e}function wO(e,t){var n,r,i,a,o,l,c,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),gt?rt(t,h):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(h/dt),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]=qt-1;--c[a],c[i]+=qt}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,gt?rt(t,h):t):new p(0)}function io(e,t,n){var r,i=Rt(e),a=Fr(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ii(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ii(-i-1)+a,n&&(r=n-o)>0&&(a+=Ii(r))):i>=o?(a+=Ii(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Ii(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Ii(r))),e.s<0?"-"+a:a}function mk(e,t){if(e.length>t)return e.length=t,!0}function SO(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(Ka+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 hk(o,a.toString())}else if(typeof a!="string")throw Error(Ka+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,AV.test(a))hk(o,a);else throw Error(Ka+a)}if(i.prototype=he,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=SO,i.config=i.set=TV,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 TV(e){if(!e||typeof e!="object")throw Error(fr+"Object expected");var t,n,r,i=["precision",1,nl,"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(rl(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Ka+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ka+n+": "+r);return this}var Yx=SO(jV);Gn=new Yx(1);const et=Yx;function CV(e){return RV(e)||MV(e)||PV(e)||OV()}function OV(){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 PV(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 MV(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function RV(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}var IV=function(t){return t},kO={},_O=function(t){return t===kO},gk=function(t){return function n(){return arguments.length===0||arguments.length===1&&_O(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},$V=function e(t,n){return t===1?n:gk(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!==kO}).length;return o>=t?n.apply(void 0,i):e(t-o,gk(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 _O(f)?c.shift():f});return n.apply(void 0,CV(d).concat(c))}))})},wh=function(t){return $V(t.length,t)},nv=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},LV=wh(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),DV=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return IV;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))}},rv=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},EO=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 BV(e){var t;return e===0?t=1:t=Math.floor(new et(e).abs().log(10).toNumber())+1,t}function zV(e,t,n){for(var r=new et(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var FV=wh(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),UV=wh(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),WV=wh(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Sh={rangeStep:zV,getDigitCount:BV,interpolateNumber:FV,uninterpolateNumber:UV,uninterpolateTruncation:WV};function iv(e){return qV(e)||GV(e)||NO(e)||HV()}function HV(){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 GV(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function qV(e){if(Array.isArray(e))return av(e)}function Ic(e,t){return YV(e)||VV(e,t)||NO(e,t)||KV()}function KV(){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 NO(e,t){if(e){if(typeof e=="string")return av(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 av(e,t)}}function av(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 VV(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 YV(e){if(Array.isArray(e))return e}function jO(e){var t=Ic(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function AO(e,t,n){if(e.lte(0))return new et(0);var r=Sh.getDigitCount(e.toNumber()),i=new et(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new et(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?c:new et(Math.ceil(c))}function XV(e,t,n){var r=1,i=new et(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new et(10).pow(Sh.getDigitCount(e)-1),i=new et(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new et(Math.floor(e)))}else e===0?i=new et(Math.floor((t-1)/2)):n||(i=new et(Math.floor(e)));var o=Math.floor((t-1)/2),l=DV(LV(function(c){return i.add(new et(c-o).mul(r)).toNumber()}),nv);return l(0,t)}function TO(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 et(0),tickMin:new et(0),tickMax:new et(0)};var a=AO(new et(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new et(0):(o=new et(e).add(t).div(2),o=o.sub(new et(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new et(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?TO(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 et(l).mul(a)),tickMax:o.add(new et(c).mul(a))})}function ZV(e){var t=Ic(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=Ic(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(iv(nv(0,i-1).map(function(){return 1/0}))):[].concat(iv(nv(0,i-1).map(function(){return-1/0})),[d]);return n>r?rv(f):f}if(u===d)return XV(u,i,a);var p=TO(u,d,o,a),h=p.step,g=p.tickMin,m=p.tickMax,v=Sh.rangeStep(g,m.add(new et(.1).mul(h)),h);return n>r?rv(v):v}function QV(e,t){var n=Ic(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=jO([r,i]),l=Ic(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=AO(new et(u).sub(c).div(d-1),a,0),p=[].concat(iv(Sh.rangeStep(new et(c),new et(u).sub(new et(.99).mul(f)),f)),[u]);return r>i?rv(p):p}var JV=EO(ZV),eY=EO(QV),tY="Invariant failed";function ao(e,t){throw new Error(tY)}var nY=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ns(e){"@babel/helpers - typeof";return Ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ns(e)}function Hf(){return Hf=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},Hf.apply(this,arguments)}function rY(e,t){return sY(e)||oY(e,t)||aY(e,t)||iY()}function iY(){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 aY(e,t){if(e){if(typeof e=="string")return yk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yk(e,t)}}function yk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oY(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 sY(e){if(Array.isArray(e))return e}function lY(e,t){if(e==null)return{};var n=cY(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 cY(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 uY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dY(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,PO(r.key),r)}}function fY(e,t,n){return t&&dY(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pY(e,t,n){return t=Gf(t),hY(e,CO()?Reflect.construct(t,n||[],Gf(e).constructor):t.apply(e,n))}function hY(e,t){if(t&&(Ns(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mY(e)}function mY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CO=function(){return!!e})()}function Gf(e){return Gf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gf(e)}function gY(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 OO(e,t,n){return t=PO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PO(e){var t=yY(e,"string");return Ns(t)=="symbol"?t:t+""}function yY(e,t){if(Ns(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ns(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kh=function(e){function t(){return uY(this,t),pY(this,t,arguments)}return gY(t,e),fY(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,p=lY(r,nY),h=Ge(p,!1);this.props.direction==="x"&&d.type!=="number"&&ao();var g=c.map(function(m){var v=u(m,l),y=v.x,b=v.y,x=v.value,_=v.errorVal;if(!_)return null;var S=[],w,k;if(Array.isArray(_)){var N=rY(_,2);w=N[0],k=N[1]}else w=k=_;if(a==="vertical"){var j=d.scale,C=b+i,I=C+o,M=C-o,$=j(x-w),R=j(x+k);S.push({x1:R,y1:I,x2:R,y2:M}),S.push({x1:$,y1:C,x2:R,y2:C}),S.push({x1:$,y1:I,x2:$,y2:M})}else if(a==="horizontal"){var B=f.scale,L=y+i,U=L-o,O=L+o,z=B(x-w),T=B(x+k);S.push({x1:U,y1:T,x2:O,y2:T}),S.push({x1:L,y1:z,x2:L,y2:T}),S.push({x1:U,y1:z,x2:O,y2:z})}return W.createElement(Vt,Hf({className:"recharts-errorBar",key:"bar-".concat(S.map(function(V){return"".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))},h),S.map(function(V){return W.createElement("line",Hf({},V,{key:"line-".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))}))});return W.createElement(Vt,{className:"recharts-errorBars"},g)}}])}(W.Component);OO(kh,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});OO(kh,"displayName","ErrorBar");function $c(e){"@babel/helpers - typeof";return $c=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},$c(e)}function vk(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 Sa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vk(Object(n),!0).forEach(function(r){vY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vY(e,t,n){return t=bY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bY(e){var t=xY(e,"string");return $c(t)=="symbol"?t:t+""}function xY(e,t){if($c(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MO=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,o=Hn(n,Ga);if(!o)return null;var l=Ga.defaultProps,c=l!==void 0?Sa(Sa({},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 p=f.item,h=f.props,g=h.sectors||h.data||[];return d.concat(g.map(function(m){return{type:o.props.iconType||p.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(d){var f=d.item,p=f.type.defaultProps,h=p!==void 0?Sa(Sa({},p),f.props):{},g=h.dataKey,m=h.name,v=h.legendType,y=h.hide;return{inactive:y,dataKey:g,type:c.iconType||v||"square",color:Xx(f),value:m||g,payload:h}}),Sa(Sa(Sa({},c),Ga.getWithHeight(o,i)),{},{payload:u,item:o})};function Lc(e){"@babel/helpers - typeof";return Lc=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},Lc(e)}function bk(e){return _Y(e)||kY(e)||SY(e)||wY()}function wY(){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 SY(e,t){if(e){if(typeof e=="string")return sv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sv(e,t)}}function kY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _Y(e){if(Array.isArray(e))return sv(e)}function sv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}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 Et(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){ls(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 ls(e,t,n){return t=EY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EY(e){var t=NY(e,"string");return Lc(t)=="symbol"?t:t+""}function NY(e,t){if(Lc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kr(e,t,n){return Ke(e)||Ke(t)?n:Ut(t)?cr(e,t,n):Ie(t)?t(e):n}function Xl(e,t,n,r){var i=kV(e,function(l){return Kr(l,t)});if(n==="number"){var a=i.filter(function(l){return se(l)||parseFloat(l)});return a.length?[xh(a),bh(a)]:[1/0,-1/0]}var o=r?i.filter(function(l){return!Ke(l)}):i;return o.map(function(l){return Ut(l)||l instanceof Date?l:""})}var jY=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,p=u>=l-1?i[0].coordinate:i[u+1].coordinate,h=void 0;if(_r(f-d)!==_r(p-f)){var g=[];if(_r(p-f)===_r(c[1]-c[0])){h=p;var m=f+c[1]-c[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{h=d;var v=p+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,(h+f)/2),Math.max(f,(h+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,p),x=Math.max(d,p);if(t>(b+f)/2&&t<=(x+f)/2){o=i[u].index;break}}}else for(var _=0;_<l;_++)if(_===0&&t<=(r[_].coordinate+r[_+1].coordinate)/2||_>0&&_<l-1&&t>(r[_].coordinate+r[_-1].coordinate)/2&&t<=(r[_].coordinate+r[_+1].coordinate)/2||_===l-1&&t>(r[_].coordinate+r[_-1].coordinate)/2){o=r[_].index;break}return o},Xx=function(t){var n,r=t,i=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Et(Et({},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},AY=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),p=0,h=f.length;p<h;p++){var g=d[f[p]],m=g.items,v=g.cateAxisId,y=m.filter(function(k){return li(k.type).indexOf("Bar")>=0});if(y&&y.length){var b=y[0].type.defaultProps,x=b!==void 0?Et(Et({},b),y[0].props):y[0].props,_=x.barSize,S=x[v];o[S]||(o[S]=[]);var w=Ke(_)?n:_;o[S].push({item:y[0],stackList:y.slice(1),barSize:Ke(w)?void 0:ro(w,r,0)})}}return o},TY=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=ro(n,i,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=i/c,g=o.reduce(function(_,S){return _+S.barSize||0},0);g+=(c-1)*u,g>=i&&(g-=(c-1)*u,u=0),g>=i&&h>0&&(p=!0,h*=.9,g=c*h);var m=(i-g)/2>>0,v={offset:m-u,size:0};d=o.reduce(function(_,S){var w={item:S.item,position:{offset:v.offset+v.size+u,size:p?h:S.barSize}},k=[].concat(bk(_),[w]);return v=k[k.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(N){k.push({item:N,position:v})}),k},f)}else{var y=ro(r,i,0,!0);i-2*y-(c-1)*u<=0&&(u=0);var b=(i-2*y-(c-1)*u)/c;b>1&&(b>>=0);var x=l===+l?Math.min(b,l):b;d=o.reduce(function(_,S,w){var k=[].concat(bk(_),[{item:S.item,position:{offset:y+(b+u)*w+(b-x)/2,size:x}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(N){k.push({item:N,position:k[k.length-1].position})}),k},f)}return d},CY=function(t,n,r,i){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=MO({children:a,legendWidth:c});if(u){var d=i||{},f=d.width,p=d.height,h=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&h!=="center"&&se(t[h]))return Et(Et({},t),{},ls({},h,t[h]+(f||0)));if((m==="horizontal"||m==="vertical"&&h==="center")&&g!=="middle"&&se(t[g]))return Et(Et({},t),{},ls({},g,t[g]+(p||0)))}return t},OY=function(t,n,r){return Ke(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},RO=function(t,n,r,i,a){var o=n.props.children,l=jr(o,kh).filter(function(u){return OY(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=Kr(d,r);if(Ke(f))return u;var p=Array.isArray(f)?[xh(f),bh(f)]:[f,f],h=c.reduce(function(g,m){var v=Kr(d,m,0),y=p[0]-Math.abs(Array.isArray(v)?v[0]:v),b=p[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(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},PY=function(t,n,r,i,a){var o=n.map(function(l){return RO(t,l,r,a,i)}).filter(function(l){return!Ke(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},IO=function(t,n,r,i,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&RO(t,c,u,i)||Xl(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},[])},$O=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},LO=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},oi=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?_r(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var p=a?a.indexOf(f):f;return{coordinate:i(p)+u,value:f,offset:u}});return d.filter(function(f){return!pu(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,p){return{coordinate:i(f)+u,value:f,index:p,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,p){return{coordinate:i(f)+u,value:a?a[f]:f,index:p,offset:u}})},Fm=new WeakMap,sd=function(t,n){if(typeof n!="function")return t;Fm.has(t)||Fm.set(t,new WeakMap);var r=Fm.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},MY=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:Tc(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:Bf(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Yl(),realScaleType:"point"}:a==="category"?{scale:Tc(),realScaleType:"band"}:{scale:Bf(),realScaleType:"linear"};if(no(i)){var c="scale".concat(oh(i));return{scale:(pk[c]||Yl)(),realScaleType:pk[c]?c:"point"}}return Ie(i)?{scale:i}:{scale:Yl(),realScaleType:"point"}},wk=1e-4,RY=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])-wk,o=Math.max(i[0],i[1])+wk,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},IY=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},$Y=function(t,n){if(!n||n.length!==2||!se(n[0])||!se(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(!se(t[0])||t[0]<r)&&(a[0]=r),(!se(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},LY=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])}},DY=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)}},BY={sign:LY,expand:e6,none:vs,silhouette:t6,wiggle:n6,positive:DY},zY=function(t,n,r){var i=n.map(function(l){return l.props.dataKey}),a=BY[r],o=JF().keys(i).value(function(l,c){return+Kr(l,c,0)}).order(Py).offset(a);return o(t)},FY=function(t,n,r,i,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,p){var h,g=(h=p.type)!==null&&h!==void 0&&h.defaultProps?Et(Et({},p.type.defaultProps),p.props):p.props,m=g.stackId,v=g.hide;if(v)return f;var y=g[r],b=f[y]||{hasStack:!1,stackGroups:{}};if(Ut(m)){var x=b.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};x.items.push(p),b.hasStack=!0,b.stackGroups[m]=x}else b.stackGroups[ah("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[p]};return Et(Et({},f),{},ls({},y,b))},c),d={};return Object.keys(u).reduce(function(f,p){var h=u[p];if(h.hasStack){var g={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(m,v){var y=h.stackGroups[v];return Et(Et({},m),{},ls({},v,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:zY(t,y.items,a)}))},g)}return Et(Et({},f),{},ls({},p,h))},d)},UY=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=JV(u,a,l);return t.domain([xh(d),bh(d)]),{niceTicks:d}}if(a&&i==="number"){var f=t.domain(),p=eY(f,a,l);return{niceTicks:p}}return null},Sk=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=Kr(o,n.dataKey,n.domain[l]);return Ke(c)?null:n.scale(c)-a/2+i},WY=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]},HY=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Et(Et({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Ut(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},GY=function(t){return t.reduce(function(n,r){return[xh(r.concat([n[0]]).filter(se)),bh(r.concat([n[1]]).filter(se))]},[1/0,-1/0])},DO=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=GY(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})},kk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_k=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,lv=function(t,n,r){if(Ie(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(se(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(kk.test(t[0])){var a=+kk.exec(t[0])[1];i[0]=n[0]-a}else Ie(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(se(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(_k.test(t[1])){var o=+_k.exec(t[1])[1];i[1]=n[1]+o}else Ie(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},qf=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=kx(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},Ek=function(t,n,r){return!t||!t.length||Kx(t,cr(r,"type.defaultProps.domain"))?n:t},BO=function(t,n){var r=t.type.defaultProps?Et(Et({},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 Et(Et({},Ge(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:a||i,color:Xx(t),value:Kr(n,i),type:c,payload:n,chartType:u,hide:d})};function Dc(e){"@babel/helpers - typeof";return Dc=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},Dc(e)}function Nk(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 jk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nk(Object(n),!0).forEach(function(r){qY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qY(e,t,n){return t=KY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KY(e){var t=VY(e,"string");return Dc(t)=="symbol"?t:t+""}function VY(e,t){if(Dc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kf=Math.PI/180,YY=function(t){return t*180/Math.PI},rn=function(t,n,r,i){return{x:t+Math.cos(-Kf*i)*r,y:n+Math.sin(-Kf*i)*r}},XY=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))},ZY=function(t,n){var r=t.x,i=t.y,a=n.cx,o=n.cy,l=XY({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:YY(u),angleInRadian:u}},QY=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}},JY=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},Ak=function(t,n){var r=t.x,i=t.y,a=ZY({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=QY(n),f=d.startAngle,p=d.endAngle,h=l,g;if(f<=p){for(;h>p;)h-=360;for(;h<f;)h+=360;g=h>=f&&h<=p}else{for(;h>f;)h-=360;for(;h<p;)h+=360;g=h>=p&&h<=f}return g?jk(jk({},n),{},{radius:o,angle:JY(h,n)}):null};function Bc(e){"@babel/helpers - typeof";return Bc=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},Bc(e)}var eX=["offset"];function tX(e){return aX(e)||iX(e)||rX(e)||nX()}function nX(){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 iX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aX(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 oX(e,t){if(e==null)return{};var n=sX(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 sX(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 Tk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tk(Object(n),!0).forEach(function(r){lX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lX(e,t,n){return t=cX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cX(e){var t=uX(e,"string");return Bc(t)=="symbol"?t:t+""}function uX(e,t){if(Bc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zc(){return zc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zc.apply(this,arguments)}var dX=function(t){var n=t.value,r=t.formatter,i=Ke(t.children)?n:t.children;return Ie(r)?r(i):i},fX=function(t,n){var r=_r(n-t),i=Math.min(Math.abs(n-t),360);return r*i},pX=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,p=c.outerRadius,h=c.startAngle,g=c.endAngle,m=c.clockWise,v=(f+p)/2,y=fX(h,g),b=y>=0?1:-1,x,_;i==="insideStart"?(x=h+b*o,_=m):i==="insideEnd"?(x=g-b*o,_=!m):i==="end"&&(x=g+b*o,_=m),_=y<=0?_:!_;var S=rn(u,d,v,x),w=rn(u,d,v,x+(_?1:-1)*359),k="M".concat(S.x,",").concat(S.y,`
93
- A`).concat(v,",").concat(v,",0,1,").concat(_?0:1,`,
94
- `).concat(w.x,",").concat(w.y),N=Ke(t.id)?ah("recharts-radial-line-"):t.id;return W.createElement("text",zc({},r,{dominantBaseline:"central",className:qe("recharts-radial-bar-label",l)}),W.createElement("defs",null,W.createElement("path",{id:N,d:k})),W.createElement("textPath",{xlinkHref:"#".concat(N)},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,p=(d+f)/2;if(i==="outside"){var h=rn(o,l,u+r,p),g=h.x,m=h.y;return{x:g,y:m,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var v=(c+u)/2,y=rn(o,l,v,p),b=y.x,x=y.y;return{x:b,y:x,textAnchor:"middle",verticalAnchor:"middle"}},mX=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,p=f*i,h=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,v=m*i,y=m>0?"end":"start",b=m>0?"start":"end";if(a==="top"){var x={x:l+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:h};return Bt(Bt({},x),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var _={x:l+u/2,y:c+d+p,textAnchor:"middle",verticalAnchor:g};return Bt(Bt({},_),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var S={x:l-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return Bt(Bt({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(a==="right"){var w={x:l+u+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Bt(Bt({},w),r?{width:Math.max(r.x+r.width-w.x,0),height:d}:{})}var k=r?{width:u,height:d}:{};return a==="insideLeft"?Bt({x:l+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},k):a==="insideRight"?Bt({x:l+u-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},k):a==="insideTop"?Bt({x:l+u/2,y:c+p,textAnchor:"middle",verticalAnchor:g},k):a==="insideBottom"?Bt({x:l+u/2,y:c+d-p,textAnchor:"middle",verticalAnchor:h},k):a==="insideTopLeft"?Bt({x:l+v,y:c+p,textAnchor:b,verticalAnchor:g},k):a==="insideTopRight"?Bt({x:l+u-v,y:c+p,textAnchor:y,verticalAnchor:g},k):a==="insideBottomLeft"?Bt({x:l+v,y:c+d-p,textAnchor:b,verticalAnchor:h},k):a==="insideBottomRight"?Bt({x:l+u-v,y:c+d-p,textAnchor:y,verticalAnchor:h},k):Vs(a)&&(se(a.x)||Da(a.x))&&(se(a.y)||Da(a.y))?Bt({x:l+ro(a.x,u),y:c+ro(a.y,d),textAnchor:"end",verticalAnchor:"end"},k):Bt({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},k)},gX=function(t){return"cx"in t&&se(t.cx)};function hn(e){var t=e.offset,n=t===void 0?5:t,r=oX(e,eX),i=Bt({offset:n},r),a=i.viewBox,o=i.position,l=i.value,c=i.children,u=i.content,d=i.className,f=d===void 0?"":d,p=i.textBreakAll;if(!a||Ke(l)&&Ke(c)&&!E.isValidElement(u)&&!Ie(u))return null;if(E.isValidElement(u))return E.cloneElement(u,i);var h;if(Ie(u)){if(h=E.createElement(u,i),E.isValidElement(h))return h}else h=dX(i);var g=gX(a),m=Ge(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return pX(i,h,m);var v=g?hX(i):mX(i);return W.createElement(Of,zc({className:qe("recharts-label",f)},m,v,{breakAll:p}),h)}hn.displayName="Label";var zO=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,p=t.y,h=t.top,g=t.left,m=t.width,v=t.height,y=t.clockWise,b=t.labelViewBox;if(b)return b;if(se(m)&&se(v)){if(se(f)&&se(p))return{x:f,y:p,width:m,height:v};if(se(h)&&se(g))return{x:h,y:g,width:m,height:v}}return se(f)&&se(p)?{x:f,y:p,width:0,height:0}:se(n)&&se(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:{}},yX=function(t,n){return t?t===!0?W.createElement(hn,{key:"label-implicit",viewBox:n}):Ut(t)?W.createElement(hn,{key:"label-implicit",viewBox:n,value:t}):E.isValidElement(t)?t.type===hn?E.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(hn,{key:"label-implicit",content:t,viewBox:n}):Ie(t)?W.createElement(hn,{key:"label-implicit",content:t,viewBox:n}):Vs(t)?W.createElement(hn,zc({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=zO(t),o=jr(i,hn).map(function(c,u){return E.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=yX(t.label,n||a);return[l].concat(tX(o))};hn.parseViewBox=zO;hn.renderCallByParent=vX;function bX(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var xX=bX;const wX=Ye(xX);function Fc(e){"@babel/helpers - typeof";return Fc=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},Fc(e)}var SX=["valueAccessor"],kX=["data","dataKey","clockWise","id","textBreakAll"];function _X(e){return AX(e)||jX(e)||NX(e)||EX()}function EX(){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 NX(e,t){if(e){if(typeof e=="string")return uv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uv(e,t)}}function jX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function AX(e){if(Array.isArray(e))return uv(e)}function uv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vf(){return Vf=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},Vf.apply(this,arguments)}function Ck(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ok(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ck(Object(n),!0).forEach(function(r){TX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ck(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TX(e,t,n){return t=CX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CX(e){var t=OX(e,"string");return Fc(t)=="symbol"?t:t+""}function OX(e,t){if(Fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pk(e,t){if(e==null)return{};var n=PX(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 PX(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 MX=function(t){return Array.isArray(t.value)?wX(t.value):t.value};function Va(e){var t=e.valueAccessor,n=t===void 0?MX:t,r=Pk(e,SX),i=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=Pk(r,kX);return!i||!i.length?null:W.createElement(Vt,{className:"recharts-label-list"},i.map(function(d,f){var p=Ke(a)?n(d,f):Kr(d&&d.payload,a),h=Ke(l)?{}:{id:"".concat(l,"-").concat(f)};return W.createElement(hn,Vf({},Ge(d,!0),u,h,{parentViewBox:d.parentViewBox,value:p,textBreakAll:c,viewBox:hn.parseViewBox(Ke(o)?d:Ok(Ok({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Va.displayName="LabelList";function RX(e,t){return e?e===!0?W.createElement(Va,{key:"labelList-implicit",data:t}):W.isValidElement(e)||Ie(e)?W.createElement(Va,{key:"labelList-implicit",data:t,content:e}):Vs(e)?W.createElement(Va,Vf({data:t},e,{key:"labelList-implicit"})):null:null}function IX(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=jr(r,Va).map(function(o,l){return E.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return i;var a=RX(e.label,t);return[a].concat(_X(i))}Va.renderCallByParent=IX;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 dv(){return dv=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},dv.apply(this,arguments)}function Mk(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 Rk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mk(Object(n),!0).forEach(function(r){$X(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $X(e,t,n){return t=LX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LX(e){var t=DX(e,"string");return Uc(t)=="symbol"?t:t+""}function DX(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)}var BX=function(t,n){var r=_r(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},ld=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)/Kf,p=u?a:a+o*f,h=rn(n,r,d,p),g=rn(n,r,i,p),m=u?a-o*f:a,v=rn(n,r,d*Math.cos(f*Kf),m);return{center:h,circleTangency:g,lineTangency:v,theta:f}},FO=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=BX(o,l),u=o+c,d=rn(n,r,a,o),f=rn(n,r,a,u),p="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 h=rn(n,r,i,o),g=rn(n,r,i,u);p+="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(h.x,",").concat(h.y," Z")}else p+="L ".concat(n,",").concat(r," Z");return p},zX=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=_r(d-u),p=ld({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),h=p.circleTangency,g=p.lineTangency,m=p.theta,v=ld({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),y=v.circleTangency,b=v.lineTangency,x=v.theta,_=c?Math.abs(u-d):Math.abs(u-d)-m-x;if(_<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
- `):FO({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(h.x,",").concat(h.y,`
107
- A`).concat(a,",").concat(a,",0,").concat(+(_>180),",").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
108
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(b.x,",").concat(b.y,`
109
- `);if(i>0){var w=ld({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),k=w.circleTangency,N=w.lineTangency,j=w.theta,C=ld({cx:n,cy:r,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),I=C.circleTangency,M=C.lineTangency,$=C.theta,R=c?Math.abs(u-d):Math.abs(u-d)-j-$;if(R<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(M.x,",").concat(M.y,`
110
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(I.x,",").concat(I.y,`
111
- A`).concat(i,",").concat(i,",0,").concat(+(R>180),",").concat(+(f>0),",").concat(k.x,",").concat(k.y,`
112
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(N.x,",").concat(N.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},FX={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},UO=function(t){var n=Rk(Rk({},FX),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,p=n.className;if(o<a||d===f)return null;var h=qe("recharts-sector",p),g=o-a,m=ro(l,g,0,!0),v;return m>0&&Math.abs(d-f)<360?v=zX({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):v=FO({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),W.createElement("path",dv({},Ge(n,!0),{className:h,d:v,role:"img"}))};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 fv(){return fv=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},fv.apply(this,arguments)}function Ik(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 $k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ik(Object(n),!0).forEach(function(r){UX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ik(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UX(e,t,n){return t=WX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WX(e){var t=HX(e,"string");return Wc(t)=="symbol"?t:t+""}function HX(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 Lk={curveBasisClosed:UF,curveBasisOpen:WF,curveBasis:FF,curveBumpX:jF,curveBumpY:AF,curveLinearClosed:HF,curveLinear:lh,curveMonotoneX:GF,curveMonotoneY:qF,curveNatural:KF,curveStep:VF,curveStepAfter:XF,curveStepBefore:YF},cd=function(t){return t.x===+t.x&&t.y===+t.y},Nl=function(t){return t.x},jl=function(t){return t.y},GX=function(t,n){if(Ie(t))return t;var r="curve".concat(oh(t));return(r==="curveMonotone"||r==="curveBump")&&n?Lk["".concat(r).concat(n==="vertical"?"Y":"X")]:Lk[r]||lh},qX=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=GX(r,l),f=u?a.filter(function(m){return cd(m)}):a,p;if(Array.isArray(o)){var h=u?o.filter(function(m){return cd(m)}):o,g=f.map(function(m,v){return $k($k({},m),{},{base:h[v]})});return l==="vertical"?p=Ju().y(jl).x1(Nl).x0(function(m){return m.base.x}):p=Ju().x(Nl).y1(jl).y0(function(m){return m.base.y}),p.defined(cd).curve(d),p(g)}return l==="vertical"&&se(o)?p=Ju().y(jl).x1(Nl).x0(o):se(o)?p=Ju().x(Nl).y1(jl).y0(o):p=HT().x(Nl).y(jl),p.defined(cd).curve(d),p(f)},Dk=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?qX(t):i;return E.createElement("path",fv({},Ge(t,!1),gf(t),{className:qe("recharts-curve",n),d:o,ref:a}))},WO={exports:{}},KX="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",VX=KX,YX=VX;function HO(){}function GO(){}GO.resetWarningCache=HO;var XX=function(){function e(r,i,a,o,l,c){if(c!==YX){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:GO,resetWarningCache:HO};return n.PropTypes=n,n};WO.exports=XX();var ZX=WO.exports;const Ve=Ye(ZX),{getOwnPropertyNames:QX,getOwnPropertySymbols:JX}=Object,{hasOwnProperty:eZ}=Object.prototype;function Um(e,t){return function(r,i,a){return e(r,i,a)&&t(r,i,a)}}function ud(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 tZ(e){return e!=null?e[Symbol.toStringTag]:void 0}function Bk(e){return QX(e).concat(JX(e))}const nZ=Object.hasOwn||((e,t)=>eZ.call(e,t));function ho(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const rZ="__v",iZ="__o",aZ="_owner",{getOwnPropertyDescriptor:zk,keys:Fk}=Object;function oZ(e,t){return e.byteLength===t.byteLength&&Yf(new Uint8Array(e),new Uint8Array(t))}function sZ(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 lZ(e,t){return e.byteLength===t.byteLength&&Yf(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function cZ(e,t){return ho(e.getTime(),t.getTime())}function uZ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function dZ(e,t){return e===t}function Uk(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 p=o.value,h=l.value;if(n.equals(p[0],h[0],c,f,e,t,n)&&n.equals(p[1],h[1],p[0],h[0],e,t,n)){d=i[f]=!0;break}f++}if(!d)return!1;c++}return!0}const fZ=ho;function pZ(e,t,n){const r=Fk(e);let i=r.length;if(Fk(t).length!==i)return!1;for(;i-- >0;)if(!qO(e,t,n,r[i]))return!1;return!0}function Al(e,t,n){const r=Bk(e);let i=r.length;if(Bk(t).length!==i)return!1;let a,o,l;for(;i-- >0;)if(a=r[i],!qO(e,t,n,a)||(o=zk(e,a),l=zk(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 ho(e.valueOf(),t.valueOf())}function mZ(e,t){return e.source===t.source&&e.flags===t.flags}function Wk(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 Yf(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 gZ(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 qO(e,t,n,r){return(r===aZ||r===iZ||r===rZ)&&(e.$$typeof||t.$$typeof)?!0:nZ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const yZ="[object ArrayBuffer]",vZ="[object Arguments]",bZ="[object Boolean]",xZ="[object DataView]",wZ="[object Date]",SZ="[object Error]",kZ="[object Map]",_Z="[object Number]",EZ="[object Object]",NZ="[object RegExp]",jZ="[object Set]",AZ="[object String]",TZ={"[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},CZ="[object URL]",OZ=Object.prototype.toString;function PZ({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:p,areUrlsEqual:h,unknownTagComparators:g}){return function(v,y,b){if(v===y)return!0;if(v==null||y==null)return!1;const x=typeof v;if(x!==typeof y)return!1;if(x!=="object")return x==="number"?l(v,y,b):x==="function"?a(v,y,b):!1;const _=v.constructor;if(_!==y.constructor)return!1;if(_===Object)return c(v,y,b);if(Array.isArray(v))return t(v,y,b);if(_===Date)return r(v,y,b);if(_===RegExp)return d(v,y,b);if(_===Map)return o(v,y,b);if(_===Set)return f(v,y,b);const S=OZ.call(v);if(S===wZ)return r(v,y,b);if(S===NZ)return d(v,y,b);if(S===kZ)return o(v,y,b);if(S===jZ)return f(v,y,b);if(S===EZ)return typeof v.then!="function"&&typeof y.then!="function"&&c(v,y,b);if(S===CZ)return h(v,y,b);if(S===SZ)return i(v,y,b);if(S===vZ)return c(v,y,b);if(TZ[S])return p(v,y,b);if(S===yZ)return e(v,y,b);if(S===xZ)return n(v,y,b);if(S===bZ||S===_Z||S===AZ)return u(v,y,b);if(g){let w=g[S];if(!w){const k=tZ(v);k&&(w=g[k])}if(w)return w(v,y,b)}return!1}}function MZ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:oZ,areArraysEqual:n?Al:sZ,areDataViewsEqual:lZ,areDatesEqual:cZ,areErrorsEqual:uZ,areFunctionsEqual:dZ,areMapsEqual:n?Um(Uk,Al):Uk,areNumbersEqual:fZ,areObjectsEqual:n?Al:pZ,arePrimitiveWrappersEqual:hZ,areRegExpsEqual:mZ,areSetsEqual:n?Um(Wk,Al):Wk,areTypedArraysEqual:n?Um(Yf,Al):Yf,areUrlsEqual:gZ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=ud(r.areArraysEqual),a=ud(r.areMapsEqual),o=ud(r.areObjectsEqual),l=ud(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:l})}return r}function RZ(e){return function(t,n,r,i,a,o,l){return e(t,n,l)}}function IZ({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 $Z=ha();ha({strict:!0});ha({circular:!0});ha({circular:!0,strict:!0});ha({createInternalComparator:()=>ho});ha({strict:!0,createInternalComparator:()=>ho});ha({circular:!0,createInternalComparator:()=>ho});ha({circular:!0,createInternalComparator:()=>ho,strict:!0});function ha(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=MZ(e),o=PZ(a),l=n?n(o):RZ(o);return IZ({circular:t,comparator:o,createState:r,equals:l,strict:i})}function LZ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Hk(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):LZ(i)};requestAnimationFrame(r)}function pv(e){"@babel/helpers - typeof";return pv=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},pv(e)}function DZ(e){return UZ(e)||FZ(e)||zZ(e)||BZ()}function BZ(){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 zZ(e,t){if(e){if(typeof e=="string")return Gk(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 Gk(e,t)}}function Gk(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 FZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UZ(e){if(Array.isArray(e))return e}function WZ(){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=DZ(o),c=l[0],u=l.slice(1);if(typeof c=="number"){Hk(i.bind(null,u),c);return}i(c),Hk(i.bind(null,u));return}pv(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 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 qk(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 Kk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qk(Object(n),!0).forEach(function(r){KO(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KO(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=GZ(e,"string");return Hc(t)==="symbol"?t:String(t)}function GZ(e,t){if(Hc(e)!=="object"||e===null)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)}var qZ=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},KZ=function(t){return t},VZ=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Zl=function(t,n){return Object.keys(n).reduce(function(r,i){return Kk(Kk({},r),{},KO({},i,t(i,n[i])))},{})},Vk=function(t,n,r){return t.map(function(i){return"".concat(VZ(i)," ").concat(n,"ms ").concat(r)}).join(",")};function YZ(e,t){return QZ(e)||ZZ(e,t)||VO(e,t)||XZ()}function XZ(){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 ZZ(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 QZ(e){if(Array.isArray(e))return e}function JZ(e){return nQ(e)||tQ(e)||VO(e)||eQ()}function eQ(){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 VO(e,t){if(e){if(typeof e=="string")return hv(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 hv(e,t)}}function tQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nQ(e){if(Array.isArray(e))return hv(e)}function hv(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 Xf=1e-4,YO=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},XO=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},Yk=function(t,n){return function(r){var i=YO(t,n);return XO(i,r)}},rQ=function(t,n){return function(r){var i=YO(t,n),a=[].concat(JZ(i.map(function(o,l){return o*l}).slice(1)),[0]);return XO(a,r)}},Xk=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=YZ(u,4);i=d[0],a=d[1],o=d[2],l=d[3]}}}var f=Yk(i,o),p=Yk(a,l),h=rQ(i,o),g=function(y){return y>1?1:y<0?0:y},m=function(y){for(var b=y>1?1:y,x=b,_=0;_<8;++_){var S=f(x)-b,w=h(x);if(Math.abs(S-b)<Xf||w<Xf)return p(x);x=g(x-S/w)}return p(x)};return m.isStepper=!1,m},iQ=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,p){var h=-(d-f)*r,g=p*a,m=p+(h-g)*l/1e3,v=p*l/1e3+d;return Math.abs(v-f)<Xf&&Math.abs(m)<Xf?[f,0]:[v,m]};return c.isStepper=!0,c.dt=l,c},aQ=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 Xk(i);case"spring":return iQ();default:if(i.split("(")[0]==="cubic-bezier")return Xk(i)}return typeof i=="function"?i:null};function Gc(e){"@babel/helpers - typeof";return Gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gc(e)}function Zk(e){return lQ(e)||sQ(e)||ZO(e)||oQ()}function oQ(){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 sQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lQ(e){if(Array.isArray(e))return gv(e)}function Qk(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?Qk(Object(n),!0).forEach(function(r){mv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mv(e,t,n){return t=cQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cQ(e){var t=uQ(e,"string");return Gc(t)==="symbol"?t:String(t)}function uQ(e,t){if(Gc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dQ(e,t){return hQ(e)||pQ(e,t)||ZO(e,t)||fQ()}function fQ(){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 ZO(e,t){if(e){if(typeof e=="string")return gv(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 gv(e,t)}}function gv(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)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 Zf=function(t,n,r){return t+(n-t)*r},yv=function(t){var n=t.from,r=t.to;return n!==r},mQ=function e(t,n,r){var i=Zl(function(a,o){if(yv(o)){var l=t(o.from,o.to,o.velocity),c=dQ(l,2),u=c[0],d=c[1];return tn(tn({},o),{},{from:u,velocity:d})}return o},n);return r<1?Zl(function(a,o){return yv(o)?tn(tn({},o),{},{velocity:Zf(o.velocity,i[a].velocity,r),from:Zf(o.from,i[a].from,r)}):o},n):e(t,i,r-1)};const gQ=function(e,t,n,r,i){var a=qZ(e,t),o=a.reduce(function(v,y){return tn(tn({},v),{},mv({},y,[e[y],t[y]]))},{}),l=a.reduce(function(v,y){return tn(tn({},v),{},mv({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,f=function(){return null},p=function(){return Zl(function(y,b){return b.from},l)},h=function(){return!Object.values(l).filter(yv).length},g=function(y){u||(u=y);var b=y-u,x=b/n.dt;l=mQ(n,l,x),i(tn(tn(tn({},e),t),p())),u=y,h()||(c=requestAnimationFrame(f))},m=function(y){d||(d=y);var b=(y-d)/r,x=Zl(function(S,w){return Zf.apply(void 0,Zk(w).concat([n(b)]))},o);if(i(tn(tn(tn({},e),t),x)),b<1)c=requestAnimationFrame(f);else{var _=Zl(function(S,w){return Zf.apply(void 0,Zk(w).concat([n(1)]))},o);i(tn(tn(tn({},e),t),_))}};return f=n.isStepper?g:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function js(e){"@babel/helpers - typeof";return js=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},js(e)}var yQ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function vQ(e,t){if(e==null)return{};var n=bQ(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 bQ(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 Wm(e){return kQ(e)||SQ(e)||wQ(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 wQ(e,t){if(e){if(typeof e=="string")return vv(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 vv(e,t)}}function SQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kQ(e){if(Array.isArray(e))return vv(e)}function vv(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 Jk(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 vr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jk(Object(n),!0).forEach(function(r){Dl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dl(e,t,n){return t=QO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EQ(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,QO(r.key),r)}}function NQ(e,t,n){return t&&EQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function QO(e){var t=jQ(e,"string");return js(t)==="symbol"?t:String(t)}function jQ(e,t){if(js(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(js(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AQ(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 TQ(e){var t=CQ();return function(){var r=Qf(e),i;if(t){var a=Qf(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return xv(this,i)}}function xv(e,t){if(t&&(js(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wv(e)}function wv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CQ(){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 Qf(e){return Qf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qf(e)}var aa=function(e){AQ(n,e);var t=TQ(n);function n(r,i){var a;_Q(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,p=o.children,h=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(wv(a)),a.changeStyle=a.changeStyle.bind(wv(a)),!l||h<=0)return a.state={style:{}},typeof p=="function"&&(a.state={style:d}),xv(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof p=="function")return a.state={style:u},xv(a);a.state={style:c?Dl({},c,u):u}}else a.state={style:{}};return a}return NQ(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,p=this.state.style;if(l){if(!o){var h={style:c?Dl({},c,d):d};this.state&&p&&(c&&p[c]!==d||!c&&p!==d)&&this.setState(h);return}if(!($Z(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&&p){var v={style:c?Dl({},c,m):m};(c&&p[c]!==m||!c&&p!==m)&&this.setState(v)}this.runAnimation(vr(vr({},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,p=i.onAnimationStart,h=gQ(o,l,aQ(u),c,this.changeStyle),g=function(){a.stopJSAnimation=h()};this.manager.start([p,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,p=f===void 0?0:f,h=function(m,v,y){if(y===0)return m;var b=v.duration,x=v.easing,_=x===void 0?"ease":x,S=v.style,w=v.properties,k=v.onAnimationEnd,N=y>0?o[y-1]:v,j=w||Object.keys(S);if(typeof _=="function"||_==="spring")return[].concat(Wm(m),[a.runJSAnimation.bind(a,{from:N.style,to:S,duration:b,easing:_}),b]);var C=Vk(j,b,_),I=vr(vr(vr({},N.style),S),{},{transition:C});return[].concat(Wm(m),[I,b,k]).filter(KZ)};return this.manager.start([c].concat(Wm(o.reduce(h,[d,Math.max(p,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=WZ());var a=i.begin,o=i.duration,l=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,p=i.steps,h=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(i);return}if(p.length>1){this.runStepAnimation(i);return}var m=l?Dl({},l,c):c,v=Vk(Object.keys(m),o,u);g.start([d,a,vr(vr({},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,yQ),u=E.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var f=function(h){var g=h.props,m=g.style,v=m===void 0?{}:m,y=g.className,b=E.cloneElement(h,vr(vr({},c),{},{style:vr(vr({},v),d),className:y}));return b};return u===1?f(E.Children.only(a)):W.createElement("div",null,E.Children.map(a,function(p){return f(p)}))}}]),n}(E.PureComponent);aa.displayName="Animate";aa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};aa.propTypes={from:Ve.oneOfType([Ve.object,Ve.string]),to:Ve.oneOfType([Ve.object,Ve.string]),attributeName:Ve.string,duration:Ve.number,begin:Ve.number,easing:Ve.oneOfType([Ve.string,Ve.func]),steps:Ve.arrayOf(Ve.shape({duration:Ve.number.isRequired,style:Ve.object.isRequired,easing:Ve.oneOfType([Ve.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ve.func]),properties:Ve.arrayOf("string"),onAnimationEnd:Ve.func})),children:Ve.oneOfType([Ve.node,Ve.func]),isActive:Ve.bool,canBegin:Ve.bool,onAnimationEnd:Ve.func,shouldReAnimate:Ve.bool,onAnimationStart:Ve.func,onAnimationReStart:Ve.func};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 Jf(){return Jf=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},Jf.apply(this,arguments)}function OQ(e,t){return IQ(e)||RQ(e,t)||MQ(e,t)||PQ()}function PQ(){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 MQ(e,t){if(e){if(typeof e=="string")return e_(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 e_(e,t)}}function e_(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 RQ(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 IQ(e){if(Array.isArray(e))return e}function t_(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 n_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t_(Object(n),!0).forEach(function(r){$Q(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Q(e,t,n){return t=LQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LQ(e){var t=DQ(e,"string");return qc(t)=="symbol"?t:t+""}function DQ(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 r_=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],p=0,h=4;p<h;p++)f[p]=a[p]>o?o:a[p];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},BQ=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),p=Math.max(o,o+c);return r>=u&&r<=d&&i>=f&&i<=p}return!1},zQ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Zx=function(t){var n=n_(n_({},zQ),t),r=E.useRef(),i=E.useState(-1),a=OQ(i,2),o=a[0],l=a[1];E.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var _=r.current.getTotalLength();_&&l(_)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,p=n.radius,h=n.className,g=n.animationEasing,m=n.animationDuration,v=n.animationBegin,y=n.isAnimationActive,b=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var x=qe("recharts-rectangle",h);return b?W.createElement(aa,{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(_){var S=_.width,w=_.height,k=_.x,N=_.y;return W.createElement(aa,{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},W.createElement("path",Jf({},Ge(n,!0),{className:x,d:r_(k,N,S,w,p),ref:r})))}):W.createElement("path",Jf({},Ge(n,!0),{className:x,d:r_(c,u,d,f,p)}))};function Sv(){return Sv=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},Sv.apply(this,arguments)}var JO=function(t){var n=t.cx,r=t.cy,i=t.r,a=t.className,o=qe("recharts-dot",a);return n===+n&&r===+r&&i===+i?E.createElement("circle",Sv({},Ge(t,!1),gf(t),{className:o,cx:n,cy:r,r:i})):null};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)}var FQ=["x","y","top","left","width","height","className"];function kv(){return kv=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},kv.apply(this,arguments)}function i_(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 UQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i_(Object(n),!0).forEach(function(r){WQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WQ(e,t,n){return t=HQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HQ(e){var t=GQ(e,"string");return Kc(t)=="symbol"?t:t+""}function GQ(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(t==="string"?String:Number)(e)}function qQ(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}var VQ=function(t,n,r,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},YQ=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,p=t.height,h=p===void 0?0:p,g=t.className,m=qQ(t,FQ),v=UQ({x:r,y:a,top:l,left:u,width:f,height:h},m);return!se(r)||!se(a)||!se(f)||!se(h)||!se(l)||!se(u)?null:W.createElement("path",kv({},Ge(v,!0),{className:qe("recharts-cross",g),d:VQ(r,a,f,h,l,u)}))},XQ=hC,ZQ=XQ(Object.getPrototypeOf,Object),QQ=ZQ,JQ=xi,eJ=QQ,tJ=wi,nJ="[object Object]",rJ=Function.prototype,iJ=Object.prototype,eP=rJ.toString,aJ=iJ.hasOwnProperty,oJ=eP.call(Object);function sJ(e){if(!tJ(e)||JQ(e)!=nJ)return!1;var t=eJ(e);if(t===null)return!0;var n=aJ.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&eP.call(n)==oJ}var lJ=sJ;const cJ=Ye(lJ);var uJ=xi,dJ=wi,fJ="[object Boolean]";function pJ(e){return e===!0||e===!1||dJ(e)&&uJ(e)==fJ}var hJ=pJ;const mJ=Ye(hJ);function Vc(e){"@babel/helpers - typeof";return Vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vc(e)}function ep(){return ep=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},ep.apply(this,arguments)}function gJ(e,t){return xJ(e)||bJ(e,t)||vJ(e,t)||yJ()}function yJ(){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 a_(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 a_(e,t)}}function a_(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 bJ(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 o_(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 s_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o_(Object(n),!0).forEach(function(r){wJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wJ(e,t,n){return t=SJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SJ(e){var t=kJ(e,"string");return Vc(t)=="symbol"?t:t+""}function kJ(e,t){if(Vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var l_=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},_J={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},EJ=function(t){var n=s_(s_({},_J),t),r=E.useRef(),i=E.useState(-1),a=gJ(i,2),o=a[0],l=a[1];E.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var x=r.current.getTotalLength();x&&l(x)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,p=n.height,h=n.className,g=n.animationEasing,m=n.animationDuration,v=n.animationBegin,y=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||p!==+p||d===0&&f===0||p===0)return null;var b=qe("recharts-trapezoid",h);return y?W.createElement(aa,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:p,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:p,x:c,y:u},duration:m,animationEasing:g,isActive:y},function(x){var _=x.upperWidth,S=x.lowerWidth,w=x.height,k=x.x,N=x.y;return W.createElement(aa,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,easing:g},W.createElement("path",ep({},Ge(n,!0),{className:b,d:l_(k,N,_,S,w),ref:r})))}):W.createElement("g",null,W.createElement("path",ep({},Ge(n,!0),{className:b,d:l_(c,u,d,f,p)})))},NJ=["option","shapeType","propTransformer","activeClassName","isActive"];function Yc(e){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yc(e)}function jJ(e,t){if(e==null)return{};var n=AJ(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 AJ(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 c_(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 tp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c_(Object(n),!0).forEach(function(r){TJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TJ(e,t,n){return t=CJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CJ(e){var t=OJ(e,"string");return Yc(t)=="symbol"?t:t+""}function OJ(e,t){if(Yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PJ(e,t){return tp(tp({},t),e)}function MJ(e,t){return e==="symbols"}function u_(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return W.createElement(Zx,n);case"trapezoid":return W.createElement(EJ,n);case"sector":return W.createElement(UO,n);case"symbols":if(MJ(t))return W.createElement(mx,n);break;default:return null}}function RJ(e){return E.isValidElement(e)?e.props:e}function IJ(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?PJ:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=jJ(e,NJ),u;if(E.isValidElement(t))u=E.cloneElement(t,tp(tp({},c),RJ(t)));else if(Ie(t))u=t(c);else if(cJ(t)&&!mJ(t)){var d=i(t,c);u=W.createElement(u_,{shapeType:n,elementProps:d})}else{var f=c;u=W.createElement(u_,{shapeType:n,elementProps:f})}return l?W.createElement(Vt,{className:o},u):u}function _h(e,t){return t!=null&&"trapezoids"in e.props}function Eh(e,t){return t!=null&&"sectors"in e.props}function Xc(e,t){return t!=null&&"points"in e.props}function $J(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 LJ(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function DJ(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function BJ(e,t){var n;return _h(e,t)?n=$J:Eh(e,t)?n=LJ:Xc(e,t)&&(n=DJ),n}function zJ(e,t){var n;return _h(e,t)?n="trapezoids":Eh(e,t)?n="sectors":Xc(e,t)&&(n="points"),n}function FJ(e,t){if(_h(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(Eh(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 Xc(e,t)?t.payload:{}}function UJ(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=zJ(n,t),a=FJ(n,t),o=r.filter(function(c,u){var d=Kx(a,c),f=n.props[i].filter(function(g){var m=BJ(n,t);return m(g,t)}),p=n.props[i].indexOf(f[f.length-1]),h=u===p;return d&&h}),l=r.indexOf(o[o.length-1]);return l}var WJ=Math.ceil,HJ=Math.max;function GJ(e,t,n,r){for(var i=-1,a=HJ(WJ((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}var qJ=GJ,KJ=MC,d_=1/0,VJ=17976931348623157e292;function YJ(e){if(!e)return e===0?e:0;if(e=KJ(e),e===d_||e===-d_){var t=e<0?-1:1;return t*VJ}return e===e?e:0}var tP=YJ,XJ=qJ,ZJ=fh,Hm=tP;function QJ(e){return function(t,n,r){return r&&typeof r!="number"&&ZJ(t,n,r)&&(n=r=void 0),t=Hm(t),n===void 0?(n=t,t=0):n=Hm(n),r=r===void 0?t<n?1:-1:Hm(r),XJ(t,n,r,e)}}var JJ=QJ,eee=JJ,tee=eee(),nee=tee;const np=Ye(nee);function Zc(e){"@babel/helpers - typeof";return Zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zc(e)}function f_(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 p_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f_(Object(n),!0).forEach(function(r){nP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nP(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=iee(e,"string");return Zc(t)=="symbol"?t:t+""}function iee(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)}var aee=["Webkit","Moz","O","ms"],oee=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=aee.reduce(function(a,o){return p_(p_({},a),{},nP({},o+r,n))},{});return i[t]=n,i};function As(e){"@babel/helpers - typeof";return As=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},As(e)}function rp(){return rp=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},rp.apply(this,arguments)}function h_(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 Gm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h_(Object(n),!0).forEach(function(r){Un(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function see(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m_(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 lee(e,t,n){return t&&m_(e.prototype,t),n&&m_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cee(e,t,n){return t=ip(t),uee(e,rP()?Reflect.construct(t,n||[],ip(e).constructor):t.apply(e,n))}function uee(e,t){if(t&&(As(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dee(e)}function dee(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 ip(e){return ip=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ip(e)}function fee(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 Un(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=pee(e,"string");return As(t)=="symbol"?t:t+""}function pee(e,t){if(As(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(As(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=Yl().domain(np(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}},g_=function(t){return t.changedTouches&&!!t.changedTouches.length},Ts=function(e){function t(n){var r;return see(this,t),r=cee(this,t,[n]),Un(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),Un(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),Un(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()}),Un(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Un(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Un(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Un(r,"handleSlideDragStart",function(i){var a=g_(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 fee(t,e),lee(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),p=Math.max(i,a),h=t.getIndexInRange(o,f),g=t.getIndexInRange(o,p);return{startIndex:h-h%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=Kr(a[r],l,r);return Ie(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,p=c.startIndex,h=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!==p||v.endIndex!==h)&&g&&g(v),this.setState({startX:o+m,endX:l+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=g_(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,p=d.width,h=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+p-h-u):b<0&&(b=Math.max(b,f-u)),y[o]=u+b;var x=this.getIndex(y),_=x.startIndex,S=x.endIndex,w=function(){var N=v.length-1;return o==="startX"&&(l>c?_%m===0:S%m===0)||l<c&&S===N||o==="endX"&&(l>c?S%m===0:_%m===0)||l>c&&S===N};this.setState(Un(Un({},o,u+b),"brushMoveStartX",r.pageX),function(){g&&w()&&g(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[i],f=l.indexOf(d);if(f!==-1){var p=f+r;if(!(p===-1||p>=l.length)){var h=l[p];i==="startX"&&h>=u||i==="endX"&&h<=c||this.setState(Un({},i,h),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 W.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=E.Children.only(u);return f?W.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,p=c.traveller,h=c.ariaLabel,g=c.data,m=c.startIndex,v=c.endIndex,y=Math.max(r,this.props.x),b=Gm(Gm({},Ge(this.props,!1)),{},{x:y,y:u,width:d,height:f}),x=h||"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 W.createElement(Vt,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,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 W.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,p=d.endX,h=5,g={pointerEvents:"none",fill:u};return W.createElement(Vt,{className:"recharts-brush-texts"},W.createElement(Of,rp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,p)-h,y:o+l/2},g),this.getTextOfTick(i)),W.createElement(Of,rp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,p)+c+h,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,p=this.state,h=p.startX,g=p.endX,m=p.isTextActive,v=p.isSlideMoving,y=p.isTravellerMoving,b=p.isTravellerFocused;if(!i||!i.length||!se(l)||!se(c)||!se(u)||!se(d)||u<=0||d<=0)return null;var x=qe("recharts-brush",a),_=W.Children.count(o)===1,S=oee("userSelect","none");return W.createElement(Vt,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),_&&this.renderPanorama(),this.renderSlide(h,g),this.renderTravellerLayer(h,"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 W.createElement(W.Fragment,null,W.createElement("rect",{x:i,y:a,width:o,height:l,fill:c,stroke:"none"}),W.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),W.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 W.isValidElement(r)?a=W.cloneElement(r,i):Ie(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 Gm({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 p=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>i?l=c:o=c}return i>=r[l]?l:o}}])}(E.PureComponent);Un(Ts,"displayName","Brush");Un(Ts,"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 mee=Sx;function gee(e,t){var n;return mee(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}var yee=gee,vee=oC,bee=da,xee=yee,wee=$n,See=fh;function kee(e,t,n){var r=wee(e)?vee:xee;return n&&See(e,t,n)&&(t=void 0),r(e,bee(t))}var _ee=kee;const Eee=Ye(_ee);var Gr=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},y_=AC;function Nee(e,t,n){t=="__proto__"&&y_?y_(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var jee=Nee,Aee=jee,Tee=NC,Cee=da;function Oee(e,t){var n={};return t=Cee(t),Tee(e,function(r,i,a){Aee(n,i,t(r,i,a))}),n}var Pee=Oee;const Mee=Ye(Pee);function Ree(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 Iee=Ree,$ee=Sx;function Lee(e,t){var n=!0;return $ee(e,function(r,i,a){return n=!!t(r,i,a),n}),n}var Dee=Lee,Bee=Iee,zee=Dee,Fee=da,Uee=$n,Wee=fh;function Hee(e,t,n){var r=Uee(e)?Bee:zee;return n&&Wee(e,t,n)&&(t=void 0),r(e,Fee(t))}var Gee=Hee;const aP=Ye(Gee);var qee=["x","y"];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 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 v_(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 Tl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v_(Object(n),!0).forEach(function(r){Kee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kee(e,t,n){return t=Vee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vee(e){var t=Yee(e,"string");return Qc(t)=="symbol"?t:t+""}function Yee(e,t){if(Qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xee(e,t){if(e==null)return{};var n=Zee(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 Zee(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 Qee(e,t){var n=e.x,r=e.y,i=Xee(e,qee),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),p=parseInt(f,10);return Tl(Tl(Tl(Tl(Tl({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:p,name:t.name,radius:t.radius})}function b_(e){return W.createElement(IJ,Ev({shapeType:"rectangle",propTransformer:Qee,activeClassName:"recharts-active-bar"},e))}var Jee=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=se(r)||p3(r);return a?t(r,i):(a||ao(),n)}},ete=["value","background"],oP;function Cs(e){"@babel/helpers - typeof";return Cs=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},Cs(e)}function tte(e,t){if(e==null)return{};var n=nte(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 nte(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 ap(){return ap=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},ap.apply(this,arguments)}function x_(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?x_(Object(n),!0).forEach(function(r){Hi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x_(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 w_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lP(r.key),r)}}function ite(e,t,n){return t&&w_(e.prototype,t),n&&w_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ate(e,t,n){return t=op(t),ote(e,sP()?Reflect.construct(t,n||[],op(e).constructor):t.apply(e,n))}function ote(e,t){if(t&&(Cs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ste(e)}function ste(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sP=function(){return!!e})()}function op(e){return op=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},op(e)}function lte(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&&Nv(e,t)}function Nv(e,t){return Nv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Nv(e,t)}function Hi(e,t,n){return t=lP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lP(e){var t=cte(e,"string");return Cs(t)=="symbol"?t:t+""}function cte(e,t){if(Cs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var dn=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=ate(this,t,[].concat(i)),Hi(n,"state",{isAnimationFinished:!1}),Hi(n,"id",ah("recharts-bar-")),Hi(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Hi(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return lte(t,e),ite(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=Ge(this.props,!1);return r&&r.map(function(f,p){var h=p===c,g=h?u:o,m=Ot(Ot(Ot({},d),f),{},{isActive:h,option:g,index:p,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return W.createElement(Vt,ap({className:"recharts-bar-rectangle"},yf(i.props,f,p),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(p)}),W.createElement(b_,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,p=this.state.prevData;return W.createElement(aa,{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(h){var g=h.t,m=a.map(function(v,y){var b=p&&p[y];if(b){var x=jo(b.x,v.x),_=jo(b.y,v.y),S=jo(b.width,v.width),w=jo(b.height,v.height);return Ot(Ot({},v),{},{x:x(g),y:_(g),width:S(g),height:w(g)})}if(o==="horizontal"){var k=jo(0,v.height),N=k(g);return Ot(Ot({},v),{},{y:v.y+v.height-N,height:N})}var j=jo(0,v.width),C=j(g);return Ot(Ot({},v),{},{width:C})});return W.createElement(Vt,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||!Kx(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=Ge(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,p=tte(u,ete);if(!f)return null;var h=Ot(Ot(Ot(Ot(Ot({},p),{},{fill:"#eee"},f),c),yf(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return W.createElement(b_,ap({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},h))})}},{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=jr(d,kh);if(!f)return null;var p=u==="vertical"?o[0].height/2:o[0].width/2,h=function(v,y){var b=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:b,errorVal:Kr(v,y)}},g={clipPath:r?"url(#clipPath-".concat(i,")"):null};return W.createElement(Vt,g,f.map(function(m){return W.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:p,dataPointFormatter:h})}))}},{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,p=r.height,h=r.isAnimationActive,g=r.background,m=r.id;if(i||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=qe("recharts-bar",o),b=l&&l.allowDataOverflow,x=c&&c.allowDataOverflow,_=b||x,S=Ke(m)?this.id:m;return W.createElement(Vt,{className:y},b||x?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(S)},W.createElement("rect",{x:b?u:u-f/2,y:x?d:d-p/2,width:b?f:f*2,height:x?p:p*2}))):null,W.createElement(Vt,{className:"recharts-bar-rectangles",clipPath:_?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(_,S),(!h||v)&&Va.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(E.PureComponent);oP=dn;Hi(dn,"displayName","Bar");Hi(dn,"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"});Hi(dn,"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,p=e.offset,h=IY(r,n);if(!h)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,x=v.minPointSize,_=g==="horizontal"?o:a,S=u?_.scale.domain():null,w=WY({numericAxis:_}),k=jr(b,Nc),N=f.map(function(j,C){var I,M,$,R,B,L;u?I=$Y(u[d+C],S):(I=Kr(j,y),Array.isArray(I)||(I=[w,I]));var U=Jee(x,oP.defaultProps.minPointSize)(I[1],C);if(g==="horizontal"){var O,z=[o.scale(I[0]),o.scale(I[1])],T=z[0],V=z[1];M=Sk({axis:a,ticks:l,bandSize:i,offset:h.offset,entry:j,index:C}),$=(O=V??T)!==null&&O!==void 0?O:void 0,R=h.size;var q=T-V;if(B=Number.isNaN(q)?0:q,L={x:M,y:o.y,width:R,height:o.height},Math.abs(U)>0&&Math.abs(B)<Math.abs(U)){var P=_r(B||U)*(Math.abs(U)-Math.abs(B));$-=P,B+=P}}else{var ce=[a.scale(I[0]),a.scale(I[1])],me=ce[0],ue=ce[1];if(M=me,$=Sk({axis:o,ticks:c,bandSize:i,offset:h.offset,entry:j,index:C}),R=ue-me,B=h.size,L={x:a.x,y:$,width:a.width,height:B},Math.abs(U)>0&&Math.abs(R)<Math.abs(U)){var He=_r(R||U)*(Math.abs(U)-Math.abs(R));R+=He}}return Ot(Ot(Ot({},j),{},{x:M,y:$,width:R,height:B,value:u?I:I[1],payload:j,background:L},k&&k[C]&&k[C].props),{},{tooltipPayload:[BO(n,j)],tooltipPosition:{x:M+R/2,y:$+B/2}})});return Ot({data:N,layout:g},p)});function Jc(e){"@babel/helpers - typeof";return Jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jc(e)}function ute(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cP(r.key),r)}}function dte(e,t,n){return t&&S_(e.prototype,t),n&&S_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function k_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k_(Object(n),!0).forEach(function(r){Nh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nh(e,t,n){return t=cP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cP(e){var t=fte(e,"string");return Jc(t)=="symbol"?t:t+""}function fte(e,t){if(Jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pte=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},p=!!Hn(u,dn);return d.reduce(function(h,g){var m=n[g],v=m.orientation,y=m.domain,b=m.padding,x=b===void 0?{}:b,_=m.mirror,S=m.reversed,w="".concat(v).concat(_?"Mirror":""),k,N,j,C,I;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var M=y[1]-y[0],$=1/0,R=m.categoricalDomain.sort(g3);if(R.forEach(function(ce,me){me>0&&($=Math.min((ce||0)-(R[me-1]||0),$))}),Number.isFinite($)){var B=$/M,L=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(k=B*L/2),m.padding==="no-gap"){var U=ro(t.barCategoryGap,B*L),O=B*L/2;k=O-U-(O-U)/L*U}}}i==="xAxis"?N=[r.left+(x.left||0)+(k||0),r.left+r.width-(x.right||0)-(k||0)]:i==="yAxis"?N=c==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(k||0),r.top+r.height-(x.bottom||0)-(k||0)]:N=m.range,S&&(N=[N[1],N[0]]);var z=MY(m,a,p),T=z.scale,V=z.realScaleType;T.domain(y).range(N),RY(T);var q=UY(T,wr(wr({},m),{},{realScaleType:V}));i==="xAxis"?(I=v==="top"&&!_||v==="bottom"&&_,j=r.left,C=f[w]-I*m.height):i==="yAxis"&&(I=v==="left"&&!_||v==="right"&&_,j=f[w]-I*m.width,C=r.top);var P=wr(wr(wr({},m),q),{},{realScaleType:V,x:j,y:C,scale:T,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return P.bandSize=qf(P,q),!m.hide&&i==="xAxis"?f[w]+=(I?-1:1)*P.height:m.hide||(f[w]+=(I?-1:1)*P.width),wr(wr({},h),{},Nh({},g,P))},{})},uP=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 uP({x:n,y:r},{x:i,y:a})},dP=function(){function e(t){ute(this,e),this.scale=t}return dte(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)}}])}();Nh(dP,"EPS",1e-4);var Qx=function(t){var n=Object.keys(t).reduce(function(r,i){return wr(wr({},r),{},Nh({},i,dP.create(t[i])))},{});return wr(wr({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return Mee(i,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return aP(i,function(a,o){return n[o].isInRange(a)})}})};function mte(e){return(e%180+180)%180}var gte=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=mte(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)},yte=da,vte=hu,bte=uh;function xte(e){return function(t,n,r){var i=Object(t);if(!vte(t)){var a=yte(n);t=bte(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 wte=xte,Ste=tP;function kte(e){var t=Ste(e),n=t%1;return t===t?n?t-n:t:0}var _te=kte,Ete=xC,Nte=da,jte=_te,Ate=Math.max;function Tte(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:jte(n);return i<0&&(i=Ate(r+i,0)),Ete(e,Nte(t),i)}var Cte=Tte,Ote=wte,Pte=Cte,Mte=Ote(Pte),Rte=Mte;const Ite=Ye(Rte);var $te=bz(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("")}),Jx=E.createContext(void 0),e0=E.createContext(void 0),fP=E.createContext(void 0),pP=E.createContext({}),hP=E.createContext(void 0),mP=E.createContext(0),gP=E.createContext(0),__=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=$te(a);return W.createElement(Jx.Provider,{value:r},W.createElement(e0.Provider,{value:i},W.createElement(pP.Provider,{value:a},W.createElement(fP.Provider,{value:d},W.createElement(hP.Provider,{value:o},W.createElement(mP.Provider,{value:u},W.createElement(gP.Provider,{value:c},l)))))))},Lte=function(){return E.useContext(hP)},yP=function(t){var n=E.useContext(Jx);n==null&&ao();var r=n[t];return r==null&&ao(),r},Dte=function(){var t=E.useContext(Jx);return Di(t)},Bte=function(){var t=E.useContext(e0),n=Ite(t,function(r){return aP(r.domain,Number.isFinite)});return n||Di(t)},vP=function(t){var n=E.useContext(e0);n==null&&ao();var r=n[t];return r==null&&ao(),r},zte=function(){var t=E.useContext(fP);return t},Fte=function(){return E.useContext(pP)},t0=function(){return E.useContext(gP)},n0=function(){return E.useContext(mP)};function Os(e){"@babel/helpers - typeof";return Os=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},Os(e)}function Ute(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wte(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 Hte(e,t,n){return t&&Wte(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gte(e,t,n){return t=sp(t),qte(e,bP()?Reflect.construct(t,n||[],sp(e).constructor):t.apply(e,n))}function qte(e,t){if(t&&(Os(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kte(e)}function Kte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bP=function(){return!!e})()}function sp(e){return sp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sp(e)}function Vte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&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 E_(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 N_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E_(Object(n),!0).forEach(function(r){r0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r0(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=Yte(e,"string");return Os(t)=="symbol"?t:t+""}function Yte(e,t){if(Os(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Os(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Xte(e,t){return ene(e)||Jte(e,t)||Qte(e,t)||Zte()}function Zte(){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 Qte(e,t){if(e){if(typeof e=="string")return j_(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 j_(e,t)}}function j_(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 Jte(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 ene(e){if(Array.isArray(e))return e}function Av(){return Av=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Av.apply(this,arguments)}var tne=function(t,n){var r;return W.isValidElement(t)?r=W.cloneElement(t,n):Ie(t)?r=t(n):r=W.createElement("line",Av({},n,{className:"recharts-reference-line-line"})),r},nne=function(t,n,r,i,a,o,l,c,u){var d=a.x,f=a.y,p=a.width,h=a.height;if(r){var g=u.y,m=t.y.apply(g,{position:o});if(Gr(u,"discard")&&!t.y.isInRange(m))return null;var v=[{x:d+p,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(Gr(u,"discard")&&!t.x.isInRange(b))return null;var x=[{x:b,y:f+h},{x:b,y:f}];return l==="top"?x.reverse():x}if(i){var _=u.segment,S=_.map(function(w){return t.apply(w,{position:o})});return Gr(u,"discard")&&Eee(S,function(w){return!t.isInRange(w)})?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=Lte(),d=yP(i),f=vP(a),p=zte();if(!u||!p)return null;ci(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=Qx({x:d.scale,y:f.scale}),g=Ut(t),m=Ut(n),v=r&&r.length===2,y=nne(h,g,m,v,p,e.position,d.orientation,f.orientation,e);if(!y)return null;var b=Xte(y,2),x=b[0],_=x.x,S=x.y,w=b[1],k=w.x,N=w.y,j=Gr(e,"hidden")?"url(#".concat(u,")"):void 0,C=N_(N_({clipPath:j},Ge(e,!0)),{},{x1:_,y1:S,x2:k,y2:N});return W.createElement(Vt,{className:qe("recharts-reference-line",l)},tne(o,C),hn.renderCallByParent(e,hte({x1:_,y1:S,x2:k,y2:N})))}var i0=function(e){function t(){return Ute(this,t),Gte(this,t,arguments)}return Vte(t,e),Hte(t,[{key:"render",value:function(){return W.createElement(rne,this.props)}}])}(W.Component);r0(i0,"displayName","ReferenceLine");r0(i0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Tv(){return Tv=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},Tv.apply(this,arguments)}function Ps(e){"@babel/helpers - typeof";return Ps=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},Ps(e)}function A_(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 T_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A_(Object(n),!0).forEach(function(r){jh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ine(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ane(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,SP(r.key),r)}}function one(e,t,n){return t&&ane(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function sne(e,t,n){return t=lp(t),lne(e,wP()?Reflect.construct(t,n||[],lp(e).constructor):t.apply(e,n))}function lne(e,t){if(t&&(Ps(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cne(e)}function cne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wP=function(){return!!e})()}function lp(e){return lp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lp(e)}function une(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 jh(e,t,n){return t=SP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SP(e){var t=dne(e,"string");return Ps(t)=="symbol"?t:t+""}function dne(e,t){if(Ps(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ps(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var fne=function(t){var n=t.x,r=t.y,i=t.xAxis,a=t.yAxis,o=Qx({x:i.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return Gr(t,"discard")&&!o.isInRange(l)?null:l},Ah=function(e){function t(){return ine(this,t),sne(this,t,arguments)}return une(t,e),one(t,[{key:"render",value:function(){var r=this.props,i=r.x,a=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=Ut(i),d=Ut(a);if(ci(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=fne(this.props);if(!f)return null;var p=f.x,h=f.y,g=this.props,m=g.shape,v=g.className,y=Gr(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=T_(T_({clipPath:y},Ge(this.props,!0)),{},{cx:p,cy:h});return W.createElement(Vt,{className:qe("recharts-reference-dot",v)},t.renderDot(m,b),hn.renderCallByParent(this.props,{x:p-o,y:h-o,width:2*o,height:2*o}))}}])}(W.Component);jh(Ah,"displayName","ReferenceDot");jh(Ah,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});jh(Ah,"renderDot",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):Ie(e)?n=e(t):n=W.createElement(JO,Tv({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});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 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 C_(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 O_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C_(Object(n),!0).forEach(function(r){Th(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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,_P(r.key),r)}}function mne(e,t,n){return t&&hne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gne(e,t,n){return t=cp(t),yne(e,kP()?Reflect.construct(t,n||[],cp(e).constructor):t.apply(e,n))}function yne(e,t){if(t&&(Ms(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 kP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kP=function(){return!!e})()}function cp(e){return cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cp(e)}function bne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pv(e,t)}function Pv(e,t){return Pv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Pv(e,t)}function Th(e,t,n){return t=_P(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _P(e){var t=xne(e,"string");return Ms(t)=="symbol"?t:t+""}function xne(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 String(e)}var wne=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 p=Qx({x:d.scale,y:f.scale}),h={x:t?p.x.apply(o,{position:"start"}):p.x.rangeMin,y:r?p.y.apply(c,{position:"start"}):p.y.rangeMin},g={x:n?p.x.apply(l,{position:"end"}):p.x.rangeMax,y:i?p.y.apply(u,{position:"end"}):p.y.rangeMax};return Gr(a,"discard")&&(!p.isInRange(h)||!p.isInRange(g))?null:uP(h,g)},Ch=function(e){function t(){return pne(this,t),gne(this,t,arguments)}return bne(t,e),mne(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;ci(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Ut(i),p=Ut(a),h=Ut(o),g=Ut(l),m=this.props.shape;if(!f&&!p&&!h&&!g&&!m)return null;var v=wne(f,p,h,g,this.props);if(!v&&!m)return null;var y=Gr(this.props,"hidden")?"url(#".concat(d,")"):void 0;return W.createElement(Vt,{className:qe("recharts-reference-area",c)},t.renderRect(m,O_(O_({clipPath:y},Ge(this.props,!0)),v)),hn.renderCallByParent(this.props,v))}}])}(W.Component);Th(Ch,"displayName","ReferenceArea");Th(Ch,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Th(Ch,"renderRect",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):Ie(e)?n=e(t):n=W.createElement(Zx,Ov({},t,{className:"recharts-reference-area-rect"})),n});function EP(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 Sne(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return gte(r,n)}function kne(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 up(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 _ne(e,t){return EP(e,t+1)}function Ene(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:EP(r,u)};var m=c,v,y=function(){return v===void 0&&(v=n(g,m)),v},b=g.coordinate,x=c===0||up(e,b,y,d,l);x||(c=0,d=o,u+=1),x&&(d=b+e*(y()/2+i),c+=u)},p;u<=a.length;)if(p=f(),p)return p.v;return[]}function eu(e){"@babel/helpers - typeof";return eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(e)}function P_(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 un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P_(Object(n),!0).forEach(function(r){Nne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nne(e,t,n){return t=jne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jne(e){var t=Ane(e,"string");return eu(t)=="symbol"?t:t+""}function Ane(e,t){if(eu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tne(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(p){var h=a[p],g,m=function(){return g===void 0&&(g=n(h,p)),g};if(p===o-1){var v=e*(h.coordinate+e*m()/2-c);a[p]=h=un(un({},h),{},{tickCoord:v>0?h.coordinate-v*e:h.coordinate})}else a[p]=h=un(un({},h),{},{tickCoord:h.coordinate});var y=up(e,h.tickCoord,m,l,c);y&&(c=h.tickCoord-e*(m()/2+i),a[p]=un(un({},h),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function Cne(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),p=e*(d.coordinate+e*f/2-u);o[l-1]=d=un(un({},d),{},{tickCoord:p>0?d.coordinate-p*e:d.coordinate});var h=up(e,d.tickCoord,function(){return f},c,u);h&&(u=d.tickCoord-e*(f/2+i),o[l-1]=un(un({},d),{},{isShow:!0}))}for(var g=a?l-1:l,m=function(b){var x=o[b],_,S=function(){return _===void 0&&(_=n(x,b)),_};if(b===0){var w=e*(x.coordinate-e*S()/2-c);o[b]=x=un(un({},x),{},{tickCoord:w<0?x.coordinate-w*e:x.coordinate})}else o[b]=x=un(un({},x),{},{tickCoord:x.coordinate});var k=up(e,x.tickCoord,S,c,u);k&&(c=x.tickCoord+e*(S()/2+i),o[b]=un(un({},x),{},{isShow:!0}))},v=0;v<g;v++)m(v);return o}function a0(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(se(c)||mu.isSsr)return _ne(i,typeof c=="number"&&se(c)?c:0);var p=[],h=l==="top"||l==="bottom"?"width":"height",g=d&&h==="width"?Vl(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(x,_){var S=Ie(u)?u(x.value,_):x.value;return h==="width"?Sne(Vl(S,{fontSize:t,letterSpacing:n}),g,f):Vl(S,{fontSize:t,letterSpacing:n})[h]},v=i.length>=2?_r(i[1].coordinate-i[0].coordinate):1,y=kne(a,v,h);return c==="equidistantPreserveStart"?Ene(v,y,m,i,o):(c==="preserveStart"||c==="preserveStartEnd"?p=Cne(v,y,m,i,o,c==="preserveStartEnd"):p=Tne(v,y,m,i,o),p.filter(function(b){return b.isShow}))}var One=["viewBox"],Pne=["viewBox"],Mne=["ticks"];function Rs(e){"@babel/helpers - typeof";return Rs=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},Rs(e)}function Zo(){return Zo=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},Zo.apply(this,arguments)}function M_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M_(Object(n),!0).forEach(function(r){o0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qm(e,t){if(e==null)return{};var n=Rne(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 Rne(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 Ine(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R_(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 $ne(e,t,n){return t&&R_(e.prototype,t),n&&R_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lne(e,t,n){return t=dp(t),Dne(e,NP()?Reflect.construct(t,n||[],dp(e).constructor):t.apply(e,n))}function Dne(e,t){if(t&&(Rs(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 NP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NP=function(){return!!e})()}function dp(e){return dp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dp(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&&Mv(e,t)}function Mv(e,t){return Mv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Mv(e,t)}function o0(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=Fne(e,"string");return Rs(t)=="symbol"?t:t+""}function Fne(e,t){if(Rs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var il=function(e){function t(n){var r;return Ine(this,t),r=Lne(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return zne(t,e),$ne(t,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,o=qm(r,One),l=this.props,c=l.viewBox,u=qm(l,Pne);return!os(a,c)||!os(o,u)||!os(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,p=i.tickMargin,h,g,m,v,y,b,x=f?-1:1,_=r.tickSize||d,S=se(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":h=g=r.coordinate,v=o+ +!f*c,m=v-x*_,b=m-x*p,y=S;break;case"left":m=v=r.coordinate,g=a+ +!f*l,h=g-x*_,y=h-x*p,b=S;break;case"right":m=v=r.coordinate,g=a+ +f*l,h=g+x*_,y=h+x*p,b=S;break;default:h=g=r.coordinate,v=o+ +f*c,m=v+x*_,b=m+x*p,y=S;break}return{line:{x1:h,y1:m,x2:g,y2:v},tick:{x:y,y:b}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=Dt(Dt(Dt({},Ge(this.props,!1)),Ge(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var p=+(c==="top"&&!u||c==="bottom"&&u);f=Dt(Dt({},f),{},{x1:i,y1:a+p*l,x2:i+o,y2:a+p*l})}else{var h=+(c==="left"&&!u||c==="right"&&u);f=Dt(Dt({},f),{},{x1:i+h*o,y1:a,x2:i+h*o,y2:a+l})}return W.createElement("line",Zo({},f,{className:qe("recharts-cartesian-axis-line",cr(d,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,p=l.unit,h=a0(Dt(Dt({},this.props),{},{ticks:r}),i,a),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),v=Ge(this.props,!1),y=Ge(d,!1),b=Dt(Dt({},v),{},{fill:"none"},Ge(c,!1)),x=h.map(function(_,S){var w=o.getTickLineCoord(_),k=w.line,N=w.tick,j=Dt(Dt(Dt(Dt({textAnchor:g,verticalAnchor:m},v),{},{stroke:"none",fill:u},y),N),{},{index:S,payload:_,visibleTicksCount:h.length,tickFormatter:f});return W.createElement(Vt,Zo({className:"recharts-cartesian-axis-tick",key:"tick-".concat(_.value,"-").concat(_.coordinate,"-").concat(_.tickCoord)},yf(o.props,_,S)),c&&W.createElement("line",Zo({},b,k,{className:qe("recharts-cartesian-axis-tick-line",cr(c,"className"))})),d&&t.renderTickItem(d,j,"".concat(Ie(f)?f(_.value,S):_.value).concat(p||"")))});return W.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,o=i.width,l=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var f=this.props,p=f.ticks,h=qm(f,Mne),g=p;return Ie(c)&&(g=p&&p.length>0?c(this.props):c(h)),o<=0||l<=0||!g||!g.length?null:W.createElement(Vt,{className:qe("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),hn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var o,l=qe(i.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?o=W.cloneElement(r,Dt(Dt({},i),{},{className:l})):Ie(r)?o=r(Dt(Dt({},i),{},{className:l})):o=W.createElement(Of,Zo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(E.Component);o0(il,"displayName","CartesianAxis");o0(il,"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 Une=["x1","y1","x2","y2","key"],Wne=["offset"];function oo(e){"@babel/helpers - typeof";return oo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oo(e)}function I_(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?I_(Object(n),!0).forEach(function(r){Hne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hne(e,t,n){return t=Gne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gne(e){var t=qne(e,"string");return oo(t)=="symbol"?t:t+""}function qne(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(t==="string"?String:Number)(e)}function Fa(){return Fa=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},Fa.apply(this,arguments)}function $_(e,t){if(e==null)return{};var n=Kne(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 Kne(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 Vne=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 W.createElement("rect",{x:i,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function AP(e,t){var n;if(W.isValidElement(e))n=W.cloneElement(e,t);else if(Ie(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,o=t.y2,l=t.key,c=$_(t,Une),u=Ge(c,!1);u.offset;var d=$_(u,Wne);n=W.createElement("line",Fa({},d,{x1:r,y1:i,x2:a,y2:o,fill:"none",key:l}))}return n}function Yne(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=mn(mn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return AP(i,u)});return W.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Xne(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=mn(mn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return AP(i,u)});return W.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Zne(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(p){return Math.round(p+i-i)}).sort(function(p,h){return p-h});i!==d[0]&&d.unshift(0);var f=d.map(function(p,h){var g=!d[h+1],m=g?i+o-p:d[h+1]-p;if(m<=0)return null;var v=h%t.length;return W.createElement("rect",{key:"react-".concat(h),y:p,x:r,height:m,width:a,stroke:"none",fill:t[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Qne(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(p){return Math.round(p+a-a)}).sort(function(p,h){return p-h});a!==d[0]&&d.unshift(0);var f=d.map(function(p,h){var g=!d[h+1],m=g?a+l-p:d[h+1]-p;if(m<=0)return null;var v=h%r.length;return W.createElement("rect",{key:"react-".concat(h),x:p,y:o,width:m,height:c,stroke:"none",fill:r[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Jne=function(t,n){var r=t.xAxis,i=t.width,a=t.height,o=t.offset;return LO(a0(mn(mn(mn({},il.defaultProps),r),{},{ticks:oi(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,n)},ere=function(t,n){var r=t.yAxis,i=t.width,a=t.height,o=t.offset;return LO(a0(mn(mn(mn({},il.defaultProps),r),{},{ticks:oi(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,n)},Co={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Bi(e){var t,n,r,i,a,o,l=t0(),c=n0(),u=Fte(),d=mn(mn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Co.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Co.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Co.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Co.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Co.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Co.verticalFill,x:se(e.x)?e.x:u.left,y:se(e.y)?e.y:u.top,width:se(e.width)?e.width:u.width,height:se(e.height)?e.height:u.height}),f=d.x,p=d.y,h=d.width,g=d.height,m=d.syncWithTicks,v=d.horizontalValues,y=d.verticalValues,b=Dte(),x=Bte();if(!se(h)||h<=0||!se(g)||g<=0||!se(f)||f!==+f||!se(p)||p!==+p)return null;var _=d.verticalCoordinatesGenerator||Jne,S=d.horizontalCoordinatesGenerator||ere,w=d.horizontalPoints,k=d.verticalPoints;if((!w||!w.length)&&Ie(S)){var N=v&&v.length,j=S({yAxis:x?mn(mn({},x),{},{ticks:N?v:x.ticks}):void 0,width:l,height:c,offset:u},N?!0:m);ci(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(oo(j),"]")),Array.isArray(j)&&(w=j)}if((!k||!k.length)&&Ie(_)){var C=y&&y.length,I=_({xAxis:b?mn(mn({},b),{},{ticks:C?y:b.ticks}):void 0,width:l,height:c,offset:u},C?!0:m);ci(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(oo(I),"]")),Array.isArray(I)&&(k=I)}return W.createElement("g",{className:"recharts-cartesian-grid"},W.createElement(Vne,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),W.createElement(Yne,Fa({},d,{offset:u,horizontalPoints:w,xAxis:b,yAxis:x})),W.createElement(Xne,Fa({},d,{offset:u,verticalPoints:k,xAxis:b,yAxis:x})),W.createElement(Zne,Fa({},d,{horizontalPoints:w})),W.createElement(Qne,Fa({},d,{verticalPoints:k})))}Bi.displayName="CartesianGrid";function Is(e){"@babel/helpers - typeof";return Is=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},Is(e)}function tre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nre(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,OP(r.key),r)}}function rre(e,t,n){return t&&nre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ire(e,t,n){return t=fp(t),are(e,TP()?Reflect.construct(t,n||[],fp(e).constructor):t.apply(e,n))}function are(e,t){if(t&&(Is(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ore(e)}function ore(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TP=function(){return!!e})()}function fp(e){return fp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fp(e)}function sre(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&&Rv(e,t)}function Rv(e,t){return Rv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Rv(e,t)}function CP(e,t,n){return t=OP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OP(e){var t=lre(e,"string");return Is(t)=="symbol"?t:t+""}function lre(e,t){if(Is(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Is(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Iv(){return Iv=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},Iv.apply(this,arguments)}function cre(e){var t=e.xAxisId,n=t0(),r=n0(),i=yP(t);return i==null?null:E.createElement(il,Iv({},i,{className:qe("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return oi(o,!0)}}))}var Br=function(e){function t(){return tre(this,t),ire(this,t,arguments)}return sre(t,e),rre(t,[{key:"render",value:function(){return E.createElement(cre,this.props)}}])}(E.Component);CP(Br,"displayName","XAxis");CP(Br,"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 $s(e){"@babel/helpers - typeof";return $s=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},$s(e)}function ure(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,RP(r.key),r)}}function fre(e,t,n){return t&&dre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pre(e,t,n){return t=pp(t),hre(e,PP()?Reflect.construct(t,n||[],pp(e).constructor):t.apply(e,n))}function hre(e,t){if(t&&($s(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 PP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PP=function(){return!!e})()}function pp(e){return pp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pp(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&&$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 MP(e,t,n){return t=RP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RP(e){var t=yre(e,"string");return $s(t)=="symbol"?t:t+""}function yre(e,t){if($s(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($s(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(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)}var vre=function(t){var n=t.yAxisId,r=t0(),i=n0(),a=vP(n);return a==null?null:E.createElement(il,Lv({},a,{className:qe("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(l){return oi(l,!0)}}))},zr=function(e){function t(){return ure(this,t),pre(this,t,arguments)}return gre(t,e),fre(t,[{key:"render",value:function(){return E.createElement(vre,this.props)}}])}(E.Component);MP(zr,"displayName","YAxis");MP(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 L_(e){return Sre(e)||wre(e)||xre(e)||bre()}function bre(){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 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 wre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Sre(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}var Bv=function(t,n,r,i,a){var o=jr(t,i0),l=jr(t,Ah),c=[].concat(L_(o),L_(l)),u=jr(t,Ch),d="".concat(i,"Id"),f=i[0],p=n;if(c.length&&(p=c.reduce(function(m,v){if(v.props[d]===r&&Gr(v.props,"extendDomain")&&se(v.props[f])){var y=v.props[f];return[Math.min(m[0],y),Math.max(m[1],y)]}return m},p)),u.length){var h="".concat(f,"1"),g="".concat(f,"2");p=u.reduce(function(m,v){if(v.props[d]===r&&Gr(v.props,"extendDomain")&&se(v.props[h])&&se(v.props[g])){var y=v.props[h],b=v.props[g];return[Math.min(m[0],y,b),Math.max(m[1],y,b)]}return m},p)}return a&&a.length&&(p=a.reduce(function(m,v){return se(v)?[Math.min(m[0],v),Math.max(m[1],v)]:m},p)),p},IP={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,p){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new i(d,f||c,p),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],h]:c._events[g].push(h):(c._events[g]=h,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 p=0,h=f.length,g=new Array(h);p<h;p++)g[p]=f[p].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,p,h,g){var m=n?n+u:u;if(!this._events[m])return!1;var v=this._events[m],y=arguments.length,b,x;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,p),!0;case 5:return v.fn.call(v.context,d,f,p,h),!0;case 6:return v.fn.call(v.context,d,f,p,h,g),!0}for(x=1,b=new Array(y-1);x<y;x++)b[x-1]=arguments[x];v.fn.apply(v.context,b)}else{var _=v.length,S;for(x=0;x<_;x++)switch(v[x].once&&this.removeListener(u,v[x].fn,void 0,!0),y){case 1:v[x].fn.call(v[x].context);break;case 2:v[x].fn.call(v[x].context,d);break;case 3:v[x].fn.call(v[x].context,d,f);break;case 4:v[x].fn.call(v[x].context,d,f,p);break;default:if(!b)for(S=1,b=new Array(y-1);S<y;S++)b[S-1]=arguments[S];v[x].fn.apply(v[x].context,b)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,p){var h=n?n+u:u;if(!this._events[h])return this;if(!d)return o(this,h),this;var g=this._events[h];if(g.fn)g.fn===d&&(!p||g.once)&&(!f||g.context===f)&&o(this,h);else{for(var m=0,v=[],y=g.length;m<y;m++)(g[m].fn!==d||p&&!g[m].once||f&&g[m].context!==f)&&v.push(g[m]);v.length?this._events[h]=v.length===1?v[0]:v:o(this,h)}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})(IP);var kre=IP.exports;const _re=Ye(kre);var Km=new _re,Vm="recharts.syncMouseEvents";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 Ere(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nre(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,$P(r.key),r)}}function jre(e,t,n){return t&&Nre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ym(e,t,n){return t=$P(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $P(e){var t=Are(e,"string");return tu(t)=="symbol"?t:t+""}function Are(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 String(e)}var Tre=function(){function e(){Ere(this,e),Ym(this,"activeIndex",0),Ym(this,"coordinateList",[]),Ym(this,"layout","horizontal")}return jre(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,p=n.mouseHandlerCallback,h=p===void 0?null:p;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=h??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,p=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:p})}}}])}();function Cre(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&&se(r)&&se(i))return!0}return!1}function Ore(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 LP(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,o=rn(t,n,r,i),l=rn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function Pre(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,p=rn(l,c,u,f),h=rn(l,c,d,f);r=p.x,i=p.y,a=h.x,o=h.y}else return LP(t);return[{x:r,y:i},{x:a,y: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 D_(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 dd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D_(Object(n),!0).forEach(function(r){Mre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mre(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 nu(t)=="symbol"?t:t+""}function Ire(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 $re(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,p=e.chartName,h=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!h||!a||!o||p!=="ScatterChart"&&i!=="axis")return null;var g,m=Dk;if(p==="ScatterChart")g=o,m=YQ;else if(p==="BarChart")g=Ore(f,o,c,d),m=Zx;else if(f==="radial"){var v=LP(o),y=v.cx,b=v.cy,x=v.radius,_=v.startAngle,S=v.endAngle;g={cx:y,cy:b,startAngle:_,endAngle:S,innerRadius:x,outerRadius:x},m=UO}else g={points:Pre(f,o,c)},m=Dk;var w=dd(dd(dd(dd({stroke:"#ccc",pointerEvents:"none"},c),g),Ge(h,!1)),{},{payload:l,payloadIndex:u,className:qe("recharts-tooltip-cursor",h.className)});return E.isValidElement(h)?E.cloneElement(h,w):E.createElement(m,w)}var Lre=["item"],Dre=["children","className","width","height","style","compact","title","desc"];function Ls(e){"@babel/helpers - typeof";return Ls=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},Ls(e)}function Qo(){return Qo=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},Qo.apply(this,arguments)}function B_(e,t){return Fre(e)||zre(e,t)||BP(e,t)||Bre()}function Bre(){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 zre(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 Fre(e){if(Array.isArray(e))return e}function z_(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 Wre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hre(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,zP(r.key),r)}}function Gre(e,t,n){return t&&Hre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qre(e,t,n){return t=hp(t),Kre(e,DP()?Reflect.construct(t,n||[],hp(e).constructor):t.apply(e,n))}function Kre(e,t){if(t&&(Ls(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vre(e)}function Vre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DP=function(){return!!e})()}function hp(e){return hp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hp(e)}function Yre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zv(e,t)}function zv(e,t){return zv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},zv(e,t)}function Ds(e){return Qre(e)||Zre(e)||BP(e)||Xre()}function Xre(){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 BP(e,t){if(e){if(typeof e=="string")return Fv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fv(e,t)}}function 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 Fv(e)}function Fv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function F_(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 Y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F_(Object(n),!0).forEach(function(r){Ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ne(e,t,n){return t=zP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zP(e){var t=Jre(e,"string");return Ls(t)=="symbol"?t:t+""}function Jre(e,t){if(Ls(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ls(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eie={xAxis:["bottom","top"],yAxis:["left","right"]},tie={width:"100%",height:"100%"},FP={x:0,y:0};function fd(e){return e}var nie=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 Y(Y(Y({},i),rn(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=i.angle;return Y(Y(Y({},i),rn(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return FP},Oh=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(Ds(l),Ds(u)):l},[]);return o.length>0?o:t&&t.length&&se(i)&&se(a)?t.slice(i,a+1):[]};function UP(e){return e==="number"?[0,"auto"]:void 0}var Uv=function(t,n,r,i){var a=t.graphicalItems,o=t.tooltipAxis,l=Oh(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 p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=f===void 0?l:f;p=wy(h,o.dataKey,i)}else p=f&&f[r]||l[r];return p?[].concat(Ds(c),[BO(u,p)]):c},[])},U_=function(t,n,r,i){var a=i||{x:t.chartX,y:t.chartY},o=nie(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=jY(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,p=Uv(t,n,d,f),h=rie(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:p,activeCoordinate:h}}return null},iie=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,p=t.stackOffset,h=$O(d,a);return r.reduce(function(g,m){var v,y=m.type.defaultProps!==void 0?Y(Y({},m.type.defaultProps),m.props):m.props,b=y.type,x=y.dataKey,_=y.allowDataOverflow,S=y.allowDuplicatedCategory,w=y.scale,k=y.ticks,N=y.includeHidden,j=y[o];if(g[j])return g;var C=Oh(t.data,{graphicalItems:i.filter(function(q){var P,ce=o in q.props?q.props[o]:(P=q.type.defaultProps)===null||P===void 0?void 0:P[o];return ce===j}),dataStartIndex:c,dataEndIndex:u}),I=C.length,M,$,R;Cre(y.domain,_,b)&&(M=lv(y.domain,null,_),h&&(b==="number"||w!=="auto")&&(R=Xl(C,x,"category")));var B=UP(b);if(!M||M.length===0){var L,U=(L=y.domain)!==null&&L!==void 0?L:B;if(x){if(M=Xl(C,x,b),b==="category"&&h){var O=m3(M);S&&O?($=M,M=np(0,I)):S||(M=Ek(U,M,m).reduce(function(q,P){return q.indexOf(P)>=0?q:[].concat(Ds(q),[P])},[]))}else if(b==="category")S?M=M.filter(function(q){return q!==""&&!Ke(q)}):M=Ek(U,M,m).reduce(function(q,P){return q.indexOf(P)>=0||P===""||Ke(P)?q:[].concat(Ds(q),[P])},[]);else if(b==="number"){var z=PY(C,i.filter(function(q){var P,ce,me=o in q.props?q.props[o]:(P=q.type.defaultProps)===null||P===void 0?void 0:P[o],ue="hide"in q.props?q.props.hide:(ce=q.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return me===j&&(N||!ue)}),x,a,d);z&&(M=z)}h&&(b==="number"||w!=="auto")&&(R=Xl(C,x,"category"))}else h?M=np(0,I):l&&l[j]&&l[j].hasStack&&b==="number"?M=p==="expand"?[0,1]:DO(l[j].stackGroups,c,u):M=IO(C,i.filter(function(q){var P=o in q.props?q.props[o]:q.type.defaultProps[o],ce="hide"in q.props?q.props.hide:q.type.defaultProps.hide;return P===j&&(N||!ce)}),b,d,!0);if(b==="number")M=Bv(f,M,j,a,k),U&&(M=lv(U,M,_));else if(b==="category"&&U){var T=U,V=M.every(function(q){return T.indexOf(q)>=0});V&&(M=T)}}return Y(Y({},g),{},Ne({},j,Y(Y({},y),{},{axisType:a,domain:M,categoricalDomain:R,duplicateDomain:$,originalDomain:(v=y.domain)!==null&&v!==void 0?v:B,isCategorical:h,layout:d})))},{})},aie=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,p=Oh(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),h=p.length,g=$O(d,a),m=-1;return r.reduce(function(v,y){var b=y.type.defaultProps!==void 0?Y(Y({},y.type.defaultProps),y.props):y.props,x=b[o],_=UP("number");if(!v[x]){m++;var S;return g?S=np(0,h):l&&l[x]&&l[x].hasStack?(S=DO(l[x].stackGroups,c,u),S=Bv(f,S,x,a)):(S=lv(_,IO(p,r.filter(function(w){var k,N,j=o in w.props?w.props[o]:(k=w.type.defaultProps)===null||k===void 0?void 0:k[o],C="hide"in w.props?w.props.hide:(N=w.type.defaultProps)===null||N===void 0?void 0:N.hide;return j===x&&!C}),"number",d),i.defaultProps.allowDataOverflow),S=Bv(f,S,x,a)),Y(Y({},v),{},Ne({},x,Y(Y({axisType:a},i.defaultProps),{},{hide:!0,orientation:cr(eie,"".concat(a,".").concat(m%2),null),domain:S,originalDomain:_,isCategorical:g,layout:d})))}return v},{})},oie=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"),p=jr(d,a),h={};return p&&p.length?h=iie(t,{axes:p,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(h=aie(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),h},sie=function(t){var n=Di(t),r=oi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:kx(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:qf(n,r)}},W_=function(t){var n=t.children,r=t.defaultShowTooltip,i=Hn(n,Ts),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}},lie=function(t){return!t||!t.length?!1:t.some(function(n){var r=li(n&&n.type);return r&&r.indexOf("Bar")>=0})},H_=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"}},cie=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,p=r.margin||{},h=Hn(f,Ts),g=Hn(f,Ga),m=Object.keys(c).reduce(function(S,w){var k=c[w],N=k.orientation;return!k.mirror&&!k.hide?Y(Y({},S),{},Ne({},N,S[N]+k.width)):S},{left:p.left||0,right:p.right||0}),v=Object.keys(o).reduce(function(S,w){var k=o[w],N=k.orientation;return!k.mirror&&!k.hide?Y(Y({},S),{},Ne({},N,cr(S,"".concat(N))+k.height)):S},{top:p.top||0,bottom:p.bottom||0}),y=Y(Y({},v),m),b=y.bottom;h&&(y.bottom+=h.props.height||Ts.defaultProps.height),g&&n&&(y=CY(y,i,r,n));var x=u-y.left-y.right,_=d-y.top-y.bottom;return Y(Y({brushBottom:b},y),{},{width:Math.max(x,0),height:Math.max(_,0)})},uie=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},die=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,p=function(y,b){var x=b.graphicalItems,_=b.stackGroups,S=b.offset,w=b.updateId,k=b.dataStartIndex,N=b.dataEndIndex,j=y.barSize,C=y.layout,I=y.barGap,M=y.barCategoryGap,$=y.maxBarSize,R=H_(C),B=R.numericAxisName,L=R.cateAxisName,U=lie(x),O=[];return x.forEach(function(z,T){var V=Oh(y.data,{graphicalItems:[z],dataStartIndex:k,dataEndIndex:N}),q=z.type.defaultProps!==void 0?Y(Y({},z.type.defaultProps),z.props):z.props,P=q.dataKey,ce=q.maxBarSize,me=q["".concat(B,"Id")],ue=q["".concat(L,"Id")],He={},Ce=c.reduce(function(Te,lt){var Me=b["".concat(lt.axisType,"Map")],Zt=q["".concat(lt.axisType,"Id")];Me&&Me[Zt]||lt.axisType==="zAxis"||ao();var Ht=Me[Zt];return Y(Y({},Te),{},Ne(Ne({},lt.axisType,Ht),"".concat(lt.axisType,"Ticks"),oi(Ht)))},He),te=Ce[L],ye=Ce["".concat(L,"Ticks")],be=_&&_[me]&&_[me].hasStack&&HY(z,_[me].stackGroups),X=li(z.type).indexOf("Bar")>=0,Ae=qf(te,ye),we=[],Se=U&&AY({barSize:j,stackGroups:_,totalSize:uie(Ce,L)});if(X){var ge,De,le=Ke(ce)?$:ce,Tt=(ge=(De=qf(te,ye,!0))!==null&&De!==void 0?De:le)!==null&&ge!==void 0?ge:0;we=TY({barGap:I,barCategoryGap:M,bandSize:Tt!==Ae?Tt:Ae,sizeList:Se[ue],maxBarSize:le}),Tt!==Ae&&(we=we.map(function(Te){return Y(Y({},Te),{},{position:Y(Y({},Te.position),{},{offset:Te.position.offset-Tt/2})})}))}var Fe=z&&z.type&&z.type.getComposedData;Fe&&O.push({props:Y(Y({},Fe(Y(Y({},Ce),{},{displayedData:V,props:y,dataKey:P,item:z,bandSize:Ae,barPosition:we,offset:S,stackedData:be,layout:C,dataStartIndex:k,dataEndIndex:N}))),{},Ne(Ne(Ne({key:z.key||"item-".concat(T)},B,Ce[B]),L,Ce[L]),"animationId",w)),childIndex:j3(z,y.children),item:z})}),O},h=function(y,b){var x=y.props,_=y.dataStartIndex,S=y.dataEndIndex,w=y.updateId;if(!b1({props:x}))return null;var k=x.children,N=x.layout,j=x.stackOffset,C=x.data,I=x.reverseStackOrder,M=H_(N),$=M.numericAxisName,R=M.cateAxisName,B=jr(k,r),L=FY(C,B,"".concat($,"Id"),"".concat(R,"Id"),j,I),U=c.reduce(function(q,P){var ce="".concat(P.axisType,"Map");return Y(Y({},q),{},Ne({},ce,oie(x,Y(Y({},P),{},{graphicalItems:B,stackGroups:P.axisType===$&&L,dataStartIndex:_,dataEndIndex:S}))))},{}),O=cie(Y(Y({},U),{},{props:x,graphicalItems:B}),b==null?void 0:b.legendBBox);Object.keys(U).forEach(function(q){U[q]=d(x,U[q],O,q.replace("Map",""),n)});var z=U["".concat(R,"Map")],T=sie(z),V=p(x,Y(Y({},U),{},{dataStartIndex:_,dataEndIndex:S,updateId:w,graphicalItems:B,stackGroups:L,offset:O}));return Y(Y({formattedGraphicalItems:V,graphicalItems:B,offset:O,stackGroups:L},T),U)},g=function(v){function y(b){var x,_,S;return Wre(this,y),S=qre(this,y,[b]),Ne(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ne(S,"accessibilityManager",new Tre),Ne(S,"handleLegendBBoxUpdate",function(w){if(w){var k=S.state,N=k.dataStartIndex,j=k.dataEndIndex,C=k.updateId;S.setState(Y({legendBBox:w},h({props:S.props,dataStartIndex:N,dataEndIndex:j,updateId:C},Y(Y({},S.state),{},{legendBBox:w}))))}}),Ne(S,"handleReceiveSyncEvent",function(w,k,N){if(S.props.syncId===w){if(N===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(k)}}),Ne(S,"handleBrushChange",function(w){var k=w.startIndex,N=w.endIndex;if(k!==S.state.dataStartIndex||N!==S.state.dataEndIndex){var j=S.state.updateId;S.setState(function(){return Y({dataStartIndex:k,dataEndIndex:N},h({props:S.props,dataStartIndex:k,dataEndIndex:N,updateId:j},S.state))}),S.triggerSyncEvent({dataStartIndex:k,dataEndIndex:N})}}),Ne(S,"handleMouseEnter",function(w){var k=S.getMouseInfo(w);if(k){var N=Y(Y({},k),{},{isTooltipActive:!0});S.setState(N),S.triggerSyncEvent(N);var j=S.props.onMouseEnter;Ie(j)&&j(N,w)}}),Ne(S,"triggeredAfterMouseMove",function(w){var k=S.getMouseInfo(w),N=k?Y(Y({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(N),S.triggerSyncEvent(N);var j=S.props.onMouseMove;Ie(j)&&j(N,w)}),Ne(S,"handleItemMouseEnter",function(w){S.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Ne(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Ne(S,"handleMouseMove",function(w){w.persist(),S.throttleTriggeredAfterMouseMove(w)}),Ne(S,"handleMouseLeave",function(w){S.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};S.setState(k),S.triggerSyncEvent(k);var N=S.props.onMouseLeave;Ie(N)&&N(k,w)}),Ne(S,"handleOuterEvent",function(w){var k=N3(w),N=cr(S.props,"".concat(k));if(k&&Ie(N)){var j,C;/.*touch.*/i.test(k)?C=S.getMouseInfo(w.changedTouches[0]):C=S.getMouseInfo(w),N((j=C)!==null&&j!==void 0?j:{},w)}}),Ne(S,"handleClick",function(w){var k=S.getMouseInfo(w);if(k){var N=Y(Y({},k),{},{isTooltipActive:!0});S.setState(N),S.triggerSyncEvent(N);var j=S.props.onClick;Ie(j)&&j(N,w)}}),Ne(S,"handleMouseDown",function(w){var k=S.props.onMouseDown;if(Ie(k)){var N=S.getMouseInfo(w);k(N,w)}}),Ne(S,"handleMouseUp",function(w){var k=S.props.onMouseUp;if(Ie(k)){var N=S.getMouseInfo(w);k(N,w)}}),Ne(S,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Ne(S,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&S.handleMouseDown(w.changedTouches[0])}),Ne(S,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&S.handleMouseUp(w.changedTouches[0])}),Ne(S,"handleDoubleClick",function(w){var k=S.props.onDoubleClick;if(Ie(k)){var N=S.getMouseInfo(w);k(N,w)}}),Ne(S,"handleContextMenu",function(w){var k=S.props.onContextMenu;if(Ie(k)){var N=S.getMouseInfo(w);k(N,w)}}),Ne(S,"triggerSyncEvent",function(w){S.props.syncId!==void 0&&Km.emit(Vm,S.props.syncId,w,S.eventEmitterSymbol)}),Ne(S,"applySyncEvent",function(w){var k=S.props,N=k.layout,j=k.syncMethod,C=S.state.updateId,I=w.dataStartIndex,M=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)S.setState(Y({dataStartIndex:I,dataEndIndex:M},h({props:S.props,dataStartIndex:I,dataEndIndex:M,updateId:C},S.state)));else if(w.activeTooltipIndex!==void 0){var $=w.chartX,R=w.chartY,B=w.activeTooltipIndex,L=S.state,U=L.offset,O=L.tooltipTicks;if(!U)return;if(typeof j=="function")B=j(O,w);else if(j==="value"){B=-1;for(var z=0;z<O.length;z++)if(O[z].value===w.activeLabel){B=z;break}}var T=Y(Y({},U),{},{x:U.left,y:U.top}),V=Math.min($,T.x+T.width),q=Math.min(R,T.y+T.height),P=O[B]&&O[B].value,ce=Uv(S.state,S.props.data,B),me=O[B]?{x:N==="horizontal"?O[B].coordinate:V,y:N==="horizontal"?q:O[B].coordinate}:FP;S.setState(Y(Y({},w),{},{activeLabel:P,activeCoordinate:me,activePayload:ce,activeTooltipIndex:B}))}else S.setState(w)}),Ne(S,"renderCursor",function(w){var k,N=S.state,j=N.isTooltipActive,C=N.activeCoordinate,I=N.activePayload,M=N.offset,$=N.activeTooltipIndex,R=N.tooltipAxisBandSize,B=S.getTooltipEventType(),L=(k=w.props.active)!==null&&k!==void 0?k:j,U=S.props.layout,O=w.key||"_recharts-cursor";return W.createElement($re,{key:O,activeCoordinate:C,activePayload:I,activeTooltipIndex:$,chartName:n,element:w,isActive:L,layout:U,offset:M,tooltipAxisBandSize:R,tooltipEventType:B})}),Ne(S,"renderPolarAxis",function(w,k,N){var j=cr(w,"type.axisType"),C=cr(S.state,"".concat(j,"Map")),I=w.type.defaultProps,M=I!==void 0?Y(Y({},I),w.props):w.props,$=C&&C[M["".concat(j,"Id")]];return E.cloneElement(w,Y(Y({},$),{},{className:qe(j,$.className),key:w.key||"".concat(k,"-").concat(N),ticks:oi($,!0)}))}),Ne(S,"renderPolarGrid",function(w){var k=w.props,N=k.radialLines,j=k.polarAngles,C=k.polarRadius,I=S.state,M=I.radiusAxisMap,$=I.angleAxisMap,R=Di(M),B=Di($),L=B.cx,U=B.cy,O=B.innerRadius,z=B.outerRadius;return E.cloneElement(w,{polarAngles:Array.isArray(j)?j:oi(B,!0).map(function(T){return T.coordinate}),polarRadius:Array.isArray(C)?C:oi(R,!0).map(function(T){return T.coordinate}),cx:L,cy:U,innerRadius:O,outerRadius:z,key:w.key||"polar-grid",radialLines:N})}),Ne(S,"renderLegend",function(){var w=S.state.formattedGraphicalItems,k=S.props,N=k.children,j=k.width,C=k.height,I=S.props.margin||{},M=j-(I.left||0)-(I.right||0),$=MO({children:N,formattedGraphicalItems:w,legendWidth:M,legendContent:u});if(!$)return null;var R=$.item,B=z_($,Lre);return E.cloneElement(R,Y(Y({},B),{},{chartWidth:j,chartHeight:C,margin:I,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Ne(S,"renderTooltip",function(){var w,k=S.props,N=k.children,j=k.accessibilityLayer,C=Hn(N,fn);if(!C)return null;var I=S.state,M=I.isTooltipActive,$=I.activeCoordinate,R=I.activePayload,B=I.activeLabel,L=I.offset,U=(w=C.props.active)!==null&&w!==void 0?w:M;return E.cloneElement(C,{viewBox:Y(Y({},L),{},{x:L.left,y:L.top}),active:U,label:B,payload:U?R:[],coordinate:$,accessibilityLayer:j})}),Ne(S,"renderBrush",function(w){var k=S.props,N=k.margin,j=k.data,C=S.state,I=C.offset,M=C.dataStartIndex,$=C.dataEndIndex,R=C.updateId;return E.cloneElement(w,{key:w.key||"_recharts-brush",onChange:sd(S.handleBrushChange,w.props.onChange),data:j,x:se(w.props.x)?w.props.x:I.left,y:se(w.props.y)?w.props.y:I.top+I.height+I.brushBottom-(N.bottom||0),width:se(w.props.width)?w.props.width:I.width,startIndex:M,endIndex:$,updateId:"brush-".concat(R)})}),Ne(S,"renderReferenceElement",function(w,k,N){if(!w)return null;var j=S,C=j.clipPathId,I=S.state,M=I.xAxisMap,$=I.yAxisMap,R=I.offset,B=w.type.defaultProps||{},L=w.props,U=L.xAxisId,O=U===void 0?B.xAxisId:U,z=L.yAxisId,T=z===void 0?B.yAxisId:z;return E.cloneElement(w,{key:w.key||"".concat(k,"-").concat(N),xAxis:M[O],yAxis:$[T],viewBox:{x:R.left,y:R.top,width:R.width,height:R.height},clipPathId:C})}),Ne(S,"renderActivePoints",function(w){var k=w.item,N=w.activePoint,j=w.basePoint,C=w.childIndex,I=w.isRange,M=[],$=k.props.key,R=k.item.type.defaultProps!==void 0?Y(Y({},k.item.type.defaultProps),k.item.props):k.item.props,B=R.activeDot,L=R.dataKey,U=Y(Y({index:C,dataKey:L,cx:N.x,cy:N.y,r:4,fill:Xx(k.item),strokeWidth:2,stroke:"#fff",payload:N.payload,value:N.value},Ge(B,!1)),gf(B));return M.push(y.renderActiveDot(B,U,"".concat($,"-activePoint-").concat(C))),j?M.push(y.renderActiveDot(B,Y(Y({},U),{},{cx:j.x,cy:j.y}),"".concat($,"-basePoint-").concat(C))):I&&M.push(null),M}),Ne(S,"renderGraphicChild",function(w,k,N){var j=S.filterFormatItem(w,k,N);if(!j)return null;var C=S.getTooltipEventType(),I=S.state,M=I.isTooltipActive,$=I.tooltipAxis,R=I.activeTooltipIndex,B=I.activeLabel,L=S.props.children,U=Hn(L,fn),O=j.props,z=O.points,T=O.isRange,V=O.baseLine,q=j.item.type.defaultProps!==void 0?Y(Y({},j.item.type.defaultProps),j.item.props):j.item.props,P=q.activeDot,ce=q.hide,me=q.activeBar,ue=q.activeShape,He=!!(!ce&&M&&U&&(P||me||ue)),Ce={};C!=="axis"&&U&&U.props.trigger==="click"?Ce={onClick:sd(S.handleItemMouseEnter,w.props.onClick)}:C!=="axis"&&(Ce={onMouseLeave:sd(S.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:sd(S.handleItemMouseEnter,w.props.onMouseEnter)});var te=E.cloneElement(w,Y(Y({},j.props),Ce));function ye(lt){return typeof $.dataKey=="function"?$.dataKey(lt.payload):null}if(He)if(R>=0){var be,X;if($.dataKey&&!$.allowDuplicatedCategory){var Ae=typeof $.dataKey=="function"?ye:"payload.".concat($.dataKey.toString());be=wy(z,Ae,B),X=T&&V&&wy(V,Ae,B)}else be=z==null?void 0:z[R],X=T&&V&&V[R];if(ue||me){var we=w.props.activeIndex!==void 0?w.props.activeIndex:R;return[E.cloneElement(w,Y(Y(Y({},j.props),Ce),{},{activeIndex:we})),null,null]}if(!Ke(be))return[te].concat(Ds(S.renderActivePoints({item:j,activePoint:be,basePoint:X,childIndex:R,isRange:T})))}else{var Se,ge=(Se=S.getItemByXY(S.state.activeCoordinate))!==null&&Se!==void 0?Se:{graphicalItem:te},De=ge.graphicalItem,le=De.item,Tt=le===void 0?w:le,Fe=De.childIndex,Te=Y(Y(Y({},j.props),Ce),{},{activeIndex:Fe});return[E.cloneElement(Tt,Te),null,null]}return T?[te,null,null]:[te,null]}),Ne(S,"renderCustomized",function(w,k,N){return E.cloneElement(w,Y(Y({key:"recharts-customized-".concat(N)},S.props),S.state))}),Ne(S,"renderMap",{CartesianGrid:{handler:fd,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:fd},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:fd},YAxis:{handler:fd},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:ah("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=RC(S.triggeredAfterMouseMove,(_=b.throttleDelay)!==null&&_!==void 0?_:1e3/60),S.state={},S}return Yre(y,v),Gre(y,[{key:"componentDidMount",value:function(){var x,_;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,_=x.children,S=x.data,w=x.height,k=x.layout,N=Hn(_,fn);if(N){var j=N.props.defaultIndex;if(!(typeof j!="number"||j<0||j>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[j]&&this.state.tooltipTicks[j].value,I=Uv(this.state,S,j,C),M=this.state.tooltipTicks[j].coordinate,$=(this.state.offset.top+w)/2,R=k==="horizontal",B=R?{x:M,y:$}:{y:M,x:$},L=this.state.formattedGraphicalItems.find(function(O){var z=O.item;return z.type.name==="Scatter"});L&&(B=Y(Y({},B),L.props.points[j].tooltipPosition),I=L.props.points[j].tooltipPayload);var U={activeTooltipIndex:j,isTooltipActive:!0,activeLabel:C,activePayload:I,activeCoordinate:B};this.setState(U),this.renderCursor(N),this.accessibilityManager.setIndex(j)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,_){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==_.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var S,w;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(x){ky([Hn(x.children,fn)],[Hn(this.props.children,fn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Hn(this.props.children,fn);if(x&&typeof x.props.shared=="boolean"){var _=x.props.shared?"axis":"item";return l.indexOf(_)>=0?_:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var _=this.container,S=_.getBoundingClientRect(),w=JG(S),k={chartX:Math.round(x.pageX-w.left),chartY:Math.round(x.pageY-w.top)},N=S.width/_.offsetWidth||1,j=this.inRange(k.chartX,k.chartY,N);if(!j)return null;var C=this.state,I=C.xAxisMap,M=C.yAxisMap,$=this.getTooltipEventType(),R=U_(this.state,this.props.data,this.props.layout,j);if($!=="axis"&&I&&M){var B=Di(I).scale,L=Di(M).scale,U=B&&B.invert?B.invert(k.chartX):null,O=L&&L.invert?L.invert(k.chartY):null;return Y(Y({},k),{},{xValue:U,yValue:O},R)}return R?Y(Y({},k),R):null}},{key:"inRange",value:function(x,_){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,k=x/S,N=_/S;if(w==="horizontal"||w==="vertical"){var j=this.state.offset,C=k>=j.left&&k<=j.left+j.width&&N>=j.top&&N<=j.top+j.height;return C?{x:k,y:N}:null}var I=this.state,M=I.angleAxisMap,$=I.radiusAxisMap;if(M&&$){var R=Di(M);return Ak({x:k,y:N},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,_=this.getTooltipEventType(),S=Hn(x,fn),w={};S&&_==="axis"&&(S.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var k=gf(this.props,this.handleOuterEvent);return Y(Y({},k),w)}},{key:"addListener",value:function(){Km.on(Vm,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Km.removeListener(Vm,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,_,S){for(var w=this.state.formattedGraphicalItems,k=0,N=w.length;k<N;k++){var j=w[k];if(j.item===x||j.props.key===x.key||_===li(j.item.type)&&S===j.childIndex)return j}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,_=this.state.offset,S=_.left,w=_.top,k=_.height,N=_.width;return W.createElement("defs",null,W.createElement("clipPath",{id:x},W.createElement("rect",{x:S,y:w,height:k,width:N})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(_,S){var w=B_(S,2),k=w[0],N=w[1];return Y(Y({},_),{},Ne({},k,N.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(_,S){var w=B_(S,2),k=w[0],N=w[1];return Y(Y({},_),{},Ne({},k,N.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var _;return(_=this.state.xAxisMap)===null||_===void 0||(_=_[x])===null||_===void 0?void 0:_.scale}},{key:"getYScaleByAxisId",value:function(x){var _;return(_=this.state.yAxisMap)===null||_===void 0||(_=_[x])===null||_===void 0?void 0:_.scale}},{key:"getItemByXY",value:function(x){var _=this.state,S=_.formattedGraphicalItems,w=_.activeItem;if(S&&S.length)for(var k=0,N=S.length;k<N;k++){var j=S[k],C=j.props,I=j.item,M=I.type.defaultProps!==void 0?Y(Y({},I.type.defaultProps),I.props):I.props,$=li(I.type);if($==="Bar"){var R=(C.data||[]).find(function(O){return BQ(x,O)});if(R)return{graphicalItem:j,payload:R}}else if($==="RadialBar"){var B=(C.data||[]).find(function(O){return Ak(x,O)});if(B)return{graphicalItem:j,payload:B}}else if(_h(j,w)||Eh(j,w)||Xc(j,w)){var L=UJ({graphicalItem:j,activeTooltipItem:w,itemData:M.data}),U=M.activeIndex===void 0?L:M.activeIndex;return{graphicalItem:Y(Y({},j),{},{childIndex:U}),payload:Xc(j,w)?M.data[L]:j.props.data[L]}}}return null}},{key:"render",value:function(){var x=this;if(!b1(this))return null;var _=this.props,S=_.children,w=_.className,k=_.width,N=_.height,j=_.style,C=_.compact,I=_.title,M=_.desc,$=z_(_,Dre),R=Ge($,!1);if(C)return W.createElement(__,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement(Ey,Qo({},R,{width:k,height:N,title:I,desc:M}),this.renderClipPath(),w1(S,this.renderMap)));if(this.props.accessibilityLayer){var B,L;R.tabIndex=(B=this.props.tabIndex)!==null&&B!==void 0?B:0,R.role=(L=this.props.role)!==null&&L!==void 0?L:"application",R.onKeyDown=function(O){x.accessibilityManager.keyboardEvent(O)},R.onFocus=function(){x.accessibilityManager.focus()}}var U=this.parseEventsOfWrapper();return W.createElement(__,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement("div",Qo({className:qe("recharts-wrapper",w),style:Y({position:"relative",cursor:"default",width:k,height:N},j)},U,{ref:function(z){x.container=z}}),W.createElement(Ey,Qo({},R,{width:k,height:N,title:I,desc:M,style:tie}),this.renderClipPath(),w1(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(E.Component);Ne(g,"displayName",n),Ne(g,"defaultProps",Y({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Ne(g,"getDerivedStateFromProps",function(v,y){var b=v.dataKey,x=v.data,_=v.children,S=v.width,w=v.height,k=v.layout,N=v.stackOffset,j=v.margin,C=y.dataStartIndex,I=y.dataEndIndex;if(y.updateId===void 0){var M=W_(v);return Y(Y(Y({},M),{},{updateId:0},h(Y(Y({props:v},M),{},{updateId:0}),y)),{},{prevDataKey:b,prevData:x,prevWidth:S,prevHeight:w,prevLayout:k,prevStackOffset:N,prevMargin:j,prevChildren:_})}if(b!==y.prevDataKey||x!==y.prevData||S!==y.prevWidth||w!==y.prevHeight||k!==y.prevLayout||N!==y.prevStackOffset||!os(j,y.prevMargin)){var $=W_(v),R={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},B=Y(Y({},U_(y,x,k)),{},{updateId:y.updateId+1}),L=Y(Y(Y({},$),R),B);return Y(Y(Y({},L),h(Y({props:v},L),y)),{},{prevDataKey:b,prevData:x,prevWidth:S,prevHeight:w,prevLayout:k,prevStackOffset:N,prevMargin:j,prevChildren:_})}if(!ky(_,y.prevChildren)){var U,O,z,T,V=Hn(_,Ts),q=V&&(U=(O=V.props)===null||O===void 0?void 0:O.startIndex)!==null&&U!==void 0?U:C,P=V&&(z=(T=V.props)===null||T===void 0?void 0:T.endIndex)!==null&&z!==void 0?z:I,ce=q!==C||P!==I,me=!Ke(x),ue=me&&!ce?y.updateId:y.updateId+1;return Y(Y({updateId:ue},h(Y(Y({props:v},y),{},{updateId:ue,dataStartIndex:q,dataEndIndex:P}),y)),{},{prevChildren:_,dataStartIndex:q,dataEndIndex:P})}return null}),Ne(g,"renderActiveDot",function(v,y,b){var x;return E.isValidElement(v)?x=E.cloneElement(v,y):Ie(v)?x=v(y):x=W.createElement(JO,y),W.createElement(Vt,{className:"recharts-active-dot",key:b},x)});var m=E.forwardRef(function(y,b){return W.createElement(g,Qo({},y,{ref:b}))});return m.displayName=g.displayName,m},Ma=die({chartName:"BarChart",GraphicalChild:dn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Br},{axisType:"yAxis",AxisComp:zr}],formatAxisMap:pte});function G_(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Ci(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}const fie={local:"#3fb950",groq:"#58a6ff",gemini:"#bc8cff",nim:"#39d2c0",openrouter:"#d29922"};function pie({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:G_(t.totalCost),label:"Total Cost"},{icon:"๐Ÿ“ž",value:Ci(t.totalRequests),label:"API Requests"},{icon:"๐Ÿง ",value:Ci(i.total),label:"Trajectories"},{icon:"๐Ÿ“",value:Ci(n.total),label:"Chat Sessions"},{icon:"๐Ÿ†",value:Ci(r.totalRuns),label:"Benchmark Runs"},{icon:"๐Ÿ“ฆ",value:Ci(a.vectors),label:"Vector Entries"}],l=Object.entries(t.byProvider||{}).map(([p,h])=>({name:p,value:h})).sort((p,h)=>h.value-p.value),c=Object.entries(i.byFingerprint||{}).map(([p,h])=>({name:p.length>15?p.slice(0,13)+"..":p,value:h})).sort((p,h)=>h.value-p.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(p=>s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon",children:p.icon}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:p.value}),s.jsx("div",{className:"stat-label",children:p.label})]})]},p.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:Ci(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:Ci(((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:Ci(((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(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Bi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"},tickFormatter:p=>"$"+p.toFixed(4)}),s.jsx(fn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:p=>[G_(p),"Cost"]}),s.jsx(dn,{dataKey:"value",radius:[4,4,0,0],children:l.map(p=>s.jsx(Nc,{fill:fie[p.name]||"#58a6ff",fillOpacity:.8},p.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(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Bi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{dataKey:"name",tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(zr,{tick:{fill:"#8b949e",fontSize:11},axisLine:{stroke:"#30363d"}}),s.jsx(fn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(dn,{dataKey:"value",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})}):s.jsx("div",{className:"empty-state",children:"No trajectory data yet."})})]})}const q_={planner:"๐Ÿ“‹","context-gatherer":"๐Ÿ“‚",writer:"โœ๏ธ",reviewer:"๐Ÿ‘๏ธ",tester:"๐Ÿงช",debugger:"๐Ÿ›",runner:"โ–ถ๏ธ",git:"๐Ÿ”€",package:"๐Ÿ“ฆ","github-release":"๐Ÿท๏ธ",security:"๐Ÿ”’",orchestrator:"๐ŸŽฏ"},K_={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"},Xm={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"},V_={pending:{icon:"โณ",label:"Pending"},running:{icon:"โ–ถ๏ธ",label:"Running"},completed:{icon:"โœ…",label:"Done"},failed:{icon:"โŒ",label:"Failed"}},hie={pending:"#6e7681",running:"#58a6ff",completed:"#3fb950",failed:"#f85149"};function mie(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 gie(e,t){const n=[],r=new Set,i=mie(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 Oi(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 Y_(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function yie(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 p=a[f]/o,h=l;return l+=p,{...d,start:h,width:p,dur:a[f]}}),u=t>0?t:o;return{laid:c,total:u}}function vie({runs:e,selectedRunId:t,onSelectRun:n,onScrub:r}){const[i,a]=E.useState(null),o=e.find(k=>k.id===(t??i))??e[0]??null,[l,c]=E.useState(0),[u,d]=E.useState(!1),f=E.useRef(null),p=E.useRef(!1),h=E.useRef(r);E.useEffect(()=>{h.current=r},[r]),E.useEffect(()=>{var k;!o&&e.length>0?a(e[0].id):o&&!e.some(N=>N.id===o.id)&&a(((k=e[0])==null?void 0:k.id)??null)},[e,o]);const{laid:g,total:m}=E.useMemo(()=>yie((o==null?void 0:o.phases)||[],(o==null?void 0:o.totalDurationMs)||0),[o]),v=m>0?Math.min(1,Math.max(0,l/m)):0,y=E.useMemo(()=>{if(m<=0)return null;const k=v*m;return g.find(N=>k>=N.start*m&&k<(N.start+N.width)*m)||null},[g,v,m]);E.useEffect(()=>{var k;(k=h.current)==null||k.call(h,(y==null?void 0:y.id)??null)},[y==null?void 0:y.id]),E.useEffect(()=>{if(!u)return;const k=setInterval(()=>{c(N=>N+m/2e3*50)},50);return()=>clearInterval(k)},[u,m]),E.useEffect(()=>{u&&m>0&&l>=m&&(d(!1),c(0))},[u,m,l]);const b=E.useCallback(k=>{const N=f.current;if(!N||m<=0)return;const j=N.getBoundingClientRect(),C=j.width||1,I=Math.min(1,Math.max(0,(k-j.left)/C));c(I*m)},[m]),x=k=>{p.current=!0,d(!1),b(k.clientX)};if(E.useEffect(()=>{const k=j=>{p.current&&b(j.clientX)},N=()=>{p.current=!1};return window.addEventListener("pointermove",k),window.addEventListener("pointerup",N),()=>{window.removeEventListener("pointermove",k),window.removeEventListener("pointerup",N)}},[b]),!o)return s.jsx("div",{className:"phase-timeline phase-timeline-empty",children:s.jsx("p",{children:"No pipeline runs yet. Run an agent task to see its phase timeline here."})});const _=o.id.startsWith("live-"),S=o.phases.filter(k=>k.status==="completed").length,w=o.phases.filter(k=>k.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(k=>s.jsxs("button",{className:`phase-run-chip ${k.id===o.id?"active":""} ${k.id.startsWith("live-")?"live":""}`,onClick:()=>{a(k.id),c(0),d(!1),n==null||n(k.id)},title:k.goal,children:[k.id.startsWith("live-")&&s.jsx("span",{className:"dag-live-dot"}),k.goal.length>32?k.goal.slice(0,30)+"โ€ฆ":k.goal,s.jsx("span",{className:"phase-run-chip-time",children:Y_(k.startedAt)})]},k.id))}),s.jsxs("div",{className:"phase-timeline-meta",children:[_&&s.jsx("span",{className:"dag-live-badge",children:"LIVE"}),s.jsxs("span",{className:"phase-meta-item",children:[o.phases.length," steps"]}),s.jsxs("span",{className:"phase-meta-item phase-meta-ok",children:["โœ… ",S]}),w>0&&s.jsxs("span",{className:"phase-meta-item phase-meta-bad",children:["โŒ ",w]}),s.jsxs("span",{className:"phase-meta-item",children:["โฑ ",Oi(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:[Oi(l)," / ",Oi(m)]}),s.jsx("input",{className:"phase-range",type:"range",min:0,max:m||1,step:1,value:Math.min(l,m||1),onChange:k=>{d(!1),c(Number(k.target.value))},"aria-label":"Scrub pipeline timeline"})]}),s.jsxs("div",{className:"phase-track-wrap",children:[s.jsxs("div",{ref:f,className:"phase-track",onPointerDown:x,style:{cursor:"grab"},children:[g.map(k=>{const N=K_[k.agentType]||"#58a6ff",j=hie[k.status],C=(y==null?void 0:y.id)===k.id;return s.jsxs("button",{className:`phase-block phase-block-${k.status} ${C?"active":""}`,style:{left:`${k.start*100}%`,width:`${Math.max(k.width*100,2)}%`,background:`linear-gradient(180deg, ${N}cc, ${N}66)`,boxShadow:C?`0 0 0 2px ${j}`:void 0},onClick:I=>{I.stopPropagation(),d(!1),c((k.start+k.width/2)*m)},title:`${Xm[k.agentType]||k.agentType}: ${k.description}`,children:[s.jsx("span",{className:"phase-block-icon",children:q_[k.agentType]||"โš™๏ธ"}),s.jsx("span",{className:"phase-block-label",children:Xm[k.agentType]||k.agentType})]},k.id)}),s.jsx("div",{className:"phase-caret",style:{left:`${v*100}%`},onPointerDown:k=>{k.stopPropagation(),x(k)},title:`${Oi(l)} elapsed`})]}),s.jsxs("div",{className:"phase-ticks",children:[s.jsx("span",{children:"0"}),s.jsx("span",{children:Oi(Math.round(m/2))}),s.jsx("span",{children:Oi(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:q_[y.agentType]||"โš™๏ธ"}),s.jsx("span",{className:"phase-detail-agent",style:{color:K_[y.agentType]||"#58a6ff"},children:Xm[y.agentType]||y.agentType}),s.jsxs("span",{className:`phase-status-badge phase-status-${y.status}`,children:[V_[y.status].icon," ",V_[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?Oi(y.dur):`~${Oi(y.dur)}`]}),y.startedAt?s.jsxs("span",{children:["๐Ÿ• ",Y_(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."})]})})]})}const X_={planner:"๐Ÿ“‹","context-gatherer":"๐Ÿ“‚",writer:"โœ๏ธ",reviewer:"๐Ÿ‘๏ธ",tester:"๐Ÿงช",debugger:"๐Ÿ›",runner:"โ–ถ๏ธ",git:"๐Ÿ”€",package:"๐Ÿ“ฆ","github-release":"๐Ÿท๏ธ",security:"๐Ÿ”’",orchestrator:"๐ŸŽฏ"},Zm={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"},bie={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"}},Z_={pending:"โณ Pending",running:"โ–ถ๏ธ Running",completed:"โœ… Done",failed:"โŒ Failed"},Oo={trivial:{icon:"๐ŸŸข",color:"#3fb950"},simple:{icon:"๐Ÿ”ต",color:"#58a6ff"},moderate:{icon:"๐ŸŸก",color:"#d29922"},complex:{icon:"๐ŸŸ ",color:"#f0883e"},critical:{icon:"๐Ÿ”ด",color:"#f85149"}},Qm={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 xie(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(_=>_.to===v);if(y.length===0)return l.set(v,0),0;const x=Math.max(...y.map(_=>u(_.from)))+1;return l.set(v,x),x}for(const v of e)u(v.id);const d=new Map;for(const v of e){const y=l.get(v.id)??0;d.has(y)||d.set(y,[]),d.get(y).push(v)}const f=Math.max(...d.keys()),p=Math.max(...Array.from(d.values()).map(v=>v.length)),h=(f+1)*(n+i)+o*2-i,g=Math.max(p,1)*(r+a)+o*2-a,m=[];for(const v of e){const y=l.get(v.id)??0,b=d.get(y),x=b.indexOf(v),_=b.length,S=_*(r+a)-a,w=g/2-S/2;m.push({...v,x:o+y*(n+i),y:w+x*(r+a),w:n,h:r,step:y,totalInStep:_,indexInStep:x})}return{layoutNodes:m,svgW:h,svgH:g}}function Q_(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 J_(e){return e?new Date(e).toLocaleTimeString("en-US",{minute:"2-digit",second:"2-digit"}):""}function wie({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 Sie({data:e}){var N;const t=e==null?void 0:e.dag,n=(N=e==null?void 0:e.memory)==null?void 0:N.total,[r,i]=E.useState(null),[a,o]=E.useState(null);E.useEffect(()=>ee.onDAGEvent(C=>{i(C)}),[]);const l=t||r,c=E.useMemo(()=>gie(l,e==null?void 0:e.pipelineRuns),[l,e==null?void 0:e.pipelineRuns]),u=j=>{o(j)},d=!!(l&&(l.nodes.length>0||l.active)),f=c.length>0;if(!d&&!f)return s.jsx(wie,{memoryTotal:n});const{nodes:p,edges:h,pipeline:g,active:m}=l??{nodes:[],edges:[],pipeline:null,active:!1},{layoutNodes:v,svgW:y,svgH:b}=xie(p,h),x=p.filter(j=>j.status==="running").length,_=p.filter(j=>j.status==="completed").length,S=p.filter(j=>j.status==="failed").length,w=p.filter(j=>j.status==="pending").length,k=p.length;return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"๐Ÿ”€ Agent Execution DAG"}),f&&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(vie,{runs:c,onScrub:u})]}),d&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`dag-status-bar ${m?"active":""}`,children:[s.jsxs("div",{className:"dag-pipeline-name",children:[m&&s.jsx("span",{className:"dag-live-dot"}),g||"Execution Pipeline"]}),s.jsxs("div",{className:"dag-pipeline-meta",children:[m&&s.jsx("span",{className:"dag-live-badge",children:"LIVE"}),s.jsxs("span",{className:"dag-step-count",children:[k," steps"]}),x>0&&s.jsxs("span",{className:"dag-running-badge",children:["โ–ถ ",x," running"]}),w>0&&s.jsxs("span",{className:"dag-pending-badge",children:["โณ ",w," pending"]}),s.jsxs("span",{className:"dag-completed-badge",children:["โœ… ",_," done"]}),S>0&&s.jsxs("span",{className:"dag-failed-badge",children:["โŒ ",S," failed"]})]})]}),s.jsx("div",{className:"dag-container",children:s.jsxs("svg",{width:y,height:b,viewBox:`0 0 ${y} ${b}`,children:[s.jsxs("defs",{children:[h.map(j=>s.jsx("marker",{id:`arrow-${j.from}-${j.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-${j.from}-${j.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"})]})]})]}),h.map(j=>{const C=v.find(z=>z.id===j.from),I=v.find(z=>z.id===j.to);if(!C||!I)return null;const M=C.x+C.w,$=C.y+C.h/2,R=I.x,B=I.y+I.h/2,L=(M+R)/2,U=I.status,O=U==="failed"?"#f85149":U==="running"?"#58a6ff":U==="completed"?"#3fb950":"#30363d";return s.jsx("g",{children:s.jsx("path",{d:`M ${M} ${$} C ${L} ${$}, ${L} ${B}, ${R} ${B}`,fill:"none",stroke:O,strokeWidth:U==="pending"?1.5:2.5,strokeOpacity:U==="pending"?.3:.8,markerEnd:`url(#arrow-${j.from}-${j.to})`,className:"dag-edge"})},`edge-${j.from}-${j.to}`)}),v.map(j=>{const C=bie[j.status];Zm[j.agentType];const I=X_[j.agentType]||"โš™๏ธ",M=Qm[j.agentType]||j.agentType,$=a===j.id,R=j.status==="running";return s.jsxs("g",{onClick:()=>o($?null:j.id),style:{cursor:"pointer"},className:"dag-node-group",children:[$&&s.jsx("rect",{x:j.x-4,y:j.y-4,width:j.w+8,height:j.h+8,rx:10,ry:10,fill:"none",stroke:"#58a6ff",strokeWidth:2,strokeOpacity:.5}),s.jsx("rect",{x:j.x,y:j.y,width:j.w,height:j.h,rx:8,ry:8,fill:C.bg,stroke:C.stroke,strokeWidth:R?2.5:1.5,strokeOpacity:.9,className:R?"dag-node-running":"",filter:R?"url(#glow)":void 0}),s.jsxs("text",{x:j.x+10,y:j.y+22,fill:"#e6edf3",fontSize:10,fontWeight:600,children:[I," ",M]}),s.jsx("text",{x:j.x+j.w-10,y:j.y+22,textAnchor:"end",fill:C.text,fontSize:9,fontWeight:500,children:Z_[j.status]}),s.jsx("text",{x:j.x+10,y:j.y+40,fill:"#8b949e",fontSize:9,children:j.description.length>28?j.description.slice(0,26)+"..":j.description}),j.complexity&&Oo[j.complexity]&&s.jsxs("text",{x:j.x+10,y:j.y+54,fill:Oo[j.complexity].color,fontSize:8,fontWeight:600,children:[Oo[j.complexity].icon," ",j.complexity]}),s.jsx("text",{x:j.x+10,y:j.y+56,fill:"#6e7681",fontSize:8,children:Q_(j.startedAt,j.completedAt)}),s.jsx("text",{x:j.x+j.w-10,y:j.y+56,textAnchor:"end",fill:"#6e7681",fontSize:8,children:J_(j.startedAt||j.completedAt)}),(j.status==="failed"||$)&&j.summary&&s.jsx("foreignObject",{x:Math.max(10,j.x-80),y:j.y+j.h+6,width:j.w+160,height:36,children:s.jsx("div",{className:"dag-node-summary",style:{color:j.status==="failed"?"#f85149":"#8b949e",fontSize:"10px",lineHeight:1.4,background:"rgba(13,17,23,0.9)",padding:"4px 8px",borderRadius:"4px",border:`1px solid ${j.status==="failed"?"rgba(248,81,73,0.3)":"rgba(48,54,61,0.5)"}`,maxHeight:"32px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j.summary})})]},`node-${j.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:v.map(j=>s.jsxs("tr",{className:`dag-row dag-row-${j.status}`,children:[s.jsx("td",{className:"dag-cell-step",children:j.step}),s.jsxs("td",{className:"dag-cell-agent",children:[s.jsx("span",{className:"dag-agent-dot",style:{background:Zm[j.agentType]||"#58a6ff"}}),Qm[j.agentType]||j.agentType]}),s.jsx("td",{className:"dag-cell-complexity",children:j.complexity&&Oo[j.complexity]?s.jsxs("span",{style:{color:Oo[j.complexity].color,fontSize:12},children:[Oo[j.complexity].icon," ",j.complexity]}):s.jsx("span",{style:{color:"#6e7681",fontSize:12},children:"โ€”"})}),s.jsx("td",{className:`dag-cell-status dag-status-${j.status}`,children:Z_[j.status]}),s.jsx("td",{className:"dag-cell-duration",children:Q_(j.startedAt,j.completedAt)}),s.jsx("td",{className:"dag-cell-time",children:J_(j.startedAt||j.completedAt)}),s.jsx("td",{className:"dag-cell-summary",children:j.summary||j.description||"--"})]},j.id))})]})}),s.jsx("h3",{className:"section-subtitle",children:"Agent Types"}),s.jsxs("div",{className:"dag-legend",children:[Object.entries(X_).map(([j,C])=>s.jsxs("div",{className:"legend-item",children:[s.jsx("span",{className:"legend-dot",style:{background:Zm[j]||"#58a6ff"}}),s.jsx("span",{className:"legend-icon",children:C}),s.jsx("span",{className:"legend-label",children:Qm[j]||j})]},j)),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 Po(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Cl(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function kie(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function _ie({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:Po(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:Cl(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:Cl(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:Po(t.measuredCost)}),s.jsxs("span",{className:"cost-label",children:[Cl(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:Po(t.estimatedCost)}),s.jsxs("span",{className:"cost-label",children:[Cl(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:Po(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:Po(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:kie(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:Po(a.costUsd)}),s.jsxs("span",{className:"request-tokens",children:[Cl(a.totalTokens)," tok"]})]},o))})]})}function Eie(e){return e==null?"$0.00":"$"+e.toFixed(6)}function pd(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function Nie({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:pd(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:Eie(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(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Bi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{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(fn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Pass Rate"]}),s.jsx(dn,{dataKey:"passRate",radius:[4,4,0,0],children:c.map((u,d)=>s.jsx(Nc,{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(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Bi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{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(fn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"ms","Latency"]}),s.jsx(dn,{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(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Bi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{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(fn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>["$"+u.toFixed(6),"Cost"]}),s.jsx(dn,{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:pd(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:pd(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:pd(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(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Bi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{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(fn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"},formatter:u=>[u+"%","Composite Score"]}),s.jsx(dn,{dataKey:"score",radius:[4,4,0,0],children:l.map((u,d)=>s.jsx(Nc,{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(Pa,{width:"100%",height:260,children:s.jsxs(Ma,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[s.jsx(Bi,{strokeDasharray:"3 3",stroke:"#21262d"}),s.jsx(Br,{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(fn,{contentStyle:{background:"#161b22",border:"1px solid #30363d",borderRadius:8},labelStyle:{color:"#e6edf3"}}),s.jsx(Ga,{wrapperStyle:{color:"#8b949e"}}),s.jsx(dn,{dataKey:"completion",name:"Completion",fill:"#3fb950",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(dn,{dataKey:"tests",name:"Tests",fill:"#58a6ff",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(dn,{dataKey:"recovery",name:"Recovery",fill:"#d29922",radius:[4,4,0,0],fillOpacity:.8}),s.jsx(dn,{dataKey:"efficiency",name:"Token Eff.",fill:"#bc8cff",radius:[4,4,0,0],fillOpacity:.8})]})})})]}),s.jsx("h3",{className:"section-subtitle",children:"Eval Run History"}),s.jsx("div",{className:"benchmark-list",children:a.length===0?s.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",s.jsx("code",{children:"buff eval run"})," to start."]}):a.map(u=>{const d=Math.round(u.summary.avgCompositeScore*100),f=d>=80?"high":d>=50?"medium":"low";return s.jsxs("div",{className:"benchmark-item",children:[s.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),s.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),s.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})}),s.jsx("h3",{className:"section-subtitle",children:"Run History"}),s.jsx("div",{className:"benchmark-list",children:i.length===0?s.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",s.jsx("code",{children:"buff benchmark"})," to start."]}):i.map(u=>{const d=u.summary.totalTasks>0?Math.round(u.summary.tasksPassed/u.summary.totalTasks*100):0,f=d>=80?"high":d>=50?"medium":"low";return s.jsxs("div",{className:"benchmark-item",children:[s.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),s.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),s.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})})]})}function Jm(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function jie({data:e}){if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading system data..."})});const{health:t,serverTime:n}=e;return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"โš™๏ธ System Health"}),s.jsxs("div",{className:"health-grid",children:[s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"๐Ÿ’พ"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Memory Directory"}),s.jsx("div",{className:"health-path",children:t.memoryDir||"~/.buff/memory/"})]})]}),s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"๐Ÿ“"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Coding Patterns"}),s.jsx("div",{className:"health-value",children:Jm(t.patterns)})]})]}),s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"๐Ÿ‘"}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"User Feedback"}),s.jsxs("div",{className:"health-value",children:[Jm(t.feedback)," ratings"]})]})]}),s.jsxs("div",{className:"health-card",children:[s.jsx("span",{className:"health-icon",children:"๐Ÿง "}),s.jsxs("div",{className:"health-body",children:[s.jsx("div",{className:"health-title",children:"Vector Index"}),s.jsxs("div",{className:"health-value",children:[Jm(t.vectors)," entries"]})]})]})]}),s.jsx("h3",{className:"section-subtitle",children:"Server Info"}),s.jsxs("div",{className:"server-info",children:[s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Status"}),s.jsx("span",{className:"info-value",children:"โ— Connected"})]}),s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Last Updated"}),s.jsx("span",{className:"info-value",children:n?new Date(n).toLocaleString():"--"})]}),s.jsxs("div",{className:"info-row",children:[s.jsx("span",{className:"info-label",children:"Data Directory"}),s.jsx("span",{className:"info-value",children:t.memoryDir||"~/.buff/memory/"})]})]})]})}const Aie=new Set(["local","lmstudio","vllm"]),Tie=new Set([]),mp={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"}},Cie=[3,4,5],WP=12e3,eE=[300,700],Oie=6e4,Pie=5e3;function Mie(e){return new Promise(t=>setTimeout(t,e))}async function HP(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{return await fetch(e,{signal:n.signal})}finally{clearTimeout(r)}}function GP(e){return e instanceof TypeError||e instanceof Error&&e.name==="AbortError"}async function Rie(e){let t=null,n=!1;for(let r=0;;r++){try{const i=await HP("/api/models",WP);if(!i.ok)t=i.status;else{const a=await Oa(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(!GP(i))throw i;n=!0,e==null||e()}if(r>=eE.length)throw new Error(n?"Dashboard server unreachable โ€” is it still running? Retrying automaticallyโ€ฆ":`Model health endpoint failed (HTTP ${t})`);await Mie(eE[r])}}async function Iie(e){for(let t=0;;t++)try{const n=await HP("/api/model-registry",WP);return n.ok?await Oa(n):null}catch(n){if(!GP(n)||t>=1)return null;e==null||e()}}function $ie(e){return e==="available"?"Available":e==="limited"?"Limited":"Unavailable"}function Lie(e){return e==="available"?"Ready":e==="limited"?"Limited":"Down"}function qP(e){return{local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ",openai:"๐Ÿค–",anthropic:"๐Ÿ”ฎ",mistral:"๐ŸŒ€",cohere:"๐Ÿง ",together:"๐ŸŸข",deepinfra:"๐ŸŒ",fireworks:"๐ŸŽ†",perplexity:"โ“",azure:"๐Ÿ”ต",anyscale:"๐Ÿ”ท",lmstudio:"๐ŸŽจ",vllm:"โšก"}[e]||"๐Ÿ”Œ"}function s0(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 tE({status:e,label:t}){const n=mp[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 Die({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 Bie({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"]})]})]})}function hd({provider:e}){const[t,n]=E.useState(!1),r=mp[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(tE,{status:e.overallStatus,label:$ie(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:mp[a.status].dot,marginRight:8}}),a.name]}),s.jsx("td",{style:{padding:"8px 12px"},children:s.jsx(tE,{status:a.status,label:Lie(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 KP(e){if(e<=0)return"now";const t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4);return t>0?`${t}h ${n}m`:n>0?`${n}m`:`${Math.ceil(e/1e3)}s`}function zie(e){return e==="verified"?{text:"#3fb950",bg:"#0a2e1a",dot:"#3fb950"}:e==="unavailable"?{text:"#f85149",bg:"#2d0f0f",dot:"#f85149"}:{text:"#8b949e",bg:"#21262d",dot:"#8b949e"}}function Fie({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 Uie({tokens:e}){const t=e>=1048576?`${(e/1048576).toFixed(1).replace(/\.0$/,"")}M`:e>=1024?`${(e/1024).toFixed(0)}K`:`${e}`;return s.jsxs("span",{title:`โณ context window ${e.toLocaleString()} tokens โ€” live from the provider's model list (v1.60.x); feeds the router's context preflight`,style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"#0a1e2e",border:"1px solid #58a6ff",color:"#58a6ff"},children:["โณ ",t]})}function Wie({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 p=r+f/(e.length-1)*(t-r*2),h=n-r-d.rate/i*(n-r*2);return`${p.toFixed(1)},${h.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 Hie({entry:e}){const t=zie(e.status),n=e.remainingTokens>=0?`${e.remainingTokens.toLocaleString()} left`:"unlimited";return s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"8px 12px",color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:t.dot,marginRight:8}}),e.model.length>32?e.model.slice(0,29)+"โ€ฆ":e.model,(e.partialRate??0)>0&&s.jsx(Fie,{rate:e.partialRate??0}),e.partialHistory&&e.partialHistory.length>=2&&s.jsx(Wie,{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(Uie,{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?KP(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 Gie({provider:e}){const[t,n]=E.useState(!1),r=e.verified>0?"#3fb950":e.unavailable>0?"#f85149":"#8b949e";return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[s.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[s.jsx("span",{style:{fontSize:24},children:qP(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:s0(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(Hie,{entry:i},i.model))})]})})]})}function qie(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 Kie({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"})]})]})]}),qie(e.keyHygiene),e.providers.map(t=>s.jsx(Gie,{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 Vie={chat:"๐Ÿ’ฌ",execute:"โš™๏ธ",plan:"๐Ÿ—บ๏ธ",edit:"โœ๏ธ",skill:"๐Ÿงฉ",learn:"๐Ÿ“š",ci:"๐Ÿ”",doctor:"๐Ÿฉบ",probe:"๐Ÿ”ญ","spot-check":"๐Ÿงช",telemetry:"๐Ÿ“ก",usage:"๐Ÿงฎ"};function Yie(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 Xie(e){return Vie[e]||"๐ŸŽฏ"}function Zie(e){return e?new Date(e).toLocaleDateString()+" "+new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"โ€”"}function Ua({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:p=>{p.currentTarget.style.transform="scale(1.05)"},onMouseLeave:p=>{p.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 Qie(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 Jie(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 eae({timeline:e}){const[t,n]=E.useState(()=>Jie(e||[])),[r,i]=E.useState(!1),a=E.useRef(null),o=E.useRef(!1),l=(e==null?void 0:e.length)??0,c=Math.max(0,Math.min(t,l-1));E.useEffect(()=>{n(m=>Math.min(m,Math.max(0,l-1)))},[l]);const u=E.useCallback(m=>{const v=a.current;if(!v||l<=0)return;const y=v.getBoundingClientRect(),b=y.width||1,x=Math.min(1,Math.max(0,(m-y.left)/b));n(Math.min(l-1,Math.floor(x*l)))},[l]),d=m=>{o.current=!0,i(!1),u(m.clientX)};if(E.useEffect(()=>{const m=y=>{o.current&&u(y.clientX)},v=()=>{o.current=!1};return window.addEventListener("pointermove",m),window.addEventListener("pointerup",v),()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v)}},[u]),E.useEffect(()=>{if(!r||l<=1)return;const m=setInterval(()=>{n(v=>Math.min(l-1,v+1))},300);return()=>clearInterval(m)},[r,l]),E.useEffect(()=>{r&&l>1&&t>=l-1&&(i(!1),n(0))},[r,l,t]),!e||l===0)return null;const f=Math.max(1,...e.map(m=>m.verified+m.killed+m.transient+(m.partial||0))),p=m=>new Date(m).toLocaleDateString([],{month:"short",day:"numeric"}),h=e[c],g=h?Qie(h.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:[p(h.day)," ยท โœ“ ",h.verified," ยท โœ— ",h.killed,h.transient>0?` ยท ~ ${h.transient}`:"",h.partial>0?` ยท โธ ${h.partial}`:""]}),s.jsx("input",{type:"range",min:0,max:Math.max(0,l-1),step:1,value:c,onChange:m=>{i(!1),n(Number(m.target.value))},"aria-label":"Scrub action timeline",style:{flex:1,accentColor:"#58a6ff",cursor:"pointer",minWidth:80}})]}),s.jsx("div",{ref:a,onPointerDown:d,style:{position:"relative",display:"flex",alignItems:"flex-end",gap:3,height:64,padding:"0 2px",cursor:"grab",userSelect:"none",touchAction:"none"},children:e.map((m,v)=>{const y=m.verified+m.killed+m.transient+(m.partial||0),b=m.verified/f*56,x=m.killed/f*56,_=m.transient/f*56,S=(m.partial||0)/f*56,w=v===c;return s.jsxs("div",{onClick:()=>{i(!1),n(v)},title:`${p(m.day)} โ€” โœ“ ${m.verified} verified ยท โœ— ${m.killed} killed ยท ~ ${m.transient} transient${(m.partial||0)>0?` ยท โธ ${m.partial} partial`:""}`,style:{flex:1,display:"flex",flexDirection:"column-reverse",alignItems:"center",gap:0,cursor:"pointer"},children:[s.jsxs("div",{style:{position:"relative",width:"100%",borderRadius:3,overflow:w?"visible":"hidden",background:y===0?"#21262d":"transparent",height:y===0?4:56,display:"flex",flexDirection:"column-reverse",boxShadow:w?"0 0 0 1.5px #58a6ff":void 0,opacity:y===0?.5:1,transition:"box-shadow 0.15s"},children:[w&&s.jsx("div",{style:{position:"absolute",top:-3,bottom:-3,width:2,left:"50%",transform:"translateX(-50%)",background:"#58a6ff",borderRadius:2,pointerEvents:"none",boxShadow:"0 0 8px #58a6ff88",zIndex:1}}),m.verified>0&&s.jsx("div",{style:{height:b,background:"#3fb950",minHeight:3}}),m.killed>0&&s.jsx("div",{style:{height:x,background:"#f85149",minHeight:3}}),m.transient>0&&s.jsx("div",{style:{height:_,background:"#d29922",minHeight:3}}),m.partial>0&&s.jsx("div",{style:{height:S,background:"#bc8cff",minHeight:3}})]}),s.jsx("div",{style:{fontSize:9,color:w?"#58a6ff":"#6e7681",marginTop:4,whiteSpace:"nowrap",fontWeight:w?700:400},children:p(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:[p(h.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(Ua,{provider:m.provider,model:m.model,reason:m.errorType,killed:!0},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="verified"?s.jsx(Ua,{provider:m.provider,model:m.model},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="partial"?s.jsx(Ua,{provider:m.provider,model:m.model,reason:m.errorType,partial:!0,streamedChunks:m.streamedChunks},`${m.provider}|${m.model}|${m.outcome}`):s.jsx(Ua,{provider:m.provider,model:m.model,reason:m.errorType,transient:!0},`${m.provider}|${m.model}|${m.outcome}`))})]})]})}function tae({entry:e}){var i,a;const[t,n]=E.useState(!0),r=(e.partial||0)>0?"#bc8cff":e.killed>0?"#f85149":e.verified>0?"#3fb950":"#d29922";return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:`1px solid ${r}33`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[s.jsxs("div",{onClick:()=>n(!t),style:{padding:"12px 16px",cursor:"pointer",display:"flex",alignItems:"center",gap:12,userSelect:"none"},children:[s.jsx("span",{style:{fontSize:20},children:Xie(e.action)}),s.jsxs("div",{style:{flex:1},children:[s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3",marginBottom:2},children:Yie(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(Ua,{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(Ua,{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(Ua,{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(eae,{timeline:e.timeline})]})]})}function nae({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:Zie(t.updatedAt)}),s.jsx("div",{className:"stat-label",children:"Last update"})]})]})]}),t.actions.map(n=>s.jsx(tae,{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 md({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 rae({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 iae({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:"}),Cie.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 aae({model:e,provider:t}){const n=mp[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:[qP(t)," ",s0(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.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 ",KP(e.resetsInMs)]})]})})}function oae({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)||s0(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(aae,{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 sae(){return s.jsxs("div",{style:{background:"#161b22",borderRadius:12,border:"1px dashed #30363d",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[s.jsx("div",{style:{fontSize:24,marginBottom:8},children:"๐ŸŽ™๏ธ"}),s.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#e6edf3",marginBottom:4},children:"Speech / TTS Provider"}),s.jsxs("div",{style:{fontSize:12,color:"#6e7681"},children:["Speech/TTS provider support coming soon."," ",s.jsx("a",{href:"https://github.com/imdheerajKube/agent-nuvira/issues/new",target:"_blank",rel:"noopener noreferrer",style:{color:"#58a6ff",textDecoration:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.textDecoration="underline"},onMouseLeave:e=>{e.currentTarget.style.textDecoration="none"},children:"Request a provider"})]})]})}function lae(){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 cae(){const[e,t]=E.useState(null),[n,r]=E.useState(null),[i,a]=E.useState(!0),[o,l]=E.useState(null),[c,u]=E.useState(4),[d,f]=E.useState(""),p=E.useRef(!0),h=E.useRef(null),g=E.useRef(!1);function m(){h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{p.current&&v()},Pie)}async function v(){a(!0),l(null),g.current=!1;try{const[b,x]=await Promise.all([Rie(()=>{g.current=!0}),Iie(()=>{g.current=!0})]);if(!p.current)return;t(b),r(x),g.current&&m()}catch(b){if(!p.current)return;l(b instanceof Error&&b.message?b.message:"Failed to fetch model status"),g.current&&m()}finally{p.current&&a(!1)}}E.useEffect(()=>{p.current=!0,v();const b=setInterval(v,Oie);return()=>{p.current=!1,clearInterval(b),h.current&&clearTimeout(h.current)}},[]);function y(b){const x=[],_=[],S=[],w=[],k={available:0,limited:1,unavailable:2};for(const N of b.providers)Tie.has(N.provider)?S.push(N):Aie.has(N.provider)?_.push(N):N.overallStatus==="available"?x.push(N):w.push(N);return x.sort((N,j)=>k[N.overallStatus]-k[j.overallStatus]),_.sort((N,j)=>k[N.overallStatus]-k[j.overallStatus]),S.sort((N,j)=>k[N.overallStatus]-k[j.overallStatus]),w.sort((N,j)=>k[N.overallStatus]-k[j.overallStatus]),{available:x,local:_,speech:S,unavailable:w}}return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"๐Ÿง  Model Provider Status"}),s.jsx("p",{className:"section-description",children:"Real-time health check of all AI providers and their available models. Providers are grouped into sections: Available cloud โ†’ Local โ†’ Unavailable."}),s.jsx(Die,{onRefresh:v,loading:i}),s.jsx(lae,{}),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(Bie,{data:e}),(()=>{const{available:b,local:x,speech:_,unavailable:S}=y(e);return s.jsxs(s.Fragment,{children:[s.jsx(md,{icon:"โœ…",title:"Available Cloud Providers",count:b.length}),b.map(w=>s.jsx(hd,{provider:w},w.provider)),s.jsx(md,{icon:"๐Ÿ ",title:"Local Providers",count:x.length}),x.map(w=>s.jsx(hd,{provider:w},w.provider)),s.jsx(md,{icon:"โ›”",title:"Unavailable Providers",count:S.length}),S.map(w=>s.jsx(hd,{provider:w},w.provider)),s.jsx(md,{icon:"๐ŸŽ™๏ธ",title:"Speech / TTS Providers",count:_.length}),_.map(w=>s.jsx(hd,{provider:w},w.provider))]})})(),s.jsx(rae,{value:d,onChange:f,totalCount:e.providers.reduce((b,x)=>b+x.models.length,0)}),s.jsx(iae,{value:c,onChange:u}),s.jsx(oae,{providers:e.providers,colsPerRow:c,searchQuery:d}),n&&s.jsx(Kie,{data:n}),n&&s.jsx(nae,{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(sae,{}),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 uae={local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ"},dae={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},fae={trivial:"๐ŸŸข",simple:"๐Ÿ”ต",moderate:"๐ŸŸก",complex:"๐ŸŸ ",critical:"๐Ÿ”ด"},VP={trivial:"๐ŸŸข trivial",simple:"๐Ÿ”ต simple",moderate:"๐ŸŸก moderate",complex:"๐ŸŸ  complex",critical:"๐Ÿ”ด critical"},pae={chat:"๐Ÿ’ฌ chat",orchestrator:"๐Ÿ”€ orchestrator",explain:"๐Ÿ” explain",benchmark:"๐Ÿ“ˆ benchmark",eval:"๐ŸŽฏ eval"},ka=[{key:"request",icon:"๐ŸŽฏ",title:"Request"},{key:"candidates",icon:"โš–๏ธ",title:"Candidates"},{key:"exclusions",icon:"๐Ÿšซ",title:"Exclusions"},{key:"pick",icon:"โœ…",title:"Pick"}],hae=2400;function eg(e){return uae[e]||"๐Ÿ”Œ"}function nE(e){return dae[e]||e}function l0(e){return e&&pae[e]||e||"unknown"}function mae(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 rE(e){const t=Math.ceil(e/6e4);return t>=60?`${Math.floor(t/60)}h ${t%60}m`:`${t}m`}const gae=8;function iE(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 ${rE(r.resetsInMs)}`:"quota exhausted โ€” parked":r&&r.cooldownRemaining>0?`circuit-breaker cooldown โ€” ${rE(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 yae(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,gae)){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)),p=[...t].filter(g=>!f.has(g)).map(g=>({provider:g,reason:iE(g,e)})),h=(o=d.find(g=>g.provider===c.provider))==null?void 0:o.reason;r.push({id:c.id,label:`${l0(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:h,candidates:d,exclusions:p})}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)),p=[...t].filter(g=>!f.has(g)).map(g=>({provider:g,reason:iE(g,e)})),h=u[0];r.push({id:`profile-${c.complexity}`,label:`${VP[c.complexity]||c.complexity} โ€” what the router would pick`,real:!1,complexity:c.complexity,task:h?`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===h))==null?void 0:l.reason,candidates:d,exclusions:p})}return r}function vae(e,t){switch(e){case"request":return`A ${t.complexity} task arrives${t.source?` from ${l0(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 bae({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 xae({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 wae({routing:e}){const t=E.useMemo(()=>yae(e),[e]),[n,r]=E.useState(""),[i,a]=E.useState(0),[o,l]=E.useState(!1);if(E.useEffect(()=>{t.length!==0&&(t.some(h=>h.id===n)||(r(t[0].id),a(0)))},[t,n]),E.useEffect(()=>{if(!o||t.length===0)return;const h=setInterval(()=>{a(g=>(g+1)%ka.length)},hae);return()=>clearInterval(h)},[o,t.length]),t.length===0)return null;const c=t.find(h=>h.id===n)??t[0],u=ka[i],d=()=>{a(h=>(h+ka.length-1)%ka.length),l(!1)},f=()=>{a(h=>(h+1)%ka.length),l(!1)},p=()=>l(h=>!h);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:h=>{r(h.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(h=>s.jsxs("option",{value:h.id,style:{background:"#0d1117",color:"#e6edf3"},children:[h.real?"โ— ":"โ—‹ ",h.label]},h.id))}),s.jsx(xae,{icon:u.icon,title:`${i+1}. ${u.title}${i>0?` โ€” ${c.complexity}`:""}`,narration:vae(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:[fae[c.complexity]||"โ€ข"," ",VP[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:l0(c.source)}),c.timestamp&&s.jsx("span",{style:{fontSize:11,color:"#6e7681",marginLeft:"auto"},children:mae(c.timestamp)})]}),s.jsx("div",{style:{fontSize:13,color:"#e6edf3"},children:c.task})]}),u.key==="candidates"&&s.jsxs("div",{children:[c.candidates.map((h,g)=>{const m=h.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:[eg(h.provider)," ",nE(h.provider).split(" ")[0],m&&" ๐Ÿ‘‘"]}),s.jsx(bae,{value:h.score,color:m?"#3fb950":"#58a6ff"}),s.jsx("span",{style:{width:44,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"#8b949e"},children:h.score.toFixed(3)})]},h.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(h=>s.jsxs("div",{style:{fontSize:12,color:"#8b949e",marginBottom:3},children:[s.jsx("span",{style:{color:"#e6edf3"},children:h.provider}),": ",h.reason||"scored"]},h.provider))]})]}),u.key==="exclusions"&&(c.exclusions.length>0?s.jsx("div",{children:c.exclusions.map(h=>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:[eg(h.provider)," ",nE(h.provider).split(" ")[0]]}),s.jsx("span",{style:{flex:1,fontSize:12,color:"#8b949e"},children:h.reason})]},h.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:[eg(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:tg,children:"โ—€"}),s.jsx("button",{onClick:p,"aria-label":o?"Pause playback":"Play playback",style:{...tg,minWidth:84,color:o?"#d29922":"#3fb950"},children:o?"โธ Pause":"โ–ถ Play"}),s.jsx("button",{onClick:f,"aria-label":"Next step",style:tg,children:"โ–ถ"}),s.jsx("div",{style:{display:"flex",gap:6,marginLeft:8},children:ka.map((h,g)=>s.jsx("button",{"aria-label":`Go to step ${g+1}: ${h.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:h.title,children:h.icon},h.key))}),s.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"#6e7681"},children:["step ",i+1,"/",ka.length]})]})]})}const tg={background:"#21262d",color:"#e6edf3",border:"1px solid #30363d",borderRadius:8,padding:"6px 12px",fontSize:13,cursor:"pointer",transition:"background 0.15s"},Sae={local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ"},kae={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},YP={trivial:"๐ŸŸข",simple:"๐Ÿ”ต",moderate:"๐ŸŸก",complex:"๐ŸŸ ",critical:"๐Ÿ”ด"};function Ar(e){return Sae[e]||"๐Ÿ”Œ"}function na(e){return kae[e]||e}function gp(e,t=1){return`${(e*100).toFixed(t)}%`}function _ae(e){return`$${e.toFixed(6)}`}function Xn({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 c0({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 Jo(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 Eae(){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 Nae={chat:"๐Ÿ’ฌ chat",orchestrator:"๐Ÿ”€ orchestrator",explain:"๐Ÿ” explain",benchmark:"๐Ÿ“ˆ benchmark",eval:"๐ŸŽฏ eval"},jae={trivial:"๐ŸŸข trivial",simple:"๐Ÿ”ต simple",moderate:"๐ŸŸก moderate",complex:"๐ŸŸ  complex",critical:"๐Ÿ”ด critical"};function XP(e){return Nae[e]||e}function ZP(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 Aae({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 Tae({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(Xn,{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(Aae,{label:`${Ar(i)} ${na(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:[XP(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 Cae({history:e}){return e.length?s.jsx(Xn,{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:ZP(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:XP(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:[Ar(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:jae[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 Oae({routing:e}){return e.preference.length?s.jsx(Xn,{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:[YP[t.complexity]||"โ€ข"," ",t.complexity]}),s.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:s.jsxs("span",{style:{color:"#3fb950",fontWeight:600},children:[Ar(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:[Ar(n.provider)," ",na(n.provider).split(" ")[0]]}),s.jsx(c0,{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:Jo("#1c2128","#6e7681"),children:["๐ŸŽฏ fit ",n.capabilityFit,"%"]}),n.costSource==="measured"&&n.costBasis?s.jsxs("span",{style:Jo("#12291a","#3fb950","#3fb950"),children:["๐Ÿ“ measured ",n.costBasis.inputTokens.toLocaleString(),"โ†’",n.costBasis.outputTokens.toLocaleString()," tok"]}):s.jsx("span",{style:Jo("#1c2128","#8b949e"),children:"๐Ÿ“ estimated"}),n.contextUtilization!==void 0&&n.contextWindowTokens!==void 0&&s.jsxs("span",{style:Jo("#1c2128","#58a6ff","#58a6ff"),children:["โณ ctx ",n.contextUtilization,"% (",n.contextWindowTokens.toLocaleString()," tok)"]})]})]},n.provider))})]},t.complexity))})]})})}):null}function Pae({routing:e}){return e.providers.length?s.jsx(Xn,{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:[Ar(t.provider)," ",na(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(c0,{value:t.avgQuality,color:"#58a6ff"}),s.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"#8b949e",width:44,textAlign:"right"},children:gp(t.avgQuality)})]})}),s.jsx("td",{style:{padding:"10px 12px",color:t.passRate>=.8?"#3fb950":"#d29922"},children:gp(t.passRate)}),s.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:_ae(t.totalCostUsd)})]},t.provider))})]})})}):null}const oE=["trivial","simple","moderate","complex","critical"];function Mae(e){return e>=.7?"#3fb950":e>=.45?"#d29922":"#f85149"}function Rae({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(Xn,{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"}),oE.map(r=>s.jsxs("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:[YP[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:[Ar(r)," ",na(r).split(" ")[0]]}),oE.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:Mae(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 Iae(e,t=1){return`${e>0?"+":""}${(e*100).toFixed(t)}%`}function $ae({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 Lae({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(Xn,{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:Iae(i.delta)}),s.jsx("span",{style:{fontSize:11,color:"#6e7681",flex:1},children:i.note}),s.jsx($ae,{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 Dae({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(Xn,{icon:"๐Ÿง ",title:"ML Router โ€” learned from similar tasks",subtitle:"Task-feature kNN (ruflo neural-router analog): outcomes of the most similar PAST tasks nudge each provider's score. Win rate is similarity-weighted; factor = 1 + 0.5 ร— (winRate โˆ’ 0.5), trusted only after 5 similar-task samples.",children:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.recordCount.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"learned tasks"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #238636",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.length}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"trusted providers"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #d29922",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#d29922",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n.length}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"still learning"})]})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.providers.map(r=>s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"10px 14px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[s.jsx("span",{children:Ar(r.provider)}),s.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#e6edf3"},children:na(r.provider)}),r.trusted?s.jsxs("span",{style:Jo("#3fb95026","#238636","#3fb950"),children:["trusted ยท ",r.samples," samples"]}):s.jsxs("span",{style:Jo("#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 ",gp(r.winRate,0)]}),s.jsx(c0,{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 Bae({routing:e}){return e.bestModels.length?s.jsx(Xn,{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:[Ar(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:[gp(t.successRate,0)," success"]})," ยท ",t.runs," run",t.runs!==1?"s":""]})]},`${t.agentType}-${t.model}`))})}):null}function zae({retrieval:e}){var l,c;if(!e.enabled&&e.repoChunks===0)return null;const t=e.totalSavedTokens??0,n=e.avgPctReduced??0,r=e.lastCall,i=e.totalCalls??0,a=e.totalRetrievals??0,o=e.totalFailovers??0;return s.jsxs(Xn,{icon:"๐Ÿง ",title:"Vector Retrieval โ€” token savings",subtitle:"Large contexts are chunked, embedded locally (bge-small-en-v1.5), and reduced to the top-k relevant chunks before the LLM โ€” saving tokens so free quotas stretch further. Complements the quota ledger: retrieval saves, the ledger manages.",children:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #238636",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"tokens saved"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsxs("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[n.toFixed(1),"%"]}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"avg context reduction"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #d29922",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#d29922",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.repoChunks.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"repo chunks indexed"})]})]}),s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",fontSize:12,color:"#8b949e",marginBottom:14},children:[s.jsxs("span",{children:["๐Ÿ“ž ",i," context calls ยท ๐Ÿง  ",a," retrievals used ยท โš ๏ธ ",o," failovers (full-context fallback)"]}),e.dimensions>0&&s.jsxs("span",{children:["ยท ",e.dimensions,"-dim embeddings"]})]}),r&&r.used!==!1&&((l=r.hits)==null?void 0:l.length)>0&&s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 16px",marginBottom:12},children:[s.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"#e6edf3",marginBottom:8},children:["Latest retrieval โ€” ",r.originalTokens.toLocaleString()," โ†’ ",r.reducedTokens.toLocaleString()," tokens",s.jsxs("span",{style:{color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" (โˆ’",(c=r.pctReduced)==null?void 0:c.toFixed(0),"%)"]})]}),s.jsx("div",{style:{fontSize:11,color:"#8b949e"},children:r.hits.slice(0,5).map(u=>s.jsxs("div",{style:{marginTop:3},children:[s.jsx("span",{style:{color:"#58a6ff"},children:"โ–ธ"})," ",u.filePath," ",s.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["(sim ",u.similarity.toFixed(3),")"]})]},u.filePath))})]}),s.jsxs("div",{style:{fontSize:11,color:"#6e7681"},children:["Pre-index your repo with ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff retrieval index <dir>"}),", query it with"," ",s.jsx("code",{style:{color:"#58a6ff"},children:'buff retrieval query "<question>"'}),", and see the same stats with"," ",s.jsx("code",{style:{color:"#58a6ff"},children:"buff retrieval stats"}),"."]})]})}function Fae({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(Xn,{icon:"๐Ÿ“’",title:"Quota Ledger โ€” free-tier usage & auto re-enable",subtitle:"Tokens/requests per provider ร— model with reset windows. Exhausted providers are parked (excluded from Auto routing) and re-enable when the window rolls.",children:[s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"tokens tracked"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:"#e6edf3",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"requests"})]}),s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:22,fontWeight:700,color:r>0?"#d29922":"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"parked"})]})]}),s.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:16},children:[s.jsxs("div",{style:{flex:"1 1 200px",background:"#0d1117",borderRadius:10,padding:"12px 16px",border:"1px solid #238636"},children:[s.jsx("div",{style:{fontSize:20,fontWeight:700,color:"#3fb950",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:i.toLocaleString()}),s.jsxs("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:["tokens on free/local ยท ",l.toFixed(0),"% of usage"]}),s.jsxs("div",{style:{fontSize:12,color:"#3fb950",marginTop:4,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["๐Ÿ’ฐ est. $",o.toFixed(4)," saved"]})]}),s.jsxs("div",{style:{flex:"1 1 200px",background:"#0d1117",borderRadius:10,padding:"12px 16px",border:"1px solid #d29922"},children:[s.jsx("div",{style:{fontSize:20,fontWeight:700,color:a>0?"#d29922":"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:a.toLocaleString()}),s.jsx("div",{style:{fontSize:11,color:"#8b949e",marginTop:2},children:"tokens on paid providers (spend triggered)"}),s.jsxs("div",{style:{fontSize:12,color:a>0?"#d29922":"#8b949e",marginTop:4},children:[e.paidRequests??0," paid request",e.paidRequests===1?"":"s"]})]})]}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[s.jsx("thead",{children:s.jsxs("tr",{style:{borderBottom:"1px solid #21262d",color:"#8b949e"},children:[s.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider / Model"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Tokens"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Requests"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Resets in"}),s.jsx("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:"State"})]})}),s.jsx("tbody",{children:e.entries.map(u=>s.jsxs("tr",{style:{borderBottom:"1px solid #21262d"},children:[s.jsxs("td",{style:{padding:"8px 10px",whiteSpace:"nowrap"},children:[s.jsxs("span",{style:{color:"#e6edf3"},children:[Ar(u.provider)," ",na(u.provider).split(" ")[0]]}),s.jsxs("span",{style:{color:"#8b949e",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" / ",u.model.length>24?u.model.slice(0,21)+"โ€ฆ":u.model]})]}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:u.tokensConsumed.toLocaleString()}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"#8b949e"},children:u.requests}),s.jsx("td",{style:{padding:"8px 10px",textAlign:"right",color:"#8b949e",whiteSpace:"nowrap"},children: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",p=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:[Ar(u.provider)," ",na(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 ${p}`,color:p,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"?"โœ…":"โšก",p=u.type==="parked"?"#f85149":u.type==="re-enabled"||u.type==="released"?"#3fb950":"#d29922",h=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 ${p}`,color:p,textAlign:"center"},children:h}),s.jsxs("span",{style:{flex:1,fontSize:12,color:"#e6edf3",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[Ar(u.provider)," ",na(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:ZP(u.timestamp)})]},`${u.timestamp}-${d}`)})})]})]})}function zd({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 Uae({governance:e}){var r,i,a,o,l;if(!e.enabled)return s.jsx(Xn,{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(Xn,{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(zd,{ok:!c.deny,children:[c.deny?"โ›”":"โœ…"," ",c.label,": ",c.items.join(", ")]},c.label)),n.map(c=>s.jsx(zd,{children:c},c)),t.length===0&&n.length===0&&s.jsx(zd,{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 Wae({rbac:e}){const t=n=>n==="admin"?"#d29922":n==="operator"?"#3fb950":"#8b949e";return s.jsxs(Xn,{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(zd,{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 Hae({data:e}){var h,g,m,v,y,b,x,_,S,w;const t=e==null?void 0:e.routing,n=t&&(t.preference.length>0||t.providers.length>0||t.bestModels.length>0),r=!!((h=t==null?void 0:t.usage)!=null&&h.total),i=!!((g=t==null?void 0:t.history)!=null&&g.length),a=!!t&&(((m=t.history)==null?void 0:m.length)??0)>0||!!((v=t==null?void 0:t.preference)!=null&&v.length),o=!!((y=t==null?void 0:t.bandit)!=null&&y.enabled),l=!!((b=t==null?void 0:t.promotion)!=null&&b.decisionCount),c=!!((x=t==null?void 0:t.ml)!=null&&x.enabled)&&(t.ml.recordCount??0)>0,u=!!((_=t==null?void 0:t.quota)!=null&&_.enabled),d=!!((S=t==null?void 0:t.retrieval)!=null&&S.enabled)||!!((w=t==null?void 0:t.retrieval)!=null&&w.repoChunks),f=!!(t!=null&&t.governance),p=!!(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&&!p?s.jsx(Eae,{}):s.jsxs(s.Fragment,{children:[a&&t&&s.jsx(wae,{routing:t}),f&&t.governance&&s.jsx(Uae,{governance:t.governance}),(t==null?void 0:t.rbac)&&s.jsx(Wae,{rbac:t.rbac}),r&&s.jsx(Tae,{usage:t.usage}),i&&s.jsx(Cae,{history:t.history}),o&&s.jsx(Rae,{bandit:t.bandit}),l&&s.jsx(Lae,{promotion:t.promotion}),c&&t.ml&&s.jsx(Dae,{ml:t.ml}),u&&s.jsx(Fae,{quota:t.quota}),d&&s.jsx(zae,{retrieval:t.retrieval}),s.jsx(Oae,{routing:t}),s.jsx(Pae,{routing:t}),s.jsx(Bae,{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 sE={chat:"๐Ÿ’ฌ",execute:"โš™๏ธ",plan:"๐Ÿ—บ๏ธ",edit:"โœ๏ธ",skill:"๐Ÿงฉ",learn:"๐Ÿ“š",ci:"๐Ÿ”",doctor:"๐Ÿฉบ",probe:"๐Ÿ”ญ","spot-check":"๐Ÿงช",telemetry:"๐Ÿ“ก",usage:"๐Ÿงฎ","ide-chat":"๐Ÿ’ฌ","ide-inline":"โœ๏ธ","ide-execute":"โš™๏ธ"};function Gae(e){return new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function gd(e){return e!==void 0?`${e}ms`:"โ€”"}function QP(e){return e===0?"#3fb950":e<.2?"#d29922":"#f85149"}function qae({data:e}){const t=e.rows,n=t.reduce((c,u)=>c+u.requests,0),r=t.reduce((c,u)=>c+Math.round(u.errorRate*u.requests),0),i=t.reduce((c,u)=>c+(u.costUsd??0),0),a=t.flatMap(c=>c.latency?[c.latency.avg]:[]),o=a.length>0?Math.round(a.reduce((c,u)=>c+u,0)/a.length):void 0,l=new Set(t.map(c=>c.action)).size;return s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"๐Ÿ“จ"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:n.toLocaleString()}),s.jsx("div",{className:"stat-label",children:"Requests"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"๐ŸŽฏ"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",children:t.length}),s.jsx("div",{className:"stat-label",children:"provider ร— model ร— action groups"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"โšก"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:o!==void 0?"#3fb950":"#8b949e"},children:o!==void 0?`${o}ms`:"โ€”"}),s.jsxs("div",{className:"stat-label",children:["Avg latency",o!==void 0?` (${a.length} groups)`:" (no samples)"]})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"๐Ÿ“›"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:QP(n>0?r/n:0)},children:n>0?`${(r/n*100).toFixed(1)}%`:"โ€”"}),s.jsxs("div",{className:"stat-label",children:["Overall error rate (",r.toLocaleString()," failures)"]})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("span",{className:"stat-icon",children:"๐Ÿ’ฐ"}),s.jsxs("div",{className:"stat-body",children:[s.jsx("div",{className:"stat-value",style:{color:i>0?"#d29922":"#8b949e"},children:i>0?`$${i.toFixed(4)}`:"โ€”"}),s.jsxs("div",{className:"stat-label",children:["Measured cost",l>0?` ยท ${l} actions`:""]})]})]})]})}function Kae({data:e}){const[t,n]=E.useState(""),[r,i]=E.useState("all"),a=e==null?void 0:e.requests,o=E.useMemo(()=>{if(!a)return[];const c=t.trim().toLowerCase();return a.rows.filter(u=>r!=="all"&&u.action!==r?!1:c?`${u.provider} ${u.model} ${u.action}`.toLowerCase().includes(c):!0)},[a,t,r]);if(!e)return s.jsx("div",{className:"loading-state",children:s.jsx("p",{children:"Loading requests..."})});if(!a||!a.enabled||a.rows.length===0)return s.jsxs("div",{className:"empty-state",style:{padding:"40px 24px",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:28,marginBottom:10},children:"๐Ÿ“จ"}),s.jsx("h2",{className:"section-title",style:{marginTop:0},children:"Requests โ€” per provider ร— model ร— action"}),s.jsxs("p",{className:"section-description",style:{maxWidth:560,margin:"0 auto"},children:["No request telemetry yet. As you use ",s.jsx("strong",{children:"chat"}),", ",s.jsx("strong",{children:"execute"}),","," ",s.jsx("strong",{children:"plan"})," and ",s.jsx("strong",{children:"edit"})," under Auto routing, every call writes to the action-telemetry log and this panel aggregates it: request counts, p50/p95/p99 latency, error rate and measured cost โ€” the same feed that drives the Models panel."]})]});const l=[...new Set(a.rows.map(c=>c.action))].sort();return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"๐Ÿ“จ Requests โ€” per provider ร— model ร— action"}),s.jsx("p",{className:"section-description",children:"Aggregated from the same action-telemetry log as the Models panel โ€” every Auto-routed call, grouped by action ร— provider ร— model. Latency percentiles appear once โ‰ฅ3 samples exist; cost when the caller reported usage."}),s.jsx(qae,{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:[sE[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:[sE[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:QP(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:gd((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?gd(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?gd(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?gd(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:Gae(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 Vae={local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ"},Yae={planner:"๐Ÿ—บ๏ธ",writer:"โœ๏ธ",reviewer:"๐Ÿ”Ž",tester:"๐Ÿงช",debugger:"๐Ÿ›",runner:"๐Ÿƒ","context-gatherer":"๐Ÿ“‚",memory:"๐Ÿง ","self-improver":"๐Ÿ“ˆ"};function Xae(e){return Vae[e]||"๐Ÿ”Œ"}function Zae(e){return Yae[e]||"๐Ÿค–"}function JP(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 u0(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 Ql(e){return e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Wv({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 Qae(){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 Jae({step:e}){const[t,n]=E.useState(!1),r=e.success?"#3fb950":"#f85149",i=e.success?"ok":"failed";return s.jsxs("div",{style:{background:"#0d1117",border:"1px solid #21262d",borderRadius:8,marginBottom:8,overflow:"hidden"},children:[s.jsxs("button",{onClick:()=>n(!t),style:{width:"100%",background:"none",border:"none",cursor:"pointer",padding:"10px 14px",textAlign:"left",display:"flex",alignItems:"center",gap:10,color:"inherit"},children:[s.jsx("span",{style:{width:26,fontSize:16},children:Zae(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:[Xae(e.provider)," ",e.provider,"/",e.model]}),s.jsx("span",{style:{width:70,fontSize:11,color:"#6e7681",textAlign:"right"},children:u0(e.latencyMs)}),s.jsxs("span",{style:{width:86,fontSize:11,color:"#6e7681",fontFamily:"'SFMono-Regular', Consolas, monospace",textAlign:"right"},children:[Ql(e.inputTokens),"โ†’",Ql(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.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 (",Ql(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 eoe({trace:e}){const[t,n]=E.useState(e.steps??null),[r,i]=E.useState(!1);E.useEffect(()=>{if(e.steps){n(e.steps);return}let l=!1;return ee.fetchTraceDetail(e.id).then(c=>{l||(c!=null&&c.steps?n(c.steps):i(!0))}),()=>{l=!0}},[e.id,e.steps]);const a=e.success===!0?"โœ…":e.success===!1?"โŒ":"โณ",o=e.success===!0?"success":e.success===!1?"failed":"in progress";return s.jsxs(Wv,{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:["๐Ÿ•“ ",JP(e.startedAt)]}),s.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"#0d1117",border:"1px solid #30363d",color:"#8b949e"},children:["โฑ ",u0(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:["๐Ÿงฎ ",Ql(e.totalTokens)," tok"]})]}),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(Jae,{step:l},l.seq))]})}function toe({traces:e}){const[t,n]=E.useState(null);return t?s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:()=>n(null),style:{background:"#21262d",border:"1px solid #30363d",color:"#e6edf3",borderRadius:8,padding:"6px 14px",fontSize:12,cursor:"pointer",marginBottom:12},children:"โ† Back to traces"}),s.jsx(eoe,{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:JP(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:["โฑ ",u0(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:["๐Ÿงฎ ",Ql(r.totalTokens)," tok"]}),a&&s.jsxs("span",{children:["๐Ÿค– ",a.slice(0,60)]})]})]},r.id)})})}function noe(){const[e,t]=E.useState(null),[n,r]=E.useState(!1),i=E.useCallback(()=>{ee.fetchTraces().then(a=>{a?(t(a),r(!1)):r(!0)})},[]);return E.useEffect(()=>{i();const a=setInterval(i,15e3);return()=>clearInterval(a)},[i]),s.jsxs("div",{className:"panel",children:[s.jsxs("div",{style:{marginBottom:16},children:[s.jsx("h2",{style:{margin:0,fontSize:18,color:"#e6edf3"},children:"๐Ÿ” Reasoning Traces"}),s.jsx("p",{style:{margin:"4px 0 0 0",fontSize:12,color:"#8b949e"},children:"Every LLM call in each pipeline โ€” agent ร— model ร— prompt digest ร— response ร— tokens ร— latency ร— routing snapshot (assessment P0)."})]}),e===null&&!n&&s.jsx(Wv,{icon:"โณ",title:"Loadingโ€ฆ",children:s.jsx("div",{style:{color:"#8b949e",fontSize:13},children:"Fetching reasoning tracesโ€ฆ"})}),n&&e===null&&s.jsx(Wv,{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(Qae,{}),e!==null&&e.length>0&&s.jsx(toe,{traces:e})]})}function ng(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function roe({authed:e,role:t}){const[n,r]=E.useState(null),[i,a]=E.useState({}),[o,l]=E.useState(""),[c,u]=E.useState(!1),[d,f]=E.useState(null),[p,h]=E.useState(null),g=e&&(t==="admin"||t==="operator"),m=e&&t==="admin",v=E.useCallback(async()=>{var k,N,j;const S=await ee.fetchAdminQuota();if(!S){h("Could not load budget config.");return}h(null),r(S);const w={};for(const C of S.providers){const I=S.quota[C]||{};w[C]={provider:C,tokens:((k=I.tokensPerWindow)==null?void 0:k.toString())??"",requests:((N=I.requestsPerWindow)==null?void 0:N.toString())??"",windowMs:((j=I.windowMs)==null?void 0:j.toString())??""}}a(w),l(S.costUsd===null?"":String(S.costUsd))},[]);E.useEffect(()=>{v()},[v]);const y=(S,w,k)=>{a(N=>({...N,[S]:{...N[S]||{provider:S},[w]:k}}))},b=async()=>{u(!0),f(null);const S={};for(const N of Object.values(i)){const j={},C=ng(N.tokens),I=ng(N.requests),M=ng(N.windowMs);C!==null&&(j.tokensPerWindow=C),I!==null&&(j.requestsPerWindow=I),M!==null&&(j.windowMs=M),S[N.provider]=Object.keys(j).length>0?j:null}const w={quota:S};if(m)if(o.trim()!==""){const N=Number(o);if(!Number.isFinite(N)||N<0){f({ok:!1,text:"Cost cap must be a non-negative number."}),u(!1);return}w.costUsd=N}else w.costUsd=null;const k=await ee.saveAdminQuota(w);u(!1),k.ok?(f({ok:!0,text:"Budget saved โ€” the quota ledger + auto-router will enforce it."}),v()):f({ok:!1,text:k.error||"Save failed."})},x=S=>{const w=n==null?void 0:n.quota[S];return!!w&&(w.tokensPerWindow!==void 0||w.requestsPerWindow!==void 0||w.windowMs!==void 0)},_=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"}),"."]}),p?s.jsx("div",{className:"admin-error",children:p}):null,n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-quota-table",children:[s.jsxs("div",{className:"admin-quota-row admin-quota-head",children:[s.jsx("span",{children:"Provider"}),s.jsx("span",{children:"Tokens / window"}),s.jsx("span",{children:"Requests / window"}),s.jsx("span",{children:"Window (ms)"}),s.jsx("span",{children:"Status"})]}),n.providers.map(S=>{var w,k,N;return s.jsxs("div",{className:"admin-quota-row",children:[s.jsx("span",{className:"admin-provider-type",children:S}),s.jsx("input",{className:_(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((w=i[S])==null?void 0:w.tokens)??"",onChange:j=>y(S,"tokens",j.target.value)}),s.jsx("input",{className:_(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((k=i[S])==null?void 0:k.requests)??"",onChange:j=>y(S,"requests",j.target.value)}),s.jsx("input",{className:_(!g),type:"number",min:0,placeholder:"86400000 (24h)",disabled:!g,value:((N=i[S])==null?void 0:N.windowMs)??"",onChange:j=>y(S,"windowMs",j.target.value)}),s.jsx("span",{className:`admin-role-badge ${x(S)?"admin-role-admin":"admin-role-viewer"}`,children:x(S)?"declared":"unset"})]},S)})]}),s.jsxs("div",{className:"admin-quota-row admin-quota-cost",children:[s.jsx("span",{className:"admin-provider-type",children:"Max cost / call (USD, admin)"}),s.jsx("input",{className:_(!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 ioe={pass:"โœ…",warn:"โš ๏ธ",fail:"โŒ"},aoe={pass:"PASS",warn:"WARN",fail:"FAIL"},ooe={env:"Environment",config:"Config",vault:"Vault",local:"Local (no key)",none:"Not configured"};function lE({check:e}){return s.jsxs("div",{className:"admin-check-row","data-status":e.status,children:[s.jsxs("span",{className:`admin-check-badge admin-check-${e.status}`,children:[ioe[e.status]," ",aoe[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 soe(){const[e,t]=E.useState(null),[n,r]=E.useState(!0),[i,a]=E.useState(null),[o,l]=E.useState(null),[c,u]=E.useState(!1),[d,f]=E.useState(null),[p,h]=E.useState(null),[g,m]=E.useState(""),[v,y]=E.useState(""),[b,x]=E.useState(""),[_,S]=E.useState(null),[w,k]=E.useState(!1),[N,j]=E.useState([]),[C,I]=E.useState(null),[M,$]=E.useState(""),[R,B]=E.useState(""),[L,U]=E.useState("viewer"),[O,z]=E.useState([]),[T,V]=E.useState({}),[q,P]=E.useState(null),[ce,me]=E.useState({}),[ue,He]=E.useState(""),[Ce,te]=E.useState(null),[ye,be]=E.useState(null),X=E.useCallback(async()=>{r(!0),a(null);const H=await ee.fetchAdminChecks();t(H),H||a("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),r(!1)},[]),Ae=E.useCallback(async()=>{const H=await ee.fetchAdminCatalog();H&&H.length>0&&z(H)},[]),we=E.useCallback(async()=>{const H=await ee.fetchAdminUsers();H.ok&&H.users&&j(H.users)},[]);E.useEffect(()=>{let H=!0;return ee.fetchAdminAuthStatus().then(oe=>{if(H){if(!oe){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:oe.configured,authenticated:oe.authenticated}),u(oe.authenticated),f(oe.role??null),h(oe.user??null),oe.authenticated?(X(),Ae(),we()):r(!1)}}),()=>{H=!1}},[X,Ae,we]);const Se=d==="admin",ge=()=>{u(!1),l(H=>H&&{...H,authenticated:!1}),S("Session expired โ€” log in again.")},De=async H=>{H.preventDefault(),k(!0),S(null);const oe=await ee.adminLogin(g,v);oe.ok?(u(!0),l({configured:!0,authenticated:!0}),f(oe.role??"admin"),h(oe.user??null),m(""),y(""),X(),Ae(),we()):S(oe.error||"Login failed."),k(!1)},le=async H=>{if(H.preventDefault(),k(!0),S(null),v.length<8){S("Password must be at least 8 characters."),k(!1);return}if(v!==b){S("Passwords do not match."),k(!1);return}const oe=await ee.adminSetup(g,v);oe.ok?(u(!0),l({configured:!0,authenticated:!0}),f(oe.role??"admin"),h(oe.user??null),m(""),y(""),x(""),X(),Ae(),we()):S(oe.error||"Setup failed."),k(!1)},Tt=async()=>{await ee.adminLogout(),u(!1),l(H=>H&&{...H,authenticated:!1}),f(null),h(null),t(null),V({}),me({}),j([])},Fe=async()=>{if(!window.confirm("Stop the running gateway? Channels will stop responding until you restart it with `buff gateway start`."))return;be("gateway"),te(null);const H=await ee.shutdown("gateway");be(null),H.ok?te(H.stopped?"โœ… Gateway stopped.":`โ„น๏ธ ${H.reason||"No running gateway found โ€” nothing to stop."}`):(te(`โŒ ${H.error||"Stop failed."}`),H.unauthorized&&ge())},Te=async()=>{window.confirm("Shut down the dashboard? This page will disconnect and the server will exit. Restart with `buff dashboard`.")&&(be("dashboard"),te("๐Ÿ›‘ Shutting down the dashboard โ€” this page will disconnectโ€ฆ"),await ee.shutdown("dashboard"),be(null),te("โ„น๏ธ The dashboard server did not stop (see the server terminal). You can also stop it with `buff dashboard stop`."))},lt=async H=>{if(H.preventDefault(),I(null),R.length<8){I("Password must be at least 8 characters.");return}const oe=await ee.addAdminUser(M,R,L);oe.ok?($(""),B(""),I("โœ… User added"),we()):(I(`โŒ ${oe.error||"Failed to add user"}`),oe.unauthorized&&ge())},Me=async H=>{if(!window.confirm(`Remove dashboard user '${H}'?`))return;I(null);const oe=await ee.removeAdminUser(H);oe.ok?(I(`โœ… Removed ${H}`),we()):(I(`โŒ ${oe.error||"Failed to remove user"}`),oe.unauthorized&&ge())},Zt=(H,oe,Re)=>{V(Oe=>({...Oe,[H]:{...Oe[H]||{},[oe]:Re}}))},Ht=async H=>{P(H),me({});const oe=T[H]||{},Re=await ee.saveProvider(H,oe);Re.ok?(t(Oe=>{if(!Oe)return Oe;const Pr=Oe.providers.some(mr=>mr.type===H)?Oe.providers.map(mr=>mr.type===H&&Re.provider?Re.provider:mr):Re.provider?[...Oe.providers,Re.provider]:Oe.providers;return{...Oe,providers:Pr}}),V(Oe=>{const ga={...Oe};return delete ga[H],ga}),me(Oe=>({...Oe,[H]:"โœ… Saved"}))):(me(Oe=>({...Oe,[H]:`โŒ ${Re.error||"Save failed"}`})),Re.unauthorized&&ge()),P(null)},F=async H=>{if(!window.confirm(`Remove ${H}'s API key and configuration? This cannot be undone.`))return;P(H),me({});const oe=await ee.deleteProvider(H);oe.ok?oe.envSourced?(t(Re=>Re&&{...Re,providers:Re.providers.map(Oe=>Oe.type===H&&oe.provider||Oe)}),me(Re=>({...Re,[H]:`โš ๏ธ Key comes from ${oe.envVar?`$${oe.envVar}`:"an env var"} โ€” unset it there to remove it (config can't override the env).`}))):(t(Re=>Re&&{...Re,providers:Re.providers.filter(Oe=>Oe.type!==H)}),V(Re=>{const Oe={...Re};return delete Oe[H],Oe})):(me(Re=>({...Re,[H]:`โŒ ${oe.error||"Remove failed"}`})),oe.unauthorized&&ge()),P(null)},K=async H=>{P(H);const oe=await ee.testProvider(H);me(Re=>{var Oe;return{...Re,[H]:oe.ok?`โœ… Connected โ€” ${((Oe=oe.models)==null?void 0:Oe.length)??0} model(s) reachable`:`โŒ ${oe.error||"Connection failed"}`}}),P(null)},ae=()=>{ue&&(V(H=>({...H,[ue]:{}})),He(""))};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 H=!o.configured;return s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["๐Ÿ› ๏ธ Admin โ€” ",H?"Set up access":"Log in"]}),s.jsx("p",{className:"admin-subtitle",children:H?"Create the admin user-id and password that gate the dashboard write surface (API-key/provider configuration). The CLI keeps working exactly as before โ€” this only guards the GUI.":"The write surface (API-key/provider configuration) is gated by the admin credentials. Read-only checks stay open."}),s.jsxs("form",{className:"admin-gate-form",onSubmit:H?le:De,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:g,onChange:oe=>m(oe.target.value),autoComplete:"username",placeholder:"admin"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:v,onChange:oe=>y(oe.target.value),autoComplete:H?"new-password":"current-password",placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"})]}),H?s.jsxs("label",{children:[s.jsx("span",{children:"Confirm password"}),s.jsx("input",{type:"password",value:b,onChange:oe=>x(oe.target.value),autoComplete:"new-password",placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"})]}):null,_?s.jsx("div",{className:"admin-error",children:_}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:w||!g||!v,children:w?"โณ โ€ฆ":H?"๐Ÿ” Create admin":"๐Ÿ” Log in"}),H?s.jsxs("p",{className:"admin-hint",children:["Automation alternative: set ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," and"," ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"})," in the dashboard's environment."]}):null]})]})}const de=(e==null?void 0:e.system.filter(H=>H.status==="pass").length)??0,_e=(e==null?void 0:e.system.filter(H=>H.status==="warn").length)??0,Xe=(e==null?void 0:e.system.filter(H=>H.status==="fail").length)??0,yt=(e==null?void 0:e.enterprise.filter(H=>H.status==="pass").length)??0,It=(e==null?void 0:e.enterprise.filter(H=>H.status==="warn").length)??0,Dn=(e==null?void 0:e.enterprise.filter(H=>H.status==="fail").length)??0,pt=(e==null?void 0:e.providers)??[],Nt=H=>{const oe=O.find(Re=>Re.id===H);return oe||{label:H}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-header",children:[s.jsxs("h2",{className:"section-title",children:["๐Ÿ› ๏ธ Admin โ€” Command Runner & Configuration",p?s.jsxs("span",{className:`admin-role-badge admin-role-${d||"viewer"}`,children:[p," ยท ",d||"viewer"]}):null]}),s.jsxs("div",{className:"admin-header-actions",children:[s.jsx("button",{className:"admin-refresh-btn",onClick:()=>void X(),disabled:n,children:n?"โณ Running checksโ€ฆ":"๐Ÿ”„ Refresh (run all commands)"}),Se||d==="operator"?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Fe(),disabled:ye!==null,title:"Stop the running gateway (buff gateway stop)",children:ye==="gateway"?"โณ Stoppingโ€ฆ":"โป Stop gateway"}):null,Se?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Te(),disabled:ye!==null,title:"Shut down this dashboard server (buff dashboard stop)",children:ye==="dashboard"?"โณ Stoppingโ€ฆ":"๐Ÿ›‘ Stop dashboard"}):null,s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Tt(),children:"๐Ÿšช Log out"})]})]}),Ce?s.jsx("div",{className:"admin-error",children:Ce}):null,Se?null:s.jsxs("div",{className:"admin-readonly-note",children:["๐Ÿ”’ Your role (",s.jsx("code",{children:d||"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:de+yt}),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:_e+It}),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:Xe+Dn}),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:pt.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(H=>s.jsx(lE,{check:H},H.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(H=>s.jsx(lE,{check:H},H.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:[pt.map(H=>{const oe=Nt(H.type),Re=T[H.type]||{};return s.jsxs("tr",{children:[s.jsxs("td",{className:"admin-provider-type",children:[oe.icon?`${oe.icon} `:"",oe.label,s.jsxs("div",{className:"admin-provider-sub",children:[H.type," ยท ",ooe[H.keySource]||H.keySource]}),H.keySource==="env"?s.jsxs("div",{className:"admin-hint",children:["comes from ",oe.envVar||"env var"," โ€” change it there, config can't override it"]}):H.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 ${H.configured?"admin-check-pass":"admin-check-warn"}`,children:H.configured?"โœ… Configured":"โš ๏ธ Not configured"})}),s.jsx("td",{children:oe.keyless?s.jsx("div",{className:"admin-hint",children:"No key needed (probed)"}):Se?s.jsx("input",{className:"admin-input admin-key-input",type:"password","aria-label":`${H.type} API key`,placeholder:H.keyMasked||"set a new keyโ€ฆ",value:Re.apiKey??"",onChange:Oe=>Zt(H.type,"apiKey",Oe.target.value),autoComplete:"new-password"}):s.jsx("div",{className:"admin-hint",children:H.keyMasked||"โ€”"})}),s.jsx("td",{children:Se?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${H.type} base URL`,placeholder:H.baseUrl||"default endpoint",value:Re.baseUrl??"",onChange:Oe=>Zt(H.type,"baseUrl",Oe.target.value)}):s.jsx("div",{className:"admin-hint",children:H.baseUrl?H.baseUrl.replace(/^https?:\/\/(?:[^@/]*@)?/,""):"default endpoint"})}),s.jsx("td",{children:Se?s.jsx("input",{className:"admin-input",type:"text","aria-label":`${H.type} model`,placeholder:H.model||"default model",value:Re.model??"",onChange:Oe=>Zt(H.type,"model",Oe.target.value)}):s.jsx("div",{className:"admin-hint",children:H.model||"default model"})}),s.jsx("td",{children:Se?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"admin-row-actions",children:[s.jsx("button",{className:"admin-mini-btn",disabled:q===H.type,onClick:()=>void Ht(H.type),children:"๐Ÿ’พ Save"}),s.jsx("button",{className:"admin-mini-btn",disabled:q===H.type,title:"Tests the SAVED configuration โ€” save first to test a new key",onClick:()=>void K(H.type),children:"๐Ÿ”Œ Test"}),s.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:q===H.type,onClick:()=>void F(H.type),children:"๐Ÿ—‘ Remove"})]}),ce[H.type]?s.jsx("div",{className:"admin-row-msg",children:ce[H.type]}):null]}):s.jsx("div",{className:"admin-hint",children:"read-only"})})]},H.type)}),pt.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"admin-empty-cell",children:"No providers configured yet."})}):null]})]})}),Se&&O.length>0?s.jsxs("div",{className:"admin-add-provider",children:[s.jsxs("select",{className:"admin-input",value:ue,onChange:H=>He(H.target.value),children:[s.jsx("option",{value:"",children:"Add a providerโ€ฆ"}),O.filter(H=>!pt.some(oe=>oe.type===H.id)).map(H=>s.jsxs("option",{value:H.id,children:[H.icon?`${H.icon} `:"",H.label," (",H.id,")"]},H.id))]}),s.jsx("button",{className:"admin-mini-btn",disabled:!ue,onClick:ae,children:"โž• Add"})]}):null,s.jsx(roe,{authed:c,role:d||"viewer"}),Se?s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-subtitle",children:"๐Ÿ‘ฅ Dashboard Users (role.manage)"}),s.jsxs("div",{className:"admin-users-list",children:[N.map(H=>s.jsxs("div",{className:"admin-user-row",children:[s.jsx("span",{className:"admin-user-name",children:H.user}),s.jsx("span",{className:`admin-role-badge admin-role-${H.role}`,children:H.role}),s.jsxs("span",{className:"admin-user-since",children:["since ",new Date(H.createdAt).toLocaleDateString()]}),H.user!==p?s.jsx("button",{className:"admin-mini-btn admin-mini-danger",onClick:()=>void Me(H.user),children:"๐Ÿ—‘ Remove user"}):s.jsx("span",{className:"admin-hint",children:"you"})]},H.user)),N.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:lt,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:M,onChange:H=>$(H.target.value),autoComplete:"off"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password (min 8 chars)"}),s.jsx("input",{type:"password",value:R,onChange:H=>B(H.target.value),autoComplete:"new-password"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{value:L,onChange:H=>U(H.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"})]})]}),C?s.jsx("div",{className:"admin-row-msg",children:C}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:!M||!R,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 eM(e){return String(e??"").replace(/\d{3,}/g,t=>t.slice(0,2)+"***")}const loe={idle:"Not paired",pairing:"โณ Pairingโ€ฆ",paired:"โœ… Paired",failed:"โŒ Pairing failed",cancelled:"โน Cancelled",error:"๐Ÿ’ฅ Pairing error"};function coe({authed:e,canWrite:t,sessionExpired:n,reveal:r=!1}){const[i,a]=E.useState(null),[o,l]=E.useState({}),[c,u]=E.useState(""),[d,f]=E.useState(!1),[p,h]=E.useState(null),g=E.useRef(null),m=E.useCallback(async()=>{const w=await ee.getWhatsAppStatus();w&&(a(w.status),l(w.contacts??{}))},[]);E.useEffect(()=>{if(m(),!e||typeof EventSource>"u")return;const w=ee.subscribeWhatsApp({onQr:k=>a(N=>N&&{...N,qr:k,state:"pairing"}),onCode:k=>a(N=>N&&{...N,pairingCode:k}),onStatus:k=>{a(k),(k.state==="paired"||k.state==="failed"||k.state==="error"||k.state==="cancelled")&&f(!1)}});return g.current=w,()=>{w(),g.current=null}},[e,m]);const v=async w=>{f(!0),h(null);const k=await w();if(!k.ok&&k.error&&/Not authenticated|Session expired/i.test(k.error)){n(),f(!1);return}k.ok?(h({kind:"ok",text:"Done."}),await m()):h({kind:"err",text:k.error||"Action failed."}),f(!1)},y=w=>{h(null),v(()=>ee.startWhatsAppPair(w?c.trim():void 0)).then(()=>u(""))},b=()=>{h(null),v(()=>ee.cancelWhatsAppPair())},x=()=>{window.confirm("Remove the paired WhatsApp session from this machine? You will need to scan a QR to pair again.")&&(h(null),v(()=>ee.unpairWhatsApp()))},_=(i==null?void 0:i.state)??"idle",S=_==="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:loe[_]}):s.jsx("span",{className:"admin-hint",children:"loadingโ€ฆ"})]}),s.jsxs("p",{className:"admin-hint",children:["The personal Baileys bridge (no Meta Business account) โ€” pair once, and the gateway can send & receive WhatsApp. Session: ",s.jsx("code",{children:(i==null?void 0:i.sessionDir)??"~/.buff/whatsapp/session"}),". Same engine as"," ",s.jsx("code",{children:"buff whatsapp pair"}),"."]}),S?s.jsxs("div",{className:"wa-pairing",children:[i!=null&&i.qr?s.jsxs("div",{className:"wa-qr-box",children:[s.jsx("img",{className:"wa-qr-img",src:i.qr,alt:"WhatsApp pairing QR code"}),s.jsxs("p",{className:"admin-hint",children:["Open WhatsApp on the phone โ†’ ",s.jsx("strong",{children:"Linked devices โ†’ Link a device โ†’ scan"}),". The QR refreshes automatically while this window is open."]})]}):i!=null&&i.phone?s.jsxs("div",{className:"wa-code-box",children:[s.jsxs("p",{className:"admin-hint",children:["On the phone with ",s.jsx("strong",{children:i.phone}),": WhatsApp โ†’ Linked devices โ†’ Link a device โ†’"," ",s.jsx("strong",{children:"โ€œLink with phone number insteadโ€"})," โ†’ enter:"]}),s.jsx("div",{className:"wa-code",children:i.pairingCode??"โ€ฆ waiting for code"})]}):s.jsx("div",{className:"wa-code-box",children:s.jsx("p",{className:"admin-hint",children:"Waiting for WhatsApp to hand over a QRโ€ฆ (it usually appears within a few seconds)"})}),i!=null&&i.phone?null:s.jsxs("div",{className:"admin-hint",children:["Tip: on a phone, โ€œLink with phone number insteadโ€ needs the number format"," ",s.jsx("code",{children:"918844433322"})," (country code included) โ€” enter it below instead of scanning."]}),i!=null&&i.error?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:i.error}):null,t&&e?s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:b,disabled:d,children:d?"โณโ€ฆ":"โน Cancel pairing"}):null]}):s.jsxs("div",{className:"wa-actions",children:[t&&e?i!=null&&i.paired?s.jsxs("div",{className:"wa-action-row",children:[s.jsx("button",{className:"admin-refresh-btn wa-unpair-btn",type:"button",onClick:x,disabled:d,children:d?"โณโ€ฆ":"๐Ÿ—‘ Unpair (remove session)"}),s.jsx("span",{className:"admin-hint",children:"Removes creds.json โ€” you will need to scan a QR again."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"wa-action-row",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>y(!1),disabled:d,children:d?"โณโ€ฆ":"๐Ÿ”ณ Pair with a QR"}),s.jsx("span",{className:"admin-hint",children:"Scans from the phone you want to link."})]}),s.jsxs("div",{className:"wa-action-row wa-phone-row",children:[s.jsx("input",{type:"text",className:"wa-phone-input",value:c,onChange:w=>u(w.target.value),placeholder:"or pair with a number โ€” e.g. 918844433322",disabled:d,maxLength:16}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>y(!0),disabled:d||!c.trim(),children:"Pair by number"})]})]}):null,_==="failed"||_==="error"||_==="cancelled"?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:(i==null?void 0:i.error)||(_==="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."}),p?s.jsx("div",{className:`admin-row-msg${p.kind==="ok"?"":" admin-row-msg-err"}`,children:p.text}):null]}),s.jsxs("div",{className:"wa-contacts",children:[s.jsxs("div",{className:"wa-contacts-head",children:[s.jsx("span",{className:"wa-panel-title",children:"๐Ÿ“‡ Send-by-name contacts"}),s.jsxs("span",{className:"admin-hint",children:[Object.keys(o).length," mapped"]})]}),s.jsxs("p",{className:"admin-hint",children:["These names are for ",s.jsx("strong",{children:"sending messages by name"})," (e.g."," ",s.jsx("code",{children:'buff gateway send whatsapp:Name "โ€ฆ"'}),") โ€” they do"," ",s.jsx("strong",{children:"NOT"})," let these numbers trigger the agent."]}),s.jsx("div",{className:"hub-alias-list",children:Object.keys(o).length===0?s.jsxs("span",{className:"admin-hint",children:["(none โ€” add one with ",s.jsx("code",{children:"buff whatsapp contact add <Name> <number>"}),")"]}):Object.entries(o).map(([w,k])=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:w}),s.jsxs("span",{className:"admin-hint",children:["โ†’ ",r?k:eM(k)]})]},w))}),s.jsxs("p",{className:"admin-hint",style:{marginTop:8},children:["To let a number ",s.jsx("strong",{children:"trigger the agent"})," (respond to its messages), add it to the"," ",s.jsx("strong",{children:"verified list"})," in the ",s.jsx("strong",{children:"Permissions tab above"}),", or run"," ",s.jsx("code",{children:"buff config gateway allow whatsapp user <number>"}),"."]})]})]})}function uoe({canWrite:e,sessionExpired:t,mode:n="grid"}){const[r,i]=E.useState(null),[a,o]=E.useState(null),[l,c]=E.useState(null),[u,d]=E.useState(null),[f,p]=E.useState(null),[h,g]=E.useState(0),[m,v]=E.useState({}),[y,b]=E.useState(!1),[x,_]=E.useState(null),S=E.useRef(!0),w=E.useCallback(async()=>{const $=await ee.getPlatformConfigs();S.current&&i($)},[t]);E.useEffect(()=>(w(),()=>{S.current=!1}),[w]);const k=async($,R)=>{c($),d(null);const B=await ee.setPlatformConfig($,R);if(S.current){if(c(null),B.unauthorized||B.forbidden){t(B.error);return}d({kind:B.ok?"ok":"err",text:B.ok?"Saved โ€” transport active.":B.error||"Save failed."}),B.ok&&(o(null),w())}},N=async $=>{if(!window.confirm(`Remove ${$} transport config? Tokens will be deleted from ~/.buff/.env.`))return;c($),d(null);const R=await ee.removePlatformConfig($);if(S.current){if(c(null),R.unauthorized||R.forbidden){t(R.error);return}d({kind:R.ok?"ok":"err",text:R.ok?"Removed.":R.error||"Remove failed."}),R.ok&&w()}},j={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!"]}},C=$=>{p($),g(0),v(Object.fromEntries($.envVars.map(R=>[R.varName,R.value]))),_(null)},I=async()=>{if(!f)return;b(!0),_(null);const $=await ee.setPlatformConfig(f.platform,m);if(b(!1),$.unauthorized||$.forbidden){t($.error);return}$.ok?(_({kind:"ok",text:"โœ… Token saved! The transport is now active."}),w()):_({kind:"err",text:$.error||"Save failed."})};if(r===null)return s.jsx("div",{className:"empty-state",children:"Loading platform transportsโ€ฆ"});const M=f?j[f.platform]:null;return n==="table"?s.jsxs(s.Fragment,{children:[f&&M?s.jsx("div",{className:"wizard-overlay",onClick:()=>p(null),children:s.jsxs("div",{className:"wizard-modal",onClick:$=>$.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:"๐Ÿš€"}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>p(null),children:"โœ•"})]}),s.jsx("div",{className:"wizard-body",children:h===0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Steps to create your bot:"}),s.jsx("ol",{className:"wizard-steps",children:M.steps.map(($,R)=>s.jsx("li",{children:$},R))}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token โ†’"}),f.setupUrl?s.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"๐Ÿ“– Docs"}):null]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"๐Ÿ”‘ Paste your token:"}),f.envVars.map($=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:$.prompt}),s.jsx("input",{type:$.secret?"password":"text",value:m[$.varName]??"",onChange:R=>v(B=>({...B,[$.varName]:R.target.value})),placeholder:$.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},$.varName)),x?s.jsx("div",{className:`admin-row-msg${x.kind==="ok"?"":" admin-row-msg-err"}`,children:x.text}):null,s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"โ† Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void I(),disabled:y,children:y?"โณ Savingโ€ฆ":"๐Ÿ’พ Save token"})]}),(x==null?void 0:x.kind)==="ok"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Next steps:"}),s.jsx("ol",{className:"wizard-steps",children:M.postSetup.map(($,R)=>s.jsx("li",{children:$},R))})]}):null]})})]})}):null,u?s.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,s.jsx("div",{className:"platform-config-table-wrapper",children:s.jsxs("table",{className:"platform-config-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Platform"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Configuration"}),s.jsx("th",{children:"CLI Command"})]})}),s.jsx("tbody",{children:r.map($=>s.jsxs(W.Fragment,{children:[s.jsxs("tr",{className:`platform-config-row ${$.configured?"configured":""}`,children:[s.jsxs("td",{className:"platform-config-name",children:[s.jsx("span",{className:"hub-platform-label",children:$.label}),s.jsx("span",{className:"hub-card-id",children:$.platform})]}),s.jsxs("td",{children:[s.jsx("span",{className:`status-dot ${$.configured?"connected":"reconnecting"}`}),s.jsx("span",{className:"platform-config-status-text",children:$.configured?"Active":"Not configured"})]}),s.jsxs("td",{className:"platform-config-actions",children:[$.configured?null:s.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>C($),children:"๐Ÿš€ Getting Started"}),$.setupUrl?s.jsx("a",{href:$.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"๐Ÿ“– Docs"}):null,s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(a===$.platform?null:$.platform),disabled:!e,children:a===$.platform?"โ–ด Close":$.configured?"โœŽ Edit":"โš™ Configure"}),$.configured?s.jsx("button",{type:"button",className:"admin-mini-btn contact-delete-btn",onClick:()=>void N($.platform),disabled:!e,children:"๐Ÿ—‘๏ธ"}):null]}),s.jsx("td",{className:"platform-config-cli",children:s.jsxs("code",{children:["buff gateway setup ",$.platform]})})]}),a===$.platform?s.jsx("tr",{className:"platform-config-expanded",children:s.jsx("td",{colSpan:4,children:s.jsxs("div",{className:"platform-config-form",children:[$.envVars.map(R=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:R.prompt}),s.jsx("input",{type:R.secret?"password":"text",value:R.value,readOnly:!0,className:"platform-config-readonly",placeholder:R.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value"})]},R.varName)),s.jsxs("p",{className:"admin-hint",children:["Tokens are in ",s.jsx("code",{children:"~/.buff/.env"})," โ€” edit there or use the wizard above."]})]})})}):null]},$.platform))})]})})]}):s.jsxs(s.Fragment,{children:[f&&M?s.jsx("div",{className:"wizard-overlay",onClick:()=>p(null),children:s.jsxs("div",{className:"wizard-modal",onClick:$=>$.stopPropagation(),children:[s.jsxs("div",{className:"wizard-header",children:[s.jsx("span",{className:"wizard-icon",children:"๐Ÿš€"}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>p(null),children:"โœ•"})]}),s.jsx("div",{className:"wizard-body",children:h===0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Steps to create your bot:"}),s.jsx("ol",{className:"wizard-steps",children:M.steps.map(($,R)=>s.jsx("li",{children:$},R))}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token โ†’"}),f.setupUrl?s.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"๐Ÿ“– Open docs in new tab"}):null]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"๐Ÿ”‘ Paste your token:"}),f.envVars.map($=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:$.prompt}),s.jsx("input",{type:$.secret?"password":"text",value:m[$.varName]??"",onChange:R=>v(B=>({...B,[$.varName]:R.target.value})),placeholder:$.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},$.varName)),x?s.jsx("div",{className:`admin-row-msg${x.kind==="ok"?"":" admin-row-msg-err"}`,children:x.text}):null,s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"โ† Back"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void I(),disabled:y,children:y?"โณ Savingโ€ฆ":"๐Ÿ’พ Save token"})]}),(x==null?void 0:x.kind)==="ok"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Next steps:"}),s.jsx("ol",{className:"wizard-steps",children:M.postSetup.map(($,R)=>s.jsx("li",{children:$},R))})]}):null]})})]})}):null,s.jsxs("div",{className:"platform-config",children:[s.jsx("h3",{className:"section-subtitle",children:"โš™๏ธ Platform transports (buff config gateway)"}),u?s.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,s.jsx("div",{className:"hub-platform-grid",children:r.map($=>s.jsx(doe,{entry:$,canWrite:e,busy:l===$.platform,expanded:a===$.platform,onToggle:()=>o(a===$.platform?null:$.platform),onSave:R=>void k($.platform,R),onRemove:()=>void N($.platform),onStartWizard:()=>C($)},$.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 doe(e){const{entry:t,canWrite:n,busy:r,expanded:i,onToggle:a,onSave:o,onRemove:l,onStartWizard:c}=e,[u,d]=E.useState(()=>Object.fromEntries(t.envVars.map(p=>[p.varName,p.value]))),f=(p,h)=>{d(g=>({...g,[p]:h}))};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,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(p=>s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:p.prompt}),s.jsx("input",{type:p.secret?"password":"text",value:u[p.varName]??"",onChange:h=>f(p.varName,h.target.value),placeholder:p.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value",autoComplete:"off",spellCheck:!1,maxLength:512})]},p.varName)),s.jsxs("div",{className:"platform-config-actions",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(u),disabled:r,children:r?"โณ Savingโ€ฆ":"๐Ÿ’พ Save"}),t.configured?s.jsx("button",{type:"button",className:"hub-remove-btn",onClick:l,disabled:r,children:"๐Ÿ—‘ Remove"}):null]})]}):s.jsx("div",{className:"hub-platform-env",children:t.envVars.map(p=>s.jsxs("div",{children:[s.jsx("code",{children:p.varName})," ",p.set?"โœ“ set":"โ€” unset"]},p.varName))})]})}const foe=[{id:"tools",label:"Tools",icon:"๐Ÿงฐ"},{id:"channels",label:"Channels",icon:"๐Ÿ“ก"},{id:"conversations",label:"Conversations",icon:"๐Ÿ’ฌ"},{id:"artifacts",label:"Artifacts",icon:"๐Ÿ“ฆ"},{id:"skills",label:"Skills",icon:"๐Ÿง "}],poe={pending:"โณ pending",sent:"โœ… sent",failed:"โŒ failed"};function hoe(){var at,jt,en,$0,L0,D0,B0,z0,F0;const[e,t]=E.useState("tools"),[n,r]=E.useState(null),[i,a]=E.useState(!0),[o,l]=E.useState(null),[c,u]=E.useState(!1),[d,f]=E.useState(null),[p,h]=E.useState(!1),[g,m]=E.useState(null),[v,y]=E.useState(null),[b,x]=E.useState(""),[_,S]=E.useState(""),[w,k]=E.useState(null),[N,j]=E.useState(!1),[C,I]=E.useState(null),[M,$]=E.useState(null),[R,B]=E.useState({}),[L,U]=E.useState(""),[O,z]=E.useState(""),[T,V]=E.useState(!1),[q,P]=E.useState(null),[ce,me]=E.useState({}),[ue,He]=E.useState(!1),[Ce,te]=E.useState(null),[ye,be]=E.useState({}),[X,Ae]=E.useState({}),[we,Se]=E.useState(!1),[ge,De]=E.useState(null),[le,Tt]=E.useState(""),[Fe,Te]=E.useState(null),[lt,Me]=E.useState(!1),[Zt,Ht]=E.useState(new Map),[F,K]=E.useState(new Set),[ae,de]=E.useState(!1),[_e,Xe]=E.useState([]),[yt,It]=E.useState(""),[Dn,pt]=E.useState(null),[Nt,H]=E.useState(""),[oe,Re]=E.useState([]),[Oe,ga]=E.useState(0),[Pr,mr]=E.useState(0),[vo,_u]=E.useState(!0),[An,bo]=E.useState(!1),[_i,sl]=E.useState(!1),tt=20,xo=E.useRef(null),Mr=E.useCallback(async(A=!1)=>{if(An)return;const G=A?0:Pr;bo(!0);try{const J=await ee.fetchGatewayConversations({offset:G,limit:tt,q:le||void 0});J.ok&&J.conversations&&(Re(ne=>A?J.conversations:[...ne,...J.conversations]),ga(J.total??0),mr(G+J.conversations.length),_u(J.hasMore??!1))}catch{}bo(!1)},[An,Pr,le]);E.useEffect(()=>{e==="conversations"&&!_i&&!An&&(sl(!0),Mr(!0))},[e,_i,An,Mr]),E.useEffect(()=>{const A=xo.current;if(!A)return;const G=new IntersectionObserver(J=>{var ne;(ne=J[0])!=null&&ne.isIntersecting&&vo&&!An&&Mr(!1)},{threshold:.1});return G.observe(A),()=>G.disconnect()},[vo,An,Mr]),E.useEffect(()=>{const A=setTimeout(()=>{e==="conversations"&&_i&&(Re([]),mr(0),_u(!0),Mr(!0))},300);return()=>clearTimeout(A)},[le]),E.useEffect(()=>ee.onTypingEvent(G=>{Ht(J=>{const ne=new Map(J),fe=`${G.platform}:${G.channelId}`;return G.typing?ne.set(fe,{platform:G.platform,channelId:G.channelId,startedAt:Date.now()}):ne.delete(fe),ne})}),[]);const Gt=E.useCallback((A,G)=>{G.stopPropagation(),K(J=>{const ne=new Set(J);return ne.has(A)?ne.delete(A):ne.add(A),ne})},[]),ya=E.useCallback(()=>{K(A=>A.size===oe.length?new Set:new Set(oe.map(G=>G.key)))},[oe]),va=E.useCallback(async()=>{if(F.size!==0){de(!0);try{await ee.exportGatewayConversations([...F])}catch{}de(!1)}},[F]);E.useEffect(()=>{e==="conversations"&&ee.getAllConversationTags().then(A=>{A.ok&&A.tags&&Xe(A.tags)})},[e]);const Eu=E.useCallback(async(A,G)=>{if(!G.trim())return;(await ee.addConversationTag(A,G.trim())).ok&&(Re(ne=>ne.map(fe=>fe.key===A?{...fe,tags:[...fe.tags??[],G.trim().toLowerCase()]}:fe)),Xe(ne=>ne.includes(G.trim().toLowerCase())?ne:[...ne,G.trim().toLowerCase()].sort())),pt(null),H("")},[]),Bh=E.useCallback(async(A,G)=>{(await ee.removeConversationTag(A,G)).ok&&Re(ne=>ne.map(fe=>fe.key===A?{...fe,tags:(fe.tags??[]).filter(Pe=>Pe!==G)}:fe))},[]),ll=E.useCallback((A,G)=>{G.stopPropagation();const J=A.contactName||A.channelId,ne=[`Conversation with ${J} (${A.platform})`,`Exported: ${new Date().toLocaleString()}`,`Messages: ${A.messageCount}`,"โ”€".repeat(50),""];if(A.messages)for(const kt of A.messages){const ve=kt.role==="user"?J:"Agent",Lt=new Date(kt.ts).toLocaleString();ne.push(`[${Lt}] ${ve}:`),ne.push(kt.content),ne.push("")}const fe=new Blob([ne.join(`
135
- `)],{type:"text/plain;charset=utf-8"}),Pe=URL.createObjectURL(fe),ht=document.createElement("a");ht.href=Pe,ht.download=`conversation-${A.platform}-${A.channelId.replace(/[^\w]/g,"_")}-${new Date().toISOString().slice(0,10)}.txt`,document.body.appendChild(ht),ht.click(),document.body.removeChild(ht),URL.revokeObjectURL(Pe)},[]),wo=E.useCallback((A,G)=>{G.stopPropagation();const J=A.contactName||A.channelId,ne=A.messages??[],fe=`<!DOCTYPE html>
136
- <html>
137
- <head>
138
- <meta charset="utf-8">
139
- <title>Conversation with ${J}</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 ${J}</h1>
156
- <div class="meta">Platform: ${A.platform} ยท ${A.messageCount} messages ยท Exported: ${new Date().toLocaleString()}</div>
157
- ${ne.map(ht=>{const kt=ht.role==="user"?"user":"assistant",ve=ht.role==="user"?J:"Agent";return`<div class="msg msg-${kt}">
158
- <div class="bubble bubble-${kt}">${ht.content.replace(/</g,"&lt;").replace(/>/g,"&gt;")}</div>
159
- <div class="timestamp">${ve} ยท ${new Date(ht.ts).toLocaleString()}</div>
160
- </div>`}).join(`
161
- `)}
162
- </body>
163
- </html>`,Pe=window.open("","_blank");Pe&&(Pe.document.write(fe),Pe.document.close(),setTimeout(()=>Pe.print(),300))},[]);E.useEffect(()=>{var G;const A=(G=n==null?void 0:n.conversations)==null?void 0:G.recent;!A||A.length===0||_i&&(Pr>tt||le||Re(J=>{const ne=new Set(J.map(ve=>ve.key)),fe=A.map(ve=>({...ve})),Pe=new Map(J.map(ve=>[ve.key,ve]));for(const ve of fe)Pe.has(ve.key)&&Pe.set(ve.key,ve);const kt=[...fe.filter(ve=>!ne.has(ve.key)),...Pe.values()];return kt.sort((ve,Lt)=>Lt.lastActiveAt-ve.lastActiveAt),kt}))},[(at=n==null?void 0:n.conversations)==null?void 0:at.recent]);const[cl,Nu]=E.useState(""),[ju,zh]=E.useState([]),[Fh,Au]=E.useState(!1),[ul,So]=E.useState(!1),[Bn,Qt]=E.useState(null),[ba,Ei]=E.useState(null),[Tu,Ct]=E.useState({}),[Ni,ko]=E.useState([]),[Xr,_o]=E.useState([]),[Eo,Cu]=E.useState(""),ji=A=>we?String(A??""):eM(A),Ou=A=>{const G=A.match(/^(\d+)@/);if(!G)return"";const J=G[1];return J.length===12&&J.startsWith("91")?`+${J.slice(0,2)} ${J.slice(2,7)} ${J.slice(7)}`:J.length===10?`+91 ${J.slice(0,5)} ${J.slice(5)}`:`+${J}`},Uh=A=>{const G=Ou(A.channelId);return A.contactName?{name:A.contactName,phone:G}:{name:G||ji(A.channelId),phone:""}},bn=E.useCallback(async()=>{var G,J;u(!0),l(null);const A=await ee.fetchHub();r(A),(G=A==null?void 0:A.channels)!=null&&G.statusRecipients&&_o(A.channels.statusRecipients),(J=A==null?void 0:A.channels)!=null&&J.contacts&&ko(A.channels.contacts),A||l("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),a(!1),u(!1)},[]);E.useEffect(()=>{bn(),ee.fetchAdminAuthStatus().then(A=>{A&&(f({configured:A.configured,authenticated:A.authenticated}),h(A.authenticated),m(A.role??null),y(A.user??null))})},[bn]);const Jt=p&&(g==="admin"||g==="operator"),Wh=async A=>{A==null||A.preventDefault();const G=cl.trim();if(!G)return;So(!0),Qt(null);const J=await ee.marketplaceSearch(G);zh(J),Au(!0),So(!1)},Hh=async A=>{if(!p){Qt({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to install skills."});return}if(!Jt){Qt({kind:"err",text:"Your role cannot install skills โ€” admin or operator only."});return}Ei(A),Qt(null);const G=await ee.marketplaceInstall(A);G.ok?(Qt({kind:"ok",text:`โœ… Installed ${A} (quarantine checked) โ€” it appears in the Skills list and loads via the skill tool next turn.`}),bn()):Qt({kind:"err",text:G.quarantined?`โ›” ${G.error||"checksum mismatch โ€” quarantined"}`:`โŒ ${G.error||"Install failed."}`}),Ei(null)},Gh=async A=>{if(!p){Qt({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to uninstall skills."});return}if(!Jt){Qt({kind:"err",text:"Your role cannot uninstall skills โ€” admin or operator only."});return}Ei(A),Qt(null);const G=await ee.marketplaceUninstall(A);G.ok?(Qt({kind:"ok",text:`๐Ÿ—‘๏ธ Uninstalled ${A} โ€” removed from .agents/skills/ and provenance.`}),bn()):Qt({kind:"err",text:`โŒ ${G.error||"Uninstall failed."}`}),Ei(null)},Ai=()=>{h(!1),f(A=>A&&{...A,authenticated:!1}),k("Session expired โ€” log in again to toggle capabilities.")},Pu=async A=>{A.preventDefault(),j(!0),k(null);const G=await ee.adminLogin(b,_);if(G.ok){h(!0),f({configured:!0,authenticated:!0}),m(G.role??"admin"),y(G.user??null),x(""),S("");const J=C;I(null),J&&await xa(J.kind,J.name,J.enabled)}else k(G.error||"Login failed.");j(!1)},Mu=async A=>{if(A.preventDefault(),j(!0),k(null),_.length<8){k("Password must be at least 8 characters."),j(!1);return}const G=await ee.adminSetup(b,_);if(G.ok){h(!0),f({configured:!0,authenticated:!0}),m(G.role??"admin"),y(G.user??null),x(""),S("");const J=C;I(null),J&&await xa(J.kind,J.name,J.enabled)}else k(G.error||"Setup failed.");j(!1)},Ru=async()=>{await ee.adminLogout(),h(!1),f(A=>A&&{...A,authenticated:!1}),m(null),y(null)},xa=async(A,G,J)=>{$(G);const ne=A==="skill"?await ee.setSkillEnabled(G,J):await ee.setToolsetEnabled(G,J);ne.ok?(B(fe=>({...fe,[G]:`โœ… ${J?"Enabled":"Disabled"} โ€” live for new agent runs`})),bn()):ne.unauthorized?Ai():(B(fe=>({...fe,[G]:`โŒ ${ne.error||"Toggle failed"}`})),ne.forbidden&&k(ne.error||"Your role cannot change capabilities.")),$(null)},Iu=(A,G)=>{if(!p){I({kind:"toolset",name:A,enabled:G});return}xa("toolset",A,G)},D=(A,G)=>{if(!p){I({kind:"skill",name:A,enabled:G});return}xa("skill",A,G)},Z=async A=>{if(A.preventDefault(),!p){P({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to send test messages."});return}if(!Jt){P({kind:"err",text:"๐Ÿ”’ Your role cannot send channel messages โ€” requires the admin or operator role."});return}V(!0),P(null);const G=await ee.sendChannelMessage(L.trim(),O);G.ok?(P({kind:"ok",text:`โœ… Sent to ${L.trim()} (${G.platform}:${ji(G.channelId)})`}),z("")):G.unauthorized?(Ai(),P({kind:"err",text:G.error||"Session expired โ€” log in again."})):P({kind:"err",text:G.error||"Send failed."}),V(!1)},Q=(A,G)=>{var ne,fe;return(((fe=(ne=n==null?void 0:n.channels)==null?void 0:ne.policies)==null?void 0:fe[A])??{})[G]??[]},ke=(A,G,J)=>{const ne=J.trim();ne&&me(fe=>{var Lt;const Pe={...fe[A]??{}},ht=G==="user"?"allowedUsers":"allowedGroups",ve=[...((Lt=fe[A])==null?void 0:Lt[ht])??Q(A,ht)];return ve.includes(ne)||ve.push(ne),Pe[ht]=ve,{...fe,[A]:Pe}})},Zr=(A,G,J)=>{me(ne=>{var Lt;const fe=G==="user"?"allowedUsers":"allowedGroups",Pe=Q(A,fe),kt=(((Lt=ne[A])==null?void 0:Lt[fe])??Pe).filter(dl=>dl!==J);if(kt.length===0&&Pe.length===0){const dl={...ne[A]??{}};delete dl[fe];const qh={...ne};return Object.keys(dl).length===0?delete qh[A]:qh[A]=dl,qh}const ve={...ne[A]??{}};return ve[fe]=kt,{...ne,[A]:ve}})},$t=(A,G)=>{const J=A.trim().toLowerCase(),ne=G.trim().toLowerCase();if(J==="*"||ne==="*"||J===ne)return!0;const fe=J.replace(/\D+/g,""),Pe=ne.replace(/\D+/g,"");return fe.length>0&&fe===Pe},zn=A=>{const G=(Tu[A]??"").trim(),J=(ye[A]??"").trim();J&&(ke(A,"user",J),G&&ko(ne=>[...ne.filter(Pe=>!(Pe.platform===A&&($t(Pe.id,J)||Pe.name.toLowerCase()===G.toLowerCase()))),{name:G,platform:A,id:J,addedAt:Date.now()}]),be(ne=>({...ne,[A]:""})),Ct(ne=>({...ne,[A]:""})))},xn=(A,G)=>{Zr(A,"user",G),ko(J=>J.filter(ne=>!(ne.platform===A&&$t(ne.id,G))))},gr=(A,G)=>{me(J=>{const ne={...J[A]??{}};return G==="silentDrop"?ne.silentDrop=ne.silentDrop===!1:ne[G]?delete ne[G]:ne[G]=!0,{...J,[A]:ne}})},Jn=Object.keys(ce).length>0||Ni.length!==(((en=(jt=n==null?void 0:n.channels)==null?void 0:jt.contacts)==null?void 0:en.length)??0)||Ni.some((A,G)=>{var J,ne;return!((ne=(J=n==null?void 0:n.channels)==null?void 0:J.contacts)!=null&&ne[G])||A.platform!==n.channels.contacts[G].platform||A.id!==n.channels.contacts[G].id||A.name!==n.channels.contacts[G].name})||Xr.length!==(((L0=($0=n==null?void 0:n.channels)==null?void 0:$0.statusRecipients)==null?void 0:L0.length)??0)||Xr.some((A,G)=>{var J,ne;return A!==((ne=(J=n==null?void 0:n.channels)==null?void 0:J.statusRecipients)==null?void 0:ne[G])}),xe=async()=>{var G;if(!p){te({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to change permissions."});return}if(!Jt){te({kind:"err",text:"๐Ÿ”’ Your role cannot change permissions โ€” requires the admin or operator role."});return}He(!0),te(null);const A=await ee.saveGatewayPolicies(ce,Xr,Ni);if(A.ok){const J=(G=A.contactErrors)!=null&&G.length?`
164
- โš ๏ธ Some contacts were rejected: ${A.contactErrors.join("; ")}`:"";te({kind:J?"warn":"ok",text:`โœ… Permissions + saved contacts + status recipients saved โ€” the running gateway applies them immediately.${J}`}),me({}),bn()}else A.unauthorized?(Ai(),te({kind:"err",text:A.error||"Session expired โ€” log in again."})):te({kind:"err",text:A.error||"Failed to save permissions."});He(!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 Be=!p&&C!==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 bn(),disabled:c,children:c?"โณ Refreshingโ€ฆ":"๐Ÿ”„ Refresh"}),p?s.jsx("button",{className:"admin-logout-btn",onClick:()=>void Ru(),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,Be?s.jsxs("div",{className:"admin-header",children:[s.jsx("h3",{className:"section-subtitle",children:d!=null&&d.configured?`๐Ÿ” Log in to ${C.enabled?"enable":"disable"} '${C.name}'`:`๐Ÿ” Set up admin access to ${C.enabled?"enable":"disable"} '${C.name}'`}),s.jsxs("form",{className:"admin-gate-form",onSubmit:d!=null&&d.configured?Pu:Mu,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{type:"text",value:b,onChange:A=>x(A.target.value),autoComplete:"username",placeholder:"admin"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:_,onChange:A=>S(A.target.value),autoComplete:d!=null&&d.configured?"current-password":"new-password",placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"})]}),w?s.jsx("div",{className:"admin-error",children:w}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:N||!b||!_,children:N?"โณ โ€ฆ":d!=null&&d.configured?"๐Ÿ” Log in & apply":"๐Ÿ” Create admin & apply"}),d!=null&&d.configured?null:s.jsxs("p",{className:"admin-hint",children:["The first user is always an admin. Automation alternative: set"," ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," / ",s.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"}),"."]})]})]}):null,!Be&&!Jt&&p?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:foe.map(A=>{var J;const G=A.id==="tools"?n?`${n.toolsets.enabled}/${n.toolsets.toolsets.length}`:"":A.id==="channels"?n?String(n.channels.delivery.total):"":A.id==="conversations"?n?String(((J=n.conversations)==null?void 0:J.total)??0):"":A.id==="artifacts"?n?String(n.artifacts.totalSessions):"":n?`${n.skills.enabled}/${n.skills.total}`:"";return s.jsxs("button",{role:"tab","aria-selected":e===A.id,className:`hub-tab${e===A.id?" active":""}`,onClick:()=>t(A.id),children:[A.icon," ",A.label,G?s.jsx("span",{className:"hub-tab-count",children:G}):null]},A.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(A=>s.jsxs("div",{className:`hub-card${A.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:A.label}),s.jsx("span",{className:"hub-card-id",children:A.name})]}),s.jsx("button",{role:"switch","aria-checked":A.enabled,"aria-label":`${A.enabled?"Disable":"Enable"} ${A.label}`,className:`hub-switch${A.enabled?" on":""}`,disabled:M===A.name||C!==null||p&&!Jt,onClick:()=>Iu(A.name,!A.enabled),children:s.jsx("span",{className:"hub-switch-knob"})})]}),s.jsx("p",{className:"hub-card-desc",children:A.description}),s.jsx("div",{className:"hub-card-tools",children:A.tools.length>0?A.tools.map(G=>s.jsx("span",{className:"hub-chip",children:G},G)):s.jsx("span",{className:"admin-hint",children:"gates dynamic MCP tools (no static names)"})}),R[A.name]?s.jsx("div",{className:"admin-row-msg",children:R[A.name]}):null,A.enabled?null:s.jsx("div",{className:"hub-card-note",children:"โ›” Removed from the model schema โ€” calls return an explicit error"})]},A.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:we,onChange:A=>Se(A.target.checked),disabled:!Jt}),"Show full sender ids ",s.jsx("span",{className:"admin-hint",children:"(masks phone numbers by default)"})]}),Jt?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(A=>s.jsxs("tr",{children:[s.jsx("td",{className:"admin-provider-type",children:ji(A.target)}),s.jsx("td",{children:A.platform}),s.jsx("td",{children:s.jsx("span",{className:`admin-check-badge admin-check-${A.status==="sent"?"pass":A.status==="failed"?"fail":"warn"}`,children:poe[A.status]||A.status})}),s.jsxs("td",{children:[A.attempts,"/5"]}),s.jsx("td",{children:A.status==="pending"?`${Math.max(0,Math.round((A.nextAttemptAt-Date.now())/1e3))}s`:"โ€”"}),s.jsx("td",{className:"admin-hint",children:A.lastError?`โš ๏ธ ${A.lastError}`:(A.text||"").slice(0,60)})]},A.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(A=>s.jsxs("tr",{children:[s.jsxs("td",{className:"admin-provider-type",children:[A.platform,A.isGroup?s.jsx("span",{className:"hub-chip",children:"group"}):null]}),s.jsx("td",{children:ji(A.from||A.senderId||A.channelId)}),s.jsx("td",{className:"admin-hint",children:(A.text||"").slice(0,60)}),s.jsxs("td",{children:[s.jsx("span",{className:`admin-check-badge admin-check-${A.handled==="pipeline"?"pass":A.handled==="refused"?"fail":"warn"}`,children:A.handled}),A.reply?s.jsx("div",{className:"admin-hint",children:A.reply.slice(0,40)}):null]}),s.jsx("td",{className:"admin-hint",children:new Date(A.at).toLocaleString()})]},A.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."]}),s.jsx("h3",{className:"section-subtitle",children:"๐Ÿ”Œ Platform transports"}),s.jsx(uoe,{canWrite:Jt,sessionExpired:Ai,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(A=>s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:A.alias}),s.jsxs("span",{className:"admin-hint",children:["โ†’ ",A.platform,":",ji(A.channelId)]})]},A.alias))}):s.jsxs("div",{className:"empty-state",children:["No aliases yet โ€” register one with ",s.jsx("code",{children:"buff gateway alias <name> <platform> <channelId>"}),"."]}),Jn?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:ue,onClick:()=>void xe(),children:ue?"โณ Savingโ€ฆ":"๐Ÿ’พ Save permissions"})]}):null,s.jsx("h3",{className:"section-subtitle",children:"๐Ÿ” Permissions โ€” who can TRIGGER the agent"}),s.jsxs("p",{className:"admin-hint",children:["This list controls ",s.jsx("strong",{children:"who may trigger the agent"})," when they message you on each platform (WhatsApp, Telegram, email, โ€ฆ). A sender on the list gets a reply; everyone else is refused. Per platform: a listed sender/group is allowed; a ",s.jsx("strong",{children:"blank"})," list means"," ",s.jsx("strong",{children:"no one"})," may trigger; the token ",s.jsx("code",{children:"Allow-All"})," skips the verifier and responds to everyone. ",s.jsx("strong",{children:"Silent"})," refuses without replying. Changes apply to the running gateway immediately."]}),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(A=>{const G={...n.channels.policies[A.platform]??{},...ce[A.platform]??{}},J=G.allowedUsers??[],ne=G.allowedGroups??[];return s.jsxs("div",{className:"hub-card",children:[s.jsxs("div",{className:"hub-card-top",children:[s.jsx("span",{className:"hub-chip",children:A.label}),s.jsx("span",{className:"hub-card-id",children:A.platform}),G.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:[J.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,J.map(fe=>{var ht,kt,ve,Lt;const Pe=(((ht=ce[A.platform])==null?void 0:ht.allowedUsers)??[]).includes(fe)&&!(((Lt=(ve=(kt=n==null?void 0:n.channels)==null?void 0:kt.policies)==null?void 0:ve[A.platform])==null?void 0:Lt.allowedUsers)??[]).includes(fe);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:[ji(fe),Pe?" ยท pending":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:ue,onClick:()=>xn(A.platform,fe),children:"โœ•"})]},`u-${fe}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:Tu[A.platform]??"",onChange:fe=>Ct(Pe=>({...Pe,[A.platform]:fe.target.value})),placeholder:"Name (optional)",disabled:ue}),s.jsx("input",{type:"text",value:ye[A.platform]??"",onChange:fe=>be(Pe=>({...Pe,[A.platform]:fe.target.value})),placeholder:"Contact no / sender id, or Allow-All",disabled:ue}),s.jsx("button",{className:"admin-refresh-btn",disabled:ue||!(ye[A.platform]??"").trim(),onClick:()=>zn(A.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:[ne.length===0?s.jsx("span",{className:"admin-hint",children:"(none โ€” any group may trigger)"}):null,ne.map(fe=>{var ht,kt,ve,Lt;const Pe=(((ht=ce[A.platform])==null?void 0:ht.allowedGroups)??[]).includes(fe)&&!(((Lt=(ve=(kt=n==null?void 0:n.channels)==null?void 0:kt.policies)==null?void 0:ve[A.platform])==null?void 0:Lt.allowedGroups)??[]).includes(fe);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:[fe,Pe?" ยท pending":""]}),s.jsx("button",{className:"admin-refresh-btn",disabled:ue,onClick:()=>Zr(A.platform,"group",fe),children:"โœ•"})]},`g-${fe}`)})]}),s.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[s.jsx("input",{type:"text",value:X[A.platform]??"",onChange:fe=>Ae(Pe=>({...Pe,[A.platform]:fe.target.value})),placeholder:"group id, e.g. 1203630283471234@g.us",disabled:ue}),s.jsx("button",{className:"admin-refresh-btn",disabled:ue||!(X[A.platform]??"").trim(),onClick:()=>{ke(A.platform,"group",X[A.platform]??""),Ae(fe=>({...fe,[A.platform]:""}))},children:"+ Group"})]}),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:G.silentDrop!==!1,disabled:ue,onChange:()=>gr(A.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:!!G.requireMention,disabled:ue,onChange:()=>gr(A.platform,"requireMention")}),s.jsx("span",{className:"admin-hint",children:"Groups: mention only"})]}),s.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx("input",{type:"checkbox",checked:!!G.disabled,disabled:ue,onChange:()=>gr(A.platform,"disabled")}),s.jsx("span",{className:"admin-hint",children:"Disabled (off)"})]})]})]},A.platform)})}),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 A=Ni.filter(ne=>ne.status==="pending").length,G=Ni.filter(ne=>ne.status==="approved").length,J=Ni.filter(ne=>ne.status==="rejected").length;return s.jsxs("div",{className:"onboarding-stats",children:[s.jsxs("span",{className:"onboarding-stat pending",children:["โณ ",A," pending"]}),s.jsxs("span",{className:"onboarding-stat approved",children:["โœ… ",G," approved"]}),s.jsxs("span",{className:"onboarding-stat rejected",children:["๐Ÿšซ ",J," 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"}),"."]}),Xr.length>0?s.jsx("div",{className:"hub-alias-list",children:Xr.map(A=>{var G,J;return s.jsxs("div",{className:"hub-alias-row",children:[s.jsx("span",{className:"hub-chip",children:"๐Ÿ“Š"}),s.jsx("span",{className:"admin-hint",children:((J=(G=n==null?void 0:n.channels)==null?void 0:G.statusRecipientDisplay)==null?void 0:J[A])??A}),s.jsx("button",{className:"admin-refresh-btn",disabled:ue,onClick:()=>_o(ne=>ne.filter(fe=>fe!==A)),children:"โœ•"})]},A)})}):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:Eo,onChange:A=>Cu(A.target.value),placeholder:"whatsapp:Name or whatsapp:+91***",disabled:ue,maxLength:128}),s.jsx("button",{className:"admin-refresh-btn",disabled:ue||!Eo.trim()||Xr.includes(Eo.trim()),onClick:()=>{_o(A=>[...A,Eo.trim()]),Cu("")},children:"+ Add"})]}),s.jsxs("div",{className:"hub-send-form",style:{marginTop:10},children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:ue,onClick:()=>void xe(),children:ue?"โณ Savingโ€ฆ":"๐Ÿ’พ Save permissions"}),Object.keys(ce).length>0?s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:ue,onClick:()=>me({}),children:"Discard draft"}):null]}),Ce?s.jsx("div",{className:`admin-row-msg${Ce.kind==="ok"?"":" admin-row-msg-err"}`,children:Ce.text}):null,s.jsx("h3",{className:"section-subtitle",children:"๐Ÿ“ค Test a channel (buff gateway send)"}),s.jsxs("form",{className:"hub-send-form",onSubmit:A=>void Z(A),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:L,onChange:A=>U(A.target.value),placeholder:"ops or slack:C0123 or email:team@example.com",disabled:T,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:A=>z(A.target.value),placeholder:"nightly build done ๐ŸŽ‰",disabled:T,maxLength:4e3})]}),s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:T||!L.trim()||!O,children:T?"โณ Sendingโ€ฆ":"๐Ÿ“ค Send test message"})]}),q?s.jsx("div",{className:`admin-row-msg${q.kind==="ok"?"":" admin-row-msg-err"}`,children:q.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(coe,{authed:p,canWrite:Jt,sessionExpired:Ai,reveal:we})]}):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:((D0=n.conversations)==null?void 0:D0.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:oe.filter(A=>Date.now()-A.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:oe.filter(A=>A.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:oe.filter(A=>A.platform==="telegram").length}),s.jsx("div",{className:"admin-summary-label",children:"Telegram"})]})]}),((B0=n.conversations)==null?void 0:B0.analytics)&&n.conversations.analytics.totalConversations>0&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>Me(!lt),style:{marginBottom:12},children:lt?"๐Ÿ“Š Hide Analytics":"๐Ÿ“Š Show Analytics"}),lt?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((A,G)=>{var fe;const J=((fe=n.conversations.analytics.topContacts[0])==null?void 0:fe.messageCount)||1,ne=Math.round(A.messageCount/J*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:G<3?"#f59e0b":"var(--muted)"},children:G===0?"๐Ÿฅ‡":G===1?"๐Ÿฅˆ":G===2?"๐Ÿฅ‰":`${G+1}.`}),s.jsxs("span",{style:{flex:1,marginLeft:8},children:[A.platform==="whatsapp"?"๐Ÿ“ฑ":"โœˆ๏ธ"," ",A.name]}),s.jsx("span",{style:{width:60,textAlign:"right",fontWeight:600},children:A.messageCount}),s.jsx("div",{style:{width:100,height:8,background:"var(--border)",borderRadius:4,marginLeft:8},children:s.jsx("div",{style:{width:`${ne}%`,height:"100%",background:"#3b82f6",borderRadius:4}})})]},G)})})]}),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:A,count:G})=>{const J=Math.max(...n.conversations.analytics.hourlyDistribution.map(fe=>fe.count),1),ne=Math.round(G/J*70);return s.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:s.jsx("div",{style:{width:"100%",height:ne,background:A>=9&&A<=21?"#3b82f6":"#6b7280",borderRadius:2},title:`${A}:00 โ€” ${G} messages`})},A)})}),s.jsx("div",{style:{display:"flex",fontSize:10,color:"var(--muted)",marginTop:4},children:[0,6,12,18,23].map(A=>s.jsxs("span",{style:{flex:1,textAlign:A===0?"left":A===23?"right":"center"},children:[A,":00"]},A))})]}),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(A=>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:A.platform}),s.jsxs("span",{style:{marginLeft:8,flex:1},children:[A.conversations," conversations"]}),s.jsxs("span",{style:{fontWeight:600},children:[A.messages," msgs"]})]},A.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:A,count:G})=>{const J=Math.max(...n.conversations.analytics.dailyVolume.map(fe=>fe.count),1),ne=Math.round(G/J*50);return s.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:s.jsx("div",{style:{width:"100%",height:ne,background:"#10b981",borderRadius:2},title:`${A}: ${G} messages`})},A)})}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"var(--muted)",marginTop:4},children:[s.jsx("span",{children:(z0=n.conversations.analytics.dailyVolume[0])==null?void 0:z0.date}),s.jsx("span",{children:(F0=n.conversations.analytics.dailyVolume[n.conversations.analytics.dailyVolume.length-1])==null?void 0:F0.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."}),oe.length>0||An?s.jsxs(s.Fragment,{children:[_e.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:"}),_e.map(A=>s.jsxs("button",{type:"button",onClick:()=>It(yt===A?"":A),style:{padding:"2px 10px",borderRadius:12,fontSize:11,cursor:"pointer",border:`1px solid ${yt===A?"#3b82f6":"var(--border)"}`,background:yt===A?"#3b82f620":"transparent",color:yt===A?"#3b82f6":"var(--muted)"},children:["๐Ÿท๏ธ ",A]},A))]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12,flexWrap:"wrap"},children:[s.jsx("input",{type:"text",value:le,onChange:A=>Tt(A.target.value),placeholder:"๐Ÿ” Search by contact name, phone number, or message contentโ€ฆ",style:{flex:1,minWidth:200}}),s.jsxs("span",{className:"admin-hint",children:[Oe," conversation",Oe===1?"":"s",le?` matching "${le}"`:""]}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:ya,style:{fontSize:12,padding:"4px 10px"},children:F.size===oe.length?"โ˜‘ Deselect All":"โ˜ Select All"}),F.size>0&&s.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:ae,onClick:()=>void va(),style:{fontSize:12,padding:"4px 10px",background:"#3b82f6",color:"#fff",border:"none"},children:ae?"โณ Exportingโ€ฆ":`๐Ÿ“ฆ Export ${F.size} as ZIP`})]}),s.jsxs("div",{className:"hub-session-list",children:[oe.filter(A=>!yt||(A.tags??[]).includes(yt)).map(A=>{const G=Date.now()-A.lastActiveAt,J=G<6e4?"just now":G<36e5?`${Math.round(G/6e4)}m ago`:G<864e5?`${Math.round(G/36e5)}h ago`:`${Math.round(G/864e5)}d ago`,ne=ge===A.key,{name:fe,phone:Pe}=Uh(A),ht=async ve=>{if(ve.stopPropagation(),!p||!Jt){te({kind:"err",text:"๐Ÿ” Log in (admin/operator) to clear conversations."});return}Te(A.key);try{await ee.clearGatewayConversation(A.key),bn()}catch{}Te(null)},kt=F.has(A.key);return s.jsxs("div",{className:"hub-card",style:{cursor:"pointer",borderLeft:`3px solid ${A.platform==="whatsapp"?"#25d366":A.platform==="telegram"?"#0088cc":"#6c757d"}`,opacity:F.size>0&&!kt?.5:1,transition:"opacity 0.2s"},onClick:()=>De(ne?null:A.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:kt,onClick:ve=>Gt(A.key,ve),onChange:()=>{},style:{cursor:"pointer",width:16,height:16}}),s.jsxs("div",{className:"hub-card-title",children:[s.jsxs("span",{className:"hub-card-name",children:[A.platform==="whatsapp"?"๐Ÿ“ฑ":A.platform==="telegram"?"โœˆ๏ธ":"๐Ÿ’ฌ"," ",fe]}),s.jsxs("span",{className:"hub-card-id",children:[Pe&&s.jsx("span",{style:{color:"var(--text-secondary, #8b949e)",marginRight:6},children:Pe}),A.platform," ยท ",J]})]})]}),s.jsxs("div",{className:"hub-card-actions",style:{gap:6},children:[s.jsxs("span",{className:"hub-chip",children:[A.messageCount," msgs"]}),ne&&A.messages&&A.messages.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"hub-mini-btn",onClick:ve=>ll(A,ve),title:"Export as text file",children:"๐Ÿ“„"}),s.jsx("button",{type:"button",className:"hub-mini-btn",onClick:ve=>wo(A,ve),title:"Export as PDF (opens print dialog)",children:"๐Ÿ“‘"})]}),s.jsx("button",{type:"button",className:"hub-mini-btn",disabled:Fe===A.key,onClick:ht,title:"Clear conversation history",style:{color:"#ef4444"},children:"๐Ÿ—‘๏ธ"}),s.jsx("span",{style:{fontSize:18,transition:"transform 0.2s",transform:ne?"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:"})," ",A.lastUserMessage.slice(0,120),A.lastUserMessage.length>120?"โ€ฆ":""]}),s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:[(A.tags??[]).map(ve=>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:["๐Ÿท๏ธ ",ve,s.jsx("button",{type:"button",onClick:Lt=>{Lt.stopPropagation(),Bh(A.key,ve)},style:{background:"none",border:"none",color:"#3b82f6",cursor:"pointer",padding:0,fontSize:12,lineHeight:1},children:"ร—"})]},ve)),Dn===A.key?s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:s.jsx("input",{type:"text",value:Nt,onChange:ve=>H(ve.target.value),onKeyDown:ve=>{ve.key==="Enter"&&Eu(A.key,Nt),ve.key==="Escape"&&(pt(null),H(""))},placeholder:"tag name",autoFocus:!0,onClick:ve=>ve.stopPropagation(),style:{width:80,padding:"1px 6px",fontSize:11,borderRadius:8,border:"1px solid var(--border)"}})}):s.jsx("button",{type:"button",onClick:ve=>{ve.stopPropagation(),pt(A.key),H("")},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"})]}),ne&&A.messages&&A.messages.length>0?s.jsxs("div",{className:"conversation-thread",style:{marginTop:10,borderTop:"1px solid var(--border)",paddingTop:10,maxHeight:400,overflowY:"auto"},children:[A.messages.map((ve,Lt)=>s.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:ve.role==="user"?"flex-end":"flex-start"},children:[s.jsxs("div",{style:{maxWidth:"80%",padding:"8px 12px",borderRadius:12,backgroundColor:ve.role==="user"?"#007bff":"var(--bg-card, #1a1f2e)",color:ve.role==="user"?"#fff":"var(--text-primary, #e6edf3)",fontSize:13,lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[ve.content.slice(0,500),ve.content.length>500?"โ€ฆ":""]}),s.jsxs("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:[ve.role==="user"?"๐Ÿ‘ค":"๐Ÿค–"," ",new Date(ve.ts).toLocaleString()]})]},Lt)),Zt.has(A.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โ€ฆ"})]})]}):ne?s.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"No message details available."}):null]},A.key)}),vo&&!An&&s.jsx("div",{ref:xo,style:{height:1}}),An&&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โ€ฆ"})]}),!An&&!vo&&oe.length>0&&s.jsxs("p",{className:"admin-hint",style:{textAlign:"center",padding:12},children:["All ",Oe," conversation",Oe===1?"":"s"," loaded."]})]})]}):An?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(A=>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:A.sessionId}),s.jsxs("span",{className:"hub-card-id",children:[A.count," artifact",A.count===1?"":"s"," ยท ",new Date(A.latestAt).toLocaleString()]})]})}),A.recent.length>0?s.jsx("ul",{className:"hub-artifact-list",children:A.recent.map((G,J)=>s.jsxs("li",{children:[s.jsx("span",{className:"hub-chip",children:G.kind}),s.jsx("span",{className:"hub-artifact-title",children:G.title||"(untitled)"}),G.preview?s.jsx("div",{className:"hub-artifact-preview",children:G.preview}):null]},J))}):s.jsx("div",{className:"admin-hint",children:"No artifact details."})]},A.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(A=>s.jsxs("div",{className:`hub-card${A.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:A.name}),s.jsxs("span",{className:"hub-card-id",children:[A.id,A.version?` ยท v${A.version}`:""]})]}),s.jsxs("div",{className:"hub-card-actions",children:[A.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":A.enabled,"aria-label":`${A.enabled?"Disable":"Enable"} ${A.name}`,className:`hub-switch${A.enabled?" on":""}`,disabled:M===A.id||C!==null||p&&!Jt,onClick:()=>D(A.id,!A.enabled),children:s.jsx("span",{className:"hub-switch-knob"})})]})]}),s.jsx("p",{className:"hub-card-desc",children:A.description}),s.jsxs("div",{className:"hub-card-tools",children:[typeof A.usageCount=="number"?s.jsxs("span",{className:"hub-chip",children:[A.usageCount," uses"]}):null,A.enabled?null:s.jsx("span",{className:"hub-chip",children:"disabled"})]}),R[A.id]?s.jsx("div",{className:"admin-row-msg",children:R[A.id]}):null,A.enabled?null:s.jsx("div",{className:"hub-card-note",children:"โ›” Excluded from skill matching โ€” not injected into the planner"})]},`c-${A.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(A=>s.jsxs("div",{className:`hub-card${A.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:A.name}),s.jsx("span",{className:"hub-card-id",children:A.id})]}),s.jsxs("div",{className:"hub-card-actions",children:[s.jsx("button",{type:"button",className:"hub-mini-btn",disabled:ba===A.id||p&&!Jt,onClick:()=>void Gh(A.id),children:"๐Ÿ—‘ Uninstall"}),s.jsx("button",{role:"switch","aria-checked":A.enabled,"aria-label":`${A.enabled?"Disable":"Enable"} ${A.name}`,className:`hub-switch${A.enabled?" on":""}`,disabled:M===A.id||C!==null||p&&!Jt,onClick:()=>D(A.id,!A.enabled),children:s.jsx("span",{className:"hub-switch-knob"})})]})]}),s.jsx("p",{className:"hub-card-desc",children:A.description}),s.jsxs("div",{className:"hub-card-tools",children:[s.jsx("span",{className:"hub-chip",children:"SKILL.md"}),A.enabled?null:s.jsx("span",{className:"hub-chip",children:"disabled"})]}),R[A.id]?s.jsx("div",{className:"admin-row-msg",children:R[A.id]}):null,A.enabled?null:s.jsx("div",{className:"hub-card-note",children:"โ›” Excluded from skill matching โ€” not injected into the planner"})]},`h-${A.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:Wh,children:[s.jsx("input",{type:"text",value:cl,onChange:A=>Nu(A.target.value),placeholder:"Search community skills (e.g. code-assist, deploy, testing)โ€ฆ"}),s.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:ul,children:ul?"Searchingโ€ฆ":"๐Ÿ”Ž Search"})]}),Bn?s.jsx("div",{className:`admin-row-msg${Bn.kind==="err"?" admin-row-msg-err":""}`,children:Bn.text}):null,Fh&&!ul?ju.length>0?s.jsx("div",{className:"hub-session-list",children:ju.map(A=>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:A.name}),s.jsxs("span",{className:"hub-card-id",children:["v",A.version," ยท ",A.sourceKind]})]}),s.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:ba===A.name||p&&!Jt,onClick:()=>void Hh(A.name),children:ba===A.name?"Installingโ€ฆ":"โฌ‡ Install"})]}),s.jsx("p",{className:"hub-card-desc",children:A.description}),s.jsxs("div",{className:"hub-card-tools",children:[s.jsx("span",{className:"hub-chip",children:A.author}),A.tags.slice(0,3).map(G=>s.jsx("span",{className:"hub-chip",children:G},G))]})]},`m-${A.name}`))}):s.jsxs("div",{className:"empty-state",children:['No skills match "',cl,'" โ€” try a broader term, or add a registry to ',s.jsx("code",{children:"skills.registries"})," in config."]}):null]}):null]})}const cE={running:"โณ running",done:"โœ… done",failed:"โŒ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐Ÿ’ฅ error"};function uE(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 moe(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 dE(e){return e===null?"โ€”":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function goe(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 yoe(){const[e,t]=E.useState(null),[n,r]=E.useState(""),[i,a]=E.useState(300),[o,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(null),[p,h]=E.useState([]),[g,m]=E.useState(!0),v=E.useRef(null),y=E.useRef(null),b=E.useCallback(async()=>{const N=await ee.listTasks();N&&h(N.tasks)},[]);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(N=>{t(N?{configured:N.configured,authenticated:N.authenticated,role:N.role}:{configured:!1,authenticated:!1,role:null}),N!=null&&N.authenticated&&b()})},[b]),E.useEffect(()=>{var N,j;if(g&&(d==null?void 0:d.status)==="running")try{(j=(N=v.current)==null?void 0:N.scrollIntoView)==null||j.call(N,{block:"end"})}catch{}},[d==null?void 0:d.logs.length,d==null?void 0:d.status,g]),E.useEffect(()=>()=>{var N;return(N=y.current)==null?void 0:N.call(y)},[]);const x=E.useCallback((N,j)=>{var I;if((I=y.current)==null||I.call(y),f(N),u(""),!j)return;const C=ee.subscribeTask(N.id,{onLog:M=>f($=>$&&$.id===N.id?{...$,logs:[...$.logs,M]}:$),onStatus:M=>f($=>$&&$.id===N.id?{...$,status:M}:$)});y.current=C},[]),_=E.useCallback(async()=>{const N=moe(n);if(N.length===0){u("Type a command first โ€” e.g. `eval run --task smoke-test` or `gateway status`.");return}l(!0),u("");const j=await ee.startTask(N,i*1e3);if(l(!1),!j.ok||!j.task){u(j.error||"Failed to start task.");return}r(""),b(),x(j.task,!0)},[n,i,x,b]),S=E.useCallback(async N=>{await ee.cancelTask(N)},[]),w=E.useCallback(async N=>{const j=await ee.getTask(N);j!=null&&j.task&&x(j.task,!1)},[x]),k=E.useCallback(()=>{var N;(N=y.current)==null||N.call(y),f(null)},[]);return e?e.authenticated?s.jsxs("div",{className:"panel",children:[s.jsx("h2",{className:"panel-title",children:"๐Ÿš€ Command Console"}),s.jsx("p",{className:"admin-subtitle",children:"Run any agent-nuvira command โ€” the same CLI, executed by the dashboard. Messaging, skills, tools, eval, memory, traces and more."}),s.jsxs("form",{className:"task-run-form",onSubmit:N=>{N.preventDefault(),_()},children:[s.jsx("input",{className:"admin-input task-cmd-input",placeholder:"eval run --task smoke-test ยท gateway status ยท skill list ยท memory stats",value:n,onChange:N=>r(N.target.value),autoComplete:"off",spellCheck:!1}),s.jsxs("select",{className:"admin-input task-timeout-select",title:"Task timeout",value:i,onChange:N=>a(Number(N.target.value)),children:[s.jsx("option",{value:60,children:"1 min"}),s.jsx("option",{value:300,children:"5 min"}),s.jsx("option",{value:600,children:"10 min"}),s.jsx("option",{value:1800,children:"30 min"})]}),s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||n.trim()==="",children:o?"โณ Startingโ€ฆ":"โ–ถ Run"})]}),c&&s.jsx("div",{className:"admin-error",children:c}),s.jsx("p",{className:"task-hint",children:"Long-running commands stream their output live. Runs are capped at the chosen timeout and can be cancelled."}),d&&s.jsxs("div",{className:"task-console-wrap",children:[s.jsxs("div",{className:"task-console-header",children:[s.jsx("code",{className:"task-console-cmd",children:d.command}),s.jsx("span",{className:`task-status ${uE(d.status)}`,children:cE[d.status]}),s.jsxs("span",{className:"task-meta",children:["exit ",d.exitCode??"โ€”"," ยท ",dE(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:k,children:"โœ• Close"})]}),s.jsxs("div",{className:"task-console",children:[d.logs.map((N,j)=>s.jsx("div",{className:`task-line task-line-${N.stream}`,children:N.text},j)),d.logs.length===0&&d.status==="running"&&s.jsx("div",{className:"task-line task-line-system",children:"โณ waiting for outputโ€ฆ"}),s.jsx("div",{ref:v})]}),s.jsxs("label",{className:"task-autoscroll",children:[s.jsx("input",{type:"checkbox",checked:g,onChange:N=>m(N.target.checked)})," auto-scroll"]})]}),s.jsx("h3",{className:"task-history-title",children:"History"}),p.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:p.map(N=>s.jsxs("tr",{className:(d==null?void 0:d.id)===N.id?"task-row-active":"",onClick:()=>void w(N.id),children:[s.jsx("td",{children:s.jsx("code",{children:N.command})}),s.jsx("td",{children:s.jsx("span",{className:`task-status ${uE(N.status)}`,children:cE[N.status]})}),s.jsx("td",{children:N.exitCode??"โ€”"}),s.jsx("td",{children:dE(N.durationMs)}),s.jsx("td",{children:goe(N.startedAt)})]},N.id))})]})})]}):s.jsxs("div",{className:"panel",children:[s.jsx("h2",{className:"panel-title",children:"๐Ÿš€ Command Console"}),s.jsxs("div",{className:"empty-state",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"Log in to run tasks."})," The console executes commands on this machine, so it needs an admin session (like the Agent Hub toggles)."]}),s.jsx("p",{children:e.configured?s.jsx(vy,{className:"admin-refresh-btn",to:"/admin",children:"๐Ÿ” Log in"}):s.jsx(vy,{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 voe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const boe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xoe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,woe={};function fE(e,t){return(woe.jsx?xoe:boe).test(e)}const Soe=/[ \t\n\f\r]/g;function koe(e){return typeof e=="object"?e.type==="text"?pE(e.value):!1:pE(e)}function pE(e){return e.replace(Soe,"")===""}class xu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xu.prototype.normal={};xu.prototype.property={};xu.prototype.space=void 0;function tM(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new xu(n,r,t)}function Hv(e){return e.toLowerCase()}class Ln{constructor(t,n){this.attribute=n,this.property=t}}Ln.prototype.attribute="";Ln.prototype.booleanish=!1;Ln.prototype.boolean=!1;Ln.prototype.commaOrSpaceSeparated=!1;Ln.prototype.commaSeparated=!1;Ln.prototype.defined=!1;Ln.prototype.mustUseProperty=!1;Ln.prototype.number=!1;Ln.prototype.overloadedBoolean=!1;Ln.prototype.property="";Ln.prototype.spaceSeparated=!1;Ln.prototype.space=void 0;let _oe=0;const je=mo(),Pt=mo(),Gv=mo(),ie=mo(),nt=mo(),Ya=mo(),Fn=mo();function mo(){return 2**++_oe}const qv=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:Pt,commaOrSpaceSeparated:Fn,commaSeparated:Ya,number:ie,overloadedBoolean:Gv,spaceSeparated:nt},Symbol.toStringTag,{value:"Module"})),rg=Object.keys(qv);class d0 extends Ln{constructor(t,n,r,i){let a=-1;if(super(t,n),hE(this,"space",i),typeof r=="number")for(;++a<rg.length;){const o=rg[a];hE(this,rg[a],(r&qv[o])===qv[o])}}}d0.prototype.defined=!0;function hE(e,t,n){n&&(e[t]=n)}function al(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new d0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Hv(r)]=r,n[Hv(a.attribute)]=r}return new xu(t,n,e.space)}const nM=al({properties:{ariaActiveDescendant:null,ariaAtomic:Pt,ariaAutoComplete:null,ariaBusy:Pt,ariaChecked:Pt,ariaColCount:ie,ariaColIndex:ie,ariaColSpan:ie,ariaControls:nt,ariaCurrent:null,ariaDescribedBy:nt,ariaDetails:null,ariaDisabled:Pt,ariaDropEffect:nt,ariaErrorMessage:null,ariaExpanded:Pt,ariaFlowTo:nt,ariaGrabbed:Pt,ariaHasPopup:null,ariaHidden:Pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nt,ariaLevel:ie,ariaLive:null,ariaModal:Pt,ariaMultiLine:Pt,ariaMultiSelectable:Pt,ariaOrientation:null,ariaOwns:nt,ariaPlaceholder:null,ariaPosInSet:ie,ariaPressed:Pt,ariaReadOnly:Pt,ariaRelevant:null,ariaRequired:Pt,ariaRoleDescription:nt,ariaRowCount:ie,ariaRowIndex:ie,ariaRowSpan:ie,ariaSelected:Pt,ariaSetSize:ie,ariaSort:null,ariaValueMax:ie,ariaValueMin:ie,ariaValueNow:ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function rM(e,t){return t in e?e[t]:t}function iM(e,t){return rM(e,t.toLowerCase())}const Eoe=al({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ya,acceptCharset:nt,accessKey:nt,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alpha:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:nt,autoFocus:je,autoPlay:je,blocking:nt,capture:null,charSet:null,checked:je,cite:null,className:nt,closedBy:null,colorSpace:null,cols:ie,colSpan:ie,command:null,commandFor:null,content:null,contentEditable:Pt,controls:je,controlsList:nt,coords:ie|Ya,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:Gv,draggable:Pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:nt,height:ie,hidden:Gv,high:ie,href:null,hrefLang:null,htmlFor:nt,httpEquiv:nt,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:nt,itemRef:nt,itemScope:je,itemType:nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:ie,manifest:null,max:null,maxLength:ie,media:null,method:null,min:null,minLength:ie,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,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:je,optimum:ie,pattern:null,ping:nt,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:nt,required:je,reversed:je,rows:ie,rowSpan:ie,sandbox:nt,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootCustomElementRegistry:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shadowRootSerializable:je,shape:null,size:ie,sizes:null,slot:null,span:ie,spellCheck:Pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ie,step:null,style:null,tabIndex:ie,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:Pt,width:ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nt,axis:null,background:null,bgColor:null,border:ie,borderColor:null,bottomMargin:ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:ie,leftMargin:ie,link:null,longDesc:null,lowSrc:null,marginHeight:ie,marginWidth:ie,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:ie,rules:null,scheme:null,scrolling:Pt,standby:null,summary:null,text:null,topMargin:ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ie,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:je,disablePictureInPicture:je,disableRemotePlayback:je,exportParts:Ya,part:nt,prefix:null,property:null,results:ie,security:null,unselectable:null},space:"html",transform:iM}),Noe=al({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:Fn,accentHeight:ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ie,amplitude:ie,arabicForm:null,ascent:ie,attributeName:null,attributeType:null,azimuth:ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ie,by:null,calcMode:null,capHeight:ie,className:nt,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:ie,diffuseConstant:ie,direction:null,display:null,dur:null,divisor:ie,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:ie,enableBackground:null,end:null,event:null,exponent:ie,externalResourcesRequired:null,fill:null,fillOpacity:ie,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:Ya,g2:Ya,glyphName:Ya,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ie,horizOriginX:ie,horizOriginY:ie,id:null,ideographic:ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ie,k:ie,k1:ie,k2:ie,k3:ie,k4:ie,kernelMatrix:Fn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ie,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:ie,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:ie,overlineThickness:ie,paintOrder:null,panose1:null,path:null,pathLength:ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ie,pointsAtY:ie,pointsAtZ:ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fn,rev:Fn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fn,requiredFeatures:Fn,requiredFonts:Fn,requiredFormats:Fn,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:ie,specularExponent:ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ie,strikethroughThickness:ie,string:null,stroke:null,strokeDashArray:Fn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ie,strokeOpacity:ie,strokeWidth:null,style:null,surfaceScale:ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fn,tabIndex:ie,tableValues:null,target:null,targetX:ie,targetY:ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ie,underlineThickness:ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ie,values:null,vAlphabetic:ie,vMathematical:ie,vectorEffect:null,vHanging:ie,vIdeographic:ie,version:null,vertAdvY:ie,vertOriginX:ie,vertOriginY:ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:rM}),aM=al({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()}}),oM=al({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:iM}),sM=al({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),joe={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"},Aoe=/[A-Z]/g,mE=/-[a-z]/g,Toe=/^data[-\w.:]+$/i;function Coe(e,t){const n=Hv(t);let r=t,i=Ln;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Toe.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(mE,Poe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!mE.test(a)){let o=a.replace(Aoe,Ooe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=d0}return new i(r,t)}function Ooe(e){return"-"+e.toLowerCase()}function Poe(e){return e.charAt(1).toUpperCase()}const Moe=tM([nM,Eoe,aM,oM,sM],"html"),f0=tM([nM,Noe,aM,oM,sM],"svg");function Roe(e){return e.join(" ").trim()}var p0={},gE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ioe=/\n/g,$oe=/^\s*/,Loe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Doe=/^:\s*/,Boe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,zoe=/^[;\s]*/,Foe=/^\s+|\s+$/g,Uoe=`
165
- `,yE="/",vE="*",Ra="",Woe="comment",Hoe="declaration";function Goe(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(Ioe);m&&(n+=m.length);var v=g.lastIndexOf(Uoe);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($oe)}function d(g){var m;for(g=g||[];m=f();)m!==!1&&g.push(m);return g}function f(){var g=a();if(!(yE!=e.charAt(0)||vE!=e.charAt(1))){for(var m=2;Ra!=e.charAt(m)&&(vE!=e.charAt(m)||yE!=e.charAt(m+1));)++m;if(m+=2,Ra===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:Woe,comment:v})}}function p(){var g=a(),m=c(Loe);if(m){if(f(),!c(Doe))return l("property missing ':'");var v=c(Boe),y=g({type:Hoe,property:bE(m[0].replace(gE,Ra)),value:v?bE(v[0].replace(gE,Ra)):Ra});return c(zoe),y}}function h(){var g=[];d(g);for(var m;m=p();)m!==!1&&(g.push(m),d(g));return g}return u(),h()}function bE(e){return e?e.replace(Foe,Ra):Ra}var qoe=Goe,Koe=zi&&zi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p0,"__esModule",{value:!0});p0.default=Yoe;const Voe=Koe(qoe);function Yoe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Voe.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 Ph={};Object.defineProperty(Ph,"__esModule",{value:!0});Ph.camelCase=void 0;var Xoe=/^--[a-zA-Z0-9_-]+$/,Zoe=/-([a-z])/g,Qoe=/^[^-]+$/,Joe=/^-(webkit|moz|ms|o|khtml)-/,ese=/^-(ms)-/,tse=function(e){return!e||Qoe.test(e)||Xoe.test(e)},nse=function(e,t){return t.toUpperCase()},xE=function(e,t){return"".concat(t,"-")},rse=function(e,t){return t===void 0&&(t={}),tse(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(ese,xE):e=e.replace(Joe,xE),e.replace(Zoe,nse))};Ph.camelCase=rse;var ise=zi&&zi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ase=ise(p0),ose=Ph;function Kv(e,t){var n={};return!e||typeof e!="string"||(0,ase.default)(e,function(r,i){r&&i&&(n[(0,ose.camelCase)(r,t)]=i)}),n}Kv.default=Kv;var sse=Kv;const lse=Ye(sse),lM=cM("end"),h0=cM("start");function cM(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 cse(e){const t=h0(e),n=lM(e);if(t&&n)return{start:t,end:n}}function Jl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wE(e.position):"start"in e||"end"in e?wE(e):"line"in e||"column"in e?Vv(e):""}function Vv(e){return SE(e&&e.line)+":"+SE(e&&e.column)}function wE(e){return Vv(e&&e.start)+"-"+Vv(e&&e.end)}function SE(e){return e&&typeof e=="number"?e:1}class vn 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=Jl(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}}vn.prototype.file="";vn.prototype.name="";vn.prototype.reason="";vn.prototype.message="";vn.prototype.stack="";vn.prototype.column=void 0;vn.prototype.line=void 0;vn.prototype.ancestors=void 0;vn.prototype.cause=void 0;vn.prototype.fatal=void 0;vn.prototype.place=void 0;vn.prototype.ruleId=void 0;vn.prototype.source=void 0;const m0={}.hasOwnProperty,use=new Map,dse=/[A-Z]/g,fse=new Set(["table","tbody","thead","tfoot","tr"]),pse=new Set(["td","th"]),uM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hse(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=Sse(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=wse(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"?f0:Moe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=dM(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function dM(e,t,n){if(t.type==="element")return mse(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return gse(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return vse(e,t,n);if(t.type==="mdxjsEsm")return yse(e,t);if(t.type==="root")return bse(e,t,n);if(t.type==="text")return xse(e,t)}function mse(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=f0,e.schema=i),e.ancestors.push(t);const a=pM(e,t.tagName,!1),o=kse(e,t);let l=y0(e,t);return fse.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!koe(c):!0})),fM(e,o,a,t),g0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function gse(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)}ru(e,t.position)}function yse(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ru(e,t.position)}function vse(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=f0,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:pM(e,t.name,!0),o=_se(e,t),l=y0(e,t);return fM(e,o,a,t),g0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function bse(e,t,n){const r={};return g0(r,y0(e,t)),e.create(t,e.Fragment,r,n)}function xse(e,t){return t.value}function fM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function g0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function wse(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 Sse(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=h0(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 kse(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&m0.call(t.properties,i)){const a=Ese(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&pse.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 _se(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 ru(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 ru(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function y0(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:use;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=dM(e,a,o);l!==void 0&&n.push(l)}return n}function Ese(e,t,n){const r=Coe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?voe(n):Roe(n)),r.property==="style"){let i=typeof n=="object"?n:Nse(e,String(n));return e.stylePropertyNameCase==="css"&&(i=jse(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?joe[r.property]||r.property:r.attribute,n]}}function Nse(e,t){try{return lse(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new vn("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=uM+"#cannot-parse-style-attribute",i}}function pM(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=fE(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=fE(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return m0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ru(e)}function ru(e,t){const n=new vn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=uM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function jse(e){const t={};let n;for(n in e)m0.call(e,n)&&(t[Ase(n)]=e[n]);return t}function Ase(e){let t=e.replace(dse,Tse);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Tse(e){return"-"+e.toLowerCase()}const ig={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"]},Cse={};function v0(e,t){const n=Cse,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return hM(e,r,i)}function hM(e,t,n){if(Ose(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 kE(e.children,t,n)}return Array.isArray(e)?kE(e,t,n):""}function kE(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=hM(e[i],t,n);return r.join("")}function Ose(e){return!!(e&&typeof e=="object")}const _E=document.createElement("i");function b0(e){const t="&"+e+";";_E.innerHTML=t;const n=_E.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Vn(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ar(e,t){return e.length>0?(Vn(e,e.length,0,t),e):t}const EE={}.hasOwnProperty;function mM(e){const t={};let n=-1;for(;++n<e.length;)Pse(t,e[n]);return t}function Pse(e,t){let n;for(n in t){const i=(EE.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){EE.call(i,o)||(i[o]=[]);const l=a[o];Mse(i[o],Array.isArray(l)?l:l?[l]:[])}}}function Mse(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Vn(e,0,0,r)}function gM(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 Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=ma(/[A-Za-z]/),gn=ma(/[\dA-Za-z]/),Rse=ma(/[#-'*+\--9=?A-Z^-~]/);function yp(e){return e!==null&&(e<32||e===127)}const Yv=ma(/\d/),Ise=ma(/[\dA-Fa-f]/),$se=ma(/[!-/:-@[-`{-~]/);function Ee(e){return e!==null&&e<-2}function it(e){return e!==null&&(e<0||e===32)}function $e(e){return e===-2||e===-1||e===32}const Mh=ma(new RegExp("\\p{P}|\\p{S}","u")),so=ma(/\s/);function ma(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ol(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&gn(e.charCodeAt(n+1))&&gn(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 ze(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return $e(c)?(e.enter(n),l(c)):t(c)}function l(c){return $e(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const Lse={tokenize:Dse};function Dse(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"),ze(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 Ee(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const Bse={tokenize:zse},NE={tokenize:Fse};function zse(e){const t=this,n=[];let r=0,i,a,o;return l;function l(x){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,c,u)(x)}return u(x)}function c(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const _=t.events.length;let S=_,w;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){w=t.events[S][1].end;break}y(r);let k=_;for(;k<t.events.length;)t.events[k][1].end={...w},k++;return Vn(t.events,S+1,0,t.events.slice(_)),t.events.length=k,u(x)}return l(x)}function u(x){if(r===n.length){if(!i)return p(x);if(i.currentConstruct&&i.currentConstruct.concrete)return g(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(NE,d,f)(x)}function d(x){return i&&b(),y(r),p(x)}function f(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(x)}function p(x){return t.containerState={},e.attempt(NE,h,g)(x)}function h(x){return r++,n.push([t.currentConstruct,t.containerState]),p(x)}function g(x){if(x===null){i&&b(),y(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),m(x)}function m(x){if(x===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return Ee(x)?(e.consume(x),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(x),m)}function v(x,_){const S=t.sliceStream(x);if(_&&S.push(null),x.previous=a,a&&(a.next=x),a=x,i.defineSkip(x.start),i.write(S),t.parser.lazy[x.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<o&&(!i.events[w][1].end||i.events[w][1].end.offset>o))return;const k=t.events.length;let N=k,j,C;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(j){C=t.events[N][1].end;break}j=!0}for(y(r),w=k;w<t.events.length;)t.events[w][1].end={...C},w++;Vn(t.events,N+1,0,t.events.slice(k)),t.events.length=w}}function y(x){let _=n.length;for(;_-- >x;){const S=n[_];t.containerState=S[1],S[0].exit.call(t,e)}n.length=x}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Fse(e,t,n){return ze(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Bs(e){if(e===null||it(e)||so(e))return 1;if(Mh(e))return 2}function Rh(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 Xv={name:"attention",resolveAll:Use,tokenize:Wse};function Use(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},p={...e[n][1].start};jE(f,-c),jE(p,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:p},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ar(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ar(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=ar(u,Rh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ar(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=ar(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Vn(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 Wse(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Bs(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=Bs(c),f=!d||d===2&&i||n.includes(c),p=!i||i===2&&d||n.includes(r);return u._open=!!(a===42?f:f&&(i||!p)),u._close=!!(a===42?p:p&&(d||!f)),t(c)}}function jE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Hse={name:"autolink",tokenize:Gse};function Gse(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(h){return kn(h)?(e.consume(h),o):h===64?n(h):u(h)}function o(h){return h===43||h===45||h===46||gn(h)?(r=1,l(h)):u(h)}function l(h){return h===58?(e.consume(h),r=0,c):(h===43||h===45||h===46||gn(h))&&r++<32?(e.consume(h),l):(r=0,u(h))}function c(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||yp(h)?n(h):(e.consume(h),c)}function u(h){return h===64?(e.consume(h),d):Rse(h)?(e.consume(h),u):n(h)}function d(h){return gn(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,d):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||gn(h))&&r++<63){const g=h===45?p:f;return e.consume(h),g}return n(h)}}const wu={partial:!0,tokenize:qse};function qse(e,t,n){return r;function r(a){return $e(a)?ze(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ee(a)?t(a):n(a)}}const yM={continuation:{tokenize:Vse},exit:Yse,name:"blockQuote",tokenize:Kse};function Kse(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 $e(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Vse(e,t,n){const r=this;return i;function i(o){return $e(o)?ze(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(yM,t,n)(o)}}function Yse(e){e.exit("blockQuote")}const vM={name:"characterEscape",tokenize:Xse};function Xse(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 $se(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const bM={name:"characterReference",tokenize:Zse};function Zse(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=gn,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=Ise,d):(e.enter("characterReferenceValue"),a=7,o=Yv,d(f))}function d(f){if(f===59&&i){const p=e.exit("characterReferenceValue");return o===gn&&!b0(r.sliceSerialize(p))?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 AE={partial:!0,tokenize:Jse},TE={concrete:!0,name:"codeFenced",tokenize:Qse};function Qse(e,t,n){const r=this,i={partial:!0,tokenize:S};let a=0,o=0,l;return c;function c(w){return u(w)}function u(w){const k=r.events[r.events.length-1];return a=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,l=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(w)}function d(w){return w===l?(o++,e.consume(w),d):o<3?n(w):(e.exit("codeFencedFenceSequence"),$e(w)?ze(e,f,"whitespace")(w):f(w))}function f(w){return w===null||Ee(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(AE,m,_)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||Ee(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(w)):$e(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ze(e,h,"whitespace")(w)):w===96&&w===l?n(w):(e.consume(w),p)}function h(w){return w===null||Ee(w)?f(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||Ee(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(w)):w===96&&w===l?n(w):(e.consume(w),g)}function m(w){return e.attempt(i,_,v)(w)}function v(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return a>0&&$e(w)?ze(e,b,"linePrefix",a+1)(w):b(w)}function b(w){return w===null||Ee(w)?e.check(AE,m,_)(w):(e.enter("codeFlowValue"),x(w))}function x(w){return w===null||Ee(w)?(e.exit("codeFlowValue"),b(w)):(e.consume(w),x)}function _(w){return e.exit("codeFenced"),t(w)}function S(w,k,N){let j=0;return C;function C(B){return w.enter("lineEnding"),w.consume(B),w.exit("lineEnding"),I}function I(B){return w.enter("codeFencedFence"),$e(B)?ze(w,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):M(B)}function M(B){return B===l?(w.enter("codeFencedFenceSequence"),$(B)):N(B)}function $(B){return B===l?(j++,w.consume(B),$):j>=o?(w.exit("codeFencedFenceSequence"),$e(B)?ze(w,R,"whitespace")(B):R(B)):N(B)}function R(B){return B===null||Ee(B)?(w.exit("codeFencedFence"),k(B)):N(B)}}}function Jse(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 ag={name:"codeIndented",tokenize:tle},ele={partial:!0,tokenize:nle};function tle(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ze(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):Ee(u)?e.attempt(ele,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ee(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function nle(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ee(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ze(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):Ee(o)?i(o):n(o)}}const rle={name:"codeText",previous:ale,resolve:ile,tokenize:ole};function ile(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 ale(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ole(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)):Ee(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||Ee(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",u(f))}}class sle{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&&Ol(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),Ol(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ol(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);Ol(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ol(this.left,n.reverse())}}}function Ol(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 xM(e){const t={};let n=-1,r,i,a,o,l,c,u;const d=new sle(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,lle(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 Vn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function lle(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,p=-1,h=n,g=0,m=0;const v=[m];for(;h;){for(;e.get(++i)[1]!==h;);a.push(i),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<l.length;)l[p][0]==="exit"&&l[p-1][0]==="enter"&&l[p][1].type===l[p-1][1].type&&l[p][1].start.line!==l[p][1].end.line&&(m=p+1,v.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),p=v.length;p--;){const y=l.slice(v[p],v[p+1]),b=a.pop();c.push([b,b+y.length-1]),e.splice(b,2,y)}for(c.reverse(),p=-1;++p<c.length;)u[g+c[p][0]]=g+c[p][1],g+=c[p][1]-c[p][0]-1;return u}const cle={resolve:dle,tokenize:fle},ule={partial:!0,tokenize:ple};function dle(e){return xM(e),e}function fle(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):Ee(l)?e.check(ule,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 ple(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ze(e,a,"linePrefix")}function a(o){if(o===null||Ee(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function wM(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),p):y===null||y===32||y===41||yp(y)?n(y):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function p(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"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(l),p(y)):y===null||y===60||Ee(y)?n(y):(e.consume(y),y===92?g:h)}function g(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function m(y){return!d&&(y===null||y===41||it(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||yp(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 SM(e,t,n,r,i,a){const o=this;let l=0,c;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(a),d}function d(h){return l>999||h===null||h===91||h===93&&!c||h===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(a),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):Ee(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Ee(h)||l++>999?(e.exit("chunkString"),d(h)):(e.consume(h),c||(c=!$e(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),l++,f):f(h)}}function kM(e,t,n,r,i,a){let o;return l;function l(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),o=p===40?41:p,c):n(p)}function c(p){return p===o?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(a),u(p))}function u(p){return p===o?(e.exit(a),c(o)):p===null?n(p):Ee(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ze(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===o||p===null||Ee(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:d)}function f(p){return p===o||p===92?(e.consume(p),d):d(p)}}function ec(e,t){let n;return r;function r(i){return Ee(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):$e(i)?ze(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const hle={name:"definition",tokenize:gle},mle={partial:!0,tokenize:yle};function gle(e,t,n){const r=this;let i;return a;function a(h){return e.enter("definition"),o(h)}function o(h){return SM.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return i=Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),c):n(h)}function c(h){return it(h)?ec(e,u)(h):u(h)}function u(h){return wM(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(mle,f,f)(h)}function f(h){return $e(h)?ze(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Ee(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function yle(e,t,n){return r;function r(l){return it(l)?ec(e,i)(l):n(l)}function i(l){return kM(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return $e(l)?ze(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ee(l)?t(l):n(l)}}const vle={name:"hardBreakEscape",tokenize:ble};function ble(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ee(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const xle={name:"headingAtx",resolve:wle,tokenize:Sle};function wle(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"},Vn(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Sle(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||it(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ee(d)?(e.exit("atxHeading"),t(d)):$e(d)?ze(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||it(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const kle=["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"],CE=["pre","script","style","textarea"],_le={concrete:!0,name:"htmlFlow",resolveTo:jle,tokenize:Ale},Ele={partial:!0,tokenize:Cle},Nle={partial:!0,tokenize:Tle};function jle(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 Ale(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),p):P===47?(e.consume(P),a=!0,m):P===63?(e.consume(P),i=3,r.interrupt?t:T):kn(P)?(e.consume(P),o=String.fromCharCode(P),v):n(P)}function p(P){return P===45?(e.consume(P),i=2,h):P===91?(e.consume(P),i=5,l=0,g):kn(P)?(e.consume(P),i=4,r.interrupt?t:T):n(P)}function h(P){return P===45?(e.consume(P),r.interrupt?t:T):n(P)}function g(P){const ce="CDATA[";return P===ce.charCodeAt(l++)?(e.consume(P),l===ce.length?r.interrupt?t:M:g):n(P)}function m(P){return kn(P)?(e.consume(P),o=String.fromCharCode(P),v):n(P)}function v(P){if(P===null||P===47||P===62||it(P)){const ce=P===47,me=o.toLowerCase();return!ce&&!a&&CE.includes(me)?(i=1,r.interrupt?t(P):M(P)):kle.includes(o.toLowerCase())?(i=6,ce?(e.consume(P),y):r.interrupt?t(P):M(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):a?b(P):x(P))}return P===45||gn(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 $e(P)?(e.consume(P),b):C(P)}function x(P){return P===47?(e.consume(P),C):P===58||P===95||kn(P)?(e.consume(P),_):$e(P)?(e.consume(P),x):C(P)}function _(P){return P===45||P===46||P===58||P===95||gn(P)?(e.consume(P),_):S(P)}function S(P){return P===61?(e.consume(P),w):$e(P)?(e.consume(P),S):x(P)}function w(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,k):$e(P)?(e.consume(P),w):N(P)}function k(P){return P===c?(e.consume(P),c=null,j):P===null||Ee(P)?n(P):(e.consume(P),k)}function N(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||it(P)?S(P):(e.consume(P),N)}function j(P){return P===47||P===62||$e(P)?x(P):n(P)}function C(P){return P===62?(e.consume(P),I):n(P)}function I(P){return P===null||Ee(P)?M(P):$e(P)?(e.consume(P),I):n(P)}function M(P){return P===45&&i===2?(e.consume(P),L):P===60&&i===1?(e.consume(P),U):P===62&&i===4?(e.consume(P),V):P===63&&i===3?(e.consume(P),T):P===93&&i===5?(e.consume(P),z):Ee(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Ele,q,$)(P)):P===null||Ee(P)?(e.exit("htmlFlowData"),$(P)):(e.consume(P),M)}function $(P){return e.check(Nle,R,q)(P)}function R(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),B}function B(P){return P===null||Ee(P)?$(P):(e.enter("htmlFlowData"),M(P))}function L(P){return P===45?(e.consume(P),T):M(P)}function U(P){return P===47?(e.consume(P),o="",O):M(P)}function O(P){if(P===62){const ce=o.toLowerCase();return CE.includes(ce)?(e.consume(P),V):M(P)}return kn(P)&&o.length<8?(e.consume(P),o+=String.fromCharCode(P),O):M(P)}function z(P){return P===93?(e.consume(P),T):M(P)}function T(P){return P===62?(e.consume(P),V):P===45&&i===2?(e.consume(P),T):M(P)}function V(P){return P===null||Ee(P)?(e.exit("htmlFlowData"),q(P)):(e.consume(P),V)}function q(P){return e.exit("htmlFlow"),t(P)}}function Tle(e,t,n){const r=this;return i;function i(o){return Ee(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 Cle(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(wu,t,n)}}const Ole={name:"htmlText",tokenize:Ple};function Ple(e,t,n){const r=this;let i,a,o;return l;function l(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),c}function c(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),S):T===63?(e.consume(T),x):kn(T)?(e.consume(T),N):n(T)}function u(T){return T===45?(e.consume(T),d):T===91?(e.consume(T),a=0,g):kn(T)?(e.consume(T),b):n(T)}function d(T){return T===45?(e.consume(T),h):n(T)}function f(T){return T===null?n(T):T===45?(e.consume(T),p):Ee(T)?(o=f,U(T)):(e.consume(T),f)}function p(T){return T===45?(e.consume(T),h):f(T)}function h(T){return T===62?L(T):T===45?p(T):f(T)}function g(T){const V="CDATA[";return T===V.charCodeAt(a++)?(e.consume(T),a===V.length?m:g):n(T)}function m(T){return T===null?n(T):T===93?(e.consume(T),v):Ee(T)?(o=m,U(T)):(e.consume(T),m)}function v(T){return T===93?(e.consume(T),y):m(T)}function y(T){return T===62?L(T):T===93?(e.consume(T),y):m(T)}function b(T){return T===null||T===62?L(T):Ee(T)?(o=b,U(T)):(e.consume(T),b)}function x(T){return T===null?n(T):T===63?(e.consume(T),_):Ee(T)?(o=x,U(T)):(e.consume(T),x)}function _(T){return T===62?L(T):x(T)}function S(T){return kn(T)?(e.consume(T),w):n(T)}function w(T){return T===45||gn(T)?(e.consume(T),w):k(T)}function k(T){return Ee(T)?(o=k,U(T)):$e(T)?(e.consume(T),k):L(T)}function N(T){return T===45||gn(T)?(e.consume(T),N):T===47||T===62||it(T)?j(T):n(T)}function j(T){return T===47?(e.consume(T),L):T===58||T===95||kn(T)?(e.consume(T),C):Ee(T)?(o=j,U(T)):$e(T)?(e.consume(T),j):L(T)}function C(T){return T===45||T===46||T===58||T===95||gn(T)?(e.consume(T),C):I(T)}function I(T){return T===61?(e.consume(T),M):Ee(T)?(o=I,U(T)):$e(T)?(e.consume(T),I):j(T)}function M(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,$):Ee(T)?(o=M,U(T)):$e(T)?(e.consume(T),M):(e.consume(T),R)}function $(T){return T===i?(e.consume(T),i=void 0,B):T===null?n(T):Ee(T)?(o=$,U(T)):(e.consume(T),$)}function R(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||it(T)?j(T):(e.consume(T),R)}function B(T){return T===47||T===62||it(T)?j(T):n(T)}function L(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function U(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),O}function O(T){return $e(T)?ze(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):z(T)}function z(T){return e.enter("htmlTextData"),o(T)}}const x0={name:"labelEnd",resolveAll:$le,resolveTo:Lle,tokenize:Dle},Mle={tokenize:Ble},Rle={tokenize:zle},Ile={tokenize:Fle};function $le(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&&Vn(e,0,e.length,n),e}function Lle(e,t){let n=e.length,r=0,i,a,o,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=ar(l,e.slice(a+1,a+r+3)),l=ar(l,[["enter",d,t]]),l=ar(l,Rh(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=ar(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=ar(l,e.slice(o+1)),l=ar(l,[["exit",c,t]]),Vn(e,a,e.length,l),e}function Dle(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(p){return a?a._inactive?f(p):(o=r.parser.defined.includes(Tr(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),c):n(p)}function c(p){return p===40?e.attempt(Mle,d,o?d:f)(p):p===91?e.attempt(Rle,d,o?u:f)(p):o?d(p):f(p)}function u(p){return e.attempt(Ile,d,f)(p)}function d(p){return t(p)}function f(p){return a._balanced=!0,n(p)}}function Ble(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 it(f)?ec(e,a)(f):a(f)}function a(f){return f===41?d(f):wM(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return it(f)?ec(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?kM(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return it(f)?ec(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 zle(e,t,n){const r=this;return i;function i(l){return SM.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function Fle(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 Ule={name:"labelStartImage",resolveAll:x0.resolveAll,tokenize:Wle};function Wle(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 Hle={name:"labelStartLink",resolveAll:x0.resolveAll,tokenize:Gle};function Gle(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 og={name:"lineEnding",tokenize:qle};function qle(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ze(e,t,"linePrefix")}}const Fd={name:"thematicBreak",tokenize:Kle};function Kle(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||Ee(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),$e(u)?ze(e,l,"whitespace")(u):l(u))}}const Tn={continuation:{tokenize:Zle},exit:Jle,name:"list",tokenize:Xle},Vle={partial:!0,tokenize:ece},Yle={partial:!0,tokenize:Qle};function Xle(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(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Yv(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Fd,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(h)}return n(h)}function c(h){return Yv(h)&&++o<10?(e.consume(h),c):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(wu,r.interrupt?n:d,e.attempt(Vle,p,f))}function d(h){return r.containerState.initialBlankLine=!0,a++,p(h)}function f(h){return $e(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Zle(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(wu,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ze(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!$e(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(Yle,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ze(e,e.attempt(Tn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Qle(e,t,n){const r=this;return ze(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 Jle(e){e.exit(this.containerState.type)}function ece(e,t,n){const r=this;return ze(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!$e(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const OE={name:"setextUnderline",resolveTo:tce,tokenize:nce};function tce(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 nce(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"),$e(u)?ze(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ee(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const rce={tokenize:ice};function ice(e){const t=this,n=e.attempt(wu,r,e.attempt(this.parser.constructs.flowInitial,i,ze(e,e.attempt(this.parser.constructs.flow,i,e.attempt(cle,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 ace={resolveAll:EM()},oce=_M("string"),sce=_M("text");function _M(e){return{resolveAll:EM(e==="text"?lce: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 p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function EM(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 lce(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 cce={42:Tn,43:Tn,45:Tn,48:Tn,49:Tn,50:Tn,51:Tn,52:Tn,53:Tn,54:Tn,55:Tn,56:Tn,57:Tn,62:yM},uce={91:hle},dce={[-2]:ag,[-1]:ag,32:ag},fce={35:xle,42:Fd,45:[OE,Fd],60:_le,61:OE,95:Fd,96:TE,126:TE},pce={38:bM,92:vM},hce={[-5]:og,[-4]:og,[-3]:og,33:Ule,38:bM,42:Xv,60:[Hse,Ole],91:Hle,92:[vle,vM],93:x0,95:Xv,96:rle},mce={null:[Xv,ace]},gce={null:[42,95]},yce={null:[]},vce=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gce,contentInitial:uce,disable:yce,document:cce,flow:fce,flowInitial:dce,insideSpan:mce,string:pce,text:hce},Symbol.toStringTag,{value:"Module"}));function bce(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:k(S),check:k(w),consume:b,enter:x,exit:_,interrupt:k(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function f(I){return o=ar(o,I),v(),o[o.length-1]!==null?[]:(N(t,0),u.events=Rh(a,u.events,u),u.events)}function p(I,M){return wce(h(I),M)}function h(I){return xce(o,I)}function g(){const{_bufferIndex:I,_index:M,line:$,column:R,offset:B}=r;return{_bufferIndex:I,_index:M,line:$,column:R,offset:B}}function m(I){i[I.line]=I.column,C()}function v(){let I;for(;r._index<o.length;){const M=o[r._index];if(typeof M=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<M.length;)y(M.charCodeAt(r._bufferIndex));else y(M)}}function y(I){d=d(I)}function b(I){Ee(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,C()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=I}function x(I,M){const $=M||{};return $.type=I,$.start=g(),u.events.push(["enter",$,u]),l.push($),$}function _(I){const M=l.pop();return M.end=g(),u.events.push(["exit",M,u]),M}function S(I,M){N(I,M.from)}function w(I,M){M.restore()}function k(I,M){return $;function $(R,B,L){let U,O,z,T;return Array.isArray(R)?q(R):"tokenize"in R?q([R]):V(R);function V(ue){return He;function He(Ce){const te=Ce!==null&&ue[Ce],ye=Ce!==null&&ue.null,be=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return q(be)(Ce)}}function q(ue){return U=ue,O=0,ue.length===0?L:P(ue[O])}function P(ue){return He;function He(Ce){return T=j(),z=ue,ue.partial||(u.currentConstruct=ue),ue.name&&u.parser.constructs.disable.null.includes(ue.name)?me():ue.tokenize.call(M?Object.assign(Object.create(u),M):u,c,ce,me)(Ce)}}function ce(ue){return I(z,T),B}function me(ue){return T.restore(),++O<U.length?P(U[O]):L}}}function N(I,M){I.resolveAll&&!a.includes(I)&&a.push(I),I.resolve&&Vn(u.events,M,u.events.length-M,I.resolve(u.events.slice(M),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function j(){const I=g(),M=u.previous,$=u.currentConstruct,R=u.events.length,B=Array.from(l);return{from:R,restore:L};function L(){r=I,u.previous=M,u.currentConstruct=$,u.events.length=R,l=B,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function xce(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 wce(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 Sce(e){const r={constructs:mM([vce,...(e||{}).extensions||[]]),content:i(Lse),defined:[],document:i(Bse),flow:i(rce),lazy:{},string:i(oce),text:i(sce)};return r;function i(a){return o;function o(l){return bce(r,a,l)}}}function kce(e){for(;!xM(e););return e}const PE=/[\0\t\n\r]/g;function _ce(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const c=[];let u,d,f,p,h;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(PE.lastIndex=f,u=PE.exec(a),p=u&&u.index!==void 0?u.index:a.length,h=a.charCodeAt(p),!u){t=a.slice(f);break}if(h===10&&f===p&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<p&&(c.push(a.slice(f,p)),e+=p-f),h){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=p+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Ece=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Nce(e){return e.replace(Ece,jce)}function jce(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return gM(n.slice(a?2:1),a?16:10)}return b0(n)||e}const NM={}.hasOwnProperty;function Ace(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Tce(n)(kce(Sce(n).document().write(_ce()(e,t,!0))))}function Tce(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Tt),autolinkProtocol:j,autolinkEmail:j,atxHeading:a(Se),blockQuote:a(ye),characterEscape:j,characterReference:j,codeFenced:a(be),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(be,o),codeText:a(X,o),codeTextData:j,data:j,codeFlowValue:j,definition:a(Ae),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(we),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a(De,o),htmlFlowData:j,htmlText:a(De,o),htmlTextData:j,image:a(le),label:o,link:a(Tt),listItem:a(Te),listItemValue:p,listOrdered:a(Fe,f),listUnordered:a(Fe),paragraph:a(lt),reference:P,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Se),strong:a(Me),thematicBreak:a(Ht)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:te,autolinkProtocol:Ce,blockQuote:c(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ue,characterReference:He,codeFenced:c(v),codeFencedFence:m,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:C,codeIndented:c(y),codeText:c(B),codeTextData:C,data:C,definition:c(),definitionDestinationString:_,definitionLabelString:b,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(M),hardBreakTrailing:c(M),htmlFlow:c($),htmlFlowData:C,htmlText:c(R),htmlTextData:C,image:c(U),label:z,labelText:O,lineEnding:I,link:c(L),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:T,resourceTitleString:V,resource:q,setextHeading:c(N),setextHeadingLineSequence:k,setextHeadingText:w,strong:c(),thematicBreak:c()}};jM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(F){let K={type:"root",children:[]};const ae={stack:[K],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:d,data:n},de=[];let _e=-1;for(;++_e<F.length;)if(F[_e][1].type==="listOrdered"||F[_e][1].type==="listUnordered")if(F[_e][0]==="enter")de.push(_e);else{const Xe=de.pop();_e=i(F,Xe,_e)}for(_e=-1;++_e<F.length;){const Xe=t[F[_e][0]];NM.call(Xe,F[_e][1].type)&&Xe[F[_e][1].type].call(Object.assign({sliceSerialize:F[_e][2].sliceSerialize},ae),F[_e][1])}if(ae.tokenStack.length>0){const Xe=ae.tokenStack[ae.tokenStack.length-1];(Xe[1]||ME).call(ae,void 0,Xe[0])}for(K.position={start:Pi(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:Pi(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<t.transforms.length;)K=t.transforms[_e](K)||K;return K}function i(F,K,ae){let de=K-1,_e=-1,Xe=!1,yt,It,Dn,pt;for(;++de<=ae;){const Nt=F[de];switch(Nt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Nt[0]==="enter"?_e++:_e--,pt=void 0;break}case"lineEndingBlank":{Nt[0]==="enter"&&(yt&&!pt&&!_e&&!Dn&&(Dn=de),pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pt=void 0}if(!_e&&Nt[0]==="enter"&&Nt[1].type==="listItemPrefix"||_e===-1&&Nt[0]==="exit"&&(Nt[1].type==="listUnordered"||Nt[1].type==="listOrdered")){if(yt){let H=de;for(It=void 0;H--;){const oe=F[H];if(oe[1].type==="lineEnding"||oe[1].type==="lineEndingBlank"){if(oe[0]==="exit")continue;It&&(F[It][1].type="lineEndingBlank",Xe=!0),oe[1].type="lineEnding",It=H}else if(!(oe[1].type==="linePrefix"||oe[1].type==="blockQuotePrefix"||oe[1].type==="blockQuotePrefixWhitespace"||oe[1].type==="blockQuoteMarker"||oe[1].type==="listItemIndent"))break}Dn&&(!It||Dn<It)&&(yt._spread=!0),yt.end=Object.assign({},It?F[It][1].start:Nt[1].end),F.splice(It||de,0,["exit",yt,Nt[2]]),de++,ae++}if(Nt[1].type==="listItemPrefix"){const H={type:"listItem",_spread:!1,start:Object.assign({},Nt[1].start),end:void 0};yt=H,F.splice(de,0,["enter",H,Nt[2]]),de++,ae++,Dn=void 0,pt=!0}}}return F[K][1]._spread=Xe,ae}function a(F,K){return ae;function ae(de){l.call(this,F(de),de),K&&K.call(this,de)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(F,K,ae){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([K,ae||void 0]),F.position={start:Pi(K.start),end:void 0}}function c(F){return K;function K(ae){F&&F.call(this,ae),u.call(this,ae)}}function u(F,K){const ae=this.stack.pop(),de=this.tokenStack.pop();if(de)de[0].type!==F.type&&(K?K.call(this,F,de[0]):(de[1]||ME).call(this,F,de[0]));else throw new Error("Cannot close `"+F.type+"` ("+Jl({start:F.start,end:F.end})+"): itโ€™s not open");ae.position.end=Pi(F.end)}function d(){return v0(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(F){if(this.data.expectingFirstListItemValue){const K=this.stack[this.stack.length-2];K.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function h(){const F=this.resume(),K=this.stack[this.stack.length-1];K.lang=F}function g(){const F=this.resume(),K=this.stack[this.stack.length-1];K.meta=F}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F.replace(/(\r?\n|\r)$/g,"")}function b(F){const K=this.resume(),ae=this.stack[this.stack.length-1];ae.label=K,ae.identifier=Tr(this.sliceSerialize(F)).toLowerCase()}function x(){const F=this.resume(),K=this.stack[this.stack.length-1];K.title=F}function _(){const F=this.resume(),K=this.stack[this.stack.length-1];K.url=F}function S(F){const K=this.stack[this.stack.length-1];if(!K.depth){const ae=this.sliceSerialize(F).length;K.depth=ae}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function k(F){const K=this.stack[this.stack.length-1];K.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function j(F){const ae=this.stack[this.stack.length-1].children;let de=ae[ae.length-1];(!de||de.type!=="text")&&(de=Zt(),de.position={start:Pi(F.start),end:void 0},ae.push(de)),this.stack.push(de)}function C(F){const K=this.stack.pop();K.value+=this.sliceSerialize(F),K.position.end=Pi(F.end)}function I(F){const K=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=K.children[K.children.length-1];ae.position.end=Pi(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(K.type)&&(j.call(this,F),C.call(this,F))}function M(){this.data.atHardBreak=!0}function $(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F}function R(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F}function B(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F}function L(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=K,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function U(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=K,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function O(F){const K=this.sliceSerialize(F),ae=this.stack[this.stack.length-2];ae.label=Nce(K),ae.identifier=Tr(K).toLowerCase()}function z(){const F=this.stack[this.stack.length-1],K=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const de=F.children;ae.children=de}else ae.alt=K}function T(){const F=this.resume(),K=this.stack[this.stack.length-1];K.url=F}function V(){const F=this.resume(),K=this.stack[this.stack.length-1];K.title=F}function q(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function ce(F){const K=this.resume(),ae=this.stack[this.stack.length-1];ae.label=K,ae.identifier=Tr(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function me(F){this.data.characterReferenceType=F.type}function ue(F){const K=this.sliceSerialize(F),ae=this.data.characterReferenceType;let de;ae?(de=gM(K,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):de=b0(K);const _e=this.stack[this.stack.length-1];_e.value+=de}function He(F){const K=this.stack.pop();K.position.end=Pi(F.end)}function Ce(F){C.call(this,F);const K=this.stack[this.stack.length-1];K.url=this.sliceSerialize(F)}function te(F){C.call(this,F);const K=this.stack[this.stack.length-1];K.url="mailto:"+this.sliceSerialize(F)}function ye(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function Ae(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function we(){return{type:"emphasis",children:[]}}function Se(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function De(){return{type:"html",value:""}}function le(){return{type:"image",title:null,url:"",alt:null}}function Tt(){return{type:"link",title:null,url:"",children:[]}}function Fe(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function Te(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function lt(){return{type:"paragraph",children:[]}}function Me(){return{type:"strong",children:[]}}function Zt(){return{type:"text",value:""}}function Ht(){return{type:"thematicBreak"}}}function Pi(e){return{line:e.line,column:e.column,offset:e.offset}}function jM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jM(e,r):Cce(e,r)}}function Cce(e,t){let n;for(n in t)if(NM.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 ME(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Jl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Jl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Jl({start:t.start,end:t.end})+") is still open")}function Oce(e){const t=this;t.parser=n;function n(r){return Ace(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Pce(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 Mce(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
168
- `}]}function Rce(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 Ice(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $ce(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lce(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ol(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 Dce(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 Bce(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function AM(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 zce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return AM(e,t);const i={src:ol(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 Fce(e,t){const n={src:ol(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 Uce(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 Wce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return AM(e,t);const i={href:ol(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 Hce(e,t){const n={href:ol(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 Gce(e,t,n){const r=e.all(t),i=n?qce(n):TM(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 qce(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=TM(n[r])}return t}function TM(e){const t=e.spread;return t??e.children.length>1}function Kce(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 Vce(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yce(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Xce(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zce(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=h0(t.children[1]),c=lM(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 Qce(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],p={},h=o?o[c]:void 0;h&&(p.align=h);let g={type:"element",tagName:a,properties:p,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 Jce(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const RE=9,IE=32;function eue(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push($E(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push($E(t.slice(i),i>0,!1)),a.join("")}function $E(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===RE||a===IE;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===RE||a===IE;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function tue(e,t){const n={type:"text",value:eue(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nue(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rue={blockquote:Pce,break:Mce,code:Rce,delete:Ice,emphasis:$ce,footnoteReference:Lce,heading:Dce,html:Bce,imageReference:zce,image:Fce,inlineCode:Uce,linkReference:Wce,link:Hce,listItem:Gce,list:Kce,paragraph:Vce,root:Yce,strong:Xce,table:Zce,tableCell:Jce,tableRow:Qce,text:tue,thematicBreak:nue,toml:yd,yaml:yd,definition:yd,footnoteDefinition:yd};function yd(){}const CM=-1,Ih=0,tc=1,vp=2,w0=3,S0=4,k0=5,_0=6,OM=7,PM=8,MM=typeof self=="object"?self:globalThis,LE=(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 MM[e](t)},iue=(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 Ih:case CM:return n(o,i);case tc:{const l=n([],i);for(const c of o)l.push(r(c));return l}case vp:{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 S0:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case k0:{const l=n(new Map,i);for(const[c,u]of o)l.set(r(c),r(u));return l}case _0:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case OM:{const{name:l,message:c}=o;return n(typeof MM[l]=="function"?LE(l,c):new Error(c),i)}case PM: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(LE(a,o),i)};return r},DE=e=>iue(new Map,e)(0),Ca="",{toString:aue}={},{keys:oue}=Object,Pl=e=>{const t=typeof e;if(t!=="object"||!e)return[Ih,t];const n=aue.call(e).slice(8,-1);switch(n){case"Array":return[tc,Ca];case"Object":return[vp,Ca];case"Date":return[w0,Ca];case"RegExp":return[S0,Ca];case"Map":return[k0,Ca];case"Set":return[_0,Ca];case"DataView":return[tc,n]}return n.includes("Array")?[tc,n]:e instanceof Error?[OM,e.name||"Error"]:[vp,n]},vd=([e,t])=>e===Ih&&(t==="function"||t==="symbol"),sue=(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]=Pl(o);switch(l){case Ih:{let d=o;switch(c){case"bigint":l=PM,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([CM],o)}return i([l,d],o)}case tc:{if(c){let p=o;return c==="DataView"?p=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(o)),i([c,[...p]],o)}const d=[],f=i([l,d],o);for(const p of o)d.push(a(p));return f}case vp:{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 p of oue(o))(e||!vd(Pl(o[p])))&&d.push([a(p),a(o[p])]);return f}case w0:return i([l,isNaN(o.getTime())?Ca:o.toISOString()],o);case S0:{const{source:d,flags:f}=o;return i([l,{source:d,flags:f}],o)}case k0:{const d=[],f=i([l,d],o);for(const[p,h]of o)(e||!(vd(Pl(p))||vd(Pl(h))))&&d.push([a(p),a(h)]);return f}case _0:{const d=[],f=i([l,d],o);for(const p of o)(e||!vd(Pl(p)))&&d.push(a(p));return f}}const{message:u}=o;return i([l,{name:c,message:u}],o)};return a},BE=(e,{json:t,lossy:n}={})=>{const r=[];return sue(!(t||n),!!t,new Map,r)(e),r},bp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?DE(BE(e,t)):structuredClone(e):(e,t)=>DE(BE(e,t));function lue(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 cue(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function uue(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||lue,r=e.options.footnoteBackLabel||cue,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(),p=ol(f.toLowerCase());let h=0;const g=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++h<=m;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,h);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,h),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-"+p},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:{...bp(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 Su=function(e){if(e==null)return hue;if(typeof e=="function")return $h(e);if(typeof e=="object")return Array.isArray(e)?due(e):fue(e);if(typeof e=="string")return pue(e);throw new Error("Expected function, string, or object as test")};function due(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Su(e[n]);return $h(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function fue(e){const t=e;return $h(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function pue(e){return $h(t);function t(n){return n&&n.type===e}}function $h(e){return t;function t(n,r,i){return!!(mue(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function hue(){return!0}function mue(e){return e!==null&&typeof e=="object"&&"type"in e}const RM=[],gue=!0,Zv=!1,yue="skip";function IM(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Su(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 h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(c.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=RM,g,m,v;if((!t||a(c,u,d[d.length-1]||void 0))&&(h=vue(n(c,d)),h[0]===Zv))return h;if("children"in c&&c.children){const y=c;if(y.children&&h[0]!==yue)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]===Zv)return g;m=typeof g[1]=="number"?g[1]:m+o}}return h}}}function vue(e){return Array.isArray(e)?e:typeof e=="number"?[gue,e]:e==null?RM:[e]}function Lh(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),IM(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 Qv={}.hasOwnProperty,bue={};function xue(e,t){const n=t||bue,r=new Map,i=new Map,a=new Map,o={...rue,...n.handlers},l={all:u,applyData:Sue,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:wue,wrap:_ue};return Lh(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,p=String(d.identifier).toUpperCase();f.has(p)||f.set(p,d)}}),l;function c(d,f){const p=d.type,h=l.handlers[p];if(Qv.call(l.handlers,p)&&h)return h(l,d,f);if(l.options.passThrough&&l.options.passThrough.includes(p)){if("children"in d){const{children:m,...v}=d,y=bp(v);return y.children=l.all(d),y}return bp(d)}return(l.options.unknownHandler||kue)(l,d,f)}function u(d){const f=[];if("children"in d){const p=d.children;let h=-1;for(;++h<p.length;){const g=l.one(p[h],d);if(g){if(h&&p[h-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=zE(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=zE(m.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function wue(e,t){e.position&&(t.position=cse(e))}function Sue(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,bp(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function kue(e,t){const n=t.data||{},r="value"in t&&!(Qv.call(n,"hProperties")||Qv.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _ue(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
174
- `});++r<e.length;)r&&n.push({type:"text",value:`
175
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
176
- `}),n}function zE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function FE(e,t){const n=xue(e,t),r=n.one(e,void 0),i=uue(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 Eue(e,t){return e&&"run"in e?async function(n,r){const i=FE(n,{file:r,...t});await e.run(i,r)}:function(n,r){return FE(n,{file:r,...e||t})}}function UE(e){if(e)throw e}var Ud=Object.prototype.hasOwnProperty,$M=Object.prototype.toString,WE=Object.defineProperty,HE=Object.getOwnPropertyDescriptor,GE=function(t){return typeof Array.isArray=="function"?Array.isArray(t):$M.call(t)==="[object Array]"},qE=function(t){if(!t||$M.call(t)!=="[object Object]")return!1;var n=Ud.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ud.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ud.call(t,i)},KE=function(t,n){WE&&n.name==="__proto__"?WE(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},VE=function(t,n){if(n==="__proto__")if(Ud.call(t,n)){if(HE)return HE(t,n).value}else return;return t[n]},Nue=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=VE(l,n),i=VE(t,n),l!==i&&(d&&i&&(qE(i)||(a=GE(i)))?(a?(a=!1,o=r&&GE(r)?r:[]):o=r&&qE(r)?r:{},KE(l,{name:n,newValue:e(d,o,i)})):typeof i<"u"&&KE(l,{name:n,newValue:i}));return l};const sg=Ye(Nue);function Jv(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 jue(){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?Aue(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 Aue(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 Lr={basename:Tue,dirname:Cue,extname:Oue,join:Pue,sep:"/"};function Tue(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ku(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 Cue(e){if(ku(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 Oue(e){ku(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 Pue(...e){let t=-1,n;for(;++t<e.length;)ku(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Mue(n)}function Mue(e){ku(e);const t=e.codePointAt(0)===47;let n=Rue(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Rue(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 ku(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Iue={cwd:$ue};function $ue(){return"/"}function eb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lue(e){if(typeof e=="string")e=new URL(e);else if(!eb(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 Due(e)}function Due(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 lg=["history","path","basename","stem","extname","dirname"];class LM{constructor(t){let n;t?eb(t)?n={path:t}:typeof t=="string"||Bue(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Iue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<lg.length;){const a=lg[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)lg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Lr.basename(this.path):void 0}set basename(t){ug(t,"basename"),cg(t,"basename"),this.path=Lr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Lr.dirname(this.path):void 0}set dirname(t){YE(this.basename,"dirname"),this.path=Lr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Lr.extname(this.path):void 0}set extname(t){if(cg(t,"extname"),YE(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=Lr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eb(t)&&(t=Lue(t)),ug(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Lr.basename(this.path,this.extname):void 0}set stem(t){ug(t,"stem"),cg(t,"stem"),this.path=Lr.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 vn(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 cg(e,t){if(e&&e.includes(Lr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Lr.sep+"`")}function ug(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function YE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Bue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zue=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},Fue={}.hasOwnProperty;class E0 extends zue{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=jue()}copy(){const t=new E0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(sg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(pg("data",this.frozen),this.namespace[t]=n,this):Fue.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=bd(t),r=this.parser||this.Parser;return dg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),dg("process",this.parser||this.Parser),fg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=bd(t),c=r.parse(l);r.run(c,l,function(d,f,p){if(d||!f||!p)return u(d);const h=f,g=r.stringify(h,p);Hue(g)?p.value=g:p.result=g,u(d,p)});function u(d,f){d||!f?o(d):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),dg("processSync",this.parser||this.Parser),fg("processSync",this.compiler||this.Compiler),this.process(t,i),ZE("processSync","process",n),r;function i(a,o){n=!0,UE(a),r=o}}run(t,n,r){XE(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=bd(n);i.run(t,c,u);function u(d,f,p){const h=f||t;d?l(d):o?o(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),ZE("runSync","run",r),i;function a(o,l){UE(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=bd(n),i=this.compiler||this.Compiler;return fg("stringify",i),XE(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=sg(!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,p=-1;for(;++f<r.length;)if(r[f][0]===u){p=f;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[h,...g]=d;const m=r[p][1];Jv(m)&&Jv(h)&&(h=sg(!0,m,h)),r[p]=[u,h,...g]}}}}const Uue=new E0().freeze();function dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fg(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 XE(e){if(!Jv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ZE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bd(e){return Wue(e)?e:new LM(e)}function Wue(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Hue(e){return typeof e=="string"||Gue(e)}function Gue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const que="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",QE=[],JE={allowDangerousHtml:!0},Kue=/^(https?|ircs?|mailto|xmpp)$/i,Vue=[{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 Yue(e){const t=Xue(e),n=Zue(e);return Que(t.runSync(t.parse(n),n),e)}function Xue(e){const t=e.rehypePlugins||QE,n=e.remarkPlugins||QE,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...JE}:JE;return Uue().use(Oce).use(n).use(Eue,r).use(t)}function Zue(e){const t=e.children||"",n=new LM;return typeof t=="string"&&(n.value=t),n}function Que(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||Jue;for(const d of Vue)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+que+d.id,void 0);return Lh(e,u),hse(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function u(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return o?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in ig)if(Object.hasOwn(ig,h)&&Object.hasOwn(d.properties,h)){const g=d.properties[h],m=ig[h];(m===null||m.includes(d.tagName))&&(d.properties[h]=c(String(g||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,p)),h&&p&&typeof f=="number")return l&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function Jue(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||Kue.test(e.slice(0,t))?e:""}function eN(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 ede(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function tde(e,t,n){const i=Su((n||{}).ignore||[]),a=nde(t);let o=-1;for(;++o<a.length;)IM(e,"text",l);function l(u,d){let f=-1,p;for(;++f<d.length;){const h=d[f],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return c(u,d)}function c(u,d){const f=d[d.length-1],p=a[o][0],h=a[o][1];let g=0;const v=f.children.indexOf(u);let y=!1,b=[];p.lastIndex=0;let x=p.exec(u.value);for(;x;){const _=x.index,S={index:x.index,input:x.input,stack:[...d,u]};let w=h(...x,S);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?p.lastIndex=_+1:(g!==_&&b.push({type:"text",value:u.value.slice(g,_)}),Array.isArray(w)?b.push(...w):w&&b.push(w),g=_+x[0].length,y=!0),!p.global)break;x=p.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 nde(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([rde(i[0]),ide(i[1])])}return t}function rde(e){return typeof e=="string"?new RegExp(ede(e),"g"):e}function ide(e){return typeof e=="function"?e:function(){return e}}const hg="phrasing",mg=["autolink","link","image","label"];function ade(){return{transforms:[fde],enter:{literalAutolink:sde,literalAutolinkEmail:gg,literalAutolinkHttp:gg,literalAutolinkWww:gg},exit:{literalAutolink:dde,literalAutolinkEmail:ude,literalAutolinkHttp:lde,literalAutolinkWww:cde}}}function ode(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hg,notInConstruct:mg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hg,notInConstruct:mg},{character:":",before:"[ps]",after:"\\/",inConstruct:hg,notInConstruct:mg}]}}function sde(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gg(e){this.config.enter.autolinkProtocol.call(this,e)}function lde(e){this.config.exit.autolinkProtocol.call(this,e)}function cde(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 ude(e){this.config.exit.autolinkEmail.call(this,e)}function dde(e){this.exit(e)}function fde(e){tde(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,pde],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),hde]],{ignore:["link","linkReference"]})}function pde(e,t,n,r,i){let a="";if(!DM(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!mde(n)))return!1;const o=gde(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 hde(e,t,n,r){return!DM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function mde(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 gde(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=eN(e,"(");let a=eN(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 DM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||so(n)||Mh(n))&&(!t||n!==47)}BM.peek=Ede;function yde(){this.buffer()}function vde(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function bde(){this.buffer()}function xde(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function wde(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Sde(e){this.exit(e)}function kde(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _de(e){this.exit(e)}function Ede(){return"["}function BM(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 Nde(){return{enter:{gfmFootnoteCallString:yde,gfmFootnoteCall:vde,gfmFootnoteDefinitionLabelString:bde,gfmFootnoteDefinition:xde},exit:{gfmFootnoteCallString:wde,gfmFootnoteCall:Sde,gfmFootnoteDefinitionLabelString:kde,gfmFootnoteDefinition:_de}}}function jde(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:BM},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?zM:Ade))),u(),c}}function Ade(e,t,n){return t===0?e:zM(e,t,n)}function zM(e,t,n){return(n?"":" ")+e}const Tde=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];FM.peek=Rde;function Cde(){return{canContainEols:["delete"],enter:{strikethrough:Pde},exit:{strikethrough:Mde}}}function Ode(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Tde}],handlers:{delete:FM}}}function Pde(e){this.enter({type:"delete",children:[]},e)}function Mde(e){this.exit(e)}function FM(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 Rde(){return"~"}function Ide(e){return e.length}function $de(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ide,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=Lde(e[d][y]);if(n.alignDelimiters!==!1){const x=i(b);v[y]=x,(c[y]===void 0||x>c[y])&&(c[y]=x)}m.push(b)}o[d]=m,l[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)a[f]=tN(r[f]);else{const m=tN(r);for(;++f<u;)a[f]=m}f=-1;const p=[],h=[];for(;++f<u;){const m=a[f];let v="",y="";m===99?(v=":",y=":"):m===108?v=":":m===114&&(y=":");let b=n.alignDelimiters===!1?1:Math.max(1,c[f]-v.length-y.length);const x=v+"-".repeat(b)+y;n.alignDelimiters!==!1&&(b=v.length+b+y.length,b>c[f]&&(c[f]=b),h[f]=b),p[f]=x}o.splice(1,0,p),l.splice(1,0,h),d=-1;const g=[];for(;++d<o.length;){const m=o[d],v=l[d];f=-1;const y=[];for(;++f<u;){const b=m[f]||"";let x="",_="";if(n.alignDelimiters!==!1){const S=c[f]-(v[f]||0),w=a[f];w===114?x=" ".repeat(S):w===99?S%2?(x=" ".repeat(S/2+.5),_=" ".repeat(S/2-.5)):(x=" ".repeat(S/2),_=x):_=" ".repeat(S)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(x),y.push(b),n.alignDelimiters!==!1&&y.push(_),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 Lde(e){return e==null?"":String(e)}function tN(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 Dde(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()),Bde);return i(),o}function Bde(e,t,n){return">"+(n?"":" ")+e}function zde(e,t){return nN(e,t.inConstruct,!0)&&!nN(e,t.notInConstruct,!1)}function nN(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 rN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
180
- `&&zde(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
181
- `}function Fde(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 Ude(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 Wde(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 Hde(e,t,n,r){const i=Wde(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Ude(e,n)){const f=n.enter("codeIndented"),p=n.indentLines(a,Gde);return f(),p}const l=n.createTracker(r),c=i.repeat(Math.max(Fde(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 Gde(e,t,n){return(n?"":" ")+e}function N0(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 qde(e,t,n,r){const i=N0(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 Kde(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 iu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function xp(e,t,n){const r=Bs(e),i=Bs(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}}UM.peek=Vde;function UM(e,t,n,r){const i=Kde(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=xp(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=iu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),p=xp(r.after.charCodeAt(0),f,i);p.inside&&(c=c.slice(0,-1)+iu(f));const h=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},l+c+h}function Vde(e,t,n){return n.options.emphasis||"*"}function Yde(e,t){let n=!1;return Lh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Zv}),!!((!e.depth||e.depth<3)&&v0(e)&&(t.options.setext||n))}function Xde(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Yde(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),p=n.containerPhrasing(e,{...a.current(),before:`
186
- `,after:`
187
- `});return f(),d(),p+`
188
- `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.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=iu(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}WM.peek=Zde;function WM(e){return e.value||""}function Zde(){return"<"}HM.peek=Qde;function HM(e,t,n,r){const i=N0(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 Qde(){return"!"}GM.peek=Jde;function GM(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 Jde(){return"!"}qM.peek=efe;function qM(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 efe(){return"`"}function KM(e,t){const n=v0(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))}VM.peek=tfe;function VM(e,t,n,r){const i=N0(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(KM(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 tfe(e,t,n){return KM(e,n)?"<":"["}YM.peek=nfe;function YM(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 nfe(){return"["}function j0(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 rfe(e){const t=j0(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 ife(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 XM(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 afe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?ife(n):j0(n);const l=e.ordered?o==="."?")":".":rfe(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),XM(n)===o&&d){let f=-1;for(;++f<e.children.length;){const p=e.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.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 ofe(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 sfe(e,t,n,r){const i=ofe(n);let a=n.bulletCurrent||j0(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,p,h){return p?(h?"":" ".repeat(o))+f:(h?a:a+" ".repeat(o-a.length))+f}}function lfe(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const cfe=Su(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ufe(e,t,n,r){return(e.children.some(function(o){return cfe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function dfe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ZM.peek=ffe;function ZM(e,t,n,r){const i=dfe(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=xp(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=iu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),p=xp(r.after.charCodeAt(0),f,i);p.inside&&(c=c.slice(0,-1)+iu(f));const h=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},l+c+h}function ffe(e,t,n){return n.options.strong||"*"}function pfe(e,t,n,r){return n.safe(e.value,r)}function hfe(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 mfe(e,t,n){const r=(XM(n)+(n.options.ruleSpaces?" ":"")).repeat(hfe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const QM={blockquote:Dde,break:rN,code:Hde,definition:qde,emphasis:UM,hardBreak:rN,heading:Xde,html:WM,image:HM,imageReference:GM,inlineCode:qM,link:VM,linkReference:YM,list:afe,listItem:sfe,paragraph:lfe,root:ufe,strong:ZM,text:pfe,thematicBreak:mfe};function gfe(){return{enter:{table:yfe,tableData:iN,tableHeader:iN,tableRow:bfe},exit:{codeText:xfe,table:vfe,tableData:yg,tableHeader:yg,tableRow:yg}}}function yfe(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 vfe(e){this.exit(e),this.data.inTable=void 0}function bfe(e){this.enter({type:"tableRow",children:[]},e)}function yg(e){this.exit(e)}function iN(e){this.enter({type:"tableCell",children:[]},e)}function xfe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,wfe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function wfe(e,t){return t==="|"?t:e}function Sfe(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:p,table:o,tableCell:c,tableRow:l}};function o(h,g,m,v){return u(d(h,m,v),h.align)}function l(h,g,m,v){const y=f(h,m,v),b=u([y]);return b.slice(0,b.indexOf(`
192
- `))}function c(h,g,m,v){const y=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(h,{...v,before:a,after:a});return b(),y(),x}function u(h,g){return $de(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(h,g,m){const v=h.children;let y=-1;const b=[],x=g.enter("table");for(;++y<v.length;)b[y]=f(v[y],g,m);return x(),b}function f(h,g,m){const v=h.children;let y=-1;const b=[],x=g.enter("tableRow");for(;++y<v.length;)b[y]=c(v[y],h,g,m);return x(),b}function p(h,g,m){let v=QM.inlineCode(h,g,m);return m.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function kfe(){return{exit:{taskListCheckValueChecked:aN,taskListCheckValueUnchecked:aN,paragraph:Efe}}}function _fe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Nfe}}}function aN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Efe(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 Nfe(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=QM.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 jfe(){return[ade(),Nde(),Cde(),gfe(),kfe()]}function Afe(e){return{extensions:[ode(),jde(e),Ode(),Sfe(e),_fe()]}}const Tfe={tokenize:Ife,partial:!0},JM={tokenize:$fe,partial:!0},eR={tokenize:Lfe,partial:!0},tR={tokenize:Dfe,partial:!0},Cfe={tokenize:Bfe,partial:!0},nR={name:"wwwAutolink",tokenize:Mfe,previous:iR},rR={name:"protocolAutolink",tokenize:Rfe,previous:aR},ki={name:"emailAutolink",tokenize:Pfe,previous:oR},Yr={};function Ofe(){return{text:Yr}}let _a=48;for(;_a<123;)Yr[_a]=ki,_a++,_a===58?_a=65:_a===91&&(_a=97);Yr[43]=ki;Yr[45]=ki;Yr[46]=ki;Yr[95]=ki;Yr[72]=[ki,rR];Yr[104]=[ki,rR];Yr[87]=[ki,nR];Yr[119]=[ki,nR];function Pfe(e,t,n){const r=this;let i,a;return o;function o(f){return!tb(f)||!oR.call(r,r.previous)||A0(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return tb(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(Cfe,d,u)(f):f===45||f===95||gn(f)?(a=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),i=!0,c}function d(f){return a&&i&&kn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Mfe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!iR.call(r,r.previous)||A0(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Tfe,e.attempt(JM,e.attempt(eR,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Rfe(e,t,n){const r=this;let i="",a=!1;return o;function o(f){return(f===72||f===104)&&aR.call(r,r.previous)&&!A0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(kn(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="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||yp(f)||it(f)||so(f)||Mh(f)?n(f):e.attempt(JM,e.attempt(eR,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Ife(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 $fe(e,t,n){let r,i,a;return o;function o(u){return u===46||u===95?e.check(tR,c,l)(u):u===null||it(u)||so(u)||u!==45&&Mh(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 Lfe(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(tR,t,a)(o):o===null||it(o)||so(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function Dfe(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||it(l)||so(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||it(l)||so(l)?t(l):r(l)}function a(l){return kn(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):kn(l)?(e.consume(l),o):n(l)}}function Bfe(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return gn(a)?n(a):t(a)}}function iR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||it(e)}function aR(e){return!kn(e)}function oR(e){return!(e===47||tb(e))}function tb(e){return e===43||e===45||e===46||e===95||gn(e)}function A0(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 zfe={tokenize:Vfe,partial:!0};function Ffe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Gfe,continuation:{tokenize:qfe},exit:Kfe}},text:{91:{name:"gfmFootnoteCall",tokenize:Hfe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ufe,resolveTo:Wfe}}}}function Ufe(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=Tr(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 Wfe(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 Hfe(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||it(f))return n(f);if(f===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(Tr(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return it(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 Gfe(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||it(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return a=Tr(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return it(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 p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(a)||i.push(a),ze(e,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return t(g)}}function qfe(e,t,n){return e.check(wu,t,e.attempt(zfe,t,n))}function Kfe(e){e.exit("gfmFootnoteDefinition")}function Vfe(e,t,n){const r=this;return ze(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 Yfe(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)},p=[["enter",d,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",f,l]],h=l.parser.constructs.insideSpan.null;h&&Vn(p,p.length,0,Rh(h,o.slice(u+1,c),l)),Vn(p,p.length,0,[["exit",f,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),Vn(o,u-1,c-u+3,p),c=u+p.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 p;function p(g){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(g):(o.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const m=Bs(u);if(g===126)return f>1?c(g):(o.consume(g),f++,h);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=Bs(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,l(g)}}}class Xfe{constructor(){this.map=[]}add(t,n,r){Zfe(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 Zfe(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 Qfe(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 Jfe(){return{flow:{null:{name:"table",tokenize:epe,resolveAll:tpe}}}}function epe(e,t,n){const r=this;let i=0,a=0,o;return l;function l(C){let I=r.events.length-1;for(;I>-1;){const R=r.events[I][1].type;if(R==="lineEnding"||R==="linePrefix")I--;else break}const M=I>-1?r.events[I][1].type:null,$=M==="tableHead"||M==="tableRow"?w:c;return $===w&&r.parser.lazy[r.now().line]?n(C):$(C)}function c(C){return e.enter("tableHead"),e.enter("tableRow"),u(C)}function u(C){return C===124||(o=!0,a+=1),d(C)}function d(C){return C===null?n(C):Ee(C)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),h):n(C):$e(C)?ze(e,d,"whitespace")(C):(a+=1,o&&(o=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(C)))}function f(C){return C===null||C===124||it(C)?(e.exit("data"),d(C)):(e.consume(C),C===92?p:f)}function p(C){return C===92||C===124?(e.consume(C),f):f(C)}function h(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),o=!1,$e(C)?ze(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):g(C))}function g(C){return C===45||C===58?v(C):C===124?(o=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),m):S(C)}function m(C){return $e(C)?ze(e,v,"whitespace")(C):v(C)}function v(C){return C===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),y):C===45?(a+=1,y(C)):C===null||Ee(C)?_(C):S(C)}function y(C){return C===45?(e.enter("tableDelimiterFiller"),b(C)):S(C)}function b(C){return C===45?(e.consume(C),b):C===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(C))}function x(C){return $e(C)?ze(e,_,"whitespace")(C):_(C)}function _(C){return C===124?g(C):C===null||Ee(C)?!o||i!==a?S(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):S(C)}function S(C){return n(C)}function w(C){return e.enter("tableRow"),k(C)}function k(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),k):C===null||Ee(C)?(e.exit("tableRow"),t(C)):$e(C)?ze(e,k,"whitespace")(C):(e.enter("data"),N(C))}function N(C){return C===null||C===124||it(C)?(e.exit("data"),k(C)):(e.consume(C),C===92?j:N)}function j(C){return C===92||C===124?(e.consume(C),N):N(C)}}function tpe(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 p=new Xfe;for(;++n<e.length;){const h=e[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(oN(p,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.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)},p.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=xd(p,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=xd(p,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=xd(p,t,a,i,n,f)):o[1]!==0&&(f=xd(p,t,o,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&oN(p,t,c,u,d),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Qfe(t.events,n))}return e}function xd(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Ro(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Ro(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=Ro(t.events,n[2]),d=Ro(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 p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[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({},Ro(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function oN(e,t,n,r,i){const a=[],o=Ro(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 Ro(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const npe={name:"tasklistCheck",tokenize:ipe};function rpe(){return{text:{91:npe}}}function ipe(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 it(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Ee(c)?t(c):$e(c)?e.check({tokenize:ape},t,n)(c):n(c)}}function ape(e,t,n){return ze(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ope(e){return mM([Ofe(),Ffe(),Yfe(e),Jfe(),rpe()])}const spe={};function lpe(e){const t=this,n=e||spe,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ope(n)),a.push(jfe()),o.push(Afe(n))}const sN=function(e,t,n){const r=Su(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]},go=function(e){if(e==null)return dpe;if(typeof e=="string")return upe(e);if(typeof e=="object")return cpe(e);if(typeof e=="function")return T0(e);throw new Error("Expected function, string, or array as `test`")};function cpe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=go(e[n]);return T0(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function upe(e){return T0(t);function t(n){return n.tagName===e}}function T0(e){return t;function t(n,r,i){return!!(fpe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function dpe(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function fpe(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const lN=/\n/g,cN=/[\t ]+/g,nb=go("br"),uN=go(xpe),ppe=go("p"),dN=go("tr"),hpe=go(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",bpe,wpe]),sR=go(["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 mpe(e,t){const n=t||{},r="children"in e?e.children:[],i=sR(e),a=uR(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...cR(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)o.push(...lR(r[l],e,{whitespace:a,breakBefore:l?void 0:i,breakAfter:l<r.length-1?nb(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 lR(e,t,n){return e.type==="element"?gpe(e,t,n):e.type==="text"?n.whitespace==="normal"?cR(e,n):ype(e):[]}function gpe(e,t,n){const r=uR(e,n),i=e.children||[];let a=-1,o=[];if(hpe(e))return o;let l,c;for(nb(e)||dN(e)&&sN(t,e,dN)?c=`
194
- `:ppe(e)?(l=2,c=2):sR(e)&&(l=1,c=1);++a<i.length;)o=o.concat(lR(i[a],e,{whitespace:r,breakBefore:a?void 0:l,breakAfter:a<i.length-1?nb(i[a+1]):c}));return uN(e)&&sN(t,e,uN)&&o.push(" "),l&&o.unshift(l),c&&o.push(c),o}function cR(e,t){const n=String(e.value),r=[],i=[];let a=0;for(;a<=n.length;){lN.lastIndex=a;const c=lN.exec(n),u=c&&"index"in c?c.index:n.length;r.push(vpe(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 ype(e){return[String(e.value)]}function vpe(e,t,n){const r=[];let i=0,a;for(;i<e.length;){cN.lastIndex=i;const o=cN.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 uR(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 bpe(e){return!!(e.properties||{}).hidden}function xpe(e){return e.tagName==="td"||e.tagName==="th"}function wpe(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function Spe(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]},p={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=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"],_={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},w=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:w.concat([{begin:/\(/,end:/\)/,keywords:_,contains:w.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:h,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:_,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:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(k,N,S,w,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function kpe(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=Spe(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 _pe(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]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:v,built_in:[...b,...x,"set","shopt",..._,...S]},contains:[h,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function Epe(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]},p={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:h,returnBegin:!0,contains:[e.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"</",contains:[].concat(b,x,y,[f,{begin:e.IDENT_RE+"::",keywords:v},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function Npe(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]},p={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=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"],_={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},w=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:w.concat([{begin:/\(/,end:/\)/,keywords:_,contains:w.concat(["self"]),relevance:0}]),relevance:0},N={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:h,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:_,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:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(k,N,S,w,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function jpe(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/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:o},h=e.inherit(p,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,h]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},v=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});p.contains=[m,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],h.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,m,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const Ape=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_-]*/}}),Tpe=["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"],Cpe=["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"],Ope=[...Tpe,...Cpe],Ppe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Mpe=["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(),Rpe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ipe=["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 $pe(e){const t=e.regex,n=Ape(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:":("+Mpe.join("|")+")"},{begin:":(:)?("+Rpe.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ipe.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:Ppe.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ope.join("|")+")\\b"}]}}function Lpe(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 Dpe(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 Bpe(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 zpe(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),p=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:p,className:"attr",starts:{end:/$/,contains:[r,l,a,i,o,n]}}]}}var Io="[0-9](_*[0-9])*",wd=`\\.(${Io})`,Sd="[0-9a-fA-F](_*[0-9a-fA-F])*",fN={className:"number",variants:[{begin:`(\\b(${Io})((${wd})|\\.)?|(${wd}))[eE][+-]?(${Io})[fFdD]?\\b`},{begin:`\\b(${Io})((${wd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${wd})[fFdD]?\\b`},{begin:`\\b(${Io})[fFdD]\\b`},{begin:`\\b0[xX]((${Sd})\\.?|(${Sd})?\\.(${Sd}))[pP][+-]?(${Io})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Sd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function dR(e,t,n){return n===-1?"":e.replace(t,r=>dR(e,t,n-1))}function Fpe(e){const t=e.regex,n="[ร€-สธa-zA-Z_$][ร€-สธa-zA-Z_$0-9]*",r=n+dR("(?:<"+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,fN,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},fN,u]}}const pN="[A-Za-z$_][0-9A-Za-z$_]*",Upe=["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"],Wpe=["true","false","null","undefined","NaN","Infinity"],fR=["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"],pR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Hpe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Gpe=[].concat(hR,fR,pR);function qpe(e){const t=e.regex,n=(O,{after:z})=>{const T="</"+O[0].slice(1);return O.input.indexOf(T,z)!==-1},r=pN,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,z)=>{const T=O[0].length+O.index,V=O.input[T];if(V==="<"||V===","){z.ignoreMatch();return}V===">"&&(n(O,{after:T})||z.ignoreMatch());let q;const P=O.input.substring(T);if(q=P.match(/^\s*=/)){z.ignoreMatch();return}if((q=P.match(/^\s+extends\s+/))&&q.index===0){z.ignoreMatch();return}}},l={$pattern:pN,keyword:Upe,literal:Wpe,built_in:Gpe,"variable.language":Hpe},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},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,v,{match:/\$\d+/},f];p.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,p.contains),S=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},k={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...fR,...pR]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const $={match:t.concat(/\b/,M([...hR,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:L,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"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},$,I,k,B,{match:/\$[(.]/}]}}const Kpe="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",Vpe={scope:"number",match:Kpe,relevance:0};function Ype(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,Vpe,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var $o="[0-9](_*[0-9])*",kd=`\\.(${$o})`,_d="[0-9a-fA-F](_*[0-9a-fA-F])*",Xpe={className:"number",variants:[{begin:`(\\b(${$o})((${kd})|\\.)?|(${kd}))[eE][+-]?(${$o})[fFdD]?\\b`},{begin:`\\b(${$o})((${kd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${kd})[fFdD]?\\b`},{begin:`\\b(${$o})[fFdD]\\b`},{begin:`\\b0[xX]((${_d})\\.?|(${_d})?\\.(${_d}))[pP][+-]?(${$o})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${_d})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Zpe(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=Xpe,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=f;return p.variants[1].contains=[f],f.variants[1].contains=[p],{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 Qpe=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_-]*/}}),Jpe=["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"],ehe=["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"],the=[...Jpe,...ehe],nhe=["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(),mR=["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(),gR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rhe=["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(),ihe=mR.concat(gR).sort().reverse();function ahe(e){const t=Qpe(e),n=ihe,r="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,_,S){return{className:x,begin:_,relevance:S}},d={$pattern:/[a-z-]+/,keyword:r,attribute:nhe.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 p=l.concat({begin:/\{/,end:/\}/,contains:o}),h={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("+rhe.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:p}},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,h,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+the.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:":("+mR.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+gR.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{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,h,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function ohe(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 she(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 lhe(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:[]}),p=e.inherit(d,{contains:[]});u.contains.push(p),d.contains.push(f);let h=[n,c];return[u,d,f,p].forEach(y=>{y.contains=y.contains.concat(h)}),h=h.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,a,u,d,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},i,r,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function che(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 uhe(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=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],p=(m,v,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},h=(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:p("s|tr|y",t.either(...f,{capture:!0}))},{begin:p("s|tr|y","\\(","\\)")},{begin:p("s|tr|y","\\[","\\]")},{begin:p("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("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 dhe(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(R,B)=>{B.data._beginMatch=R[1]||R[2]},"on:end":(R,B)=>{B.data._beginMatch!==R[1]&&B.ignoreMatch()}},p=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[
196
- ]`,g={scope:"string",variants:[d,u,f,p]},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"],_={keyword:y,literal:(R=>{const B=[];return R.forEach(L=>{B.push(L),L.toLowerCase()===L?B.push(L.toUpperCase()):B.push(L.toLowerCase())}),B})(v),built_in:b},S=R=>R.map(B=>B.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,t.concat(h,"+"),t.concat("(?!",S(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},k=t.concat(r,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),k],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),k],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"}}]},j={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},C={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[j,o,N,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,w]},I={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(b).join("\\b|"),"\\b)"),r,t.concat(h,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[C]};C.contains.push(I);const M=[j,N,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,w],$={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...M]},...M,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:_,contains:[$,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,I,N,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},w,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",$,o,N,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,m]}}function fhe(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 phe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function hhe(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]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${g})`},{begin:`(${h})[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(${p})[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 mhe(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function ghe(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 yhe(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]})]}]},p="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${p})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},w=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=w,m.contains=w;const C=[{begin:/^\s*=>/,starts:{end:"$",contains:w}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:w}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(C).concat(u).concat(w)}}function vhe(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 bhe=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_-]*/}}),xhe=["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"],whe=["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"],She=[...xhe,...whe],khe=["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(),_he=["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(),Ehe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Nhe=["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 jhe(e){const t=bhe(e),n=Ehe,r=_he,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("+She.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("+Nhe.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:khe.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 Ahe(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function The(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"],p=["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"],h=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(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function b(S){return t.concat(/\b/,t.either(...S.map(w=>w.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(p),relevance:0};function _(S,{exceptions:w,when:k}={}){const N=k;return w=w||[],S.map(j=>j.match(/\|\d+$/)||w.includes(j)?j:N(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(g,{when:S=>S.length<3}),literal:a,type:l,built_in:f},contains:[{scope:"type",match:b(o)},x,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function yR(e){return e?typeof e=="string"?e:e.source:null}function Ml(e){return Je("(?=",e,")")}function Je(...e){return e.map(n=>yR(n)).join("")}function Che(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function wn(...e){return"("+(Che(e).capture?"":"?:")+e.map(r=>yR(r)).join("|")+")"}const C0=e=>Je(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Ohe=["Protocol","Type"].map(C0),hN=["init","self"].map(C0),Phe=["Any","Self"],vg=["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"],mN=["false","nil","true"],Mhe=["assignment","associativity","higherThan","left","lowerThan","none","right"],Rhe=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],gN=["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"],vR=wn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),bR=wn(vR,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),bg=Je(vR,bR,"*"),xR=wn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),wp=wn(xR,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ir=Je(xR,wp,"*"),Ed=Je(/[A-Z]/,wp,"*"),Ihe=["attached","autoclosure",Je(/convention\(/,wn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Je(/objc\(/,Ir,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],$he=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Lhe(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,wn(...Ohe,...hN)],className:{2:"keyword"}},a={match:Je(/\./,wn(...vg)),relevance:0},o=vg.filter(ge=>typeof ge=="string").concat(["_|0"]),l=vg.filter(ge=>typeof ge!="string").concat(Phe).map(C0),c={variants:[{className:"keyword",match:wn(...l,...hN)}]},u={$pattern:wn(/\b\w+/,/#\w+/),keyword:o.concat(Rhe),literal:mN},d=[i,a,c],f={match:Je(/\./,wn(...gN)),relevance:0},p={className:"built_in",match:Je(/\b/,wn(...gN),/(?=\()/)},h=[f,p],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:bg},{match:`\\.(\\.|${bR})+`}]},v=[g,m],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(ge="")=>({className:"subst",variants:[{match:Je(/\\/,ge,/[0\\tnr"']/)},{match:Je(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(ge="")=>({className:"subst",match:Je(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),w=(ge="")=>({className:"subst",label:"interpol",begin:Je(/\\/,ge,/\(/),end:/\)/}),k=(ge="")=>({begin:Je(ge,/"""/),end:Je(/"""/,ge),contains:[_(ge),S(ge),w(ge)]}),N=(ge="")=>({begin:Je(ge,/"/),end:Je(/"/,ge),contains:[_(ge),w(ge)]}),j={className:"string",variants:[k(),k("#"),k("##"),k("###"),N(),N("#"),N("##"),N("###")]},C=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],I={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:C},M=ge=>{const De=Je(ge,/\//),le=Je(/\//,ge);return{begin:De,end:le,contains:[...C,{scope:"comment",begin:`#(?!.*${le})`,end:/$/}]}},$={scope:"regexp",variants:[M("###"),M("##"),M("#"),I]},R={match:Je(/`/,Ir,/`/)},B={className:"variable",match:/\$\d+/},L={className:"variable",match:`\\$${wp}+`},U=[R,B,L],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$he,contains:[...v,x,j]}]}},z={scope:"keyword",match:Je(/@/,wn(...Ihe),Ml(wn(/\(/,/\s+/)))},T={scope:"meta",match:Je(/@/,Ir)},V=[O,z,T],q={match:Ml(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Je(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,wp,"+")},{className:"type",match:Ed,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Je(/\s+&\s+/,Ml(Ed)),relevance:0}]},P={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...V,g,q]};q.contains.push(P);const ce={match:Je(Ir,/\s*:/),keywords:"_|0",relevance:0},me={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ce,...r,$,...d,...h,...v,x,j,...U,...V,q]},ue={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,q]},He={begin:wn(Ml(Je(Ir,/\s*:/)),Ml(Je(Ir,/\s+/,Ir,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ir}]},Ce={begin:/\(/,end:/\)/,keywords:u,contains:[He,...r,...d,...v,x,j,...V,q,me],endsParent:!0,illegal:/["']/},te={match:[/(func|macro)/,/\s+/,wn(R.match,Ir,bg)],className:{1:"keyword",3:"title.function"},contains:[ue,Ce,t],illegal:[/\[/,/%/]},ye={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ue,Ce,t],illegal:/\[|%/},be={match:[/operator/,/\s+/,bg],className:{1:"keyword",3:"title"}},X={begin:[/precedencegroup/,/\s+/,Ed],className:{1:"keyword",3:"title"},contains:[q],keywords:[...Mhe,...mN],end:/}/},Ae={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},we={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Se={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ir,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ue,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Ed},...d],relevance:0}]};for(const ge of j.variants){const De=ge.contains.find(Tt=>Tt.label==="interpol");De.keywords=u;const le=[...d,...h,...v,x,j,...U];De.contains=[...le,{begin:/\(/,end:/\)/,contains:["self",...le]}]}return{name:"Swift",keywords:u,contains:[...r,te,ye,Ae,we,Se,be,X,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},$,...d,...h,...v,x,j,...U,...V,q,me]}}const Sp="[A-Za-z$_][0-9A-Za-z$_]*",wR=["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"],SR=["true","false","null","undefined","NaN","Infinity"],kR=["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"],_R=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ER=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],NR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jR=[].concat(ER,kR,_R);function Dhe(e){const t=e.regex,n=(O,{after:z})=>{const T="</"+O[0].slice(1);return O.input.indexOf(T,z)!==-1},r=Sp,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,z)=>{const T=O[0].length+O.index,V=O.input[T];if(V==="<"||V===","){z.ignoreMatch();return}V===">"&&(n(O,{after:T})||z.ignoreMatch());let q;const P=O.input.substring(T);if(q=P.match(/^\s*=/)){z.ignoreMatch();return}if((q=P.match(/^\s+extends\s+/))&&q.index===0){z.ignoreMatch();return}}},l={$pattern:Sp,keyword:wR,literal:SR,built_in:jR,"variable.language":NR},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},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,v,{match:/\$\d+/},f];p.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,p.contains),S=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},k={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...kR,..._R]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const $={match:t.concat(/\b/,M([...ER,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:L,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"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},$,I,k,B,{match:/\$[(.]/}]}}function Bhe(e){const t=e.regex,n=Dhe(e),r=Sp,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:Sp,keyword:wR.concat(c),literal:SR,built_in:jR.concat(i),"variable.language":NR},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(x=>x.label===v);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const p=n.contains.find(m=>m.scope==="attr"),h=Object.assign({},p,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,p,h]),n.contains=n.contains.concat([d,a,o,h]),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 zhe(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:/>/}]}),p=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,p,{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:[p]}]}}function Fhe(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 Uhe(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 Whe(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,{}[\]]+/}]}),p={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"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[h],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}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,m,a,o],y=[...v];return y.pop(),y.push(l),h.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const Hhe={arduino:kpe,bash:_pe,c:Epe,cpp:Npe,csharp:jpe,css:$pe,diff:Lpe,go:Dpe,graphql:Bpe,ini:zpe,java:Fpe,javascript:qpe,json:Ype,kotlin:Zpe,less:ahe,lua:ohe,makefile:she,markdown:lhe,objectivec:che,perl:uhe,php:dhe,"php-template":fhe,plaintext:phe,python:hhe,"python-repl":mhe,r:ghe,ruby:yhe,rust:vhe,scss:jhe,shell:Ahe,sql:The,swift:Lhe,typescript:Bhe,vbnet:zhe,wasm:Fhe,xml:Uhe,yaml:Whe};function AR(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)&&AR(n)}),e}class yN{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function TR(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Gi(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 Ghe="</span>",vN=e=>!!e.scope,qhe=(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 Khe{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=TR(t)}openNode(t){if(!vN(t))return;const n=qhe(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){vN(t)&&(this.buffer+=Ghe)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const bN=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class O0{constructor(){this.rootNode=bN(),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=bN({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=>{O0._collapse(n)}))}}class Vhe extends O0{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 Khe(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function au(e){return e?typeof e=="string"?e:e.source:null}function CR(e){return yo("(?=",e,")")}function Yhe(e){return yo("(?:",e,")*")}function Xhe(e){return yo("(?:",e,")?")}function yo(...e){return e.map(n=>au(n)).join("")}function Zhe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function P0(...e){return"("+(Zhe(e).capture?"":"?:")+e.map(r=>au(r)).join("|")+")"}function OR(e){return new RegExp(e.toString()+"|").exec("").length-1}function Qhe(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Jhe=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M0(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let a=au(r),o="";for(;a.length>0;){const l=Jhe.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 eme=/\b\B/,PR="[a-zA-Z]\\w*",R0="[a-zA-Z_]\\w*",MR="\\b\\d+(\\.\\d+)?",RR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",IR="\\b(0b[01]+)",tme="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",nme=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=yo(t,/.*\b/,e.binary,/\b.*/)),Gi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},ou={begin:"\\\\[\\s\\S]",relevance:0},rme={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ou]},ime={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ou]},ame={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/},Dh=function(e,t,n={}){const r=Gi({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=P0("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:yo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ome=Dh("//","$"),sme=Dh("/\\*","\\*/"),lme=Dh("#","$"),cme={scope:"number",begin:MR,relevance:0},ume={scope:"number",begin:RR,relevance:0},dme={scope:"number",begin:IR,relevance:0},fme={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ou,{begin:/\[/,end:/\]/,relevance:0,contains:[ou]}]},pme={scope:"title",begin:PR,relevance:0},hme={scope:"title",begin:R0,relevance:0},mme={begin:"\\.\\s*"+R0,relevance:0},gme=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 Nd=Object.freeze({__proto__:null,APOS_STRING_MODE:rme,BACKSLASH_ESCAPE:ou,BINARY_NUMBER_MODE:dme,BINARY_NUMBER_RE:IR,COMMENT:Dh,C_BLOCK_COMMENT_MODE:sme,C_LINE_COMMENT_MODE:ome,C_NUMBER_MODE:ume,C_NUMBER_RE:RR,END_SAME_AS_BEGIN:gme,HASH_COMMENT_MODE:lme,IDENT_RE:PR,MATCH_NOTHING_RE:eme,METHOD_GUARD:mme,NUMBER_MODE:cme,NUMBER_RE:MR,PHRASAL_WORDS_MODE:ame,QUOTE_STRING_MODE:ime,REGEXP_MODE:fme,RE_STARTERS_RE:tme,SHEBANG:nme,TITLE_MODE:pme,UNDERSCORE_IDENT_RE:R0,UNDERSCORE_TITLE_MODE:hme});function yme(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function vme(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function bme(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=yme,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function xme(e,t){Array.isArray(e.illegal)&&(e.illegal=P0(...e.illegal))}function wme(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 Sme(e,t){e.relevance===void 0&&(e.relevance=1)}const kme=(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=yo(n.beforeMatch,CR(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},_me=["of","and","for","in","not","or","if","then","parent","list","value"],Eme="keyword";function $R(e,t,n=Eme){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,$R(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,Nme(c[0],c[1])]})}}function Nme(e,t){return t?Number(t):jme(e)?0:1}function jme(e){return _me.includes(e.toLowerCase())}const xN={},Xa=e=>{console.error(e)},wN=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Mo=(e,t)=>{xN[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),xN[`${e}/${t}`]=!0)},kp=new Error;function LR(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+=OR(t[l-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Ame(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Xa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),kp;if(typeof e.beginScope!="object"||e.beginScope===null)throw Xa("beginScope must be object"),kp;LR(e,e.begin,{key:"beginScope"}),e.begin=M0(e.begin,{joinWith:""})}}function Tme(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Xa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),kp;if(typeof e.endScope!="object"||e.endScope===null)throw Xa("endScope must be object"),kp;LR(e,e.end,{key:"endScope"}),e.end=M0(e.end,{joinWith:""})}}function Cme(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ome(e){Cme(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Ame(e),Tme(e)}function Pme(e){function t(o,l){return new RegExp(au(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+=OR(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(M0(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,p)=>p>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;[vme,wme,Ome,kme].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[bme,xme,Sme].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=$R(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=au(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 Mme(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=Gi(e.classNameAliases||{}),a(e)}function DR(e){return e?e.endsWithParent||DR(e.starts):!1}function Mme(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Gi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:DR(e)?Gi(e,{starts:e.starts?Gi(e.starts):null}):Object.isFrozen(e)?Gi(e):e}var Rme="11.11.2";class Ime extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const xg=TR,SN=Gi,kN=Symbol("nomatch"),$me=7,BR=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:Vhe};function c(L){return l.noHighlightRe.test(L)}function u(L){let U=L.className+" ";U+=L.parentNode?L.parentNode.className:"";const O=l.languageDetectRe.exec(U);if(O){const z=N(O[1]);return z||(wN(a.replace("{}",O[1])),wN("Falling back to no-highlight mode for this block.",L)),z?O[1]:"no-highlight"}return U.split(/\s+/).find(z=>c(z)||N(z))}function d(L,U,O){let z="",T="";typeof U=="object"?(z=L,O=U.ignoreIllegals,T=U.language):(Mo("10.7.0","highlight(lang, code, ...args) has been deprecated."),Mo("10.7.0",`Please use highlight(code, options) instead.
197
- https://github.com/highlightjs/highlight.js/issues/2277`),T=L,z=U),O===void 0&&(O=!0);const V={code:z,language:T};R("before:highlight",V);const q=V.result?V.result:f(V.language,V.code,O);return q.code=V.code,R("after:highlight",q),q}function f(L,U,O,z){const T=Object.create(null);function V(F,K){return F.keywords[K]}function q(){if(!le.keywords){Fe.addText(Te);return}let F=0;le.keywordPatternRe.lastIndex=0;let K=le.keywordPatternRe.exec(Te),ae="";for(;K;){ae+=Te.substring(F,K.index);const de=Se.case_insensitive?K[0].toLowerCase():K[0],_e=V(le,de);if(_e){const[Xe,yt]=_e;if(Fe.addText(ae),ae="",T[de]=(T[de]||0)+1,T[de]<=$me&&(lt+=yt),Xe.startsWith("_"))ae+=K[0];else{const It=Se.classNameAliases[Xe]||Xe;me(K[0],It)}}else ae+=K[0];F=le.keywordPatternRe.lastIndex,K=le.keywordPatternRe.exec(Te)}ae+=Te.substring(F),Fe.addText(ae)}function P(){if(Te==="")return;let F=null;if(typeof le.subLanguage=="string"){if(!t[le.subLanguage]){Fe.addText(Te);return}F=f(le.subLanguage,Te,!0,Tt[le.subLanguage]),Tt[le.subLanguage]=F._top}else F=h(Te,le.subLanguage.length?le.subLanguage:null);le.relevance>0&&(lt+=F.relevance),Fe.__addSublanguage(F._emitter,F.language)}function ce(){le.subLanguage!=null?P():q(),Te=""}function me(F,K){F!==""&&(Fe.startScope(K),Fe.addText(F),Fe.endScope())}function ue(F,K){let ae=1;const de=K.length-1;for(;ae<=de;){if(!F._emit[ae]){ae++;continue}const _e=Se.classNameAliases[F[ae]]||F[ae],Xe=K[ae];_e?me(Xe,_e):(Te=Xe,q(),Te=""),ae++}}function He(F,K){return F.scope&&typeof F.scope=="string"&&Fe.openNode(Se.classNameAliases[F.scope]||F.scope),F.beginScope&&(F.beginScope._wrap?(me(Te,Se.classNameAliases[F.beginScope._wrap]||F.beginScope._wrap),Te=""):F.beginScope._multi&&(ue(F.beginScope,K),Te="")),le=Object.create(F,{parent:{value:le}}),le}function Ce(F,K,ae){let de=Qhe(F.endRe,ae);if(de){if(F["on:end"]){const _e=new yN(F);F["on:end"](K,_e),_e.isMatchIgnored&&(de=!1)}if(de){for(;F.endsParent&&F.parent;)F=F.parent;return F}}if(F.endsWithParent)return Ce(F.parent,K,ae)}function te(F){return le.matcher.regexIndex===0?(Te+=F[0],1):(Ht=!0,0)}function ye(F){const K=F[0],ae=F.rule,de=new yN(ae),_e=[ae.__beforeBegin,ae["on:begin"]];for(const Xe of _e)if(Xe&&(Xe(F,de),de.isMatchIgnored))return te(K);return ae.skip?Te+=K:(ae.excludeBegin&&(Te+=K),ce(),!ae.returnBegin&&!ae.excludeBegin&&(Te=K)),He(ae,F),ae.returnBegin?0:K.length}function be(F){const K=F[0],ae=U.substring(F.index),de=Ce(le,F,ae);if(!de)return kN;const _e=le;le.endScope&&le.endScope._wrap?(ce(),me(K,le.endScope._wrap)):le.endScope&&le.endScope._multi?(ce(),ue(le.endScope,F)):_e.skip?Te+=K:(_e.returnEnd||_e.excludeEnd||(Te+=K),ce(),_e.excludeEnd&&(Te=K));do le.scope&&Fe.closeNode(),!le.skip&&!le.subLanguage&&(lt+=le.relevance),le=le.parent;while(le!==de.parent);return de.starts&&He(de.starts,F),_e.returnEnd?0:K.length}function X(){const F=[];for(let K=le;K!==Se;K=K.parent)K.scope&&F.unshift(K.scope);F.forEach(K=>Fe.openNode(K))}let Ae={};function we(F,K){const ae=K&&K[0];if(Te+=F,ae==null)return ce(),0;if(Ae.type==="begin"&&K.type==="end"&&Ae.index===K.index&&ae===""){if(Te+=U.slice(K.index,K.index+1),!i){const de=new Error(`0 width match regex (${L})`);throw de.languageName=L,de.badRule=Ae.rule,de}return 1}if(Ae=K,K.type==="begin")return ye(K);if(K.type==="illegal"&&!O){const de=new Error('Illegal lexeme "'+ae+'" for mode "'+(le.scope||"<unnamed>")+'"');throw de.mode=le,de}else if(K.type==="end"){const de=be(K);if(de!==kN)return de}if(K.type==="illegal"&&ae==="")return K.index===U.length||(Te+=`
198
- `),1;if(Zt>1e5&&Zt>K.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Te+=ae,ae.length}const Se=N(L);if(!Se)throw Xa(a.replace("{}",L)),new Error('Unknown language: "'+L+'"');const ge=Pme(Se);let De="",le=z||ge;const Tt={},Fe=new l.__emitter(l);X();let Te="",lt=0,Me=0,Zt=0,Ht=!1;try{if(Se.__emitTokens)Se.__emitTokens(U,Fe);else{for(le.matcher.considerAll();;){Zt++,Ht?Ht=!1:le.matcher.considerAll(),le.matcher.lastIndex=Me;const F=le.matcher.exec(U);if(!F)break;const K=U.substring(Me,F.index),ae=we(K,F);Me=F.index+ae}we(U.substring(Me))}return Fe.finalize(),De=Fe.toHTML(),{language:L,value:De,relevance:lt,illegal:!1,_emitter:Fe,_top:le}}catch(F){if(F.message&&F.message.includes("Illegal"))return{language:L,value:xg(U),illegal:!0,relevance:0,_illegalBy:{message:F.message,index:Me,context:U.slice(Me-100,Me+100),mode:F.mode,resultSoFar:De},_emitter:Fe};if(i)return{language:L,value:xg(U),illegal:!1,relevance:0,errorRaised:F,_emitter:Fe,_top:le};throw F}}function p(L){const U={value:xg(L),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return U._emitter.addText(L),U}function h(L,U){U=U||l.languages||Object.keys(t);const O=p(L),z=U.filter(N).filter(C).map(ce=>f(ce,L,!1));z.unshift(O);const T=z.sort((ce,me)=>{if(ce.relevance!==me.relevance)return me.relevance-ce.relevance;if(ce.language&&me.language){if(N(ce.language).supersetOf===me.language)return 1;if(N(me.language).supersetOf===ce.language)return-1}return 0}),[V,q]=T,P=V;return P.secondBest=q,P}function g(L,U,O){const z=U&&n[U]||O;L.classList.add("hljs"),L.classList.add(`language-${z}`)}function m(L){let U=null;const O=u(L);if(c(O))return;if(R("before:highlightElement",{el:L,language:O}),L.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",L);return}if(L.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(L)),l.throwUnescapedHTML))throw new Ime("One of your code blocks includes unescaped HTML.",L.innerHTML);U=L;const z=U.textContent,T=O?d(z,{language:O,ignoreIllegals:!0}):h(z);L.innerHTML=T.value,L.dataset.highlighted="yes",g(L,O,T.language),L.result={language:T.language,re:T.relevance,relevance:T.relevance},T.secondBest&&(L.secondBest={language:T.secondBest.language,relevance:T.secondBest.relevance}),R("after:highlightElement",{el:L,result:T,text:z})}function v(L){l=SN(l,L)}const y=()=>{_(),Mo("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){_(),Mo("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function _(){function L(){_()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",L,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function S(L,U){let O=null;try{O=U(e)}catch(z){if(Xa("Language definition for '{}' could not be registered.".replace("{}",L)),i)Xa(z);else throw z;O=o}O.name||(O.name=L),t[L]=O,O.rawDefinition=U.bind(null,e),O.aliases&&j(O.aliases,{languageName:L})}function w(L){delete t[L];for(const U of Object.keys(n))n[U]===L&&delete n[U]}function k(){return Object.keys(t)}function N(L){return L=(L||"").toLowerCase(),t[L]||t[n[L]]}function j(L,{languageName:U}){typeof L=="string"&&(L=[L]),L.forEach(O=>{n[O.toLowerCase()]=U})}function C(L){const U=N(L);return U&&!U.disableAutodetect}function I(L){L["before:highlightBlock"]&&!L["before:highlightElement"]&&(L["before:highlightElement"]=U=>{L["before:highlightBlock"](Object.assign({block:U.el},U))}),L["after:highlightBlock"]&&!L["after:highlightElement"]&&(L["after:highlightElement"]=U=>{L["after:highlightBlock"](Object.assign({block:U.el},U))})}function M(L){I(L),r.push(L)}function $(L){const U=r.indexOf(L);U!==-1&&r.splice(U,1)}function R(L,U){const O=L;r.forEach(function(z){z[O]&&z[O](U)})}function B(L){return Mo("10.7.0","highlightBlock will be removed entirely in v12.0"),Mo("10.7.0","Please use highlightElement now."),m(L)}Object.assign(e,{highlight:d,highlightAuto:h,highlightAll:_,highlightElement:m,highlightBlock:B,configure:v,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:S,unregisterLanguage:w,listLanguages:k,getLanguage:N,registerAliases:j,autoDetection:C,inherit:SN,addPlugin:M,removePlugin:$}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=Rme,e.regex={concat:yo,lookahead:CR,either:P0,optional:Xhe,anyNumberOfTimes:Yhe};for(const L in Nd)typeof Nd[L]=="object"&&AR(Nd[L]);return Object.assign(e,Nd),e},zs=BR({});zs.newInstance=()=>BR({});var Lme=zs;zs.HighlightJS=zs;zs.default=zs;const Dme=Ye(Lme),_N={},Bme="hljs-";function zme(e){const t=Dme.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||_N,p=typeof f.prefix=="string"?f.prefix:Bme;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Fme,classPrefix:p});const h=t.highlight(u,{ignoreIllegals:!0,language:c});if(h.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:h.errorRaised});const g=h._emitter.root,m=g.data;return m.language=h.language,m.relevance=h.relevance,g}function r(c,u){const f=(u||_N).subset||i();let p=-1,h=0,g;for(;++p<f.length;){const m=f[p];if(!t.getLanguage(m))continue;const v=n(m,c,u);v.data&&v.data.relevance!==void 0&&v.data.relevance>h&&(h=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:h}}}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 Fme{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 Ume={};function Wme(e){const t=e||Ume,n=t.aliases,r=t.detect||!1,i=t.languages||Hhe,a=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=zme(i);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){Lh(d,"element",function(p,h,g){if(p.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=Hme(p);if(m===!1||!m&&!r||m&&a&&a.includes(m))return;Array.isArray(p.properties.className)||(p.properties.className=[]),p.properties.className.includes(c)||p.properties.className.unshift(c);const v=mpe(p,{whitespace:"pre"});let y;try{y=m?u.highlight(m,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(b){const x=b;if(m&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+m+"`, itโ€™s not registered",{ancestors:[g,p],cause:x,place:p.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!m&&y.data&&y.data.language&&p.properties.className.push("language-"+y.data.language),y.children.length>0&&(p.children=y.children)})}}function Hme(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 _p="[A-Za-z$_][0-9A-Za-z$_]*",zR=["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"],FR=["true","false","null","undefined","NaN","Infinity"],UR=["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"],WR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],HR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],GR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],qR=[].concat(HR,UR,WR);function Gme(e){const t=e.regex,n=(O,{after:z})=>{const T="</"+O[0].slice(1);return O.input.indexOf(T,z)!==-1},r=_p,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,z)=>{const T=O[0].length+O.index,V=O.input[T];if(V==="<"||V===","){z.ignoreMatch();return}V===">"&&(n(O,{after:T})||z.ignoreMatch());let q;const P=O.input.substring(T);if(q=P.match(/^\s*=/)){z.ignoreMatch();return}if((q=P.match(/^\s+extends\s+/))&&q.index===0){z.ignoreMatch();return}}},l={$pattern:_p,keyword:zR,literal:FR,built_in:qR,"variable.language":GR},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},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,v,{match:/\$\d+/},f];p.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,p.contains),S=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},k={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...UR,...WR]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const $={match:t.concat(/\b/,M([...HR,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:L,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"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},$,I,k,B,{match:/\$[(.]/}]}}function EN(e){const t=e.regex,n=Gme(e),r=_p,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:_p,keyword:zR.concat(c),literal:FR,built_in:qR.concat(i),"variable.language":GR},d={className:"meta",begin:"@"+r},f=(m,v,y)=>{const b=m.contains.findIndex(x=>x.label===v);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const p=n.contains.find(m=>m.scope==="attr"),h=Object.assign({},p,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,p,h]),n.contains=n.contains.concat([d,a,o,h]),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 NN="[A-Za-z$_][0-9A-Za-z$_]*",qme=["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"],Kme=["true","false","null","undefined","NaN","Infinity"],KR=["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"],VR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],YR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Vme=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],Yme=[].concat(YR,KR,VR);function jN(e){const t=e.regex,n=(O,{after:z})=>{const T="</"+O[0].slice(1);return O.input.indexOf(T,z)!==-1},r=NN,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,z)=>{const T=O[0].length+O.index,V=O.input[T];if(V==="<"||V===","){z.ignoreMatch();return}V===">"&&(n(O,{after:T})||z.ignoreMatch());let q;const P=O.input.substring(T);if(q=P.match(/^\s*=/)){z.ignoreMatch();return}if((q=P.match(/^\s+extends\s+/))&&q.index===0){z.ignoreMatch();return}}},l={$pattern:NN,keyword:qme,literal:Kme,built_in:Yme,"variable.language":Vme},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},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,v,{match:/\$\d+/},f];p.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,p.contains),S=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},k={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...KR,...VR]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function M(O){return t.concat("(?!",O.join("|"),")")}const $={match:t.concat(/\b/,M([...YR,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",U={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:N},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,v,b,{match:/\$\d+/},f,N,{scope:"attr",match:r+t.lookahead(":"),relevance:0},U,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:L,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"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},$,I,k,B,{match:/\$[(.]/}]}}const Xme="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",Zme={scope:"number",match:Xme,relevance:0};function Qme(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,Zme,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Jme(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]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:v,built_in:[...b,...x,"set","shopt",..._,...S]},contains:[h,e.SHEBANG(),g,f,a,o,y,l,c,u,d,n]}}function AN(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function TN(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]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${g})`},{begin:`(${h})[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(${p})[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 CN(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:[]}),p=e.inherit(d,{contains:[]});u.contains.push(p),d.contains.push(f);let h=[n,c];return[u,d,f,p].forEach(y=>{y.contains=y.contains.concat(h)}),h=h.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,a,r,u,d,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},i,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ON(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,{}[\]]+/}]}),p={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"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[h],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}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,m,a,o],y=[...v];return y.pop(),y.push(l),h.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}function ege(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 tge(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"],p=["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"],h=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(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function b(S){return t.concat(/\b/,t.either(...S.map(w=>w.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(p),relevance:0};function _(S,{exceptions:w,when:k}={}){const N=k;return w=w||[],S.map(j=>j.match(/\|\d+$/)||w.includes(j)?j:N(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(g,{when:S=>S.length<3}),literal:a,type:l,built_in:f},contains:[{scope:"type",match:b(o)},x,y,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function PN(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 nge=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_-]*/}}),rge=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ige=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],age=[...rge,...ige],oge=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),sge=["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(),lge=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cge=["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 uge(e){const t=e.regex,n=nge(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:":("+sge.join("|")+")"},{begin:":(:)?("+lge.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+cge.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:oge.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+age.join("|")+")\\b"}]}}function MN(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}const dge={ts:EN,typescript:EN,js:jN,javascript:jN,json:Qme,bash:Jme,shell:AN,sh:AN,python:TN,py:TN,markdown:CN,md:CN,yaml:ON,yml:ON,diff:ege,sql:tge,html:PN,xml:PN,css:uge,text:MN,plaintext:MN};function XR(e){if(e==null)return"";const t=e;return typeof t.value=="string"?t.value:Array.isArray(t.children)?t.children.map(XR).join(""):""}function fge({lang:e,code:t,children:n}){const[r,i]=E.useState(!1),a=async()=>{var o;try{await((o=navigator.clipboard)==null?void 0:o.writeText(t)),i(!0),setTimeout(()=>i(!1),1500)}catch{}};return s.jsxs("div",{className:"md-code-block",children:[s.jsxs("div",{className:"md-code-head",children:[s.jsx("span",{className:"md-code-lang",children:e}),s.jsx("button",{type:"button",className:"md-code-copy",onClick:()=>void a(),children:r?"โœ“ Copied":"โง‰ Copy"})]}),s.jsx("pre",{className:"md-code-pre",children:s.jsx("code",{children:n})})]})}function pge({node:e,children:t}){var o,l,c,u;const n=(o=e==null?void 0:e.children)==null?void 0:o[0],i=((u=(Array.isArray((l=n==null?void 0:n.properties)==null?void 0:l.className)?(c=n==null?void 0:n.properties)==null?void 0:c.className:[]).find(d=>typeof d=="string"&&d.startsWith("language-")))==null?void 0:u.slice(9))??"text",a=E.useMemo(()=>XR(n),[n]);return s.jsx(fge,{lang:i,code:a,children:t})}function RN({text:e}){const t=E.useMemo(()=>({h1:({node:n,...r})=>s.jsx("h1",{className:"md-heading md-h1",...r}),h2:({node:n,...r})=>s.jsx("h2",{className:"md-heading md-h2",...r}),h3:({node:n,...r})=>s.jsx("h3",{className:"md-heading md-h3",...r}),h4:({node:n,...r})=>s.jsx("h4",{className:"md-heading md-h4",...r}),h5:({node:n,...r})=>s.jsx("h5",{className:"md-heading md-h5",...r}),h6:({node:n,...r})=>s.jsx("h6",{className:"md-heading md-h6",...r}),p:({node:n,...r})=>s.jsx("p",{className:"md-para",...r}),ul:({node:n,...r})=>s.jsx("ul",{className:"md-list md-ul",...r}),ol:({node:n,...r})=>s.jsx("ol",{className:"md-list md-ol",...r}),blockquote:({node:n,...r})=>s.jsx("blockquote",{className:"md-quote",...r}),hr:({node:n,...r})=>s.jsx("hr",{className:"md-hr",...r}),table:({node:n,...r})=>s.jsx("table",{className:"md-table",...r}),a:({node:n,...r})=>s.jsx("a",{target:"_blank",rel:"noreferrer",...r}),pre:pge}),[]);return s.jsx("div",{className:"md-root",children:s.jsx(Yue,{remarkPlugins:[lpe],rehypePlugins:[[Wme,{languages:dge}]],components:t,children:e??""})})}const IN=/```([\w+-]*)\n([\s\S]*?)```/g;function hge(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 mge(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 gge(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 yge(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 $N=/https?:\/\/[^\s)\]}"'<>]+/i,LN=/(๐Ÿš€|deploy(?:ed|ment|ing)?|live at|published|available at|open the)/i;function vge(e){return e.replace(/[.,;:!?]+$/,"")}function bge(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(LN);!o&&i+1<t.length&&/deploy(?:ed|ment|ing)?:\s*$/i.test(a.trim())&&(o=t[i+1].match(LN));const l=a.match($N)||(i+1<t.length?t[i+1].match($N):null);if(!o||!l)continue;const c=vge(l[0]);r.has(c)||(r.add(c),n.push({url:c,title:a.trim().slice(0,80)||"Deployment"}))}return n}function DN(e){const t=[],n=[],r=[];IN.lastIndex=0;let i;for(;(i=IN.exec(e))!==null;){const a=(i[1]||"").toLowerCase(),o=i[2];if(a==="diff"||o.includes("diff --git ")){const l=hge(o);l.length>0&&t.push({files:l,summary:`${l.length} file${l.length===1?"":"s"} changed`})}else mge(o)&&n.push({verdict:gge(o),title:yge(o),body:o})}for(const a of bge(e))r.push(a);return{diffs:t,results:n,deploys:r}}const xge=/\x1b(?:\[[0-9;?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-Z\\-_])/g;function BN(e){return e?e.replace(xge,""):""}const zN=3e5,wge=2e3;function Sge(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 kge={running:"โณ running",done:"โœ… done",failed:"โŒ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐Ÿ’ฅ error"};function jd({diff:e,selectable:t=!1,onCommitAccepted:n,lockedHint:r}){const[i,a]=E.useState(null),o=new Set(i??e.files.map(d=>d.path)),l=d=>{a(f=>{const p=f??e.files.map(h=>h.path);return p.includes(d)?p.filter(h=>h!==d):[...p,d]})},c=e.files.reduce((d,f)=>{var p;return d+(((p=f.body.match(/^\+/gm))==null?void 0:p.length)??0)},0),u=e.files.reduce((d,f)=>{var p;return d+(((p=f.body.match(/^-/gm))==null?void 0:p.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:p=>{p.preventDefault(),p.stopPropagation(),l(d.path)},children:f?"โœ“":"โœ—"}):null,d.path]}),s.jsx("pre",{className:"chat-diff-body",children:d.body.split(`
203
- `).map((p,h)=>{const g=p.startsWith("+")?"diff-add":p.startsWith("-")?"diff-del":p.startsWith("@@")?"diff-hunk":"";return s.jsx("div",{className:`chat-diff-line ${g}`,children:p||" "},h)})})]},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 I0({text:e,label:t}){const[n,r]=E.useState(!1),i=async()=>{var a;try{await((a=navigator.clipboard)==null?void 0:a.writeText(e)),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return s.jsx("button",{type:"button",className:"chat-card-copy",title:`Copy ${t}`,onClick:()=>void i(),children:n?"โœ“ Copied":"โง‰ Copy"})}function _ge({result:e}){const t=e.verdict==="pass"?"โœ…":e.verdict==="fail"?"โŒ":"๐Ÿ“‹";return s.jsxs("div",{className:`chat-result-card chat-result-${e.verdict}`,children:[s.jsxs("div",{className:"chat-result-head",children:[s.jsx("span",{className:"chat-result-icon",children:t}),s.jsx("span",{className:"chat-result-title",children:e.title}),s.jsx("span",{className:"chat-result-meta",children:e.verdict}),s.jsx(I0,{text:e.body,label:"result output"})]}),s.jsx("pre",{className:"chat-result-body",children:e.body})]})}function Ege({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(I0,{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 Nge({children:e}){const t=E.useRef(null),n=r=>{if(!t.current)return;const i=Array.from(t.current.querySelectorAll("[data-artifact-card]"));if(i.length===0)return;const a=i.indexOf(document.activeElement);let o=-1;r.key==="ArrowDown"?o=a+1>=i.length?0:a+1:r.key==="ArrowUp"?o=a-1<0?i.length-1:a-1:r.key==="Home"?o=0:r.key==="End"&&(o=i.length-1),o>=0&&o!==a&&(r.preventDefault(),i[o].focus())};return s.jsx("div",{className:"chat-artifacts",ref:t,role:"group","aria-label":"Artifacts",onKeyDown:n,children:e})}function jge({task:e,onCancel:t}){const n=e.status==="running",r=e.logs.map(i=>BN(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:kge[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(I0,{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=BN(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 FN({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 Age({request:e,onSave:t}){const[n,r]=E.useState({}),[i,a]=E.useState(!1),o=e.missing.every(u=>{var d;return(d=n[u])==null?void 0:d.trim()}),l=e.missing.filter(u=>e.persisted[u]),c=e.missing.filter(u=>!e.persisted[u]);return s.jsxs("div",{className:"chat-secret-card",children:[s.jsxs("div",{className:"chat-secret-head",children:[s.jsx("span",{className:"chat-secret-icon",children:"๐Ÿ”"}),s.jsxs("span",{className:"chat-secret-title",children:[e.skillName," needs environment variables"]})]}),l.length>0?s.jsxs("div",{className:"chat-secret-persisted",children:["Already configured: ",l.map(u=>s.jsx("code",{children:u},u)).join(", ")]}):null,c.length>0&&!i?s.jsxs("div",{className:"chat-secret-fields",children:[c.map(u=>s.jsxs("div",{className:"chat-secret-row",children:[s.jsxs("label",{className:"chat-secret-label",htmlFor:`secret-${u}`,children:[u,":"]}),s.jsx("input",{id:`secret-${u}`,className:"chat-secret-input",type:"password",placeholder:`Enter ${u} valueโ€ฆ`,value:n[u]??"",onChange:d=>r(f=>({...f,[u]:d.target.value}))})]},u)),s.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!o,onClick:()=>{t(n),a(!0)},children:"๐Ÿ’พ Save to ~/.buff/.env"})]}):i?s.jsx("div",{className:"admin-hint",children:"โœ… Saved โ€” the skill will pick up these values on next load."}):s.jsx("div",{className:"admin-hint",children:"All required env vars are already configured."})]})}function Tge({result:e}){const[t,n]=E.useState(!1),r=e.success?"โœ…":"โŒ",i=e.success?"Success":`Failed (exit ${e.exitCode})`,a=e.success?"chat-exec-success":"chat-exec-failure",o=new Date(e.timestamp).toLocaleTimeString();return s.jsxs("div",{className:`chat-exec-card ${a}`,children:[s.jsxs("div",{className:"chat-exec-head",onClick:()=>n(!t),style:{cursor:"pointer"},children:[s.jsx("span",{className:"chat-exec-icon",children:"๐Ÿ“œ"}),s.jsx("span",{className:"chat-exec-title",children:e.skillName}),s.jsxs("span",{className:"chat-exec-status",children:[r," ",i]}),s.jsxs("span",{className:"chat-exec-meta",children:[e.runtime," ยท ",e.durationMs,"ms ยท ",o]}),s.jsx("span",{className:"chat-exec-expand",children:t?"โ–ผ":"โ–ถ"})]}),t&&s.jsxs("div",{className:"chat-exec-body",children:[e.stdout&&s.jsxs("div",{className:"chat-exec-section",children:[s.jsx("div",{className:"chat-exec-section-title",children:"stdout"}),s.jsx("pre",{className:"chat-exec-output",children:e.stdout})]}),e.stderr&&s.jsxs("div",{className:"chat-exec-section chat-exec-stderr",children:[s.jsx("div",{className:"chat-exec-section-title",children:"stderr"}),s.jsx("pre",{className:"chat-exec-output",children:e.stderr})]}),s.jsxs("div",{className:"chat-exec-details",children:[s.jsxs("span",{children:["Runtime: ",e.runtime]}),s.jsxs("span",{children:["Exit code: ",e.exitCode]}),s.jsxs("span",{children:["Duration: ",e.durationMs,"ms"]})]})]})]})}function Cge(e){return e==="done"?"โœ…":e==="running"?"๐Ÿ”„":e==="blocked"?"โ›”":"โฌœ"}function UN({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:Cge(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 WN({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:Sge(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 wg(){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 Oge(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 HN(){var Pu,Mu,Ru,xa,Iu;const[e,t]=E.useState(null),[n,r]=E.useState([]),[i,a]=E.useState(""),[o,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(null),[p,h]=E.useState([]),[g,m]=E.useState([]),[v,y]=E.useState(null),[b,x]=E.useState(null),[_,S]=E.useState(null),[w,k]=E.useState([]),[N,j]=E.useState([]),[C,I]=E.useState(null),M=E.useRef([]),$=E.useRef([]),R=E.useRef(null),B=E.useRef(null),L=E.useRef(null),[U,O]=E.useState(""),z=E.useRef(""),T=E.useRef(null),[V,q]=E.useState(null),P=E.useRef(wg()),ce=E.useRef(""),[me,ue]=E.useState([]),[He,Ce]=E.useState(!0),[te,ye]=E.useState(""),[be,X]=E.useState(null),[Ae,we]=E.useState(""),[Se,ge]=E.useState([]),[De,le]=E.useState(null),[Tt,Fe]=E.useState(!1),Te=E.useRef(null),lt=E.useRef(null),[Me,Zt]=E.useState(null),[Ht,F]=E.useState(null),[K,ae]=E.useState([]),[de,_e]=E.useState(""),[Xe,yt]=E.useState(""),[It,Dn]=E.useState(!1),[pt,Nt]=E.useState(""),[H,oe]=E.useState([]),[Re,Oe]=E.useState(null),[ga,Pr]=E.useState(!1),[mr,vo]=E.useState([]),[_u,An]=E.useState([]),[bo,_i]=E.useState(""),sl=E.useRef(null),tt=E.useRef(null),xo=E.useRef(null),Mr=E.useRef(null),[Gt,ya]=E.useState(null),[va,Eu]=E.useState(new Set);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(D=>{t(D?{configured:D.configured,authenticated:D.authenticated,role:D.role}:{configured:!1,authenticated:!1,role:null})})},[]),E.useEffect(()=>{var D,Z;try{(Z=(D=xo.current)==null?void 0:D.scrollTo)==null||Z.call(D,{top:xo.current.scrollHeight})}catch{}},[n,o,p]),E.useEffect(()=>()=>{var D;(D=tt.current)==null||D.call(tt),tt.current=null},[]);const Bh=E.useCallback(async D=>{var ke,Zr;(ke=tt.current)==null||ke.call(tt),tt.current=null;const Z=await ee.getChatSession(D);if(!Z)return;P.current=D,r(Z.turns.map($t=>({role:$t.role,content:$t.content,...$t.role==="assistant"?{followups:[],artifacts:DN($t.content)}:{}}))),h([]),M.current=[],m([]),$.current=[],y(null),R.current=null,x(null),B.current=null,S(null),L.current=null,z.current="",O(""),q(null),u(""),f(null),I(null),ya(null),Ce(!0);const Q=Z.projectPath;if(Q){if(F(Q),(Me==null?void 0:Me.path)===Q)return;(Zr=Mr.current)==null||Zr.call(Mr,Q)}else F(null)},[Me]),ll=E.useCallback(()=>{var D;(D=tt.current)==null||D.call(tt),tt.current=null,P.current=wg(),F(null),r([]),h([]),M.current=[],m([]),$.current=[],y(null),R.current=null,x(null),B.current=null,S(null),L.current=null,z.current="",O(""),q(null),u(""),f(null),I(null),ya(null),ge([]),le(null),a(""),Ce(!0)},[]),wo=E.useCallback(D=>{ge(Z=>[...Z,D].slice(-10))},[]),cl=E.useCallback(D=>{ge(Z=>Z.filter((Q,ke)=>ke!==D))},[]),Nu=E.useCallback(async D=>{if(!D)return;if(D.size>zN){u(`Attachment "${D.name}" is too large (max ${Math.round(zN/1024)} KB).`);return}const Z=await D.text();wo({name:D.name,content:Z,kind:"file"})},[wo]),ju=E.useCallback(D=>{const Z=D.currentTarget,Q=D.clipboardData.getData("text")||"";Q.length>=wge&&(lt.current={start:Z.selectionStart,end:Z.selectionEnd},le({text:Q}))},[]),zh=E.useCallback(()=>{const D=De;if(!D)return;const Z=lt.current;a(Q=>Z?Q.slice(0,Z.start)+Q.slice(Z.end):Q),wo({name:"pasted-text.txt",content:D.text,kind:"paste"}),le(null),lt.current=null},[De,wo]),Fh=E.useCallback(D=>{X(D.id),we(D.title==="(untitled conversation)"?"":D.title)},[]),Au=E.useCallback(async D=>{const Z=await ee.renameChatSession(D,Ae);Z.ok?ue(Q=>Q.map(ke=>ke.id===D?{...ke,title:Ae.trim()||ke.title}:ke)):u(Z.error||"Could not rename the session."),X(null),we("")},[Ae]),ul=E.useCallback(async D=>{const Z=await ee.deleteChatSession(D);Z.ok?(ue(Q=>Q.filter(ke=>ke.id!==D)),P.current===D&&ll()):u(Z.error||"Could not delete the session.")},[ll]),So=(e==null?void 0:e.authenticated)===!0&&(e.role==="admin"||e.role==="operator");E.useEffect(()=>{So&&(ee.listChatSessions().then(D=>{Array.isArray(D)&&ue(D)}),ee.listProjects().then(D=>{Array.isArray(D)&&ae(D)}))},[So]);const Bn=E.useCallback(async D=>{const Z=D.trim();if(!Z)return;yt("");const Q=await ee.attachProject(Z);if(Q.ok&&Q.project){Zt(Q.project),_e("");const ke=await ee.listProjects();Array.isArray(ke)&&ae(ke)}else yt(Q.error||"Could not attach that directory.")},[]);Mr.current=Bn;const Qt=E.useCallback(async D=>{Dn(!0),Pr(!0),_i("");const Z=await ee.browseDirectories(D,{showDrives:!D});Z.ok&&(Nt(Z.path),oe(Z.entries),Oe(Z.parent),Z.drives&&vo(Z.drives),Z.breadcrumbs&&An(Z.breadcrumbs)),Pr(!1)},[]),ba=E.useCallback(async D=>{Pr(!0),_i("");const Z=await ee.browseDirectories(D);Z.ok&&(Nt(Z.path),oe(Z.entries),Oe(Z.parent),Z.breadcrumbs&&An(Z.breadcrumbs)),Pr(!1)},[]),Ei=E.useCallback(async()=>{if(!pt)return;const D=await ee.browseDirectories(pt);D.ok&&oe(D.entries)},[pt]);E.useEffect(()=>(It&&pt&&(sl.current=setInterval(()=>{Ei()},5e3)),()=>{sl.current&&clearInterval(sl.current)}),[It,pt,Ei]);const Tu=E.useCallback(async()=>{const D=window;if(typeof D.showDirectoryPicker=="function")try{const Q=(await D.showDirectoryPicker()).name;if(!Q){Qt();return}yt(""),l(!0);const ke=await ee.resolveFolder(Q);l(!1),ke.ok&&ke.path?(_e(ke.path),Bn(ke.path)):(yt((ke.error||"Could not find folder.")+" Opening manual browser..."),Qt());return}catch(Z){if(Z instanceof DOMException&&Z.name==="AbortError")return}Qt()},[Qt,Bn]),Ct=E.useCallback(async(D,Z)=>{var gr,Jn;const Q=D.trim(),ke=Array.isArray(Z)?Z:Se,Zr=!Array.isArray(Z)&&(Z==null?void 0:Z.skipResolve)===!0;if(!Q&&ke.length===0||o)return;if(u(""),f(null),h([]),M.current=[],m([]),$.current=[],y(null),R.current=null,x(null),B.current=null,S(null),L.current=null,r(xe=>[...xe,{role:"user",content:Q,attachments:ke.length>0?ke:void 0}]),a(""),ge([]),le(null),ce.current=Q||`[${ke.length} attachment(s)]`,l(!0),Ce(!1),!Zr){const at=((await ee.chatResolve(Q)).matches??[])[0]??null;if(at&&at.command&&!at.ambiguous&&at.score>=.6){I({ask:Q,top:at}),l(!1);return}if(at&&at.ambiguous&&!C){I({ask:Q,top:at}),l(!1);return}}const $t=P.current,zn=new AbortController;T.current=zn,q(null),(gr=tt.current)==null||gr.call(tt),tt.current=ee.subscribeChat($t,{onToken:xe=>{z.current+=xe,O(z.current)},onProgress:xe=>{M.current=[...M.current,xe],h(M.current)},onQuestion:xe=>{ya(xe),Eu(new Set)},onTool:xe=>{const Be=[...$.current],at=Be.findIndex(en=>en.id===xe.id),jt={id:xe.id,tool:xe.tool,phase:xe.phase,args:xe.args,ok:xe.ok,result:xe.result,error:xe.error,durationMs:xe.durationMs};at>=0?Be[at]=jt:Be.push(jt),$.current=Be,m(Be)},onPlan:xe=>{const Be={goal:xe.goal,steps:xe.steps,revision:xe.revision};R.current=Be,y(Be)},onDiff:xe=>{const Be={files:xe.files,summary:xe.summary};B.current=Be,x(Be)},onSkillDraft:xe=>{const Be={name:xe.name,description:xe.description,markdown:xe.markdown,updatedAt:xe.updatedAt,status:"pending"};L.current=Be,S(Be)},onSecretRequest:xe=>{k(Be=>{const at=Be.findIndex(jt=>jt.skillName===xe.skillName);if(at>=0){const jt=[...Be];return jt[at]=xe,jt}return[...Be,xe]})},onExecutionResult:xe=>{j(Be=>[...Be,xe])}});const xn=await ee.chatSend($t,Q||`(see ${ke.length} attachment${ke.length===1?"":"s"})`,{projectPath:Me==null?void 0:Me.path,attachments:ke.map(xe=>({name:xe.name,content:xe.content,kind:xe.kind}))},zn.signal);if(T.current=null,(Jn=tt.current)==null||Jn.call(tt),tt.current=null,z.current="",O(""),xn.ok){f(xn.generationFailed?null:`${xn.provider??"provider"}${xn.model?` / ${xn.model}`:" (auto-routed)"}`),q(xn.generationFailed?Q:null);const xe=xn.content||"(the agent produced no text โ€” try rephrasing)";r(Be=>[...Be,{role:"assistant",content:xe,error:xn.generationFailed,followups:xn.followups,steps:M.current,tools:$.current,plan:R.current,diff:B.current,draft:L.current,artifacts:DN(xe)}])}else zn.signal.aborted?(u(""),q(null)):xn.unauthorized?(t(xe=>xe&&{...xe,authenticated:!1}),u("Session expired โ€” log in again to chat.")):(u(xn.error||"The agent could not answer โ€” check that a provider API key is set for the dashboard process."),q(Q));l(!1),Ce(!0)},[o,Me,Se]),Ni=E.useCallback(()=>{var D;(D=T.current)==null||D.abort()},[]),ko=E.useCallback(async D=>{S(Q=>Q&&{...Q,status:"saving"});const Z=await ee.skillDraftAccept(D);S(Q=>Q&&{...Q,status:Z.ok?"saved":"error"}),Z.ok||u(Z.error||"Could not accept the draft.")},[]),Xr=E.useCallback(async D=>{const Z=await ee.skillDraftReject(D);Z.ok?S(Q=>Q&&{...Q,status:"rejected"}):u(Z.error||"Could not reject the draft.")},[]),_o=E.useCallback(D=>{Ct(`Revise the skill draft "${D}" โ€” improve it per your best judgment and present it again.`)},[Ct]),Eo=E.useCallback(async D=>{const Z=await ee.saveSecrets(D);Z.ok||u(Z.error||"Could not save secrets.")},[]),Cu=E.useCallback(async D=>{const ke=((await ee.chatResolve(D)).matches??[])[0]??null;if(!(ke!=null&&ke.command)){I(null);return}I(null),l(!0);const Zr=ke.command.split(/\s+/),$t=await ee.startTask(Zr,6e4);if(!$t.ok||!$t.task){u($t.error||"The command could not be started."),l(!1);return}const zn=$t.task.id,xn={id:zn,command:ke.command,status:$t.task.status,exitCode:$t.task.exitCode,durationMs:$t.task.durationMs,logs:$t.task.logs??[]};r(at=>[...at,{role:"assistant",content:"",task:xn}]);const gr=at=>r(jt=>jt.map(en=>en.task&&en.task.id===zn?{...en,task:{...en.task,...at}}:en));let Jn=null;Jn=ee.subscribeTask(zn,{onLog:at=>r(jt=>jt.map(en=>en.task&&en.task.id===zn?{...en,task:{...en.task,logs:[...en.task.logs,at]}}:en)),onStatus:at=>{gr({status:at}),at!=="running"&&(ee.getTask(zn).then(jt=>{jt!=null&&jt.task&&gr({exitCode:jt.task.exitCode,durationMs:jt.task.durationMs,logs:jt.task.logs??[]})}),Jn==null||Jn(),l(!1))}});const xe=await ee.getTask(zn);xe!=null&&xe.task&&gr({status:xe.task.status,exitCode:xe.task.exitCode,durationMs:xe.task.durationMs,logs:xe.task.logs??[]});const Be=await ee.getTask(zn);Be!=null&&Be.task&&Be.task.status!=="running"&&(Jn==null||Jn(),gr({status:Be.task.status,exitCode:Be.task.exitCode,durationMs:Be.task.durationMs,logs:Be.task.logs??[]}),l(!1))},[]),ji=E.useCallback(D=>{I(null),Ct(D,{skipResolve:!0})},[Ct]),Ou=E.useCallback(D=>{if(D.length===0)return;const Z=Me?` in the attached project ${Me.path}`:"";Ct(`Commit exactly these files that I accepted on the diff card (and nothing else)${Z}: ${D.join(", ")}. Show me a short confirmation before finishing.`)},[Ct,Me]),Uh=E.useCallback(async D=>{await ee.cancelTask(D)},[]),bn=E.useCallback(async D=>{const Z=Gt;if(!Z)return;ya(null);const Q=await ee.chatRespond(P.current,Z.questionId,D);Q.ok||u(Q.error||"The question could not be answered โ€” try sending your message again.")},[Gt]),Jt=E.useCallback(()=>{if(!Gt)return;const D=Gt.multiSelect?[...va]:[...va][0];Gt.multiSelect?bn({index:[...va]}):bn(D!==void 0?{index:D}:{index:-1})},[Gt,va,bn]),Wh=E.useCallback(()=>{Gt&&bn({index:-1})},[Gt,bn]),Hh=E.useCallback(D=>{Eu(Z=>{const Q=new Set(Z);return Gt!=null&&Gt.multiSelect?Q.has(D)?Q.delete(D):Q.add(D):(Q.clear(),Q.add(D)),Q})},[Gt]),Gh=E.useCallback(async()=>{var Z;(Z=tt.current)==null||Z.call(tt),tt.current=null,P.current=wg(),r([]),h([]),M.current=[],m([]),$.current=[],y(null),R.current=null,x(null),B.current=null,S(null),L.current=null,z.current="",O(""),q(null),u(""),f(null),I(null),ya(null);const D=await ee.listChatSessions();Array.isArray(D)&&ue(D)},[]),Ai=((Pu=[...n].reverse().find(D=>{var Z;return D.role==="assistant"&&!D.error&&(((Z=D.followups)==null?void 0:Z.length)??0)>0}))==null?void 0:Pu.followups)??[];return s.jsxs("div",{className:"panel",children:[s.jsxs("div",{className:"panel-header",children:[s.jsx("h2",{children:"๐Ÿ’ฌ Chat with the agent"}),s.jsxs("div",{className:"chat-head-actions",children:[d?s.jsx("span",{className:"admin-hint",children:d}):null,s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void Gh(),disabled:o||n.length===0,children:"๐Ÿ—‘ New conversation"})]})]}),e!=null&&e.authenticated?So?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-project-bar",children:Me?s.jsxs("div",{className:"chat-project-attached",children:[s.jsx("span",{className:"chat-project-icon",children:"๐Ÿ“"}),s.jsx("span",{className:"chat-project-name",children:Me.name}),s.jsxs("span",{className:"chat-project-meta",children:[Me.fileCount," files ยท ",Me.symbolCount," symbols",Me.truncated?" ยท truncated map":""]}),s.jsx("span",{className:"chat-project-path",title:Me.path,children:Me.path}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>Zt(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"}),K.length>0?s.jsx("span",{className:"chat-project-chips",children:K.filter(D=>D.kind!=="cwd").slice(0,3).map(D=>s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Bn(D.path),children:D.name},D.path))}):null,s.jsx("input",{className:"chat-project-input",value:de,onChange:D=>_e(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),Bn(de))},placeholder:"or type a path, e.g. ~/code/my-app",disabled:o}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void Bn(de),disabled:o||!de.trim(),children:"Attach"}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void Tu(),title:"Pick a project folder using your system's folder picker (Finder / Explorer)",children:"๐Ÿ—‚๏ธ Browse"}),Xe?s.jsx("span",{className:"chat-project-error",children:Xe}):null,It?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:()=>Dn(!1),title:"Close",children:"โœ•"}),s.jsx("div",{className:"chat-browse-breadcrumbs",children:mr.length>0&&!pt?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 Qt(),children:"๐Ÿ "}),_u.map((D,Z)=>s.jsxs("span",{children:[s.jsx("span",{className:"chat-breadcrumb-sep",children:"/"}),s.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void ba(D.path),children:D.name})]},D.path))]})})]}),mr.length>0&&!pt?s.jsx("div",{className:"chat-browse-drives",children:mr.map(D=>s.jsx("button",{type:"button",className:"chat-browse-drive",onClick:()=>void ba(D.path),children:D.name},D.path))}):null,H.length>5?s.jsx("div",{className:"chat-browse-search",children:s.jsx("input",{type:"text",className:"chat-browse-filter",placeholder:"๐Ÿ” Filter foldersโ€ฆ",value:bo,onChange:D=>_i(D.target.value),autoFocus:!0})}):null,s.jsx("div",{className:"chat-browse-list",children:ga?s.jsx("span",{className:"admin-hint",children:"Loadingโ€ฆ"}):H.length===0?s.jsx("span",{className:"admin-hint",children:"No subdirectories found"}):H.filter(D=>!bo||D.name.toLowerCase().includes(bo.toLowerCase())).map(D=>s.jsxs("button",{type:"button",className:"chat-browse-entry",onClick:()=>void ba(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 Ei(),title:"Refresh folder list",children:"๐Ÿ”„"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>{Dn(!1),Bn(pt)},disabled:!pt,children:"๐Ÿ“ Select this folder"})]})]}):null]})}),Ht&&(!Me||Me.path!==Ht)?s.jsxs("div",{className:"chat-session-project-banner",children:[s.jsxs("span",{children:["โš ๏ธ This conversation was working in ",s.jsx("code",{children:Ht})]}),Me?s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void Bn(Ht),children:"๐Ÿ“ Switch to it"}):s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void Bn(Ht),children:"๐Ÿ“ Attach it"})]}):null,s.jsxs("div",{className:"chat-layout",children:[He?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:ll,children:"๏ผ‹ New"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Collapse history",onClick:()=>Ce(!1),children:"โ–ธ"})]})]}),s.jsx("input",{className:"chat-session-search",placeholder:"Search conversationsโ€ฆ",value:te,onChange:D=>ye(D.target.value)}),me.length===0?s.jsx("div",{className:"chat-sidebar-empty",children:"No past conversations yet."}):s.jsx("div",{className:"chat-sidebar-list",children:Oge(me,te).map(({label:D,items:Z})=>s.jsxs("div",{className:"chat-session-group",children:[s.jsx("div",{className:"chat-session-group-label",children:D}),Z.map(Q=>s.jsx("div",{className:`chat-session-item${Q.id===P.current?" chat-session-active":""}`,children:be===Q.id?s.jsxs("div",{className:"chat-session-rename",children:[s.jsx("input",{autoFocus:!0,value:Ae,onChange:ke=>we(ke.target.value),onKeyDown:ke=>{ke.key==="Enter"&&Au(Q.id),ke.key==="Escape"&&X(null)},placeholder:"Session title"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>void Au(Q.id),children:"โœ“"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"chat-session-main",onClick:()=>void Bh(Q.id),title:Q.preview||Q.title,children:[s.jsx("span",{className:"chat-session-title",children:Q.title}),s.jsx("span",{className:"chat-session-preview",children:Q.firstUser||Q.preview}),s.jsxs("span",{className:"chat-session-meta",children:[Q.projectPath?`๐Ÿ“ ${Q.projectPath.split("/").pop()} ยท `:"",Q.turnCount," msg",Q.turnCount===1?"":"s"," ยท ",new Date(Q.updatedAt).toLocaleString()]})]}),s.jsxs("span",{className:"chat-session-actions",children:[s.jsx("button",{type:"button",className:"chat-mini-action",title:"Rename",onClick:()=>Fh(Q),children:"โœ๏ธ"}),s.jsx("button",{type:"button",className:"chat-mini-action",title:"Delete",onClick:()=>void ul(Q.id),children:"๐Ÿ—‘"})]})]})},Q.id))]},D))})]}):s.jsx("div",{className:"chat-rail",children:s.jsx("button",{type:"button",className:"chat-rail-btn",onClick:()=>Ce(!0),title:"Show history",children:"๐Ÿ“"})}),s.jsxs("div",{className:"chat-main",children:[s.jsxs("div",{className:"chat-thread",ref:xo,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 Ct("what's the state of this project?"),children:"๐Ÿ“‹ assess this project"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Ct("run the test suite"),children:"๐Ÿงช run the tests"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Ct("stop the gateway"),children:"โน stop the gateway"}),s.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Ct("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 Ct("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 Ct("publish the current version"),children:"๐Ÿš€ publish the release"})]})]}):n.map((D,Z)=>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(RN,{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(Q=>Q.name).join(", ")]}),D.attachments.map((Q,ke)=>s.jsxs("div",{className:"chat-attach-content",children:[s.jsxs("div",{className:"admin-hint",children:[Q.name," โ€” ",Q.content.length.toLocaleString()," chars"]}),s.jsx("pre",{children:Q.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(jd,{diff:D.diff,selectable:!0,onCommitAccepted:Ou})]}):null,D.role==="assistant"&&D.artifacts&&(D.artifacts.diffs.length>0||D.artifacts.results.length>0||D.artifacts.deploys.length>0)?s.jsxs(Nge,{children:[D.artifacts.diffs.map((Q,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Diff: ${Q.summary}`,className:"chat-artifact-item",children:Me?s.jsx(jd,{diff:Q,selectable:!0,onCommitAccepted:Ou}):s.jsx(jd,{diff:Q,lockedHint:"Attach a project to review and commit these changes."})},`diff-${ke}`)),D.artifacts.results.map((Q,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Result: ${Q.title}`,className:"chat-artifact-item",children:s.jsx(_ge,{result:Q})},`result-${ke}`)),D.artifacts.deploys.map((Q,ke)=>s.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Deployment: ${Q.url}`,className:"chat-artifact-item",children:s.jsx(Ege,{deploy:Q})},`deploy-${ke}`))]}):null,D.role==="assistant"&&D.task?s.jsx(jge,{task:D.task,onCancel:D.task.status==="running"?()=>void Uh(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(FN,{draft:D.draft,onAccept:ko,onReject:Xr,onEdit:_o})]}):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(UN,{plan:D.plan})]}):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(WN,{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((Q,ke)=>s.jsx("div",{children:Q.trim()},ke))})]}):null]},Z)),o?s.jsxs("div",{className:"chat-bubble chat-assistant",children:[s.jsx("div",{className:"chat-bubble-role",children:"๐Ÿค– Agent"}),v?s.jsx(UN,{plan:v}):null,b?s.jsx(jd,{diff:b}):null,_?s.jsx(FN,{draft:_,onAccept:ko,onReject:Xr,onEdit:_o}):null,w.map(D=>s.jsx(Age,{request:D,onSave:Eo},D.skillName)),N.map((D,Z)=>s.jsx(Tge,{result:D},`${D.skillName}-${Z}`)),s.jsx(WN,{tools:g,live:!0}),U?s.jsx("div",{className:"chat-bubble-text chat-streaming",children:s.jsx(RN,{text:U})}):null,s.jsx("div",{className:"chat-working",children:p.length>0?s.jsx("span",{className:"chat-working-lines",children:p.map((D,Z)=>s.jsx("div",{className:"chat-step-line",children:D.trim()},Z))}):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,V&&!o?s.jsxs("div",{className:"chat-retry-row",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void Ct(V),children:"โ†ป Retry"}),s.jsx("span",{className:"admin-hint",children:"Re-send the last message โ€” the turn failed."})]}):null,C&&!o?s.jsx("div",{className:"chat-resolve-card",children:(Mu=C.top)!=null&&Mu.ambiguous&&((Ru=C.top.options)!=null&&Ru.length)?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"chat-resolve-head",children:[s.jsx("strong",{children:"๐Ÿค” Which do you mean?"}),' โ€” "',C.ask,'" maps to more than one action.']}),s.jsx("div",{className:"chat-resolve-options",children:C.top.options.map(D=>s.jsxs("button",{className:"chat-chip",type:"button",onClick:()=>void Ct(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:()=>{I(null)},children:"โœ• Not that โ€” ask the agent"})})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"chat-resolve-head",children:[s.jsx("strong",{children:"โšก Run this command?"}),' โ€” "',C.ask,'"']}),s.jsx("div",{className:"chat-resolve-cmd",children:s.jsx("code",{children:(xa=C.top)==null?void 0:xa.command})}),(Iu=C.top)!=null&&Iu.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 Cu(C.ask),children:"โ–ถ Run"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>ji(C.ask),children:"โœ• No โ€” ask the agent"})]})]})}):null,Gt?s.jsxs("div",{className:"chat-resolve-card chat-question-card",children:[s.jsx("div",{className:"chat-resolve-head",children:s.jsxs("strong",{children:["๐Ÿค” ",Gt.question]})}),s.jsx("div",{className:"chat-resolve-options",children:Gt.choices.map((D,Z)=>s.jsxs("button",{type:"button",className:`chat-chip${va.has(Z)?" chat-chip-selected":""}`,onClick:()=>Hh(Z),children:[D.label,D.description?s.jsxs("span",{className:"admin-hint",children:[" โ€” ",D.description]}):null]},`${D.label}-${Z}`))}),s.jsxs("div",{className:"chat-resolve-foot",children:[s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:Jt,children:Gt.multiSelect?"Submit":"Choose"}),s.jsx("button",{className:"admin-mini-btn",type:"button",onClick:Wh,children:"Skip โ€” best judgment"})]})]}):null,Ai.length>0&&!o?s.jsxs("div",{className:"chat-followups",children:[s.jsx("span",{className:"admin-hint",children:"Next steps:"}),Ai.map((D,Z)=>s.jsx("button",{className:"chat-chip",type:"button",onClick:()=>void Ct(D.prompt),children:D.label||D.prompt},Z))]}):null,s.jsxs("form",{className:`chat-composer${Tt?" chat-composer-drag":""}`,onSubmit:D=>{D.preventDefault(),Ct(i)},onDragOver:D=>{D.preventDefault(),Fe(!0)},onDragLeave:()=>Fe(!1),onDrop:D=>{var Q;D.preventDefault(),Fe(!1);const Z=Array.from(((Q=D.dataTransfer)==null?void 0:Q.files)??[]);for(const ke of Z.slice(0,10))Nu(ke)},children:[De?s.jsxs("div",{className:"chat-paste-offer",children:[s.jsxs("span",{className:"admin-hint",children:["๐Ÿ“„ You pasted ",De.text.length.toLocaleString()," characters. Attach it as a file instead?"]}),s.jsx("button",{type:"button",className:"chat-chip",onClick:zh,children:"Attach as text"}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>{le(null),lt.current=null},children:"Keep inline"})]}):null,Se.length>0?s.jsx("div",{className:"chat-attach-row",children:Se.map((D,Z)=>s.jsxs("span",{className:"chat-attach-chip",title:`${D.name} (${D.content.length.toLocaleString()} chars)`,children:["๐Ÿ“Ž ",D.name,s.jsxs("span",{className:"admin-hint",children:[" ",D.content.length.toLocaleString(),"c"]}),s.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>cl(Z),children:"โœ•"})]},`${D.name}-${Z}`))}):null,s.jsxs("div",{className:"chat-input-row",children:[s.jsx("input",{ref:Te,type:"file",style:{display:"none"},onChange:D=>{var Q;const Z=(Q=D.target.files)==null?void 0:Q[0];Z&&Nu(Z),D.target.value=""}}),s.jsx("button",{type:"button",className:"chat-attach-btn",title:"Attach a file (up to 300 KB, text only)",disabled:o||Se.length>=10,onClick:()=>{var D;return(D=Te.current)==null?void 0:D.click()},children:"๐Ÿ“Ž"}),s.jsx("textarea",{className:"chat-input-box",value:i,onChange:D=>a(D.target.value),onPaste:ju,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey?(D.preventDefault(),Ct(i)):D.key==="ArrowUp"&&i===""&&ce.current&&(D.preventDefault(),a(ce.current))},placeholder:"Message the agentโ€ฆ (Enter to send ยท Shift+Enter for a new line ยท โ†‘ recalls last ยท ๐Ÿ“Ž attach a file or paste a large document)",disabled:o,maxLength:8e3,rows:1,autoFocus:!0}),o?s.jsx("button",{className:"admin-mini-btn chat-cancel-btn",type:"button",onClick:Ni,children:"โน Cancel"}):null,s.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||!i.trim()&&Se.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 Pge={running:"โณ running",done:"โœ… done",failed:"โŒ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐Ÿ’ฅ error"};function ZR({presets:e,customPlaceholder:t,timeoutMs:n=3e5,hint:r}){const[i,a]=E.useState(null),[o,l]=E.useState(!1),[c,u]=E.useState(""),[d,f]=E.useState(""),[p,h]=E.useState(null),[g,m]=E.useState([]),v=E.useRef(null),y=E.useRef(null);E.useEffect(()=>{ee.fetchAdminAuthStatus().then(S=>{a(S?{authenticated:S.authenticated,role:S.role}:{authenticated:!1,role:null})})},[]),E.useEffect(()=>{var S,w;try{(w=(S=v.current)==null?void 0:S.scrollIntoView)==null||w.call(S,{block:"end"})}catch{}},[g]),E.useEffect(()=>()=>{var S;(S=y.current)==null||S.call(y)},[]);const b=(i==null?void 0:i.authenticated)===!0&&(i.role==="admin"||i.role==="operator"),x=E.useCallback(async(S,w)=>{var C;if(o)return;l(!0),u(""),m([]);const k=await ee.startTask(S,w??n);if(!k.ok||!k.task){u(k.error||"Could not start the command."),l(!1);return}const N=k.task;h(N);const j=await ee.getTask(N.id);j!=null&&j.task&&m(j.task.logs.map(I=>({stream:I.stream,text:I.text}))),(C=y.current)==null||C.call(y),y.current=ee.subscribeTask(N.id,{onLog:I=>m(M=>[...M,{stream:I.stream,text:I.text}]),onStatus:I=>{h(M=>M&&{...M,status:I}),I!=="running"&&l(!1)}})},[o,n]),_=E.useCallback(async()=>{p&&await ee.cancelTask(p.id)},[p]);return s.jsxs("div",{className:"ops-console",children:[i!=null&&i.authenticated?b?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"ops-presets",children:e.map(S=>s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void x(S.args,S.timeoutMs),disabled:o,children:S.label},S.label))}),s.jsxs("div",{className:"ops-custom-row",children:[s.jsx("input",{type:"text",value:d,onChange:S=>f(S.target.value),placeholder:t,disabled:o,maxLength:160}),s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void x(d.trim().split(/\s+/)),disabled:o||!d.trim(),children:"Run"})]}),r?s.jsx("p",{className:"admin-hint",children:r}):null]}):s.jsx("div",{className:"admin-login-hint",children:"Your role can view but not run commands (requires admin or operator)."}):s.jsx("div",{className:"admin-login-hint",children:"Log in (admin or operator) to run commands."}),c?s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:c}):null,p?s.jsxs("div",{className:"ops-console-box",children:[s.jsxs("div",{className:"ops-console-head",children:[s.jsxs("span",{children:[p.command," ยท ",s.jsx("span",{className:p.status==="running"?"task-status-running":"",children:Pge[p.status]})]}),p.status==="running"?s.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void _(),children:"โน Cancel"}):null]}),s.jsxs("pre",{className:"ops-console",role:"log",children:[g.length>0?g.map((S,w)=>s.jsx("div",{children:S.text},w)):s.jsx("div",{className:"admin-hint",children:"Waiting for outputโ€ฆ"}),s.jsx("div",{ref:v})]})]}):null]})}const Mge=[{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 GN(e){return typeof e!="number"?"โ€”":`${Math.round(e*100)}%`}function Rge(e){return new Date(e).toLocaleString()}function Ige({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(ZR,{presets:Mge,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:Rge(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:GN(r.summary.completionRate)}),s.jsx("td",{children:GN(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 $ge=[{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 Lge(){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(ZR,{presets:$ge,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 Sg={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 Dge(){const[e,t]=E.useState(null),[n,r]=E.useState("all"),[i,a]=E.useState(null),[o,l]=E.useState(0),[c,u]=E.useState({}),[d,f]=E.useState(!1),[p,h]=E.useState(null),[g,m]=E.useState({status:"idle"}),[v,y]=E.useState(""),[b,x]=E.useState("Hello from agent-nuvira!"),[_,S]=E.useState(!1),[w,k]=E.useState(null),N=E.useRef(!0),j=E.useCallback(async()=>{const O=await ee.getPlatformConfigs();N.current&&t(O)},[]);E.useEffect(()=>(j(),()=>{N.current=!1}),[j]);const C=O=>{a(O),l(0),u(Object.fromEntries(O.envVars.map(T=>[T.varName,T.value]))),h(null),m({status:"idle"});const z=Sg[O.platform];y((z==null?void 0:z.testTarget)??""),x("Hello from agent-nuvira!"),k(null)},I=async()=>{if(!i)return;m({status:"checking"});const O=await ee.verifyPlatformConfig(i.platform,c);O.ok?(m({status:"ok",info:O.info}),h({kind:"ok",text:"Verified! "+(O.info?"Connected as "+O.info+".":"Token is valid.")})):(m({status:"err",error:O.error}),h({kind:"err",text:O.error||"Verification failed."}))},M=async()=>{if(!i)return;f(!0),h(null);const O=await ee.setPlatformConfig(i.platform,c);f(!1),O.ok?(h({kind:"ok",text:"Token saved! Verifying..."}),j(),l(2),I()):h({kind:"err",text:O.error||"Save failed."})},$=async()=>{if(!i||!v)return;S(!0),k(null);const O=await ee.sendChannelMessage(v,b);S(!1),O.ok?k({kind:"ok",text:"Message sent via "+O.platform+"! Check your "+i.label+" app."}):k({kind:"err",text:O.error||"Send failed. Make sure the gateway is running (Gateway tab)."})};if(e===null)return s.jsx("div",{className:"empty-state",children:"Loading platforms..."});const R=e.filter(O=>O.configured).length,B=e.filter(O=>n==="configured"?O.configured:n==="unconfigured"?!O.configured:!0),L=i?Sg[i.platform]:null;function U(O){return o===O?"wizard-step-dot active":"wizard-step-dot"}return s.jsxs("div",{className:"panel",children:[s.jsx("div",{className:"panel-header",children:s.jsx("h2",{children:"Platforms โ€” Messaging Gateway Onboarding"})}),s.jsxs("div",{className:"platforms-summary",children:[s.jsxs("div",{className:"platforms-summary-stat",children:[s.jsx("span",{className:"platforms-summary-number",children:R}),s.jsx("span",{className:"platforms-summary-label",children:"configured"})]}),s.jsxs("div",{className:"platforms-summary-stat",children:[s.jsx("span",{className:"platforms-summary-number",children:e.length-R}),s.jsx("span",{className:"platforms-summary-label",children:"available"})]}),s.jsx("div",{className:"platforms-summary-filters",children:["all","configured","unconfigured"].map(O=>s.jsx("button",{type:"button",className:n===O?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>r(O),children:O==="all"?"All":O==="configured"?"Configured":"Not set up"},O))})]}),s.jsx("div",{className:"platforms-grid",children:B.map(O=>{const z=Sg[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:(z==null?void 0:z.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:(z==null?void 0:z.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(T=>s.jsxs("span",{className:T.set?"platform-var-chip set":"platform-var-chip",children:[T.varName," ",T.set?"done":"--"]},T.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:()=>C(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&&L?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:L.icon}),s.jsxs("span",{className:"wizard-title",children:["Getting Started: ",i.label]}),s.jsxs("div",{className:"wizard-steps-indicator",children:[s.jsx("span",{className:U(0),children:"1"}),s.jsx("span",{className:U(1),children:"2"}),s.jsx("span",{className:U(2),children:"3"})]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>a(null),children:"X"})]}),s.jsxs("div",{className:"wizard-body",children:[o===0&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"wizard-section-title",children:["Step 1: Create your bot on ",i.label]}),s.jsx("ol",{className:"wizard-steps",children:L.steps.map((O,z)=>s.jsx("li",{children:O},z))}),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:z=>u(T=>({...T,[O.varName]:z.target.value})),placeholder:O.secret?"paste your token here":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},O.varName)),p?s.jsx("div",{className:p.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:p.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"&&(p==null?void 0:p.kind)==="ok"&&s.jsx("div",{className:"wizard-verify-status ok",children:p.text}),v&&s.jsxs("div",{className:"wizard-test-section",children:[s.jsx("p",{className:"wizard-section-title",children:"Send a test message:"}),s.jsx("div",{className:"wizard-test-row",children:s.jsx("input",{className:"wizard-test-input",value:v,onChange:O=>y(O.target.value),placeholder:"telegram:YOUR_CHAT_ID"})}),s.jsxs("div",{className:"wizard-test-row",children:[s.jsx("input",{className:"wizard-test-input",value:b,onChange:O=>x(O.target.value),placeholder:"Hello from agent-nuvira!"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void $(),disabled:_||!v,children:_?"Sending...":"Send test"})]}),w?s.jsx("div",{className:w.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:w.text}):null]}),s.jsxs("div",{className:"wizard-nav",children:[s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(1),children:"Edit token"}),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>a(null),children:"Done"})]}),!v&&s.jsxs("p",{className:"wizard-hint",children:["Token saved! Start the gateway from the Gateway tab, then send a message from your ",i.label," app."]})]})]})]})}):null]})}const Bge=[{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)"}],qN=[{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 zge({canWrite:e,sessionExpired:t}){const[n,r]=E.useState(null),[i,a]=E.useState(null),[o,l]=E.useState(!1),[c,u]=E.useState("overview"),d=E.useRef(!0),[f,p]=E.useState("bearer"),[h,g]=E.useState(""),[m,v]=E.useState(""),[y,b]=E.useState(""),[x,_]=E.useState("us-east-1"),[S,w]=E.useState(qN.filter(R=>R.checked).map(R=>R.name)),[k,N]=E.useState(!1),[j,C]=E.useState(null),I=E.useCallback(async()=>{const R=await ee.getBedrockStatus();d.current&&r(R)},[]);E.useEffect(()=>(I(),()=>{d.current=!1}),[I]);const M=async()=>{l(!0),a(null);try{const R=await ee.probeBedrock((n==null?void 0:n.region)||"us-east-1");if(!d.current)return;R.ok&&R.models&&(a(R.models),u("test"))}catch{}finally{d.current&&l(!1)}},$=async()=>{N(!0),C(null);try{const R={BEDROCK_REGION:x};f==="bearer"&&h?R.AWS_BEARER_TOKEN=h:f==="iam"&&(m&&(R.AWS_ACCESS_KEY_ID=m),y&&(R.AWS_SECRET_ACCESS_KEY=y));const B=await ee.setupBedrock(R);if(!d.current)return;B.ok?(C({kind:"ok",text:"โœ… Configuration saved! Running connectivity testโ€ฆ"}),u("overview"),await I(),setTimeout(()=>void M(),500)):C({kind:"err",text:B.error||"Save failed"})}catch{d.current&&C({kind:"err",text:"Could not reach the dashboard server."})}finally{d.current&&N(!1)}};return n===null?s.jsx("div",{className:"empty-state",children:"Loading Bedrock statusโ€ฆ"}):s.jsxs("div",{className:"bedrock-onboarding",children:[s.jsx("h2",{className:"section-title",children:"๐ŸŸ  AWS Bedrock"}),s.jsxs("p",{className:"admin-subtitle",children:["Bedrock gives you access to Claude, Llama, Mistral, DeepSeek, and more โ€” all through a single AWS account. Unlike other providers, Bedrock requires a ",s.jsx("strong",{children:"region"}),", ",s.jsx("strong",{children:"AWS credentials"}),", and explicit ",s.jsx("strong",{children:"model access approval"}),"."]}),j?s.jsx("div",{className:`admin-row-msg${j.kind==="ok"?"":" admin-row-msg-err"}`,children:j.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:()=>p("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:()=>p("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:h,onChange:R=>g(R.target.value),placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",autoComplete:"off",spellCheck:!1})]})]}):s.jsxs("div",{className:"bedrock-wizard-fields",children:[s.jsxs("div",{className:"bedrock-setup-hint",children:[s.jsx("strong",{children:"IAM credentials"})," give full AWS SDK access. Create an IAM user with Bedrock permissions."]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"AWS_ACCESS_KEY_ID"}),s.jsx("input",{type:"text",value:m,onChange:R=>v(R.target.value),placeholder:"AKIA...",autoComplete:"off",spellCheck:!1})]}),s.jsxs("label",{className:"hub-send-target",children:[s.jsx("span",{className:"admin-hint",children:"AWS_SECRET_ACCESS_KEY"}),s.jsx("input",{type:"password",value:y,onChange:R=>b(R.target.value),placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",autoComplete:"off",spellCheck:!1})]})]})]}),s.jsxs("div",{className:"bedrock-wizard-step",children:[s.jsx("h4",{children:"Step 2: AWS Region"}),s.jsxs("p",{className:"admin-hint",children:["Models vary by region. ",s.jsx("strong",{children:"us-east-1"})," and ",s.jsx("strong",{children:"us-west-2"})," have the most models. โš ๏ธ Do NOT use eu-north-1 unless models are explicitly enabled there."]}),s.jsx("select",{className:"bedrock-region-select",value:x,onChange:R=>_(R.target.value),children:Bge.map(R=>s.jsx("option",{value:R.value,children:R.label},R.value))})]}),s.jsxs("div",{className:"bedrock-wizard-step",children:[s.jsx("h4",{children:"Step 3: Model Access"}),s.jsx("p",{className:"admin-hint",children:"Bedrock requires you to request access for each model family."}),s.jsx("div",{className:"bedrock-model-access-hint",children:s.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${x}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"๐Ÿ“– Open Model Access in AWS Console"})}),s.jsx("div",{className:"bedrock-family-grid",children:qN.map(R=>s.jsxs("label",{className:`bedrock-family-card ${S.includes(R.name)?"selected":""}`,children:[s.jsx("input",{type:"checkbox",checked:S.includes(R.name),onChange:B=>{B.target.checked?w(L=>[...L,R.name]):w(L=>L.filter(U=>U!==R.name))}}),s.jsxs("div",{children:[s.jsx("strong",{children:R.name}),s.jsxs("span",{children:[R.models.length," model(s)"]})]})]},R.name))}),s.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"In the AWS Console, select the families above and submit. Approval is usually instant for Anthropic and Meta models."})]}),s.jsxs("div",{className:"bedrock-wizard-actions",children:[s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void $(),disabled:k||f==="bearer"&&!h||f==="iam"&&(!m||!y),children:k?"โณ Savingโ€ฆ":"๐Ÿ’พ Save & Test"}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),children:"Cancel"})]})]}),c==="test"&&i&&s.jsxs("div",{className:"bedrock-probe-results",children:[s.jsxs("h3",{className:"section-subtitle",children:["๐Ÿ” Model Probe Results (",n.region,")"]}),s.jsx("div",{className:"bedrock-probe-grid",children:i.map(R=>s.jsxs("div",{className:`bedrock-probe-card bedrock-probe-${R.status}`,children:[s.jsx("span",{className:"bedrock-probe-icon",children:R.status==="accessible"?"โœ…":R.status==="permission-denied"?"๐Ÿ”’":R.status==="not-found"?"โšซ":"โŒ"}),s.jsx("span",{className:"bedrock-probe-id",children:R.modelId}),s.jsx("span",{className:"bedrock-probe-status",children:R.status==="accessible"?"Ready":R.status==="permission-denied"?`Need access (HTTP ${R.httpStatus})`:R.status==="not-found"?"Not in this region":"Error"})]},R.modelId))}),i.some(R=>R.status==="permission-denied")&&s.jsxs("div",{className:"bedrock-probe-action",children:[s.jsxs("p",{children:["Some models exist in ",n.region," but access is not approved."]}),s.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${n.region}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"๐Ÿ”“ Request Model Access in AWS Console โ†’"})]}),s.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),style:{marginTop:12},children:"โ† Back"})]}),!n.configured&&c==="overview"&&s.jsxs("div",{className:"bedrock-getting-started",children:[s.jsx("h3",{className:"section-subtitle",children:"๐Ÿ“‹ Getting Started with Bedrock"}),s.jsxs("div",{className:"bedrock-steps",children:[s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"1"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Create an AWS account"})," (or use existing)",s.jsxs("span",{children:["New to AWS? Sign up at ",s.jsx("a",{href:"https://aws.amazon.com/",target:"_blank",rel:"noopener noreferrer",children:"aws.amazon.com"})]})]})]}),s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"2"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Get Bedrock API key"}),s.jsx("span",{children:"Bedrock โ†’ Settings โ†’ API keys โ†’ Create key"})]})]}),s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"3"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Request model access"}),s.jsx("span",{children:"Bedrock โ†’ Model access โ†’ Select Claude, Llama, etc. โ†’ Submit"})]})]}),s.jsxs("div",{className:"bedrock-step",children:[s.jsx("span",{className:"bedrock-step-num",children:"4"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Configure in this wizard"}),s.jsx("span",{children:'Click "Setup Wizard" above to enter your credentials'})]})]})]})]}),n.configured&&c==="overview"&&!i&&s.jsx("div",{className:"bedrock-quick-status",children:s.jsxs("p",{className:"admin-hint",children:["Bedrock is configured. Click ",s.jsx("strong",{children:"๐Ÿ” Test Models"})," to verify connectivity and discover which models are accessible in ",n.region,"."]})})]})}function Fge(){const[e,t]=E.useState([]),[n,r]=E.useState(!0),[i,a]=E.useState("all"),[o,l]=E.useState(null),[c,u]=E.useState(""),[d,f]=E.useState(""),[p,h]=E.useState(null),g=E.useCallback(async()=>{r(!0);const k=await ee.getContacts();k.ok&&k.contacts&&t(k.contacts),r(!1)},[]);E.useEffect(()=>{g()},[g]);const m=e.filter(k=>i==="all"||k.status===i),v=async k=>{h(null);const N=await ee.approveContact(k.platform,k.name);h(N.ok?{kind:"ok",text:`โœ… ${k.name} approved.`}:{kind:"err",text:N.error||"Failed."}),g()},y=async k=>{h(null);const N=await ee.rejectContact(k.platform,k.name);h(N.ok?{kind:"ok",text:`๐Ÿšซ ${k.name} rejected.`}:{kind:"err",text:N.error||"Failed."}),g()},b=async k=>{h(null);const N=await ee.deleteContact(k.platform,k.name);h(N.ok?{kind:"ok",text:`๐Ÿ—‘๏ธ ${k.name} deleted.`}:{kind:"err",text:N.error||"Failed."}),g()},x=async()=>{if(!o)return;h(null);const k=await ee.updateContact(o.platform,o.id,{name:c,phone:d});h(k.ok?{kind:"ok",text:`โœ… ${c} updated.`}:{kind:"err",text:k.error||"Failed."}),l(null),g()},_=k=>k==="approved"?s.jsx("span",{className:"contact-status-badge approved",children:"โœ… Approved"}):k==="pending"?s.jsx("span",{className:"contact-status-badge pending",children:"โณ Pending"}):s.jsx("span",{className:"contact-status-badge rejected",children:"๐Ÿšซ Rejected"}),S=k=>({telegram:"โœˆ๏ธ",whatsapp:"๐Ÿ“ฑ",whatsapp_cloud:"๐Ÿ“ฑ",email:"๐Ÿ“ง",slack:"๐Ÿ’ฌ",discord:"๐ŸŽฎ"})[k]||"๐Ÿ”Œ",w=k=>k?new Date(k).toLocaleString():"โ€”";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."})]}),p&&s.jsxs("div",{className:`admin-row-msg ${p.kind==="err"?"admin-row-msg-err":""}`,children:[p.text,s.jsx("button",{className:"admin-mini-btn",onClick:()=>h(null),children:"โœ•"})]}),s.jsxs("div",{className:"contacts-filters",children:[["all","approved","pending","rejected"].map(k=>s.jsx("button",{type:"button",className:i===k?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>a(k),children:k==="all"?`All (${e.length})`:k==="approved"?`โœ… Approved (${e.filter(N=>N.status==="approved").length})`:k==="pending"?`โณ Pending (${e.filter(N=>N.status==="pending").length})`:`๐Ÿšซ Rejected (${e.filter(N=>N.status==="rejected").length})`},k)),s.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void g(),children:"๐Ÿ”„ Refresh"})]}),n?s.jsx("div",{className:"empty-state",children:"Loading contacts..."}):m.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:m.map(k=>s.jsxs("tr",{className:`contact-row status-${k.status}`,children:[s.jsxs("td",{children:[S(k.platform)," ",k.platform]}),s.jsx("td",{className:"contact-name",children:k.name}),s.jsx("td",{className:"contact-id",children:s.jsx("code",{children:k.id})}),s.jsx("td",{className:"contact-phone",children:k.phone||"โ€”"}),s.jsx("td",{children:_(k.status)}),s.jsx("td",{className:"contact-date",children:w(k.registeredAt||k.addedAt)}),s.jsxs("td",{className:"contact-actions",children:[k.status!=="approved"&&s.jsx("button",{className:"admin-mini-btn contact-approve-btn",onClick:()=>void v(k),children:"โœ… Approve"}),k.status!=="rejected"&&s.jsx("button",{className:"admin-mini-btn contact-reject-btn",onClick:()=>void y(k),children:"๐Ÿšซ Reject"}),s.jsx("button",{className:"admin-mini-btn",onClick:()=>{l(k),u(k.name),f(k.phone||"")},children:"โœ๏ธ Edit"}),s.jsx("button",{className:"admin-mini-btn contact-delete-btn",onClick:()=>void b(k),children:"๐Ÿ—‘๏ธ"})]})]},`${k.platform}:${k.id}`))})]})}),o&&s.jsx("div",{className:"wizard-overlay",onClick:()=>l(null),children:s.jsxs("div",{className:"wizard-modal",onClick:k=>k.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:k=>u(k.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:k=>f(k.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 x(),children:"Save"})]})]})]})})]})}function cs(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 Uge(e,t,n){if(e==="unavailable")return"#f85149";if(e==="unverified")return"#d29922";const i=(Date.now()-t)/(24*60*60*1e3);return i>30&&n>.5?"#f85149":i>7?"#d29922":"#3fb950"}function Wge(e,t,n){if(e==="unavailable")return"Unavailable";if(e==="unverified")return"Unverified";const i=(Date.now()-t)/(24*60*60*1e3);return i>30&&n>.5?"Likely Removed":i>7?"Stale":"Fresh"}function Hge({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: ${cs(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: ${cs(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: ${cs(i)}`,children:s.jsx("div",{className:"timeline-bar-fill use",style:{width:`${l}%`}})})]})}function Gge(){const[e,t]=E.useState(null),[n,r]=E.useState(!0),[i,a]=E.useState(null),[o,l]=E.useState("all"),[c,u]=E.useState("provider"),d=E.useRef(!0),f=E.useCallback(async()=>{try{const v=await fetch("/api/model-timeline");if(!v.ok)throw new Error("Failed to fetch timeline data");const y=await v.json();d.current&&(t(y),a(null))}catch(v){d.current&&a(v instanceof Error?v.message:"Failed to load timeline")}finally{d.current&&r(!1)}},[]);if(E.useEffect(()=>{d.current=!0,f();const v=setInterval(f,3e4);return()=>{d.current=!1,clearInterval(v)}},[f]),n)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"๐Ÿ“… Model Discovery Timeline"}),s.jsxs("div",{className:"loading-state",children:[s.jsx("div",{className:"loading-spinner"}),s.jsx("p",{children:"Loading timeline..."})]})]});if(i)return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"๐Ÿ“… Model Discovery Timeline"}),s.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:i})]});const h=((e==null?void 0:e.entries)??[]).filter(v=>{const b=(Date.now()-v.lastProbedAt)/(24*60*60*1e3),x=b>7,_=b>30&&v.errorRate>.5,S=!x&&!_;return o==="fresh"?S:o==="stale"?x&&!_:o==="removed"?_:!0}),g=[...h].sort((v,y)=>{if(c==="provider")return v.provider.localeCompare(y.provider)||v.model.localeCompare(y.model);if(c==="lastProbed")return y.lastProbedAt-v.lastProbedAt;if(c==="status"){const b={unavailable:0,unverified:1,verified:2};return(b[y.status]??0)-(b[v.status]??0)}return 0}),m=new Map;for(const v of g)m.has(v.provider)||m.set(v.provider,[]),m.get(v.provider).push(v);return s.jsxs("div",{className:"admin-header",children:[s.jsx("h2",{className:"section-title",children:"๐Ÿ“… Model Discovery Timeline"}),s.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-value",children:(e==null?void 0:e.totalModels)??0}),s.jsx("div",{className:"stat-label",children:"Total Models"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#3fb950"},children:[s.jsx("div",{className:"stat-value",style:{color:"#3fb950"},children:(e==null?void 0:e.freshCount)??0}),s.jsx("div",{className:"stat-label",children:"Fresh (<7d)"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#d29922"},children:[s.jsx("div",{className:"stat-value",style:{color:"#d29922"},children:(e==null?void 0:e.staleCount)??0}),s.jsx("div",{className:"stat-label",children:"Stale (7-30d)"})]}),s.jsxs("div",{className:"stat-card",style:{borderColor:"#f85149"},children:[s.jsx("div",{className:"stat-value",style:{color:"#f85149"},children:(e==null?void 0:e.removedCount)??0}),s.jsx("div",{className:"stat-label",children:"Likely Removed (>30d)"})]})]}),s.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:[s.jsx("div",{style:{display:"flex",gap:4},children:["all","fresh","stale","removed"].map(v=>s.jsx("button",{className:`admin-refresh-btn ${o===v?"active":""}`,onClick:()=>l(v),style:{background:o===v?"#238636":"#21262d",border:`1px solid ${o===v?"#3fb950":"#30363d"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"},children:v.charAt(0).toUpperCase()+v.slice(1)},v))}),s.jsx("div",{style:{display:"flex",gap:4},children:["provider","lastProbed","status"].map(v=>s.jsxs("button",{className:`admin-refresh-btn ${c===v?"active":""}`,onClick:()=>u(v),style:{background:c===v?"#238636":"#21262d",border:`1px solid ${c===v?"#3fb950":"#30363d"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"},children:["Sort: ",v==="lastProbed"?"Last Seen":v.charAt(0).toUpperCase()+v.slice(1)]},v))}),s.jsx("button",{className:"admin-refresh-btn",onClick:f,style:{background:"#21262d",border:"1px solid #30363d",padding:"4px 12px",fontSize:12,cursor:"pointer"},children:"๐Ÿ”„ Refresh"})]}),s.jsxs("div",{style:{display:"flex",gap:16,marginBottom:12,fontSize:11,color:"#8b949e"},children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:"#58a6ff"},children:"โ– "})," Probe (last seen)"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#3fb950"},children:"โ– "})," Verified (last success)"]}),s.jsxs("span",{children:[s.jsx("span",{style:{color:"#d29922"},children:"โ– "})," Used (last invocation)"]})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from(m.entries()).map(([v,y])=>s.jsxs("div",{style:{background:"#161b22",borderRadius:8,border:"1px solid #30363d",overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{style:{fontSize:16},children:v==="groq"?"โšก":v==="gemini"?"๐ŸŒ€":v==="local"?"๐Ÿ’ป":"๐Ÿค–"}),s.jsx("span",{style:{fontWeight:600,color:"#e6edf3"},children:v}),s.jsxs("span",{style:{fontSize:12,color:"#8b949e"},children:["(",y.length," models)"]})]}),s.jsx("div",{style:{padding:"8px 14px"},children:y.map(b=>{const x=Date.now();(x-b.lastProbedAt)/(24*60*60*1e3);const _=Uge(b.status,b.lastProbedAt,b.errorRate),S=Wge(b.status,b.lastProbedAt,b.errorRate);return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"6px 0",borderBottom:"1px solid #21262d"},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("div",{style:{fontSize:13,color:"#e6edf3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.model}),s.jsxs("div",{style:{fontSize:11,color:"#8b949e",display:"flex",gap:12},children:[s.jsxs("span",{children:["Probed: ",cs(x-b.lastProbedAt)]}),b.lastVerifiedAt>0&&s.jsxs("span",{children:["Verified: ",cs(x-b.lastVerifiedAt)]}),b.lastUsedAt>0&&s.jsxs("span",{children:["Used: ",cs(x-b.lastUsedAt)]}),b.latencyMs!==void 0&&s.jsxs("span",{children:[b.latencyMs,"ms"]})]})]}),s.jsx(Hge,{entry:b}),s.jsx("div",{style:{fontSize:11,padding:"2px 8px",borderRadius:4,background:`${_}20`,color:_,border:`1px solid ${_}40`,whiteSpace:"nowrap"},children:S})]},b.model)})})]},v))}),h.length===0&&s.jsx("div",{style:{textAlign:"center",padding:"40px 20px",color:"#8b949e"},children:"No models match the current filter"})]})}function qge(){const[e,t]=E.useState(null),[n,r]=E.useState(!1),[i,a]=E.useState("--"),o=E.useCallback(c=>{t(c),a(new Date().toLocaleTimeString())},[]),l=E.useCallback(c=>{r(c)},[]);return E.useEffect(()=>{ee.fetchAll().then(d=>{d&&o(d)});const c=ee.subscribe(o),u=ee.onConnectionChange(l);return ee.connect(),()=>{c(),u(),ee.disconnect()}},[o,l]),s.jsx($L,{connected:n,lastUpdated:i,children:s.jsxs(yL,{children:[s.jsx(vt,{path:"/",element:s.jsx(HN,{})}),s.jsx(vt,{path:"/overview",element:s.jsx(pie,{data:e})}),s.jsx(vt,{path:"/chat",element:s.jsx(r1,{to:"/",replace:!0})}),s.jsx(vt,{path:"/dag",element:s.jsx(Sie,{data:e})}),s.jsx(vt,{path:"/costs",element:s.jsx(_ie,{data:e})}),s.jsx(vt,{path:"/benchmarks",element:s.jsx(Nie,{data:e})}),s.jsx(vt,{path:"/models",element:s.jsx(cae,{})}),s.jsx(vt,{path:"/models/timeline",element:s.jsx(Gge,{})}),s.jsx(vt,{path:"/routing",element:s.jsx(Hae,{data:e})}),s.jsx(vt,{path:"/requests",element:s.jsx(Kae,{data:e})}),s.jsx(vt,{path:"/traces",element:s.jsx(noe,{})}),s.jsx(vt,{path:"/hub",element:s.jsx(hoe,{})}),s.jsx(vt,{path:"/tasks",element:s.jsx(yoe,{})}),s.jsx(vt,{path:"/chat",element:s.jsx(HN,{})}),s.jsx(vt,{path:"/evals",element:s.jsx(Ige,{data:e})}),s.jsx(vt,{path:"/platforms",element:s.jsx(Dge,{})}),s.jsx(vt,{path:"/bedrock",element:s.jsx(zge,{canWrite:!0,sessionExpired:c=>console.error(c)})}),s.jsx(vt,{path:"/contacts",element:s.jsx(Fge,{})}),s.jsx(vt,{path:"/gateway",element:s.jsx(Lge,{})}),s.jsx(vt,{path:"/system",element:s.jsx(jie,{data:e})}),s.jsx(vt,{path:"/admin",element:s.jsx(soe,{})}),s.jsx(vt,{path:"*",element:s.jsx(r1,{to:"/",replace:!0})})]})})}aT(document.getElementById("root")).render(s.jsx(E.StrictMode,{children:s.jsx(EL,{children:s.jsx(qge,{})})}));
207
- //# sourceMappingURL=index-CXWJHhWs.js.map