siclaw 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agentbox/gateway-client.d.ts +4 -0
- package/dist/agentbox/gateway-client.js +9 -1
- package/dist/agentbox/gateway-client.js.map +1 -1
- package/dist/agentbox/http-server.js +25 -1
- package/dist/agentbox/http-server.js.map +1 -1
- package/dist/agentbox/session.d.ts +2 -0
- package/dist/agentbox/session.js +11 -7
- package/dist/agentbox/session.js.map +1 -1
- package/dist/agentbox-main.js +10 -0
- package/dist/agentbox-main.js.map +1 -1
- package/dist/cli-main.js +19 -3
- package/dist/cli-main.js.map +1 -1
- package/dist/core/agent-factory.d.ts +2 -0
- package/dist/core/agent-factory.js +87 -21
- package/dist/core/agent-factory.js.map +1 -1
- package/dist/core/compaction.d.ts +80 -0
- package/dist/core/compaction.js +442 -0
- package/dist/core/compaction.js.map +1 -0
- package/dist/core/config.d.ts +7 -0
- package/dist/core/config.js +27 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/extensions/compaction-safeguard.d.ts +2 -0
- package/dist/core/extensions/compaction-safeguard.js +681 -0
- package/dist/core/extensions/compaction-safeguard.js.map +1 -0
- package/dist/core/extensions/deep-investigation.js +47 -73
- package/dist/core/extensions/deep-investigation.js.map +1 -1
- package/dist/core/extensions/memory-flush.d.ts +2 -10
- package/dist/core/extensions/memory-flush.js +4 -86
- package/dist/core/extensions/memory-flush.js.map +1 -1
- package/dist/core/llm-proxy.js +25 -6
- package/dist/core/llm-proxy.js.map +1 -1
- package/dist/core/message-utils.d.ts +18 -0
- package/dist/core/message-utils.js +28 -0
- package/dist/core/message-utils.js.map +1 -0
- package/dist/core/prompt.js +4 -5
- package/dist/core/prompt.js.map +1 -1
- package/dist/core/session-tool-result-guard.d.ts +2 -0
- package/dist/core/session-tool-result-guard.js +159 -0
- package/dist/core/session-tool-result-guard.js.map +1 -0
- package/dist/core/stream-wrappers.d.ts +41 -0
- package/dist/core/stream-wrappers.js +369 -0
- package/dist/core/stream-wrappers.js.map +1 -0
- package/dist/core/thinking-blocks.d.ts +20 -0
- package/dist/core/thinking-blocks.js +45 -0
- package/dist/core/thinking-blocks.js.map +1 -0
- package/dist/core/tool-call-id.d.ts +22 -0
- package/dist/core/tool-call-id.js +226 -0
- package/dist/core/tool-call-id.js.map +1 -0
- package/dist/core/tool-call-repair.d.ts +18 -0
- package/dist/core/tool-call-repair.js +73 -0
- package/dist/core/tool-call-repair.js.map +1 -0
- package/dist/core/tool-result-context-guard.d.ts +36 -0
- package/dist/core/tool-result-context-guard.js +272 -0
- package/dist/core/tool-result-context-guard.js.map +1 -0
- package/dist/cron/cron-limits.d.ts +16 -0
- package/dist/cron/cron-limits.js +17 -0
- package/dist/cron/cron-limits.js.map +1 -0
- package/dist/cron/cron-matcher.d.ts +14 -0
- package/dist/cron/cron-matcher.js +29 -0
- package/dist/cron/cron-matcher.js.map +1 -1
- package/dist/gateway/agentbox/client.d.ts +0 -2
- package/dist/gateway/agentbox/client.js.map +1 -1
- package/dist/gateway/agentbox/k8s-spawner.d.ts +10 -10
- package/dist/gateway/agentbox/k8s-spawner.js +27 -55
- package/dist/gateway/agentbox/k8s-spawner.js.map +1 -1
- package/dist/gateway/agentbox/local-spawner.d.ts +5 -0
- package/dist/gateway/agentbox/local-spawner.js +10 -0
- package/dist/gateway/agentbox/local-spawner.js.map +1 -1
- package/dist/gateway/cron/cron-service.js +7 -0
- package/dist/gateway/cron/cron-service.js.map +1 -1
- package/dist/gateway/db/index.js +9 -1
- package/dist/gateway/db/index.js.map +1 -1
- package/dist/gateway/db/init-schema.js +65 -16
- package/dist/gateway/db/init-schema.js.map +1 -1
- package/dist/gateway/db/migrate-sqlite.js +73 -20
- package/dist/gateway/db/migrate-sqlite.js.map +1 -1
- package/dist/gateway/db/repositories/cluster-repo.d.ts +59 -0
- package/dist/gateway/db/repositories/cluster-repo.js +107 -0
- package/dist/gateway/db/repositories/cluster-repo.js.map +1 -0
- package/dist/gateway/db/repositories/config-repo.d.ts +4 -5
- package/dist/gateway/db/repositories/config-repo.js +17 -0
- package/dist/gateway/db/repositories/config-repo.js.map +1 -1
- package/dist/gateway/db/repositories/feedback-repo.d.ts +71 -0
- package/dist/gateway/db/repositories/feedback-repo.js +52 -0
- package/dist/gateway/db/repositories/feedback-repo.js.map +1 -0
- package/dist/gateway/db/repositories/knowledge-doc-repo.d.ts +37 -0
- package/dist/gateway/db/repositories/knowledge-doc-repo.js +48 -0
- package/dist/gateway/db/repositories/knowledge-doc-repo.js.map +1 -0
- package/dist/gateway/db/repositories/user-cluster-config-repo.d.ts +45 -0
- package/dist/gateway/db/repositories/user-cluster-config-repo.js +90 -0
- package/dist/gateway/db/repositories/user-cluster-config-repo.js.map +1 -0
- package/dist/gateway/db/repositories/workspace-repo.d.ts +2 -2
- package/dist/gateway/db/repositories/workspace-repo.js +12 -12
- package/dist/gateway/db/repositories/workspace-repo.js.map +1 -1
- package/dist/gateway/db/schema-mysql.d.ts +437 -44
- package/dist/gateway/db/schema-mysql.js +36 -9
- package/dist/gateway/db/schema-mysql.js.map +1 -1
- package/dist/gateway/db/schema-sqlite.d.ts +459 -46
- package/dist/gateway/db/schema-sqlite.js +36 -9
- package/dist/gateway/db/schema-sqlite.js.map +1 -1
- package/dist/gateway/db/schema.d.ts +435 -44
- package/dist/gateway/db/schema.js +1 -1
- package/dist/gateway/db/schema.js.map +1 -1
- package/dist/gateway/plugins/channel-bridge.js +1 -1
- package/dist/gateway/plugins/channel-bridge.js.map +1 -1
- package/dist/gateway/rpc-methods.d.ts +2 -1
- package/dist/gateway/rpc-methods.js +507 -172
- package/dist/gateway/rpc-methods.js.map +1 -1
- package/dist/gateway/server.js +191 -51
- package/dist/gateway/server.js.map +1 -1
- package/dist/gateway/web/dist/assets/index-DTD0P9j8.css +1 -0
- package/dist/gateway/web/dist/assets/index-DhqsS2E0.js +756 -0
- package/dist/gateway/web/dist/assets/index-DhqsS2E0.js.map +1 -0
- package/dist/gateway/web/dist/index.html +2 -2
- package/dist/gateway-main.js +1 -3
- package/dist/gateway-main.js.map +1 -1
- package/dist/memory/indexer.d.ts +13 -0
- package/dist/memory/indexer.js +91 -1
- package/dist/memory/indexer.js.map +1 -1
- package/dist/memory/knowledge-extractor.d.ts +47 -0
- package/dist/memory/knowledge-extractor.js +165 -0
- package/dist/memory/knowledge-extractor.js.map +1 -0
- package/dist/memory/overview-generator.d.ts +16 -0
- package/dist/memory/overview-generator.js +233 -0
- package/dist/memory/overview-generator.js.map +1 -0
- package/dist/memory/session-summarizer.d.ts +28 -0
- package/dist/memory/session-summarizer.js +20 -2
- package/dist/memory/session-summarizer.js.map +1 -1
- package/dist/memory/temporal-decay.js +2 -2
- package/dist/memory/temporal-decay.js.map +1 -1
- package/dist/memory/topic-consolidator.d.ts +52 -0
- package/dist/memory/topic-consolidator.js +197 -0
- package/dist/memory/topic-consolidator.js.map +1 -0
- package/dist/tools/cluster-info.d.ts +9 -0
- package/dist/tools/cluster-info.js +74 -0
- package/dist/tools/cluster-info.js.map +1 -0
- package/dist/tools/command-sets.js +15 -5
- package/dist/tools/command-sets.js.map +1 -1
- package/dist/tools/create-skill.js +1 -1
- package/dist/tools/create-skill.js.map +1 -1
- package/dist/tools/debug-pod.d.ts +217 -0
- package/dist/tools/debug-pod.js +603 -0
- package/dist/tools/debug-pod.js.map +1 -0
- package/dist/tools/deep-search/engine.d.ts +0 -5
- package/dist/tools/deep-search/engine.js +68 -28
- package/dist/tools/deep-search/engine.js.map +1 -1
- package/dist/tools/deep-search/format.d.ts +1 -1
- package/dist/tools/deep-search/format.js +1 -2
- package/dist/tools/deep-search/format.js.map +1 -1
- package/dist/tools/deep-search/prompts.d.ts +4 -1
- package/dist/tools/deep-search/prompts.js +47 -29
- package/dist/tools/deep-search/prompts.js.map +1 -1
- package/dist/tools/deep-search/quality-gate.d.ts +25 -0
- package/dist/tools/deep-search/quality-gate.js +81 -0
- package/dist/tools/deep-search/quality-gate.js.map +1 -0
- package/dist/tools/deep-search/schemas.d.ts +25 -0
- package/dist/tools/deep-search/schemas.js +26 -1
- package/dist/tools/deep-search/schemas.js.map +1 -1
- package/dist/tools/deep-search/sre-knowledge.d.ts +6 -10
- package/dist/tools/deep-search/sre-knowledge.js +21 -52
- package/dist/tools/deep-search/sre-knowledge.js.map +1 -1
- package/dist/tools/deep-search/sub-agent.js +24 -8
- package/dist/tools/deep-search/sub-agent.js.map +1 -1
- package/dist/tools/deep-search/tool.js +3 -6
- package/dist/tools/deep-search/tool.js.map +1 -1
- package/dist/tools/deep-search/types.d.ts +13 -0
- package/dist/tools/deep-search/types.js +4 -4
- package/dist/tools/deep-search/types.js.map +1 -1
- package/dist/tools/dp-tools.d.ts +9 -6
- package/dist/tools/dp-tools.js +26 -55
- package/dist/tools/dp-tools.js.map +1 -1
- package/dist/tools/exec-utils.d.ts +8 -21
- package/dist/tools/exec-utils.js +11 -95
- package/dist/tools/exec-utils.js.map +1 -1
- package/dist/tools/fork-skill.js +1 -1
- package/dist/tools/fork-skill.js.map +1 -1
- package/dist/tools/k8s-checks.d.ts +11 -5
- package/dist/tools/k8s-checks.js +28 -9
- package/dist/tools/k8s-checks.js.map +1 -1
- package/dist/tools/knowledge-search.d.ts +3 -0
- package/dist/tools/knowledge-search.js +115 -0
- package/dist/tools/knowledge-search.js.map +1 -0
- package/dist/tools/kubeconfig-resolver.d.ts +22 -0
- package/dist/tools/kubeconfig-resolver.js +98 -18
- package/dist/tools/kubeconfig-resolver.js.map +1 -1
- package/dist/tools/manage-schedule.js +23 -1
- package/dist/tools/manage-schedule.js.map +1 -1
- package/dist/tools/netns-script.d.ts +1 -1
- package/dist/tools/netns-script.js +19 -7
- package/dist/tools/netns-script.js.map +1 -1
- package/dist/tools/node-exec.d.ts +1 -1
- package/dist/tools/node-exec.js +19 -7
- package/dist/tools/node-exec.js.map +1 -1
- package/dist/tools/node-script.d.ts +1 -1
- package/dist/tools/node-script.js +19 -7
- package/dist/tools/node-script.js.map +1 -1
- package/dist/tools/pod-exec.js +12 -1
- package/dist/tools/pod-exec.js.map +1 -1
- package/dist/tools/pod-nsenter-exec.d.ts +1 -1
- package/dist/tools/pod-nsenter-exec.js +19 -7
- package/dist/tools/pod-nsenter-exec.js.map +1 -1
- package/dist/tools/pod-script.js +12 -1
- package/dist/tools/pod-script.js.map +1 -1
- package/dist/tools/restricted-bash.js +10 -3
- package/dist/tools/restricted-bash.js.map +1 -1
- package/dist/tools/run-skill.js +14 -2
- package/dist/tools/run-skill.js.map +1 -1
- package/dist/tools/save-feedback.d.ts +7 -0
- package/dist/tools/save-feedback.js +125 -0
- package/dist/tools/save-feedback.js.map +1 -0
- package/dist/tools/update-skill.js +1 -1
- package/dist/tools/update-skill.js.map +1 -1
- package/package.json +1 -1
- package/skills/core/deep-investigation/SKILL.md +11 -14
- package/skills/core/session-feedback/SKILL.md +146 -0
|
@@ -0,0 +1,756 @@
|
|
|
1
|
+
var A6=Object.defineProperty;var T6=(e,t,n)=>t in e?A6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Bg=(e,t,n)=>T6(e,typeof t!="symbol"?t+"":t,n);function pA(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 s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).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 Ln=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mA={exports:{}},sm={},gA={exports:{}},Ge={};/**
|
|
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 md=Symbol.for("react.element"),O6=Symbol.for("react.portal"),_6=Symbol.for("react.fragment"),D6=Symbol.for("react.strict_mode"),M6=Symbol.for("react.profiler"),I6=Symbol.for("react.provider"),L6=Symbol.for("react.context"),R6=Symbol.for("react.forward_ref"),F6=Symbol.for("react.suspense"),z6=Symbol.for("react.memo"),$6=Symbol.for("react.lazy"),mk=Symbol.iterator;function B6(e){return e===null||typeof e!="object"?null:(e=mk&&e[mk]||e["@@iterator"],typeof e=="function"?e:null)}var yA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xA=Object.assign,vA={};function ql(e,t,n){this.props=e,this.context=t,this.refs=vA,this.updater=n||yA}ql.prototype.isReactComponent={};ql.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")};ql.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function bA(){}bA.prototype=ql.prototype;function ab(e,t,n){this.props=e,this.context=t,this.refs=vA,this.updater=n||yA}var sb=ab.prototype=new bA;sb.constructor=ab;xA(sb,ql.prototype);sb.isPureReactComponent=!0;var gk=Array.isArray,wA=Object.prototype.hasOwnProperty,ob={current:null},SA={key:!0,ref:!0,__self:!0,__source:!0};function kA(e,t,n){var r,i={},a=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(a=""+t.key),t)wA.call(t,r)&&!SA.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:md,type:e,key:a,ref:s,props:i,_owner:ob.current}}function U6(e,t){return{$$typeof:md,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function lb(e){return typeof e=="object"&&e!==null&&e.$$typeof===md}function V6(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var yk=/\/+/g;function Ug(e,t){return typeof e=="object"&&e!==null&&e.key!=null?V6(""+e.key):t.toString(36)}function Qf(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case md:case O6:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Ug(s,0):r,gk(i)?(n="",e!=null&&(n=e.replace(yk,"$&/")+"/"),Qf(i,t,n,"",function(u){return u})):i!=null&&(lb(i)&&(i=U6(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(yk,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",gk(e))for(var o=0;o<e.length;o++){a=e[o];var c=r+Ug(a,o);s+=Qf(a,t,n,c,i)}else if(c=B6(e),typeof c=="function")for(e=c.call(e),o=0;!(a=e.next()).done;)a=a.value,c=r+Ug(a,o++),s+=Qf(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 s}function nf(e,t,n){if(e==null)return e;var r=[],i=0;return Qf(e,r,"","",function(a){return t.call(n,a,i++)}),r}function W6(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 Gn={current:null},Jf={transition:null},H6={ReactCurrentDispatcher:Gn,ReactCurrentBatchConfig:Jf,ReactCurrentOwner:ob};function jA(){throw Error("act(...) is not supported in production builds of React.")}Ge.Children={map:nf,forEach:function(e,t,n){nf(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return nf(e,function(){t++}),t},toArray:function(e){return nf(e,function(t){return t})||[]},only:function(e){if(!lb(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ge.Component=ql;Ge.Fragment=_6;Ge.Profiler=M6;Ge.PureComponent=ab;Ge.StrictMode=D6;Ge.Suspense=F6;Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H6;Ge.act=jA;Ge.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=xA({},e.props),i=e.key,a=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,s=ob.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)wA.call(t,c)&&!SA.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:md,type:e.type,key:i,ref:a,props:r,_owner:s}};Ge.createContext=function(e){return e={$$typeof:L6,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:I6,_context:e},e.Consumer=e};Ge.createElement=kA;Ge.createFactory=function(e){var t=kA.bind(null,e);return t.type=e,t};Ge.createRef=function(){return{current:null}};Ge.forwardRef=function(e){return{$$typeof:R6,render:e}};Ge.isValidElement=lb;Ge.lazy=function(e){return{$$typeof:$6,_payload:{_status:-1,_result:e},_init:W6}};Ge.memo=function(e,t){return{$$typeof:z6,type:e,compare:t===void 0?null:t}};Ge.startTransition=function(e){var t=Jf.transition;Jf.transition={};try{e()}finally{Jf.transition=t}};Ge.unstable_act=jA;Ge.useCallback=function(e,t){return Gn.current.useCallback(e,t)};Ge.useContext=function(e){return Gn.current.useContext(e)};Ge.useDebugValue=function(){};Ge.useDeferredValue=function(e){return Gn.current.useDeferredValue(e)};Ge.useEffect=function(e,t){return Gn.current.useEffect(e,t)};Ge.useId=function(){return Gn.current.useId()};Ge.useImperativeHandle=function(e,t,n){return Gn.current.useImperativeHandle(e,t,n)};Ge.useInsertionEffect=function(e,t){return Gn.current.useInsertionEffect(e,t)};Ge.useLayoutEffect=function(e,t){return Gn.current.useLayoutEffect(e,t)};Ge.useMemo=function(e,t){return Gn.current.useMemo(e,t)};Ge.useReducer=function(e,t,n){return Gn.current.useReducer(e,t,n)};Ge.useRef=function(e){return Gn.current.useRef(e)};Ge.useState=function(e){return Gn.current.useState(e)};Ge.useSyncExternalStore=function(e,t,n){return Gn.current.useSyncExternalStore(e,t,n)};Ge.useTransition=function(){return Gn.current.useTransition()};Ge.version="18.3.1";gA.exports=Ge;var m=gA.exports;const K6=fi(m),NA=pA({__proto__:null,default:K6},[m]);/**
|
|
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 q6=m,G6=Symbol.for("react.element"),Y6=Symbol.for("react.fragment"),X6=Object.prototype.hasOwnProperty,Z6=q6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Q6={key:!0,ref:!0,__self:!0,__source:!0};function CA(e,t,n){var r,i={},a=null,s=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)X6.call(t,r)&&!Q6.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:G6,type:e,key:a,ref:s,props:i,_owner:Z6.current}}sm.Fragment=Y6;sm.jsx=CA;sm.jsxs=CA;mA.exports=sm;var l=mA.exports,Ey={},PA={exports:{}},Nr={},EA={exports:{}},AA={};/**
|
|
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(I,H){var O=I.length;I.push(H);e:for(;0<O;){var oe=O-1>>>1,re=I[oe];if(0<i(re,H))I[oe]=H,I[O]=re,O=oe;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var H=I[0],O=I.pop();if(O!==H){I[0]=O;e:for(var oe=0,re=I.length,D=re>>>1;oe<D;){var G=2*(oe+1)-1,te=I[G],ee=G+1,Z=I[ee];if(0>i(te,O))ee<re&&0>i(Z,te)?(I[oe]=Z,I[ee]=O,oe=ee):(I[oe]=te,I[G]=O,oe=G);else if(ee<re&&0>i(Z,O))I[oe]=Z,I[ee]=O,oe=ee;else break e}}return H}function i(I,H){var O=I.sortIndex-H.sortIndex;return O!==0?O:I.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var c=[],u=[],d=1,f=null,h=3,p=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(I){for(var H=n(u);H!==null;){if(H.callback===null)r(u);else if(H.startTime<=I)r(u),H.sortIndex=H.expirationTime,t(c,H);else break;H=n(u)}}function S(I){if(y=!1,w(I),!g)if(n(c)!==null)g=!0,ae(k);else{var H=n(u);H!==null&&Q(S,H.startTime-I)}}function k(I,H){g=!1,y&&(y=!1,v(P),P=-1),p=!0;var O=h;try{for(w(H),f=n(c);f!==null&&(!(f.expirationTime>H)||I&&!_());){var oe=f.callback;if(typeof oe=="function"){f.callback=null,h=f.priorityLevel;var re=oe(f.expirationTime<=H);H=e.unstable_now(),typeof re=="function"?f.callback=re:f===n(c)&&r(c),w(H)}else r(c);f=n(c)}if(f!==null)var D=!0;else{var G=n(u);G!==null&&Q(S,G.startTime-H),D=!1}return D}finally{f=null,h=O,p=!1}}var j=!1,N=null,P=-1,T=5,E=-1;function _(){return!(e.unstable_now()-E<T)}function C(){if(N!==null){var I=e.unstable_now();E=I;var H=!0;try{H=N(!0,I)}finally{H?A():(j=!1,N=null)}}else j=!1}var A;if(typeof b=="function")A=function(){b(C)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,B=M.port2;M.port1.onmessage=C,A=function(){B.postMessage(null)}}else A=function(){x(C,0)};function ae(I){N=I,j||(j=!0,A())}function Q(I,H){P=x(function(){I(e.unstable_now())},H)}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(I){I.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,ae(k))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(I){switch(h){case 1:case 2:case 3:var H=3;break;default:H=h}var O=h;h=H;try{return I()}finally{h=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,H){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var O=h;h=I;try{return H()}finally{h=O}},e.unstable_scheduleCallback=function(I,H,O){var oe=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?oe+O:oe):O=oe,I){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=O+re,I={id:d++,callback:H,priorityLevel:I,startTime:O,expirationTime:re,sortIndex:-1},O>oe?(I.sortIndex=O,t(u,I),n(c)===null&&I===n(u)&&(y?(v(P),P=-1):y=!0,Q(S,O-oe))):(I.sortIndex=re,t(c,I),g||p||(g=!0,ae(k))),I},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(I){var H=h;return function(){var O=h;h=H;try{return I.apply(this,arguments)}finally{h=O}}}})(AA);EA.exports=AA;var J6=EA.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 eF=m,vr=J6;function ge(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 TA=new Set,wu={};function jo(e,t){Nl(e,t),Nl(e+"Capture",t)}function Nl(e,t){for(wu[e]=t,e=0;e<t.length;e++)TA.add(t[e])}var sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ay=Object.prototype.hasOwnProperty,tF=/^[: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]*$/,xk={},vk={};function nF(e){return Ay.call(vk,e)?!0:Ay.call(xk,e)?!1:tF.test(e)?vk[e]=!0:(xk[e]=!0,!1)}function rF(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 iF(e,t,n,r){if(t===null||typeof t>"u"||rF(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 Yn(e,t,n,r,i,a,s){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=s}var kn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kn[e]=new Yn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kn[t]=new Yn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kn[e]=new Yn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kn[e]=new Yn(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){kn[e]=new Yn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kn[e]=new Yn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kn[e]=new Yn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kn[e]=new Yn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kn[e]=new Yn(e,5,!1,e.toLowerCase(),null,!1,!1)});var cb=/[\-:]([a-z])/g;function ub(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(cb,ub);kn[t]=new Yn(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(cb,ub);kn[t]=new Yn(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(cb,ub);kn[t]=new Yn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kn[e]=new Yn(e,1,!1,e.toLowerCase(),null,!1,!1)});kn.xlinkHref=new Yn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kn[e]=new Yn(e,1,!1,e.toLowerCase(),null,!0,!0)});function db(e,t,n,r){var i=kn.hasOwnProperty(t)?kn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(iF(t,n,i,r)&&(n=null),r||i===null?nF(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 ya=eF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,rf=Symbol.for("react.element"),Go=Symbol.for("react.portal"),Yo=Symbol.for("react.fragment"),fb=Symbol.for("react.strict_mode"),Ty=Symbol.for("react.profiler"),OA=Symbol.for("react.provider"),_A=Symbol.for("react.context"),hb=Symbol.for("react.forward_ref"),Oy=Symbol.for("react.suspense"),_y=Symbol.for("react.suspense_list"),pb=Symbol.for("react.memo"),Fa=Symbol.for("react.lazy"),DA=Symbol.for("react.offscreen"),bk=Symbol.iterator;function yc(e){return e===null||typeof e!="object"?null:(e=bk&&e[bk]||e["@@iterator"],typeof e=="function"?e:null)}var Lt=Object.assign,Vg;function Kc(e){if(Vg===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Vg=t&&t[1]||""}return`
|
|
34
|
+
`+Vg+e}var Wg=!1;function Hg(e,t){if(!e||Wg)return"";Wg=!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
|
+
`),s=i.length-1,o=a.length-1;1<=s&&0<=o&&i[s]!==a[o];)o--;for(;1<=s&&0<=o;s--,o--)if(i[s]!==a[o]){if(s!==1||o!==1)do if(s--,o--,0>o||i[s]!==a[o]){var c=`
|
|
37
|
+
`+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=o);break}}}finally{Wg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Kc(e):""}function aF(e){switch(e.tag){case 5:return Kc(e.type);case 16:return Kc("Lazy");case 13:return Kc("Suspense");case 19:return Kc("SuspenseList");case 0:case 2:case 15:return e=Hg(e.type,!1),e;case 11:return e=Hg(e.type.render,!1),e;case 1:return e=Hg(e.type,!0),e;default:return""}}function Dy(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 Yo:return"Fragment";case Go:return"Portal";case Ty:return"Profiler";case fb:return"StrictMode";case Oy:return"Suspense";case _y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _A:return(e.displayName||"Context")+".Consumer";case OA:return(e._context.displayName||"Context")+".Provider";case hb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pb:return t=e.displayName||null,t!==null?t:Dy(e.type)||"Memo";case Fa:t=e._payload,e=e._init;try{return Dy(e(t))}catch{}}return null}function sF(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 Dy(t);case 8:return t===fb?"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 os(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function MA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oF(e){var t=MA(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(s){r=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function af(e){e._valueTracker||(e._valueTracker=oF(e))}function IA(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=MA(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Nh(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 My(e,t){var n=t.checked;return Lt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function wk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=os(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 LA(e,t){t=t.checked,t!=null&&db(e,"checked",t,!1)}function Iy(e,t){LA(e,t);var n=os(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")?Ly(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ly(e,t.type,os(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sk(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 Ly(e,t,n){(t!=="number"||Nh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qc=Array.isArray;function pl(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=""+os(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 Ry(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ge(91));return Lt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function kk(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ge(92));if(qc(n)){if(1<n.length)throw Error(ge(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:os(n)}}function RA(e,t){var n=os(t.value),r=os(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 jk(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function FA(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 Fy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?FA(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var sf,zA=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(sf=sf||document.createElement("div"),sf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=sf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Su(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ru={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},lF=["Webkit","ms","Moz","O"];Object.keys(ru).forEach(function(e){lF.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ru[t]=ru[e]})});function $A(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ru.hasOwnProperty(e)&&ru[e]?(""+t).trim():t+"px"}function BA(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=$A(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var cF=Lt({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 zy(e,t){if(t){if(cF[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ge(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ge(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ge(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ge(62))}}function $y(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 By=null;function mb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Uy=null,ml=null,gl=null;function Nk(e){if(e=xd(e)){if(typeof Uy!="function")throw Error(ge(280));var t=e.stateNode;t&&(t=dm(t),Uy(e.stateNode,e.type,t))}}function UA(e){ml?gl?gl.push(e):gl=[e]:ml=e}function VA(){if(ml){var e=ml,t=gl;if(gl=ml=null,Nk(e),t)for(e=0;e<t.length;e++)Nk(t[e])}}function WA(e,t){return e(t)}function HA(){}var Kg=!1;function KA(e,t,n){if(Kg)return e(t,n);Kg=!0;try{return WA(e,t,n)}finally{Kg=!1,(ml!==null||gl!==null)&&(HA(),VA())}}function ku(e,t){var n=e.stateNode;if(n===null)return null;var r=dm(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(ge(231,t,typeof n));return n}var Vy=!1;if(sa)try{var xc={};Object.defineProperty(xc,"passive",{get:function(){Vy=!0}}),window.addEventListener("test",xc,xc),window.removeEventListener("test",xc,xc)}catch{Vy=!1}function uF(e,t,n,r,i,a,s,o,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var iu=!1,Ch=null,Ph=!1,Wy=null,dF={onError:function(e){iu=!0,Ch=e}};function fF(e,t,n,r,i,a,s,o,c){iu=!1,Ch=null,uF.apply(dF,arguments)}function hF(e,t,n,r,i,a,s,o,c){if(fF.apply(this,arguments),iu){if(iu){var u=Ch;iu=!1,Ch=null}else throw Error(ge(198));Ph||(Ph=!0,Wy=u)}}function No(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 qA(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 Ck(e){if(No(e)!==e)throw Error(ge(188))}function pF(e){var t=e.alternate;if(!t){if(t=No(e),t===null)throw Error(ge(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 Ck(i),e;if(a===r)return Ck(i),t;a=a.sibling}throw Error(ge(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,o=i.child;o;){if(o===n){s=!0,n=i,r=a;break}if(o===r){s=!0,r=i,n=a;break}o=o.sibling}if(!s){for(o=a.child;o;){if(o===n){s=!0,n=a,r=i;break}if(o===r){s=!0,r=a,n=i;break}o=o.sibling}if(!s)throw Error(ge(189))}}if(n.alternate!==r)throw Error(ge(190))}if(n.tag!==3)throw Error(ge(188));return n.stateNode.current===n?e:t}function GA(e){return e=pF(e),e!==null?YA(e):null}function YA(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=YA(e);if(t!==null)return t;e=e.sibling}return null}var XA=vr.unstable_scheduleCallback,Pk=vr.unstable_cancelCallback,mF=vr.unstable_shouldYield,gF=vr.unstable_requestPaint,Ht=vr.unstable_now,yF=vr.unstable_getCurrentPriorityLevel,gb=vr.unstable_ImmediatePriority,ZA=vr.unstable_UserBlockingPriority,Eh=vr.unstable_NormalPriority,xF=vr.unstable_LowPriority,QA=vr.unstable_IdlePriority,om=null,Pi=null;function vF(e){if(Pi&&typeof Pi.onCommitFiberRoot=="function")try{Pi.onCommitFiberRoot(om,e,void 0,(e.current.flags&128)===128)}catch{}}var ri=Math.clz32?Math.clz32:SF,bF=Math.log,wF=Math.LN2;function SF(e){return e>>>=0,e===0?32:31-(bF(e)/wF|0)|0}var of=64,lf=4194304;function Gc(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 Ah(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,s=n&268435455;if(s!==0){var o=s&~i;o!==0?r=Gc(o):(a&=s,a!==0&&(r=Gc(a)))}else s=n&~i,s!==0?r=Gc(s):a!==0&&(r=Gc(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-ri(t),i=1<<n,r|=e[n],t&=~i;return r}function kF(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 jF(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-ri(a),o=1<<s,c=i[s];c===-1?(!(o&n)||o&r)&&(i[s]=kF(o,t)):c<=t&&(e.expiredLanes|=o),a&=~o}}function Hy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function JA(){var e=of;return of<<=1,!(of&4194240)&&(of=64),e}function qg(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ri(t),e[t]=n}function NF(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-ri(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function yb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ri(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var lt=0;function eT(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var tT,xb,nT,rT,iT,Ky=!1,cf=[],Xa=null,Za=null,Qa=null,ju=new Map,Nu=new Map,Ua=[],CF="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 Ek(e,t){switch(e){case"focusin":case"focusout":Xa=null;break;case"dragenter":case"dragleave":Za=null;break;case"mouseover":case"mouseout":Qa=null;break;case"pointerover":case"pointerout":ju.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nu.delete(t.pointerId)}}function vc(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=xd(t),t!==null&&xb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function PF(e,t,n,r,i){switch(t){case"focusin":return Xa=vc(Xa,e,t,n,r,i),!0;case"dragenter":return Za=vc(Za,e,t,n,r,i),!0;case"mouseover":return Qa=vc(Qa,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return ju.set(a,vc(ju.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Nu.set(a,vc(Nu.get(a)||null,e,t,n,r,i)),!0}return!1}function aT(e){var t=Vs(e.target);if(t!==null){var n=No(t);if(n!==null){if(t=n.tag,t===13){if(t=qA(n),t!==null){e.blockedOn=t,iT(e.priority,function(){nT(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 eh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=qy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);By=r,n.target.dispatchEvent(r),By=null}else return t=xd(n),t!==null&&xb(t),e.blockedOn=n,!1;t.shift()}return!0}function Ak(e,t,n){eh(e)&&n.delete(t)}function EF(){Ky=!1,Xa!==null&&eh(Xa)&&(Xa=null),Za!==null&&eh(Za)&&(Za=null),Qa!==null&&eh(Qa)&&(Qa=null),ju.forEach(Ak),Nu.forEach(Ak)}function bc(e,t){e.blockedOn===t&&(e.blockedOn=null,Ky||(Ky=!0,vr.unstable_scheduleCallback(vr.unstable_NormalPriority,EF)))}function Cu(e){function t(i){return bc(i,e)}if(0<cf.length){bc(cf[0],e);for(var n=1;n<cf.length;n++){var r=cf[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Xa!==null&&bc(Xa,e),Za!==null&&bc(Za,e),Qa!==null&&bc(Qa,e),ju.forEach(t),Nu.forEach(t),n=0;n<Ua.length;n++)r=Ua[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ua.length&&(n=Ua[0],n.blockedOn===null);)aT(n),n.blockedOn===null&&Ua.shift()}var yl=ya.ReactCurrentBatchConfig,Th=!0;function AF(e,t,n,r){var i=lt,a=yl.transition;yl.transition=null;try{lt=1,vb(e,t,n,r)}finally{lt=i,yl.transition=a}}function TF(e,t,n,r){var i=lt,a=yl.transition;yl.transition=null;try{lt=4,vb(e,t,n,r)}finally{lt=i,yl.transition=a}}function vb(e,t,n,r){if(Th){var i=qy(e,t,n,r);if(i===null)r0(e,t,r,Oh,n),Ek(e,r);else if(PF(i,e,t,n,r))r.stopPropagation();else if(Ek(e,r),t&4&&-1<CF.indexOf(e)){for(;i!==null;){var a=xd(i);if(a!==null&&tT(a),a=qy(e,t,n,r),a===null&&r0(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else r0(e,t,r,null,n)}}var Oh=null;function qy(e,t,n,r){if(Oh=null,e=mb(r),e=Vs(e),e!==null)if(t=No(e),t===null)e=null;else if(n=t.tag,n===13){if(e=qA(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 Oh=e,null}function sT(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(yF()){case gb:return 1;case ZA:return 4;case Eh:case xF:return 16;case QA:return 536870912;default:return 16}default:return 16}}var Ha=null,bb=null,th=null;function oT(){if(th)return th;var e,t=bb,n=t.length,r,i="value"in Ha?Ha.value:Ha.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[a-r];r++);return th=i.slice(e,1<r?1-r:void 0)}function nh(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 uf(){return!0}function Tk(){return!1}function Cr(e){function t(n,r,i,a,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?uf:Tk,this.isPropagationStopped=Tk,this}return Lt(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=uf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=uf)},persist:function(){},isPersistent:uf}),t}var Gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wb=Cr(Gl),yd=Lt({},Gl,{view:0,detail:0}),OF=Cr(yd),Gg,Yg,wc,lm=Lt({},yd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sb,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!==wc&&(wc&&e.type==="mousemove"?(Gg=e.screenX-wc.screenX,Yg=e.screenY-wc.screenY):Yg=Gg=0,wc=e),Gg)},movementY:function(e){return"movementY"in e?e.movementY:Yg}}),Ok=Cr(lm),_F=Lt({},lm,{dataTransfer:0}),DF=Cr(_F),MF=Lt({},yd,{relatedTarget:0}),Xg=Cr(MF),IF=Lt({},Gl,{animationName:0,elapsedTime:0,pseudoElement:0}),LF=Cr(IF),RF=Lt({},Gl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),FF=Cr(RF),zF=Lt({},Gl,{data:0}),_k=Cr(zF),$F={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BF={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"},UF={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VF(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=UF[e])?!!t[e]:!1}function Sb(){return VF}var WF=Lt({},yd,{key:function(e){if(e.key){var t=$F[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=nh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?BF[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sb,charCode:function(e){return e.type==="keypress"?nh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),HF=Cr(WF),KF=Lt({},lm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dk=Cr(KF),qF=Lt({},yd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sb}),GF=Cr(qF),YF=Lt({},Gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),XF=Cr(YF),ZF=Lt({},lm,{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}),QF=Cr(ZF),JF=[9,13,27,32],kb=sa&&"CompositionEvent"in window,au=null;sa&&"documentMode"in document&&(au=document.documentMode);var ez=sa&&"TextEvent"in window&&!au,lT=sa&&(!kb||au&&8<au&&11>=au),Mk=" ",Ik=!1;function cT(e,t){switch(e){case"keyup":return JF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xo=!1;function tz(e,t){switch(e){case"compositionend":return uT(t);case"keypress":return t.which!==32?null:(Ik=!0,Mk);case"textInput":return e=t.data,e===Mk&&Ik?null:e;default:return null}}function nz(e,t){if(Xo)return e==="compositionend"||!kb&&cT(e,t)?(e=oT(),th=bb=Ha=null,Xo=!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 lT&&t.locale!=="ko"?null:t.data;default:return null}}var rz={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 Lk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rz[e.type]:t==="textarea"}function dT(e,t,n,r){UA(r),t=_h(t,"onChange"),0<t.length&&(n=new wb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var su=null,Pu=null;function iz(e){ST(e,0)}function cm(e){var t=Jo(e);if(IA(t))return e}function az(e,t){if(e==="change")return t}var fT=!1;if(sa){var Zg;if(sa){var Qg="oninput"in document;if(!Qg){var Rk=document.createElement("div");Rk.setAttribute("oninput","return;"),Qg=typeof Rk.oninput=="function"}Zg=Qg}else Zg=!1;fT=Zg&&(!document.documentMode||9<document.documentMode)}function Fk(){su&&(su.detachEvent("onpropertychange",hT),Pu=su=null)}function hT(e){if(e.propertyName==="value"&&cm(Pu)){var t=[];dT(t,Pu,e,mb(e)),KA(iz,t)}}function sz(e,t,n){e==="focusin"?(Fk(),su=t,Pu=n,su.attachEvent("onpropertychange",hT)):e==="focusout"&&Fk()}function oz(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return cm(Pu)}function lz(e,t){if(e==="click")return cm(t)}function cz(e,t){if(e==="input"||e==="change")return cm(t)}function uz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var li=typeof Object.is=="function"?Object.is:uz;function Eu(e,t){if(li(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(!Ay.call(t,i)||!li(e[i],t[i]))return!1}return!0}function zk(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $k(e,t){var n=zk(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=zk(n)}}function pT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mT(){for(var e=window,t=Nh();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nh(e.document)}return t}function jb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function dz(e){var t=mT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pT(n.ownerDocument.documentElement,n)){if(r!==null&&jb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=$k(n,a);var s=$k(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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 fz=sa&&"documentMode"in document&&11>=document.documentMode,Zo=null,Gy=null,ou=null,Yy=!1;function Bk(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yy||Zo==null||Zo!==Nh(r)||(r=Zo,"selectionStart"in r&&jb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ou&&Eu(ou,r)||(ou=r,r=_h(Gy,"onSelect"),0<r.length&&(t=new wb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zo)))}function df(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qo={animationend:df("Animation","AnimationEnd"),animationiteration:df("Animation","AnimationIteration"),animationstart:df("Animation","AnimationStart"),transitionend:df("Transition","TransitionEnd")},Jg={},gT={};sa&&(gT=document.createElement("div").style,"AnimationEvent"in window||(delete Qo.animationend.animation,delete Qo.animationiteration.animation,delete Qo.animationstart.animation),"TransitionEvent"in window||delete Qo.transitionend.transition);function um(e){if(Jg[e])return Jg[e];if(!Qo[e])return e;var t=Qo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in gT)return Jg[e]=t[n];return e}var yT=um("animationend"),xT=um("animationiteration"),vT=um("animationstart"),bT=um("transitionend"),wT=new Map,Uk="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 ms(e,t){wT.set(e,t),jo(t,[e])}for(var e0=0;e0<Uk.length;e0++){var t0=Uk[e0],hz=t0.toLowerCase(),pz=t0[0].toUpperCase()+t0.slice(1);ms(hz,"on"+pz)}ms(yT,"onAnimationEnd");ms(xT,"onAnimationIteration");ms(vT,"onAnimationStart");ms("dblclick","onDoubleClick");ms("focusin","onFocus");ms("focusout","onBlur");ms(bT,"onTransitionEnd");Nl("onMouseEnter",["mouseout","mouseover"]);Nl("onMouseLeave",["mouseout","mouseover"]);Nl("onPointerEnter",["pointerout","pointerover"]);Nl("onPointerLeave",["pointerout","pointerover"]);jo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));jo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));jo("onBeforeInput",["compositionend","keypress","textInput","paste"]);jo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));jo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));jo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yc="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(" "),mz=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yc));function Vk(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,hF(r,t,void 0,e),e.currentTarget=null}function ST(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 s=r.length-1;0<=s;s--){var o=r[s],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==a&&i.isPropagationStopped())break e;Vk(i,o,u),a=c}else for(s=0;s<r.length;s++){if(o=r[s],c=o.instance,u=o.currentTarget,o=o.listener,c!==a&&i.isPropagationStopped())break e;Vk(i,o,u),a=c}}}if(Ph)throw e=Wy,Ph=!1,Wy=null,e}function St(e,t){var n=t[ex];n===void 0&&(n=t[ex]=new Set);var r=e+"__bubble";n.has(r)||(kT(t,e,2,!1),n.add(r))}function n0(e,t,n){var r=0;t&&(r|=4),kT(n,e,r,t)}var ff="_reactListening"+Math.random().toString(36).slice(2);function Au(e){if(!e[ff]){e[ff]=!0,TA.forEach(function(n){n!=="selectionchange"&&(mz.has(n)||n0(n,!1,e),n0(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ff]||(t[ff]=!0,n0("selectionchange",!1,t))}}function kT(e,t,n,r){switch(sT(t)){case 1:var i=AF;break;case 4:i=TF;break;default:i=vb}n=i.bind(null,t,n,e),i=void 0,!Vy||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 r0(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;o!==null;){if(s=Vs(o),s===null)return;if(c=s.tag,c===5||c===6){r=a=s;continue e}o=o.parentNode}}r=r.return}KA(function(){var u=a,d=mb(n),f=[];e:{var h=wT.get(e);if(h!==void 0){var p=wb,g=e;switch(e){case"keypress":if(nh(n)===0)break e;case"keydown":case"keyup":p=HF;break;case"focusin":g="focus",p=Xg;break;case"focusout":g="blur",p=Xg;break;case"beforeblur":case"afterblur":p=Xg;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Ok;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=DF;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=GF;break;case yT:case xT:case vT:p=LF;break;case bT:p=XF;break;case"scroll":p=OF;break;case"wheel":p=QF;break;case"copy":case"cut":case"paste":p=FF;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Dk}var y=(t&4)!==0,x=!y&&e==="scroll",v=y?h!==null?h+"Capture":null:h;y=[];for(var b=u,w;b!==null;){w=b;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,v!==null&&(S=ku(b,v),S!=null&&y.push(Tu(b,S,w)))),x)break;b=b.return}0<y.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==By&&(g=n.relatedTarget||n.fromElement)&&(Vs(g)||g[oa]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?Vs(g):null,g!==null&&(x=No(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(y=Ok,S="onMouseLeave",v="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(y=Dk,S="onPointerLeave",v="onPointerEnter",b="pointer"),x=p==null?h:Jo(p),w=g==null?h:Jo(g),h=new y(S,b+"leave",p,n,d),h.target=x,h.relatedTarget=w,S=null,Vs(d)===u&&(y=new y(v,b+"enter",g,n,d),y.target=w,y.relatedTarget=x,S=y),x=S,p&&g)t:{for(y=p,v=g,b=0,w=y;w;w=Io(w))b++;for(w=0,S=v;S;S=Io(S))w++;for(;0<b-w;)y=Io(y),b--;for(;0<w-b;)v=Io(v),w--;for(;b--;){if(y===v||v!==null&&y===v.alternate)break t;y=Io(y),v=Io(v)}y=null}else y=null;p!==null&&Wk(f,h,p,y,!1),g!==null&&x!==null&&Wk(f,x,g,y,!0)}}e:{if(h=u?Jo(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var k=az;else if(Lk(h))if(fT)k=cz;else{k=oz;var j=sz}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=lz);if(k&&(k=k(e,u))){dT(f,k,n,d);break e}j&&j(e,h,u),e==="focusout"&&(j=h._wrapperState)&&j.controlled&&h.type==="number"&&Ly(h,"number",h.value)}switch(j=u?Jo(u):window,e){case"focusin":(Lk(j)||j.contentEditable==="true")&&(Zo=j,Gy=u,ou=null);break;case"focusout":ou=Gy=Zo=null;break;case"mousedown":Yy=!0;break;case"contextmenu":case"mouseup":case"dragend":Yy=!1,Bk(f,n,d);break;case"selectionchange":if(fz)break;case"keydown":case"keyup":Bk(f,n,d)}var N;if(kb)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Xo?cT(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(lT&&n.locale!=="ko"&&(Xo||P!=="onCompositionStart"?P==="onCompositionEnd"&&Xo&&(N=oT()):(Ha=d,bb="value"in Ha?Ha.value:Ha.textContent,Xo=!0)),j=_h(u,P),0<j.length&&(P=new _k(P,e,null,n,d),f.push({event:P,listeners:j}),N?P.data=N:(N=uT(n),N!==null&&(P.data=N)))),(N=ez?tz(e,n):nz(e,n))&&(u=_h(u,"onBeforeInput"),0<u.length&&(d=new _k("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=N))}ST(f,t)})}function Tu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _h(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=ku(e,n),a!=null&&r.unshift(Tu(e,a,i)),a=ku(e,t),a!=null&&r.push(Tu(e,a,i))),e=e.return}return r}function Io(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Wk(e,t,n,r,i){for(var a=t._reactName,s=[];n!==null&&n!==r;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&u!==null&&(o=u,i?(c=ku(n,a),c!=null&&s.unshift(Tu(n,c,o))):i||(c=ku(n,a),c!=null&&s.push(Tu(n,c,o)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var gz=/\r\n?/g,yz=/\u0000|\uFFFD/g;function Hk(e){return(typeof e=="string"?e:""+e).replace(gz,`
|
|
38
|
+
`).replace(yz,"")}function hf(e,t,n){if(t=Hk(t),Hk(e)!==t&&n)throw Error(ge(425))}function Dh(){}var Xy=null,Zy=null;function Qy(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 Jy=typeof setTimeout=="function"?setTimeout:void 0,xz=typeof clearTimeout=="function"?clearTimeout:void 0,Kk=typeof Promise=="function"?Promise:void 0,vz=typeof queueMicrotask=="function"?queueMicrotask:typeof Kk<"u"?function(e){return Kk.resolve(null).then(e).catch(bz)}:Jy;function bz(e){setTimeout(function(){throw e})}function i0(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),Cu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Cu(t)}function Ja(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 qk(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 Yl=Math.random().toString(36).slice(2),ji="__reactFiber$"+Yl,Ou="__reactProps$"+Yl,oa="__reactContainer$"+Yl,ex="__reactEvents$"+Yl,wz="__reactListeners$"+Yl,Sz="__reactHandles$"+Yl;function Vs(e){var t=e[ji];if(t)return t;for(var n=e.parentNode;n;){if(t=n[oa]||n[ji]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=qk(e);e!==null;){if(n=e[ji])return n;e=qk(e)}return t}e=n,n=e.parentNode}return null}function xd(e){return e=e[ji]||e[oa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Jo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ge(33))}function dm(e){return e[Ou]||null}var tx=[],el=-1;function gs(e){return{current:e}}function Nt(e){0>el||(e.current=tx[el],tx[el]=null,el--)}function bt(e,t){el++,tx[el]=e.current,e.current=t}var ls={},Rn=gs(ls),rr=gs(!1),oo=ls;function Cl(e,t){var n=e.type.contextTypes;if(!n)return ls;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 ir(e){return e=e.childContextTypes,e!=null}function Mh(){Nt(rr),Nt(Rn)}function Gk(e,t,n){if(Rn.current!==ls)throw Error(ge(168));bt(Rn,t),bt(rr,n)}function jT(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(ge(108,sF(e)||"Unknown",i));return Lt({},n,r)}function Ih(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ls,oo=Rn.current,bt(Rn,e),bt(rr,rr.current),!0}function Yk(e,t,n){var r=e.stateNode;if(!r)throw Error(ge(169));n?(e=jT(e,t,oo),r.__reactInternalMemoizedMergedChildContext=e,Nt(rr),Nt(Rn),bt(Rn,e)):Nt(rr),bt(rr,n)}var Hi=null,fm=!1,a0=!1;function NT(e){Hi===null?Hi=[e]:Hi.push(e)}function kz(e){fm=!0,NT(e)}function ys(){if(!a0&&Hi!==null){a0=!0;var e=0,t=lt;try{var n=Hi;for(lt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Hi=null,fm=!1}catch(i){throw Hi!==null&&(Hi=Hi.slice(e+1)),XA(gb,ys),i}finally{lt=t,a0=!1}}return null}var tl=[],nl=0,Lh=null,Rh=0,Mr=[],Ir=0,lo=null,Gi=1,Yi="";function Ds(e,t){tl[nl++]=Rh,tl[nl++]=Lh,Lh=e,Rh=t}function CT(e,t,n){Mr[Ir++]=Gi,Mr[Ir++]=Yi,Mr[Ir++]=lo,lo=e;var r=Gi;e=Yi;var i=32-ri(r)-1;r&=~(1<<i),n+=1;var a=32-ri(t)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Gi=1<<32-ri(t)+i|n<<i|r,Yi=a+e}else Gi=1<<a|n<<i|r,Yi=e}function Nb(e){e.return!==null&&(Ds(e,1),CT(e,1,0))}function Cb(e){for(;e===Lh;)Lh=tl[--nl],tl[nl]=null,Rh=tl[--nl],tl[nl]=null;for(;e===lo;)lo=Mr[--Ir],Mr[Ir]=null,Yi=Mr[--Ir],Mr[Ir]=null,Gi=Mr[--Ir],Mr[Ir]=null}var mr=null,hr=null,Tt=!1,Jr=null;function PT(e,t){var n=Rr(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 Xk(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,mr=e,hr=Ja(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,mr=e,hr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=lo!==null?{id:Gi,overflow:Yi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Rr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,mr=e,hr=null,!0):!1;default:return!1}}function nx(e){return(e.mode&1)!==0&&(e.flags&128)===0}function rx(e){if(Tt){var t=hr;if(t){var n=t;if(!Xk(e,t)){if(nx(e))throw Error(ge(418));t=Ja(n.nextSibling);var r=mr;t&&Xk(e,t)?PT(r,n):(e.flags=e.flags&-4097|2,Tt=!1,mr=e)}}else{if(nx(e))throw Error(ge(418));e.flags=e.flags&-4097|2,Tt=!1,mr=e}}}function Zk(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;mr=e}function pf(e){if(e!==mr)return!1;if(!Tt)return Zk(e),Tt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Qy(e.type,e.memoizedProps)),t&&(t=hr)){if(nx(e))throw ET(),Error(ge(418));for(;t;)PT(e,t),t=Ja(t.nextSibling)}if(Zk(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ge(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){hr=Ja(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}hr=null}}else hr=mr?Ja(e.stateNode.nextSibling):null;return!0}function ET(){for(var e=hr;e;)e=Ja(e.nextSibling)}function Pl(){hr=mr=null,Tt=!1}function Pb(e){Jr===null?Jr=[e]:Jr.push(e)}var jz=ya.ReactCurrentBatchConfig;function Sc(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(ge(309));var r=n.stateNode}if(!r)throw Error(ge(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(s){var o=i.refs;s===null?delete o[a]:o[a]=s},t._stringRef=a,t)}if(typeof e!="string")throw Error(ge(284));if(!n._owner)throw Error(ge(290,e))}return e}function mf(e,t){throw e=Object.prototype.toString.call(t),Error(ge(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qk(e){var t=e._init;return t(e._payload)}function AT(e){function t(v,b){if(e){var w=v.deletions;w===null?(v.deletions=[b],v.flags|=16):w.push(b)}}function n(v,b){if(!e)return null;for(;b!==null;)t(v,b),b=b.sibling;return null}function r(v,b){for(v=new Map;b!==null;)b.key!==null?v.set(b.key,b):v.set(b.index,b),b=b.sibling;return v}function i(v,b){return v=rs(v,b),v.index=0,v.sibling=null,v}function a(v,b,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<b?(v.flags|=2,b):w):(v.flags|=2,b)):(v.flags|=1048576,b)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function o(v,b,w,S){return b===null||b.tag!==6?(b=f0(w,v.mode,S),b.return=v,b):(b=i(b,w),b.return=v,b)}function c(v,b,w,S){var k=w.type;return k===Yo?d(v,b,w.props.children,S,w.key):b!==null&&(b.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Fa&&Qk(k)===b.type)?(S=i(b,w.props),S.ref=Sc(v,b,w),S.return=v,S):(S=ch(w.type,w.key,w.props,null,v.mode,S),S.ref=Sc(v,b,w),S.return=v,S)}function u(v,b,w,S){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=h0(w,v.mode,S),b.return=v,b):(b=i(b,w.children||[]),b.return=v,b)}function d(v,b,w,S,k){return b===null||b.tag!==7?(b=eo(w,v.mode,S,k),b.return=v,b):(b=i(b,w),b.return=v,b)}function f(v,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=f0(""+b,v.mode,w),b.return=v,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case rf:return w=ch(b.type,b.key,b.props,null,v.mode,w),w.ref=Sc(v,null,b),w.return=v,w;case Go:return b=h0(b,v.mode,w),b.return=v,b;case Fa:var S=b._init;return f(v,S(b._payload),w)}if(qc(b)||yc(b))return b=eo(b,v.mode,w,null),b.return=v,b;mf(v,b)}return null}function h(v,b,w,S){var k=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return k!==null?null:o(v,b,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case rf:return w.key===k?c(v,b,w,S):null;case Go:return w.key===k?u(v,b,w,S):null;case Fa:return k=w._init,h(v,b,k(w._payload),S)}if(qc(w)||yc(w))return k!==null?null:d(v,b,w,S,null);mf(v,w)}return null}function p(v,b,w,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(w)||null,o(b,v,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case rf:return v=v.get(S.key===null?w:S.key)||null,c(b,v,S,k);case Go:return v=v.get(S.key===null?w:S.key)||null,u(b,v,S,k);case Fa:var j=S._init;return p(v,b,w,j(S._payload),k)}if(qc(S)||yc(S))return v=v.get(w)||null,d(b,v,S,k,null);mf(b,S)}return null}function g(v,b,w,S){for(var k=null,j=null,N=b,P=b=0,T=null;N!==null&&P<w.length;P++){N.index>P?(T=N,N=null):T=N.sibling;var E=h(v,N,w[P],S);if(E===null){N===null&&(N=T);break}e&&N&&E.alternate===null&&t(v,N),b=a(E,b,P),j===null?k=E:j.sibling=E,j=E,N=T}if(P===w.length)return n(v,N),Tt&&Ds(v,P),k;if(N===null){for(;P<w.length;P++)N=f(v,w[P],S),N!==null&&(b=a(N,b,P),j===null?k=N:j.sibling=N,j=N);return Tt&&Ds(v,P),k}for(N=r(v,N);P<w.length;P++)T=p(N,v,P,w[P],S),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?P:T.key),b=a(T,b,P),j===null?k=T:j.sibling=T,j=T);return e&&N.forEach(function(_){return t(v,_)}),Tt&&Ds(v,P),k}function y(v,b,w,S){var k=yc(w);if(typeof k!="function")throw Error(ge(150));if(w=k.call(w),w==null)throw Error(ge(151));for(var j=k=null,N=b,P=b=0,T=null,E=w.next();N!==null&&!E.done;P++,E=w.next()){N.index>P?(T=N,N=null):T=N.sibling;var _=h(v,N,E.value,S);if(_===null){N===null&&(N=T);break}e&&N&&_.alternate===null&&t(v,N),b=a(_,b,P),j===null?k=_:j.sibling=_,j=_,N=T}if(E.done)return n(v,N),Tt&&Ds(v,P),k;if(N===null){for(;!E.done;P++,E=w.next())E=f(v,E.value,S),E!==null&&(b=a(E,b,P),j===null?k=E:j.sibling=E,j=E);return Tt&&Ds(v,P),k}for(N=r(v,N);!E.done;P++,E=w.next())E=p(N,v,P,E.value,S),E!==null&&(e&&E.alternate!==null&&N.delete(E.key===null?P:E.key),b=a(E,b,P),j===null?k=E:j.sibling=E,j=E);return e&&N.forEach(function(C){return t(v,C)}),Tt&&Ds(v,P),k}function x(v,b,w,S){if(typeof w=="object"&&w!==null&&w.type===Yo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case rf:e:{for(var k=w.key,j=b;j!==null;){if(j.key===k){if(k=w.type,k===Yo){if(j.tag===7){n(v,j.sibling),b=i(j,w.props.children),b.return=v,v=b;break e}}else if(j.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Fa&&Qk(k)===j.type){n(v,j.sibling),b=i(j,w.props),b.ref=Sc(v,j,w),b.return=v,v=b;break e}n(v,j);break}else t(v,j);j=j.sibling}w.type===Yo?(b=eo(w.props.children,v.mode,S,w.key),b.return=v,v=b):(S=ch(w.type,w.key,w.props,null,v.mode,S),S.ref=Sc(v,b,w),S.return=v,v=S)}return s(v);case Go:e:{for(j=w.key;b!==null;){if(b.key===j)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(v,b.sibling),b=i(b,w.children||[]),b.return=v,v=b;break e}else{n(v,b);break}else t(v,b);b=b.sibling}b=h0(w,v.mode,S),b.return=v,v=b}return s(v);case Fa:return j=w._init,x(v,b,j(w._payload),S)}if(qc(w))return g(v,b,w,S);if(yc(w))return y(v,b,w,S);mf(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(v,b.sibling),b=i(b,w),b.return=v,v=b):(n(v,b),b=f0(w,v.mode,S),b.return=v,v=b),s(v)):n(v,b)}return x}var El=AT(!0),TT=AT(!1),Fh=gs(null),zh=null,rl=null,Eb=null;function Ab(){Eb=rl=zh=null}function Tb(e){var t=Fh.current;Nt(Fh),e._currentValue=t}function ix(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 xl(e,t){zh=e,Eb=rl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(er=!0),e.firstContext=null)}function Vr(e){var t=e._currentValue;if(Eb!==e)if(e={context:e,memoizedValue:t,next:null},rl===null){if(zh===null)throw Error(ge(308));rl=e,zh.dependencies={lanes:0,firstContext:e}}else rl=rl.next=e;return t}var Ws=null;function Ob(e){Ws===null?Ws=[e]:Ws.push(e)}function OT(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ob(t)):(n.next=i.next,i.next=n),t.interleaved=n,la(e,r)}function la(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 za=!1;function _b(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _T(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 Qi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function es(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,nt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,la(e,n)}return i=r.interleaved,i===null?(t.next=t,Ob(r)):(t.next=i.next,i.next=t),r.interleaved=t,la(e,n)}function rh(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,yb(e,n)}}function Jk(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 s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,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 $h(e,t,n,r){var i=e.updateQueue;za=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var c=o,u=c.next;c.next=null,s===null?a=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==s&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=i.baseState;s=0,d=u=c=null,o=a;do{var h=o.lane,p=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=e,y=o;switch(h=t,p=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=Lt({},f,h);break e;case 2:za=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,s|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);uo|=s,e.lanes=s,e.memoizedState=f}}function ej(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(ge(191,i));i.call(r)}}}var vd={},Ei=gs(vd),_u=gs(vd),Du=gs(vd);function Hs(e){if(e===vd)throw Error(ge(174));return e}function Db(e,t){switch(bt(Du,t),bt(_u,e),bt(Ei,vd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Fy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Fy(t,e)}Nt(Ei),bt(Ei,t)}function Al(){Nt(Ei),Nt(_u),Nt(Du)}function DT(e){Hs(Du.current);var t=Hs(Ei.current),n=Fy(t,e.type);t!==n&&(bt(_u,e),bt(Ei,n))}function Mb(e){_u.current===e&&(Nt(Ei),Nt(_u))}var Dt=gs(0);function Bh(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 s0=[];function Ib(){for(var e=0;e<s0.length;e++)s0[e]._workInProgressVersionPrimary=null;s0.length=0}var ih=ya.ReactCurrentDispatcher,o0=ya.ReactCurrentBatchConfig,co=0,It=null,tn=null,cn=null,Uh=!1,lu=!1,Mu=0,Nz=0;function Cn(){throw Error(ge(321))}function Lb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!li(e[n],t[n]))return!1;return!0}function Rb(e,t,n,r,i,a){if(co=a,It=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ih.current=e===null||e.memoizedState===null?Az:Tz,e=n(r,i),lu){a=0;do{if(lu=!1,Mu=0,25<=a)throw Error(ge(301));a+=1,cn=tn=null,t.updateQueue=null,ih.current=Oz,e=n(r,i)}while(lu)}if(ih.current=Vh,t=tn!==null&&tn.next!==null,co=0,cn=tn=It=null,Uh=!1,t)throw Error(ge(300));return e}function Fb(){var e=Mu!==0;return Mu=0,e}function bi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return cn===null?It.memoizedState=cn=e:cn=cn.next=e,cn}function Wr(){if(tn===null){var e=It.alternate;e=e!==null?e.memoizedState:null}else e=tn.next;var t=cn===null?It.memoizedState:cn.next;if(t!==null)cn=t,tn=e;else{if(e===null)throw Error(ge(310));tn=e,e={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},cn===null?It.memoizedState=cn=e:cn=cn.next=e}return cn}function Iu(e,t){return typeof t=="function"?t(e):t}function l0(e){var t=Wr(),n=t.queue;if(n===null)throw Error(ge(311));n.lastRenderedReducer=e;var r=tn,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var o=s=null,c=null,u=a;do{var d=u.lane;if((co&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?(o=c=f,s=r):c=c.next=f,It.lanes|=d,uo|=d}u=u.next}while(u!==null&&u!==a);c===null?s=r:c.next=o,li(r,t.memoizedState)||(er=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,It.lanes|=a,uo|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function c0(e){var t=Wr(),n=t.queue;if(n===null)throw Error(ge(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);li(a,t.memoizedState)||(er=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function MT(){}function IT(e,t){var n=It,r=Wr(),i=t(),a=!li(r.memoizedState,i);if(a&&(r.memoizedState=i,er=!0),r=r.queue,zb(FT.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||cn!==null&&cn.memoizedState.tag&1){if(n.flags|=2048,Lu(9,RT.bind(null,n,r,i,t),void 0,null),un===null)throw Error(ge(349));co&30||LT(n,t,i)}return i}function LT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=It.updateQueue,t===null?(t={lastEffect:null,stores:null},It.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function RT(e,t,n,r){t.value=n,t.getSnapshot=r,zT(t)&&$T(e)}function FT(e,t,n){return n(function(){zT(t)&&$T(e)})}function zT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!li(e,n)}catch{return!0}}function $T(e){var t=la(e,1);t!==null&&ii(t,e,1,-1)}function tj(e){var t=bi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Iu,lastRenderedState:e},t.queue=e,e=e.dispatch=Ez.bind(null,It,e),[t.memoizedState,e]}function Lu(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=It.updateQueue,t===null?(t={lastEffect:null,stores:null},It.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 BT(){return Wr().memoizedState}function ah(e,t,n,r){var i=bi();It.flags|=e,i.memoizedState=Lu(1|t,n,void 0,r===void 0?null:r)}function hm(e,t,n,r){var i=Wr();r=r===void 0?null:r;var a=void 0;if(tn!==null){var s=tn.memoizedState;if(a=s.destroy,r!==null&&Lb(r,s.deps)){i.memoizedState=Lu(t,n,a,r);return}}It.flags|=e,i.memoizedState=Lu(1|t,n,a,r)}function nj(e,t){return ah(8390656,8,e,t)}function zb(e,t){return hm(2048,8,e,t)}function UT(e,t){return hm(4,2,e,t)}function VT(e,t){return hm(4,4,e,t)}function WT(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 HT(e,t,n){return n=n!=null?n.concat([e]):null,hm(4,4,WT.bind(null,t,e),n)}function $b(){}function KT(e,t){var n=Wr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qT(e,t){var n=Wr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lb(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function GT(e,t,n){return co&21?(li(n,t)||(n=JA(),It.lanes|=n,uo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,er=!0),e.memoizedState=n)}function Cz(e,t){var n=lt;lt=n!==0&&4>n?n:4,e(!0);var r=o0.transition;o0.transition={};try{e(!1),t()}finally{lt=n,o0.transition=r}}function YT(){return Wr().memoizedState}function Pz(e,t,n){var r=ns(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},XT(e))ZT(t,n);else if(n=OT(e,t,n,r),n!==null){var i=Hn();ii(n,e,r,i),QT(n,t,r)}}function Ez(e,t,n){var r=ns(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(XT(e))ZT(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,o=a(s,n);if(i.hasEagerState=!0,i.eagerState=o,li(o,s)){var c=t.interleaved;c===null?(i.next=i,Ob(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=OT(e,t,i,r),n!==null&&(i=Hn(),ii(n,e,r,i),QT(n,t,r))}}function XT(e){var t=e.alternate;return e===It||t!==null&&t===It}function ZT(e,t){lu=Uh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function QT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yb(e,n)}}var Vh={readContext:Vr,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useInsertionEffect:Cn,useLayoutEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useMutableSource:Cn,useSyncExternalStore:Cn,useId:Cn,unstable_isNewReconciler:!1},Az={readContext:Vr,useCallback:function(e,t){return bi().memoizedState=[e,t===void 0?null:t],e},useContext:Vr,useEffect:nj,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ah(4194308,4,WT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ah(4194308,4,e,t)},useInsertionEffect:function(e,t){return ah(4,2,e,t)},useMemo:function(e,t){var n=bi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=bi();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=Pz.bind(null,It,e),[r.memoizedState,e]},useRef:function(e){var t=bi();return e={current:e},t.memoizedState=e},useState:tj,useDebugValue:$b,useDeferredValue:function(e){return bi().memoizedState=e},useTransition:function(){var e=tj(!1),t=e[0];return e=Cz.bind(null,e[1]),bi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=It,i=bi();if(Tt){if(n===void 0)throw Error(ge(407));n=n()}else{if(n=t(),un===null)throw Error(ge(349));co&30||LT(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,nj(FT.bind(null,r,a,e),[e]),r.flags|=2048,Lu(9,RT.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=bi(),t=un.identifierPrefix;if(Tt){var n=Yi,r=Gi;n=(r&~(1<<32-ri(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Nz++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Tz={readContext:Vr,useCallback:KT,useContext:Vr,useEffect:zb,useImperativeHandle:HT,useInsertionEffect:UT,useLayoutEffect:VT,useMemo:qT,useReducer:l0,useRef:BT,useState:function(){return l0(Iu)},useDebugValue:$b,useDeferredValue:function(e){var t=Wr();return GT(t,tn.memoizedState,e)},useTransition:function(){var e=l0(Iu)[0],t=Wr().memoizedState;return[e,t]},useMutableSource:MT,useSyncExternalStore:IT,useId:YT,unstable_isNewReconciler:!1},Oz={readContext:Vr,useCallback:KT,useContext:Vr,useEffect:zb,useImperativeHandle:HT,useInsertionEffect:UT,useLayoutEffect:VT,useMemo:qT,useReducer:c0,useRef:BT,useState:function(){return c0(Iu)},useDebugValue:$b,useDeferredValue:function(e){var t=Wr();return tn===null?t.memoizedState=e:GT(t,tn.memoizedState,e)},useTransition:function(){var e=c0(Iu)[0],t=Wr().memoizedState;return[e,t]},useMutableSource:MT,useSyncExternalStore:IT,useId:YT,unstable_isNewReconciler:!1};function Xr(e,t){if(e&&e.defaultProps){t=Lt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ax(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Lt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pm={isMounted:function(e){return(e=e._reactInternals)?No(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Hn(),i=ns(e),a=Qi(r,i);a.payload=t,n!=null&&(a.callback=n),t=es(e,a,i),t!==null&&(ii(t,e,i,r),rh(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Hn(),i=ns(e),a=Qi(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=es(e,a,i),t!==null&&(ii(t,e,i,r),rh(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Hn(),r=ns(e),i=Qi(n,r);i.tag=2,t!=null&&(i.callback=t),t=es(e,i,r),t!==null&&(ii(t,e,r,n),rh(t,e,r))}};function rj(e,t,n,r,i,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,s):t.prototype&&t.prototype.isPureReactComponent?!Eu(n,r)||!Eu(i,a):!0}function JT(e,t,n){var r=!1,i=ls,a=t.contextType;return typeof a=="object"&&a!==null?a=Vr(a):(i=ir(t)?oo:Rn.current,r=t.contextTypes,a=(r=r!=null)?Cl(e,i):ls),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=pm,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function ij(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&&pm.enqueueReplaceState(t,t.state,null)}function sx(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},_b(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Vr(a):(a=ir(t)?oo:Rn.current,i.context=Cl(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(ax(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&&pm.enqueueReplaceState(i,i.state,null),$h(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Tl(e,t){try{var n="",r=t;do n+=aF(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 u0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ox(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _z=typeof WeakMap=="function"?WeakMap:Map;function eO(e,t,n){n=Qi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hh||(Hh=!0,yx=r),ox(e,t)},n}function tO(e,t,n){n=Qi(-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(){ox(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ox(e,t),typeof r!="function"&&(ts===null?ts=new Set([this]):ts.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function aj(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new _z;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=Kz.bind(null,e,t,n),t.then(e,e))}function sj(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 oj(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=Qi(-1,1),t.tag=2,es(n,t,1))),n.lanes|=1),e)}var Dz=ya.ReactCurrentOwner,er=!1;function Bn(e,t,n,r){t.child=e===null?TT(t,null,n,r):El(t,e.child,n,r)}function lj(e,t,n,r,i){n=n.render;var a=t.ref;return xl(t,i),r=Rb(e,t,n,r,a,i),n=Fb(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):(Tt&&n&&Nb(t),t.flags|=1,Bn(e,t,r,i),t.child)}function cj(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!Gb(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,nO(e,t,a,r,i)):(e=ch(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 s=a.memoizedProps;if(n=n.compare,n=n!==null?n:Eu,n(s,r)&&e.ref===t.ref)return ca(e,t,i)}return t.flags|=1,e=rs(a,r),e.ref=t.ref,e.return=t,t.child=e}function nO(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Eu(a,r)&&e.ref===t.ref)if(er=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(er=!0);else return t.lanes=e.lanes,ca(e,t,i)}return lx(e,t,n,r,i)}function rO(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},bt(al,ur),ur|=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,bt(al,ur),ur|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,bt(al,ur),ur|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,bt(al,ur),ur|=r;return Bn(e,t,i,n),t.child}function iO(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function lx(e,t,n,r,i){var a=ir(n)?oo:Rn.current;return a=Cl(t,a),xl(t,i),n=Rb(e,t,n,r,a,i),r=Fb(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):(Tt&&r&&Nb(t),t.flags|=1,Bn(e,t,n,i),t.child)}function uj(e,t,n,r,i){if(ir(n)){var a=!0;Ih(t)}else a=!1;if(xl(t,i),t.stateNode===null)sh(e,t),JT(t,n,r),sx(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,o=t.memoizedProps;s.props=o;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Vr(u):(u=ir(n)?oo:Rn.current,u=Cl(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==r||c!==u)&&ij(t,s,r,u),za=!1;var h=t.memoizedState;s.state=h,$h(t,r,s,i),c=t.memoizedState,o!==r||h!==c||rr.current||za?(typeof d=="function"&&(ax(t,n,d,r),c=t.memoizedState),(o=za||rj(t,n,o,r,h,c,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=o):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,_T(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:Xr(t.type,o),s.props=u,f=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=Vr(c):(c=ir(n)?oo:Rn.current,c=Cl(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||h!==c)&&ij(t,s,r,c),za=!1,h=t.memoizedState,s.state=h,$h(t,r,s,i);var g=t.memoizedState;o!==f||h!==g||rr.current||za?(typeof p=="function"&&(ax(t,n,p,r),g=t.memoizedState),(u=za||rj(t,n,u,r,h,g,c)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return cx(e,t,n,r,a,i)}function cx(e,t,n,r,i,a){iO(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Yk(t,n,!1),ca(e,t,a);r=t.stateNode,Dz.current=t;var o=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=El(t,e.child,null,a),t.child=El(t,null,o,a)):Bn(e,t,o,a),t.memoizedState=r.state,i&&Yk(t,n,!0),t.child}function aO(e){var t=e.stateNode;t.pendingContext?Gk(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Gk(e,t.context,!1),Db(e,t.containerInfo)}function dj(e,t,n,r,i){return Pl(),Pb(i),t.flags|=256,Bn(e,t,n,r),t.child}var ux={dehydrated:null,treeContext:null,retryLane:0};function dx(e){return{baseLanes:e,cachePool:null,transitions:null}}function sO(e,t,n){var r=t.pendingProps,i=Dt.current,a=!1,s=(t.flags&128)!==0,o;if((o=s)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),bt(Dt,i&1),e===null)return rx(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):(s=r.children,e=r.fallback,a?(r=t.mode,a=t.child,s={mode:"hidden",children:s},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=ym(s,r,0,null),e=eo(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=dx(n),t.memoizedState=ux,e):Bb(t,s));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Mz(e,t,s,r,o,i,n);if(a){a=r.fallback,s=t.mode,i=e.child,o=i.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=rs(i,c),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?a=rs(o,a):(a=eo(a,s,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,s=e.child.memoizedState,s=s===null?dx(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=ux,r}return a=e.child,e=a.sibling,r=rs(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=ym({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function gf(e,t,n,r){return r!==null&&Pb(r),El(t,e.child,null,n),e=Bb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mz(e,t,n,r,i,a,s){if(n)return t.flags&256?(t.flags&=-257,r=u0(Error(ge(422))),gf(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=ym({mode:"visible",children:r.children},i,0,null),a=eo(a,i,s,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&El(t,e.child,null,s),t.child.memoizedState=dx(s),t.memoizedState=ux,a);if(!(t.mode&1))return gf(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(ge(419)),r=u0(a,r,void 0),gf(e,t,s,r)}if(o=(s&e.childLanes)!==0,er||o){if(r=un,r!==null){switch(s&-s){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|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,la(e,i),ii(r,e,i,-1))}return qb(),r=u0(Error(ge(421))),gf(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=qz.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,hr=Ja(i.nextSibling),mr=t,Tt=!0,Jr=null,e!==null&&(Mr[Ir++]=Gi,Mr[Ir++]=Yi,Mr[Ir++]=lo,Gi=e.id,Yi=e.overflow,lo=t),t=Bb(t,r.children),t.flags|=4096,t)}function fj(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ix(e.return,t,n)}function d0(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 oO(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Bn(e,t,r.children,n),r=Dt.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&&fj(e,n,t);else if(e.tag===19)fj(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(bt(Dt,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&&Bh(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),d0(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&&Bh(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}d0(t,!0,n,null,a);break;case"together":d0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sh(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ca(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),uo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ge(153));if(t.child!==null){for(e=t.child,n=rs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=rs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Iz(e,t,n){switch(t.tag){case 3:aO(t),Pl();break;case 5:DT(t);break;case 1:ir(t.type)&&Ih(t);break;case 4:Db(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;bt(Fh,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(bt(Dt,Dt.current&1),t.flags|=128,null):n&t.child.childLanes?sO(e,t,n):(bt(Dt,Dt.current&1),e=ca(e,t,n),e!==null?e.sibling:null);bt(Dt,Dt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return oO(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),bt(Dt,Dt.current),r)break;return null;case 22:case 23:return t.lanes=0,rO(e,t,n)}return ca(e,t,n)}var lO,fx,cO,uO;lO=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}};fx=function(){};cO=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Hs(Ei.current);var a=null;switch(n){case"input":i=My(e,i),r=My(e,r),a=[];break;case"select":i=Lt({},i,{value:void 0}),r=Lt({},r,{value:void 0}),a=[];break;case"textarea":i=Ry(e,i),r=Ry(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Dh)}zy(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(s in o)o.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(wu.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(s in o)!o.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&o[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(wu.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&St("scroll",e),a||o===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};uO=function(e,t,n,r){n!==r&&(t.flags|=4)};function kc(e,t){if(!Tt)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 Pn(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 Lz(e,t,n){var r=t.pendingProps;switch(Cb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pn(t),null;case 1:return ir(t.type)&&Mh(),Pn(t),null;case 3:return r=t.stateNode,Al(),Nt(rr),Nt(Rn),Ib(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(pf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Jr!==null&&(bx(Jr),Jr=null))),fx(e,t),Pn(t),null;case 5:Mb(t);var i=Hs(Du.current);if(n=t.type,e!==null&&t.stateNode!=null)cO(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ge(166));return Pn(t),null}if(e=Hs(Ei.current),pf(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[ji]=t,r[Ou]=a,e=(t.mode&1)!==0,n){case"dialog":St("cancel",r),St("close",r);break;case"iframe":case"object":case"embed":St("load",r);break;case"video":case"audio":for(i=0;i<Yc.length;i++)St(Yc[i],r);break;case"source":St("error",r);break;case"img":case"image":case"link":St("error",r),St("load",r);break;case"details":St("toggle",r);break;case"input":wk(r,a),St("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},St("invalid",r);break;case"textarea":kk(r,a),St("invalid",r)}zy(n,a),i=null;for(var s in a)if(a.hasOwnProperty(s)){var o=a[s];s==="children"?typeof o=="string"?r.textContent!==o&&(a.suppressHydrationWarning!==!0&&hf(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&hf(r.textContent,o,e),i=["children",""+o]):wu.hasOwnProperty(s)&&o!=null&&s==="onScroll"&&St("scroll",r)}switch(n){case"input":af(r),Sk(r,a,!0);break;case"textarea":af(r),jk(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Dh)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=FA(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[ji]=t,e[Ou]=r,lO(e,t,!1,!1),t.stateNode=e;e:{switch(s=$y(n,r),n){case"dialog":St("cancel",e),St("close",e),i=r;break;case"iframe":case"object":case"embed":St("load",e),i=r;break;case"video":case"audio":for(i=0;i<Yc.length;i++)St(Yc[i],e);i=r;break;case"source":St("error",e),i=r;break;case"img":case"image":case"link":St("error",e),St("load",e),i=r;break;case"details":St("toggle",e),i=r;break;case"input":wk(e,r),i=My(e,r),St("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Lt({},r,{value:void 0}),St("invalid",e);break;case"textarea":kk(e,r),i=Ry(e,r),St("invalid",e);break;default:i=r}zy(n,i),o=i;for(a in o)if(o.hasOwnProperty(a)){var c=o[a];a==="style"?BA(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&zA(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Su(e,c):typeof c=="number"&&Su(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(wu.hasOwnProperty(a)?c!=null&&a==="onScroll"&&St("scroll",e):c!=null&&db(e,a,c,s))}switch(n){case"input":af(e),Sk(e,r,!1);break;case"textarea":af(e),jk(e);break;case"option":r.value!=null&&e.setAttribute("value",""+os(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?pl(e,!!r.multiple,a,!1):r.defaultValue!=null&&pl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Dh)}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 Pn(t),null;case 6:if(e&&t.stateNode!=null)uO(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ge(166));if(n=Hs(Du.current),Hs(Ei.current),pf(t)){if(r=t.stateNode,n=t.memoizedProps,r[ji]=t,(a=r.nodeValue!==n)&&(e=mr,e!==null))switch(e.tag){case 3:hf(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hf(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ji]=t,t.stateNode=r}return Pn(t),null;case 13:if(Nt(Dt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Tt&&hr!==null&&t.mode&1&&!(t.flags&128))ET(),Pl(),t.flags|=98560,a=!1;else if(a=pf(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(ge(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ge(317));a[ji]=t}else Pl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pn(t),a=!1}else Jr!==null&&(bx(Jr),Jr=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||Dt.current&1?rn===0&&(rn=3):qb())),t.updateQueue!==null&&(t.flags|=4),Pn(t),null);case 4:return Al(),fx(e,t),e===null&&Au(t.stateNode.containerInfo),Pn(t),null;case 10:return Tb(t.type._context),Pn(t),null;case 17:return ir(t.type)&&Mh(),Pn(t),null;case 19:if(Nt(Dt),a=t.memoizedState,a===null)return Pn(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)kc(a,!1);else{if(rn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Bh(e),s!==null){for(t.flags|=128,kc(a,!1),r=s.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,s=a.alternate,s===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=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,e=s.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return bt(Dt,Dt.current&1|2),t.child}e=e.sibling}a.tail!==null&&Ht()>Ol&&(t.flags|=128,r=!0,kc(a,!1),t.lanes=4194304)}else{if(!r)if(e=Bh(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kc(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Tt)return Pn(t),null}else 2*Ht()-a.renderingStartTime>Ol&&n!==1073741824&&(t.flags|=128,r=!0,kc(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(n=a.last,n!==null?n.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ht(),t.sibling=null,n=Dt.current,bt(Dt,r?n&1|2:n&1),t):(Pn(t),null);case 22:case 23:return Kb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ur&1073741824&&(Pn(t),t.subtreeFlags&6&&(t.flags|=8192)):Pn(t),null;case 24:return null;case 25:return null}throw Error(ge(156,t.tag))}function Rz(e,t){switch(Cb(t),t.tag){case 1:return ir(t.type)&&Mh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Al(),Nt(rr),Nt(Rn),Ib(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Mb(t),null;case 13:if(Nt(Dt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ge(340));Pl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Nt(Dt),null;case 4:return Al(),null;case 10:return Tb(t.type._context),null;case 22:case 23:return Kb(),null;case 24:return null;default:return null}}var yf=!1,Tn=!1,Fz=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function il(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Bt(e,t,r)}else n.current=null}function hx(e,t,n){try{n()}catch(r){Bt(e,t,r)}}var hj=!1;function zz(e,t){if(Xy=Th,e=mT(),jb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(o=s+i),f!==a||r!==0&&f.nodeType!==3||(c=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===i&&(o=s),h===a&&++d===r&&(c=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Zy={focusedElem:e,selectionRange:n},Th=!1,Ee=t;Ee!==null;)if(t=Ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ee=e;else for(;Ee!==null;){t=Ee;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 y=g.memoizedProps,x=g.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:Xr(t.type,y),x);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ge(163))}}catch(S){Bt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Ee=e;break}Ee=t.return}return g=hj,hj=!1,g}function cu(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&&hx(t,n,a)}i=i.next}while(i!==r)}}function mm(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 px(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 dO(e){var t=e.alternate;t!==null&&(e.alternate=null,dO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ji],delete t[Ou],delete t[ex],delete t[wz],delete t[Sz])),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 fO(e){return e.tag===5||e.tag===3||e.tag===4}function pj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fO(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 mx(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=Dh));else if(r!==4&&(e=e.child,e!==null))for(mx(e,t,n),e=e.sibling;e!==null;)mx(e,t,n),e=e.sibling}function gx(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(gx(e,t,n),e=e.sibling;e!==null;)gx(e,t,n),e=e.sibling}var gn=null,Zr=!1;function Ta(e,t,n){for(n=n.child;n!==null;)hO(e,t,n),n=n.sibling}function hO(e,t,n){if(Pi&&typeof Pi.onCommitFiberUnmount=="function")try{Pi.onCommitFiberUnmount(om,n)}catch{}switch(n.tag){case 5:Tn||il(n,t);case 6:var r=gn,i=Zr;gn=null,Ta(e,t,n),gn=r,Zr=i,gn!==null&&(Zr?(e=gn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):gn.removeChild(n.stateNode));break;case 18:gn!==null&&(Zr?(e=gn,n=n.stateNode,e.nodeType===8?i0(e.parentNode,n):e.nodeType===1&&i0(e,n),Cu(e)):i0(gn,n.stateNode));break;case 4:r=gn,i=Zr,gn=n.stateNode.containerInfo,Zr=!0,Ta(e,t,n),gn=r,Zr=i;break;case 0:case 11:case 14:case 15:if(!Tn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&hx(n,t,s),i=i.next}while(i!==r)}Ta(e,t,n);break;case 1:if(!Tn&&(il(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Bt(n,t,o)}Ta(e,t,n);break;case 21:Ta(e,t,n);break;case 22:n.mode&1?(Tn=(r=Tn)||n.memoizedState!==null,Ta(e,t,n),Tn=r):Ta(e,t,n);break;default:Ta(e,t,n)}}function mj(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Fz),t.forEach(function(r){var i=Gz.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Gr(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,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 5:gn=o.stateNode,Zr=!1;break e;case 3:gn=o.stateNode.containerInfo,Zr=!0;break e;case 4:gn=o.stateNode.containerInfo,Zr=!0;break e}o=o.return}if(gn===null)throw Error(ge(160));hO(a,s,i),gn=null,Zr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Bt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)pO(t,e),t=t.sibling}function pO(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Gr(t,e),gi(e),r&4){try{cu(3,e,e.return),mm(3,e)}catch(y){Bt(e,e.return,y)}try{cu(5,e,e.return)}catch(y){Bt(e,e.return,y)}}break;case 1:Gr(t,e),gi(e),r&512&&n!==null&&il(n,n.return);break;case 5:if(Gr(t,e),gi(e),r&512&&n!==null&&il(n,n.return),e.flags&32){var i=e.stateNode;try{Su(i,"")}catch(y){Bt(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,s=n!==null?n.memoizedProps:a,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&a.type==="radio"&&a.name!=null&&LA(i,a),$y(o,s);var u=$y(o,a);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?BA(i,f):d==="dangerouslySetInnerHTML"?zA(i,f):d==="children"?Su(i,f):db(i,d,f,u)}switch(o){case"input":Iy(i,a);break;case"textarea":RA(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?pl(i,!!a.multiple,p,!1):h!==!!a.multiple&&(a.defaultValue!=null?pl(i,!!a.multiple,a.defaultValue,!0):pl(i,!!a.multiple,a.multiple?[]:"",!1))}i[Ou]=a}catch(y){Bt(e,e.return,y)}}break;case 6:if(Gr(t,e),gi(e),r&4){if(e.stateNode===null)throw Error(ge(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){Bt(e,e.return,y)}}break;case 3:if(Gr(t,e),gi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Cu(t.containerInfo)}catch(y){Bt(e,e.return,y)}break;case 4:Gr(t,e),gi(e);break;case 13:Gr(t,e),gi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Wb=Ht())),r&4&&mj(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Tn=(u=Tn)||d,Gr(t,e),Tn=u):Gr(t,e),gi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Ee=e,d=e.child;d!==null;){for(f=Ee=d;Ee!==null;){switch(h=Ee,p=h.child,h.tag){case 0:case 11:case 14:case 15:cu(4,h,h.return);break;case 1:il(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(y){Bt(r,n,y)}}break;case 5:il(h,h.return);break;case 22:if(h.memoizedState!==null){yj(f);continue}}p!==null?(p.return=h,Ee=p):yj(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"):(o=f.stateNode,c=f.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=$A("display",s))}catch(y){Bt(e,e.return,y)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(y){Bt(e,e.return,y)}}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:Gr(t,e),gi(e),r&4&&mj(e);break;case 21:break;default:Gr(t,e),gi(e)}}function gi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(fO(n)){var r=n;break e}n=n.return}throw Error(ge(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Su(i,""),r.flags&=-33);var a=pj(e);gx(e,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,o=pj(e);mx(e,o,s);break;default:throw Error(ge(161))}}catch(c){Bt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $z(e,t,n){Ee=e,mO(e)}function mO(e,t,n){for(var r=(e.mode&1)!==0;Ee!==null;){var i=Ee,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||yf;if(!s){var o=i.alternate,c=o!==null&&o.memoizedState!==null||Tn;o=yf;var u=Tn;if(yf=s,(Tn=c)&&!u)for(Ee=i;Ee!==null;)s=Ee,c=s.child,s.tag===22&&s.memoizedState!==null?xj(i):c!==null?(c.return=s,Ee=c):xj(i);for(;a!==null;)Ee=a,mO(a),a=a.sibling;Ee=i,yf=o,Tn=u}gj(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Ee=a):gj(e)}}function gj(e){for(;Ee!==null;){var t=Ee;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Tn||mm(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Tn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Xr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&ej(t,a,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ej(t,s,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;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&&Cu(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ge(163))}Tn||t.flags&512&&px(t)}catch(h){Bt(t,t.return,h)}}if(t===e){Ee=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ee=n;break}Ee=t.return}}function yj(e){for(;Ee!==null;){var t=Ee;if(t===e){Ee=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ee=n;break}Ee=t.return}}function xj(e){for(;Ee!==null;){var t=Ee;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{mm(4,t)}catch(c){Bt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){Bt(t,i,c)}}var a=t.return;try{px(t)}catch(c){Bt(t,a,c)}break;case 5:var s=t.return;try{px(t)}catch(c){Bt(t,s,c)}}}catch(c){Bt(t,t.return,c)}if(t===e){Ee=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Ee=o;break}Ee=t.return}}var Bz=Math.ceil,Wh=ya.ReactCurrentDispatcher,Ub=ya.ReactCurrentOwner,Br=ya.ReactCurrentBatchConfig,nt=0,un=null,Xt=null,wn=0,ur=0,al=gs(0),rn=0,Ru=null,uo=0,gm=0,Vb=0,uu=null,Jn=null,Wb=0,Ol=1/0,Wi=null,Hh=!1,yx=null,ts=null,xf=!1,Ka=null,Kh=0,du=0,xx=null,oh=-1,lh=0;function Hn(){return nt&6?Ht():oh!==-1?oh:oh=Ht()}function ns(e){return e.mode&1?nt&2&&wn!==0?wn&-wn:jz.transition!==null?(lh===0&&(lh=JA()),lh):(e=lt,e!==0||(e=window.event,e=e===void 0?16:sT(e.type)),e):1}function ii(e,t,n,r){if(50<du)throw du=0,xx=null,Error(ge(185));gd(e,n,r),(!(nt&2)||e!==un)&&(e===un&&(!(nt&2)&&(gm|=n),rn===4&&Va(e,wn)),ar(e,r),n===1&&nt===0&&!(t.mode&1)&&(Ol=Ht()+500,fm&&ys()))}function ar(e,t){var n=e.callbackNode;jF(e,t);var r=Ah(e,e===un?wn:0);if(r===0)n!==null&&Pk(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Pk(n),t===1)e.tag===0?kz(vj.bind(null,e)):NT(vj.bind(null,e)),vz(function(){!(nt&6)&&ys()}),n=null;else{switch(eT(r)){case 1:n=gb;break;case 4:n=ZA;break;case 16:n=Eh;break;case 536870912:n=QA;break;default:n=Eh}n=kO(n,gO.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function gO(e,t){if(oh=-1,lh=0,nt&6)throw Error(ge(327));var n=e.callbackNode;if(vl()&&e.callbackNode!==n)return null;var r=Ah(e,e===un?wn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=qh(e,r);else{t=r;var i=nt;nt|=2;var a=xO();(un!==e||wn!==t)&&(Wi=null,Ol=Ht()+500,Js(e,t));do try{Wz();break}catch(o){yO(e,o)}while(!0);Ab(),Wh.current=a,nt=i,Xt!==null?t=0:(un=null,wn=0,t=rn)}if(t!==0){if(t===2&&(i=Hy(e),i!==0&&(r=i,t=vx(e,i))),t===1)throw n=Ru,Js(e,0),Va(e,r),ar(e,Ht()),n;if(t===6)Va(e,r);else{if(i=e.current.alternate,!(r&30)&&!Uz(i)&&(t=qh(e,r),t===2&&(a=Hy(e),a!==0&&(r=a,t=vx(e,a))),t===1))throw n=Ru,Js(e,0),Va(e,r),ar(e,Ht()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ge(345));case 2:Ms(e,Jn,Wi);break;case 3:if(Va(e,r),(r&130023424)===r&&(t=Wb+500-Ht(),10<t)){if(Ah(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Hn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Jy(Ms.bind(null,e,Jn,Wi),t);break}Ms(e,Jn,Wi);break;case 4:if(Va(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ri(r);a=1<<s,s=t[s],s>i&&(i=s),r&=~a}if(r=i,r=Ht()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Bz(r/1960))-r,10<r){e.timeoutHandle=Jy(Ms.bind(null,e,Jn,Wi),r);break}Ms(e,Jn,Wi);break;case 5:Ms(e,Jn,Wi);break;default:throw Error(ge(329))}}}return ar(e,Ht()),e.callbackNode===n?gO.bind(null,e):null}function vx(e,t){var n=uu;return e.current.memoizedState.isDehydrated&&(Js(e,t).flags|=256),e=qh(e,t),e!==2&&(t=Jn,Jn=n,t!==null&&bx(t)),e}function bx(e){Jn===null?Jn=e:Jn.push.apply(Jn,e)}function Uz(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(!li(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 Va(e,t){for(t&=~Vb,t&=~gm,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ri(t),r=1<<n;e[n]=-1,t&=~r}}function vj(e){if(nt&6)throw Error(ge(327));vl();var t=Ah(e,0);if(!(t&1))return ar(e,Ht()),null;var n=qh(e,t);if(e.tag!==0&&n===2){var r=Hy(e);r!==0&&(t=r,n=vx(e,r))}if(n===1)throw n=Ru,Js(e,0),Va(e,t),ar(e,Ht()),n;if(n===6)throw Error(ge(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ms(e,Jn,Wi),ar(e,Ht()),null}function Hb(e,t){var n=nt;nt|=1;try{return e(t)}finally{nt=n,nt===0&&(Ol=Ht()+500,fm&&ys())}}function fo(e){Ka!==null&&Ka.tag===0&&!(nt&6)&&vl();var t=nt;nt|=1;var n=Br.transition,r=lt;try{if(Br.transition=null,lt=1,e)return e()}finally{lt=r,Br.transition=n,nt=t,!(nt&6)&&ys()}}function Kb(){ur=al.current,Nt(al)}function Js(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,xz(n)),Xt!==null)for(n=Xt.return;n!==null;){var r=n;switch(Cb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Mh();break;case 3:Al(),Nt(rr),Nt(Rn),Ib();break;case 5:Mb(r);break;case 4:Al();break;case 13:Nt(Dt);break;case 19:Nt(Dt);break;case 10:Tb(r.type._context);break;case 22:case 23:Kb()}n=n.return}if(un=e,Xt=e=rs(e.current,null),wn=ur=t,rn=0,Ru=null,Vb=gm=uo=0,Jn=uu=null,Ws!==null){for(t=0;t<Ws.length;t++)if(n=Ws[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var s=a.next;a.next=i,r.next=s}n.pending=r}Ws=null}return e}function yO(e,t){do{var n=Xt;try{if(Ab(),ih.current=Vh,Uh){for(var r=It.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Uh=!1}if(co=0,cn=tn=It=null,lu=!1,Mu=0,Ub.current=null,n===null||n.return===null){rn=1,Ru=t,Xt=null;break}e:{var a=e,s=n.return,o=n,c=t;if(t=wn,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=o,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=sj(s);if(p!==null){p.flags&=-257,oj(p,s,o,a,t),p.mode&1&&aj(a,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var y=new Set;y.add(c),t.updateQueue=y}else g.add(c);break e}else{if(!(t&1)){aj(a,u,t),qb();break e}c=Error(ge(426))}}else if(Tt&&o.mode&1){var x=sj(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),oj(x,s,o,a,t),Pb(Tl(c,o));break e}}a=c=Tl(c,o),rn!==4&&(rn=2),uu===null?uu=[a]:uu.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var v=eO(a,c,t);Jk(a,v);break e;case 1:o=c;var b=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ts===null||!ts.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var S=tO(a,o,t);Jk(a,S);break e}}a=a.return}while(a!==null)}bO(n)}catch(k){t=k,Xt===n&&n!==null&&(Xt=n=n.return);continue}break}while(!0)}function xO(){var e=Wh.current;return Wh.current=Vh,e===null?Vh:e}function qb(){(rn===0||rn===3||rn===2)&&(rn=4),un===null||!(uo&268435455)&&!(gm&268435455)||Va(un,wn)}function qh(e,t){var n=nt;nt|=2;var r=xO();(un!==e||wn!==t)&&(Wi=null,Js(e,t));do try{Vz();break}catch(i){yO(e,i)}while(!0);if(Ab(),nt=n,Wh.current=r,Xt!==null)throw Error(ge(261));return un=null,wn=0,rn}function Vz(){for(;Xt!==null;)vO(Xt)}function Wz(){for(;Xt!==null&&!mF();)vO(Xt)}function vO(e){var t=SO(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?bO(e):Xt=t,Ub.current=null}function bO(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Rz(n,t),n!==null){n.flags&=32767,Xt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{rn=6,Xt=null;return}}else if(n=Lz(n,t,ur),n!==null){Xt=n;return}if(t=t.sibling,t!==null){Xt=t;return}Xt=t=e}while(t!==null);rn===0&&(rn=5)}function Ms(e,t,n){var r=lt,i=Br.transition;try{Br.transition=null,lt=1,Hz(e,t,n,r)}finally{Br.transition=i,lt=r}return null}function Hz(e,t,n,r){do vl();while(Ka!==null);if(nt&6)throw Error(ge(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(ge(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(NF(e,a),e===un&&(Xt=un=null,wn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||xf||(xf=!0,kO(Eh,function(){return vl(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Br.transition,Br.transition=null;var s=lt;lt=1;var o=nt;nt|=4,Ub.current=null,zz(e,n),pO(n,e),dz(Zy),Th=!!Xy,Zy=Xy=null,e.current=n,$z(n),gF(),nt=o,lt=s,Br.transition=a}else e.current=n;if(xf&&(xf=!1,Ka=e,Kh=i),a=e.pendingLanes,a===0&&(ts=null),vF(n.stateNode),ar(e,Ht()),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(Hh)throw Hh=!1,e=yx,yx=null,e;return Kh&1&&e.tag!==0&&vl(),a=e.pendingLanes,a&1?e===xx?du++:(du=0,xx=e):du=0,ys(),null}function vl(){if(Ka!==null){var e=eT(Kh),t=Br.transition,n=lt;try{if(Br.transition=null,lt=16>e?16:e,Ka===null)var r=!1;else{if(e=Ka,Ka=null,Kh=0,nt&6)throw Error(ge(331));var i=nt;for(nt|=4,Ee=e.current;Ee!==null;){var a=Ee,s=a.child;if(Ee.flags&16){var o=a.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(Ee=u;Ee!==null;){var d=Ee;switch(d.tag){case 0:case 11:case 15:cu(8,d,a)}var f=d.child;if(f!==null)f.return=d,Ee=f;else for(;Ee!==null;){d=Ee;var h=d.sibling,p=d.return;if(dO(d),d===u){Ee=null;break}if(h!==null){h.return=p,Ee=h;break}Ee=p}}}var g=a.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var x=y.sibling;y.sibling=null,y=x}while(y!==null)}}Ee=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,Ee=s;else e:for(;Ee!==null;){if(a=Ee,a.flags&2048)switch(a.tag){case 0:case 11:case 15:cu(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,Ee=v;break e}Ee=a.return}}var b=e.current;for(Ee=b;Ee!==null;){s=Ee;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,Ee=w;else e:for(s=b;Ee!==null;){if(o=Ee,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:mm(9,o)}}catch(k){Bt(o,o.return,k)}if(o===s){Ee=null;break e}var S=o.sibling;if(S!==null){S.return=o.return,Ee=S;break e}Ee=o.return}}if(nt=i,ys(),Pi&&typeof Pi.onPostCommitFiberRoot=="function")try{Pi.onPostCommitFiberRoot(om,e)}catch{}r=!0}return r}finally{lt=n,Br.transition=t}}return!1}function bj(e,t,n){t=Tl(n,t),t=eO(e,t,1),e=es(e,t,1),t=Hn(),e!==null&&(gd(e,1,t),ar(e,t))}function Bt(e,t,n){if(e.tag===3)bj(e,e,n);else for(;t!==null;){if(t.tag===3){bj(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ts===null||!ts.has(r))){e=Tl(n,e),e=tO(t,e,1),t=es(t,e,1),e=Hn(),t!==null&&(gd(t,1,e),ar(t,e));break}}t=t.return}}function Kz(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Hn(),e.pingedLanes|=e.suspendedLanes&n,un===e&&(wn&n)===n&&(rn===4||rn===3&&(wn&130023424)===wn&&500>Ht()-Wb?Js(e,0):Vb|=n),ar(e,t)}function wO(e,t){t===0&&(e.mode&1?(t=lf,lf<<=1,!(lf&130023424)&&(lf=4194304)):t=1);var n=Hn();e=la(e,t),e!==null&&(gd(e,t,n),ar(e,n))}function qz(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wO(e,n)}function Gz(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(ge(314))}r!==null&&r.delete(t),wO(e,n)}var SO;SO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rr.current)er=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return er=!1,Iz(e,t,n);er=!!(e.flags&131072)}else er=!1,Tt&&t.flags&1048576&&CT(t,Rh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;sh(e,t),e=t.pendingProps;var i=Cl(t,Rn.current);xl(t,n),i=Rb(null,t,r,e,i,n);var a=Fb();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ir(r)?(a=!0,Ih(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,_b(t),i.updater=pm,t.stateNode=i,i._reactInternals=t,sx(t,r,e,n),t=cx(null,t,r,!0,a,n)):(t.tag=0,Tt&&a&&Nb(t),Bn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(sh(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Xz(r),e=Xr(r,e),i){case 0:t=lx(null,t,r,e,n);break e;case 1:t=uj(null,t,r,e,n);break e;case 11:t=lj(null,t,r,e,n);break e;case 14:t=cj(null,t,r,Xr(r.type,e),n);break e}throw Error(ge(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Xr(r,i),lx(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Xr(r,i),uj(e,t,r,i,n);case 3:e:{if(aO(t),e===null)throw Error(ge(387));r=t.pendingProps,a=t.memoizedState,i=a.element,_T(e,t),$h(t,r,null,n);var s=t.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Tl(Error(ge(423)),t),t=dj(e,t,r,n,i);break e}else if(r!==i){i=Tl(Error(ge(424)),t),t=dj(e,t,r,n,i);break e}else for(hr=Ja(t.stateNode.containerInfo.firstChild),mr=t,Tt=!0,Jr=null,n=TT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pl(),r===i){t=ca(e,t,n);break e}Bn(e,t,r,n)}t=t.child}return t;case 5:return DT(t),e===null&&rx(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,Qy(r,i)?s=null:a!==null&&Qy(r,a)&&(t.flags|=32),iO(e,t),Bn(e,t,s,n),t.child;case 6:return e===null&&rx(t),null;case 13:return sO(e,t,n);case 4:return Db(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=El(t,null,r,n):Bn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Xr(r,i),lj(e,t,r,i,n);case 7:return Bn(e,t,t.pendingProps,n),t.child;case 8:return Bn(e,t,t.pendingProps.children,n),t.child;case 12:return Bn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,bt(Fh,r._currentValue),r._currentValue=s,a!==null)if(li(a.value,s)){if(a.children===i.children&&!rr.current){t=ca(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var o=a.dependencies;if(o!==null){s=a.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=Qi(-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),ix(a.return,n,t),o.lanes|=n;break}c=c.next}}else if(a.tag===10)s=a.type===t.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(ge(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ix(s,n,t),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Bn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,xl(t,n),i=Vr(i),r=r(i),t.flags|=1,Bn(e,t,r,n),t.child;case 14:return r=t.type,i=Xr(r,t.pendingProps),i=Xr(r.type,i),cj(e,t,r,i,n);case 15:return nO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Xr(r,i),sh(e,t),t.tag=1,ir(r)?(e=!0,Ih(t)):e=!1,xl(t,n),JT(t,r,i),sx(t,r,i,n),cx(null,t,r,!0,e,n);case 19:return oO(e,t,n);case 22:return rO(e,t,n)}throw Error(ge(156,t.tag))};function kO(e,t){return XA(e,t)}function Yz(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 Rr(e,t,n,r){return new Yz(e,t,n,r)}function Gb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xz(e){if(typeof e=="function")return Gb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hb)return 11;if(e===pb)return 14}return 2}function rs(e,t){var n=e.alternate;return n===null?(n=Rr(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 ch(e,t,n,r,i,a){var s=2;if(r=e,typeof e=="function")Gb(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Yo:return eo(n.children,i,a,t);case fb:s=8,i|=8;break;case Ty:return e=Rr(12,n,t,i|2),e.elementType=Ty,e.lanes=a,e;case Oy:return e=Rr(13,n,t,i),e.elementType=Oy,e.lanes=a,e;case _y:return e=Rr(19,n,t,i),e.elementType=_y,e.lanes=a,e;case DA:return ym(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case OA:s=10;break e;case _A:s=9;break e;case hb:s=11;break e;case pb:s=14;break e;case Fa:s=16,r=null;break e}throw Error(ge(130,e==null?e:typeof e,""))}return t=Rr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function eo(e,t,n,r){return e=Rr(7,e,r,t),e.lanes=n,e}function ym(e,t,n,r){return e=Rr(22,e,r,t),e.elementType=DA,e.lanes=n,e.stateNode={isHidden:!1},e}function f0(e,t,n){return e=Rr(6,e,null,t),e.lanes=n,e}function h0(e,t,n){return t=Rr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zz(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=qg(0),this.expirationTimes=qg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qg(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Yb(e,t,n,r,i,a,s,o,c){return e=new Zz(e,t,n,o,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Rr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_b(a),e}function Qz(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Go,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function jO(e){if(!e)return ls;e=e._reactInternals;e:{if(No(e)!==e||e.tag!==1)throw Error(ge(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ir(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ge(171))}if(e.tag===1){var n=e.type;if(ir(n))return jT(e,n,t)}return t}function NO(e,t,n,r,i,a,s,o,c){return e=Yb(n,r,!0,e,i,a,s,o,c),e.context=jO(null),n=e.current,r=Hn(),i=ns(n),a=Qi(r,i),a.callback=t??null,es(n,a,i),e.current.lanes=i,gd(e,i,r),ar(e,r),e}function xm(e,t,n,r){var i=t.current,a=Hn(),s=ns(i);return n=jO(n),t.context===null?t.context=n:t.pendingContext=n,t=Qi(a,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=es(i,t,s),e!==null&&(ii(e,i,s,a),rh(e,i,s)),s}function Gh(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 wj(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Xb(e,t){wj(e,t),(e=e.alternate)&&wj(e,t)}function Jz(){return null}var CO=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zb(e){this._internalRoot=e}vm.prototype.render=Zb.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ge(409));xm(e,t,null,null)};vm.prototype.unmount=Zb.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fo(function(){xm(null,e,null,null)}),t[oa]=null}};function vm(e){this._internalRoot=e}vm.prototype.unstable_scheduleHydration=function(e){if(e){var t=rT();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ua.length&&t!==0&&t<Ua[n].priority;n++);Ua.splice(n,0,e),n===0&&aT(e)}};function Qb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Sj(){}function e$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=Gh(s);a.call(u)}}var s=NO(t,r,e,0,null,!1,!1,"",Sj);return e._reactRootContainer=s,e[oa]=s.current,Au(e.nodeType===8?e.parentNode:e),fo(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=Gh(c);o.call(u)}}var c=Yb(e,0,!1,null,null,!1,!1,"",Sj);return e._reactRootContainer=c,e[oa]=c.current,Au(e.nodeType===8?e.parentNode:e),fo(function(){xm(t,c,n,r)}),c}function wm(e,t,n,r,i){var a=n._reactRootContainer;if(a){var s=a;if(typeof i=="function"){var o=i;i=function(){var c=Gh(s);o.call(c)}}xm(t,s,e,i)}else s=e$(n,t,e,i,r);return Gh(s)}tT=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Gc(t.pendingLanes);n!==0&&(yb(t,n|1),ar(t,Ht()),!(nt&6)&&(Ol=Ht()+500,ys()))}break;case 13:fo(function(){var r=la(e,1);if(r!==null){var i=Hn();ii(r,e,1,i)}}),Xb(e,1)}};xb=function(e){if(e.tag===13){var t=la(e,134217728);if(t!==null){var n=Hn();ii(t,e,134217728,n)}Xb(e,134217728)}};nT=function(e){if(e.tag===13){var t=ns(e),n=la(e,t);if(n!==null){var r=Hn();ii(n,e,t,r)}Xb(e,t)}};rT=function(){return lt};iT=function(e,t){var n=lt;try{return lt=e,t()}finally{lt=n}};Uy=function(e,t,n){switch(t){case"input":if(Iy(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=dm(r);if(!i)throw Error(ge(90));IA(r),Iy(r,i)}}}break;case"textarea":RA(e,n);break;case"select":t=n.value,t!=null&&pl(e,!!n.multiple,t,!1)}};WA=Hb;HA=fo;var t$={usingClientEntryPoint:!1,Events:[xd,Jo,dm,UA,VA,Hb]},jc={findFiberByHostInstance:Vs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n$={bundleType:jc.bundleType,version:jc.version,rendererPackageName:jc.rendererPackageName,rendererConfig:jc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ya.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=GA(e),e===null?null:e.stateNode},findFiberByHostInstance:jc.findFiberByHostInstance||Jz,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 vf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vf.isDisabled&&vf.supportsFiber)try{om=vf.inject(n$),Pi=vf}catch{}}Nr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t$;Nr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qb(t))throw Error(ge(200));return Qz(e,t,null,n)};Nr.createRoot=function(e,t){if(!Qb(e))throw Error(ge(299));var n=!1,r="",i=CO;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Yb(e,1,!1,null,null,n,!1,r,i),e[oa]=t.current,Au(e.nodeType===8?e.parentNode:e),new Zb(t)};Nr.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(ge(188)):(e=Object.keys(e).join(","),Error(ge(268,e)));return e=GA(t),e=e===null?null:e.stateNode,e};Nr.flushSync=function(e){return fo(e)};Nr.hydrate=function(e,t,n){if(!bm(t))throw Error(ge(200));return wm(null,e,t,!0,n)};Nr.hydrateRoot=function(e,t,n){if(!Qb(e))throw Error(ge(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=CO;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=NO(t,null,e,1,n??null,i,!1,a,s),e[oa]=t.current,Au(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 vm(t)};Nr.render=function(e,t,n){if(!bm(t))throw Error(ge(200));return wm(null,e,t,!1,n)};Nr.unmountComponentAtNode=function(e){if(!bm(e))throw Error(ge(40));return e._reactRootContainer?(fo(function(){wm(null,null,e,!1,function(){e._reactRootContainer=null,e[oa]=null})}),!0):!1};Nr.unstable_batchedUpdates=Hb;Nr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!bm(n))throw Error(ge(200));if(e==null||e._reactInternals===void 0)throw Error(ge(38));return wm(e,t,n,!1,r)};Nr.version="18.3.1-next-f1338f8080-20240426";function PO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(PO)}catch(e){console.error(e)}}PO(),PA.exports=Nr;var Co=PA.exports;const r$=fi(Co),i$=pA({__proto__:null,default:r$},[Co]);var kj=Co;Ey.createRoot=kj.createRoot,Ey.hydrateRoot=kj.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.2
|
|
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 At(){return At=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},At.apply(this,arguments)}var Yt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Yt||(Yt={}));const jj="popstate";function a$(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:s,hash:o}=r.location;return Fu("",{pathname:a,search:s,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:po(i)}return o$(t,n,null,e)}function He(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ho(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function s$(){return Math.random().toString(36).substr(2,8)}function Nj(e,t){return{usr:e.state,key:e.key,idx:t}}function Fu(e,t,n,r){return n===void 0&&(n=null),At({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?xs(t):t,{state:n,key:t&&t.key||r||s$()})}function po(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 xs(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 o$(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,o=Yt.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(At({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){o=Yt.Pop;let x=d(),v=x==null?null:x-u;u=x,c&&c({action:o,location:y.location,delta:v})}function h(x,v){o=Yt.Push;let b=Fu(y.location,x,v);u=d()+1;let w=Nj(b,u),S=y.createHref(b);try{s.pushState(w,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(S)}a&&c&&c({action:o,location:y.location,delta:1})}function p(x,v){o=Yt.Replace;let b=Fu(y.location,x,v);u=d();let w=Nj(b,u),S=y.createHref(b);s.replaceState(w,"",S),a&&c&&c({action:o,location:y.location,delta:0})}function g(x){let v=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof x=="string"?x:po(x);return b=b.replace(/ $/,"%20"),He(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let y={get action(){return o},get location(){return e(i,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(jj,f),c=x,()=>{i.removeEventListener(jj,f),c=null}},createHref(x){return t(i,x)},createURL:g,encodeLocation(x){let v=g(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:p,go(x){return s.go(x)}};return y}var ot;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ot||(ot={}));const l$=new Set(["lazy","caseSensitive","path","id","index","children"]);function c$(e){return e.index===!0}function Yh(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,a)=>{let s=[...n,String(a)],o=typeof i.id=="string"?i.id:s.join("-");if(He(i.index!==!0||!i.children,"Cannot specify children on an index route"),He(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),c$(i)){let c=At({},i,t(i),{id:o});return r[o]=c,c}else{let c=At({},i,t(i),{id:o,children:void 0});return r[o]=c,i.children&&(c.children=Yh(i.children,t,s,r)),c}})}function $s(e,t,n){return n===void 0&&(n="/"),uh(e,t,n,!1)}function uh(e,t,n,r){let i=typeof t=="string"?xs(t):t,a=ci(i.pathname||"/",n);if(a==null)return null;let s=EO(e);d$(s);let o=null;for(let c=0;o==null&&c<s.length;++c){let u=S$(a);o=b$(s[c],u,r)}return o}function u$(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function EO(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,s,o)=>{let c={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};c.relativePath.startsWith("/")&&(He(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=Ji([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(He(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),EO(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:x$(u,a.index),routesMeta:d})};return e.forEach((a,s)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))i(a,s);else for(let c of AO(a.path))i(a,s,c)}),t}function AO(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 s=AO(r.join("/")),o=[];return o.push(...s.map(c=>c===""?a:[a,c].join("/"))),i&&o.push(...s),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function d$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:v$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const f$=/^:[\w-]+$/,h$=3,p$=2,m$=1,g$=10,y$=-2,Cj=e=>e==="*";function x$(e,t){let n=e.split("/"),r=n.length;return n.some(Cj)&&(r+=y$),t&&(r+=p$),n.filter(i=>!Cj(i)).reduce((i,a)=>i+(f$.test(a)?h$:a===""?m$:g$),r)}function v$(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 b$(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a="/",s=[];for(let o=0;o<r.length;++o){let c=r[o],u=o===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=Xh({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=Xh({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(i,f.params),s.push({params:i,pathname:Ji([a,f.pathname]),pathnameBase:C$(Ji([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=Ji([a,f.pathnameBase]))}return s}function Xh(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],s=a.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let y=o[f]||"";s=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const g=o[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function w$(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ho(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,(s,o,c)=>(r.push({paramName:o,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 S$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ho(!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 ci(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 k$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,j$=e=>k$.test(e);function N$(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?xs(e):e,a;if(n)if(j$(n))a=n;else{if(n.includes("//")){let s=n;n=n.replace(/\/\/+/g,"/"),ho(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?a=Pj(n.substring(1),"/"):a=Pj(n,t)}else a=t;return{pathname:a,search:P$(r),hash:E$(i)}}function Pj(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 p0(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 TO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Sm(e,t){let n=TO(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function km(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=xs(e):(i=At({},e),He(!i.pathname||!i.pathname.includes("?"),p0("?","pathname","search",i)),He(!i.pathname||!i.pathname.includes("#"),p0("#","pathname","hash",i)),He(!i.search||!i.search.includes("#"),p0("#","search","hash",i)));let a=e===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}o=f>=0?t[f]:"/"}let c=N$(i,o),u=s&&s!=="/"&&s.endsWith("/"),d=(a||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Ji=e=>e.join("/").replace(/\/\/+/g,"/"),C$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),P$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,E$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Zh{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function zu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const OO=["post","put","patch","delete"],A$=new Set(OO),T$=["get",...OO],O$=new Set(T$),_$=new Set([301,302,303,307,308]),D$=new Set([307,308]),m0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},M$={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ho={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Jb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,I$=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),_O="remix-router-transitions";function L$(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;He(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let z=e.detectErrorBoundary;i=V=>({hasErrorBoundary:z(V)})}else i=I$;let a={},s=Yh(e.routes,i,void 0,a),o,c=e.basename||"/",u=e.dataStrategy||$$,d=e.patchRoutesOnNavigation,f=At({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,p=new Set,g=null,y=null,x=null,v=e.hydrationData!=null,b=$s(s,e.history.location,c),w=!1,S=null;if(b==null&&!d){let z=Qn(404,{pathname:e.history.location.pathname}),{matches:V,route:X}=Fj(s);b=V,S={[X.id]:z}}b&&!e.hydrationData&&qr(b,s,e.history.location.pathname).active&&(b=null);let k;if(b)if(b.some(z=>z.route.lazy))k=!1;else if(!b.some(z=>z.route.loader))k=!0;else if(f.v7_partialHydration){let z=e.hydrationData?e.hydrationData.loaderData:null,V=e.hydrationData?e.hydrationData.errors:null;if(V){let X=b.findIndex(he=>V[he.route.id]!==void 0);k=b.slice(0,X+1).every(he=>!Sx(he.route,z,V))}else k=b.every(X=>!Sx(X.route,z,V))}else k=e.hydrationData!=null;else if(k=!1,b=[],f.v7_partialHydration){let z=qr(null,s,e.history.location.pathname);z.active&&z.matches&&(w=!0,b=z.matches)}let j,N={historyAction:e.history.action,location:e.history.location,matches:b,initialized:k,navigation:m0,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},P=Yt.Pop,T=!1,E,_=!1,C=new Map,A=null,M=!1,B=!1,ae=[],Q=new Set,I=new Map,H=0,O=-1,oe=new Map,re=new Set,D=new Map,G=new Map,te=new Set,ee=new Map,Z=new Map,ce;function J(){if(h=e.history.listen(z=>{let{action:V,location:X,delta:he}=z;if(ce){ce(),ce=void 0;return}ho(Z.size===0||he!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let $=Me({currentLocation:N.location,nextLocation:X,historyAction:V});if($&&he!=null){let K=new Promise(ie=>{ce=ie});e.history.go(he*-1),de($,{state:"blocked",location:X,proceed(){de($,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),K.then(()=>e.history.go(he))},reset(){let ie=new Map(N.blockers);ie.set($,Ho),Y({blockers:ie})}});return}return le(V,X)}),n){e7(t,C);let z=()=>t7(t,C);t.addEventListener("pagehide",z),A=()=>t.removeEventListener("pagehide",z)}return N.initialized||le(Yt.Pop,N.location,{initialHydration:!0}),j}function ne(){h&&h(),A&&A(),p.clear(),E&&E.abort(),N.fetchers.forEach((z,V)=>ye(V)),N.blockers.forEach((z,V)=>Et(V))}function be(z){return p.add(z),()=>p.delete(z)}function Y(z,V){V===void 0&&(V={}),N=At({},N,z);let X=[],he=[];f.v7_fetcherPersist&&N.fetchers.forEach(($,K)=>{$.state==="idle"&&(te.has(K)?he.push(K):X.push(K))}),te.forEach($=>{!N.fetchers.has($)&&!I.has($)&&he.push($)}),[...p].forEach($=>$(N,{deletedFetchers:he,viewTransitionOpts:V.viewTransitionOpts,flushSync:V.flushSync===!0})),f.v7_fetcherPersist?(X.forEach($=>N.fetchers.delete($)),he.forEach($=>ye($))):he.forEach($=>te.delete($))}function R(z,V,X){var he,$;let{flushSync:K}=X===void 0?{}:X,ie=N.actionData!=null&&N.navigation.formMethod!=null&&Qr(N.navigation.formMethod)&&N.navigation.state==="loading"&&((he=z.state)==null?void 0:he._isRedirect)!==!0,ve;V.actionData?Object.keys(V.actionData).length>0?ve=V.actionData:ve=null:ie?ve=N.actionData:ve=null;let we=V.loaderData?Lj(N.loaderData,V.loaderData,V.matches||[],V.errors):N.loaderData,ke=N.blockers;ke.size>0&&(ke=new Map(ke),ke.forEach((Se,Ne)=>ke.set(Ne,Ho)));let Ce=T===!0||N.navigation.formMethod!=null&&Qr(N.navigation.formMethod)&&(($=z.state)==null?void 0:$._isRedirect)!==!0;o&&(s=o,o=void 0),M||P===Yt.Pop||(P===Yt.Push?e.history.push(z,z.state):P===Yt.Replace&&e.history.replace(z,z.state));let fe;if(P===Yt.Pop){let Se=C.get(N.location.pathname);Se&&Se.has(z.pathname)?fe={currentLocation:N.location,nextLocation:z}:C.has(z.pathname)&&(fe={currentLocation:z,nextLocation:N.location})}else if(_){let Se=C.get(N.location.pathname);Se?Se.add(z.pathname):(Se=new Set([z.pathname]),C.set(N.location.pathname,Se)),fe={currentLocation:N.location,nextLocation:z}}Y(At({},V,{actionData:ve,loaderData:we,historyAction:P,location:z,initialized:!0,navigation:m0,revalidation:"idle",restoreScrollPosition:Ns(z,V.matches||N.matches),preventScrollReset:Ce,blockers:ke}),{viewTransitionOpts:fe,flushSync:K===!0}),P=Yt.Pop,T=!1,_=!1,M=!1,B=!1,ae=[]}async function F(z,V){if(typeof z=="number"){e.history.go(z);return}let X=wx(N.location,N.matches,c,f.v7_prependBasename,z,f.v7_relativeSplatPath,V==null?void 0:V.fromRouteId,V==null?void 0:V.relative),{path:he,submission:$,error:K}=Ej(f.v7_normalizeFormMethod,!1,X,V),ie=N.location,ve=Fu(N.location,he,V&&V.state);ve=At({},ve,e.history.encodeLocation(ve));let we=V&&V.replace!=null?V.replace:void 0,ke=Yt.Push;we===!0?ke=Yt.Replace:we===!1||$!=null&&Qr($.formMethod)&&$.formAction===N.location.pathname+N.location.search&&(ke=Yt.Replace);let Ce=V&&"preventScrollReset"in V?V.preventScrollReset===!0:void 0,fe=(V&&V.flushSync)===!0,Se=Me({currentLocation:ie,nextLocation:ve,historyAction:ke});if(Se){de(Se,{state:"blocked",location:ve,proceed(){de(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:ve}),F(z,V)},reset(){let Ne=new Map(N.blockers);Ne.set(Se,Ho),Y({blockers:Ne})}});return}return await le(ke,ve,{submission:$,pendingError:K,preventScrollReset:Ce,replace:V&&V.replace,enableViewTransition:V&&V.viewTransition,flushSync:fe})}function ue(){if(se(),Y({revalidation:"loading"}),N.navigation.state!=="submitting"){if(N.navigation.state==="idle"){le(N.historyAction,N.location,{startUninterruptedRevalidation:!0});return}le(P||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:_===!0})}}async function le(z,V,X){E&&E.abort(),E=null,P=z,M=(X&&X.startUninterruptedRevalidation)===!0,pc(N.location,N.matches),T=(X&&X.preventScrollReset)===!0,_=(X&&X.enableViewTransition)===!0;let he=o||s,$=X&&X.overrideNavigation,K=X!=null&&X.initialHydration&&N.matches&&N.matches.length>0&&!w?N.matches:$s(he,V,c),ie=(X&&X.flushSync)===!0;if(K&&N.initialized&&!B&&K$(N.location,V)&&!(X&&X.submission&&Qr(X.submission.formMethod))){R(V,{matches:K},{flushSync:ie});return}let ve=qr(K,he,V.pathname);if(ve.active&&ve.matches&&(K=ve.matches),!K){let{error:$e,notFoundMatches:Pe,route:Re}=Ke(V.pathname);R(V,{matches:Pe,loaderData:{},errors:{[Re.id]:$e}},{flushSync:ie});return}E=new AbortController;let we=Lo(e.history,V,E.signal,X&&X.submission),ke;if(X&&X.pendingError)ke=[Bs(K).route.id,{type:ot.error,error:X.pendingError}];else if(X&&X.submission&&Qr(X.submission.formMethod)){let $e=await ze(we,V,X.submission,K,ve.active,{replace:X.replace,flushSync:ie});if($e.shortCircuited)return;if($e.pendingActionResult){let[Pe,Re]=$e.pendingActionResult;if(dr(Re)&&zu(Re.error)&&Re.error.status===404){E=null,R(V,{matches:$e.matches,loaderData:{},errors:{[Pe]:Re.error}});return}}K=$e.matches||K,ke=$e.pendingActionResult,$=g0(V,X.submission),ie=!1,ve.active=!1,we=Lo(e.history,we.url,we.signal)}let{shortCircuited:Ce,matches:fe,loaderData:Se,errors:Ne}=await Be(we,V,K,ve.active,$,X&&X.submission,X&&X.fetcherSubmission,X&&X.replace,X&&X.initialHydration===!0,ie,ke);Ce||(E=null,R(V,At({matches:fe||K},Rj(ke),{loaderData:Se,errors:Ne})))}async function ze(z,V,X,he,$,K){K===void 0&&(K={}),se();let ie=Q$(V,X);if(Y({navigation:ie},{flushSync:K.flushSync===!0}),$){let ke=await pi(he,V.pathname,z.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){let Ce=Bs(ke.partialMatches).route.id;return{matches:ke.partialMatches,pendingActionResult:[Ce,{type:ot.error,error:ke.error}]}}else if(ke.matches)he=ke.matches;else{let{notFoundMatches:Ce,error:fe,route:Se}=Ke(V.pathname);return{matches:Ce,pendingActionResult:[Se.id,{type:ot.error,error:fe}]}}}let ve,we=Xc(he,V);if(!we.route.action&&!we.route.lazy)ve={type:ot.error,error:Qn(405,{method:z.method,pathname:V.pathname,routeId:we.route.id})};else if(ve=(await je("action",N,z,[we],he,null))[we.route.id],z.signal.aborted)return{shortCircuited:!0};if(Ks(ve)){let ke;return K&&K.replace!=null?ke=K.replace:ke=Dj(ve.response.headers.get("Location"),new URL(z.url),c,e.history)===N.location.pathname+N.location.search,await tt(z,ve,!0,{submission:X,replace:ke}),{shortCircuited:!0}}if(qa(ve))throw Qn(400,{type:"defer-action"});if(dr(ve)){let ke=Bs(he,we.route.id);return(K&&K.replace)!==!0&&(P=Yt.Push),{matches:he,pendingActionResult:[ke.route.id,ve]}}return{matches:he,pendingActionResult:[we.route.id,ve]}}async function Be(z,V,X,he,$,K,ie,ve,we,ke,Ce){let fe=$||g0(V,K),Se=K||ie||$j(fe),Ne=!M&&(!f.v7_partialHydration||!we);if(he){if(Ne){let Ft=et(Ce);Y(At({navigation:fe},Ft!==void 0?{actionData:Ft}:{}),{flushSync:ke})}let it=await pi(X,V.pathname,z.signal);if(it.type==="aborted")return{shortCircuited:!0};if(it.type==="error"){let Ft=Bs(it.partialMatches).route.id;return{matches:it.partialMatches,loaderData:{},errors:{[Ft]:it.error}}}else if(it.matches)X=it.matches;else{let{error:Ft,notFoundMatches:Do,route:gc}=Ke(V.pathname);return{matches:Do,loaderData:{},errors:{[gc.id]:Ft}}}}let $e=o||s,[Pe,Re]=Tj(e.history,N,X,Se,V,f.v7_partialHydration&&we===!0,f.v7_skipActionErrorRevalidation,B,ae,Q,te,D,re,$e,c,Ce);if(yt(it=>!(X&&X.some(Ft=>Ft.route.id===it))||Pe&&Pe.some(Ft=>Ft.route.id===it)),O=++H,Pe.length===0&&Re.length===0){let it=rt();return R(V,At({matches:X,loaderData:{},errors:Ce&&dr(Ce[1])?{[Ce[0]]:Ce[1].error}:null},Rj(Ce),it?{fetchers:new Map(N.fetchers)}:{}),{flushSync:ke}),{shortCircuited:!0}}if(Ne){let it={};if(!he){it.navigation=fe;let Ft=et(Ce);Ft!==void 0&&(it.actionData=Ft)}Re.length>0&&(it.fetchers=pt(Re)),Y(it,{flushSync:ke})}Re.forEach(it=>{Ue(it.key),it.controller&&I.set(it.key,it.controller)});let st=()=>Re.forEach(it=>Ue(it.key));E&&E.signal.addEventListener("abort",st);let{loaderResults:Ye,fetcherResults:Ui}=await W(N,X,Pe,Re,z);if(z.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener("abort",st),Re.forEach(it=>I.delete(it.key));let mi=bf(Ye);if(mi)return await tt(z,mi.result,!0,{replace:ve}),{shortCircuited:!0};if(mi=bf(Ui),mi)return re.add(mi.key),await tt(z,mi.result,!0,{replace:ve}),{shortCircuited:!0};let{loaderData:$g,errors:mc}=Ij(N,X,Ye,Ce,Re,Ui,ee);ee.forEach((it,Ft)=>{it.subscribe(Do=>{(Do||it.done)&&ee.delete(Ft)})}),f.v7_partialHydration&&we&&N.errors&&(mc=At({},N.errors,mc));let Cs=rt(),ef=gt(O),tf=Cs||ef||Re.length>0;return At({matches:X,loaderData:$g,errors:mc},tf?{fetchers:new Map(N.fetchers)}:{})}function et(z){if(z&&!dr(z[1]))return{[z[0]]:z[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function pt(z){return z.forEach(V=>{let X=N.fetchers.get(V.key),he=Nc(void 0,X?X.data:void 0);N.fetchers.set(V.key,he)}),new Map(N.fetchers)}function Pt(z,V,X,he){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ue(z);let $=(he&&he.flushSync)===!0,K=o||s,ie=wx(N.location,N.matches,c,f.v7_prependBasename,X,f.v7_relativeSplatPath,V,he==null?void 0:he.relative),ve=$s(K,ie,c),we=qr(ve,K,ie);if(we.active&&we.matches&&(ve=we.matches),!ve){pe(z,V,Qn(404,{pathname:ie}),{flushSync:$});return}let{path:ke,submission:Ce,error:fe}=Ej(f.v7_normalizeFormMethod,!0,ie,he);if(fe){pe(z,V,fe,{flushSync:$});return}let Se=Xc(ve,ke),Ne=(he&&he.preventScrollReset)===!0;if(Ce&&Qr(Ce.formMethod)){Vt(z,V,ke,Se,ve,we.active,$,Ne,Ce);return}D.set(z,{routeId:V,path:ke}),ut(z,V,ke,Se,ve,we.active,$,Ne,Ce)}async function Vt(z,V,X,he,$,K,ie,ve,we){se(),D.delete(z);function ke(qt){if(!qt.route.action&&!qt.route.lazy){let Mo=Qn(405,{method:we.formMethod,pathname:X,routeId:V});return pe(z,V,Mo,{flushSync:ie}),!0}return!1}if(!K&&ke(he))return;let Ce=N.fetchers.get(z);Te(z,J$(we,Ce),{flushSync:ie});let fe=new AbortController,Se=Lo(e.history,X,fe.signal,we);if(K){let qt=await pi($,new URL(Se.url).pathname,Se.signal,z);if(qt.type==="aborted")return;if(qt.type==="error"){pe(z,V,qt.error,{flushSync:ie});return}else if(qt.matches){if($=qt.matches,he=Xc($,X),ke(he))return}else{pe(z,V,Qn(404,{pathname:X}),{flushSync:ie});return}}I.set(z,fe);let Ne=H,Pe=(await je("action",N,Se,[he],$,z))[he.route.id];if(Se.signal.aborted){I.get(z)===fe&&I.delete(z);return}if(f.v7_fetcherPersist&&te.has(z)){if(Ks(Pe)||dr(Pe)){Te(z,La(void 0));return}}else{if(Ks(Pe))if(I.delete(z),O>Ne){Te(z,La(void 0));return}else return re.add(z),Te(z,Nc(we)),tt(Se,Pe,!1,{fetcherSubmission:we,preventScrollReset:ve});if(dr(Pe)){pe(z,V,Pe.error);return}}if(qa(Pe))throw Qn(400,{type:"defer-action"});let Re=N.navigation.location||N.location,st=Lo(e.history,Re,fe.signal),Ye=o||s,Ui=N.navigation.state!=="idle"?$s(Ye,N.navigation.location,c):N.matches;He(Ui,"Didn't find any matches after fetcher action");let mi=++H;oe.set(z,mi);let $g=Nc(we,Pe.data);N.fetchers.set(z,$g);let[mc,Cs]=Tj(e.history,N,Ui,we,Re,!1,f.v7_skipActionErrorRevalidation,B,ae,Q,te,D,re,Ye,c,[he.route.id,Pe]);Cs.filter(qt=>qt.key!==z).forEach(qt=>{let Mo=qt.key,pk=N.fetchers.get(Mo),E6=Nc(void 0,pk?pk.data:void 0);N.fetchers.set(Mo,E6),Ue(Mo),qt.controller&&I.set(Mo,qt.controller)}),Y({fetchers:new Map(N.fetchers)});let ef=()=>Cs.forEach(qt=>Ue(qt.key));fe.signal.addEventListener("abort",ef);let{loaderResults:tf,fetcherResults:it}=await W(N,Ui,mc,Cs,st);if(fe.signal.aborted)return;fe.signal.removeEventListener("abort",ef),oe.delete(z),I.delete(z),Cs.forEach(qt=>I.delete(qt.key));let Ft=bf(tf);if(Ft)return tt(st,Ft.result,!1,{preventScrollReset:ve});if(Ft=bf(it),Ft)return re.add(Ft.key),tt(st,Ft.result,!1,{preventScrollReset:ve});let{loaderData:Do,errors:gc}=Ij(N,Ui,tf,void 0,Cs,it,ee);if(N.fetchers.has(z)){let qt=La(Pe.data);N.fetchers.set(z,qt)}gt(mi),N.navigation.state==="loading"&&mi>O?(He(P,"Expected pending action"),E&&E.abort(),R(N.navigation.location,{matches:Ui,loaderData:Do,errors:gc,fetchers:new Map(N.fetchers)})):(Y({errors:gc,loaderData:Lj(N.loaderData,Do,Ui,gc),fetchers:new Map(N.fetchers)}),B=!1)}async function ut(z,V,X,he,$,K,ie,ve,we){let ke=N.fetchers.get(z);Te(z,Nc(we,ke?ke.data:void 0),{flushSync:ie});let Ce=new AbortController,fe=Lo(e.history,X,Ce.signal);if(K){let Pe=await pi($,new URL(fe.url).pathname,fe.signal,z);if(Pe.type==="aborted")return;if(Pe.type==="error"){pe(z,V,Pe.error,{flushSync:ie});return}else if(Pe.matches)$=Pe.matches,he=Xc($,X);else{pe(z,V,Qn(404,{pathname:X}),{flushSync:ie});return}}I.set(z,Ce);let Se=H,$e=(await je("loader",N,fe,[he],$,z))[he.route.id];if(qa($e)&&($e=await ew($e,fe.signal,!0)||$e),I.get(z)===Ce&&I.delete(z),!fe.signal.aborted){if(te.has(z)){Te(z,La(void 0));return}if(Ks($e))if(O>Se){Te(z,La(void 0));return}else{re.add(z),await tt(fe,$e,!1,{preventScrollReset:ve});return}if(dr($e)){pe(z,V,$e.error);return}He(!qa($e),"Unhandled fetcher deferred data"),Te(z,La($e.data))}}async function tt(z,V,X,he){let{submission:$,fetcherSubmission:K,preventScrollReset:ie,replace:ve}=he===void 0?{}:he;V.response.headers.has("X-Remix-Revalidate")&&(B=!0);let we=V.response.headers.get("Location");He(we,"Expected a Location header on the redirect Response"),we=Dj(we,new URL(z.url),c,e.history);let ke=Fu(N.location,we,{_isRedirect:!0});if(n){let Pe=!1;if(V.response.headers.has("X-Remix-Reload-Document"))Pe=!0;else if(Jb.test(we)){const Re=e.history.createURL(we);Pe=Re.origin!==t.location.origin||ci(Re.pathname,c)==null}if(Pe){ve?t.location.replace(we):t.location.assign(we);return}}E=null;let Ce=ve===!0||V.response.headers.has("X-Remix-Replace")?Yt.Replace:Yt.Push,{formMethod:fe,formAction:Se,formEncType:Ne}=N.navigation;!$&&!K&&fe&&Se&&Ne&&($=$j(N.navigation));let $e=$||K;if(D$.has(V.response.status)&&$e&&Qr($e.formMethod))await le(Ce,ke,{submission:At({},$e,{formAction:we}),preventScrollReset:ie||T,enableViewTransition:X?_:void 0});else{let Pe=g0(ke,$);await le(Ce,ke,{overrideNavigation:Pe,fetcherSubmission:K,preventScrollReset:ie||T,enableViewTransition:X?_:void 0})}}async function je(z,V,X,he,$,K){let ie,ve={};try{ie=await B$(u,z,V,X,he,$,K,a,i)}catch(we){return he.forEach(ke=>{ve[ke.route.id]={type:ot.error,error:we}}),ve}for(let[we,ke]of Object.entries(ie))if(q$(ke)){let Ce=ke.result;ve[we]={type:ot.redirect,response:W$(Ce,X,we,$,c,f.v7_relativeSplatPath)}}else ve[we]=await V$(ke);return ve}async function W(z,V,X,he,$){let K=z.matches,ie=je("loader",z,$,X,V,null),ve=Promise.all(he.map(async Ce=>{if(Ce.matches&&Ce.match&&Ce.controller){let Se=(await je("loader",z,Lo(e.history,Ce.path,Ce.controller.signal),[Ce.match],Ce.matches,Ce.key))[Ce.match.route.id];return{[Ce.key]:Se}}else return Promise.resolve({[Ce.key]:{type:ot.error,error:Qn(404,{pathname:Ce.path})}})})),we=await ie,ke=(await ve).reduce((Ce,fe)=>Object.assign(Ce,fe),{});return await Promise.all([X$(V,we,$.signal,K,z.loaderData),Z$(V,ke,he)]),{loaderResults:we,fetcherResults:ke}}function se(){B=!0,ae.push(...yt()),D.forEach((z,V)=>{I.has(V)&&Q.add(V),Ue(V)})}function Te(z,V,X){X===void 0&&(X={}),N.fetchers.set(z,V),Y({fetchers:new Map(N.fetchers)},{flushSync:(X&&X.flushSync)===!0})}function pe(z,V,X,he){he===void 0&&(he={});let $=Bs(N.matches,V);ye(z),Y({errors:{[$.route.id]:X},fetchers:new Map(N.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function L(z){return G.set(z,(G.get(z)||0)+1),te.has(z)&&te.delete(z),N.fetchers.get(z)||M$}function ye(z){let V=N.fetchers.get(z);I.has(z)&&!(V&&V.state==="loading"&&oe.has(z))&&Ue(z),D.delete(z),oe.delete(z),re.delete(z),f.v7_fetcherPersist&&te.delete(z),Q.delete(z),N.fetchers.delete(z)}function _e(z){let V=(G.get(z)||0)-1;V<=0?(G.delete(z),te.add(z),f.v7_fetcherPersist||ye(z)):G.set(z,V),Y({fetchers:new Map(N.fetchers)})}function Ue(z){let V=I.get(z);V&&(V.abort(),I.delete(z))}function mt(z){for(let V of z){let X=L(V),he=La(X.data);N.fetchers.set(V,he)}}function rt(){let z=[],V=!1;for(let X of re){let he=N.fetchers.get(X);He(he,"Expected fetcher: "+X),he.state==="loading"&&(re.delete(X),z.push(X),V=!0)}return mt(z),V}function gt(z){let V=[];for(let[X,he]of oe)if(he<z){let $=N.fetchers.get(X);He($,"Expected fetcher: "+X),$.state==="loading"&&(Ue(X),oe.delete(X),V.push(X))}return mt(V),V.length>0}function Kt(z,V){let X=N.blockers.get(z)||Ho;return Z.get(z)!==V&&Z.set(z,V),X}function Et(z){N.blockers.delete(z),Z.delete(z)}function de(z,V){let X=N.blockers.get(z)||Ho;He(X.state==="unblocked"&&V.state==="blocked"||X.state==="blocked"&&V.state==="blocked"||X.state==="blocked"&&V.state==="proceeding"||X.state==="blocked"&&V.state==="unblocked"||X.state==="proceeding"&&V.state==="unblocked","Invalid blocker state transition: "+X.state+" -> "+V.state);let he=new Map(N.blockers);he.set(z,V),Y({blockers:he})}function Me(z){let{currentLocation:V,nextLocation:X,historyAction:he}=z;if(Z.size===0)return;Z.size>1&&ho(!1,"A router only supports one blocker at a time");let $=Array.from(Z.entries()),[K,ie]=$[$.length-1],ve=N.blockers.get(K);if(!(ve&&ve.state==="proceeding")&&ie({currentLocation:V,nextLocation:X,historyAction:he}))return K}function Ke(z){let V=Qn(404,{pathname:z}),X=o||s,{matches:he,route:$}=Fj(X);return yt(),{notFoundMatches:he,route:$,error:V}}function yt(z){let V=[];return ee.forEach((X,he)=>{(!z||z(he))&&(X.cancel(),V.push(he),ee.delete(he))}),V}function js(z,V,X){if(g=z,x=V,y=X||null,!v&&N.navigation===m0){v=!0;let he=Ns(N.location,N.matches);he!=null&&Y({restoreScrollPosition:he})}return()=>{g=null,x=null,y=null}}function _o(z,V){return y&&y(z,V.map(he=>u$(he,N.loaderData)))||z.key}function pc(z,V){if(g&&x){let X=_o(z,V);g[X]=x()}}function Ns(z,V){if(g){let X=_o(z,V),he=g[X];if(typeof he=="number")return he}return null}function qr(z,V,X){if(d)if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:uh(V,X,c,!0)}}else return{active:!0,matches:uh(V,X,c,!0)||[]};return{active:!1,matches:null}}async function pi(z,V,X,he){if(!d)return{type:"success",matches:z};let $=z;for(;;){let K=o==null,ie=o||s,ve=a;try{await d({signal:X,path:V,matches:$,fetcherKey:he,patch:(Ce,fe)=>{X.aborted||_j(Ce,fe,ie,ve,i)}})}catch(Ce){return{type:"error",error:Ce,partialMatches:$}}finally{K&&!X.aborted&&(s=[...s])}if(X.aborted)return{type:"aborted"};let we=$s(ie,V,c);if(we)return{type:"success",matches:we};let ke=uh(ie,V,c,!0);if(!ke||$.length===ke.length&&$.every((Ce,fe)=>Ce.route.id===ke[fe].route.id))return{type:"success",matches:null};$=ke}}function Fg(z){a={},o=Yh(z,i,void 0,a)}function zg(z,V){let X=o==null;_j(z,V,o||s,a,i),X&&(s=[...s],Y({}))}return j={get basename(){return c},get future(){return f},get state(){return N},get routes(){return s},get window(){return t},initialize:J,subscribe:be,enableScrollRestoration:js,navigate:F,fetch:Pt,revalidate:ue,createHref:z=>e.history.createHref(z),encodeLocation:z=>e.history.encodeLocation(z),getFetcher:L,deleteFetcher:_e,dispose:ne,getBlocker:Kt,deleteBlocker:Et,patchRoutes:zg,_internalFetchControllers:I,_internalActiveDeferreds:ee,_internalSetRoutes:Fg},j}function R$(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function wx(e,t,n,r,i,a,s,o){let c,u;if(s){c=[];for(let f of t)if(c.push(f),f.route.id===s){u=f;break}}else c=t,u=t[t.length-1];let d=km(i||".",Sm(c,a),ci(e.pathname,n)||e.pathname,o==="path");if(i==null&&(d.search=e.search,d.hash=e.hash),(i==null||i===""||i===".")&&u){let f=tw(d.search);if(u.route.index&&!f)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&f){let h=new URLSearchParams(d.search),p=h.getAll("index");h.delete("index"),p.filter(y=>y).forEach(y=>h.append("index",y));let g=h.toString();d.search=g?"?"+g:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Ji([n,d.pathname])),po(d)}function Ej(e,t,n,r){if(!r||!R$(r))return{path:n};if(r.formMethod&&!Y$(r.formMethod))return{path:n,error:Qn(405,{method:r.formMethod})};let i=()=>({path:n,error:Qn(400,{type:"invalid-body"})}),a=r.formMethod||"get",s=e?a.toUpperCase():a.toLowerCase(),o=IO(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Qr(s))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,g)=>{let[y,x]=g;return""+p+y+"="+x+`
|
|
50
|
+
`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Qr(s))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}He(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=kx(r.formData),u=r.formData;else if(r.body instanceof FormData)c=kx(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=Mj(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=Mj(c)}catch{return i()}let d={formMethod:s,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Qr(d.formMethod))return{path:n,submission:d};let f=xs(n);return t&&f.search&&tw(f.search)&&c.append("index",""),f.search="?"+c,{path:po(f),submission:d}}function Aj(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Tj(e,t,n,r,i,a,s,o,c,u,d,f,h,p,g,y){let x=y?dr(y[1])?y[1].error:y[1].data:void 0,v=e.createURL(t.location),b=e.createURL(i),w=n;a&&t.errors?w=Aj(n,Object.keys(t.errors)[0],!0):y&&dr(y[1])&&(w=Aj(n,y[0]));let S=y?y[1].statusCode:void 0,k=s&&S&&S>=400,j=w.filter((P,T)=>{let{route:E}=P;if(E.lazy)return!0;if(E.loader==null)return!1;if(a)return Sx(E,t.loaderData,t.errors);if(F$(t.loaderData,t.matches[T],P)||c.some(A=>A===P.route.id))return!0;let _=t.matches[T],C=P;return Oj(P,At({currentUrl:v,currentParams:_.params,nextUrl:b,nextParams:C.params},r,{actionResult:x,actionStatus:S,defaultShouldRevalidate:k?!1:o||v.pathname+v.search===b.pathname+b.search||v.search!==b.search||DO(_,C)}))}),N=[];return f.forEach((P,T)=>{if(a||!n.some(M=>M.route.id===P.routeId)||d.has(T))return;let E=$s(p,P.path,g);if(!E){N.push({key:T,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let _=t.fetchers.get(T),C=Xc(E,P.path),A=!1;h.has(T)?A=!1:u.has(T)?(u.delete(T),A=!0):_&&_.state!=="idle"&&_.data===void 0?A=o:A=Oj(C,At({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:S,defaultShouldRevalidate:k?!1:o})),A&&N.push({key:T,routeId:P.routeId,path:P.path,matches:E,match:C,controller:new AbortController})}),[j,N]}function Sx(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function F$(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function DO(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Oj(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function _j(e,t,n,r,i){var a;let s;if(e){let u=r[e];He(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),s=u.children}else s=n;let o=t.filter(u=>!s.some(d=>MO(u,d))),c=Yh(o,i,[e||"_","patch",String(((a=s)==null?void 0:a.length)||"0")],r);s.push(...c)}function MO(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(a=>MO(n,a))}):!1}async function z$(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];He(i,"No route found in manifest");let a={};for(let s in r){let c=i[s]!==void 0&&s!=="hasErrorBoundary";ho(!c,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!c&&!l$.has(s)&&(a[s]=r[s])}Object.assign(i,a),Object.assign(i,At({},t(i),{lazy:void 0}))}async function $$(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,a,s)=>Object.assign(i,{[n[s].route.id]:a}),{})}async function B$(e,t,n,r,i,a,s,o,c,u){let d=a.map(p=>p.route.lazy?z$(p.route,c,o):void 0),f=a.map((p,g)=>{let y=d[g],x=i.some(b=>b.route.id===p.route.id);return At({},p,{shouldLoad:x,resolve:async b=>(b&&r.method==="GET"&&(p.route.lazy||p.route.loader)&&(x=!0),x?U$(t,r,p,y,b,u):Promise.resolve({type:ot.data,result:void 0}))})}),h=await e({matches:f,request:r,params:a[0].params,fetcherKey:s,context:u});try{await Promise.all(d)}catch{}return h}async function U$(e,t,n,r,i,a){let s,o,c=u=>{let d,f=new Promise((g,y)=>d=y);o=()=>d(),t.signal.addEventListener("abort",o);let h=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:a},...g!==void 0?[g]:[]),p=(async()=>{try{return{type:"data",result:await(i?i(y=>h(y)):h())}}catch(g){return{type:"error",result:g}}})();return Promise.race([p,f])};try{let u=n.route[e];if(r)if(u){let d,[f]=await Promise.all([c(u).catch(h=>{d=h}),r]);if(d!==void 0)throw d;s=f}else if(await r,u=n.route[e],u)s=await c(u);else if(e==="action"){let d=new URL(t.url),f=d.pathname+d.search;throw Qn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:ot.data,result:void 0};else if(u)s=await c(u);else{let d=new URL(t.url),f=d.pathname+d.search;throw Qn(404,{pathname:f})}He(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:ot.error,result:u}}finally{o&&t.signal.removeEventListener("abort",o)}return s}async function V$(e){let{result:t,type:n}=e;if(LO(t)){let f;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?f=null:f=await t.json():f=await t.text()}catch(h){return{type:ot.error,error:h}}return n===ot.error?{type:ot.error,error:new Zh(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:ot.data,data:f,statusCode:t.status,headers:t.headers}}if(n===ot.error){if(zj(t)){var r,i;if(t.data instanceof Error){var a,s;return{type:ot.error,error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:ot.error,error:new Zh(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:zu(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:ot.error,error:t,statusCode:zu(t)?t.status:void 0}}if(G$(t)){var o,c;return{type:ot.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((c=t.init)==null?void 0:c.headers)&&new Headers(t.init.headers)}}if(zj(t)){var u,d;return{type:ot.data,data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}}return{type:ot.data,data:t}}function W$(e,t,n,r,i,a){let s=e.headers.get("Location");if(He(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jb.test(s)){let o=r.slice(0,r.findIndex(c=>c.route.id===n)+1);s=wx(new URL(t.url),o,i,!0,s,a),e.headers.set("Location",s)}return e}function Dj(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Jb.test(e)){let a=e,s=a.startsWith("//")?new URL(t.protocol+a):new URL(a);if(i.includes(s.protocol))throw new Error("Invalid redirect location");let o=ci(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}try{let a=r.createURL(e);if(i.includes(a.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Lo(e,t,n,r){let i=e.createURL(IO(t)).toString(),a={signal:n};if(r&&Qr(r.formMethod)){let{formMethod:s,formEncType:o}=r;a.method=s.toUpperCase(),o==="application/json"?(a.headers=new Headers({"Content-Type":o}),a.body=JSON.stringify(r.json)):o==="text/plain"?a.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?a.body=kx(r.formData):a.body=r.formData}return new Request(i,a)}function kx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Mj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function H$(e,t,n,r,i){let a={},s=null,o,c=!1,u={},d=n&&dr(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,p=t[h];if(He(!Ks(p),"Cannot handle redirect results in processLoaderData"),dr(p)){let g=p.error;d!==void 0&&(g=d,d=void 0),s=s||{};{let y=Bs(e,h);s[y.route.id]==null&&(s[y.route.id]=g)}a[h]=void 0,c||(c=!0,o=zu(p.error)?p.error.status:500),p.headers&&(u[h]=p.headers)}else qa(p)?(r.set(h,p.deferredData),a[h]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!c&&(o=p.statusCode),p.headers&&(u[h]=p.headers)):(a[h]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(o=p.statusCode),p.headers&&(u[h]=p.headers))}),d!==void 0&&n&&(s={[n[0]]:d},a[n[0]]=void 0),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:u}}function Ij(e,t,n,r,i,a,s){let{loaderData:o,errors:c}=H$(t,n,r,s);return i.forEach(u=>{let{key:d,match:f,controller:h}=u,p=a[d];if(He(p,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(dr(p)){let g=Bs(e.matches,f==null?void 0:f.route.id);c&&c[g.route.id]||(c=At({},c,{[g.route.id]:p.error})),e.fetchers.delete(d)}else if(Ks(p))He(!1,"Unhandled fetcher revalidation redirect");else if(qa(p))He(!1,"Unhandled fetcher deferred data");else{let g=La(p.data);e.fetchers.set(d,g)}}),{loaderData:o,errors:c}}function Lj(e,t,n,r){let i=At({},t);for(let a of n){let s=a.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(i[s]=t[s]):e[s]!==void 0&&a.route.loader&&(i[s]=e[s]),r&&r.hasOwnProperty(s))break}return i}function Rj(e){return e?dr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Bs(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Fj(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Qn(e,t){let{pathname:n,routeId:r,method:i,type:a,message:s}=t===void 0?{}:t,o="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?c="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"?c="defer() is not supported in actions":a==="invalid-body"&&(c="Unable to encode submission body")):e===403?(o="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",c='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?c="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(c='Invalid request method "'+i.toUpperCase()+'"')),new Zh(e||500,o,new Error(c),!0)}function bf(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Ks(i))return{key:r,result:i}}}function IO(e){let t=typeof e=="string"?xs(e):e;return po(At({},t,{hash:""}))}function K$(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function q$(e){return LO(e.result)&&_$.has(e.result.status)}function qa(e){return e.type===ot.deferred}function dr(e){return e.type===ot.error}function Ks(e){return(e&&e.type)===ot.redirect}function zj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function G$(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function LO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Y$(e){return O$.has(e.toLowerCase())}function Qr(e){return A$.has(e.toLowerCase())}async function X$(e,t,n,r,i){let a=Object.entries(t);for(let s=0;s<a.length;s++){let[o,c]=a[s],u=e.find(h=>(h==null?void 0:h.route.id)===o);if(!u)continue;let d=r.find(h=>h.route.id===u.route.id),f=d!=null&&!DO(d,u)&&(i&&i[u.route.id])!==void 0;qa(c)&&f&&await ew(c,n,!1).then(h=>{h&&(t[o]=h)})}}async function Z$(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:a,controller:s}=n[r],o=t[i];e.find(u=>(u==null?void 0:u.route.id)===a)&&qa(o)&&(He(s,"Expected an AbortController for revalidating fetcher deferred result"),await ew(o,s.signal,!0).then(u=>{u&&(t[i]=u)}))}}async function ew(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:ot.data,data:e.deferredData.unwrappedData}}catch(i){return{type:ot.error,error:i}}return{type:ot.data,data:e.deferredData.data}}}function tw(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Xc(e,t){let n=typeof t=="string"?xs(t).search:t.search;if(e[e.length-1].route.index&&tw(n||""))return e[e.length-1];let r=TO(e);return r[r.length-1]}function $j(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:s}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function g0(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Q$(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Nc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function J$(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function La(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function e7(e,t){try{let n=e.sessionStorage.getItem(_O);if(n){let r=JSON.parse(n);for(let[i,a]of Object.entries(r||{}))a&&Array.isArray(a)&&t.set(i,new Set(a||[]))}}catch{}}function t7(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(_O,JSON.stringify(n))}catch(r){ho(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
51
|
+
* React Router v6.30.3
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Remix Software Inc.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
+
*
|
|
58
|
+
* @license MIT
|
|
59
|
+
*/function _l(){return _l=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},_l.apply(this,arguments)}const bd=m.createContext(null),nw=m.createContext(null),xa=m.createContext(null),rw=m.createContext(null),Fi=m.createContext({outlet:null,matches:[],isDataRoute:!1}),RO=m.createContext(null);function n7(e,t){let{relative:n}=t===void 0?{}:t;Xl()||He(!1);let{basename:r,navigator:i}=m.useContext(xa),{hash:a,pathname:s,search:o}=jm(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:Ji([r,s])),i.createHref({pathname:c,search:o,hash:a})}function Xl(){return m.useContext(rw)!=null}function va(){return Xl()||He(!1),m.useContext(rw).location}function FO(e){m.useContext(xa).static||m.useLayoutEffect(e)}function zi(){let{isDataRoute:e}=m.useContext(Fi);return e?y7():r7()}function r7(){Xl()||He(!1);let e=m.useContext(bd),{basename:t,future:n,navigator:r}=m.useContext(xa),{matches:i}=m.useContext(Fi),{pathname:a}=va(),s=JSON.stringify(Sm(i,n.v7_relativeSplatPath)),o=m.useRef(!1);return FO(()=>{o.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let f=km(u,JSON.parse(s),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ji([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,s,a,e])}const i7=m.createContext(null);function a7(e){let t=m.useContext(Fi).outlet;return t&&m.createElement(i7.Provider,{value:e},t)}function s7(){let{matches:e}=m.useContext(Fi),t=e[e.length-1];return t?t.params:{}}function jm(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(xa),{matches:i}=m.useContext(Fi),{pathname:a}=va(),s=JSON.stringify(Sm(i,r.v7_relativeSplatPath));return m.useMemo(()=>km(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}function o7(e,t,n,r){Xl()||He(!1);let{navigator:i}=m.useContext(xa),{matches:a}=m.useContext(Fi),s=a[a.length-1],o=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=va(),d;d=u;let f=d.pathname||"/",h=f;if(c!=="/"){let y=c.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let p=$s(e,{pathname:h});return f7(p&&p.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:Ji([c,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:Ji([c,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r)}function l7(){let e=p7(),t=zu(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 m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:i},n):null,null)}const c7=m.createElement(l7,null);class u7 extends m.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?m.createElement(Fi.Provider,{value:this.props.routeContext},m.createElement(RO.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function d7(e){let{routeContext:t,match:n,children:r}=e,i=m.useContext(bd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Fi.Provider,{value:t},r)}function f7(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 s=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let d=s.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);d>=0||He(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<s.length;d++){let f=s[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let p,g=!1,y=null,x=null;n&&(p=o&&f.route.id?o[f.route.id]:void 0,y=f.route.errorElement||c7,c&&(u<0&&h===0?(x7("route-fallback"),g=!0,x=null):u===h&&(g=!0,x=f.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,h+1)),b=()=>{let w;return p?w=y:g?w=x:f.route.Component?w=m.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,m.createElement(d7,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(u7,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var iw=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(iw||{}),zO=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}(zO||{});function $O(e){let t=m.useContext(bd);return t||He(!1),t}function BO(e){let t=m.useContext(nw);return t||He(!1),t}function h7(e){let t=m.useContext(Fi);return t||He(!1),t}function UO(e){let t=h7(),n=t.matches[t.matches.length-1];return n.route.id||He(!1),n.route.id}function p7(){var e;let t=m.useContext(RO),n=BO(zO.UseRouteError),r=UO();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let m7=0;function g7(e){let{router:t,basename:n}=$O(iw.UseBlocker),r=BO(),[i,a]=m.useState(""),s=m.useCallback(o=>{if(typeof e!="function")return!!e;if(n==="/")return e(o);let{currentLocation:c,nextLocation:u,historyAction:d}=o;return e({currentLocation:_l({},c,{pathname:ci(c.pathname,n)||c.pathname}),nextLocation:_l({},u,{pathname:ci(u.pathname,n)||u.pathname}),historyAction:d})},[n,e]);return m.useEffect(()=>{let o=String(++m7);return a(o),()=>t.deleteBlocker(o)},[t]),m.useEffect(()=>{i!==""&&t.getBlocker(i,s)},[t,i,s]),i&&r.blockers.has(i)?r.blockers.get(i):Ho}function y7(){let{router:e}=$O(iw.UseNavigateStable),t=UO(),n=m.useRef(!1);return FO(()=>{n.current=!0}),m.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,_l({fromRouteId:t},a)))},[e,t])}const Bj={};function x7(e,t,n){Bj[e]||(Bj[e]=!0)}function v7(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function dh(e){let{to:t,replace:n,state:r,relative:i}=e;Xl()||He(!1);let{future:a,static:s}=m.useContext(xa),{matches:o}=m.useContext(Fi),{pathname:c}=va(),u=zi(),d=km(t,Sm(o,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return m.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function aw(e){return a7(e.context)}function b7(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Yt.Pop,navigator:a,static:s=!1,future:o}=e;Xl()&&He(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:a,static:s,future:_l({v7_relativeSplatPath:!1},o)}),[c,o,a,s]);typeof r=="string"&&(r=xs(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,y=m.useMemo(()=>{let x=ci(d,c);return x==null?null:{location:{pathname:x,search:f,hash:h,state:p,key:g},navigationType:i}},[c,d,f,h,p,g,i]);return y==null?null:m.createElement(xa.Provider,{value:u},m.createElement(rw.Provider,{children:n,value:y}))}new Promise(()=>{});function w7(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:m.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
60
|
+
* React Router DOM v6.30.3
|
|
61
|
+
*
|
|
62
|
+
* Copyright (c) Remix Software Inc.
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the MIT license found in the
|
|
65
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
66
|
+
*
|
|
67
|
+
* @license MIT
|
|
68
|
+
*/function Dl(){return Dl=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},Dl.apply(this,arguments)}function VO(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 S7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function k7(e,t){return e.button===0&&(!t||t==="_self")&&!S7(e)}function jx(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function j7(e,t){let n=jx(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const N7=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],C7=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],P7="6";try{window.__reactRouterVersion=P7}catch{}function E7(e,t){return L$({basename:void 0,future:Dl({},void 0,{v7_prependBasename:!0}),history:a$({window:void 0}),hydrationData:A7(),routes:e,mapRouteProperties:w7,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function A7(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Dl({},t,{errors:T7(t.errors)})),t}function T7(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Zh(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let s=new a(i.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}const WO=m.createContext({isTransitioning:!1}),O7=m.createContext(new Map),_7="startTransition",Uj=NA[_7],D7="flushSync",Vj=i$[D7];function M7(e){Uj?Uj(e):e()}function Cc(e){Vj?Vj(e):e()}class I7{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function L7(e){let{fallbackElement:t,router:n,future:r}=e,[i,a]=m.useState(n.state),[s,o]=m.useState(),[c,u]=m.useState({isTransitioning:!1}),[d,f]=m.useState(),[h,p]=m.useState(),[g,y]=m.useState(),x=m.useRef(new Map),{v7_startTransition:v}=r||{},b=m.useCallback(P=>{v?M7(P):P()},[v]),w=m.useCallback((P,T)=>{let{deletedFetchers:E,flushSync:_,viewTransitionOpts:C}=T;P.fetchers.forEach((M,B)=>{M.data!==void 0&&x.current.set(B,M.data)}),E.forEach(M=>x.current.delete(M));let A=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!C||A){_?Cc(()=>a(P)):b(()=>a(P));return}if(_){Cc(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:C.currentLocation,nextLocation:C.nextLocation})});let M=n.window.document.startViewTransition(()=>{Cc(()=>a(P))});M.finished.finally(()=>{Cc(()=>{f(void 0),p(void 0),o(void 0),u({isTransitioning:!1})})}),Cc(()=>p(M));return}h?(d&&d.resolve(),h.skipTransition(),y({state:P,currentLocation:C.currentLocation,nextLocation:C.nextLocation})):(o(P),u({isTransitioning:!0,flushSync:!1,currentLocation:C.currentLocation,nextLocation:C.nextLocation}))},[n.window,h,d,x,b]);m.useLayoutEffect(()=>n.subscribe(w),[n,w]),m.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new I7)},[c]),m.useEffect(()=>{if(d&&s&&n.window){let P=s,T=d.promise,E=n.window.document.startViewTransition(async()=>{b(()=>a(P)),await T});E.finished.finally(()=>{f(void 0),p(void 0),o(void 0),u({isTransitioning:!1})}),p(E)}},[b,s,d,n.window]),m.useEffect(()=>{d&&s&&i.location.key===s.location.key&&d.resolve()},[d,h,i.location,s]),m.useEffect(()=>{!c.isTransitioning&&g&&(o(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[c.isTransitioning,g]),m.useEffect(()=>{},[]);let S=m.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:P=>n.navigate(P),push:(P,T,E)=>n.navigate(P,{state:T,preventScrollReset:E==null?void 0:E.preventScrollReset}),replace:(P,T,E)=>n.navigate(P,{replace:!0,state:T,preventScrollReset:E==null?void 0:E.preventScrollReset})}),[n]),k=n.basename||"/",j=m.useMemo(()=>({router:n,navigator:S,static:!1,basename:k}),[n,S,k]),N=m.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return m.useEffect(()=>v7(r,n.future),[r,n.future]),m.createElement(m.Fragment,null,m.createElement(bd.Provider,{value:j},m.createElement(nw.Provider,{value:i},m.createElement(O7.Provider,{value:x.current},m.createElement(WO.Provider,{value:c},m.createElement(b7,{basename:k,location:i.location,navigationType:i.historyAction,navigator:S,future:N},i.initialized||n.future.v7_partialHydration?m.createElement(R7,{routes:n.routes,future:n.future,state:i}):t))))),null)}const R7=m.memo(F7);function F7(e){let{routes:t,future:n,state:r}=e;return o7(t,void 0,r,n)}const z7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,HO=m.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:o,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=VO(t,N7),{basename:p}=m.useContext(xa),g,y=!1;if(typeof u=="string"&&$7.test(u)&&(g=u,z7))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=ci(S.pathname,p);S.origin===w.origin&&k!=null?u=k+S.search+S.hash:y=!0}catch{}let x=n7(u,{relative:i}),v=U7(u,{replace:s,state:o,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||v(w)}return m.createElement("a",Dl({},h,{href:g||x,onClick:y||a?r:b,ref:n,target:c}))}),y0=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:s=!1,style:o,to:c,viewTransition:u,children:d}=t,f=VO(t,C7),h=jm(c,{relative:f.relative}),p=va(),g=m.useContext(nw),{navigator:y,basename:x}=m.useContext(xa),v=g!=null&&V7(h)&&u===!0,b=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,w=p.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(w=w.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase()),S&&x&&(S=ci(S,x)||S);const k=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let j=w===b||!s&&w.startsWith(b)&&w.charAt(k)==="/",N=S!=null&&(S===b||!s&&S.startsWith(b)&&S.charAt(b.length)==="/"),P={isActive:j,isPending:N,isTransitioning:v},T=j?r:void 0,E;typeof a=="function"?E=a(P):E=[a,j?"active":null,N?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let _=typeof o=="function"?o(P):o;return m.createElement(HO,Dl({},f,{"aria-current":T,className:E,ref:n,style:_,to:c,viewTransition:u}),typeof d=="function"?d(P):d)});var Nx;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Nx||(Nx={}));var Wj;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Wj||(Wj={}));function B7(e){let t=m.useContext(bd);return t||He(!1),t}function U7(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:o}=t===void 0?{}:t,c=zi(),u=va(),d=jm(e,{relative:s});return m.useCallback(f=>{if(k7(f,n)){f.preventDefault();let h=r!==void 0?r:po(u)===po(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:s,viewTransition:o})}},[u,c,d,r,i,n,e,a,s,o])}function wd(e){let t=m.useRef(jx(e)),n=m.useRef(!1),r=va(),i=m.useMemo(()=>j7(r.search,n.current?null:t.current),[r.search]),a=zi(),s=m.useCallback((o,c)=>{const u=jx(typeof o=="function"?o(i):o);n.current=!0,a("?"+u,c)},[a,i]);return[i,s]}function V7(e,t){t===void 0&&(t={});let n=m.useContext(WO);n==null&&He(!1);let{basename:r}=B7(Nx.useViewTransitionState),i=jm(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=ci(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=ci(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xh(i.pathname,s)!=null||Xh(i.pathname,a)!=null}/**
|
|
69
|
+
* @license lucide-react v0.395.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const W7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),KO=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
|
|
74
|
+
* @license lucide-react v0.395.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/var H7={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
79
|
+
* @license lucide-react v0.395.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const K7=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...o},c)=>m.createElement("svg",{ref:c,...H7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:KO("lucide",i),...o},[...s.map(([u,d])=>m.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
|
|
84
|
+
* @license lucide-react v0.395.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const me=(e,t)=>{const n=m.forwardRef(({className:r,...i},a)=>m.createElement(K7,{ref:a,iconNode:t,className:KO(`lucide-${W7(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
89
|
+
* @license lucide-react v0.395.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const q7=me("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
94
|
+
* @license lucide-react v0.395.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const G7=me("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
99
|
+
* @license lucide-react v0.395.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const qO=me("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
104
|
+
* @license lucide-react v0.395.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const Hj=me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
109
|
+
* @license lucide-react v0.395.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const GO=me("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
114
|
+
* @license lucide-react v0.395.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const sw=me("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
119
|
+
* @license lucide-react v0.395.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const ow=me("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
|
|
124
|
+
* @license lucide-react v0.395.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const cs=me("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
|
|
129
|
+
* @license lucide-react v0.395.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const Y7=me("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
134
|
+
* @license lucide-react v0.395.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const lw=me("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
|
|
139
|
+
* @license lucide-react v0.395.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const _n=me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
144
|
+
* @license lucide-react v0.395.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const ea=me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
149
|
+
* @license lucide-react v0.395.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const ua=me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
154
|
+
* @license lucide-react v0.395.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const fh=me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
159
|
+
* @license lucide-react v0.395.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const $u=me("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
164
|
+
* @license lucide-react v0.395.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const X7=me("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
169
|
+
* @license lucide-react v0.395.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const br=me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
174
|
+
* @license lucide-react v0.395.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const Z7=me("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
179
|
+
* @license lucide-react v0.395.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const vs=me("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
184
|
+
* @license lucide-react v0.395.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const YO=me("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
189
|
+
* @license lucide-react v0.395.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const Kj=me("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
|
|
194
|
+
* @license lucide-react v0.395.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const us=me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
199
|
+
* @license lucide-react v0.395.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const Q7=me("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
204
|
+
* @license lucide-react v0.395.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const qs=me("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
209
|
+
* @license lucide-react v0.395.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const XO=me("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
|
|
214
|
+
* @license lucide-react v0.395.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const J7=me("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
219
|
+
* @license lucide-react v0.395.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const Cx=me("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
224
|
+
* @license lucide-react v0.395.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const mo=me("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
229
|
+
* @license lucide-react v0.395.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const ZO=me("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
234
|
+
* @license lucide-react v0.395.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const eB=me("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
239
|
+
* @license lucide-react v0.395.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const Zl=me("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
244
|
+
* @license lucide-react v0.395.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const Ga=me("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
|
|
249
|
+
* @license lucide-react v0.395.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const tB=me("FilePlus2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]);/**
|
|
254
|
+
* @license lucide-react v0.395.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const Sd=me("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
259
|
+
* @license lucide-react v0.395.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const nB=me("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
|
|
264
|
+
* @license lucide-react v0.395.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const QO=me("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/**
|
|
269
|
+
* @license lucide-react v0.395.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const cw=me("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
274
|
+
* @license lucide-react v0.395.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const Ml=me("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
279
|
+
* @license lucide-react v0.395.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const JO=me("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
|
284
|
+
* @license lucide-react v0.395.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const uw=me("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
289
|
+
* @license lucide-react v0.395.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const Nm=me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
294
|
+
* @license lucide-react v0.395.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const Ql=me("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
299
|
+
* @license lucide-react v0.395.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const rB=me("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
304
|
+
* @license lucide-react v0.395.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const dw=me("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
309
|
+
* @license lucide-react v0.395.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const fw=me("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
314
|
+
* @license lucide-react v0.395.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const iB=me("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
|
|
319
|
+
* @license lucide-react v0.395.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const Ie=me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
324
|
+
* @license lucide-react v0.395.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const Qh=me("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
329
|
+
* @license lucide-react v0.395.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const aB=me("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
|
|
334
|
+
* @license lucide-react v0.395.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const sB=me("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
339
|
+
* @license lucide-react v0.395.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const oB=me("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
344
|
+
* @license lucide-react v0.395.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const lB=me("MessageSquareHeart",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M14.8 7.5a1.84 1.84 0 0 0-2.6 0l-.2.3-.3-.3a1.84 1.84 0 1 0-2.4 2.8L12 13l2.7-2.7c.9-.9.8-2.1.1-2.8",key:"1blaws"}]]);/**
|
|
349
|
+
* @license lucide-react v0.395.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const Cm=me("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
354
|
+
* @license lucide-react v0.395.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const hw=me("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
359
|
+
* @license lucide-react v0.395.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const kd=me("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
364
|
+
* @license lucide-react v0.395.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const cB=me("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
|
|
369
|
+
* @license lucide-react v0.395.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const Pm=me("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
374
|
+
* @license lucide-react v0.395.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const Px=me("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
379
|
+
* @license lucide-react v0.395.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const dn=me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
384
|
+
* @license lucide-react v0.395.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const uB=me("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
|
|
389
|
+
* @license lucide-react v0.395.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const dB=me("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
394
|
+
* @license lucide-react v0.395.0 - ISC
|
|
395
|
+
*
|
|
396
|
+
* This source code is licensed under the ISC license.
|
|
397
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
+
*/const e_=me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
399
|
+
* @license lucide-react v0.395.0 - ISC
|
|
400
|
+
*
|
|
401
|
+
* This source code is licensed under the ISC license.
|
|
402
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
+
*/const In=me("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
404
|
+
* @license lucide-react v0.395.0 - ISC
|
|
405
|
+
*
|
|
406
|
+
* This source code is licensed under the ISC license.
|
|
407
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
+
*/const Bu=me("SearchCode",[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/**
|
|
409
|
+
* @license lucide-react v0.395.0 - ISC
|
|
410
|
+
*
|
|
411
|
+
* This source code is licensed under the ISC license.
|
|
412
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
+
*/const Kn=me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
414
|
+
* @license lucide-react v0.395.0 - ISC
|
|
415
|
+
*
|
|
416
|
+
* This source code is licensed under the ISC license.
|
|
417
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
+
*/const fB=me("SendHorizontal",[["path",{d:"m3 3 3 9-3 9 19-9Z",key:"1aobqy"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
|
|
419
|
+
* @license lucide-react v0.395.0 - ISC
|
|
420
|
+
*
|
|
421
|
+
* This source code is licensed under the ISC license.
|
|
422
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
423
|
+
*/const hB=me("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
424
|
+
* @license lucide-react v0.395.0 - ISC
|
|
425
|
+
*
|
|
426
|
+
* This source code is licensed under the ISC license.
|
|
427
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
+
*/const pB=me("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
429
|
+
* @license lucide-react v0.395.0 - ISC
|
|
430
|
+
*
|
|
431
|
+
* This source code is licensed under the ISC license.
|
|
432
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
+
*/const Em=me("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
434
|
+
* @license lucide-react v0.395.0 - ISC
|
|
435
|
+
*
|
|
436
|
+
* This source code is licensed under the ISC license.
|
|
437
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
+
*/const mB=me("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
439
|
+
* @license lucide-react v0.395.0 - ISC
|
|
440
|
+
*
|
|
441
|
+
* This source code is licensed under the ISC license.
|
|
442
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
443
|
+
*/const Uu=me("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
444
|
+
* @license lucide-react v0.395.0 - ISC
|
|
445
|
+
*
|
|
446
|
+
* This source code is licensed under the ISC license.
|
|
447
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
448
|
+
*/const pw=me("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
449
|
+
* @license lucide-react v0.395.0 - ISC
|
|
450
|
+
*
|
|
451
|
+
* This source code is licensed under the ISC license.
|
|
452
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
+
*/const Am=me("ShieldX",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);/**
|
|
454
|
+
* @license lucide-react v0.395.0 - ISC
|
|
455
|
+
*
|
|
456
|
+
* This source code is licensed under the ISC license.
|
|
457
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
458
|
+
*/const mw=me("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
459
|
+
* @license lucide-react v0.395.0 - ISC
|
|
460
|
+
*
|
|
461
|
+
* This source code is licensed under the ISC license.
|
|
462
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
+
*/const gw=me("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
464
|
+
* @license lucide-react v0.395.0 - ISC
|
|
465
|
+
*
|
|
466
|
+
* This source code is licensed under the ISC license.
|
|
467
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
468
|
+
*/const gB=me("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
469
|
+
* @license lucide-react v0.395.0 - ISC
|
|
470
|
+
*
|
|
471
|
+
* This source code is licensed under the ISC license.
|
|
472
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
473
|
+
*/const yB=me("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
474
|
+
* @license lucide-react v0.395.0 - ISC
|
|
475
|
+
*
|
|
476
|
+
* This source code is licensed under the ISC license.
|
|
477
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
478
|
+
*/const xB=me("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
|
|
479
|
+
* @license lucide-react v0.395.0 - ISC
|
|
480
|
+
*
|
|
481
|
+
* This source code is licensed under the ISC license.
|
|
482
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
483
|
+
*/const yw=me("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
484
|
+
* @license lucide-react v0.395.0 - ISC
|
|
485
|
+
*
|
|
486
|
+
* This source code is licensed under the ISC license.
|
|
487
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
488
|
+
*/const ai=me("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
489
|
+
* @license lucide-react v0.395.0 - ISC
|
|
490
|
+
*
|
|
491
|
+
* This source code is licensed under the ISC license.
|
|
492
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
493
|
+
*/const t_=me("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
|
|
494
|
+
* @license lucide-react v0.395.0 - ISC
|
|
495
|
+
*
|
|
496
|
+
* This source code is licensed under the ISC license.
|
|
497
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
498
|
+
*/const n_=me("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
|
|
499
|
+
* @license lucide-react v0.395.0 - ISC
|
|
500
|
+
*
|
|
501
|
+
* This source code is licensed under the ISC license.
|
|
502
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
503
|
+
*/const Vu=me("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
504
|
+
* @license lucide-react v0.395.0 - ISC
|
|
505
|
+
*
|
|
506
|
+
* This source code is licensed under the ISC license.
|
|
507
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
508
|
+
*/const Fn=me("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
509
|
+
* @license lucide-react v0.395.0 - ISC
|
|
510
|
+
*
|
|
511
|
+
* This source code is licensed under the ISC license.
|
|
512
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
513
|
+
*/const si=me("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
514
|
+
* @license lucide-react v0.395.0 - ISC
|
|
515
|
+
*
|
|
516
|
+
* This source code is licensed under the ISC license.
|
|
517
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
518
|
+
*/const Ex=me("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
|
|
519
|
+
* @license lucide-react v0.395.0 - ISC
|
|
520
|
+
*
|
|
521
|
+
* This source code is licensed under the ISC license.
|
|
522
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
523
|
+
*/const Jh=me("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
524
|
+
* @license lucide-react v0.395.0 - ISC
|
|
525
|
+
*
|
|
526
|
+
* This source code is licensed under the ISC license.
|
|
527
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
528
|
+
*/const Wu=me("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
529
|
+
* @license lucide-react v0.395.0 - ISC
|
|
530
|
+
*
|
|
531
|
+
* This source code is licensed under the ISC license.
|
|
532
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
533
|
+
*/const ta=me("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
534
|
+
* @license lucide-react v0.395.0 - ISC
|
|
535
|
+
*
|
|
536
|
+
* This source code is licensed under the ISC license.
|
|
537
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
538
|
+
*/const vB=me("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
539
|
+
* @license lucide-react v0.395.0 - ISC
|
|
540
|
+
*
|
|
541
|
+
* This source code is licensed under the ISC license.
|
|
542
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
543
|
+
*/const xw=me("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
|
|
544
|
+
* @license lucide-react v0.395.0 - ISC
|
|
545
|
+
*
|
|
546
|
+
* This source code is licensed under the ISC license.
|
|
547
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
548
|
+
*/const r_=me("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
549
|
+
* @license lucide-react v0.395.0 - ISC
|
|
550
|
+
*
|
|
551
|
+
* This source code is licensed under the ISC license.
|
|
552
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
553
|
+
*/const Qe=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
554
|
+
* @license lucide-react v0.395.0 - ISC
|
|
555
|
+
*
|
|
556
|
+
* This source code is licensed under the ISC license.
|
|
557
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
558
|
+
*/const jd=me("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function i_(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=i_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ct(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=i_(e))&&(r&&(r+=" "),r+=t);return r}const vw="-",bB=e=>{const t=SB(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const o=s.split(vw);return o[0]===""&&o.length!==1&&o.shift(),a_(o,t)||wB(s)},getConflictingClassGroupIds:(s,o)=>{const c=n[s]||[];return o&&r[s]?[...c,...r[s]]:c}}},a_=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?a_(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(vw);return(s=t.validators.find(({validator:o})=>o(a)))==null?void 0:s.classGroupId},qj=/^\[(.+)\]$/,wB=e=>{if(qj.test(e)){const t=qj.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},SB=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return jB(Object.entries(e.classGroups),n).forEach(([a,s])=>{Ax(s,r,a,t)}),r},Ax=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:Gj(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(kB(i)){Ax(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,s])=>{Ax(s,Gj(t,a),n,r)})})},Gj=(e,t)=>{let n=e;return t.split(vw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},kB=e=>e.isThemeGetter,jB=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,o])=>[t+s,o])):a);return[n,i]}):e,NB=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,s)=>{n.set(a,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return i(a,s),s},set(a,s){n.has(a)?n.set(a,s):i(a,s)}}},s_="!",CB=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,s=o=>{const c=[];let u=0,d=0,f;for(let x=0;x<o.length;x++){let v=o[x];if(u===0){if(v===i&&(r||o.slice(x,x+a)===t)){c.push(o.slice(d,x)),d=x+a;continue}if(v==="/"){f=x;continue}}v==="["?u++:v==="]"&&u--}const h=c.length===0?o:o.substring(d),p=h.startsWith(s_),g=p?h.substring(1):h,y=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}};return n?o=>n({className:o,parseClassName:s}):s},PB=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},EB=e=>({cache:NB(e.cacheSize),parseClassName:CB(e),...bB(e)}),AB=/\s+/,TB=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],s=e.trim().split(AB);let o="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let g=!!p,y=r(g?h.substring(0,p):h);if(!y){if(!g){o=u+(o.length>0?" "+o:o);continue}if(y=r(h),!y){o=u+(o.length>0?" "+o:o);continue}g=!1}const x=PB(d).join(":"),v=f?x+s_:x,b=v+y;if(a.includes(b))continue;a.push(b);const w=i(y,g);for(let S=0;S<w.length;++S){const k=w[S];a.push(v+k)}o=u+(o.length>0?" "+o:o)}return o};function OB(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=o_(t))&&(r&&(r+=" "),r+=n);return r}const o_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=o_(e[r]))&&(n&&(n+=" "),n+=t);return n};function _B(e,...t){let n,r,i,a=s;function s(c){const u=t.reduce((d,f)=>f(d),e());return n=EB(u),r=n.cache.get,i=n.cache.set,a=o,o(c)}function o(c){const u=r(c);if(u)return u;const d=TB(c,n);return i(c,d),d}return function(){return a(OB.apply(null,arguments))}}const wt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},l_=/^\[(?:([a-z-]+):)?(.+)\]$/i,DB=/^\d+\/\d+$/,MB=new Set(["px","full","screen"]),IB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,RB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,FB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vi=e=>bl(e)||MB.has(e)||DB.test(e),Oa=e=>Jl(e,"length",qB),bl=e=>!!e&&!Number.isNaN(Number(e)),x0=e=>Jl(e,"number",bl),Pc=e=>!!e&&Number.isInteger(Number(e)),$B=e=>e.endsWith("%")&&bl(e.slice(0,-1)),Ve=e=>l_.test(e),_a=e=>IB.test(e),BB=new Set(["length","size","percentage"]),UB=e=>Jl(e,BB,c_),VB=e=>Jl(e,"position",c_),WB=new Set(["image","url"]),HB=e=>Jl(e,WB,YB),KB=e=>Jl(e,"",GB),Ec=()=>!0,Jl=(e,t,n)=>{const r=l_.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},qB=e=>LB.test(e)&&!RB.test(e),c_=()=>!1,GB=e=>FB.test(e),YB=e=>zB.test(e),XB=()=>{const e=wt("colors"),t=wt("spacing"),n=wt("blur"),r=wt("brightness"),i=wt("borderColor"),a=wt("borderRadius"),s=wt("borderSpacing"),o=wt("borderWidth"),c=wt("contrast"),u=wt("grayscale"),d=wt("hueRotate"),f=wt("invert"),h=wt("gap"),p=wt("gradientColorStops"),g=wt("gradientColorStopPositions"),y=wt("inset"),x=wt("margin"),v=wt("opacity"),b=wt("padding"),w=wt("saturate"),S=wt("scale"),k=wt("sepia"),j=wt("skew"),N=wt("space"),P=wt("translate"),T=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",Ve,t],C=()=>[Ve,t],A=()=>["",Vi,Oa],M=()=>["auto",bl,Ve],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ae=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",Ve],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],oe=()=>[bl,Ve];return{cacheSize:500,separator:":",theme:{colors:[Ec],spacing:[Vi,Oa],blur:["none","",_a,Ve],brightness:oe(),borderColor:[e],borderRadius:["none","","full",_a,Ve],borderSpacing:C(),borderWidth:A(),contrast:oe(),grayscale:H(),hueRotate:oe(),invert:H(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[$B,Oa],inset:_(),margin:_(),opacity:oe(),padding:C(),saturate:oe(),scale:oe(),sepia:H(),skew:oe(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",Ve]}],container:["container"],columns:[{columns:[_a]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),Ve]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pc,Ve]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ve]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Pc,Ve]}],"grid-cols":[{"grid-cols":[Ec]}],"col-start-end":[{col:["auto",{span:["full",Pc,Ve]},Ve]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[Ec]}],"row-start-end":[{row:["auto",{span:[Pc,Ve]},Ve]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ve]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ve]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ve,t]}],"min-w":[{"min-w":[Ve,t,"min","max","fit"]}],"max-w":[{"max-w":[Ve,t,"none","full","min","max","fit","prose",{screen:[_a]},_a]}],h:[{h:[Ve,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ve,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_a,Oa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",x0]}],"font-family":[{font:[Ec]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ve]}],"line-clamp":[{"line-clamp":["none",bl,x0]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vi,Ve]}],"list-image":[{"list-image":["none",Ve]}],"list-style-type":[{list:["none","disc","decimal",Ve]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vi,Oa]}],"underline-offset":[{"underline-offset":["auto",Vi,Ve]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),VB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",UB]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},HB]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...ae(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:ae()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...ae()]}],"outline-offset":[{"outline-offset":[Vi,Ve]}],"outline-w":[{outline:[Vi,Oa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Vi,Oa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_a,KB]}],"shadow-color":[{shadow:[Ec]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",_a,Ve]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ve]}],duration:[{duration:oe()}],ease:[{ease:["linear","in","out","in-out",Ve]}],delay:[{delay:oe()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ve]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Pc,Ve]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ve]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ve]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ve]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Vi,Oa,x0]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ZB=_B(XB);function U(...e){return ZB(ct(e))}const Hu="siclaw_auth",Tm=()=>{try{const e=localStorage.getItem(Hu);if(e)return JSON.parse(e)}catch{localStorage.removeItem(Hu)}return{isAuthenticated:!1}},QB=e=>{localStorage.setItem(Hu,JSON.stringify(e))},JB=async e=>{try{const n=await(await fetch("/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json();if(n.ok&&n.token){const r={isAuthenticated:!0,token:n.token,user:n.user};return QB(r),{ok:!0,token:n.token,user:n.user}}return{ok:!1,error:n.error||"Login failed"}}catch{return{ok:!1,error:"Network error"}}},u_=()=>{localStorage.removeItem(Hu),localStorage.removeItem("siclaw_user_profile"),window.location.href="/login"},e8=()=>Tm().token,ds=()=>Tm().user;function t8(e){try{const t=JSON.parse(atob(e.split(".")[1]));return t.exp?t.exp*1e3<Date.now()-6e4:!0}catch{return!0}}const v0=()=>{const e=Tm();return!e.isAuthenticated||!e.token?!1:t8(e.token)?(localStorage.removeItem(Hu),localStorage.removeItem("siclaw_user_profile"),window.location.href="/login",!1):!0},n8=()=>{const e=e8(),n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return e?`${n}?token=${encodeURIComponent(e)}`:n};var fA,hA;let d_={name:((fA=ds())==null?void 0:fA.username)||"User",role:"",initials:bw(((hA=ds())==null?void 0:hA.username)||"User"),avatarBg:"bg-primary-100"};function bw(e){const t=e.split(" ");return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():e.substring(0,2).toUpperCase()}const Il=()=>{const e=localStorage.getItem("siclaw_user_profile");return e?JSON.parse(e):d_},ep=e=>{const n={...Il(),...e};return e.name&&(n.initials=bw(e.name)),d_=n,localStorage.setItem("siclaw_user_profile",JSON.stringify(n)),window.dispatchEvent(new Event("user-profile-updated")),n};async function r8(e){try{const t=await e("profile.get");if(!t.profile)return null;const n=t.profile,r=n.name||"User";return{name:r,role:n.role||"",initials:bw(r),avatarBg:n.avatarBg||"bg-primary-100"}}catch{return null}}async function i8(e,t){await e("profile.update",t),ep(t)}async function a8(e){const t=ds(),n=await r8(e);if(n)ep(n);else if(t){const r=Il();(r.name==="User"||r.name==="SRE Admin")&&ep({name:t.username})}}const f_=m.createContext(null),Yj=1e3,s8=3e4;function o8({children:e}){const[t,n]=m.useState("disconnected"),r=m.useRef(null),i=m.useRef(0),a=m.useRef(new Map),s=m.useRef(new Set),o=m.useRef(0),c=m.useRef(),u=m.useRef(!1),d=m.useRef(),f=m.useRef("disconnected"),h=m.useCallback(w=>{f.current=w,n(w)},[]),p=m.useCallback(()=>{if(u.current||!v0())return;const w=Yj*Math.pow(2,o.current),S=Math.random()*Yj,k=Math.min(w+S,s8);o.current++,console.log(`[ws] Reconnecting in ${Math.round(k)}ms (attempt ${o.current})`),c.current=setTimeout(()=>{g()},k)},[]),g=m.useCallback(()=>{if(r.current&&(r.current.onopen=null,r.current.onclose=null,r.current.onerror=null,r.current.onmessage=null,(r.current.readyState===WebSocket.OPEN||r.current.readyState===WebSocket.CONNECTING)&&r.current.close(),r.current=null),d.current&&clearTimeout(d.current),!v0()){console.warn("[ws] Not authenticated, skipping connect");return}h("connecting");const w=n8();console.log(`[ws] Connecting to: ${w} (attempt ${o.current})`);const S=new WebSocket(w);r.current=S,d.current=setTimeout(()=>{S.readyState!==WebSocket.OPEN&&(console.warn(`[ws] Connection timeout (3s), readyState=${S.readyState}, retrying...`),S.onclose=null,S.close(),r.current=null,h("disconnected"),p())},3e3),S.onopen=()=>{clearTimeout(d.current),console.log("[ws] Connected"),o.current=0,h("connected")},S.onmessage=k=>{try{const j=JSON.parse(k.data);if(j.type==="res"&&j.id){const N=a.current.get(j.id);if(N){const P=j.error?{code:j.error.code,message:j.error.message??"Unknown error"}:void 0;N(j.payload??j.result,P),a.current.delete(j.id)}}for(const N of Array.from(s.current))N(j)}catch(j){console.error("[ws] Failed to parse message:",j)}},S.onclose=k=>{clearTimeout(d.current),console.log(`[ws] Closed: code=${k.code} reason=${k.reason}`),r.current=null,h("disconnected"),p()},S.onerror=k=>{console.error("[ws] Error:",k)}},[h,p]),y=m.useCallback(()=>{var w;u.current=!0,c.current&&(clearTimeout(c.current),c.current=void 0),(w=r.current)==null||w.close(),r.current=null,h("disconnected")},[h]),x=m.useCallback((w,S)=>new Promise((k,j)=>{if(!r.current||r.current.readyState!==WebSocket.OPEN){j(new Error("WebSocket not connected"));return}const N=String(++i.current);a.current.set(N,(P,T)=>{var E;if(T){if((E=T.message)!=null&&E.includes("Unauthorized")){u_();return}j(new Error(T.message))}else k(P)}),r.current.send(JSON.stringify({type:"req",id:N,method:w,params:S??{}}))}),[]),v=m.useCallback(w=>(s.current.add(w),()=>{s.current.delete(w)}),[]);m.useEffect(()=>(v0()&&(u.current=!1,g()),()=>{y()}),[g,y]);const b={status:t,isConnected:t==="connected",sendRpc:x,connect:g,disconnect:y,subscribe:v};return l.jsx(f_.Provider,{value:b,children:e})}function Rt(e={}){const t=m.useContext(f_);if(!t)throw new Error("useWebSocket must be used within WebSocketProvider");const n=m.useRef(e.onMessage);n.current=e.onMessage,m.useEffect(()=>{if(!n.current)return;const i=a=>{var s;return(s=n.current)==null?void 0:s.call(n,a)};return t.subscribe(i)},[t.subscribe]);const r=m.useRef(e.onStatusChange);return r.current=e.onStatusChange,m.useEffect(()=>{var i;(i=r.current)==null||i.call(r,t.status)},[t.status]),{status:t.status,connect:t.connect,disconnect:t.disconnect,sendRpc:t.sendRpc,isConnected:t.isConnected}}const l8=new Set(["cron_success","cron_failure","cron_result"]);function c8(e){const t=new Map,n=[];for(const r of e)if(l8.has(r.type)&&r.relatedId){const i=t.get(r.relatedId);i?i.push(r):t.set(r.relatedId,[r])}else n.push({key:r.id,type:r.type,title:r.title,relatedId:r.relatedId,notifications:[r],latestAt:r.createdAt,unreadCount:r.isRead?0:1});for(const[r,i]of t){const a=i[0].type;n.push({key:`cron:${r}`,type:a,title:i[0].title,relatedId:r,notifications:i,latestAt:i[0].createdAt,unreadCount:i.filter(s=>!s.isRead).length})}return n.sort((r,i)=>{const a=r.latestAt?new Date(r.latestAt).getTime():0;return(i.latestAt?new Date(i.latestAt).getTime():0)-a}),n}function u8(e){const[t,n]=m.useState([]),[r,i]=m.useState(0),a=m.useCallback(async()=>{try{const[f,h]=await Promise.all([e("notification.list"),e("notification.unreadCount")]);n(f.notifications??[]),i(h.count??0)}catch(f){console.error("[useNotifications] Failed to load:",f)}},[e]),s=m.useCallback(async f=>{try{await e("notification.markRead",{id:f}),n(h=>h.map(p=>p.id===f?{...p,isRead:!0}:p)),i(h=>Math.max(0,h-1))}catch(h){console.error("[useNotifications] markRead failed:",h)}},[e]),o=m.useCallback(async()=>{try{await e("notification.markRead",{id:"all"}),n(f=>f.map(h=>({...h,isRead:!0}))),i(0)}catch(f){console.error("[useNotifications] markAllRead failed:",f)}},[e]),c=m.useCallback(async f=>{try{await e("notification.dismiss",{id:f}),n(h=>{const p=h.find(g=>g.id===f);return p&&!p.isRead&&i(g=>Math.max(0,g-1)),h.filter(g=>g.id!==f)})}catch(h){console.error("[useNotifications] dismissOne failed:",h)}},[e]),u=m.useCallback(async()=>{try{await e("notification.dismissAll"),n([]),i(0)}catch(f){console.error("[useNotifications] dismissAll failed:",f)}},[e]),d=m.useCallback(f=>{if(f.type==="event"&&f.event==="notification"&&f.payload){const h=f.payload;n(p=>[h,...p]),i(p=>p+1)}},[]);return{notifications:t,unreadCount:r,loadNotifications:a,markRead:s,markAllRead:o,dismissOne:c,dismissAll:u,handleWsEvent:d}}function d8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const f8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,p8={};function Xj(e,t){return(p8.jsx?h8:f8).test(e)}const m8=/[ \t\n\f\r]/g;function g8(e){return typeof e=="object"?e.type==="text"?Zj(e.value):!1:Zj(e)}function Zj(e){return e.replace(m8,"")===""}class Nd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Nd.prototype.normal={};Nd.prototype.property={};Nd.prototype.space=void 0;function h_(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Nd(n,r,t)}function Tx(e){return e.toLowerCase()}class sr{constructor(t,n){this.attribute=n,this.property=t}}sr.prototype.attribute="";sr.prototype.booleanish=!1;sr.prototype.boolean=!1;sr.prototype.commaOrSpaceSeparated=!1;sr.prototype.commaSeparated=!1;sr.prototype.defined=!1;sr.prototype.mustUseProperty=!1;sr.prototype.number=!1;sr.prototype.overloadedBoolean=!1;sr.prototype.property="";sr.prototype.spaceSeparated=!1;sr.prototype.space=void 0;let y8=0;const We=Po(),Gt=Po(),Ox=Po(),xe=Po(),xt=Po(),wl=Po(),cr=Po();function Po(){return 2**++y8}const _x=Object.freeze(Object.defineProperty({__proto__:null,boolean:We,booleanish:Gt,commaOrSpaceSeparated:cr,commaSeparated:wl,number:xe,overloadedBoolean:Ox,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),b0=Object.keys(_x);class ww extends sr{constructor(t,n,r,i){let a=-1;if(super(t,n),Qj(this,"space",i),typeof r=="number")for(;++a<b0.length;){const s=b0[a];Qj(this,b0[a],(r&_x[s])===_x[s])}}}ww.prototype.defined=!0;function Qj(e,t,n){n&&(e[t]=n)}function ec(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new ww(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Tx(r)]=r,n[Tx(a.attribute)]=r}return new Nd(t,n,e.space)}const p_=ec({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:xt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:xe,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:xt,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Gt,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function m_(e,t){return t in e?e[t]:t}function g_(e,t){return m_(e,t.toLowerCase())}const x8=ec({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:wl,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:We,allowPaymentRequest:We,allowUserMedia:We,alt:null,as:null,async:We,autoCapitalize:null,autoComplete:xt,autoFocus:We,autoPlay:We,blocking:xt,capture:null,charSet:null,checked:We,cite:null,className:xt,cols:xe,colSpan:null,content:null,contentEditable:Gt,controls:We,controlsList:xt,coords:xe|wl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:We,defer:We,dir:null,dirName:null,disabled:We,download:Ox,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:We,formTarget:null,headers:xt,height:xe,hidden:Ox,high:xe,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:We,inputMode:null,integrity:null,is:null,isMap:We,itemId:null,itemProp:xt,itemRef:xt,itemScope:We,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:We,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:We,muted:We,name:null,nonce:null,noModule:We,noValidate:We,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:We,optimum:xe,pattern:null,ping:xt,placeholder:null,playsInline:We,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:We,referrerPolicy:null,rel:xt,required:We,reversed:We,rows:xe,rowSpan:xe,sandbox:xt,scope:null,scoped:We,seamless:We,selected:We,shadowRootClonable:We,shadowRootDelegatesFocus:We,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:We,useMap:null,value:Gt,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:We,declare:We,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:We,noHref:We,noShade:We,noWrap:We,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:We,disableRemotePlayback:We,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:g_}),v8=ec({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",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:cr,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:xt,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:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:We,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,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:wl,g2:wl,glyphName:wl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:cr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,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:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cr,rev:cr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cr,requiredFeatures:cr,requiredFonts:cr,requiredFormats:cr,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:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:cr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cr,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:m_}),y_=ec({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()}}),x_=ec({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:g_}),v_=ec({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),b8={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"},w8=/[A-Z]/g,Jj=/-[a-z]/g,S8=/^data[-\w.:]+$/i;function k8(e,t){const n=Tx(t);let r=t,i=sr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&S8.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Jj,N8);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Jj.test(a)){let s=a.replace(w8,j8);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=ww}return new i(r,t)}function j8(e){return"-"+e.toLowerCase()}function N8(e){return e.charAt(1).toUpperCase()}const C8=h_([p_,x8,y_,x_,v_],"html"),Sw=h_([p_,v8,y_,x_,v_],"svg");function P8(e){return e.join(" ").trim()}var kw={},eN=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,E8=/\n/g,A8=/^\s*/,T8=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,O8=/^:\s*/,_8=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,D8=/^[;\s]*/,M8=/^\s+|\s+$/g,I8=`
|
|
559
|
+
`,tN="/",nN="*",Us="",L8="comment",R8="declaration";function F8(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 y=g.match(E8);y&&(n+=y.length);var x=g.lastIndexOf(I8);r=~x?g.length-x:r+g.length}function a(){var g={line:n,column:r};return function(y){return y.position=new s(g),u(),y}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function o(g){var y=new Error(t.source+":"+n+":"+r+": "+g);if(y.reason=g,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function c(g){var y=g.exec(e);if(y){var x=y[0];return i(x),e=e.slice(x.length),y}}function u(){c(A8)}function d(g){var y;for(g=g||[];y=f();)y!==!1&&g.push(y);return g}function f(){var g=a();if(!(tN!=e.charAt(0)||nN!=e.charAt(1))){for(var y=2;Us!=e.charAt(y)&&(nN!=e.charAt(y)||tN!=e.charAt(y+1));)++y;if(y+=2,Us===e.charAt(y-1))return o("End of comment missing");var x=e.slice(2,y-2);return r+=2,i(x),e=e.slice(y),r+=2,g({type:L8,comment:x})}}function h(){var g=a(),y=c(T8);if(y){if(f(),!c(O8))return o("property missing ':'");var x=c(_8),v=g({type:R8,property:rN(y[0].replace(eN,Us)),value:x?rN(x[0].replace(eN,Us)):Us});return c(D8),v}}function p(){var g=[];d(g);for(var y;y=h();)y!==!1&&(g.push(y),d(g));return g}return u(),p()}function rN(e){return e?e.replace(M8,Us):Us}var z8=F8,$8=Ln&&Ln.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kw,"__esModule",{value:!0});kw.default=U8;const B8=$8(z8);function U8(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,B8.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:s,value:o}=a;i?t(s,o,a):o&&(n=n||{},n[s]=o)}),n}var Om={};Object.defineProperty(Om,"__esModule",{value:!0});Om.camelCase=void 0;var V8=/^--[a-zA-Z0-9_-]+$/,W8=/-([a-z])/g,H8=/^[^-]+$/,K8=/^-(webkit|moz|ms|o|khtml)-/,q8=/^-(ms)-/,G8=function(e){return!e||H8.test(e)||V8.test(e)},Y8=function(e,t){return t.toUpperCase()},iN=function(e,t){return"".concat(t,"-")},X8=function(e,t){return t===void 0&&(t={}),G8(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(q8,iN):e=e.replace(K8,iN),e.replace(W8,Y8))};Om.camelCase=X8;var Z8=Ln&&Ln.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Q8=Z8(kw),J8=Om;function Dx(e,t){var n={};return!e||typeof e!="string"||(0,Q8.default)(e,function(r,i){r&&i&&(n[(0,J8.camelCase)(r,t)]=i)}),n}Dx.default=Dx;var e9=Dx;const t9=fi(e9),b_=w_("end"),jw=w_("start");function w_(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 n9(e){const t=jw(e),n=b_(e);if(t&&n)return{start:t,end:n}}function fu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?aN(e.position):"start"in e||"end"in e?aN(e):"line"in e||"column"in e?Mx(e):""}function Mx(e){return sN(e&&e.line)+":"+sN(e&&e.column)}function aN(e){return Mx(e&&e.start)+"-"+Mx(e&&e.end)}function sN(e){return e&&typeof e=="number"?e:1}class zn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!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&&(s=!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 o=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=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=fu(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=s&&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}}zn.prototype.file="";zn.prototype.name="";zn.prototype.reason="";zn.prototype.message="";zn.prototype.stack="";zn.prototype.column=void 0;zn.prototype.line=void 0;zn.prototype.ancestors=void 0;zn.prototype.cause=void 0;zn.prototype.fatal=void 0;zn.prototype.place=void 0;zn.prototype.ruleId=void 0;zn.prototype.source=void 0;const Nw={}.hasOwnProperty,r9=new Map,i9=/[A-Z]/g,a9=new Set(["table","tbody","thead","tfoot","tr"]),s9=new Set(["td","th"]),S_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function o9(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=m9(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=p9(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"?Sw:C8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=k_(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function k_(e,t,n){if(t.type==="element")return l9(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return c9(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return d9(e,t,n);if(t.type==="mdxjsEsm")return u9(e,t);if(t.type==="root")return f9(e,t,n);if(t.type==="text")return h9(e,t)}function l9(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Sw,e.schema=i),e.ancestors.push(t);const a=N_(e,t.tagName,!1),s=g9(e,t);let o=Pw(e,t);return a9.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!g8(c):!0})),j_(e,s,a,t),Cw(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function c9(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)}Ku(e,t.position)}function u9(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ku(e,t.position)}function d9(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Sw,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:N_(e,t.name,!0),s=y9(e,t),o=Pw(e,t);return j_(e,s,a,t),Cw(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function f9(e,t,n){const r={};return Cw(r,Pw(e,t)),e.create(t,e.Fragment,r,n)}function h9(e,t){return t.value}function j_(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Cw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function p9(e,t,n){return r;function r(i,a,s,o){const u=Array.isArray(s.children)?n:t;return o?u(a,s,o):u(a,s)}}function m9(e,t){return n;function n(r,i,a,s){const o=Array.isArray(a.children),c=jw(r);return t(i,a,s,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function g9(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Nw.call(t.properties,i)){const a=x9(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&s9.has(t.tagName)?r=o:n[s]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function y9(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 s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Ku(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 o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else Ku(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Pw(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:r9;for(;++r<t.children.length;){const a=t.children[r];let s;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;s=c+"-"+u,i.set(c,u+1)}}const o=k_(e,a,s);o!==void 0&&n.push(o)}return n}function x9(e,t,n){const r=k8(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?d8(n):P8(n)),r.property==="style"){let i=typeof n=="object"?n:v9(e,String(n));return e.stylePropertyNameCase==="css"&&(i=b9(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?b8[r.property]||r.property:r.attribute,n]}}function v9(e,t){try{return t9(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new zn("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=S_+"#cannot-parse-style-attribute",i}}function N_(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const o=Xj(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=s}else r=Xj(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Nw.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ku(e)}function Ku(e,t){const n=new zn("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=S_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function b9(e){const t={};let n;for(n in e)Nw.call(e,n)&&(t[w9(n)]=e[n]);return t}function w9(e){let t=e.replace(i9,S9);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function S9(e){return"-"+e.toLowerCase()}const w0={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"]},k9={};function Ew(e,t){const n=k9,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return C_(e,r,i)}function C_(e,t,n){if(j9(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 oN(e.children,t,n)}return Array.isArray(e)?oN(e,t,n):""}function oN(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=C_(e[i],t,n);return r.join("")}function j9(e){return!!(e&&typeof e=="object")}const lN=document.createElement("i");function Aw(e){const t="&"+e+";";lN.innerHTML=t;const n=lN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gr(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function Lr(e,t){return e.length>0?(gr(e,e.length,0,t),e):t}const cN={}.hasOwnProperty;function P_(e){const t={};let n=-1;for(;++n<e.length;)N9(t,e[n]);return t}function N9(e,t){let n;for(n in t){const i=(cN.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){cN.call(i,s)||(i[s]=[]);const o=a[s];C9(i[s],Array.isArray(o)?o:o?[o]:[])}}}function C9(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);gr(e,0,0,r)}function E_(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 oi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Un=bs(/[A-Za-z]/),Dn=bs(/[\dA-Za-z]/),P9=bs(/[#-'*+\--9=?A-Z^-~]/);function tp(e){return e!==null&&(e<32||e===127)}const Ix=bs(/\d/),E9=bs(/[\dA-Fa-f]/),A9=bs(/[!-/:-@[-`{-~]/);function Le(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function qe(e){return e===-2||e===-1||e===32}const _m=bs(new RegExp("\\p{P}|\\p{S}","u")),go=bs(/\s/);function bs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tc(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&Dn(e.charCodeAt(n+1))&&Dn(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Je(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(c){return qe(c)?(e.enter(n),o(c)):t(c)}function o(c){return qe(c)&&a++<i?(e.consume(c),o):(e.exit(n),t(c))}}const T9={tokenize:O9};function O9(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Je(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Le(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const _9={tokenize:D9},uN={tokenize:M9};function D9(e){const t=this,n=[];let r=0,i,a,s;return o;function o(w){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const S=t.events.length;let k=S,j;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){j=t.events[k][1].end;break}v(r);let N=S;for(;N<t.events.length;)t.events[N][1].end={...j},N++;return gr(t.events,k+1,0,t.events.slice(S)),t.events.length=N,u(w)}return o(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(uN,d,f)(w)}function d(w){return i&&b(),v(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(w)}function h(w){return t.containerState={},e.attempt(uN,p,g)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function g(w){if(w===null){i&&b(),v(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),y(w)}function y(w){if(w===null){x(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return Le(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(w),y)}function x(w,S){const k=t.sliceStream(w);if(S&&k.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let j=i.events.length;for(;j--;)if(i.events[j][1].start.offset<s&&(!i.events[j][1].end||i.events[j][1].end.offset>s))return;const N=t.events.length;let P=N,T,E;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(T){E=t.events[P][1].end;break}T=!0}for(v(r),j=N;j<t.events.length;)t.events[j][1].end={...E},j++;gr(t.events,P+1,0,t.events.slice(N)),t.events.length=j}}function v(w){let S=n.length;for(;S-- >w;){const k=n[S];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function M9(e,t,n){return Je(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ll(e){if(e===null||ht(e)||go(e))return 1;if(_m(e))return 2}function Dm(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 Lx={name:"attention",resolveAll:I9,tokenize:L9};function I9(e,t){let n=-1,r,i,a,s,o,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};dN(f,-c),dN(h,c),s={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[r][1].end={...s.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Lr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Lr(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),u=Lr(u,Dm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Lr(u,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Lr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,gr(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 L9(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ll(r);let a;return s;function s(c){return a=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===a)return e.consume(c),o;const u=e.exit("attentionSequence"),d=Ll(c),f=!d||d===2&&i||n.includes(c),h=!i||i===2&&d||n.includes(r);return u._open=!!(a===42?f:f&&(i||!h)),u._close=!!(a===42?h:h&&(d||!f)),t(c)}}function dN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const R9={name:"autolink",tokenize:F9};function F9(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return Un(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||Dn(p)?(r=1,o(p)):u(p)}function o(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||Dn(p))&&r++<32?(e.consume(p),o):(r=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||tp(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):P9(p)?(e.consume(p),u):n(p)}function d(p){return Dn(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Dn(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const Cd={partial:!0,tokenize:z9};function z9(e,t,n){return r;function r(a){return qe(a)?Je(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Le(a)?t(a):n(a)}}const A_={continuation:{tokenize:B9},exit:U9,name:"blockQuote",tokenize:$9};function $9(e,t,n){const r=this;return i;function i(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return qe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function B9(e,t,n){const r=this;return i;function i(s){return qe(s)?Je(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(A_,t,n)(s)}}function U9(e){e.exit("blockQuote")}const T_={name:"characterEscape",tokenize:V9};function V9(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 A9(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const O_={name:"characterReference",tokenize:W9};function W9(e,t,n){const r=this;let i=0,a,s;return o;function o(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,s=Dn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=E9,d):(e.enter("characterReferenceValue"),a=7,s=Ix,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===Dn&&!Aw(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<a?(e.consume(f),d):n(f)}}const fN={partial:!0,tokenize:K9},hN={concrete:!0,name:"codeFenced",tokenize:H9};function H9(e,t,n){const r=this,i={partial:!0,tokenize:k};let a=0,s=0,o;return c;function c(j){return u(j)}function u(j){const N=r.events[r.events.length-1];return a=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,o=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(j)}function d(j){return j===o?(s++,e.consume(j),d):s<3?n(j):(e.exit("codeFencedFenceSequence"),qe(j)?Je(e,f,"whitespace")(j):f(j))}function f(j){return j===null||Le(j)?(e.exit("codeFencedFence"),r.interrupt?t(j):e.check(fN,y,S)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(j))}function h(j){return j===null||Le(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(j)):qe(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Je(e,p,"whitespace")(j)):j===96&&j===o?n(j):(e.consume(j),h)}function p(j){return j===null||Le(j)?f(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(j))}function g(j){return j===null||Le(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(j)):j===96&&j===o?n(j):(e.consume(j),g)}function y(j){return e.attempt(i,S,x)(j)}function x(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),v}function v(j){return a>0&&qe(j)?Je(e,b,"linePrefix",a+1)(j):b(j)}function b(j){return j===null||Le(j)?e.check(fN,y,S)(j):(e.enter("codeFlowValue"),w(j))}function w(j){return j===null||Le(j)?(e.exit("codeFlowValue"),b(j)):(e.consume(j),w)}function S(j){return e.exit("codeFenced"),t(j)}function k(j,N,P){let T=0;return E;function E(B){return j.enter("lineEnding"),j.consume(B),j.exit("lineEnding"),_}function _(B){return j.enter("codeFencedFence"),qe(B)?Je(j,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):C(B)}function C(B){return B===o?(j.enter("codeFencedFenceSequence"),A(B)):P(B)}function A(B){return B===o?(T++,j.consume(B),A):T>=s?(j.exit("codeFencedFenceSequence"),qe(B)?Je(j,M,"whitespace")(B):M(B)):P(B)}function M(B){return B===null||Le(B)?(j.exit("codeFencedFence"),N(B)):P(B)}}}function K9(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const S0={name:"codeIndented",tokenize:G9},q9={partial:!0,tokenize:Y9};function G9(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Je(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?s(u):n(u)}function s(u){return u===null?c(u):Le(u)?e.attempt(q9,s,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Le(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function Y9(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Le(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Je(e,a,"linePrefix",5)(s)}function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):Le(s)?i(s):n(s)}}const X9={name:"codeText",previous:Q9,resolve:Z9,tokenize:J9};function Z9(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 Q9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function J9(e,t,n){let r=0,i,a;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(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)):Le(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||Le(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 eU{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&&Ac(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),Ac(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ac(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);Ac(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ac(this.left,n.reverse())}}}function Ac(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 __(e){const t={};let n=-1,r,i,a,s,o,c,u;const d=new eU(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,tU(d,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=d.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return gr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function tU(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,c=[],u={};let d,f,h=-1,p=n,g=0,y=0;const x=[y];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(y=h+1,x.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),h=x.length;h--;){const v=o.slice(x[h],x[h+1]),b=a.pop();c.push([b,b+v.length-1]),e.splice(b,2,v)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const nU={resolve:iU,tokenize:aU},rU={partial:!0,tokenize:sU};function iU(e){return __(e),e}function aU(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):Le(o)?e.check(rU,s,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function sU(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Je(e,a,"linePrefix")}function a(s){if(s===null||Le(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function D_(e,t,n,r,i,a,s,o,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(v){return v===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(v),e.exit(a),h):v===null||v===32||v===41||tp(v)?n(v):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(v))}function h(v){return v===62?(e.enter(a),e.consume(v),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===62?(e.exit("chunkString"),e.exit(o),h(v)):v===null||v===60||Le(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===60||v===62||v===92?(e.consume(v),p):p(v)}function y(v){return!d&&(v===null||v===41||ht(v))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(v)):d<u&&v===40?(e.consume(v),d++,y):v===41?(e.consume(v),d--,y):v===null||v===32||v===40||tp(v)?n(v):(e.consume(v),v===92?x:y)}function x(v){return v===40||v===41||v===92?(e.consume(v),y):y(v)}}function M_(e,t,n,r,i,a){const s=this;let o=0,c;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),d}function d(p){return o>999||p===null||p===91||p===93&&!c||p===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Le(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Le(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!qe(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function I_(e,t,n,r,i,a){let s;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,c):n(h)}function c(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(a),u(h))}function u(h){return h===s?(e.exit(a),c(s)):h===null?n(h):Le(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Je(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||Le(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===s||h===92?(e.consume(h),d):d(h)}}function hu(e,t){let n;return r;function r(i){return Le(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):qe(i)?Je(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const oU={name:"definition",tokenize:cU},lU={partial:!0,tokenize:uU};function cU(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),s(p)}function s(p){return M_.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=oi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return ht(p)?hu(e,u)(p):u(p)}function u(p){return D_(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(lU,f,f)(p)}function f(p){return qe(p)?Je(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Le(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function uU(e,t,n){return r;function r(o){return ht(o)?hu(e,i)(o):n(o)}function i(o){return I_(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return qe(o)?Je(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Le(o)?t(o):n(o)}}const dU={name:"hardBreakEscape",tokenize:fU};function fU(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Le(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const hU={name:"headingAtx",resolve:pU,tokenize:mU};function pU(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"},gr(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function mU(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||ht(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Le(d)?(e.exit("atxHeading"),t(d)):qe(d)?Je(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||ht(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const gU=["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"],pN=["pre","script","style","textarea"],yU={concrete:!0,name:"htmlFlow",resolveTo:bU,tokenize:wU},xU={partial:!0,tokenize:kU},vU={partial:!0,tokenize:SU};function bU(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 wU(e,t,n){const r=this;let i,a,s,o,c;return u;function u(D){return d(D)}function d(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),f}function f(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),a=!0,y):D===63?(e.consume(D),i=3,r.interrupt?t:O):Un(D)?(e.consume(D),s=String.fromCharCode(D),x):n(D)}function h(D){return D===45?(e.consume(D),i=2,p):D===91?(e.consume(D),i=5,o=0,g):Un(D)?(e.consume(D),i=4,r.interrupt?t:O):n(D)}function p(D){return D===45?(e.consume(D),r.interrupt?t:O):n(D)}function g(D){const G="CDATA[";return D===G.charCodeAt(o++)?(e.consume(D),o===G.length?r.interrupt?t:C:g):n(D)}function y(D){return Un(D)?(e.consume(D),s=String.fromCharCode(D),x):n(D)}function x(D){if(D===null||D===47||D===62||ht(D)){const G=D===47,te=s.toLowerCase();return!G&&!a&&pN.includes(te)?(i=1,r.interrupt?t(D):C(D)):gU.includes(s.toLowerCase())?(i=6,G?(e.consume(D),v):r.interrupt?t(D):C(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?b(D):w(D))}return D===45||Dn(D)?(e.consume(D),s+=String.fromCharCode(D),x):n(D)}function v(D){return D===62?(e.consume(D),r.interrupt?t:C):n(D)}function b(D){return qe(D)?(e.consume(D),b):E(D)}function w(D){return D===47?(e.consume(D),E):D===58||D===95||Un(D)?(e.consume(D),S):qe(D)?(e.consume(D),w):E(D)}function S(D){return D===45||D===46||D===58||D===95||Dn(D)?(e.consume(D),S):k(D)}function k(D){return D===61?(e.consume(D),j):qe(D)?(e.consume(D),k):w(D)}function j(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),c=D,N):qe(D)?(e.consume(D),j):P(D)}function N(D){return D===c?(e.consume(D),c=null,T):D===null||Le(D)?n(D):(e.consume(D),N)}function P(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||ht(D)?k(D):(e.consume(D),P)}function T(D){return D===47||D===62||qe(D)?w(D):n(D)}function E(D){return D===62?(e.consume(D),_):n(D)}function _(D){return D===null||Le(D)?C(D):qe(D)?(e.consume(D),_):n(D)}function C(D){return D===45&&i===2?(e.consume(D),ae):D===60&&i===1?(e.consume(D),Q):D===62&&i===4?(e.consume(D),oe):D===63&&i===3?(e.consume(D),O):D===93&&i===5?(e.consume(D),H):Le(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xU,re,A)(D)):D===null||Le(D)?(e.exit("htmlFlowData"),A(D)):(e.consume(D),C)}function A(D){return e.check(vU,M,re)(D)}function M(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),B}function B(D){return D===null||Le(D)?A(D):(e.enter("htmlFlowData"),C(D))}function ae(D){return D===45?(e.consume(D),O):C(D)}function Q(D){return D===47?(e.consume(D),s="",I):C(D)}function I(D){if(D===62){const G=s.toLowerCase();return pN.includes(G)?(e.consume(D),oe):C(D)}return Un(D)&&s.length<8?(e.consume(D),s+=String.fromCharCode(D),I):C(D)}function H(D){return D===93?(e.consume(D),O):C(D)}function O(D){return D===62?(e.consume(D),oe):D===45&&i===2?(e.consume(D),O):C(D)}function oe(D){return D===null||Le(D)?(e.exit("htmlFlowData"),re(D)):(e.consume(D),oe)}function re(D){return e.exit("htmlFlow"),t(D)}}function SU(e,t,n){const r=this;return i;function i(s){return Le(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function kU(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Cd,t,n)}}const jU={name:"htmlText",tokenize:NU};function NU(e,t,n){const r=this;let i,a,s;return o;function o(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),c}function c(O){return O===33?(e.consume(O),u):O===47?(e.consume(O),k):O===63?(e.consume(O),w):Un(O)?(e.consume(O),P):n(O)}function u(O){return O===45?(e.consume(O),d):O===91?(e.consume(O),a=0,g):Un(O)?(e.consume(O),b):n(O)}function d(O){return O===45?(e.consume(O),p):n(O)}function f(O){return O===null?n(O):O===45?(e.consume(O),h):Le(O)?(s=f,Q(O)):(e.consume(O),f)}function h(O){return O===45?(e.consume(O),p):f(O)}function p(O){return O===62?ae(O):O===45?h(O):f(O)}function g(O){const oe="CDATA[";return O===oe.charCodeAt(a++)?(e.consume(O),a===oe.length?y:g):n(O)}function y(O){return O===null?n(O):O===93?(e.consume(O),x):Le(O)?(s=y,Q(O)):(e.consume(O),y)}function x(O){return O===93?(e.consume(O),v):y(O)}function v(O){return O===62?ae(O):O===93?(e.consume(O),v):y(O)}function b(O){return O===null||O===62?ae(O):Le(O)?(s=b,Q(O)):(e.consume(O),b)}function w(O){return O===null?n(O):O===63?(e.consume(O),S):Le(O)?(s=w,Q(O)):(e.consume(O),w)}function S(O){return O===62?ae(O):w(O)}function k(O){return Un(O)?(e.consume(O),j):n(O)}function j(O){return O===45||Dn(O)?(e.consume(O),j):N(O)}function N(O){return Le(O)?(s=N,Q(O)):qe(O)?(e.consume(O),N):ae(O)}function P(O){return O===45||Dn(O)?(e.consume(O),P):O===47||O===62||ht(O)?T(O):n(O)}function T(O){return O===47?(e.consume(O),ae):O===58||O===95||Un(O)?(e.consume(O),E):Le(O)?(s=T,Q(O)):qe(O)?(e.consume(O),T):ae(O)}function E(O){return O===45||O===46||O===58||O===95||Dn(O)?(e.consume(O),E):_(O)}function _(O){return O===61?(e.consume(O),C):Le(O)?(s=_,Q(O)):qe(O)?(e.consume(O),_):T(O)}function C(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),i=O,A):Le(O)?(s=C,Q(O)):qe(O)?(e.consume(O),C):(e.consume(O),M)}function A(O){return O===i?(e.consume(O),i=void 0,B):O===null?n(O):Le(O)?(s=A,Q(O)):(e.consume(O),A)}function M(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||ht(O)?T(O):(e.consume(O),M)}function B(O){return O===47||O===62||ht(O)?T(O):n(O)}function ae(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Q(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),I}function I(O){return qe(O)?Je(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):H(O)}function H(O){return e.enter("htmlTextData"),s(O)}}const Tw={name:"labelEnd",resolveAll:AU,resolveTo:TU,tokenize:OU},CU={tokenize:_U},PU={tokenize:DU},EU={tokenize:MU};function AU(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&&gr(e,0,e.length,n),e}function TU(e,t){let n=e.length,r=0,i,a,s,o;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(s){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"&&(s=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[s][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",c,t],["enter",u,t]],o=Lr(o,e.slice(a+1,a+r+3)),o=Lr(o,[["enter",d,t]]),o=Lr(o,Dm(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),o=Lr(o,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),o=Lr(o,e.slice(s+1)),o=Lr(o,[["exit",c,t]]),gr(e,a,e.length,o),e}function OU(e,t,n){const r=this;let i=r.events.length,a,s;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 o;function o(h){return a?a._inactive?f(h):(s=r.parser.defined.includes(oi(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(CU,d,s?d:f)(h):h===91?e.attempt(PU,d,s?u:f)(h):s?d(h):f(h)}function u(h){return e.attempt(EU,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function _U(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 ht(f)?hu(e,a)(f):a(f)}function a(f){return f===41?d(f):D_(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ht(f)?hu(e,c)(f):d(f)}function o(f){return n(f)}function c(f){return f===34||f===39||f===40?I_(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return ht(f)?hu(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 DU(e,t,n){const r=this;return i;function i(o){return M_.call(r,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(oi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function MU(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 IU={name:"labelStartImage",resolveAll:Tw.resolveAll,tokenize:LU};function LU(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const RU={name:"labelStartLink",resolveAll:Tw.resolveAll,tokenize:FU};function FU(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const k0={name:"lineEnding",tokenize:zU};function zU(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Je(e,t,"linePrefix")}}const hh={name:"thematicBreak",tokenize:$U};function $U(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Le(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),qe(u)?Je(e,o,"whitespace")(u):o(u))}}const Zn={continuation:{tokenize:WU},exit:KU,name:"list",tokenize:VU},BU={partial:!0,tokenize:qU},UU={partial:!0,tokenize:HU};function VU(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,s=0;return o;function o(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ix(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(hh,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return Ix(p)&&++s<10?(e.consume(p),c):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Cd,r.interrupt?n:d,e.attempt(BU,h,f))}function d(p){return r.containerState.initialBlankLine=!0,a++,h(p)}function f(p){return qe(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function WU(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Cd,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Je(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!qe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(UU,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Je(e,e.attempt(Zn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function HU(e,t,n){const r=this;return Je(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function KU(e){e.exit(this.containerState.type)}function qU(e,t,n){const r=this;return Je(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!qe(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const mN={name:"setextUnderline",resolveTo:GU,tokenize:YU};function GU(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 s={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",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function YU(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,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),qe(u)?Je(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Le(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const XU={tokenize:ZU};function ZU(e){const t=this,n=e.attempt(Cd,r,e.attempt(this.parser.constructs.flowInitial,i,Je(e,e.attempt(this.parser.constructs.flow,i,e.attempt(nU,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 QU={resolveAll:R_()},JU=L_("string"),eV=L_("text");function L_(e){return{resolveAll:R_(e==="text"?tV:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,o);return s;function s(d){return u(d)?a(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),a(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function R_(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 tV(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,s=-1,o=0,c;for(;a--;){const u=i[a];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(u===-2)c=!0,o++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},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 nV={42:Zn,43:Zn,45:Zn,48:Zn,49:Zn,50:Zn,51:Zn,52:Zn,53:Zn,54:Zn,55:Zn,56:Zn,57:Zn,62:A_},rV={91:oU},iV={[-2]:S0,[-1]:S0,32:S0},aV={35:hU,42:hh,45:[mN,hh],60:yU,61:mN,95:hh,96:hN,126:hN},sV={38:O_,92:T_},oV={[-5]:k0,[-4]:k0,[-3]:k0,33:IU,38:O_,42:Lx,60:[R9,jU],91:RU,92:[dU,T_],93:Tw,95:Lx,96:X9},lV={null:[Lx,QU]},cV={null:[42,95]},uV={null:[]},dV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cV,contentInitial:rV,disable:uV,document:nV,flow:aV,flowInitial:iV,insideSpan:lV,string:sV,text:oV},Symbol.toStringTag,{value:"Module"}));function fV(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 s=[],o=[];const c={attempt:N(k),check:N(j),consume:b,enter:w,exit:S,interrupt:N(j,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function f(_){return s=Lr(s,_),x(),s[s.length-1]!==null?[]:(P(t,0),u.events=Dm(a,u.events,u),u.events)}function h(_,C){return pV(p(_),C)}function p(_){return hV(s,_)}function g(){const{_bufferIndex:_,_index:C,line:A,column:M,offset:B}=r;return{_bufferIndex:_,_index:C,line:A,column:M,offset:B}}function y(_){i[_.line]=_.column,E()}function x(){let _;for(;r._index<s.length;){const C=s[r._index];if(typeof C=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<C.length;)v(C.charCodeAt(r._bufferIndex));else v(C)}}function v(_){d=d(_)}function b(_){Le(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,E()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=_}function w(_,C){const A=C||{};return A.type=_,A.start=g(),u.events.push(["enter",A,u]),o.push(A),A}function S(_){const C=o.pop();return C.end=g(),u.events.push(["exit",C,u]),C}function k(_,C){P(_,C.from)}function j(_,C){C.restore()}function N(_,C){return A;function A(M,B,ae){let Q,I,H,O;return Array.isArray(M)?re(M):"tokenize"in M?re([M]):oe(M);function oe(ee){return Z;function Z(ce){const J=ce!==null&&ee[ce],ne=ce!==null&&ee.null,be=[...Array.isArray(J)?J:J?[J]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return re(be)(ce)}}function re(ee){return Q=ee,I=0,ee.length===0?ae:D(ee[I])}function D(ee){return Z;function Z(ce){return O=T(),H=ee,ee.partial||(u.currentConstruct=ee),ee.name&&u.parser.constructs.disable.null.includes(ee.name)?te():ee.tokenize.call(C?Object.assign(Object.create(u),C):u,c,G,te)(ce)}}function G(ee){return _(H,O),B}function te(ee){return O.restore(),++I<Q.length?D(Q[I]):ae}}}function P(_,C){_.resolveAll&&!a.includes(_)&&a.push(_),_.resolve&&gr(u.events,C,u.events.length-C,_.resolve(u.events.slice(C),u)),_.resolveTo&&(u.events=_.resolveTo(u.events,u))}function T(){const _=g(),C=u.previous,A=u.currentConstruct,M=u.events.length,B=Array.from(o);return{from:M,restore:ae};function ae(){r=_,u.previous=C,u.currentConstruct=A,u.events.length=M,o=B,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function hV(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function pV(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
|
|
560
|
+
`;break}case-3:{s=`\r
|
|
561
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function mV(e){const r={constructs:P_([dV,...(e||{}).extensions||[]]),content:i(T9),defined:[],document:i(_9),flow:i(XU),lazy:{},string:i(JU),text:i(eV)};return r;function i(a){return s;function s(o){return fV(r,a,o)}}}function gV(e){for(;!__(e););return e}const gN=/[\0\t\n\r]/g;function yV(){let e=1,t="",n=!0,r;return i;function i(a,s,o){const c=[];let u,d,f,h,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(gN.lastIndex=f,u=gN.exec(a),h=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(h),!u){t=a.slice(f);break}if(p===10&&f===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<h&&(c.push(a.slice(f,h)),e+=h-f),p){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const xV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function vV(e){return e.replace(xV,bV)}function bV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return E_(n.slice(a?2:1),a?16:10)}return Aw(n)||e}const F_={}.hasOwnProperty;function wV(e,t,n){return typeof t!="string"&&(n=t,t=void 0),SV(n)(gV(mV(n).document().write(yV()(e,t,!0))))}function SV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(et),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(ne),characterEscape:T,characterReference:T,codeFenced:a(be),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(be,s),codeText:a(Y,s),codeTextData:T,data:T,codeFlowValue:T,definition:a(R),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(F),hardBreakEscape:a(le),hardBreakTrailing:a(le),htmlFlow:a(ze,s),htmlFlowData:T,htmlText:a(ze,s),htmlTextData:T,image:a(Be),label:s,link:a(et),listItem:a(Pt),listItemValue:h,listOrdered:a(pt,f),listUnordered:a(pt),paragraph:a(Vt),reference:D,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(ue),strong:a(ut),thematicBreak:a(je)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:J,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ee,characterReference:Z,codeFenced:c(x),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:E,codeIndented:c(v),codeText:c(B),codeTextData:E,data:E,definition:c(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(C),hardBreakTrailing:c(C),htmlFlow:c(A),htmlFlowData:E,htmlText:c(M),htmlTextData:E,image:c(Q),label:H,labelText:I,lineEnding:_,link:c(ae),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:G,resourceDestinationString:O,resourceTitleString:oe,resource:re,setextHeading:c(P),setextHeadingLineSequence:N,setextHeadingText:j,strong:c(),thematicBreak:c()}};z_(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(W){let se={type:"root",children:[]};const Te={stack:[se],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:d,data:n},pe=[];let L=-1;for(;++L<W.length;)if(W[L][1].type==="listOrdered"||W[L][1].type==="listUnordered")if(W[L][0]==="enter")pe.push(L);else{const ye=pe.pop();L=i(W,ye,L)}for(L=-1;++L<W.length;){const ye=t[W[L][0]];F_.call(ye,W[L][1].type)&&ye[W[L][1].type].call(Object.assign({sliceSerialize:W[L][2].sliceSerialize},Te),W[L][1])}if(Te.tokenStack.length>0){const ye=Te.tokenStack[Te.tokenStack.length-1];(ye[1]||yN).call(Te,void 0,ye[0])}for(se.position={start:Da(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Da(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},L=-1;++L<t.transforms.length;)se=t.transforms[L](se)||se;return se}function i(W,se,Te){let pe=se-1,L=-1,ye=!1,_e,Ue,mt,rt;for(;++pe<=Te;){const gt=W[pe];switch(gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{gt[0]==="enter"?L++:L--,rt=void 0;break}case"lineEndingBlank":{gt[0]==="enter"&&(_e&&!rt&&!L&&!mt&&(mt=pe),rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:rt=void 0}if(!L&>[0]==="enter"&>[1].type==="listItemPrefix"||L===-1&>[0]==="exit"&&(gt[1].type==="listUnordered"||gt[1].type==="listOrdered")){if(_e){let Kt=pe;for(Ue=void 0;Kt--;){const Et=W[Kt];if(Et[1].type==="lineEnding"||Et[1].type==="lineEndingBlank"){if(Et[0]==="exit")continue;Ue&&(W[Ue][1].type="lineEndingBlank",ye=!0),Et[1].type="lineEnding",Ue=Kt}else if(!(Et[1].type==="linePrefix"||Et[1].type==="blockQuotePrefix"||Et[1].type==="blockQuotePrefixWhitespace"||Et[1].type==="blockQuoteMarker"||Et[1].type==="listItemIndent"))break}mt&&(!Ue||mt<Ue)&&(_e._spread=!0),_e.end=Object.assign({},Ue?W[Ue][1].start:gt[1].end),W.splice(Ue||pe,0,["exit",_e,gt[2]]),pe++,Te++}if(gt[1].type==="listItemPrefix"){const Kt={type:"listItem",_spread:!1,start:Object.assign({},gt[1].start),end:void 0};_e=Kt,W.splice(pe,0,["enter",Kt,gt[2]]),pe++,Te++,mt=void 0,rt=!0}}}return W[se][1]._spread=ye,Te}function a(W,se){return Te;function Te(pe){o.call(this,W(pe),pe),se&&se.call(this,pe)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(W,se,Te){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([se,Te||void 0]),W.position={start:Da(se.start),end:void 0}}function c(W){return se;function se(Te){W&&W.call(this,Te),u.call(this,Te)}}function u(W,se){const Te=this.stack.pop(),pe=this.tokenStack.pop();if(pe)pe[0].type!==W.type&&(se?se.call(this,W,pe[0]):(pe[1]||yN).call(this,W,pe[0]));else throw new Error("Cannot close `"+W.type+"` ("+fu({start:W.start,end:W.end})+"): it’s not open");Te.position.end=Da(W.end)}function d(){return Ew(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(W){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function p(){const W=this.resume(),se=this.stack[this.stack.length-1];se.lang=W}function g(){const W=this.resume(),se=this.stack[this.stack.length-1];se.meta=W}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W.replace(/(\r?\n|\r)$/g,"")}function b(W){const se=this.resume(),Te=this.stack[this.stack.length-1];Te.label=se,Te.identifier=oi(this.sliceSerialize(W)).toLowerCase()}function w(){const W=this.resume(),se=this.stack[this.stack.length-1];se.title=W}function S(){const W=this.resume(),se=this.stack[this.stack.length-1];se.url=W}function k(W){const se=this.stack[this.stack.length-1];if(!se.depth){const Te=this.sliceSerialize(W).length;se.depth=Te}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function N(W){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function T(W){const Te=this.stack[this.stack.length-1].children;let pe=Te[Te.length-1];(!pe||pe.type!=="text")&&(pe=tt(),pe.position={start:Da(W.start),end:void 0},Te.push(pe)),this.stack.push(pe)}function E(W){const se=this.stack.pop();se.value+=this.sliceSerialize(W),se.position.end=Da(W.end)}function _(W){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=se.children[se.children.length-1];Te.position.end=Da(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(se.type)&&(T.call(this,W),E.call(this,W))}function C(){this.data.atHardBreak=!0}function A(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W}function M(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W}function B(){const W=this.resume(),se=this.stack[this.stack.length-1];se.value=W}function ae(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=se,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function Q(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=se,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function I(W){const se=this.sliceSerialize(W),Te=this.stack[this.stack.length-2];Te.label=vV(se),Te.identifier=oi(se).toLowerCase()}function H(){const W=this.stack[this.stack.length-1],se=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const pe=W.children;Te.children=pe}else Te.alt=se}function O(){const W=this.resume(),se=this.stack[this.stack.length-1];se.url=W}function oe(){const W=this.resume(),se=this.stack[this.stack.length-1];se.title=W}function re(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function G(W){const se=this.resume(),Te=this.stack[this.stack.length-1];Te.label=se,Te.identifier=oi(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function te(W){this.data.characterReferenceType=W.type}function ee(W){const se=this.sliceSerialize(W),Te=this.data.characterReferenceType;let pe;Te?(pe=E_(se,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):pe=Aw(se);const L=this.stack[this.stack.length-1];L.value+=pe}function Z(W){const se=this.stack.pop();se.position.end=Da(W.end)}function ce(W){E.call(this,W);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(W)}function J(W){E.call(this,W);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(W)}function ne(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function R(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function F(){return{type:"emphasis",children:[]}}function ue(){return{type:"heading",depth:0,children:[]}}function le(){return{type:"break"}}function ze(){return{type:"html",value:""}}function Be(){return{type:"image",title:null,url:"",alt:null}}function et(){return{type:"link",title:null,url:"",children:[]}}function pt(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Pt(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Vt(){return{type:"paragraph",children:[]}}function ut(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function je(){return{type:"thematicBreak"}}}function Da(e){return{line:e.line,column:e.column,offset:e.offset}}function z_(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?z_(e,r):kV(e,r)}}function kV(e,t){let n;for(n in t)if(F_.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 yN(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fu({start:t.start,end:t.end})+") is still open")}function jV(e){const t=this;t.parser=n;function n(r){return wV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function NV(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 CV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
562
|
+
`}]}function PV(e,t){const n=t.value?t.value+`
|
|
563
|
+
`:"",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 EV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=tc(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function OV(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 _V(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $_(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 s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function DV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $_(e,t);const i={src:tc(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 MV(e,t){const n={src:tc(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 IV(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 LV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $_(e,t);const i={href:tc(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 RV(e,t){const n={href:tc(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 FV(e,t,n){const r=e.all(t),i=n?zV(n):B_(t),a={},s=[];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 o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
|
|
564
|
+
`}),d.type==="element"&&d.tagName==="p"&&!i?s.push(...d.children):s.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
|
|
565
|
+
`});const u={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,u),e.applyData(t,u)}function zV(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=B_(n[r])}return t}function B_(e){const t=e.spread;return t??e.children.length>1}function $V(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.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 BV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UV(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function VV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WV(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=jw(t.children[1]),c=b_(t.children[t.children.length-1]);o&&c&&(s.position={start:o,end:c}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function HV(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:t.children.length;let c=-1;const u=[];for(;++c<o;){const f=t.children[c],h={},p=s?s[c]:void 0;p&&(h.align=p);let g={type:"element",tagName:a,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function KV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const xN=9,vN=32;function qV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(bN(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(bN(t.slice(i),i>0,!1)),a.join("")}function bN(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===xN||a===vN;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===xN||a===vN;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function GV(e,t){const n={type:"text",value:qV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function YV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const XV={blockquote:NV,break:CV,code:PV,delete:EV,emphasis:AV,footnoteReference:TV,heading:OV,html:_V,imageReference:DV,image:MV,inlineCode:IV,linkReference:LV,link:RV,listItem:FV,list:$V,paragraph:BV,root:UV,strong:VV,table:WV,tableCell:KV,tableRow:HV,text:GV,thematicBreak:YV,toml:wf,yaml:wf,definition:wf,footnoteDefinition:wf};function wf(){}const U_=-1,Mm=0,pu=1,np=2,Ow=3,_w=4,Dw=5,Mw=6,V_=7,W_=8,wN=typeof self=="object"?self:globalThis,ZV=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case Mm:case U_:return n(s,i);case pu:{const o=n([],i);for(const c of s)o.push(r(c));return o}case np:{const o=n({},i);for(const[c,u]of s)o[r(c)]=r(u);return o}case Ow:return n(new Date(s),i);case _w:{const{source:o,flags:c}=s;return n(new RegExp(o,c),i)}case Dw:{const o=n(new Map,i);for(const[c,u]of s)o.set(r(c),r(u));return o}case Mw:{const o=n(new Set,i);for(const c of s)o.add(r(c));return o}case V_:{const{name:o,message:c}=s;return n(new wN[o](c),i)}case W_:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return n(new DataView(o),s)}}return n(new wN[a](s),i)};return r},SN=e=>ZV(new Map,e)(0),Ro="",{toString:QV}={},{keys:JV}=Object,Tc=e=>{const t=typeof e;if(t!=="object"||!e)return[Mm,t];const n=QV.call(e).slice(8,-1);switch(n){case"Array":return[pu,Ro];case"Object":return[np,Ro];case"Date":return[Ow,Ro];case"RegExp":return[_w,Ro];case"Map":return[Dw,Ro];case"Set":return[Mw,Ro];case"DataView":return[pu,n]}return n.includes("Array")?[pu,n]:n.includes("Error")?[V_,n]:[np,n]},Sf=([e,t])=>e===Mm&&(t==="function"||t==="symbol"),eW=(e,t,n,r)=>{const i=(s,o)=>{const c=r.push(s)-1;return n.set(o,c),c},a=s=>{if(n.has(s))return n.get(s);let[o,c]=Tc(s);switch(o){case Mm:{let d=s;switch(c){case"bigint":o=W_,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([U_],s)}return i([o,d],s)}case pu:{if(c){let h=s;return c==="DataView"?h=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(s)),i([c,[...h]],s)}const d=[],f=i([o,d],s);for(const h of s)d.push(a(h));return f}case np:{if(c)switch(c){case"BigInt":return i([c,s.toString()],s);case"Boolean":case"Number":case"String":return i([c,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const d=[],f=i([o,d],s);for(const h of JV(s))(e||!Sf(Tc(s[h])))&&d.push([a(h),a(s[h])]);return f}case Ow:return i([o,s.toISOString()],s);case _w:{const{source:d,flags:f}=s;return i([o,{source:d,flags:f}],s)}case Dw:{const d=[],f=i([o,d],s);for(const[h,p]of s)(e||!(Sf(Tc(h))||Sf(Tc(p))))&&d.push([a(h),a(p)]);return f}case Mw:{const d=[],f=i([o,d],s);for(const h of s)(e||!Sf(Tc(h)))&&d.push(a(h));return f}}const{message:u}=s;return i([o,{name:c,message:u}],s)};return a},kN=(e,{json:t,lossy:n}={})=>{const r=[];return eW(!(t||n),!!t,new Map,r)(e),r},rp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?SN(kN(e,t)):structuredClone(e):(e,t)=>SN(kN(e,t));function tW(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 nW(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rW(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tW,r=e.options.footnoteBackLabel||nW,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=tc(f.toLowerCase());let p=0;const g=[],y=e.footnoteCounts.get(f);for(;y!==void 0&&++p<=y;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const b=x.children[x.children.length-1];b&&b.type==="text"?b.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else d.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,v),o.push(v)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...rp(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
566
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
567
|
+
`}]}}const Im=function(e){if(e==null)return oW;if(typeof e=="function")return Lm(e);if(typeof e=="object")return Array.isArray(e)?iW(e):aW(e);if(typeof e=="string")return sW(e);throw new Error("Expected function, string, or object as test")};function iW(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Im(e[n]);return Lm(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function aW(e){const t=e;return Lm(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function sW(e){return Lm(t);function t(n){return n&&n.type===e}}function Lm(e){return t;function t(n,r,i){return!!(lW(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function oW(){return!0}function lW(e){return e!==null&&typeof e=="object"&&"type"in e}const H_=[],cW=!0,Rx=!1,uW="skip";function K_(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Im(i),s=r?-1:1;o(e,void 0,[])();function o(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=H_,g,y,x;if((!t||a(c,u,d[d.length-1]||void 0))&&(p=dW(n(c,d)),p[0]===Rx))return p;if("children"in c&&c.children){const v=c;if(v.children&&p[0]!==uW)for(y=(r?v.children.length:-1)+s,x=d.concat(v);y>-1&&y<v.children.length;){const b=v.children[y];if(g=o(b,y,x)(),g[0]===Rx)return g;y=typeof g[1]=="number"?g[1]:y+s}}return p}}}function dW(e){return Array.isArray(e)?e:typeof e=="number"?[cW,e]:e==null?H_:[e]}function Iw(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),K_(e,a,o,i);function o(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return s(c,f,d)}}const Fx={}.hasOwnProperty,fW={};function hW(e,t){const n=t||fW,r=new Map,i=new Map,a=new Map,s={...XV,...n.handlers},o={all:u,applyData:mW,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:c,options:n,patch:pW,wrap:yW};return Iw(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),o;function c(d,f){const h=d.type,p=o.handlers[h];if(Fx.call(o.handlers,h)&&p)return p(o,d,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:y,...x}=d,v=rp(x);return v.children=o.all(d),v}return rp(d)}return(o.options.unknownHandler||gW)(o,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const g=o.one(h[p],d);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=jN(g.value)),!Array.isArray(g)&&g.type==="element")){const y=g.children[0];y&&y.type==="text"&&(y.value=jN(y.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function pW(e,t){e.position&&(t.position=n9(e))}function mW(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 s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,rp(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function gW(e,t){const n=t.data||{},r="value"in t&&!(Fx.call(n,"hProperties")||Fx.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 yW(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
568
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
569
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
570
|
+
`}),n}function jN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function NN(e,t){const n=hW(e,t),r=n.one(e,void 0),i=rW(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
571
|
+
`},i),a}function xW(e,t){return e&&"run"in e?async function(n,r){const i=NN(n,{file:r,...t});await e.run(i,r)}:function(n,r){return NN(n,{file:r,...e||t})}}function CN(e){if(e)throw e}var ph=Object.prototype.hasOwnProperty,q_=Object.prototype.toString,PN=Object.defineProperty,EN=Object.getOwnPropertyDescriptor,AN=function(t){return typeof Array.isArray=="function"?Array.isArray(t):q_.call(t)==="[object Array]"},TN=function(t){if(!t||q_.call(t)!=="[object Object]")return!1;var n=ph.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ph.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||ph.call(t,i)},ON=function(t,n){PN&&n.name==="__proto__"?PN(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},_N=function(t,n){if(n==="__proto__")if(ph.call(t,n)){if(EN)return EN(t,n).value}else return;return t[n]},vW=function e(){var t,n,r,i,a,s,o=arguments[0],c=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},c=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=_N(o,n),i=_N(t,n),o!==i&&(d&&i&&(TN(i)||(a=AN(i)))?(a?(a=!1,s=r&&AN(r)?r:[]):s=r&&TN(r)?r:{},ON(o,{name:n,newValue:e(d,s,i)})):typeof i<"u"&&ON(o,{name:n,newValue:i}));return o};const j0=fi(vW);function zx(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 bW(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(c,...u){const d=e[++a];let f=-1;if(c){s(c);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,d?wW(d,o)(...u):s(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 wW(e,t){let n;return r;function r(...s){const o=e.length>s.length;let c;o&&s.push(i);try{c=e.apply(this,s)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(s,...o){n||(n=!0,t(s,...o))}function a(s){i(null,s)}}const wi={basename:SW,dirname:kW,extname:jW,join:NW,sep:"/"};function SW(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Pd(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 s=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function kW(e){if(Pd(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 jW(e){Pd(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===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 NW(...e){let t=-1,n;for(;++t<e.length;)Pd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":CW(n)}function CW(e){Pd(e);const t=e.codePointAt(0)===47;let n=PW(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function PW(e,t){let n="",r=0,i=-1,a=0,s=-1,o,c;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-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=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function Pd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const EW={cwd:AW};function AW(){return"/"}function $x(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function TW(e){if(typeof e=="string")e=new URL(e);else if(!$x(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 OW(e)}function OW(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 N0=["history","path","basename","stem","extname","dirname"];class G_{constructor(t){let n;t?$x(t)?n={path:t}:typeof t=="string"||_W(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":EW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<N0.length;){const a=N0[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)N0.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?wi.basename(this.path):void 0}set basename(t){P0(t,"basename"),C0(t,"basename"),this.path=wi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wi.dirname(this.path):void 0}set dirname(t){DN(this.basename,"dirname"),this.path=wi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wi.extname(this.path):void 0}set extname(t){if(C0(t,"extname"),DN(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=wi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){$x(t)&&(t=TW(t)),P0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wi.basename(this.path,this.extname):void 0}set stem(t){P0(t,"stem"),C0(t,"stem"),this.path=wi.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 zn(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 C0(e,t){if(e&&e.includes(wi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wi.sep+"`")}function P0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function DN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _W(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DW=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},MW={}.hasOwnProperty;class Lw extends DW{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=bW()}copy(){const t=new Lw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(j0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(T0("data",this.frozen),this.namespace[t]=n,this):MW.call(this.namespace,t)&&this.namespace[t]||void 0:t?(T0("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=kf(t),r=this.parser||this.Parser;return E0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),E0("process",this.parser||this.Parser),A0("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const o=kf(t),c=r.parse(o);r.run(c,o,function(d,f,h){if(d||!f||!h)return u(d);const p=f,g=r.stringify(p,h);RW(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?s(d):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),E0("processSync",this.parser||this.Parser),A0("processSync",this.compiler||this.Compiler),this.process(t,i),IN("processSync","process",n),r;function i(a,s){n=!0,CN(a),r=s}}run(t,n,r){MN(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(s,o){const c=kf(n);i.run(t,c,u);function u(d,f,h){const p=f||t;d?o(d):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),IN("runSync","run",r),i;function a(s,o){CN(s),i=o,r=!0}}stringify(t,n){this.freeze();const r=kf(n),i=this.compiler||this.Compiler;return A0("stringify",i),MN(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(T0("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(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 s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(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");o(u.plugins),u.settings&&(i.settings=j0(!0,i.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];a(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[p,...g]=d;const y=r[h][1];zx(y)&&zx(p)&&(p=j0(!0,y,p)),r[h]=[u,p,...g]}}}}const IW=new Lw().freeze();function E0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function A0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function T0(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 MN(e){if(!zx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function IN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function kf(e){return LW(e)?e:new G_(e)}function LW(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function RW(e){return typeof e=="string"||FW(e)}function FW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zW="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",LN=[],RN={allowDangerousHtml:!0},$W=/^(https?|ircs?|mailto|xmpp)$/i,BW=[{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 UW(e){const t=VW(e),n=WW(e);return HW(t.runSync(t.parse(n),n),e)}function VW(e){const t=e.rehypePlugins||LN,n=e.remarkPlugins||LN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...RN}:RN;return IW().use(jV).use(n).use(xW,r).use(t)}function WW(e){const t=e.children||"",n=new G_;return typeof t=="string"&&(n.value=t),n}function HW(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||KW;for(const d of BW)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+zW+d.id,void 0);return Iw(e,u),o9(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return s?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in w0)if(Object.hasOwn(w0,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],y=w0[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=c(String(g||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function KW(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||$W.test(e.slice(0,t))?e:""}function FN(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 qW(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function GW(e,t,n){const i=Im((n||{}).ignore||[]),a=YW(t);let s=-1;for(;++s<a.length;)K_(e,"text",o);function o(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return c(u,d)}function c(u,d){const f=d[d.length-1],h=a[s][0],p=a[s][1];let g=0;const x=f.children.indexOf(u);let v=!1,b=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const S=w.index,k={index:w.index,input:w.input,stack:[...d,u]};let j=p(...w,k);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?h.lastIndex=S+1:(g!==S&&b.push({type:"text",value:u.value.slice(g,S)}),Array.isArray(j)?b.push(...j):j&&b.push(j),g=S+w[0].length,v=!0),!h.global)break;w=h.exec(u.value)}return v?(g<u.value.length&&b.push({type:"text",value:u.value.slice(g)}),f.children.splice(x,1,...b)):b=[u],x+b.length}}function YW(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([XW(i[0]),ZW(i[1])])}return t}function XW(e){return typeof e=="string"?new RegExp(qW(e),"g"):e}function ZW(e){return typeof e=="function"?e:function(){return e}}const O0="phrasing",_0=["autolink","link","image","label"];function QW(){return{transforms:[aH],enter:{literalAutolink:eH,literalAutolinkEmail:D0,literalAutolinkHttp:D0,literalAutolinkWww:D0},exit:{literalAutolink:iH,literalAutolinkEmail:rH,literalAutolinkHttp:tH,literalAutolinkWww:nH}}}function JW(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:O0,notInConstruct:_0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:O0,notInConstruct:_0},{character:":",before:"[ps]",after:"\\/",inConstruct:O0,notInConstruct:_0}]}}function eH(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function D0(e){this.config.enter.autolinkProtocol.call(this,e)}function tH(e){this.config.exit.autolinkProtocol.call(this,e)}function nH(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 rH(e){this.config.exit.autolinkEmail.call(this,e)}function iH(e){this.exit(e)}function aH(e){GW(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,sH],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),oH]],{ignore:["link","linkReference"]})}function sH(e,t,n,r,i){let a="";if(!Y_(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!lH(n)))return!1;const s=cH(n+r);if(!s[0])return!1;const o={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function oH(e,t,n,r){return!Y_(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function lH(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 cH(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=FN(e,"(");let a=FN(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 Y_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||go(n)||_m(n))&&(!t||n!==47)}X_.peek=xH;function uH(){this.buffer()}function dH(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fH(){this.buffer()}function hH(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function pH(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=oi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mH(e){this.exit(e)}function gH(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=oi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yH(e){this.exit(e)}function xH(){return"["}function X_(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),o(),s(),a+=i.move("]"),a}function vH(){return{enter:{gfmFootnoteCallString:uH,gfmFootnoteCall:dH,gfmFootnoteDefinitionLabelString:fH,gfmFootnoteDefinition:hH},exit:{gfmFootnoteCallString:pH,gfmFootnoteCall:mH,gfmFootnoteDefinitionLabelString:gH,gfmFootnoteDefinition:yH}}}function bH(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:X_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const o=a.createTracker(s);let c=o.move("[^");const u=a.enter("footnoteDefinition"),d=a.enter("label");return c+=o.move(a.safe(a.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?`
|
|
572
|
+
`:" ")+a.indentLines(a.containerFlow(r,o.current()),t?Z_:wH))),u(),c}}function wH(e,t,n){return t===0?e:Z_(e,t,n)}function Z_(e,t,n){return(n?"":" ")+e}const SH=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Q_.peek=PH;function kH(){return{canContainEols:["delete"],enter:{strikethrough:NH},exit:{strikethrough:CH}}}function jH(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:SH}],handlers:{delete:Q_}}}function NH(e){this.enter({type:"delete",children:[]},e)}function CH(e){this.exit(e)}function Q_(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function PH(){return"~"}function EH(e){return e.length}function AH(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||EH,a=[],s=[],o=[],c=[];let u=0,d=-1;for(;++d<e.length;){const y=[],x=[];let v=-1;for(e[d].length>u&&(u=e[d].length);++v<e[d].length;){const b=TH(e[d][v]);if(n.alignDelimiters!==!1){const w=i(b);x[v]=w,(c[v]===void 0||w>c[v])&&(c[v]=w)}y.push(b)}s[d]=y,o[d]=x}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)a[f]=zN(r[f]);else{const y=zN(r);for(;++f<u;)a[f]=y}f=-1;const h=[],p=[];for(;++f<u;){const y=a[f];let x="",v="";y===99?(x=":",v=":"):y===108?x=":":y===114&&(v=":");let b=n.alignDelimiters===!1?1:Math.max(1,c[f]-x.length-v.length);const w=x+"-".repeat(b)+v;n.alignDelimiters!==!1&&(b=x.length+b+v.length,b>c[f]&&(c[f]=b),p[f]=b),h[f]=w}s.splice(1,0,h),o.splice(1,0,p),d=-1;const g=[];for(;++d<s.length;){const y=s[d],x=o[d];f=-1;const v=[];for(;++f<u;){const b=y[f]||"";let w="",S="";if(n.alignDelimiters!==!1){const k=c[f]-(x[f]||0),j=a[f];j===114?w=" ".repeat(k):j===99?k%2?(w=" ".repeat(k/2+.5),S=" ".repeat(k/2-.5)):(w=" ".repeat(k/2),S=w):S=" ".repeat(k)}n.delimiterStart!==!1&&!f&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||f)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(b),n.alignDelimiters!==!1&&v.push(S),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&v.push("|")}g.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return g.join(`
|
|
573
|
+
`)}function TH(e){return e==null?"":String(e)}function zN(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 OH(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(e,a.current()),_H);return i(),s}function _H(e,t,n){return">"+(n?"":" ")+e}function DH(e,t){return $N(e,t.inConstruct,!0)&&!$N(e,t.notInConstruct,!1)}function $N(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 BN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
574
|
+
`&&DH(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
575
|
+
`}function MH(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>s&&(s=a):a=1,i=r+t.length,r=n.indexOf(t,i);return s}function IH(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 LH(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 RH(e,t,n,r){const i=LH(n),a=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(IH(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,FH);return f(),h}const o=n.createTracker(r),c=i.repeat(Math.max(MH(a,i)+1,3)),u=n.enter("codeFenced");let d=o.move(c);if(e.lang){const f=n.enter(`codeFencedLang${s}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${s}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
|
|
576
|
+
`,encode:["`"],...o.current()})),f()}return d+=o.move(`
|
|
577
|
+
`),a&&(d+=o.move(a+`
|
|
578
|
+
`)),d+=o.move(c),u(),d}function FH(e,t,n){return(n?"":" ")+e}function Rw(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 zH(e,t,n,r){const i=Rw(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=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("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
579
|
+
`,...c.current()}))),o(),e.title&&(o=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),o()),s(),u}function $H(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 qu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ip(e,t,n){const r=Ll(e),i=Ll(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}}J_.peek=BH;function J_(e,t,n,r){const i=$H(n),a=n.enter("emphasis"),s=n.createTracker(r),o=s.move(i);let c=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const u=c.charCodeAt(0),d=ip(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=qu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=ip(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+qu(f));const p=s.move(i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function BH(e,t,n){return n.options.emphasis||"*"}function UH(e,t){let n=!1;return Iw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Rx}),!!((!e.depth||e.depth<3)&&Ew(e)&&(t.options.setext||n))}function VH(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(UH(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...a.current(),before:`
|
|
580
|
+
`,after:`
|
|
581
|
+
`});return f(),d(),h+`
|
|
582
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
583
|
+
`))+1))}const s="#".repeat(i),o=n.enter("headingAtx"),c=n.enter("phrasing");a.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
584
|
+
`,...a.current()});return/^[\t ]/.test(u)&&(u=qu(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),c(),o(),u}e4.peek=WH;function e4(e){return e.value||""}function WH(){return"<"}t4.peek=HH;function t4(e,t,n,r){const i=Rw(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=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("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=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),o()),u+=c.move(")"),s(),u}function HH(){return"!"}n4.peek=KH;function n4(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const u=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return s(),n.stack=d,a(),i==="full"||!u||u!==f?c+=o.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function KH(){return"!"}r4.peek=qH;function r4(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 s=n.unsafe[a],o=n.compilePattern(s);let c;if(s.atBreak)for(;c=o.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 qH(){return"`"}function i4(e,t){const n=Ew(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))}a4.peek=GH;function a4(e,t,n,r){const i=Rw(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,c;if(i4(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),o(),n.stack=d,f}o=n.enter("link"),c=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(c=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),c(),e.title&&(c=n.enter(`title${a}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),c()),u+=s.move(")"),o(),u}function GH(e,t,n){return i4(e,n)?"<":"["}s4.peek=YH;function s4(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return s(),n.stack=d,a(),i==="full"||!u||u!==f?c+=o.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function YH(){return"["}function Fw(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 XH(e){const t=Fw(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 ZH(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 o4(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 QH(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=e.ordered?ZH(n):Fw(n);const o=e.ordered?s==="."?")":".":XH(n);let c=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&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),o4(n)===s&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(s=o),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),u}function JH(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 eK(e,t,n,r){const i=JH(n);let a=n.bulletCurrent||Fw(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 s=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return c(),u;function d(f,h,p){return h?(p?"":" ".repeat(s))+f:(p?a:a+" ".repeat(s-a.length))+f}}function tK(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(e,r);return a(),i(),s}const nK=Im(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rK(e,t,n,r){return(e.children.some(function(s){return nK(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function iK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}l4.peek=aK;function l4(e,t,n,r){const i=iK(n),a=n.enter("strong"),s=n.createTracker(r),o=s.move(i+i);let c=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const u=c.charCodeAt(0),d=ip(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=qu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=ip(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+qu(f));const p=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function aK(e,t,n){return n.options.strong||"*"}function sK(e,t,n,r){return n.safe(e.value,r)}function oK(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 lK(e,t,n){const r=(o4(n)+(n.options.ruleSpaces?" ":"")).repeat(oK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const c4={blockquote:OH,break:BN,code:RH,definition:zH,emphasis:J_,hardBreak:BN,heading:VH,html:e4,image:t4,imageReference:n4,inlineCode:r4,link:a4,linkReference:s4,list:QH,listItem:eK,paragraph:tK,root:rK,strong:l4,text:sK,thematicBreak:lK};function cK(){return{enter:{table:uK,tableData:UN,tableHeader:UN,tableRow:fK},exit:{codeText:hK,table:dK,tableData:M0,tableHeader:M0,tableRow:M0}}}function uK(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 dK(e){this.exit(e),this.data.inTable=void 0}function fK(e){this.enter({type:"tableRow",children:[]},e)}function M0(e){this.exit(e)}function UN(e){this.enter({type:"tableCell",children:[]},e)}function hK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pK(e,t){return t==="|"?t:e}function mK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
585
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:c,tableRow:o}};function s(p,g,y,x){return u(d(p,y,x),p.align)}function o(p,g,y,x){const v=f(p,y,x),b=u([v]);return b.slice(0,b.indexOf(`
|
|
586
|
+
`))}function c(p,g,y,x){const v=y.enter("tableCell"),b=y.enter("phrasing"),w=y.containerPhrasing(p,{...x,before:a,after:a});return b(),v(),w}function u(p,g){return AH(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,y){const x=p.children;let v=-1;const b=[],w=g.enter("table");for(;++v<x.length;)b[v]=f(x[v],g,y);return w(),b}function f(p,g,y){const x=p.children;let v=-1;const b=[],w=g.enter("tableRow");for(;++v<x.length;)b[v]=c(x[v],p,g,y);return w(),b}function h(p,g,y){let x=c4.inlineCode(p,g,y);return y.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function gK(){return{exit:{taskListCheckValueChecked:VN,taskListCheckValueUnchecked:VN,paragraph:xK}}}function yK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:vK}}}function VN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function xK(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,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===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 vK(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let c=c4.listItem(e,t,n,{...r,...o.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+s}}function bK(){return[QW(),vH(),kH(),cK(),gK()]}function wK(e){return{extensions:[JW(),bH(e),jH(),mK(e),yK()]}}const SK={tokenize:EK,partial:!0},u4={tokenize:AK,partial:!0},d4={tokenize:TK,partial:!0},f4={tokenize:OK,partial:!0},kK={tokenize:_K,partial:!0},h4={name:"wwwAutolink",tokenize:CK,previous:m4},p4={name:"protocolAutolink",tokenize:PK,previous:g4},ba={name:"emailAutolink",tokenize:NK,previous:y4},$i={};function jK(){return{text:$i}}let Ps=48;for(;Ps<123;)$i[Ps]=ba,Ps++,Ps===58?Ps=65:Ps===91&&(Ps=97);$i[43]=ba;$i[45]=ba;$i[46]=ba;$i[95]=ba;$i[72]=[ba,p4];$i[104]=[ba,p4];$i[87]=[ba,h4];$i[119]=[ba,h4];function NK(e,t,n){const r=this;let i,a;return s;function s(f){return!Bx(f)||!y4.call(r,r.previous)||zw(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Bx(f)?(e.consume(f),o):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(kK,d,u)(f):f===45||f===95||Dn(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&&Un(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function CK(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!m4.call(r,r.previous)||zw(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(SK,e.attempt(u4,e.attempt(d4,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function PK(e,t,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&g4.call(r,r.previous)&&!zw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(Un(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),a?u:(a=!0,c)):n(f)}function u(f){return f===null||tp(f)||ht(f)||go(f)||_m(f)?n(f):e.attempt(u4,e.attempt(d4,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function EK(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function AK(e,t,n){let r,i,a;return s;function s(u){return u===46||u===95?e.check(f4,c,o)(u):u===null||ht(u)||go(u)||u!==45&&_m(u)?c(u):(a=!0,e.consume(u),s)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function c(u){return i||r||!a?n(u):t(u)}}function TK(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(f4,t,a)(s):s===null||ht(s)||go(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function OK(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||ht(o)||go(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||ht(o)||go(o)?t(o):r(o)}function a(o){return Un(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):Un(o)?(e.consume(o),s):n(o)}}function _K(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Dn(a)?n(a):t(a)}}function m4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ht(e)}function g4(e){return!Un(e)}function y4(e){return!(e===47||Bx(e))}function Bx(e){return e===43||e===45||e===46||e===95||Dn(e)}function zw(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 DK={tokenize:BK,partial:!0};function MK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:FK,continuation:{tokenize:zK},exit:$K}},text:{91:{name:"gfmFootnoteCall",tokenize:RK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:IK,resolveTo:LK}}}}function IK(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){s=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!s||!s._balanced)return n(c);const u=oi(r.sliceSerialize({start:s.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 LK(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)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[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",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function RK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(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&&!s||f===null||f===91||ht(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(oi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ht(f)||(s=!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 FK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;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(s>999||g===93&&!o||g===null||g===91||ht(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return a=oi(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ht(g)||(o=!0),s++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),s++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(a)||i.push(a),Je(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function zK(e,t,n){return e.check(Cd,t,e.attempt(DK,t,n))}function $K(e){e.exit("gfmFootnoteDefinition")}function BK(e,t,n){const r=this;return Je(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function UK(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(s,o){let c=-1;for(;++c<s.length;)if(s[c][0]==="enter"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._close){let u=c;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[c][1].end.offset-s[c][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[c][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[c][1].end)},f={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[c][1].start)},h=[["enter",d,o],["enter",s[u][1],o],["exit",s[u][1],o],["enter",f,o]],p=o.parser.constructs.insideSpan.null;p&&gr(h,h.length,0,Dm(p,s.slice(u+1,c),o)),gr(h,h.length,0,[["exit",f,o],["enter",s[c][1],o],["exit",s[c][1],o],["exit",d,o]]),gr(s,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<s.length;)s[c][1].type==="strikethroughSequenceTemporary"&&(s[c][1].type="data");return s}function a(s,o,c){const u=this.previous,d=this.events;let f=0;return h;function h(g){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const y=Ll(u);if(g===126)return f>1?c(g):(s.consume(g),f++,p);if(f<2&&!n)return c(g);const x=s.exit("strikethroughSequenceTemporary"),v=Ll(g);return x._open=!v||v===2&&!!y,x._close=!y||y===2&&!!v,o(g)}}}class VK{constructor(){this.map=[]}add(t,n,r){WK(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[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 WK(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 HK(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 KK(){return{flow:{null:{name:"table",tokenize:qK,resolveAll:GK}}}}function qK(e,t,n){const r=this;let i=0,a=0,s;return o;function o(E){let _=r.events.length-1;for(;_>-1;){const M=r.events[_][1].type;if(M==="lineEnding"||M==="linePrefix")_--;else break}const C=_>-1?r.events[_][1].type:null,A=C==="tableHead"||C==="tableRow"?j:c;return A===j&&r.parser.lazy[r.now().line]?n(E):A(E)}function c(E){return e.enter("tableHead"),e.enter("tableRow"),u(E)}function u(E){return E===124||(s=!0,a+=1),d(E)}function d(E){return E===null?n(E):Le(E)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):n(E):qe(E)?Je(e,d,"whitespace")(E):(a+=1,s&&(s=!1,i+=1),E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),f(E)))}function f(E){return E===null||E===124||ht(E)?(e.exit("data"),d(E)):(e.consume(E),E===92?h:f)}function h(E){return E===92||E===124?(e.consume(E),f):f(E)}function p(E){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(E):(e.enter("tableDelimiterRow"),s=!1,qe(E)?Je(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):g(E))}function g(E){return E===45||E===58?x(E):E===124?(s=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),y):k(E)}function y(E){return qe(E)?Je(e,x,"whitespace")(E):x(E)}function x(E){return E===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),v):E===45?(a+=1,v(E)):E===null||Le(E)?S(E):k(E)}function v(E){return E===45?(e.enter("tableDelimiterFiller"),b(E)):k(E)}function b(E){return E===45?(e.consume(E),b):E===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(E))}function w(E){return qe(E)?Je(e,S,"whitespace")(E):S(E)}function S(E){return E===124?g(E):E===null||Le(E)?!s||i!==a?k(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):k(E)}function k(E){return n(E)}function j(E){return e.enter("tableRow"),N(E)}function N(E){return E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),N):E===null||Le(E)?(e.exit("tableRow"),t(E)):qe(E)?Je(e,N,"whitespace")(E):(e.enter("data"),P(E))}function P(E){return E===null||E===124||ht(E)?(e.exit("data"),N(E)):(e.consume(E),E===92?T:P)}function T(E){return E===92||E===124?(e.consume(E),P):P(E)}}function GK(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,c=0,u,d,f;const h=new VK;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,c!==0&&(WN(h,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,t]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=jf(h,t,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=jf(h,t,a,i,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(o=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,a[1]!==0?(s[0]=s[1],f=jf(h,t,a,i,n,f)):s[1]!==0&&(f=jf(h,t,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(c!==0&&WN(h,t,c,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=HK(t.events,n))}return e}function jf(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},Ko(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Ko(t.events,n[1]);if(a={type:s,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=Ko(t.events,n[2]),d=Ko(t.events,n[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,y=n[3]-n[2]-1;e.add(g,y,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},Ko(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function WN(e,t,n,r,i){const a=[],s=Ko(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function Ko(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const YK={name:"tasklistCheck",tokenize:ZK};function XK(){return{text:{91:YK}}}function ZK(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 ht(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),s):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),s):n(c)}function s(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Le(c)?t(c):qe(c)?e.check({tokenize:QK},t,n)(c):n(c)}}function QK(e,t,n){return Je(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function JK(e){return P_([jK(),MK(),UK(e),KK(),XK()])}const eq={};function tq(e){const t=this,n=e||eq,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(JK(n)),a.push(bK()),s.push(wK(n))}function nq(e){return e.split(/(```[\s\S]*?```|`[^`]+`)/g).map((n,r)=>r%2===1?n:n.replace(new RegExp("(?<=\\w)_(?=\\w)","g"),"\\_")).join("")}function Ed({children:e}){return l.jsx(UW,{remarkPlugins:[tq],components:{pre({children:t}){return l.jsx("pre",{className:"bg-slate-900 text-slate-100 rounded-lg p-4 overflow-x-auto my-3 text-sm leading-relaxed",children:t})},code({className:t,children:n,...r}){return t?l.jsx("code",{className:`font-mono text-[13px] ${t??""}`,...r,children:n}):l.jsx("code",{className:"bg-gray-100 text-pink-600 px-1.5 py-0.5 rounded text-[13px] font-mono",...r,children:n})},p({children:t}){return l.jsx("p",{className:"mb-2 last:mb-0",children:t})},ul({children:t}){return l.jsx("ul",{className:"list-disc pl-5 mb-2 space-y-1",children:t})},ol({children:t}){return l.jsx("ol",{className:"list-decimal pl-5 mb-2 space-y-1",children:t})},li({children:t}){return l.jsx("li",{className:"leading-relaxed",children:t})},h1({children:t}){return l.jsx("h1",{className:"text-xl font-bold mb-2 mt-3 first:mt-0",children:t})},h2({children:t}){return l.jsx("h2",{className:"text-lg font-bold mb-2 mt-3 first:mt-0",children:t})},h3({children:t}){return l.jsx("h3",{className:"text-base font-bold mb-1.5 mt-2 first:mt-0",children:t})},a({href:t,children:n}){return l.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:n})},blockquote({children:t}){return l.jsx("blockquote",{className:"border-l-4 border-gray-300 pl-4 my-2 text-gray-600 italic",children:t})},table({children:t}){return l.jsx("div",{className:"overflow-x-auto my-2",children:l.jsx("table",{className:"min-w-full text-sm border border-gray-200 rounded",children:t})})},th({children:t}){return l.jsx("th",{className:"border-b border-gray-200 bg-gray-50 px-3 py-2 text-left font-semibold",children:t})},td({children:t}){return l.jsx("td",{className:"border-b border-gray-100 px-3 py-2",children:t})},hr(){return l.jsx("hr",{className:"my-3 border-gray-200"})},strong({children:t}){return l.jsx("strong",{className:"font-semibold",children:t})}},children:nq(e)})}const rq={cron_success:{icon:br,chipLabel:"Scheduled Task",bgClass:"bg-green-100",textClass:"text-green-600",chipBg:"bg-green-50",chipText:"text-green-700"},cron_failure:{icon:si,chipLabel:"Scheduled Task",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},cron_result:{icon:Vu,chipLabel:"Scheduled Task",bgClass:"bg-blue-100",textClass:"text-blue-600",chipBg:"bg-blue-50",chipText:"text-blue-700"},vote_up:{icon:n_,chipLabel:"Vote",bgClass:"bg-green-100",textClass:"text-green-600",chipBg:"bg-green-50",chipText:"text-green-700"},vote_down:{icon:t_,chipLabel:"Vote",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},skill_reverted:{icon:Ex,chipLabel:"Skill Reverted",bgClass:"bg-orange-100",textClass:"text-orange-600",chipBg:"bg-orange-50",chipText:"text-orange-700"},skill_approved:{icon:pw,chipLabel:"Approved",bgClass:"bg-green-100",textClass:"text-green-600",chipBg:"bg-green-50",chipText:"text-green-700"},skill_rejected:{icon:Am,chipLabel:"Rejected",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},contribution_rejected:{icon:vs,chipLabel:"Rejected",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},skill_review_requested:{icon:Uu,chipLabel:"Publish Review",bgClass:"bg-amber-100",textClass:"text-amber-600",chipBg:"bg-amber-50",chipText:"text-amber-700"},contribution_review_requested:{icon:ta,chipLabel:"Team Review",bgClass:"bg-blue-100",textClass:"text-blue-600",chipBg:"bg-blue-50",chipText:"text-blue-700"}},iq={icon:ow,chipLabel:"Notification",bgClass:"bg-gray-100",textClass:"text-gray-600",chipBg:"bg-gray-50",chipText:"text-gray-700"};function $w(e){return rq[e]??iq}const x4=new Set(["cron_success","cron_failure","cron_result"]);function Bw(e){if(!e)return"";const t=new Date(e),r=new Date().getTime()-t.getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const a=Math.floor(i/60);return a<24?`${a}h ago`:t.toLocaleDateString()}function aq(e){for(const t of e.split(`
|
|
587
|
+
`)){const n=t.replace(/^#{1,6}\s+/,"").replace(/[*_`~]/g,"").trim();if(n)return n.length>80?n.slice(0,77)+"...":n}return e.slice(0,80)}function sq({notif:e,onClose:t}){const n=$w(e.type);return l.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",onClick:t,children:[l.jsx("div",{className:"absolute inset-0 bg-black/40"}),l.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-[42rem] max-w-[90vw] max-h-[80vh] flex flex-col",onClick:r=>r.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3.5 border-b border-gray-100 flex-shrink-0",children:[l.jsx("div",{className:U("w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0",n.bgClass),children:l.jsx(n.icon,{className:U("w-3.5 h-3.5",n.textClass)})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-semibold text-gray-900 truncate",children:e.title}),l.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[l.jsx("span",{className:U("text-[10px] font-medium",n.chipBg,n.chipText,"px-1.5 py-0.5 rounded"),children:n.chipLabel}),l.jsx("span",{className:U("text-[10px] font-medium",e.type==="cron_success"?"text-green-600":e.type==="cron_failure"?"text-red-600":"text-gray-500"),children:e.type==="cron_success"?"Success":e.type==="cron_failure"?"Failed":""}),l.jsx("span",{className:"text-[10px] text-gray-400",children:Bw(e.createdAt)})]})]}),l.jsx("button",{onClick:t,className:"p-1.5 rounded-md hover:bg-gray-100 text-gray-400 hover:text-gray-600 flex-shrink-0",children:l.jsx(Qe,{className:"w-4 h-4"})})]}),l.jsx("div",{className:"px-5 py-4 overflow-y-auto flex-1",children:l.jsx("div",{className:"prose prose-sm prose-gray max-w-none",children:l.jsx(Ed,{children:e.message??""})})})]})]})}const HN=new Set(["skill_approved","skill_rejected","contribution_rejected","skill_reverted"]),I0=new Set(["skill_review_requested","contribution_review_requested"]),oq=300;function KN({notif:e,onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i,nested:a}){var y;const[s,o]=m.useState(!0),c=zi(),u=$w(e.type),d=u.icon,f=(((y=e.message)==null?void 0:y.length)??0)>oq,h=x4.has(e.type),p=(HN.has(e.type)||I0.has(e.type))&&e.relatedId,g=()=>{e.isRead||t(e.id),I0.has(e.type)&&e.relatedId?(r==null||r(),c("/skills?tab=approvals")):HN.has(e.type)&&e.relatedId?(r==null||r(),c(`/skills/${e.relatedId}`)):h&&e.message&&i&&i(e)};return l.jsx(l.Fragment,{children:l.jsx("div",{onClick:g,className:U("group relative px-3 py-2.5 border-b border-gray-50 hover:bg-gray-50/80 transition-colors cursor-pointer",!e.isRead&&"bg-blue-50/40",a&&"pl-10 border-b-0 py-2"),children:l.jsxs("div",{className:"flex items-start gap-2.5",children:[!a&&l.jsxs("div",{className:"relative flex-shrink-0 mt-0.5",children:[l.jsx("div",{className:U("w-7 h-7 rounded-full flex items-center justify-center",u.bgClass),children:l.jsx(d,{className:U("w-3.5 h-3.5",u.textClass)})}),!e.isRead&&l.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-blue-500 border-2 border-white"})]}),a&&h&&l.jsx("div",{className:U("w-2 h-2 rounded-full mt-1.5 flex-shrink-0",e.type==="cron_success"?"bg-green-500":e.type==="cron_failure"?"bg-red-500":"bg-blue-500")}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center justify-between gap-1.5 mb-0.5",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[!a&&l.jsx("span",{className:U("inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium flex-shrink-0",u.chipBg,u.chipText),children:u.chipLabel}),h&&l.jsx("span",{className:U("text-[10px] font-medium",e.type==="cron_success"?"text-green-600":e.type==="cron_failure"?"text-red-600":"text-gray-500"),children:e.type==="cron_success"?"Success":e.type==="cron_failure"?"Failed":""}),l.jsx("span",{className:"text-[10px] text-gray-400",children:Bw(e.createdAt)})]}),l.jsx("button",{onClick:x=>{x.stopPropagation(),n(e.id)},className:"flex-shrink-0 p-1 rounded hover:bg-gray-200 text-gray-300 opacity-0 group-hover:opacity-100 transition-opacity",title:"Delete",children:l.jsx(Qe,{className:"w-3 h-3"})})]}),l.jsx("p",{className:"text-sm text-gray-900 leading-snug break-words",children:e.title}),e.message&&(h?l.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[l.jsx("p",{className:"text-xs text-gray-500 truncate flex-1 min-w-0",children:aq(e.message)}),l.jsxs("button",{onClick:x=>{x.stopPropagation(),e.isRead||t(e.id),i==null||i(e)},className:"flex items-center gap-0.5 text-[10px] text-primary-600 hover:text-primary-700 font-medium flex-shrink-0",children:[l.jsx(Sd,{className:"w-3 h-3"}),"Details"]})]}):l.jsxs("div",{className:"mt-1",children:[l.jsx("p",{className:U("text-xs text-gray-500 leading-relaxed break-words whitespace-pre-wrap",s&&f&&"line-clamp-5"),children:e.message}),f&&l.jsx("button",{onClick:x=>{x.stopPropagation(),o(!s)},className:"text-[10px] text-primary-600 hover:text-primary-700 font-medium mt-0.5",children:s?"Show more":"Show less"})]})),p&&!e.isRead&&l.jsxs("button",{onClick:x=>{x.stopPropagation(),g()},className:"mt-1 text-[11px] text-primary-600 hover:text-primary-700 font-medium hover:underline",children:[I0.has(e.type)?"Go to Approvals":"View Skill Details"," →"]})]})]})})})}function lq({group:e,onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i}){const[a,s]=m.useState(!1);if(e.notifications.length===1)return l.jsx(KN,{notif:e.notifications[0],onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i});const o=$w(e.type),c=o.icon,u=x4.has(e.type),d=u?e.notifications.filter(h=>h.type==="cron_success").length:0,f=u?e.notifications.filter(h=>h.type==="cron_failure").length:0;return l.jsxs("div",{className:"border-b border-gray-50",children:[l.jsxs("button",{onClick:()=>s(!a),className:U("w-full text-left px-3 py-2.5 hover:bg-gray-50/80 transition-colors flex items-start gap-2.5",e.unreadCount>0&&"bg-blue-50/40"),children:[l.jsxs("div",{className:"relative flex-shrink-0 mt-0.5",children:[l.jsx("div",{className:U("w-7 h-7 rounded-full flex items-center justify-center",o.bgClass),children:l.jsx(c,{className:U("w-3.5 h-3.5",o.textClass)})}),e.unreadCount>0&&l.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-blue-500 border-2 border-white"})]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[l.jsx("span",{className:U("inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium flex-shrink-0",o.chipBg,o.chipText),children:o.chipLabel}),l.jsx("span",{className:"text-[10px] text-gray-400",children:Bw(e.latestAt)})]}),l.jsx("p",{className:"text-sm text-gray-900 leading-snug break-words",children:e.title}),l.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[l.jsxs("span",{className:"text-[10px] text-gray-400",children:[e.notifications.length," runs"]}),u&&d>0&&l.jsxs("span",{className:"text-[10px] text-green-600 font-medium",children:[d," passed"]}),u&&f>0&&l.jsxs("span",{className:"text-[10px] text-red-600 font-medium",children:[f," failed"]}),e.unreadCount>0&&l.jsxs("span",{className:"text-[10px] text-blue-500 font-medium",children:[e.unreadCount," unread"]})]})]}),l.jsx(ua,{className:U("w-4 h-4 text-gray-400 flex-shrink-0 mt-1 transition-transform duration-200",a&&"rotate-90")})]}),a&&l.jsx("div",{className:"bg-gray-50/50",children:e.notifications.map(h=>l.jsx(KN,{notif:h,onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i,nested:!0},h.id))})]})}function cq(){const{sendRpc:e,isConnected:t}=Rt({onMessage:v=>u(v)}),{notifications:n,unreadCount:r,loadNotifications:i,markRead:a,markAllRead:s,dismissOne:o,dismissAll:c,handleWsEvent:u}=u8(e),[d,f]=m.useState(!1),[h,p]=m.useState(null),g=m.useRef(null),y=m.useCallback(v=>{f(!1),p(v)},[]),x=m.useMemo(()=>c8(n),[n]);return m.useEffect(()=>{t&&i()},[t,i]),m.useEffect(()=>{if(!d)return;const v=b=>{g.current&&!g.current.contains(b.target)&&f(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]),l.jsxs("div",{className:"relative",ref:g,children:[l.jsxs("button",{onClick:()=>f(!d),className:"relative p-1.5 rounded-md text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-colors",children:[l.jsx(ow,{className:"w-4.5 h-4.5"}),r>0&&l.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white",children:r>99?"99+":r})]}),d&&l.jsxs("div",{className:"absolute top-full left-0 mt-2 w-[28rem] bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden z-[60]",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Notifications"}),l.jsxs("div",{className:"flex items-center gap-2",children:[r>0&&l.jsxs("button",{onClick:s,className:"flex items-center gap-1 text-xs text-primary-600 hover:text-primary-700 font-medium",children:[l.jsx(_n,{className:"w-3 h-3"}),"Mark all read"]}),n.length>0&&l.jsxs("button",{onClick:c,className:"flex items-center gap-1 text-xs text-red-500 hover:text-red-600 font-medium",title:"Clear all notifications",children:[l.jsx(Fn,{className:"w-3 h-3"}),"Clear all"]})]})]}),l.jsx("div",{className:"max-h-[480px] overflow-y-auto",children:x.length===0?l.jsx("div",{className:"py-8 text-center text-sm text-gray-400",children:"No notifications"}):x.map(v=>l.jsx(lq,{group:v,onMarkRead:a,onDelete:o,onClose:()=>f(!1),onShowDetail:y},v.key))})]}),h&&l.jsx(sq,{notif:h,onClose:()=>p(null)})]})}const v4=m.createContext(null),qN="siclaw_workspace_id";function uq({children:e}){const{sendRpc:t,isConnected:n}=Rt(),[r,i]=m.useState([]),[a,s]=m.useState(null),o=m.useRef(!1),c=m.useCallback(async()=>{if(n)try{const f=(await t("workspace.list")).workspaces??[];i(f);const h=localStorage.getItem(qN),p=h?f.find(y=>y.id===h):null,g=f.find(y=>y.isDefault)??f[0]??null;s(p??g)}catch(d){console.error("Failed to load workspaces:",d)}},[n,t]),u=m.useCallback(d=>{s(d),localStorage.setItem(qN,d.id)},[]);return m.useEffect(()=>{n&&!o.current&&(o.current=!0,c())},[n,c]),l.jsx(v4.Provider,{value:{workspaces:r,currentWorkspace:a,setCurrentWorkspace:u,reload:c},children:e})}function Ad(){const e=m.useContext(v4);if(!e)throw new Error("useWorkspace must be used within a WorkspaceProvider");return e}const dq=[{icon:J7,label:"Pilot",to:"/pilot"},{icon:lw,label:"Workspace",to:"/workspace"},{icon:Vu,label:"Cron Jobs",to:"/cron"},{icon:jd,label:"Triggers",to:"/triggers"}],L0=[{icon:gB,label:"Agent",key:"agent",items:[{icon:fw,label:"Skills",to:"/skills"},{icon:Px,label:"MCP",to:"/mcp"}]},{icon:Em,label:"Settings",key:"settings",items:[{icon:mB,label:"Channels",to:"/channels",adminOnly:!0},{icon:mo,label:"Models",to:"/models",adminOnly:!0},{icon:Ql,label:"Credentials",to:"/credentials"},{icon:cs,label:"Knowledge",to:"/knowledge",adminOnly:!0},{icon:mw,label:"Permissions",to:"/permissions",adminOnly:!0},{icon:r_,label:"System",to:"/settings/system",adminOnly:!0}]}];function GN(e,t){const n=`sidebar-${e}-expanded`,[r,i]=m.useState(()=>{if(t)return!0;const s=localStorage.getItem(n);return s===null?!0:s==="true"});return m.useEffect(()=>{t&&!r&&(i(!0),localStorage.setItem(n,"true"))},[t]),{expanded:r,toggle:()=>{const s=!r;i(s),localStorage.setItem(n,String(s))}}}const YN={indigo:"bg-indigo-500",blue:"bg-blue-500",green:"bg-green-500",amber:"bg-amber-500",rose:"bg-rose-500",purple:"bg-purple-500",teal:"bg-teal-500",gray:"bg-gray-400"};function fq(){var x;const e=zi(),t=va(),[n,r]=m.useState(Il()),i=ds(),a=(i==null?void 0:i.username)==="admin",{workspaces:s,currentWorkspace:o,setCurrentWorkspace:c}=Ad(),[u,d]=m.useState(!1),f=m.useRef(null);m.useEffect(()=>{const v=b=>{f.current&&!f.current.contains(b.target)&&d(!1)};return u&&document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[u]);const h=v=>v.items.filter(b=>!b.adminOnly||a).some(b=>t.pathname.startsWith(b.to)),p=GN("agent",h(L0[0])),g=GN("settings",h(L0[1])),y=[p,g];return m.useEffect(()=>{const v=()=>r(Il());return window.addEventListener("user-profile-updated",v),()=>window.removeEventListener("user-profile-updated",v)},[]),l.jsxs("aside",{className:"w-64 h-screen bg-gray-50 border-r border-gray-200 flex flex-col shrink-0",children:[l.jsxs("div",{className:"h-14 flex items-center justify-between px-4 border-b border-gray-200 bg-white",children:[l.jsxs("div",{className:"flex items-center gap-2.5 text-primary-600",children:[l.jsx("div",{className:"p-1 bg-primary-50 rounded-md",children:l.jsx(XO,{className:"w-5 h-5"})}),l.jsx("span",{className:"font-bold text-gray-900 tracking-tight",children:"Siclaw"})]}),l.jsx(cq,{})]}),s.length>0&&l.jsx("div",{className:"px-3 py-2 border-b border-gray-200",ref:f,children:l.jsxs("div",{className:"relative",children:[l.jsxs("button",{onClick:()=>d(!u),className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg bg-white border border-gray-200 hover:border-gray-300 text-sm font-medium text-gray-900 shadow-sm transition-colors",children:[l.jsx("span",{className:U("w-2 h-2 rounded-full shrink-0",YN[((x=o==null?void 0:o.configJson)==null?void 0:x.color)??"indigo"]??"bg-indigo-500")}),l.jsx("span",{className:"flex-1 text-left truncate",children:(o==null?void 0:o.name)??"Default"}),l.jsx(ea,{className:U("w-4 h-4 text-gray-400 transition-transform",u&&"rotate-180")})]}),u&&l.jsxs("div",{className:"absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-50 py-1 max-h-48 overflow-y-auto",children:[s.map(v=>{var b;return l.jsxs("button",{onClick:()=>{c(v),d(!1)},className:U("w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-gray-50 transition-colors",(o==null?void 0:o.id)===v.id&&"bg-indigo-50 text-indigo-700"),children:[l.jsx("span",{className:U("w-2 h-2 rounded-full shrink-0",YN[((b=v.configJson)==null?void 0:b.color)??"indigo"]??"bg-indigo-500")}),l.jsx("span",{className:"truncate",children:v.name}),v.envType==="test"&&l.jsx("span",{className:"text-xs px-1 py-0.5 rounded bg-amber-50 text-amber-600 ml-1",children:"TEST"}),v.isDefault&&l.jsx("span",{className:"text-xs text-gray-400 ml-auto",children:"default"})]},v.id)}),l.jsx("div",{className:"border-t border-gray-100 mt-1 pt-1",children:l.jsx("button",{onClick:()=>{d(!1),e("/workspace")},className:"w-full px-3 py-2 text-sm text-indigo-600 text-left hover:bg-gray-50 transition-colors",children:"Manage Workspaces"})})]})]})}),l.jsxs("div",{className:"flex-1 py-4 px-3 space-y-1 overflow-y-auto",children:[dq.map(v=>l.jsxs(y0,{to:v.to,className:({isActive:b})=>U("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-normal transition-all",b?"bg-primary-50 text-primary-700":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:[l.jsx(v.icon,{className:"w-[18px] h-[18px] stroke-[1.25]"}),v.label]},v.to)),L0.map((v,b)=>{const w=v.items.filter(N=>!N.adminOnly||a);if(w.length===0)return null;const{expanded:S,toggle:k}=y[b],j=h(v);return l.jsxs("div",{className:"pt-2",children:[l.jsxs("button",{onClick:k,className:U("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-normal transition-all w-full text-left",j?"text-gray-900":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:[l.jsx(v.icon,{className:"w-[18px] h-[18px] stroke-[1.25]"}),l.jsx("span",{className:"flex-1",children:v.label}),l.jsx(ua,{className:U("w-3.5 h-3.5 stroke-[1.5] text-gray-400 transition-transform",S&&"rotate-90")})]}),S&&w.map(N=>l.jsxs(y0,{to:N.to,className:({isActive:P})=>U("flex items-center gap-3 pl-9 pr-3 py-2 rounded-lg text-sm font-normal transition-all",P?"bg-primary-50 text-primary-700":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:[l.jsx(N.icon,{className:"w-[18px] h-[18px] stroke-[1.25]"}),N.label]},N.to))]},v.key)})]}),l.jsx("div",{className:"px-3 pb-2",children:l.jsxs(y0,{to:"/monitoring",className:({isActive:v})=>U("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-normal transition-all",v?"bg-primary-50 text-primary-700":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:[l.jsx(sw,{className:"w-[18px] h-[18px] stroke-[1.25]"}),"Dashboard"]})}),l.jsx("div",{className:"p-3 border-t border-gray-200 bg-white",children:l.jsxs("button",{onClick:()=>e("/settings"),className:"flex items-center gap-3 w-full p-2 rounded-md hover:bg-gray-50 transition-colors text-left group",children:[l.jsx("div",{className:U("w-8 h-8 rounded-full flex items-center justify-center text-primary-700 font-semibold text-xs ring-2 ring-white shadow-sm",n.avatarBg),children:n.initials}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-gray-900 group-hover:text-primary-600 transition-colors truncate",children:n.name}),l.jsxs("div",{className:"text-xs text-gray-500 truncate",children:["@",(i==null?void 0:i.username)??"user"]})]}),l.jsx(Em,{className:"w-4 h-4 text-gray-400 group-hover:text-gray-600"})]})})]})}function hq(){const{sendRpc:e,isConnected:t}=Rt(),n=m.useRef(!1);return m.useEffect(()=>{t&&!n.current&&(n.current=!0,a8(e))},[t,e]),l.jsxs("div",{className:"flex h-screen bg-white overflow-hidden",children:[l.jsx(fq,{}),l.jsx("main",{className:"flex-1 flex flex-col relative overflow-hidden bg-white",children:l.jsx(aw,{})})]})}function pq(){return l.jsx(o8,{children:l.jsx(uq,{children:l.jsx(hq,{})})})}const mq=()=>{const{isAuthenticated:e}=Tm();return e?l.jsx(aw,{}):l.jsx(dh,{to:"/login",replace:!0})};function gq(){const e=zi(),[t]=wd(),[n,r]=m.useState(""),[i,a]=m.useState(""),[s,o]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(!1);m.useEffect(()=>{const g=t.get("error");g&&o(decodeURIComponent(g)),fetch("/api/sso/config").then(y=>y.json()).then(y=>f(y.enabled)).catch(()=>{})},[t]);const h=async g=>{g.preventDefault(),o(""),u(!0);try{const y=await JB({username:n,password:i});y.ok?e("/"):o(y.error||"Login failed")}catch{o("Network error")}finally{u(!1)}},p=()=>{window.location.href="/auth/sso"};return l.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col items-center justify-center p-4",children:[l.jsxs("div",{className:"w-full max-w-sm bg-white rounded-2xl shadow-xl border border-gray-100 overflow-hidden",children:[l.jsxs("div",{className:"p-8 pb-6 flex flex-col items-center text-center",children:[l.jsx("div",{className:"w-16 h-16 bg-primary-50 rounded-2xl flex items-center justify-center mb-6 text-primary-600",children:l.jsx(XO,{className:"w-8 h-8"})}),l.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Welcome Back"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Sign in to access your Siclaw workspace"})]}),l.jsxs("form",{onSubmit:h,className:"p-8 pt-0 space-y-4",children:[s&&l.jsxs("div",{className:"flex items-center gap-2 p-3 bg-red-50 border border-red-100 rounded-lg text-red-600 text-sm",children:[l.jsx($u,{className:"w-4 h-4 flex-shrink-0"}),l.jsx("span",{children:s})]}),d&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",onClick:p,className:"w-full flex items-center justify-center gap-3 px-4 py-3 bg-primary-600 text-white rounded-xl hover:bg-primary-700 transition-all font-medium shadow-lg shadow-primary-100",children:[l.jsx(eB,{className:"w-5 h-5"}),l.jsx("span",{children:"Sign in with SSO"})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("span",{className:"w-full border-t border-gray-100"})}),l.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:l.jsx("span",{className:"bg-white px-2 text-gray-400",children:"or sign in with password"})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700",children:"Username"}),l.jsx("input",{id:"username",type:"text",value:n,onChange:g=>r(g.target.value),className:"w-full px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent transition-all",placeholder:"Enter your username",required:!0,autoFocus:!d,disabled:c})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:"Password"}),l.jsx("input",{id:"password",type:"password",value:i,onChange:g=>a(g.target.value),className:"w-full px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent transition-all",placeholder:"Enter your password",required:!0,disabled:c})]}),l.jsxs("button",{type:"submit",disabled:c||!n||!i,className:"w-full flex items-center justify-center gap-3 px-4 py-3 bg-gray-900 text-white rounded-xl hover:bg-gray-800 transition-all font-medium shadow-lg shadow-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[c?l.jsx(Ie,{className:"w-5 h-5 animate-spin"}):l.jsx(aB,{className:"w-5 h-5"}),l.jsx("span",{children:c?"Signing in...":"Sign In"})]}),!d&&l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("span",{className:"w-full border-t border-gray-100"})}),l.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:l.jsx("span",{className:"bg-white px-2 text-gray-400",children:"Restricted Access"})})]})]})]}),l.jsx("div",{className:"mt-8 text-center text-xs text-gray-400",children:"© 2025 Siclaw. All rights reserved."})]})}function yq(){const e=zi(),[t]=wd(),[n,r]=m.useState(null);return m.useEffect(()=>{const i=t.get("token"),a=t.get("userId"),s=t.get("username"),o=t.get("error");if(o){r(o),setTimeout(()=>e("/login?error="+encodeURIComponent(o),{replace:!0}),3e3);return}if(i&&a&&s){const c={isAuthenticated:!0,token:i,user:{id:a,username:s}};localStorage.setItem("siclaw_auth",JSON.stringify(c)),e("/",{replace:!0})}else r("SSO callback missing required parameters"),setTimeout(()=>e("/login?error=sso_callback_failed",{replace:!0}),3e3)},[t,e]),n?l.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col items-center justify-center",children:[l.jsx("p",{className:"text-sm text-red-500 mb-2",children:n}),l.jsx("p",{className:"text-xs text-gray-400",children:"Redirecting to login..."})]}):l.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col items-center justify-center",children:[l.jsx(Ie,{className:"w-8 h-8 animate-spin text-gray-400 mb-4"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Completing sign in..."})]})}function xq({sessions:e,currentSessionKey:t,onSelectSession:n,onNewSession:r,onDeleteSession:i}){const[a,s]=m.useState(""),o=a?e.filter(u=>(u.title||"").toLowerCase().includes(a.toLowerCase())||(u.preview||"").toLowerCase().includes(a.toLowerCase())):e,c=u=>{if(!u)return"";try{const d=new Date(u),h=new Date().getTime()-d.getTime(),p=Math.floor(h/(1e3*60*60*24));return p===0?d.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):p===1?"Yesterday":p<7?d.toLocaleDateString([],{weekday:"short"}):d.toLocaleDateString([],{month:"short",day:"numeric"})}catch{return""}};return l.jsxs("div",{className:"h-full flex flex-col bg-gray-50/50",children:[l.jsxs("div",{className:"p-4 border-b border-gray-200 bg-white",children:[l.jsxs("div",{className:"relative group",children:[l.jsx(Kn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search...",value:a,onChange:u=>s(u.target.value),className:"w-full pl-9 pr-3 py-2 bg-gray-50 border border-gray-200 rounded-lg text-sm text-gray-900 focus:outline-none focus:border-primary-500 focus:bg-white transition-all placeholder:text-gray-400"})]}),l.jsxs("button",{onClick:r,className:"w-full mt-3 flex items-center justify-center gap-2 py-2 bg-white border border-gray-200 rounded-lg text-sm font-medium text-gray-700 hover:border-primary-200 hover:text-primary-600 transition-all shadow-sm",children:[l.jsx(dn,{className:"w-4 h-4"}),"New Session"]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-1",children:[l.jsx("div",{className:"px-2 pb-2 text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Recent"}),o.length===0&&l.jsx("div",{className:"px-2 py-8 text-center text-sm text-gray-400",children:a?"No matching sessions":"No sessions yet"}),o.map(u=>{const d=u.key===t;return l.jsxs("div",{onClick:()=>n(u.key),className:U("p-3 rounded-lg cursor-pointer transition-all border group relative",d?"bg-white border-primary-200 shadow-sm ring-1 ring-primary-50 text-gray-900":"bg-transparent border-transparent hover:bg-white hover:border-gray-200 hover:shadow-sm text-gray-600"),children:[l.jsxs("div",{className:"flex justify-between items-start mb-1",children:[l.jsx("h3",{className:U("font-semibold text-sm truncate pr-2",d?"text-primary-700":"text-gray-900"),children:u.title||"Untitled Session"}),l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsx("span",{className:"text-[10px] text-gray-400 pt-0.5",children:c(u.lastActiveAt||u.createdAt)}),i&&l.jsx("button",{onClick:f=>{f.stopPropagation(),i(u.key)},className:"p-1 text-gray-300 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:l.jsx(Fn,{className:"w-3 h-3"})})]})]}),l.jsx("p",{className:"text-xs text-gray-500 truncate",children:u.preview||" "})]},u.key)})]})]})}function XN(e){return e<1e3?String(e):e<1e4||e<1e5?(e/1e3).toFixed(1)+"k":Math.round(e/1e3)+"k"}function vq(e){return e<.01?"$"+e.toFixed(3):"$"+e.toFixed(2)}function bq({onSend:e,onAbort:t,disabled:n,isLoading:r,contextUsage:i,isCompacting:a,editingSkill:s,onClearEditSkill:o,pendingMessages:c,onRemovePending:u,dpFocus:d,dpActive:f,onSetDpActive:h,hasMessages:p,draft:g,draftSeq:y}){const[x,v]=m.useState(""),[b,w]=m.useState(!1),S=m.useRef(!1),k=m.useRef(null);m.useEffect(()=>{g&&(v(g),setTimeout(()=>{const A=k.current;A&&(A.focus(),A.setSelectionRange(g.length,g.length))},0))},[g,y]);const j=f??!1,N=h??(()=>{}),[P,T]=m.useState(!1),E=m.useCallback(async()=>{const A=x.trim();if(!A||n)return;let M="";j&&(M+=`[Deep Investigation]
|
|
588
|
+
`),s&&(M+=`[Skill: ${s.name}]
|
|
589
|
+
`),M+=A,e(M.trim()),v("")},[x,n,e,s,j]),_=m.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&!S.current&&!A.nativeEvent.isComposing&&(A.preventDefault(),E())},[E]),C=x.trim();return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full px-4 pb-2 z-20 bg-gradient-to-t from-gray-50 via-gray-50 to-transparent pt-10",children:l.jsxs("div",{className:"max-w-5xl mx-auto",children:[l.jsxs("div",{className:U("relative bg-white rounded-[24px] shadow-lg border transition-all duration-200",b?"border-gray-300 shadow-xl":"border-gray-200",n&&"opacity-60"),children:[l.jsxs("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 min-w-0",children:[l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",onClick:()=>T(!P),disabled:n,className:U("p-1.5 rounded-lg transition-colors disabled:opacity-50",P?"text-gray-600 bg-gray-100":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:"Actions",children:l.jsx(dn,{className:"w-4 h-4"})}),P&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>T(!1)}),l.jsx("div",{className:"absolute bottom-full left-0 mb-1 bg-white rounded-xl shadow-xl border border-gray-200 z-20 w-[220px]",children:l.jsxs("div",{className:"py-1",children:[l.jsxs("button",{type:"button",onClick:()=>N(!j),className:"flex items-center gap-3 w-full px-3 py-2.5 text-left hover:bg-gray-50 transition-colors",children:[l.jsx(Bu,{className:"w-4 h-4 text-blue-500 shrink-0"}),l.jsx("span",{className:"flex-1 text-sm text-gray-700",children:"Deep Investigation"}),j&&l.jsx(_n,{className:"w-4 h-4 text-blue-500 shrink-0"})]}),!r&&p&&l.jsxs("button",{type:"button",onClick:()=>{e("[Feedback]"),T(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 text-left hover:bg-gray-50 transition-colors",children:[l.jsx(lB,{className:"w-4 h-4 text-emerald-500 shrink-0"}),l.jsx("span",{className:"flex-1 text-sm text-gray-700",children:"Session Feedback"})]})]})})]})]}),l.jsx("div",{className:"ml-auto flex items-center gap-3 shrink-0"})]}),(j||s)&&l.jsx("div",{className:"flex flex-wrap gap-2 px-4 pb-1",children:j&&l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg border text-xs font-medium bg-blue-50 border-blue-200 text-blue-700",children:[l.jsx(Bu,{className:"w-3.5 h-3.5 text-blue-500"}),l.jsx("span",{children:"Deep Investigation"}),d&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 text-[10px] font-semibold uppercase",children:d.replace(/_/g," ")}),l.jsx("button",{type:"button",className:"ml-0.5 p-0.5 rounded hover:bg-blue-200 transition-colors",onClick:()=>N(!1),children:l.jsx(Qe,{className:"w-3 h-3"})})]})}),s&&l.jsx("div",{className:"flex flex-wrap gap-2 px-4 pb-1",children:l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg border text-xs font-medium bg-indigo-50 border-indigo-200 text-indigo-700",children:[l.jsx(cs,{className:"w-3.5 h-3.5 text-indigo-500"}),l.jsx("span",{children:s.name}),l.jsx("button",{type:"button",className:"ml-0.5 p-0.5 rounded hover:bg-indigo-200 transition-colors",onClick:()=>o==null?void 0:o(),children:l.jsx(Qe,{className:"w-3 h-3"})})]})}),c&&c.length>0&&l.jsx("div",{className:"flex flex-col gap-1 px-4 pb-1",children:c.map((A,M)=>l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-amber-50 border border-amber-200 text-xs text-amber-800",children:[l.jsx("span",{className:"flex-1 truncate",children:A}),l.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-amber-200 transition-colors shrink-0",onClick:()=>u==null?void 0:u(M),title:"Remove this instruction",children:l.jsx(Qe,{className:"w-3 h-3"})})]},M))}),l.jsxs("div",{className:"relative w-full",children:[l.jsx("textarea",{ref:k,value:x,onFocus:()=>w(!0),onBlur:()=>w(!1),onChange:A=>v(A.target.value),onKeyDown:_,onCompositionStart:()=>{S.current=!0},onCompositionEnd:()=>{S.current=!1},placeholder:n?"Connecting...":"Reply...",disabled:n,className:"w-full bg-transparent border-none outline-none px-6 py-3 pr-14 text-[15px] text-gray-900 placeholder:text-gray-400 focus:ring-0 focus:outline-none resize-none min-h-[48px] max-h-[200px] disabled:cursor-not-allowed",rows:1,style:{height:"auto"}}),g&&x.trim()===g.trim()&&l.jsxs("span",{className:"absolute left-6 top-3 pointer-events-none text-[15px]",children:[l.jsx("span",{className:"invisible",children:x}),l.jsx("span",{className:"text-gray-400",children:"add details or press Enter ↵"})]})]}),r&&x.trim()?l.jsx("button",{onClick:E,className:"absolute right-3 bottom-3 p-2 rounded-lg bg-primary-600 text-white shadow-md hover:bg-primary-700 transition-all",title:"Send steer instruction",children:l.jsx(Hj,{className:"w-5 h-5"})}):r?l.jsx("button",{onClick:t,className:"absolute right-3 bottom-3 p-2 rounded-lg bg-red-500 text-white shadow-md hover:bg-red-600 transition-all",title:"Stop generating",children:l.jsx(yB,{className:"w-5 h-5"})}):l.jsx("button",{onClick:E,disabled:!C||n,className:U("absolute right-3 bottom-3 p-2 rounded-lg transition-all",C&&!n?"bg-primary-600 text-white shadow-md hover:bg-primary-700":"bg-gray-100 text-gray-300 cursor-not-allowed"),children:l.jsx(Hj,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"mt-4 flex items-center justify-between px-1",children:[l.jsx("p",{className:"text-xs text-gray-400",children:"AI may make mistakes. Please verify important information."}),a?l.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-amber-500",children:[l.jsx(Ie,{className:"w-3 h-3 animate-spin"}),l.jsx("span",{children:"Compacting..."})]}):i&&i.percent>0?l.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-400 font-mono cursor-default",children:[l.jsxs("span",{title:`Input: ${i.inputTokens.toLocaleString()} tokens`,children:["↑ ",XN(i.inputTokens)]}),l.jsxs("span",{title:`Output: ${i.outputTokens.toLocaleString()} tokens`,children:["↓ ",XN(i.outputTokens)]}),i.cost>0&&l.jsx("span",{title:"API cost this session",children:vq(i.cost)}),l.jsxs("span",{className:"flex items-center gap-1",title:`Context: ${i.tokens.toLocaleString()} / ${i.contextWindow.toLocaleString()} tokens`,children:[Math.round(i.percent),"%",l.jsx("span",{className:U("inline-block w-1.5 h-1.5 rounded-full",i.percent>75?"bg-red-400":i.percent>50?"bg-yellow-400":"bg-green-400")})]})]}):null]})]})})})}function wq({message:e,status:t,onOpenPanel:n}){let r=null;try{r=JSON.parse(e.content)}catch{}if(!(r!=null&&r.skill))return null;const{skill:i}=r,a=e.toolName==="update_skill",s=e.toolName==="fork_skill";return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("inline-flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors",t==="saved"&&"border-green-200 bg-green-50/50",t==="dismissed"&&"border-gray-200 bg-gray-50/50 opacity-60",t==="superseded"&&"border-gray-200 bg-gray-50/50 opacity-40",t==="pending"&&"border-indigo-200 bg-indigo-50/50"),children:[l.jsx(cs,{className:U("w-4 h-4 shrink-0",t==="saved"?"text-green-500":t==="dismissed"?"text-gray-400":t==="superseded"?"text-gray-300":"text-indigo-500")}),l.jsx("span",{className:U("text-sm font-medium",t==="superseded"?"text-gray-400":"text-gray-800"),children:i.name}),t==="saved"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-green-100 text-green-700",children:[l.jsx(_n,{className:"w-2.5 h-2.5"}),a?"Updated":s?"Forked":"Saved"]}),t==="dismissed"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-500",children:[l.jsx(Qe,{className:"w-2.5 h-2.5"}),"Dismissed"]}),t==="superseded"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-400",children:[l.jsx(dw,{className:"w-2.5 h-2.5"}),"Superseded"]}),t==="pending"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-indigo-100 text-indigo-600",children:[l.jsx(us,{className:"w-2.5 h-2.5"}),"Pending"]}),t!=="superseded"&&n&&l.jsxs("button",{onClick:()=>n(e),className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium text-gray-500 hover:text-indigo-600 hover:bg-indigo-50 transition-colors",children:[l.jsx(Zl,{className:"w-3 h-3"}),"View"]})]})})}async function Nf(e,t,n){if(!t)return null;try{const r={};n&&(r.workspaceId=n);const i=await e("cron.list",r),a=t.toLowerCase();return i.jobs.find(s=>s.name===t)??i.jobs.find(s=>s.name.toLowerCase()===a)??i.jobs.find(s=>s.name.toLowerCase().includes(a)||a.includes(s.name.toLowerCase()))??null}catch{return null}}function Sq({message:e,status:t,onOpenPanel:n,sendRpc:r,updateMessageMeta:i,selectedWorkspaceId:a}){var w;const[s,o]=m.useState("idle"),[c,u]=m.useState(""),d=m.useRef(!1);let f=null;try{f=JSON.parse(e.content)}catch{}m.useEffect(()=>{!f||f.error||!r||!i||d.current||t==="saved"||t==="dismissed"||t==="superseded"||(d.current=!0,h())},[t]);const h=async()=>{var S;if(!(!f||!r||!i)){if(!a){o("error"),u("Please select a workspace first");return}o("executing");try{const k=f.action;if(k==="create"&&f.schedule)await r("cron.save",{name:f.schedule.name,description:f.schedule.description,schedule:f.schedule.schedule,status:f.schedule.status||"active",workspaceId:a??null});else if(k==="update"&&f.schedule){const j=f.name??((S=f.schedule)==null?void 0:S.name)??f.id,N=await Nf(r,j,a);if(!N)throw new Error("Schedule not found");await r("cron.save",{id:N.id,name:f.schedule.name,description:f.schedule.description,schedule:f.schedule.schedule,status:f.schedule.status||"active",workspaceId:a??null})}else if(k==="delete"){const j=await Nf(r,f.name??f.id,a);if(!j)throw new Error("Schedule not found");await r("cron.delete",{id:j.id})}else if(k==="pause"||k==="resume"){const j=await Nf(r,f.name??f.id,a);if(!j)throw new Error("Schedule not found");await r("cron.setStatus",{id:j.id,status:k==="pause"?"paused":"active"})}else if(k==="rename"){const j=await Nf(r,f.name??f.id,a);if(!j)throw new Error("Schedule not found");await r("cron.rename",{id:j.id,newName:f.newName})}o("done"),await i(e.id,{scheduleCard:"saved"})}catch(k){o("error"),u((k==null?void 0:k.message)||"Operation failed")}}};if(!f||f.error)return null;const p=f.action,g=p==="rename",y=p==="delete",x=g?`${f.name||f.id} → ${f.newName}`:((w=f.schedule)==null?void 0:w.name)||f.name||f.id||"...",v=()=>{switch(p){case"delete":return"Deleted";case"pause":return"Paused";case"resume":return"Resumed";case"rename":return"Renamed";case"update":return"Updated";default:return"Saved"}},b=s==="done"?"saved":t;return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("inline-flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors",b==="saved"&&"border-green-200 bg-green-50/50",b==="dismissed"&&"border-gray-200 bg-gray-50/50 opacity-60",b==="superseded"&&"border-gray-200 bg-gray-50/50 opacity-40",b==="pending"&&(y?"border-red-200 bg-red-50/50":"border-amber-200 bg-amber-50/50"),s==="error"&&"border-red-200 bg-red-50/50"),children:[l.jsx(us,{className:U("w-4 h-4 shrink-0",b==="saved"?"text-green-500":b==="dismissed"?"text-gray-400":b==="superseded"?"text-gray-300":s==="error"||y?"text-red-500":"text-amber-500")}),l.jsx("span",{className:U("text-sm font-medium",b==="superseded"?"text-gray-400":"text-gray-800"),children:x}),f.schedule&&l.jsx("span",{className:"font-mono text-xs text-gray-500 bg-gray-100 px-1.5 py-0.5 rounded",children:f.schedule.schedule}),s==="executing"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-100 text-amber-600",children:[l.jsx(Ie,{className:"w-2.5 h-2.5 animate-spin"}),"Processing"]}),s==="error"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-100 text-red-600",children:[l.jsx($u,{className:"w-2.5 h-2.5"}),c]}),s!=="executing"&&s!=="error"&&b==="saved"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-green-100 text-green-700",children:[l.jsx(_n,{className:"w-2.5 h-2.5"}),v()]}),b==="dismissed"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-500",children:[l.jsx(Qe,{className:"w-2.5 h-2.5"}),"Dismissed"]}),b==="superseded"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-400",children:[l.jsx(dw,{className:"w-2.5 h-2.5"}),"Superseded"]}),b!=="superseded"&&n&&s!=="executing"&&l.jsxs("button",{onClick:()=>n(e),className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium text-gray-500 hover:text-amber-600 hover:bg-amber-50 transition-colors",children:[l.jsx(Zl,{className:"w-3 h-3"}),"View"]})]})})}const kq={VALIDATED:"validated",INVALIDATED:"invalidated",INCONCLUSIVE:"inconclusive",PENDING:"pending",SKIPPED:"skipped"};function jq(e){var u,d;if(!e||!e.includes("Deep Search Summary"))return null;const t=e.match(/### Conclusion\n([\s\S]*?)(?=\n### )/),n=((u=t==null?void 0:t[1])==null?void 0:u.trim())??"",r=[],i=e.match(/### Hypothesis Verdicts\n([\s\S]*?)(?=\n### )/);if(i){const f=i[1],h=/^- (?:✅|❌|⚠️|⏳|⏭️)\s+(\w+)\s+\*\*(\w+)\*\*:\s+(.+?)\s+—\s+(\d+)%/gm;let p;for(;(p=h.exec(f))!==null;){const g=p[1],y=p[2],x=p[3],v=parseInt(p[4],10);r.push({id:y,text:x,status:kq[g]??"pending",confidence:v})}if(r.length===0){const g=f.split(`
|
|
590
|
+
`);let y=null;for(const x of g){const v=x.match(/^- .+?\*\*(\w+)\*\*:\s+(.+?)\s+—\s+(\d+)%/);if(v){let b="pending";x.includes("VALIDATED")&&!x.includes("INVALIDATED")?b="validated":x.includes("INVALIDATED")?b="invalidated":x.includes("INCONCLUSIVE")?b="inconclusive":x.includes("SKIPPED")?b="skipped":x.includes("PENDING")&&(b="pending"),y&&r.push(y),y={id:v[1],text:v[2],status:b,confidence:parseInt(v[3],10)}}else x.trim()&&y&&x.startsWith(" ")&&(y.reasoning=x.trim())}y&&r.push(y)}else{const g=f.split(`
|
|
591
|
+
`);let y=-1;for(const x of g)x.startsWith("- ")?y++:x.startsWith(" ")&&x.trim()&&y>=0&&y<r.length&&(r[y].reasoning=x.trim())}}const a=e.match(/Tool calls:\s*(\d+)\s*\|\s*Duration:\s*([^\s|]+)\s*\|\s*Hypotheses:\s*(.+)/),s={toolCalls:a?parseInt(a[1],10):0,duration:(a==null?void 0:a[2])??"",hypothesesSummary:((d=a==null?void 0:a[3])==null?void 0:d.trim())??""},o=e.match(/Full report:\s*`([^`]+)`/),c=o==null?void 0:o[1];return{conclusion:n,hypotheses:r,stats:s,reportPath:c}}function Nq(e){const t=e.hypotheses;return!t||!Array.isArray(t)?null:t.map(n=>{var r;return{id:n.id,text:n.text,status:n.status??"pending",confidence:n.confidence??0,reasoning:n.reasoning,toolCallsUsed:n.toolCallsUsed,evidence:(r=n.evidence)==null?void 0:r.filter(i=>i.command||i.outputPreview)}})}function R0({status:e,className:t}){const n=U("w-4 h-4 shrink-0",t);switch(e){case"validated":return l.jsx(br,{className:U(n,"text-green-500")});case"invalidated":return l.jsx(vs,{className:U(n,"text-red-400")});case"inconclusive":return l.jsx(si,{className:U(n,"text-amber-500")});case"skipped":return l.jsx(gw,{className:U(n,"text-gray-400")});case"validating":return l.jsx(Ie,{className:U(n,"text-blue-500 animate-spin")});case"pending":default:return l.jsx(us,{className:U(n,"text-gray-400")})}}const F0={validated:"VALIDATED",invalidated:"INVALIDATED",inconclusive:"INCONCLUSIVE",pending:"PENDING",skipped:"SKIPPED",validating:"VALIDATING"},Cq={validated:"text-green-600",invalidated:"text-red-500",inconclusive:"text-amber-600",pending:"text-gray-500",skipped:"text-gray-400",validating:"text-blue-500"};function Pq(){const e=m.useRef(Date.now()),[t,n]=m.useState(0);m.useEffect(()=>{const a=setInterval(()=>{n(Math.floor((Date.now()-e.current)/1e3))},1e3);return()=>clearInterval(a)},[]);const r=Math.floor(t/60),i=t%60;return l.jsxs("span",{className:"text-xs text-gray-400 font-mono tabular-nums",children:[r,":",i.toString().padStart(2,"0")]})}function Eq({message:e,progress:t,sendMessage:n,updateMessageMeta:r}){var T,E,_;const[i,a]=m.useState(!1),s=e.toolStatus==="running",o=e.toolStatus==="error",c=(T=e.metadata)==null?void 0:T.investigationFeedback,[u,d]=m.useState(c?"submitted":"idle"),[f,h]=m.useState(c??null),[p,g]=m.useState(""),y=(E=e.toolDetails)==null?void 0:E.investigationId,x=()=>{if(!f||!y)return;const C=p.trim(),A=C?`[investigation feedback: ${f}] investigationId=${y} ${C}`:`[investigation feedback: ${f}] investigationId=${y}`;n==null||n(A),r==null||r(e.id,{investigationFeedback:f}),d("submitted")},v=s?null:jq(e.content),b=e.toolDetails?Nq(e.toolDetails):null,w=((_=e.toolDetails)==null?void 0:_.reportPath)??(v==null?void 0:v.reportPath),S=e.toolInput||"",j=(b??(v==null?void 0:v.hypotheses)??[]).slice().sort((C,A)=>C.status==="validated"&&A.status!=="validated"?-1:A.status==="validated"&&C.status!=="validated"?1:A.confidence-C.confidence);if(s){const C=t&&t.hypotheses.length>0;return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:"rounded-lg border border-blue-200 bg-blue-50/50 px-4 py-3 max-w-2xl",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Kn,{className:"w-4 h-4 text-blue-500 shrink-0"}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),(t==null?void 0:t.phase)&&l.jsx("span",{className:"text-xs font-medium px-1.5 py-0.5 rounded bg-blue-100 text-blue-700",children:t.phase}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[l.jsx(Pq,{}),l.jsx(Ie,{className:"w-4 h-4 animate-spin text-blue-500"})]})]}),S&&l.jsxs("p",{className:"text-sm text-gray-600 mb-3 line-clamp-2",children:["“",S,"”"]}),C?l.jsx("div",{className:"space-y-1 mb-3",children:t.hypotheses.map(A=>l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(R0,{status:A.status,className:"mt-0.5"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("span",{className:"text-sm text-gray-700",children:[l.jsx("span",{className:"font-medium",children:A.id})," ",l.jsx("span",{className:"text-gray-600",children:A.text})]}),l.jsx("span",{className:U("text-xs font-medium ml-1.5",Cq[A.status]||"text-gray-500"),children:A.status==="validating"&&A.lastAction?l.jsx("span",{className:"text-blue-500 font-mono",children:A.lastAction}):A.status==="validated"||A.status==="invalidated"||A.status==="inconclusive"?`${F0[A.status]||A.status} (${A.confidence}%)`:F0[A.status]||A.status})]})]},A.id))}):null,l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-blue-100/60 rounded-md",children:[l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin text-blue-500 shrink-0"}),l.jsx("span",{className:"text-xs text-blue-700 font-mono truncate",children:(t==null?void 0:t.currentAction)||"Investigating hypotheses..."})]})]})})}if(o||!v)return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:"rounded-lg border border-red-200 bg-red-50/50 px-4 py-3 max-w-2xl",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Kn,{className:"w-4 h-4 text-red-500 shrink-0"}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),l.jsx(vs,{className:"w-4 h-4 text-red-500 ml-auto shrink-0"})]}),S&&l.jsxs("p",{className:"text-sm text-gray-600 mb-2",children:["“",S,"”"]}),l.jsx("pre",{className:"text-xs text-red-600 whitespace-pre-wrap bg-red-100/60 rounded-md px-3 py-2",children:e.content||"Investigation failed."})]})});const N=j.length>0,P=j.some(C=>C.evidence&&C.evidence.length>0);return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("rounded-lg border px-4 py-3 max-w-2xl transition-colors",N?"border-green-200 bg-green-50/50":"border-gray-200 bg-gray-50/50"),children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Kn,{className:U("w-4 h-4 shrink-0",N?"text-green-500":"text-gray-500")}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),l.jsxs("span",{className:U("ml-auto text-xs font-medium px-1.5 py-0.5 rounded flex items-center gap-1","bg-green-100 text-green-700"),children:[l.jsx(br,{className:"w-3 h-3"}),"Done"]})]}),(v==null?void 0:v.conclusion)&&l.jsx("div",{className:"mb-3 text-sm text-gray-700 leading-relaxed [&_p]:mb-1.5 [&_p:last-child]:mb-0 [&_strong]:text-gray-800 [&_ul]:list-disc [&_ul]:pl-4 [&_ol]:list-decimal [&_ol]:pl-4 [&_li]:mb-0.5",children:l.jsx(Ed,{children:v.conclusion})}),j.length>0&&l.jsx("div",{className:"space-y-1.5 mb-3",children:j.map(C=>{const A=C.status==="skipped"||C.status==="pending";return l.jsx("div",{children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(R0,{status:C.status,className:"mt-0.5"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-baseline gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium text-gray-800 shrink-0",children:C.id}),l.jsx("span",{className:"text-sm text-gray-700 truncate",children:C.text}),l.jsxs("span",{className:U("text-xs font-semibold px-1.5 py-0.5 rounded shrink-0 ml-auto",C.status==="validated"?"bg-green-100 text-green-700":C.status==="invalidated"?"bg-red-100 text-red-600":C.status==="inconclusive"?"bg-amber-100 text-amber-700":"bg-gray-100 text-gray-500"),children:[C.confidence,"%"]})]}),!A&&C.reasoning&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5 leading-relaxed line-clamp-2",children:C.reasoning})]})]})},C.id)})}),i&&j.length>0&&l.jsx("div",{className:"border-t border-green-200 pt-3 mb-3 space-y-3",children:j.filter(C=>C.evidence&&C.evidence.length>0||C.toolCallsUsed).map(C=>l.jsxs("div",{className:"bg-white/70 rounded-md px-3 py-2 border border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(R0,{status:C.status}),l.jsxs("span",{className:"text-sm font-medium text-gray-800",children:[C.id,": ",C.text]}),l.jsxs("span",{className:U("ml-auto text-xs font-semibold px-1.5 py-0.5 rounded shrink-0",C.status==="validated"?"bg-green-100 text-green-700":C.status==="invalidated"?"bg-red-100 text-red-600":C.status==="inconclusive"?"bg-amber-100 text-amber-700":"bg-gray-100 text-gray-600"),children:[F0[C.status]," (",C.confidence,"%)"]})]}),C.evidence&&C.evidence.length>0&&l.jsxs("div",{className:"mt-2 space-y-1.5",children:[l.jsx("span",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-wider",children:"Evidence"}),C.evidence.map((A,M)=>l.jsxs("div",{className:"bg-gray-50 rounded px-2.5 py-1.5 border border-gray-100",children:[l.jsxs("div",{className:"font-mono text-[11px] text-gray-700 truncate",children:[l.jsxs("span",{className:"text-gray-400",children:[A.tool,":"]})," ",A.command]}),A.outputPreview&&l.jsx("pre",{className:"text-[11px] text-gray-500 mt-1 whitespace-pre-wrap line-clamp-3 leading-relaxed",children:A.outputPreview})]},M))]}),C.toolCallsUsed!=null&&l.jsxs("p",{className:"text-[11px] text-gray-400 mt-1.5",children:[C.toolCallsUsed," tool calls"]})]},C.id))}),l.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[(()=>{var A;const C=(v==null?void 0:v.stats.toolCalls)??((A=e.toolDetails)==null?void 0:A.totalToolCalls)??0;return C>0?l.jsxs("span",{children:[C," calls"]}):null})(),(()=>{var A;if(v!=null&&v.stats.duration)return l.jsx("span",{children:v.stats.duration});const C=(A=e.toolDetails)==null?void 0:A.durationMs;return C?l.jsxs("span",{children:[(C/1e3).toFixed(1),"s"]}):null})(),(v==null?void 0:v.stats.hypothesesSummary)&&l.jsx("span",{children:v.stats.hypothesesSummary})]}),P&&l.jsx("button",{type:"button",className:"flex items-center gap-1 text-xs text-gray-500 hover:text-gray-700 transition-colors cursor-pointer",onClick:()=>a(!i),children:i?l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Collapse"}),l.jsx(fh,{className:"w-3.5 h-3.5"})]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Evidence"}),l.jsx(ea,{className:"w-3.5 h-3.5"})]})})]}),i&&w&&l.jsxs("div",{className:"mt-2 pt-2 border-t border-green-200",children:[l.jsx("span",{className:"text-xs text-gray-400",children:"Full report: "}),l.jsx("code",{className:"text-xs text-gray-500 bg-gray-100 px-1.5 py-0.5 rounded",children:w})]}),y&&u==="submitted"&&f&&l.jsxs("div",{className:"mt-3 pt-2 border-t border-green-200 flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-400",children:"Feedback:"}),l.jsx("span",{className:U("text-xs font-medium px-2 py-0.5 rounded-full",f==="confirmed"?"bg-green-100 text-green-700":f==="corrected"?"bg-amber-100 text-amber-700":"bg-red-100 text-red-600"),children:f==="confirmed"?"✅ Correct":f==="corrected"?"🔧 Corrected":"❌ Rejected"})]}),y&&u==="idle"&&l.jsx("div",{className:"mt-3 pt-2 border-t border-green-200",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-400",children:"Was this diagnosis accurate?"}),l.jsxs("div",{className:"flex gap-1.5 ml-auto",children:[l.jsx("button",{type:"button",className:"text-xs px-2.5 py-1 rounded-md bg-green-50 text-green-700 hover:bg-green-100 border border-green-200 transition-colors cursor-pointer",onClick:()=>{h("confirmed"),d("submitted"),n==null||n(`[investigation feedback: confirmed] investigationId=${y}`),r==null||r(e.id,{investigationFeedback:"confirmed"})},children:"✅ Correct"}),l.jsx("button",{type:"button",className:"text-xs px-2.5 py-1 rounded-md bg-amber-50 text-amber-700 hover:bg-amber-100 border border-amber-200 transition-colors cursor-pointer",onClick:()=>{h("corrected"),d("input")},children:"🔧 Partial"}),l.jsx("button",{type:"button",className:"text-xs px-2.5 py-1 rounded-md bg-red-50 text-red-600 hover:bg-red-100 border border-red-200 transition-colors cursor-pointer",onClick:()=>{h("rejected"),d("input")},children:"❌ Wrong"})]})]})}),y&&u==="input"&&f&&l.jsxs("div",{className:"mt-3 pt-2 border-t border-green-200 space-y-2",children:[l.jsx("span",{className:"text-xs text-gray-500",children:f==="corrected"?"What was the actual root cause?":"What was wrong with the diagnosis? (optional)"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",className:"flex-1 text-xs px-2.5 py-1.5 border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-300",placeholder:f==="corrected"?"The actual root cause was...":"Optional note...",value:p,onChange:C=>g(C.target.value),onKeyDown:C=>{C.key==="Enter"&&x()}}),l.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-md bg-blue-500 text-white hover:bg-blue-600 transition-colors cursor-pointer",onClick:x,children:"Submit"}),l.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-md text-gray-400 hover:text-gray-600 transition-colors cursor-pointer",onClick:()=>{d("idle"),h(null),g("")},children:"Cancel"})]})]})]})})}function Aq(e){if(!e)return[];const t=e.split(/\n---\s*\n/).filter(a=>a.trim());if(t.length>=2)return t.map((a,s)=>Cf(a.trim(),s+1));const n=e.split(/\n(?=#{2,3}\s*(?:Hypothesis|H)\s*\d)/i).filter(a=>a.trim());if(n.length>=2)return n.map((a,s)=>Cf(a.trim(),s+1));const r=e.split(/\n(?=#{2,3}\s*\d+[.)]\s)/).filter(a=>a.trim());if(r.length>=2){const a=o=>/^#{2,3}\s*\d+[.)]\s/m.test(o),s=r.filter(a);if(s.length>=2)return s.map((o,c)=>Cf(o.trim(),c+1))}const i=e.split(/\n(?=\*{2}(?:Hypothesis|H)\s*\d)/i).filter(a=>a.trim());if(i.length>=2){const a=o=>/\*{2}(?:Hypothesis|H)\s*\d/i.test(o),s=i.filter(a);if(s.length>=2)return s.map((o,c)=>Cf(o.trim(),c+1))}return Tq(e)}function Cf(e,t){const n=e.split(`
|
|
592
|
+
`).map(o=>o.trim()).filter(Boolean);let r,i="",a="";const s=[];for(const o of n){const c=o.match(/^\*{2}(?:Hypothesis|H)\s*\d+[:\s]*(.*?)\*{2}\s*$/i);if(c){const g=c[1],y=g.match(/[(\uff08](?:confidence|置信度)[:\s:]*(\d+)\s*%[)\uff09]/i);y&&(r=parseInt(y[1],10)),i=Si(g.replace(/[(\uff08](?:confidence|置信度)[:\s:]*\d+\s*%[)\uff09]/i,"").trim());continue}const u=o.match(/^#{2,3}\s*(?:Hypothesis|H)\s*\d+[:\s]*(.*)/i);if(u){const g=u[1],y=g.match(/[(\uff08](?:confidence|置信度)[:\s:]*(\d+)\s*%[)\uff09]/i);y&&(r=parseInt(y[1],10)),i=Si(g.replace(/[(\uff08](?:confidence|置信度)[:\s:]*\d+\s*%[)\uff09]/i,"").trim());continue}const d=o.match(/^#{2,3}\s*\d+[.)]\s*(.*)/);if(d){const g=d[1],y=g.match(/[(\uff08](?:confidence|置信度)[:\s:]*(\d+)\s*%[)\uff09]/i);y&&(r=parseInt(y[1],10)),i=Si(g.replace(/[(\uff08](?:confidence|置信度)[:\s:]*\d+\s*%[)\uff09]/i,"").trim());continue}const f=o.match(/^\*{0,2}(?:confidence|置信度)\*{0,2}[:\s:]*(\d+)\s*%/i);if(f){r=parseInt(f[1],10);continue}if(o.match(/^\*{0,2}(?:validation tools?|verification tools?)\*{0,2}[:\s]/i))continue;if(o.match(/`(node_exec|pod_exec|bash|run_skill|node_script)[:\s]/)){s.push(Si(o));continue}const h=o.replace(/^[-*]\s+/,""),p=h.match(/^\*{0,2}(?:description|描述)\*{0,2}[:\s:]*(.*)/i);if(p&&p[1]){const g=Si(p[1]);i?a?s.push(g):a=g:i=g;continue}if(h.match(/^(?:\*{0,2})(?:validation method|validation|expected result|验证方法|验证|预期结果)(?:\*{0,2})[:\s:]/i)){s.push(Si(h));continue}if(!i&&h.length>10&&!h.startsWith("**Validation")&&!h.startsWith("**Confidence")&&!h.startsWith("**验证")&&!h.startsWith("**置信度")){i=Si(h);continue}if(i){const g=Si(h);g.length>5&&(a?s.push(g):a=g)}}if(r==null){const o=e.match(/(\d+)\s*%/);o&&(r=parseInt(o[1],10))}return{index:t,title:i||`Hypothesis ${t}`,confidence:r,description:a||void 0,detailLines:s}}function Tq(e){const t=[],n=e.split(`
|
|
593
|
+
`);let r=null;for(const i of n){const a=i.trim();if(!a)continue;const s=a.match(/^(\d+)[.)]\s+(.+)/);if(s){r&&t.push(r);const o=Si(s[2]),c=o.match(/(\d+)\s*%/);r={index:parseInt(s[1],10),title:o.replace(/\(\d+%\)/,"").trim(),confidence:c?parseInt(c[1],10):void 0,detailLines:[]}}else if(r&&(a.startsWith("-")||a.startsWith("*")||/^\s/.test(i))){const o=Si(a.replace(/^[-*]\s+/,""));o.length>5&&r.detailLines.push(o)}}return r&&t.push(r),t}function Si(e){return e.replace(/\*{1,2}([^*]+)\*{1,2}/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/^[#\s]+/,"").trim()}function Oq({message:e,sendMessage:t,abortResponse:n,onHypothesesConfirmed:r,superseded:i,alreadyConfirmed:a}){var _,C;const[s,o]=m.useState(!1),[c,u]=m.useState(""),[d,f]=m.useState(null),[h,p]=m.useState(!1),g=e.toolStatus==="running",y=e.toolStatus==="success"||!e.toolStatus&&!e.isStreaming,x=(_=e.toolDetails)==null?void 0:_.hypotheses;let v;if(Array.isArray(x))v=x.map((A,M)=>({index:M+1,title:A.text??`Hypothesis ${M+1}`,confidence:A.confidence,description:A.description,detailLines:[]}));else{const A=x||e.toolInput||"";v=Aq(A)}const b=Array.isArray(x)?"":x||e.toolInput||"",w=h||a;if(i)return l.jsx("div",{className:"pl-12",children:l.jsx("div",{className:"rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-2 max-w-2xl opacity-50",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Kn,{className:"w-4 h-4 text-gray-400 shrink-0"}),l.jsx("span",{className:"text-sm text-gray-500",children:"Hypotheses"}),l.jsxs("span",{className:"text-xs text-gray-400",children:[v.length," items"]}),l.jsx("span",{className:"ml-auto text-xs text-gray-400",children:"Superseded"})]})})});const S=y&&((C=e.toolDetails)==null?void 0:C.autoConfirmed)===!0,k=y&&!g&&!s&&!S&&!w,j=()=>{r&&v.length>0&&r(v.map(A=>({id:`H${A.index}`,text:A.title,confidence:A.confidence??0})))},N=()=>{t&&(t("The user has confirmed hypotheses. Please call deep_search to validate them."),p(!0),j())},P=()=>{c.trim()&&t&&(t(`User feedback: ${c.trim()}. Please revise the hypotheses based on this feedback, then call propose_hypotheses again to present the updated hypotheses and wait for user confirmation before calling deep_search.`),o(!1),u(""),p(!0))},T=()=>{n&&n()},E=A=>{f(d===A?null:A)};return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("rounded-lg border px-4 py-3 max-w-2xl transition-colors",y?"border-indigo-200 bg-indigo-50/50":"border-blue-200 bg-blue-50/50"),children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(Kn,{className:"w-4 h-4 text-indigo-500 shrink-0"}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Hypothesis Review"}),y&&(S||w)&&l.jsxs("span",{className:"ml-auto text-xs font-medium px-1.5 py-0.5 rounded flex items-center gap-1 bg-indigo-100 text-indigo-700",children:[l.jsx(br,{className:"w-3 h-3"}),"Confirmed"]}),y&&!S&&!w&&!s&&l.jsx("span",{className:"ml-auto text-xs text-amber-600 font-medium px-1.5 py-0.5 rounded bg-amber-50",children:"Awaiting review"})]}),v.length>0?l.jsx("div",{className:"space-y-1 mb-3",children:v.map(A=>{const M=d===A.index,B=A.detailLines.length>0||A.description;return l.jsxs("div",{children:[l.jsxs("button",{type:"button",className:U("flex items-center gap-2 w-full text-left px-2 py-1.5 rounded-md transition-colors",B?"hover:bg-indigo-100/60 cursor-pointer":"cursor-default",M&&"bg-indigo-100/60"),onClick:()=>B&&E(A.index),children:[B?l.jsx(ua,{className:U("w-3 h-3 text-gray-400 shrink-0 transition-transform",M&&"rotate-90")}):l.jsx("span",{className:"w-3 shrink-0"}),l.jsx("span",{className:"text-xs font-semibold text-indigo-500 bg-indigo-100 rounded-full w-5 h-5 flex items-center justify-center shrink-0",children:A.index}),l.jsx("span",{className:"flex-1 text-sm text-gray-700 min-w-0 truncate",children:A.title}),A.confidence!=null&&l.jsxs("span",{className:U("text-xs font-semibold px-1.5 py-0.5 rounded shrink-0",A.confidence>=70?"bg-indigo-100 text-indigo-700":A.confidence>=40?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-500"),children:[A.confidence,"%"]})]}),M&&B&&l.jsxs("div",{className:"ml-10 pl-2 border-l-2 border-indigo-200 mt-1 mb-2 space-y-1",children:[A.description&&l.jsx("p",{className:"text-xs text-gray-600 leading-relaxed",children:A.description}),A.detailLines.map((ae,Q)=>l.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:ae},Q))]})]},A.index)})}):l.jsx("div",{className:"mb-3 text-sm text-gray-600",children:l.jsx(Ed,{children:b})}),s&&l.jsxs("div",{className:"mb-3 flex gap-2",children:[l.jsx("input",{type:"text",value:c,onChange:A=>u(A.target.value),onKeyDown:A=>A.key==="Enter"&&!A.nativeEvent.isComposing&&P(),placeholder:"Add/modify hypotheses...",className:"flex-1 text-sm border border-indigo-200 rounded-md px-3 py-1.5 focus:outline-none focus:ring-1 focus:ring-indigo-400",autoFocus:!0}),l.jsxs("button",{type:"button",onClick:P,disabled:!c.trim(),className:"text-xs font-medium px-3 py-1.5 rounded-md bg-indigo-600 text-white hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-1 cursor-pointer",children:[l.jsx(hB,{className:"w-3 h-3"}),"Send"]}),l.jsx("button",{type:"button",onClick:()=>{o(!1),u("")},className:"text-xs font-medium px-2 py-1.5 rounded-md text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer",children:l.jsx(Qe,{className:"w-3.5 h-3.5"})})]}),k&&l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-indigo-100",children:[l.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1 text-xs font-medium px-3 py-1.5 rounded-md bg-indigo-600 text-white hover:bg-indigo-700 transition-colors cursor-pointer",children:[l.jsx(Pm,{className:"w-3 h-3"}),"Confirm & Run"]}),l.jsxs("button",{type:"button",onClick:()=>o(!0),className:"flex items-center gap-1 text-xs font-medium px-2.5 py-1.5 rounded-md text-indigo-600 hover:bg-indigo-100 transition-colors cursor-pointer",children:[l.jsx(Cm,{className:"w-3 h-3"}),"Modify"]}),l.jsxs("button",{type:"button",onClick:T,className:"flex items-center gap-1 text-xs font-medium px-2.5 py-1.5 rounded-md text-gray-500 hover:bg-gray-100 hover:text-red-600 transition-colors cursor-pointer",children:[l.jsx(Qe,{className:"w-3 h-3"}),"Cancel"]})]})]})})}function _q({status:e}){return e==="done"?l.jsx(br,{className:"w-4 h-4 text-green-500 shrink-0 mt-0.5"}):e==="in_progress"?l.jsx(Ie,{className:"w-4 h-4 text-blue-500 animate-spin shrink-0 mt-0.5"}):e==="skipped"?l.jsx(gw,{className:"w-3.5 h-3.5 text-gray-400 shrink-0 mt-0.5"}):e==="error"?l.jsx(vs,{className:"w-4 h-4 text-red-500 shrink-0 mt-0.5"}):l.jsx(YO,{className:"w-4 h-4 text-gray-300 shrink-0 mt-0.5"})}function Dq({status:e}){const t="w-3.5 h-3.5 shrink-0";switch(e){case"validated":return l.jsx(br,{className:U(t,"text-green-500")});case"invalidated":return l.jsx(vs,{className:U(t,"text-red-400")});case"inconclusive":return l.jsx(si,{className:U(t,"text-amber-500")});case"validating":return l.jsx(Ie,{className:U(t,"text-blue-500 animate-spin")});case"skipped":return l.jsx(gw,{className:U(t,"text-gray-400")});default:return l.jsx(us,{className:U(t,"text-gray-300")})}}function Mq({used:e,max:t}){const n=t>0?Math.min(100,Math.round(e/t*100)):0;return l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("div",{className:"flex-1 h-1 bg-gray-200 rounded-full overflow-hidden max-w-[80px]",children:l.jsx("div",{className:"h-full bg-blue-400 rounded-full transition-all",style:{width:`${n}%`}})}),l.jsxs("span",{className:"text-[10px] text-gray-400 font-mono tabular-nums",children:[e,"/",t]})]})}const ZN={validated:"text-green-600",invalidated:"text-red-500",inconclusive:"text-amber-600",validating:"text-blue-500",pending:"text-gray-400",skipped:"text-gray-400"},Iq={validated:"VALIDATED",invalidated:"INVALIDATED",inconclusive:"INCONCLUSIVE",validating:"validating...",pending:"pending",skipped:"SKIPPED"};function Lq({h:e}){const t=e.status==="validated"||e.status==="invalidated"||e.status==="inconclusive"||e.status==="skipped",n=e.status==="validating";return l.jsxs("div",{className:U("flex items-start gap-1.5 py-0.5",t&&"opacity-70"),children:[l.jsx(Dq,{status:e.status}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsx("span",{className:U("text-xs font-medium shrink-0",n?"text-blue-700":t?"text-gray-500":"text-gray-600"),children:e.id}),l.jsx("span",{className:U("text-xs truncate",t?"text-gray-400":"text-gray-600"),children:e.text}),e.confidence>0&&l.jsxs("span",{className:U("text-[10px] font-semibold shrink-0 ml-auto",ZN[e.status]||"text-gray-400"),children:[e.confidence,"%"]})]}),n&&l.jsxs("div",{className:"mt-0.5 space-y-0.5",children:[e.maxCalls>0&&l.jsx(Mq,{used:e.callsUsed,max:e.maxCalls}),e.lastAction&&l.jsx("p",{className:"text-[10px] text-blue-500 font-mono truncate",children:e.lastAction})]}),t&&l.jsxs("span",{className:U("text-[10px] font-medium",ZN[e.status]),children:[Iq[e.status],e.callsUsed>0&&` · ${e.callsUsed} calls`]})]})]})}function Rq({items:e,investigationProgress:t,onDismiss:n}){const[r,i]=m.useState(!1),a=e.filter(p=>p.status==="done"||p.status==="skipped").length,s=e.length,o=a===s,c=e.some(p=>p.status==="error"),u=e.find(p=>p.status==="in_progress")||e.find(p=>p.status==="pending"),d=e.find(p=>p.id==="deep_search"),f=(t==null?void 0:t.hypotheses)??[],h=((d==null?void 0:d.status)==="in_progress"||(d==null?void 0:d.status)==="done")&&f.length>0;return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("rounded-lg border px-4 py-3 transition-colors max-w-lg",c?"border-red-200 bg-red-50/50":o?"border-green-200 bg-green-50/50":"border-indigo-200 bg-indigo-50/50"),children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Bu,{className:U("w-4 h-4 shrink-0",c?"text-red-500":o?"text-green-500":"text-indigo-500")}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),u&&!o&&u.status==="in_progress"&&l.jsx("span",{className:"text-xs text-gray-500",children:u.label}),l.jsxs("span",{className:U("ml-auto text-xs font-medium px-1.5 py-0.5 rounded",c?"bg-red-100 text-red-700":o?"bg-green-100 text-green-700":"bg-indigo-100 text-indigo-700"),children:[a,"/",s]}),n&&!o&&(r?l.jsxs("div",{className:"flex items-center gap-1 text-xs ml-1",children:[l.jsx("button",{onClick:()=>{i(!1),n()},className:"px-1.5 py-0.5 rounded bg-red-100 text-red-700 hover:bg-red-200 font-medium",children:"Exit"}),l.jsx("button",{onClick:()=>i(!1),className:"px-1.5 py-0.5 rounded bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium",children:"Cancel"})]}):l.jsx("button",{onClick:()=>i(!0),className:"ml-1 p-0.5 rounded hover:bg-gray-200 text-gray-400 hover:text-gray-600",title:"Exit investigation",children:l.jsx(Qe,{className:"w-3.5 h-3.5"})}))]}),l.jsx("div",{className:"space-y-1.5",children:e.map(p=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(_q,{status:p.status}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:U("text-sm leading-relaxed",p.status==="done"?"text-gray-400 line-through":p.status==="skipped"?"text-gray-400":p.status==="error"?"text-red-600 font-medium":p.status==="in_progress"?"text-gray-800 font-medium":"text-gray-600"),children:p.label}),p.summary&&(p.status==="done"||p.status==="skipped"||p.status==="error")&&l.jsx("p",{className:U("text-xs mt-0.5",p.status==="error"?"text-red-500":"text-gray-500"),style:{textDecoration:"none"},children:p.summary})]})]}),p.id==="deep_search"&&h&&l.jsxs("div",{className:"ml-6 mt-1.5 mb-1 pl-2 border-l-2 border-indigo-200 space-y-0.5",children:[f.map(g=>l.jsx(Lq,{h:g},g.id)),(t==null?void 0:t.currentAction)&&l.jsxs("div",{className:"flex items-center gap-1.5 mt-1 px-2 py-1 bg-blue-50 rounded",children:[l.jsx(Ie,{className:"w-3 h-3 animate-spin text-blue-400 shrink-0"}),l.jsx("span",{className:"text-[10px] text-blue-600 font-mono truncate",children:t.currentAction})]})]})]},p.id))})]})})}const Fq=[{icon:cs,title:"Skills",description:"Reusable diagnostic scripts for common SRE tasks"},{icon:Bu,title:"Deep Investigation",description:"Hypothesis-driven root cause analysis with evidence"},{icon:mo,title:"Memory",description:"Remembers findings and context across sessions"},{icon:Vu,title:"Scheduled Jobs",description:"Automated health checks on a cron schedule"}],zq=["Check my cluster health","List available skills","What happened since my last session?"],QN="Introduce yourself and help me get started",$q={kubeconfig:"Kubeconfig",ssh_password:"SSH",ssh_key:"SSH Key",api_token:"API Token",api_basic_auth:"API Auth"};function Bq({systemStatus:e,onSendPrompt:t,onNavigateModels:n,onNavigateCredentials:r,isAdmin:i}){const a=e?(e.sessionCount??0)===0:!1,s=(e==null?void 0:e.hasModels)??!1,o=(e==null?void 0:e.credentials)??{},c=Object.keys(o).length>0,u=(e==null?void 0:e.sessionCount)??0,d=i?s&&c&&u>0:c&&u>0,f=p=>{if(!s){i&&n();return}t(p)},h=[];return i&&h.push({done:s,label:"Configure AI Model",subtitle:"Add a model provider to start chatting",onClick:n}),h.push({done:c,label:"Add Credentials",subtitle:"Connect to your clusters and servers via SSH or Kubeconfig",onClick:r}),h.push({done:u>0,label:"Start your first conversation",subtitle:"Ask Siclaw to diagnose an issue or run a skill"}),l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 max-w-2xl mx-auto space-y-8",children:[a&&l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("h1",{className:"text-2xl font-semibold text-gray-800",children:"Welcome to Siclaw"}),l.jsx("p",{className:"text-gray-500 text-sm",children:"Your personal SRE assistant that learns, remembers, and grows with you"})]}),e&&!d&&l.jsxs("div",{className:"w-full bg-white border border-gray-200 rounded-2xl shadow-sm p-5 space-y-3",children:[l.jsx("h2",{className:"text-sm font-semibold text-gray-700",children:"Getting Started"}),l.jsx("div",{className:"space-y-2",children:h.map((p,g)=>l.jsx(Uq,{step:g+1,done:p.done,label:p.label,subtitle:p.subtitle,onClick:p.onClick},p.label))})]}),a&&l.jsx("div",{className:"w-full grid grid-cols-2 gap-3",children:Fq.map(p=>l.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm p-4 space-y-1.5",children:[l.jsx(p.icon,{className:"w-5 h-5 text-gray-400"}),l.jsx("p",{className:"text-sm font-medium text-gray-700",children:p.title}),l.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:p.description})]},p.title))}),d&&c&&l.jsx(Vq,{credentials:o}),e&&l.jsxs("div",{className:"w-full space-y-3",children:[l.jsx("p",{className:"text-xs text-center text-gray-400",children:"Try asking"}),l.jsxs("div",{className:"flex flex-wrap gap-2 justify-center",children:[a&&l.jsx("button",{onClick:()=>f(QN),className:"rounded-full px-4 py-2 bg-blue-50 hover:bg-blue-100 border border-blue-200 text-sm text-blue-700 transition-colors",children:QN}),zq.map(p=>l.jsx("button",{onClick:()=>f(p),className:"rounded-full px-4 py-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 text-sm text-gray-700 transition-colors",children:p},p))]}),!s&&l.jsx("p",{className:"text-xs text-center text-amber-600",children:i?"Configure a model first to start chatting":"Waiting for an admin to configure a model"})]})]})}function Uq({step:e,done:t,label:n,subtitle:r,onClick:i}){const a=l.jsxs("div",{className:"flex items-start gap-3",children:[t?l.jsx(br,{className:"w-5 h-5 text-green-500 mt-0.5 shrink-0"}):l.jsx(YO,{className:"w-5 h-5 text-gray-300 mt-0.5 shrink-0"}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("p",{className:`text-sm font-medium ${t?"text-gray-400":"text-gray-800"}`,children:[e,". ",n]}),l.jsx("p",{className:`text-xs mt-0.5 ${t?"text-gray-300":"text-gray-500"}`,children:r})]}),!t&&i&&l.jsx(qO,{className:"w-4 h-4 text-gray-400 mt-0.5 ml-auto shrink-0"})]});return i?l.jsx("button",{onClick:i,className:"w-full text-left px-3 py-2.5 rounded-xl hover:bg-gray-50 transition-colors",children:a}):l.jsx("div",{className:"px-3 py-2.5",children:a})}function Vq({credentials:e}){const t=Object.entries(e);return t.length===0?null:l.jsxs("div",{className:"w-full bg-white border border-gray-200 rounded-2xl shadow-sm p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(Ql,{className:"w-4 h-4 text-gray-400"}),l.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Credentials"})]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(([n,r])=>l.jsxs("span",{className:"inline-flex items-center text-xs bg-gray-50 text-gray-600 border border-gray-200 rounded-full px-2.5 py-1",children:[$q[n]||n," ×",r]},n))})]})}const Wq=new Set(["create_skill","update_skill","fork_skill"]);function mu(e){return!!e&&Wq.has(e)}const JN=["Thinking...","Tip: Use + to provide session feedback and help the AI improve","Tip: Enable Deep Investigation for hypothesis-driven root cause analysis","Tip: Siclaw remembers findings across sessions — ask about past investigations","Analyzing the situation...","Tip: Use Skills to run reusable diagnostic scripts","Tip: You can queue your next message while the AI is responding","Working on it..."];function Hq(e){const t=new Map,n=new Map;for(const r of e){if(r.role!=="tool"||!mu(r.toolName))continue;let i=null;try{i=JSON.parse(r.content)}catch{continue}if(!(i!=null&&i.skill))continue;const a=i.skillId||i.skill.name;n.has(a)||n.set(a,[]),n.get(a).push(r.id);const s=r.metadata;(s==null?void 0:s.skillCard)==="saved"?t.set(r.id,"saved"):(s==null?void 0:s.skillCard)==="dismissed"?t.set(r.id,"dismissed"):t.set(r.id,"pending")}for(const[,r]of n){let i=-1;for(let a=r.length-1;a>=0;a--)if(t.get(r[a])==="pending"){i=a;break}for(let a=0;a<r.length;a++)t.get(r[a])==="pending"&&a!==i&&t.set(r[a],"superseded")}return t}function Kq(e){var r;const t=new Map,n=new Map;for(const i of e){if(i.role!=="tool"||i.toolName!=="manage_schedule")continue;let a=null;try{a=JSON.parse(i.content)}catch{continue}if(!a)continue;const s=((r=a.schedule)==null?void 0:r.name)||a.id||i.id;n.has(s)||n.set(s,[]),n.get(s).push(i.id);const o=i.metadata;(o==null?void 0:o.scheduleCard)==="saved"?t.set(i.id,"saved"):(o==null?void 0:o.scheduleCard)==="dismissed"?t.set(i.id,"dismissed"):t.set(i.id,"pending")}for(const[,i]of n){let a=-1;for(let s=i.length-1;s>=0;s--)if(t.get(i[s])==="pending"){a=s;break}for(let s=0;s<i.length;s++)t.get(i[s])==="pending"&&s!==a&&t.set(i[s],"superseded")}return t}function qq({messages:e,isLoading:t,isLoadingHistory:n,wsStatus:r,isConnected:i,hasMore:a,isLoadingMore:s,sendMessage:o,abortResponse:c,loadMoreHistory:u,sendRpc:d,contextUsage:f,isCompacting:h,skills:p,editingSkill:g,onEditSkill:y,onClearEditSkill:x,onSkillSaved:v,onOpenSkillPanel:b,onOpenSchedulePanel:w,panelMessage:S,updateMessageMeta:k,pendingMessages:j,onRemovePending:N,investigationProgress:P,dpActive:T,onSetDpActive:E,dpFocus:_,dpChecklist:C,onHypothesesConfirmed:A,onExitDp:M,systemStatus:B,onNavigateModels:ae,onNavigateCredentials:Q,sessionKey:I,selectedWorkspaceId:H,isAdmin:O}){const oe=m.useRef(null),re=m.useRef(null),D=m.useRef(0),G=m.useRef(0),te=m.useRef(!1),ee=m.useRef(!1),Z=m.useRef(!1),ce=m.useRef(null),J=m.useRef(I);m.useEffect(()=>{J.current!==I&&(J.current=I,te.current=!1,G.current=0,ee.current=!0,F.current=!1,Z.current=!0,ce.current&&(clearTimeout(ce.current),ce.current=null))},[I]);const[ne,be]=m.useState(0),[Y,R]=m.useState(null),F=m.useRef(!1),ue=m.useRef(t),[le,ze]=m.useState(!1);m.useEffect(()=>{const je=ue.current;if(ue.current=t,je&&!t&&!F.current&&e.length>0){F.current=!0,ze(!0);const W=setTimeout(()=>ze(!1),7e3);return()=>clearTimeout(W)}},[t,e.length]),m.useEffect(()=>()=>{ce.current&&clearTimeout(ce.current)},[]);const Be=m.useCallback((je=!0)=>{requestAnimationFrame(()=>{var W;(W=oe.current)==null||W.scrollIntoView(je?{behavior:"smooth"}:void 0)})},[]),et=m.useMemo(()=>Hq(e),[e]),pt=m.useMemo(()=>Kq(e),[e]),Pt=m.useMemo(()=>{for(let je=e.length-1;je>=0;je--)if(e[je].toolName==="propose_hypotheses"&&!e[je].isStreaming)return e[je].id;return null},[e]),Vt=m.useMemo(()=>{const je=e.filter(W=>!W.hidden);for(let W=je.length-1;W>=0;W--){if(je[W].role==="assistant")return je[W].id;if(je[W].role==="user")return null}return null},[e]),ut=m.useMemo(()=>{if(!Pt)return!1;const je=e.findIndex(se=>se.id===Pt);if(je<0)return!1;const W=e.slice(je+1);return!!(W.some(se=>se.toolName==="deep_search")||W.some(se=>se.role==="user"&&se.content.includes("confirmed hypotheses"))||C!=null&&C.some(se=>se.id==="deep_search"&&(se.status==="in_progress"||se.status==="done")))},[e,Pt,C]);m.useEffect(()=>{const je=re.current;if(je){if(D.current){const W=je.scrollHeight-D.current;W>0&&(je.scrollTop+=W),D.current=0}else if(ee.current&&e.length>0)ee.current=!1,te.current=!1,Be(!1);else if(G.current===0&&e.length>0)te.current=!1,Be(!1);else if(e.length>G.current){const W=e[e.length-1];(W==null?void 0:W.role)==="user"?(te.current=!1,Be(!1)):te.current||Be(!0)}else te.current||Be(!0);G.current=e.length}},[e,Be]),m.useEffect(()=>{if(Z.current){if(te.current){Z.current=!1,ce.current&&(clearTimeout(ce.current),ce.current=null);return}e.length!==0&&(Be(!1),ce.current&&clearTimeout(ce.current),ce.current=setTimeout(()=>{Z.current=!1,ce.current=null},180))}},[e.length,C==null?void 0:C.length,P==null?void 0:P.phase,P==null?void 0:P.hypotheses.length,P==null?void 0:P.currentAction,n,Be]);const tt=m.useCallback(()=>{const je=re.current;if(!je)return;const{scrollTop:W,scrollHeight:se,clientHeight:Te}=je,pe=se-W-Te;te.current=pe>300,te.current&&(Z.current=!1,ce.current&&(clearTimeout(ce.current),ce.current=null)),!(!a||s||!u)&&je.scrollTop<80&&(D.current=je.scrollHeight,u())},[a,s,u]);return l.jsxs("div",{className:"flex-1 flex flex-col h-full bg-white",children:[l.jsx("div",{className:"absolute top-4 right-16 z-30",children:l.jsxs("div",{className:U("flex items-center gap-1.5 px-2 py-1 rounded-full text-xs font-medium transition-colors",i?"bg-green-50 text-green-600":r==="connecting"?"bg-yellow-50 text-yellow-600":"bg-red-50 text-red-600"),children:[i?l.jsx(xw,{className:"w-3 h-3"}):r==="connecting"?l.jsx(Ie,{className:"w-3 h-3 animate-spin"}):l.jsx(vB,{className:"w-3 h-3"}),l.jsx("span",{children:i?"Connected":r==="connecting"?"Connecting...":"Disconnected"})]})}),l.jsx("div",{ref:re,className:"flex-1 overflow-y-auto px-4 lg:px-8 py-8",onScroll:tt,children:l.jsxs("div",{className:"max-w-5xl mx-auto space-y-8",children:[n?l.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-gray-400",children:[l.jsx(Ie,{className:"w-8 h-8 animate-spin text-gray-300 mb-4"}),l.jsx("p",{className:"text-sm",children:"Loading messages..."})]}):e.length===0?l.jsx(Bq,{systemStatus:B??null,onSendPrompt:o,onNavigateModels:ae??(()=>{}),onNavigateCredentials:Q??(()=>{}),isAdmin:O}):l.jsxs(l.Fragment,{children:[s&&l.jsx("div",{className:"flex justify-center py-2",children:l.jsx(Ie,{className:"w-4 h-4 animate-spin text-gray-400"})}),!a&&e.length>0&&l.jsx("div",{className:"flex justify-center",children:l.jsx("span",{className:"text-xs font-semibold text-gray-400 bg-gray-100 px-3 py-1 rounded-full",children:"Start of conversation"})}),e.filter(je=>!je.hidden).map(je=>l.jsx(eG,{message:je,sendRpc:d,skills:p,editingSkill:g,onEditSkill:y,onSkillSaved:v,skillStatus:et.get(je.id),scheduleStatus:pt.get(je.id),onOpenSkillPanel:b,onOpenSchedulePanel:w,updateMessageMeta:k,isInPanel:(S==null?void 0:S.id)===je.id,investigationProgress:P,sendMessage:o,abortResponse:c,dpFocus:_,dpChecklistActive:C!=null&&C.length>0,onHypothesesConfirmed:A,hypothesesSuperseded:Pt!=null&&je.toolName==="propose_hypotheses"&&je.id!==Pt,hypothesesAlreadyConfirmed:je.id===Pt&&ut,selectedWorkspaceId:H,showSuggestedReplies:je.id===Vt&&!t,onChipClick:W=>{be(se=>se+1),R(W+" ")}},je.id)),C&&C.length>0&&l.jsx(Rq,{items:C,investigationProgress:P,onDismiss:M}),t&&l.jsx(Gq,{}),le&&l.jsxs("div",{className:U("text-center text-xs text-gray-400 py-2 transition-opacity duration-500",le?"opacity-100":"opacity-0"),children:["Was this helpful? Tap ",l.jsx("span",{className:"font-medium text-gray-500",children:"+"})," below to share feedback"]})]}),l.jsx("div",{ref:oe})]})}),l.jsx(bq,{onSend:o,onAbort:c,disabled:!i,isLoading:t,contextUsage:f,isCompacting:h,editingSkill:g,onClearEditSkill:x,pendingMessages:j,onRemovePending:N,dpFocus:_,dpActive:T,onSetDpActive:E,hasMessages:e.length>0,draft:Y,draftSeq:ne})]})}function Gq(){const[e,t]=m.useState(0),[n,r]=m.useState(!0);return m.useEffect(()=>{const i=setInterval(()=>{r(!1),setTimeout(()=>{t(a=>(a+1)%JN.length),r(!0)},300)},8e3);return()=>clearInterval(i)},[]),l.jsxs("div",{className:"flex gap-4",children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-white border border-gray-200 flex items-center justify-center text-primary-600 shadow-sm",children:l.jsx(mo,{className:"w-5 h-5"})}),l.jsxs("div",{className:"flex items-center gap-2 text-gray-400",children:[l.jsx(Ie,{className:"w-4 h-4 animate-spin"}),l.jsx("span",{className:U("text-sm transition-opacity duration-300",n?"opacity-100":"opacity-0"),children:JN[e]})]})]})}function Yq(e){const t=[],n=/\[User Script: ([^\s]+) \((\w+)\)\]\n*/g,r=e.replace(n,(i,a,s)=>(t.push({name:a,lang:s}),"")).trim();return{scripts:t,text:r}}function Xq(e){const t=e.match(/\[Skill: ([^\]]+)\]\n*/);if(t)return{skillName:t[1],text:e.replace(t[0],"").trim()};const n=e.match(/\[Editing Skill: ([^\]]+)\]\n(?:.*\n)*?---\n*/);return n?{skillName:n[1],text:e.replace(n[0],"").trim()}:{skillName:null,text:e}}function Zq(e){const t=e.match(/\[Deep Investigation\]\n*/);return t?{isDeepInvestigation:!0,text:e.replace(t[0],"").trim()}:{isDeepInvestigation:!1,text:e}}function Qq(e){const t=[],n=/[-*]\s+\*\*([A-Za-z\d]+)\.\*\*\s+(.+?)(?:\s+[—\-–]\s+.*)?$/gm;for(const a of e.matchAll(n))t.push({key:a[1],label:a[2].trim()});if(t.length>=2&&t.length<=8)return t;const r=[],i=/^([A-Z])\.\s+(.+?)(?:\s+[—\-–]\s+.*)?$/gm;for(const a of e.matchAll(i))r.push({key:a[1],label:a[2].trim()});return r.length>=2&&r.length<=8?r:[]}function Jq(e){const t=e.match(/<!--\s*suggested-replies:\s*(.*?)\s*-->/);if(t){const r=[];for(const a of t[1].split(",")){const s=a.trim();if(!s)continue;const o=s.indexOf("|");o>0?r.push({key:s.slice(0,o).trim(),label:s.slice(o+1).trim()}):r.push({key:s,label:s})}const i=e.replace(/<!--\s*suggested-replies:\s*.*?\s*-->/,"").trimEnd();return{replies:r,text:i}}const n=Qq(e);return n.length>0?{replies:n,text:e}:{replies:[],text:e}}function eG({message:e,skills:t,onEditSkill:n,skillStatus:r,scheduleStatus:i,onOpenSkillPanel:a,onOpenSchedulePanel:s,sendRpc:o,updateMessageMeta:c,investigationProgress:u,sendMessage:d,abortResponse:f,dpFocus:h,dpChecklistActive:p,onHypothesesConfirmed:g,hypothesesSuperseded:y,hypothesesAlreadyConfirmed:x,selectedWorkspaceId:v,showSuggestedReplies:b,onChipClick:w}){const S=e.role==="user",k=e.role==="tool";if(k)return mu(e.toolName)&&!e.isStreaming?l.jsx(wq,{message:e,status:r??"pending",onOpenPanel:a}):e.toolName==="manage_schedule"&&!e.isStreaming?l.jsx(Sq,{message:e,status:i??"pending",onOpenPanel:s,sendRpc:o,updateMessageMeta:c,selectedWorkspaceId:v}):e.toolName==="deep_search"?e.isStreaming&&(h||p)?null:l.jsx(Eq,{message:e,progress:e.isStreaming?u:void 0,sendMessage:d,updateMessageMeta:c}):e.toolName==="propose_hypotheses"&&!e.isStreaming?l.jsx(Oq,{message:e,sendMessage:d,abortResponse:f,onHypothesesConfirmed:g,superseded:y,alreadyConfirmed:x}):l.jsx(tG,{message:e,skills:t,onEditSkill:n});const{isDeepInvestigation:j,text:N}=S?Zq(e.content):{isDeepInvestigation:!1,text:e.content},{scripts:P,text:T}=S?Yq(N):{scripts:[],text:N},{skillName:E,text:_}=S?Xq(T):{skillName:null,text:T},C=!S&&!k?_.replace(/<!--\s*suggested-replies:\s*.*?\s*-->/g,"").trimEnd():_,{replies:A,text:M}=!S&&!k&&b&&!e.isStreaming?Jq(_):{replies:[],text:C};return l.jsxs("div",{className:U("flex gap-4 group",S?"flex-row-reverse":"flex-row"),children:[l.jsx("div",{className:U("w-8 h-8 rounded-full flex items-center justify-center shrink-0 shadow-sm border",S?"bg-primary-600 border-primary-600 text-white":"bg-white border-gray-200 text-primary-600"),children:S?l.jsx(Wu,{className:"w-4 h-4"}):l.jsx(mo,{className:"w-5 h-5"})}),l.jsxs("div",{className:U("flex flex-col min-w-0",S?"items-end":"items-start"),children:[l.jsxs("div",{className:"flex items-baseline gap-2 mb-1",children:[l.jsx("span",{className:"text-sm font-semibold text-gray-900",children:S?"You":"Siclaw"}),l.jsx("span",{className:"text-xs text-gray-400",children:e.timestamp}),e.isStreaming&&!S&&l.jsx(Ie,{className:"w-3 h-3 animate-spin text-gray-400"})]}),(j||E||P.length>0)&&l.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:[j&&l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-xs font-medium text-blue-700",children:[l.jsx(Bu,{className:"w-3.5 h-3.5 text-blue-500"}),l.jsx("span",{children:"Deep Investigation"}),h&&l.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 text-[10px] font-semibold uppercase",children:h})]}),E&&l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-indigo-50 border border-indigo-200 text-xs font-medium text-indigo-700",children:[l.jsx(cs,{className:"w-3.5 h-3.5 text-indigo-500"}),l.jsx("span",{children:E})]}),P.map((B,ae)=>l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-primary-50 border border-primary-200 text-xs font-medium text-primary-800",children:[B.lang==="python"?l.jsx(Ga,{className:"w-3.5 h-3.5 text-blue-600"}):l.jsx(ai,{className:"w-3.5 h-3.5 text-green-600"}),l.jsx("span",{children:B.name})]},ae))]}),M&&l.jsx("div",{className:U("px-5 py-3.5 rounded-2xl text-[15px] leading-relaxed shadow-sm max-w-3xl min-w-0 overflow-hidden",S?"bg-primary-600 text-white rounded-tr-sm [&_pre]:bg-black/20 [&_pre]:text-white [&_code]:bg-white/15 [&_code]:text-white [&_a]:text-blue-200":"bg-white border border-gray-200 text-gray-800 rounded-tl-sm"),children:l.jsx(Ed,{children:M})}),A.length>0&&w&&l.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:A.map(B=>l.jsxs("button",{type:"button",onClick:()=>w(B.key),className:"rounded-full px-3 py-1.5 text-sm border border-gray-200 bg-white hover:bg-gray-50 text-gray-700 transition-colors cursor-pointer",children:[l.jsxs("span",{className:"font-medium text-gray-500",children:[B.key,"."]})," ",B.label]},B.key))})]})]})}function tG({message:e,skills:t,onEditSkill:n}){const[r,i]=m.useState(!1),a=e.isStreaming||r,s=(()=>{if(e.toolName!=="run_skill"||!t||!n)return null;const o=e.toolInput;return o?t.find(c=>c.scope==="personal"&&(c.name===o||c.dirName===o))??null:null})();return l.jsx("div",{className:"pl-12 min-w-0",children:l.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm overflow-hidden",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2 bg-gray-50 border-b border-gray-200 hover:bg-gray-100 transition-colors cursor-pointer text-left min-w-0",onClick:()=>i(!r),children:[l.jsx(ua,{className:U("w-3.5 h-3.5 text-gray-400 transition-transform shrink-0",a&&"rotate-90")}),l.jsx(ai,{className:"w-4 h-4 text-gray-500 shrink-0"}),l.jsx("span",{className:"font-mono text-xs font-semibold text-gray-700 shrink-0",children:e.toolName}),e.toolInput&&l.jsx("span",{className:"font-mono text-xs text-gray-500 truncate min-w-0",children:e.toolInput}),e.toolStatus==="running"&&l.jsx(Ie,{className:"w-3 h-3 animate-spin text-blue-400 ml-auto shrink-0"}),e.toolStatus==="success"&&l.jsx(br,{className:"w-3.5 h-3.5 text-green-500 ml-auto shrink-0"}),e.toolStatus==="error"&&l.jsx(vs,{className:"w-3.5 h-3.5 text-red-500 ml-auto shrink-0"}),e.toolStatus==="aborted"&&l.jsx(GO,{className:"w-3.5 h-3.5 text-amber-500 ml-auto shrink-0"}),s&&!e.isStreaming&&l.jsx("span",{className:"ml-auto shrink-0 p-1 rounded hover:bg-indigo-100 text-gray-400 hover:text-indigo-600 transition-colors",title:"Edit this skill",onClick:o=>{o.stopPropagation(),n(String(s.id),s.name)},children:l.jsx(kd,{className:"w-3.5 h-3.5"})})]}),a&&l.jsxs("div",{className:"overflow-x-auto bg-slate-50 max-h-80 overflow-y-auto",children:[e.toolInput&&l.jsx("div",{className:"px-4 pt-3 pb-2 border-b border-slate-200",children:l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-slate-800 whitespace-pre-wrap break-all",children:e.toolInput})}),l.jsx("div",{className:"p-4",children:l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-slate-600 whitespace-pre-wrap",children:e.content||(e.toolStatus==="aborted"?"Aborted.":"Running...")})})]})]})})}class nG{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const a=this.castInput(t,r),s=this.castInput(n,r),o=this.removeEmpty(this.tokenize(a,r)),c=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(o,c,r,i)}diffWithOptionsObj(t,n,r,i){var a;const s=b=>{if(b=this.postProcess(b,r),i){setTimeout(function(){i(b)},0);return}else return b},o=n.length,c=t.length;let u=1,d=o+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const f=(a=r.timeout)!==null&&a!==void 0?a:1/0,h=Date.now()+f,p=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(p[0],n,t,0,r);if(p[0].oldPos+1>=c&&g+1>=o)return s(this.buildValues(p[0].lastComponent,n,t));let y=-1/0,x=1/0;const v=()=>{for(let b=Math.max(y,-u);b<=Math.min(x,u);b+=2){let w;const S=p[b-1],k=p[b+1];S&&(p[b-1]=void 0);let j=!1;if(k){const P=k.oldPos-b;j=k&&0<=P&&P<o}const N=S&&S.oldPos+1<c;if(!j&&!N){p[b]=void 0;continue}if(!N||j&&S.oldPos<k.oldPos?w=this.addToPath(k,!0,!1,0,r):w=this.addToPath(S,!1,!0,1,r),g=this.extractCommon(w,n,t,b,r),w.oldPos+1>=c&&g+1>=o)return s(this.buildValues(w.lastComponent,n,t))||!0;p[b]=w,w.oldPos+1>=c&&(x=Math.min(x,b-1)),g+1>=o&&(y=Math.max(y,b+1))}u++};if(i)(function b(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);v()||b()},0)})();else for(;u<=d&&Date.now()<=h;){const b=v();if(b)return b}}addToPath(t,n,r,i,a){const s=t.lastComponent;return s&&!a.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,i,a){const s=n.length,o=r.length;let c=t.oldPos,u=c-i,d=0;for(;u+1<s&&c+1<o&&this.equals(r[c+1],n[u+1],a);)u++,c++,d++,a.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!a.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const i=[];let a;for(;t;)i.push(t),a=t.previousComponent,delete t.previousComponent,t=a;i.reverse();const s=i.length;let o=0,c=0,u=0;for(;o<s;o++){const d=i[o];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(h,p){const g=r[u+p];return g.length>h.length?g:h}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}}class rG extends nG{constructor(){super(...arguments),this.tokenize=aG}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
594
|
+
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
595
|
+
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
596
|
+
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
597
|
+
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const iG=new rG;function Ux(e,t,n){return iG.diff(e,t,n)}function aG(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
598
|
+
`));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){const a=r[i];i%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}function sG({message:e,sendRpc:t,skills:n,onSave:r,onDismiss:i,onClose:a,updateMessageMeta:s}){const o=e.metadata,c=o==null?void 0:o.skillCard,u=o==null?void 0:o.reviewStatus,d=c==="saved"||c==="dismissed"?"saved":"idle",[f,h]=m.useState(d),[p,g]=m.useState(""),[y,x]=m.useState(d==="saved"?"Saved":""),[v,b]=m.useState(u),[w,S]=m.useState(null),[k,j]=m.useState(!1),[N,P]=m.useState(new Set),[T,E]=m.useState(!0);let _=null;try{_=JSON.parse(e.content)}catch{}const C=_==null?void 0:_.skill,A=e.toolName==="update_skill",M=e.toolName==="fork_skill"||!!(_!=null&&_.fork),B=C?n.find(Z=>Z.name===C.name&&Z.scope==="personal")??n.find(Z=>Z.name===C.name)??(_!=null&&_.skillId?n.find(Z=>Z.name===_.skillId&&Z.scope==="personal")??n.find(Z=>Z.name===_.skillId):void 0):void 0,ae=M?n.find(Z=>Z.name===((_==null?void 0:_.sourceSkillName)??(C==null?void 0:C.name))&&Z.scope!=="personal")??n.find(Z=>Z.name===((_==null?void 0:_.sourceSkillName)??(C==null?void 0:C.name))):void 0,Q=B?String(B.id):(_==null?void 0:_.skillId)||void 0,I=!A&&!M?B:void 0,H=!!I;m.useEffect(()=>{(c==="saved"||c==="dismissed")&&(h("saved"),x(c==="saved"?"Saved":"Dismissed"))},[c]),m.useEffect(()=>{const Z=A?Q:M&&ae?String(ae.id):void 0;!Z||!t||(j(!0),t("skill.get",{id:Z}).then(ce=>{S(ce.files??null)}).catch(()=>S(null)).finally(()=>j(!1)))},[A,M,Q,ae,t]);const O=A||M&&!!w,oe=m.useMemo(()=>{if(!O||!(C!=null&&C.specs)||!(w!=null&&w.specs))return null;const Z=Ux(w.specs??"",C.specs??"");return Z.every(ce=>!ce.added&&!ce.removed)?null:Z},[O,C==null?void 0:C.specs,w==null?void 0:w.specs]),re=m.useMemo(()=>{if(!O||!(C!=null&&C.scripts))return null;const Z=new Map(((w==null?void 0:w.scripts)??[]).map(J=>[J.name,J.content])),ce=[];for(const J of C.scripts){const ne=Z.get(J.name);if(!ne)ce.push({name:J.name,status:"new"});else{const be=Ux(ne??"",J.content??""),Y=be.some(R=>R.added||R.removed);ce.push({name:J.name,status:Y?"changed":"unchanged",changes:Y?be:void 0})}}return ce},[A,C==null?void 0:C.scripts,w==null?void 0:w.scripts]),D=A&&oe===null&&(re==null?void 0:re.every(Z=>Z.status==="unchanged")),G=()=>{if(!C)return"";let Z=2,ce=`${C.name}-${Z}`;for(;n.some(J=>J.name===ce);)Z++,ce=`${C.name}-${Z}`;return ce},te=async Z=>{var ce;if(C){h("saving"),g(""),x("");try{const J=(ce=C.scripts)==null?void 0:ce.map(be=>({name:be.name,content:be.content}));let ne;if(M&&Z!=="create-new-name"){const be=ae?String(ae.id):void 0;if(!be)throw new Error(`Source skill "${(_==null?void 0:_.sourceSkillName)??C.name}" not found`);ne=(await t("skill.fork",{sourceId:be,name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:J})).reviewStatus,x("Forked to Personal")}else if(Z==="update")B&&B.scope!=="personal"?(ne=(await t("skill.fork",{sourceId:String(B.id),name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:J})).reviewStatus,x("Saved to Personal")):(ne=(await t("skill.update",{id:Q,name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:J})).reviewStatus,x("Updated"));else if(Z==="update-existing"&&I)I.scope==="personal"?(ne=(await t("skill.update",{id:String(I.id),name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:J})).reviewStatus,x("Updated")):(ne=(await t("skill.fork",{sourceId:String(I.id),name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:J})).reviewStatus,x("Saved to Personal"));else if(Z==="create-new-name"){const be=G();ne=(await t("skill.create",{name:be,description:C.description,type:C.type,specs:C.specs,scripts:J})).reviewStatus,x(`Saved as "${be}"`)}else ne=(await t("skill.create",{name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:J})).reviewStatus,x("Saved");b(ne),h("saved"),await s(e.id,{skillCard:"saved",reviewStatus:ne}),r(e)}catch(J){h("error"),g((J==null?void 0:J.message)||"Failed to save skill")}}},ee=async()=>{await s(e.id,{skillCard:"dismissed"}),i(e)};return C?l.jsxs("div",{className:"w-[480px] border-l border-gray-200 bg-white flex flex-col shrink-0 h-full",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 bg-gradient-to-r from-indigo-50 to-purple-50 flex items-center justify-between shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(cs,{className:"w-4 h-4 text-indigo-600 shrink-0"}),l.jsx("span",{className:"font-semibold text-sm text-gray-900 truncate",children:C.name}),C.type&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium bg-indigo-100 text-indigo-700 shrink-0",children:[l.jsx(yw,{className:"w-2.5 h-2.5"}),C.type]})]}),l.jsx("button",{onClick:a,className:"p-1 rounded hover:bg-white/60 transition-colors shrink-0",children:l.jsx(Qe,{className:"w-4 h-4 text-gray-500"})})]}),C.description&&l.jsx("div",{className:"px-4 py-2 border-b border-gray-100 text-xs text-gray-600",children:C.description}),l.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:k?l.jsxs("div",{className:"flex items-center justify-center py-12 text-gray-400",children:[l.jsx(Ie,{className:"w-5 h-5 animate-spin mr-2"}),l.jsx("span",{className:"text-sm",children:"Loading current version..."})]}):D?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-gray-400",children:[l.jsx(_n,{className:"w-8 h-8 mb-2 text-green-400"}),l.jsx("span",{className:"text-sm font-medium text-green-600",children:"Already up to date"}),l.jsx("span",{className:"text-xs text-gray-400 mt-1",children:"No changes detected"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"border-b border-gray-100",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2.5 hover:bg-gray-50 transition-colors text-left",onClick:()=>E(!T),children:[l.jsx(ua,{className:U("w-3.5 h-3.5 text-gray-400 transition-transform",T&&"rotate-90")}),l.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"SKILL.md"}),A&&oe&&l.jsx("span",{className:"ml-auto text-[10px] font-medium text-amber-600 bg-amber-50 px-1.5 py-0.5 rounded",children:"changed"})]}),T&&l.jsx("div",{className:"px-4 pb-3 max-h-96 overflow-y-auto",children:A&&oe?l.jsx(e2,{changes:oe}):l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-gray-600 whitespace-pre-wrap",children:C.specs})})]}),C.scripts&&C.scripts.length>0&&l.jsxs("div",{className:"border-b border-gray-100",children:[l.jsx("div",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Scripts"})}),C.scripts.map((Z,ce)=>{const J=re==null?void 0:re[ce],ne=N.has(Z.name);return l.jsxs("div",{className:"border-t border-gray-50",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2 hover:bg-gray-50 transition-colors text-left",onClick:()=>P(be=>{const Y=new Set(be);return Y.has(Z.name)?Y.delete(Z.name):Y.add(Z.name),Y}),children:[l.jsx(ua,{className:U("w-3 h-3 text-gray-400 transition-transform",ne&&"rotate-90")}),Z.name.endsWith(".py")?l.jsx(Ga,{className:"w-3.5 h-3.5 text-blue-500"}):l.jsx(ai,{className:"w-3.5 h-3.5 text-green-500"}),l.jsx("span",{className:"text-xs font-mono text-gray-700",children:Z.name}),J&&l.jsx("span",{className:U("ml-auto text-[10px] font-medium px-1.5 py-0.5 rounded",J.status==="new"?"text-green-600 bg-green-50":J.status==="changed"?"text-amber-600 bg-amber-50":"text-gray-400 bg-gray-50"),children:J.status})]}),ne&&l.jsx("div",{className:"px-4 pb-3 max-h-64 overflow-y-auto",children:J!=null&&J.changes?l.jsx(e2,{changes:J.changes}):l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-gray-600 whitespace-pre-wrap",children:Z.content})})]},Z.name)})]})]})}),f==="idle"&&H&&l.jsxs("div",{className:"px-4 py-2 bg-amber-50 border-t border-amber-200 flex items-start gap-2 shrink-0",children:[l.jsx(si,{className:"w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5"}),l.jsxs("span",{className:"text-xs text-amber-800",children:["A ",I.scope," skill named ",l.jsxs("strong",{children:['"',C.name,'"']})," already exists."]})]}),f==="saved"&&v==="draft"&&l.jsxs("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-200 flex items-start gap-2 shrink-0",children:[l.jsx(Nm,{className:"w-3.5 h-3.5 text-gray-400 shrink-0 mt-0.5"}),l.jsx("span",{className:"text-xs text-gray-600",children:"Saved as draft. Available in test workspaces. Request publish to use in production."})]}),f==="saved"&&(v==="pending"||v==="staged")&&l.jsxs("div",{className:"px-4 py-2 bg-amber-50 border-t border-amber-200 flex items-start gap-2 shrink-0",children:[l.jsx(si,{className:"w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5"}),l.jsx("span",{className:"text-xs text-amber-800",children:"Awaiting admin approval. You can switch to a test workspace to debug this skill immediately."})]}),l.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-gray-50/80 flex items-center justify-between shrink-0",children:[l.jsx("button",{onClick:ee,disabled:f==="saving",className:"px-3 py-1.5 rounded-lg text-xs font-medium text-gray-600 hover:bg-gray-200 transition-colors",children:"Dismiss"}),l.jsxs("div",{className:"flex items-center gap-2",children:[f==="idle"&&!D&&(()=>{if(M&&ae){const Z=n.some(ce=>ce.name===C.name&&ce.scope==="personal");return l.jsxs("button",{onClick:()=>te(Z?"create-new-name":"create"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-purple-600 text-white hover:bg-purple-700 transition-colors shadow-sm",children:[l.jsx(cw,{className:"w-3.5 h-3.5"}),"Fork to Personal"]})}if(A&&Q){const Z=B&&B.scope!=="personal";return l.jsx("button",{onClick:()=>te("update"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-indigo-600 text-white hover:bg-indigo-700 transition-colors shadow-sm",children:Z?l.jsxs(l.Fragment,{children:[l.jsx(Cx,{className:"w-3.5 h-3.5"})," Save to Personal"]}):l.jsxs(l.Fragment,{children:[l.jsx(In,{className:"w-3.5 h-3.5"})," Update Skill"]})})}return H?l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>te("update-existing"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-amber-600 text-white hover:bg-amber-700 transition-colors shadow-sm",children:I.scope==="personal"?l.jsxs(l.Fragment,{children:[l.jsx(In,{className:"w-3.5 h-3.5"})," Update Existing"]}):l.jsxs(l.Fragment,{children:[l.jsx(Cx,{className:"w-3.5 h-3.5"})," Save to Personal"]})}),l.jsx("button",{onClick:()=>te("create-new-name"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-gray-700 hover:bg-gray-100 border border-gray-300 transition-colors",children:"Save as New"})]}):l.jsxs("button",{onClick:()=>te("create"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-indigo-600 text-white hover:bg-indigo-700 transition-colors shadow-sm",children:[l.jsx(In,{className:"w-3.5 h-3.5"}),"Save Skill"]})})(),f==="idle"&&D&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-green-600",children:[l.jsx(_n,{className:"w-3.5 h-3.5"}),"Up to date"]}),f==="saving"&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-indigo-600",children:[l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin"}),"Saving..."]}),f==="saved"&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-green-600",children:[l.jsx(_n,{className:"w-3.5 h-3.5"}),y||"Saved"]}),f==="error"&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-red-600",children:[l.jsx($u,{className:"w-3.5 h-3.5"}),p]}),l.jsx("button",{onClick:()=>{h("idle"),g("")},className:"px-2.5 py-1 rounded-lg text-xs font-medium text-red-600 hover:bg-red-50 border border-red-200 transition-colors",children:"Retry"})]})]})]})]}):l.jsx("div",{className:"w-[480px] border-l border-gray-200 bg-white flex flex-col shrink-0",children:l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Invalid skill data"}),l.jsx("button",{onClick:a,className:"p-1 rounded hover:bg-gray-100",children:l.jsx(Qe,{className:"w-4 h-4 text-gray-400"})})]})})}function e2({changes:e}){return l.jsx("pre",{className:"text-xs font-mono leading-relaxed whitespace-pre-wrap",children:e.map((t,n)=>l.jsx("span",{className:U(t.added&&"bg-green-100 text-green-800",t.removed&&"bg-red-100 text-red-800 line-through",!t.added&&!t.removed&&"text-gray-500"),children:t.value},n))})}async function Oc(e,t,n){try{const r=await e("cron.list");if(t)return r.jobs.find(i=>i.id===t)??null;if(n){const i=n.toLowerCase(),a=r.jobs.find(c=>c.name===n);if(a)return a;const s=r.jobs.find(c=>c.name.toLowerCase()===i);if(s)return s;const o=r.jobs.find(c=>c.name.toLowerCase().includes(i)||i.includes(c.name.toLowerCase()));if(o)return o}return r.jobs.length===1?r.jobs[0]:null}catch{return null}}function oG({message:e,sendRpc:t,onSave:n,onDismiss:r,onClose:i,updateMessageMeta:a,selectedWorkspaceId:s}){var G;const o=(G=e.metadata)==null?void 0:G.scheduleCard,c=o==="saved"||o==="dismissed"?"saved":"idle",[u,d]=m.useState(c),[f,h]=m.useState(""),[p,g]=m.useState(null),[y,x]=m.useState(!1),[v,b]=m.useState(!0),[w,S]=m.useState(!0);let k=null;try{k=JSON.parse(e.content)}catch{}const j=k==null?void 0:k.action,N=k==null?void 0:k.schedule,P=j==="create",T=j==="update",E=j==="delete",_=j==="pause",C=j==="resume",A=j==="rename",M=A?(k==null?void 0:k.name)||(k==null?void 0:k.id)||"...":(N==null?void 0:N.name)||(k==null?void 0:k.name)||(k==null?void 0:k.id)||"...";m.useEffect(()=>{(o==="saved"||o==="dismissed")&&d("saved")},[o]);const B=m.useRef(!1);m.useEffect(()=>{if(B.current||u!=="idle")return;const te=e.metadata;te!=null&&te.scheduleCard||(_||C)&&(B.current=!0,O())},[_,C,u]),m.useEffect(()=>{!T||!t||(x(!0),Oc(t,k==null?void 0:k.id,(k==null?void 0:k.name)??(N==null?void 0:N.name)).then(te=>g(te)).catch(()=>g(null)).finally(()=>x(!1)))},[T,k==null?void 0:k.id,k==null?void 0:k.name,N==null?void 0:N.name,t]);const ae=T&&p&&N&&p.schedule!==N.schedule,Q=T&&p&&N&&p.status!==N.status,I=m.useMemo(()=>{if(!T||!p||!N)return null;const te=p.description??"",ee=N.description??"";if(te===ee)return null;const Z=Ux(te,ee);return Z.every(ce=>!ce.added&&!ce.removed)?null:Z},[T,p,N]),H=T&&p&&!ae&&!Q&&!I,O=async()=>{if(k){if(!s){d("error"),h("Please select a workspace first");return}d("saving"),h("");try{if(P&&N)await t("cron.save",{name:N.name,description:N.description,schedule:N.schedule,status:N.status||"active",workspaceId:s??null});else if(T&&N){const te=await Oc(t,k.id,k.name);if(!te)throw new Error("Schedule not found");await t("cron.save",{id:te.id,name:N.name,description:N.description,schedule:N.schedule,status:N.status||"active",workspaceId:s??null})}else if(E){const te=await Oc(t,k.id,k.name);if(!te)throw new Error("Schedule not found");await t("cron.delete",{id:te.id})}else if(_||C){const te=await Oc(t,k.id,k.name);if(!te)throw new Error("Schedule not found");await t("cron.setStatus",{id:te.id,status:_?"paused":"active"})}else if(A){const te=await Oc(t,k.id,k.name);if(!te)throw new Error("Schedule not found");await t("cron.rename",{id:te.id,newName:k.newName})}d("saved"),await a(e.id,{scheduleCard:"saved"}),n(e)}catch(te){d("error"),h((te==null?void 0:te.message)||"Operation failed")}}},oe=async()=>{await a(e.id,{scheduleCard:"dismissed"}),r(e)};if(!k||k.error)return l.jsx("div",{className:"w-[480px] border-l border-gray-200 bg-white flex flex-col shrink-0",children:l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Invalid schedule data"}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-gray-100",children:l.jsx(Qe,{className:"w-4 h-4 text-gray-400"})})]})});const re=lG(j);return _||C?l.jsxs("div",{className:"w-[320px] border-l border-gray-200 bg-white flex flex-col shrink-0",children:[l.jsxs("div",{className:U("px-4 py-3 border-b border-gray-200 bg-gradient-to-r flex items-center justify-between shrink-0",re.gradient),children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(us,{className:U("w-4 h-4 shrink-0",re.iconColor)}),l.jsx("span",{className:"font-semibold text-sm text-gray-900 truncate",children:M})]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-white/60 transition-colors shrink-0",children:l.jsx(Qe,{className:"w-4 h-4 text-gray-500"})})]}),l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-4",children:[u==="saving"&&l.jsxs(l.Fragment,{children:[l.jsx(Ie,{className:U("w-8 h-8 mb-3 animate-spin",re.iconColor)}),l.jsx("span",{className:"text-sm text-gray-600",children:_?"Pausing...":"Resuming..."})]}),u==="saved"&&l.jsxs(l.Fragment,{children:[l.jsx(_n,{className:"w-8 h-8 mb-3 text-green-500"}),l.jsx("span",{className:"text-sm font-medium text-green-600",children:_?"Schedule paused":"Schedule resumed"})]}),u==="error"&&l.jsxs(l.Fragment,{children:[l.jsx($u,{className:"w-8 h-8 mb-3 text-red-500"}),l.jsx("span",{className:"text-sm font-medium text-red-600",children:f}),l.jsx("button",{onClick:()=>{d("idle"),h(""),B.current=!1},className:"mt-3 px-3 py-1.5 rounded-lg text-xs font-medium text-red-600 hover:bg-red-50 border border-red-200",children:"Retry"})]}),u==="idle"&&l.jsxs(l.Fragment,{children:[l.jsx(Ie,{className:U("w-8 h-8 mb-3 animate-spin",re.iconColor)}),l.jsx("span",{className:"text-sm text-gray-500",children:"Preparing..."})]})]})]}):l.jsxs("div",{className:"w-[480px] border-l border-gray-200 bg-white flex flex-col shrink-0 h-full",children:[l.jsxs("div",{className:U("px-4 py-3 border-b border-gray-200 bg-gradient-to-r flex items-center justify-between shrink-0",re.gradient),children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(us,{className:U("w-4 h-4 shrink-0",re.iconColor)}),l.jsx("span",{className:"font-semibold text-sm text-gray-900 truncate",children:M}),l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium shrink-0",re.badgeColor),children:[l.jsx(yw,{className:"w-2.5 h-2.5"}),re.badge]})]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-white/60 transition-colors shrink-0",children:l.jsx(Qe,{className:"w-4 h-4 text-gray-500"})})]}),k.summary&&l.jsx("div",{className:"px-4 py-2 border-b border-gray-100 text-xs text-gray-600",children:k.summary}),l.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:y?l.jsxs("div",{className:"flex items-center justify-center py-12 text-gray-400",children:[l.jsx(Ie,{className:"w-5 h-5 animate-spin mr-2"}),l.jsx("span",{className:"text-sm",children:"Loading current version..."})]}):H?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-gray-400",children:[l.jsx(_n,{className:"w-8 h-8 mb-2 text-green-400"}),l.jsx("span",{className:"text-sm font-medium text-green-600",children:"Already up to date"}),l.jsx("span",{className:"text-xs text-gray-400 mt-1",children:"No changes detected"})]}):l.jsxs(l.Fragment,{children:[(N||A)&&l.jsxs("div",{className:"border-b border-gray-100",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2.5 hover:bg-gray-50 transition-colors text-left",onClick:()=>b(!v),children:[l.jsx(ua,{className:U("w-3.5 h-3.5 text-gray-400 transition-transform",v&&"rotate-90")}),l.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Schedule"}),T&&(ae||Q)&&l.jsx("span",{className:"ml-auto text-[10px] font-medium text-amber-600 bg-amber-50 px-1.5 py-0.5 rounded",children:"changed"})]}),v&&l.jsxs("div",{className:"px-4 pb-3 space-y-3",children:[N&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-medium text-gray-400 uppercase tracking-wider",children:"Cron Expression"}),T&&ae&&p?l.jsxs("div",{className:"mt-1 space-y-1",children:[l.jsx("div",{className:"font-mono text-xs bg-red-50 text-red-700 px-2 py-1 rounded line-through",children:p.schedule}),l.jsx("div",{className:"font-mono text-xs bg-green-50 text-green-700 px-2 py-1 rounded",children:N.schedule})]}):l.jsx("div",{className:"font-mono text-xs text-gray-700 bg-gray-50 px-2 py-1 rounded mt-1",children:N.schedule})]}),N&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-medium text-gray-400 uppercase tracking-wider",children:"Status"}),T&&Q&&p?l.jsxs("div",{className:"mt-1 space-y-1",children:[l.jsx("div",{className:"text-xs bg-red-50 text-red-700 px-2 py-1 rounded line-through",children:p.status}),l.jsx("div",{className:"text-xs bg-green-50 text-green-700 px-2 py-1 rounded",children:N.status})]}):l.jsx("div",{className:"text-xs text-gray-700 bg-gray-50 px-2 py-1 rounded mt-1",children:N.status||"active"})]}),A&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-medium text-gray-400 uppercase tracking-wider",children:"Name"}),l.jsxs("div",{className:"mt-1 space-y-1",children:[l.jsx("div",{className:"text-xs bg-red-50 text-red-700 px-2 py-1 rounded line-through",children:(k==null?void 0:k.name)||(k==null?void 0:k.id)}),l.jsx("div",{className:"text-xs bg-green-50 text-green-700 px-2 py-1 rounded",children:k==null?void 0:k.newName})]})]})]})]}),((N==null?void 0:N.description)||T&&(p==null?void 0:p.description))&&l.jsxs("div",{className:"border-b border-gray-100",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2.5 hover:bg-gray-50 transition-colors text-left",onClick:()=>S(!w),children:[l.jsx(ua,{className:U("w-3.5 h-3.5 text-gray-400 transition-transform",w&&"rotate-90")}),l.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Description"}),I&&l.jsx("span",{className:"ml-auto text-[10px] font-medium text-amber-600 bg-amber-50 px-1.5 py-0.5 rounded",children:"changed"})]}),w&&l.jsx("div",{className:"px-4 pb-3",children:I?l.jsx(cG,{changes:I}):l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-gray-600 whitespace-pre-wrap",children:(N==null?void 0:N.description)||(p==null?void 0:p.description)||""})})]}),E&&!N&&l.jsxs("div",{className:"px-4 py-6 flex flex-col items-center text-center",children:[l.jsx(re.Icon,{className:U("w-8 h-8 mb-3",re.iconColor)}),l.jsx("span",{className:"text-sm text-gray-600",children:"This will permanently delete the schedule."})]})]})}),l.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-gray-50/80 flex items-center justify-between shrink-0",children:[l.jsx("button",{onClick:oe,disabled:u==="saving",className:"px-3 py-1.5 rounded-lg text-xs font-medium text-gray-600 hover:bg-gray-200 transition-colors",children:"Dismiss"}),l.jsxs("div",{className:"flex items-center gap-2",children:[u==="idle"&&!H&&l.jsxs("button",{onClick:O,className:U("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-white transition-colors shadow-sm",re.btnClass),children:[l.jsx(re.Icon,{className:"w-3.5 h-3.5"}),re.label]}),u==="idle"&&H&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-green-600",children:[l.jsx(_n,{className:"w-3.5 h-3.5"}),"Up to date"]}),u==="saving"&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-amber-600",children:[l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin"}),"Processing..."]}),u==="saved"&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-green-600",children:[l.jsx(_n,{className:"w-3.5 h-3.5"}),"Done"]}),u==="error"&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-red-600",children:[l.jsx($u,{className:"w-3.5 h-3.5"}),f]}),l.jsx("button",{onClick:()=>{d("idle"),h("")},className:"px-2.5 py-1 rounded-lg text-xs font-medium text-red-600 hover:bg-red-50 border border-red-200 transition-colors",children:"Retry"})]})]})]})]})}function lG(e){switch(e){case"delete":return{label:"Delete Schedule",Icon:Fn,btnClass:"bg-red-600 hover:bg-red-700",gradient:"from-red-50 to-orange-50",badge:"Delete",badgeColor:"bg-red-100 text-red-700",iconColor:"text-red-500"};case"pause":return{label:"Pause Schedule",Icon:hw,btnClass:"bg-amber-600 hover:bg-amber-700",gradient:"from-amber-50 to-orange-50",badge:"Pause",badgeColor:"bg-amber-100 text-amber-700",iconColor:"text-amber-500"};case"resume":return{label:"Resume Schedule",Icon:Pm,btnClass:"bg-green-600 hover:bg-green-700",gradient:"from-green-50 to-emerald-50",badge:"Resume",badgeColor:"bg-green-100 text-green-700",iconColor:"text-green-500"};case"rename":return{label:"Rename Schedule",Icon:kd,btnClass:"bg-blue-600 hover:bg-blue-700",gradient:"from-blue-50 to-indigo-50",badge:"Rename",badgeColor:"bg-blue-100 text-blue-700",iconColor:"text-blue-500"};case"update":return{label:"Update Schedule",Icon:In,btnClass:"bg-amber-600 hover:bg-amber-700",gradient:"from-amber-50 to-orange-50",badge:"Update",badgeColor:"bg-amber-100 text-amber-700",iconColor:"text-amber-500"};default:return{label:"Save Schedule",Icon:In,btnClass:"bg-amber-600 hover:bg-amber-700",gradient:"from-amber-50 to-yellow-50",badge:"Create",badgeColor:"bg-amber-100 text-amber-700",iconColor:"text-amber-500"}}}function cG({changes:e}){return l.jsx("pre",{className:"text-xs font-mono leading-relaxed whitespace-pre-wrap",children:e.map((t,n)=>l.jsx("span",{className:U(t.added&&"bg-green-100 text-green-800",t.removed&&"bg-red-100 text-red-800 line-through",!t.added&&!t.removed&&"text-gray-500"),children:t.value},n))})}const Uw=m.createContext({});function Vw(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Rm=m.createContext(null),Ww=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class uG extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function dG({children:e,isPresent:t}){const n=m.useId(),r=m.useRef(null),i=m.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=m.useContext(Ww);return m.useInsertionEffect(()=>{const{width:s,height:o,top:c,left:u}=i.current;if(t||!r.current||!s||!o)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return a&&(d.nonce=a),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
|
|
599
|
+
[data-motion-pop-id="${n}"] {
|
|
600
|
+
position: absolute !important;
|
|
601
|
+
width: ${s}px !important;
|
|
602
|
+
height: ${o}px !important;
|
|
603
|
+
top: ${c}px !important;
|
|
604
|
+
left: ${u}px !important;
|
|
605
|
+
}
|
|
606
|
+
`),()=>{document.head.removeChild(d)}},[t]),l.jsx(uG,{isPresent:t,childRef:r,sizeRef:i,children:m.cloneElement(e,{ref:r})})}const fG=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s})=>{const o=Vw(hG),c=m.useId(),u=m.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=m.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:f=>(o.set(f,!1),()=>o.delete(f))}),a?[Math.random(),u]:[n,u]);return m.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),m.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),s==="popLayout"&&(e=l.jsx(dG,{isPresent:n,children:e})),l.jsx(Rm.Provider,{value:d,children:e})};function hG(){return new Map}function b4(e=!0){const t=m.useContext(Rm);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=m.useId();m.useEffect(()=>{e&&i(a)},[e]);const s=m.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,s]:[!0]}const Pf=e=>e.key||"";function t2(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const Hw=typeof window<"u",w4=Hw?m.useLayoutEffect:m.useEffect,Ur=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:s=!1})=>{const[o,c]=b4(s),u=m.useMemo(()=>t2(e),[e]),d=s&&!o?[]:u.map(Pf),f=m.useRef(!0),h=m.useRef(u),p=Vw(()=>new Map),[g,y]=m.useState(u),[x,v]=m.useState(u);w4(()=>{f.current=!1,h.current=u;for(let S=0;S<x.length;S++){const k=Pf(x[S]);d.includes(k)?p.delete(k):p.get(k)!==!0&&p.set(k,!1)}},[x,d.length,d.join("-")]);const b=[];if(u!==g){let S=[...u];for(let k=0;k<x.length;k++){const j=x[k],N=Pf(j);d.includes(N)||(S.splice(k,0,j),b.push(j))}a==="wait"&&b.length&&(S=b),v(t2(S)),y(u);return}const{forceRender:w}=m.useContext(Uw);return l.jsx(l.Fragment,{children:x.map(S=>{const k=Pf(S),j=s&&!o?!1:u===x||d.includes(k),N=()=>{if(p.has(k))p.set(k,!0);else return;let P=!0;p.forEach(T=>{T||(P=!1)}),P&&(w==null||w(),v(h.current),s&&(c==null||c()),r&&r())};return l.jsx(fG,{isPresent:j,initial:!f.current||n?void 0:!1,custom:j?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:j?void 0:N,children:S},k)})})},yr=e=>e;let S4=yr;function Kw(e){let t;return()=>(t===void 0&&(t=e()),t)}const Rl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},na=e=>e*1e3,ra=e=>e/1e3,pG={useManualTiming:!1};function mG(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(u){a.has(u)&&(c.schedule(u),e()),u(s)}const c={schedule:(u,d=!1,f=!1)=>{const p=f&&r?t:n;return d&&a.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(o),t.clear(),r=!1,i&&(i=!1,c.process(u))}};return c}const Ef=["read","resolveKeyframes","update","preRender","render","postRender"],gG=40;function k4(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,s=Ef.reduce((v,b)=>(v[b]=mG(a),v),{}),{read:o,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=s,p=()=>{const v=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(v-i.timestamp,gG),1),i.timestamp=v,i.isProcessing=!0,o.process(i),c.process(i),u.process(i),d.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},g=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Ef.reduce((v,b)=>{const w=s[b];return v[b]=(S,k=!1,j=!1)=>(n||g(),w.schedule(S,k,j)),v},{}),cancel:v=>{for(let b=0;b<Ef.length;b++)s[Ef[b]].cancel(v)},state:i,steps:s}}const{schedule:Ct,cancel:fs,state:yn,steps:z0}=k4(typeof requestAnimationFrame<"u"?requestAnimationFrame:yr,!0),j4=m.createContext({strict:!1}),n2={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Fl={};for(const e in n2)Fl[e]={isEnabled:t=>n2[e].some(n=>!!t[n])};function yG(e){for(const t in e)Fl[t]={...Fl[t],...e[t]}}const xG=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ap(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||xG.has(e)}let N4=e=>!ap(e);function vG(e){e&&(N4=t=>t.startsWith("on")?!ap(t):e(t))}try{vG(require("@emotion/is-prop-valid").default)}catch{}function bG(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(N4(i)||n===!0&&ap(i)||!t&&!ap(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function wG(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Fm=m.createContext({});function Gu(e){return typeof e=="string"||Array.isArray(e)}function zm(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const qw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gw=["initial",...qw];function $m(e){return zm(e.animate)||Gw.some(t=>Gu(e[t]))}function C4(e){return!!($m(e)||e.variants)}function SG(e,t){if($m(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Gu(n)?n:void 0,animate:Gu(r)?r:void 0}}return e.inherit!==!1?t:{}}function kG(e){const{initial:t,animate:n}=SG(e,m.useContext(Fm));return m.useMemo(()=>({initial:t,animate:n}),[r2(t),r2(n)])}function r2(e){return Array.isArray(e)?e.join(" "):e}const jG=Symbol.for("motionComponentSymbol");function sl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function NG(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):sl(n)&&(n.current=r))},[t])}const Yw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),CG="framerAppearId",P4="data-"+Yw(CG),{schedule:Xw}=k4(queueMicrotask,!1),E4=m.createContext({});function PG(e,t,n,r,i){var a,s;const{visualElement:o}=m.useContext(Fm),c=m.useContext(j4),u=m.useContext(Rm),d=m.useContext(Ww).reducedMotion,f=m.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=m.useContext(E4);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&EG(f.current,n,i,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const y=n[P4],x=m.useRef(!!y&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,y))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,y)));return w4(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Xw.render(h.render),x.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!x.current&&h.animationState&&h.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)===null||v===void 0||v.call(window,y)}),x.current=!1))}),h}function EG(e,t,n,r){const{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:A4(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&sl(o),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function A4(e){if(e)return e.options.allowProjection!==!1?e.projection:A4(e.parent)}function AG({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var a,s;e&&yG(e);function o(u,d){let f;const h={...m.useContext(Ww),...u,layoutId:TG(u)},{isStatic:p}=h,g=kG(u),y=r(u,p);if(!p&&Hw){OG();const x=_G(h);f=x.MeasureLayout,g.visualElement=PG(i,y,h,t,x.ProjectionNode)}return l.jsxs(Fm.Provider,{value:g,children:[f&&g.visualElement?l.jsx(f,{visualElement:g.visualElement,...h}):null,n(i,u,NG(y,g.visualElement,d),y,p,g.visualElement)]})}o.displayName=`motion.${typeof i=="string"?i:`create(${(s=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&s!==void 0?s:""})`}`;const c=m.forwardRef(o);return c[jG]=i,c}function TG({layoutId:e}){const t=m.useContext(Uw).id;return t&&e!==void 0?t+"-"+e:e}function OG(e,t){m.useContext(j4).strict}function _G(e){const{drag:t,layout:n}=Fl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const DG=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Zw(e){return typeof e!="string"||e.includes("-")?!1:!!(DG.indexOf(e)>-1||/[A-Z]/u.test(e))}function i2(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Qw(e,t,n,r){if(typeof t=="function"){const[i,a]=i2(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=i2(r);t=t(n!==void 0?n:e.custom,i,a)}return t}const Vx=e=>Array.isArray(e),MG=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),IG=e=>Vx(e)?e[e.length-1]||0:e,Mn=e=>!!(e&&e.getVelocity);function mh(e){const t=Mn(e)?e.get():e;return MG(t)?t.toValue():t}function LG({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){const s={latestValues:RG(r,i,a,e),renderState:t()};return n&&(s.onMount=o=>n({props:r,current:o,...s}),s.onUpdate=o=>n(o)),s}const T4=e=>(t,n)=>{const r=m.useContext(Fm),i=m.useContext(Rm),a=()=>LG(e,t,r,i);return n?a():Vw(a)};function RG(e,t,n,r){const i={},a=r(e,{});for(const h in a)i[h]=mh(a[h]);let{initial:s,animate:o}=e;const c=$m(e),u=C4(e);t&&u&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||s===!1;const f=d?o:s;if(f&&typeof f!="boolean"&&!zm(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=Qw(e,h[p]);if(g){const{transitionEnd:y,transition:x,...v}=g;for(const b in v){let w=v[b];if(Array.isArray(w)){const S=d?w.length-1:0;w=w[S]}w!==null&&(i[b]=w)}for(const b in y)i[b]=y[b]}}}return i}const nc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Eo=new Set(nc),O4=e=>t=>typeof t=="string"&&t.startsWith(e),_4=O4("--"),FG=O4("var(--"),Jw=e=>FG(e)?zG.test(e.split("/*")[0].trim()):!1,zG=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,D4=(e,t)=>t&&typeof e=="number"?t.transform(e):e,da=(e,t,n)=>n>t?t:n<e?e:n,rc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Yu={...rc,transform:e=>da(0,1,e)},Af={...rc,default:1},Td=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ra=Td("deg"),Ai=Td("%"),Fe=Td("px"),$G=Td("vh"),BG=Td("vw"),a2={...Ai,parse:e=>Ai.parse(e)/100,transform:e=>Ai.transform(e*100)},UG={borderWidth:Fe,borderTopWidth:Fe,borderRightWidth:Fe,borderBottomWidth:Fe,borderLeftWidth:Fe,borderRadius:Fe,radius:Fe,borderTopLeftRadius:Fe,borderTopRightRadius:Fe,borderBottomRightRadius:Fe,borderBottomLeftRadius:Fe,width:Fe,maxWidth:Fe,height:Fe,maxHeight:Fe,top:Fe,right:Fe,bottom:Fe,left:Fe,padding:Fe,paddingTop:Fe,paddingRight:Fe,paddingBottom:Fe,paddingLeft:Fe,margin:Fe,marginTop:Fe,marginRight:Fe,marginBottom:Fe,marginLeft:Fe,backgroundPositionX:Fe,backgroundPositionY:Fe},VG={rotate:Ra,rotateX:Ra,rotateY:Ra,rotateZ:Ra,scale:Af,scaleX:Af,scaleY:Af,scaleZ:Af,skew:Ra,skewX:Ra,skewY:Ra,distance:Fe,translateX:Fe,translateY:Fe,translateZ:Fe,x:Fe,y:Fe,z:Fe,perspective:Fe,transformPerspective:Fe,opacity:Yu,originX:a2,originY:a2,originZ:Fe},s2={...rc,transform:Math.round},e1={...UG,...VG,zIndex:s2,size:Fe,fillOpacity:Yu,strokeOpacity:Yu,numOctaves:s2},WG={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HG=nc.length;function KG(e,t,n){let r="",i=!0;for(let a=0;a<HG;a++){const s=nc[a],o=e[s];if(o===void 0)continue;let c=!0;if(typeof o=="number"?c=o===(s.startsWith("scale")?1:0):c=parseFloat(o)===0,!c||n){const u=D4(o,e1[s]);if(!c){i=!1;const d=WG[s]||s;r+=`${d}(${u}) `}n&&(t[s]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function t1(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let s=!1,o=!1;for(const c in t){const u=t[c];if(Eo.has(c)){s=!0;continue}else if(_4(c)){i[c]=u;continue}else{const d=D4(u,e1[c]);c.startsWith("origin")?(o=!0,a[c]=d):r[c]=d}}if(t.transform||(s||n?r.transform=KG(t,e.transform,n):r.transform&&(r.transform="none")),o){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}const qG={offset:"stroke-dashoffset",array:"stroke-dasharray"},GG={offset:"strokeDashoffset",array:"strokeDasharray"};function YG(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?qG:GG;e[a.offset]=Fe.transform(-r);const s=Fe.transform(t),o=Fe.transform(n);e[a.array]=`${s} ${o}`}function o2(e,t,n){return typeof e=="string"?e:Fe.transform(t+n*e)}function XG(e,t,n){const r=o2(t,e.x,e.width),i=o2(n,e.y,e.height);return`${r} ${i}`}function n1(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:s,pathSpacing:o=1,pathOffset:c=0,...u},d,f){if(t1(e,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:g}=e;h.transform&&(g&&(p.transform=h.transform),delete h.transform),g&&(i!==void 0||a!==void 0||p.transform)&&(p.transformOrigin=XG(g,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&YG(h,s,o,c,!1)}const r1=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),M4=()=>({...r1(),attrs:{}}),i1=e=>typeof e=="string"&&e.toLowerCase()==="svg";function I4(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const L4=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function R4(e,t,n,r){I4(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(L4.has(i)?i:Yw(i),t.attrs[i])}const sp={};function ZG(e){Object.assign(sp,e)}function F4(e,{layout:t,layoutId:n}){return Eo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!sp[e]||e==="opacity")}function a1(e,t,n){var r;const{style:i}=e,a={};for(const s in i)(Mn(i[s])||t.style&&Mn(t.style[s])||F4(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[s]=i[s]);return a}function z4(e,t,n){const r=a1(e,t,n);for(const i in e)if(Mn(e[i])||Mn(t[i])){const a=nc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function QG(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const l2=["x","y","width","height","cx","cy","r"],JG={useVisualState:T4({scrapeMotionValuesFromProps:z4,createRenderState:M4,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(const o in i)if(Eo.has(o)){a=!0;break}}if(!a)return;let s=!t;if(t)for(let o=0;o<l2.length;o++){const c=l2[o];e[c]!==t[c]&&(s=!0)}s&&Ct.read(()=>{QG(n,r),Ct.render(()=>{n1(r,i,i1(n.tagName),e.transformTemplate),R4(n,r)})})}})},eY={useVisualState:T4({scrapeMotionValuesFromProps:a1,createRenderState:r1})};function $4(e,t,n){for(const r in t)!Mn(t[r])&&!F4(r,n)&&(e[r]=t[r])}function tY({transformTemplate:e},t){return m.useMemo(()=>{const n=r1();return t1(n,t,e),Object.assign({},n.vars,n.style)},[t])}function nY(e,t){const n=e.style||{},r={};return $4(r,n,e),Object.assign(r,tY(e,t)),r}function rY(e,t){const n={},r=nY(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function iY(e,t,n,r){const i=m.useMemo(()=>{const a=M4();return n1(a,t,i1(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};$4(a,e.style,e),i.style={...a,...i.style}}return i}function aY(e=!1){return(n,r,i,{latestValues:a},s)=>{const c=(Zw(n)?iY:rY)(r,a,s,n),u=bG(r,typeof n=="string",e),d=n!==m.Fragment?{...u,...c,ref:i}:{},{children:f}=r,h=m.useMemo(()=>Mn(f)?f.get():f,[f]);return m.createElement(n,{...d,children:h})}}function sY(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...Zw(r)?JG:eY,preloadedFeatures:e,useRender:aY(i),createVisualElement:t,Component:r};return AG(s)}}function B4(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Bm(e,t,n){const r=e.getProps();return Qw(r,t,n!==void 0?n:r.custom,e)}const oY=Kw(()=>window.ScrollTimeline!==void 0);class lY{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(oY()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class cY extends lY{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function s1(e,t){return e?e[t]||e.default||e:void 0}const Wx=2e4;function U4(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Wx;)t+=n,r=e.next(t);return t>=Wx?1/0:t}function o1(e){return typeof e=="function"}function c2(e,t){e.timeline=t,e.onfinish=null}const l1=e=>Array.isArray(e)&&typeof e[0]=="number",uY={linearEasing:void 0};function dY(e,t){const n=Kw(e);return()=>{var r;return(r=uY[t])!==null&&r!==void 0?r:n()}}const op=dY(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),V4=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=e(Rl(0,i-1,a))+", ";return`linear(${r.substring(0,r.length-2)})`};function W4(e){return!!(typeof e=="function"&&op()||!e||typeof e=="string"&&(e in Hx||op())||l1(e)||Array.isArray(e)&&e.every(W4))}const Zc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Hx={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zc([0,.65,.55,1]),circOut:Zc([.55,0,1,.45]),backIn:Zc([.31,.01,.66,-.59]),backOut:Zc([.33,1.53,.69,.99])};function H4(e,t){if(e)return typeof e=="function"&&op()?V4(e,t):l1(e)?Zc(e):Array.isArray(e)?e.map(n=>H4(n,t)||Hx.easeOut):Hx[e]}const Yr={x:!1,y:!1};function K4(){return Yr.x||Yr.y}function fY(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const a=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function q4(e,t){const n=fY(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function u2(e){return t=>{t.pointerType==="touch"||K4()||e(t)}}function hY(e,t,n={}){const[r,i,a]=q4(e,n),s=u2(o=>{const{target:c}=o,u=t(o);if(typeof u!="function"||!c)return;const d=u2(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,i)});return r.forEach(o=>{o.addEventListener("pointerenter",s,i)}),a}const G4=(e,t)=>t?e===t?!0:G4(e,t.parentElement):!1,c1=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,pY=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function mY(e){return pY.has(e.tagName)||e.tabIndex!==-1}const Qc=new WeakSet;function d2(e){return t=>{t.key==="Enter"&&e(t)}}function $0(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const gY=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=d2(()=>{if(Qc.has(n))return;$0(n,"down");const i=d2(()=>{$0(n,"up")}),a=()=>$0(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function f2(e){return c1(e)&&!K4()}function yY(e,t,n={}){const[r,i,a]=q4(e,n),s=o=>{const c=o.currentTarget;if(!f2(o)||Qc.has(c))return;Qc.add(c);const u=t(o),d=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!f2(p)||!Qc.has(c))&&(Qc.delete(c),typeof u=="function"&&u(p,{success:g}))},f=p=>{d(p,n.useGlobalTarget||G4(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return r.forEach(o=>{!mY(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",s,i),o.addEventListener("focus",u=>gY(u,i),i)}),a}function xY(e){return e==="x"||e==="y"?Yr[e]?null:(Yr[e]=!0,()=>{Yr[e]=!1}):Yr.x||Yr.y?null:(Yr.x=Yr.y=!0,()=>{Yr.x=Yr.y=!1})}const Y4=new Set(["width","height","top","left","right","bottom",...nc]);let gh;function vY(){gh=void 0}const Ti={now:()=>(gh===void 0&&Ti.set(yn.isProcessing||pG.useManualTiming?yn.timestamp:performance.now()),gh),set:e=>{gh=e,queueMicrotask(vY)}};function u1(e,t){e.indexOf(t)===-1&&e.push(t)}function d1(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class f1{constructor(){this.subscriptions=[]}add(t){return u1(this.subscriptions,t),()=>d1(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const s=this.subscriptions[a];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function X4(e,t){return t?e*(1e3/t):0}const h2=30,bY=e=>!isNaN(parseFloat(e));class wY{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=Ti.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ti.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=bY(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new f1);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ct.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ti.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>h2)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,h2);return X4(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Xu(e,t){return new wY(e,t)}function SY(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xu(n))}function kY(e,t){const n=Bm(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const s in a){const o=IG(a[s]);SY(e,s,o)}}function jY(e){return!!(Mn(e)&&e.add)}function Kx(e,t){const n=e.getValue("willChange");if(jY(n))return n.add(t)}function Z4(e){return e.props[P4]}const Q4=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,NY=1e-7,CY=12;function PY(e,t,n,r,i){let a,s,o=0;do s=t+(n-t)/2,a=Q4(s,r,i)-e,a>0?n=s:t=s;while(Math.abs(a)>NY&&++o<CY);return s}function Od(e,t,n,r){if(e===t&&n===r)return yr;const i=a=>PY(a,0,1,e,n);return a=>a===0||a===1?a:Q4(i(a),t,r)}const J4=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,eD=e=>t=>1-e(1-t),tD=Od(.33,1.53,.69,.99),h1=eD(tD),nD=J4(h1),rD=e=>(e*=2)<1?.5*h1(e):.5*(2-Math.pow(2,-10*(e-1))),p1=e=>1-Math.sin(Math.acos(e)),iD=eD(p1),aD=J4(p1),sD=e=>/^0[^.\s]+$/u.test(e);function EY(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||sD(e):!0}const gu=e=>Math.round(e*1e5)/1e5,m1=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function AY(e){return e==null}const TY=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,g1=(e,t)=>n=>!!(typeof n=="string"&&TY.test(n)&&n.startsWith(e)||t&&!AY(n)&&Object.prototype.hasOwnProperty.call(n,t)),oD=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,s,o]=r.match(m1);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},OY=e=>da(0,255,e),B0={...rc,transform:e=>Math.round(OY(e))},Gs={test:g1("rgb","red"),parse:oD("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+B0.transform(e)+", "+B0.transform(t)+", "+B0.transform(n)+", "+gu(Yu.transform(r))+")"};function _Y(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const qx={test:g1("#"),parse:_Y,transform:Gs.transform},ol={test:g1("hsl","hue"),parse:oD("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ai.transform(gu(t))+", "+Ai.transform(gu(n))+", "+gu(Yu.transform(r))+")"},En={test:e=>Gs.test(e)||qx.test(e)||ol.test(e),parse:e=>Gs.test(e)?Gs.parse(e):ol.test(e)?ol.parse(e):qx.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Gs.transform(e):ol.transform(e)},DY=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function MY(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(m1))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(DY))===null||n===void 0?void 0:n.length)||0)>0}const lD="number",cD="color",IY="var",LY="var(",p2="${}",RY=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Zu(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(RY,c=>(En.test(c)?(r.color.push(a),i.push(cD),n.push(En.parse(c))):c.startsWith(LY)?(r.var.push(a),i.push(IY),n.push(c)):(r.number.push(a),i.push(lD),n.push(parseFloat(c))),++a,p2)).split(p2);return{values:n,split:o,indexes:r,types:i}}function uD(e){return Zu(e).values}function dD(e){const{split:t,types:n}=Zu(e),r=t.length;return i=>{let a="";for(let s=0;s<r;s++)if(a+=t[s],i[s]!==void 0){const o=n[s];o===lD?a+=gu(i[s]):o===cD?a+=En.transform(i[s]):a+=i[s]}return a}}const FY=e=>typeof e=="number"?0:e;function zY(e){const t=uD(e);return dD(e)(t.map(FY))}const hs={test:MY,parse:uD,createTransformer:dD,getAnimatableNone:zY},$Y=new Set(["brightness","contrast","saturate","opacity"]);function BY(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(m1)||[];if(!r)return e;const i=n.replace(r,"");let a=$Y.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const UY=/\b([a-z-]*)\(.*?\)/gu,Gx={...hs,getAnimatableNone:e=>{const t=e.match(UY);return t?t.map(BY).join(" "):e}},VY={...e1,color:En,backgroundColor:En,outlineColor:En,fill:En,stroke:En,borderColor:En,borderTopColor:En,borderRightColor:En,borderBottomColor:En,borderLeftColor:En,filter:Gx,WebkitFilter:Gx},y1=e=>VY[e];function fD(e,t){let n=y1(e);return n!==Gx&&(n=hs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const WY=new Set(["auto","none","0"]);function HY(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!WY.has(a)&&Zu(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=fD(n,i)}const m2=e=>e===rc||e===Fe,g2=(e,t)=>parseFloat(e.split(", ")[t]),y2=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return g2(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?g2(a[1],e):0}},KY=new Set(["x","y","z"]),qY=nc.filter(e=>!KY.has(e));function GY(e){const t=[];return qY.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:y2(4,13),y:y2(5,14)};zl.translateX=zl.x;zl.translateY=zl.y;const to=new Set;let Yx=!1,Xx=!1;function hD(){if(Xx){const e=Array.from(to).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=GY(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,s])=>{var o;(o=r.getValue(a))===null||o===void 0||o.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Xx=!1,Yx=!1,to.forEach(e=>e.complete()),to.clear()}function pD(){to.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Xx=!0)})}function YY(){pD(),hD()}class x1{constructor(t,n,r,i,a,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(to.add(this),Yx||(Yx=!0,Ct.read(pD),Ct.resolveKeyframes(hD))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const c=r.readValue(n,o);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),to.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,to.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const mD=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),XY=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ZY(e){const t=XY.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function gD(e,t,n=1){const[r,i]=ZY(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const s=a.trim();return mD(s)?parseFloat(s):s}return Jw(i)?gD(i,t,n+1):i}const yD=e=>t=>t.test(e),QY={test:e=>e==="auto",parse:e=>e},xD=[rc,Fe,Ai,Ra,BG,$G,QY],x2=e=>xD.find(yD(e));class vD extends x1{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Jw(u))){const d=gD(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Y4.has(r)||t.length!==2)return;const[i,a]=t,s=x2(i),o=x2(a);if(s!==o)if(m2(s)&&m2(o))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)EY(t[i])&&r.push(i);r.length&&HY(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=zl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const s=i.length-1,o=i[s];i[s]=zl[r](n.measureViewportBox(),window.getComputedStyle(n.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,u])=>{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const v2=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hs.test(e)||e==="0")&&!e.startsWith("url("));function JY(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function eX(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],s=v2(i,t),o=v2(a,t);return!s||!o?!1:JY(e)||(n==="spring"||o1(n))&&r}const tX=e=>e!==null;function Um(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(tX),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const nX=40;class bD{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ti.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:s,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>nX?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&YY(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ti.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:s,onComplete:o,onUpdate:c,isGenerator:u}=this.options;if(!u&&!eX(t,r,i,a))if(s)this.options.duration=0;else{c&&c(Um(t,this.options,n)),o&&o(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Mt=(e,t,n)=>e+(t-e)*n;function U0(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function rX({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,s=0;if(!t)i=a=s=n;else{const o=n<.5?n*(1+t):n+t-n*t,c=2*n-o;i=U0(c,o,e+1/3),a=U0(c,o,e),s=U0(c,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:r}}function lp(e,t){return n=>n>0?t:e}const V0=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},iX=[qx,Gs,ol],aX=e=>iX.find(t=>t.test(e));function b2(e){const t=aX(e);if(!t)return!1;let n=t.parse(e);return t===ol&&(n=rX(n)),n}const w2=(e,t)=>{const n=b2(e),r=b2(t);if(!n||!r)return lp(e,t);const i={...n};return a=>(i.red=V0(n.red,r.red,a),i.green=V0(n.green,r.green,a),i.blue=V0(n.blue,r.blue,a),i.alpha=Mt(n.alpha,r.alpha,a),Gs.transform(i))},sX=(e,t)=>n=>t(e(n)),_d=(...e)=>e.reduce(sX),Zx=new Set(["none","hidden"]);function oX(e,t){return Zx.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function lX(e,t){return n=>Mt(e,t,n)}function v1(e){return typeof e=="number"?lX:typeof e=="string"?Jw(e)?lp:En.test(e)?w2:dX:Array.isArray(e)?wD:typeof e=="object"?En.test(e)?w2:cX:lp}function wD(e,t){const n=[...e],r=n.length,i=e.map((a,s)=>v1(a)(a,t[s]));return a=>{for(let s=0;s<r;s++)n[s]=i[s](a);return n}}function cX(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=v1(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function uX(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const s=t.types[a],o=e.indexes[s][i[s]],c=(n=e.values[o])!==null&&n!==void 0?n:0;r[a]=c,i[s]++}return r}const dX=(e,t)=>{const n=hs.createTransformer(t),r=Zu(e),i=Zu(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Zx.has(e)&&!i.values.length||Zx.has(t)&&!r.values.length?oX(e,t):_d(wD(uX(r,i),i.values),n):lp(e,t)};function SD(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Mt(e,t,n):v1(e)(e,t)}const fX=5;function kD(e,t,n){const r=Math.max(t-fX,0);return X4(n-e(r),t-r)}const $t={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},W0=.001;function hX({duration:e=$t.duration,bounce:t=$t.bounce,velocity:n=$t.velocity,mass:r=$t.mass}){let i,a,s=1-t;s=da($t.minDamping,$t.maxDamping,s),e=da($t.minDuration,$t.maxDuration,ra(e)),s<1?(i=u=>{const d=u*s,f=d*e,h=d-n,p=Qx(u,s),g=Math.exp(-f);return W0-h/p*g},a=u=>{const f=u*s*e,h=f*n+n,p=Math.pow(s,2)*Math.pow(u,2)*e,g=Math.exp(-f),y=Qx(Math.pow(u,2),s);return(-i(u)+W0>0?-1:1)*((h-p)*g)/y}):(i=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-W0+d*f},a=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const o=5/e,c=mX(i,a,o);if(e=na(e),isNaN(c))return{stiffness:$t.stiffness,damping:$t.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const pX=12;function mX(e,t,n){let r=n;for(let i=1;i<pX;i++)r=r-e(r)/t(r);return r}function Qx(e,t){return e*Math.sqrt(1-t*t)}const gX=["duration","bounce"],yX=["stiffness","damping","mass"];function S2(e,t){return t.some(n=>e[n]!==void 0)}function xX(e){let t={velocity:$t.velocity,stiffness:$t.stiffness,damping:$t.damping,mass:$t.mass,isResolvedFromDuration:!1,...e};if(!S2(e,yX)&&S2(e,gX))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*da(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:$t.mass,stiffness:i,damping:a}}else{const n=hX(e);t={...t,...n,mass:$t.mass},t.isResolvedFromDuration=!0}return t}function jD(e=$t.visualDuration,t=$t.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=xX({...n,velocity:-ra(n.velocity||0)}),g=h||0,y=u/(2*Math.sqrt(c*d)),x=s-a,v=ra(Math.sqrt(c/d)),b=Math.abs(x)<5;r||(r=b?$t.restSpeed.granular:$t.restSpeed.default),i||(i=b?$t.restDelta.granular:$t.restDelta.default);let w;if(y<1){const k=Qx(v,y);w=j=>{const N=Math.exp(-y*v*j);return s-N*((g+y*v*x)/k*Math.sin(k*j)+x*Math.cos(k*j))}}else if(y===1)w=k=>s-Math.exp(-v*k)*(x+(g+v*x)*k);else{const k=v*Math.sqrt(y*y-1);w=j=>{const N=Math.exp(-y*v*j),P=Math.min(k*j,300);return s-N*((g+y*v*x)*Math.sinh(P)+k*x*Math.cosh(P))/k}}const S={calculatedDuration:p&&f||null,next:k=>{const j=w(k);if(p)o.done=k>=f;else{let N=0;y<1&&(N=k===0?na(g):kD(w,k,j));const P=Math.abs(N)<=r,T=Math.abs(s-j)<=i;o.done=P&&T}return o.value=o.done?s:j,o},toString:()=>{const k=Math.min(U4(S),Wx),j=V4(N=>S.next(k*N).value,k,30);return k+"ms "+j}};return S}function k2({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=P=>o!==void 0&&P<o||c!==void 0&&P>c,g=P=>o===void 0?c:c===void 0||Math.abs(o-P)<Math.abs(c-P)?o:c;let y=n*t;const x=f+y,v=s===void 0?x:s(x);v!==x&&(y=v-f);const b=P=>-y*Math.exp(-P/r),w=P=>v+b(P),S=P=>{const T=b(P),E=w(P);h.done=Math.abs(T)<=u,h.value=h.done?v:E};let k,j;const N=P=>{p(h.value)&&(k=P,j=jD({keyframes:[h.value,g(h.value)],velocity:kD(w,P,h.value),damping:i,stiffness:a,restDelta:u,restSpeed:d}))};return N(0),{calculatedDuration:null,next:P=>{let T=!1;return!j&&k===void 0&&(T=!0,S(P),N(P)),k!==void 0&&P>=k?j.next(P-k):(!T&&S(P),h)}}}const vX=Od(.42,0,1,1),bX=Od(0,0,.58,1),ND=Od(.42,0,.58,1),wX=e=>Array.isArray(e)&&typeof e[0]!="number",SX={linear:yr,easeIn:vX,easeInOut:ND,easeOut:bX,circIn:p1,circInOut:aD,circOut:iD,backIn:h1,backInOut:nD,backOut:tD,anticipate:rD},j2=e=>{if(l1(e)){S4(e.length===4);const[t,n,r,i]=e;return Od(t,n,r,i)}else if(typeof e=="string")return SX[e];return e};function kX(e,t,n){const r=[],i=n||SD,a=e.length-1;for(let s=0;s<a;s++){let o=i(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||yr:t;o=_d(c,o)}r.push(o)}return r}function jX(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(S4(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=kX(t,r,i),c=o.length,u=d=>{if(s&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const h=Rl(e[f],e[f+1],d);return o[f](h)};return n?d=>u(da(e[0],e[a-1],d)):u}function NX(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Rl(0,t,r);e.push(Mt(n,1,i))}}function CX(e){const t=[0];return NX(t,e.length-1),t}function PX(e,t){return e.map(n=>n*t)}function EX(e,t){return e.map(()=>t||ND).splice(0,e.length-1)}function cp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=wX(r)?r.map(j2):j2(r),a={done:!1,value:t[0]},s=PX(n&&n.length===t.length?n:CX(t),e),o=jX(s,t,{ease:Array.isArray(i)?i:EX(t,i)});return{calculatedDuration:e,next:c=>(a.value=o(c),a.done=c>=e,a)}}const AX=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ct.update(t,!0),stop:()=>fs(t),now:()=>yn.isProcessing?yn.timestamp:Ti.now()}},TX={decay:k2,inertia:k2,tween:cp,keyframes:cp,spring:jD},OX=e=>e/100;class b1 extends bD{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,s=(i==null?void 0:i.KeyframeResolver)||x1,o=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new s(a,o,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:s=0}=this.options,o=o1(n)?n:TX[n]||cp;let c,u;o!==cp&&typeof t[0]!="number"&&(c=_d(OX,SD(t[0],t[1])),t=[0,100]);const d=o({...this.options,keyframes:t});a==="mirror"&&(u=o({...this.options,keyframes:[...t].reverse(),velocity:-s})),d.calculatedDuration===null&&(d.calculatedDuration=U4(d));const{calculatedDuration:f}=d,h=f+i,p=h*(r+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:P}=this.options;return{done:!0,value:P[P.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:s,mapPercentToKeyframes:o,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return a.next(0);const{delay:h,repeat:p,repeatType:g,repeatDelay:y,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-h*(this.speed>=0?1:-1),b=this.speed>=0?v<0:v>d;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,S=a;if(p){const P=Math.min(this.currentTime,d)/f;let T=Math.floor(P),E=P%1;!E&&P>=1&&(E=1),E===1&&T--,T=Math.min(T,p+1),!!(T%2)&&(g==="reverse"?(E=1-E,y&&(E-=y/f)):g==="mirror"&&(S=s)),w=da(0,1,E)*f}const k=b?{done:!1,value:c[0]}:S.next(w);o&&(k.value=o(k.value));let{done:j}=k;!b&&u!==null&&(j=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&j);return N&&i!==void 0&&(k.value=Um(c,this.options,i)),x&&x(k.value),N&&this.finish(),k}get duration(){const{resolved:t}=this;return t?ra(t.calculatedDuration):0}get time(){return ra(this.currentTime)}set time(t){t=na(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ra(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=AX,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const _X=new Set(["opacity","clipPath","filter","transform"]);function DX(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=H4(o,i);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"})}const MX=Kw(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),up=10,IX=2e4;function LX(e){return o1(e.type)||e.type==="spring"||!W4(e.ease)}function RX(e,t){const n=new b1({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let a=0;for(;!r.done&&a<IX;)r=n.sample(a),i.push(r.value),a+=up;return{times:void 0,keyframes:i,duration:a-up,ease:"linear"}}const CD={anticipate:rD,backInOut:nD,circInOut:aD};function FX(e){return e in CD}class N2 extends bD{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new vD(a,(s,o)=>this.onKeyframesResolved(s,o),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:a,type:s,motionValue:o,name:c,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof a=="string"&&op()&&FX(a)&&(a=CD[a]),LX(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:g,...y}=this.options,x=RX(t,y);t=x.keyframes,t.length===1&&(t[1]=t[0]),r=x.duration,i=x.times,a=x.ease,s="keyframes"}const d=DX(o.owner.current,c,t,{...this.options,duration:r,times:i,ease:a});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(c2(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set(Um(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:s,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ra(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ra(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=na(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return yr;const{animation:r}=n;c2(r,t)}return yr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:a,ease:s,times:o}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...p}=this.options,g=new b1({...p,keyframes:r,duration:i,type:a,ease:s,times:o,isGenerator:!0}),y=na(this.time);u.setWithVelocity(g.sample(y-up).value,g.sample(y).value,up)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:a,damping:s,type:o}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return MX()&&r&&_X.has(r)&&!c&&!u&&!i&&a!=="mirror"&&s!==0&&o!=="inertia"}}const zX={type:"spring",stiffness:500,damping:25,restSpeed:10},$X=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),BX={type:"keyframes",duration:.8},UX={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},VX=(e,{keyframes:t})=>t.length>2?BX:Eo.has(e)?e.startsWith("scale")?$X(t[1]):zX:UX;function WX({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const w1=(e,t,n,r={},i,a)=>s=>{const o=s1(r,e)||{},c=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-na(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:a?void 0:i};WX(o)||(d={...d,...VX(e,d)}),d.duration&&(d.duration=na(d.duration)),d.repeatDelay&&(d.repeatDelay=na(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!a&&t.get()!==void 0){const h=Um(d.keyframes,o);if(h!==void 0)return Ct.update(()=>{d.onUpdate(h),d.onComplete()}),new cY([])}return!a&&N2.supports(d)?new N2(d):new b1(d)};function HX({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function PD(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:s=e.getDefaultTransition(),transitionEnd:o,...c}=t;r&&(s=r);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in c){const h=e.getValue(f,(a=e.latestValues[f])!==null&&a!==void 0?a:null),p=c[f];if(p===void 0||d&&HX(d,f))continue;const g={delay:n,...s1(s||{},f)};let y=!1;if(window.MotionHandoffAnimation){const v=Z4(e);if(v){const b=window.MotionHandoffAnimation(v,f,Ct);b!==null&&(g.startTime=b,y=!0)}}Kx(e,f),h.start(w1(f,h,p,e.shouldReduceMotion&&Y4.has(f)?{type:!1}:g,e,y));const x=h.animation;x&&u.push(x)}return o&&Promise.all(u).then(()=>{Ct.update(()=>{o&&kY(e,o)})}),u}function Jx(e,t,n={}){var r;const i=Bm(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const s=i?()=>Promise.all(PD(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=a;return KX(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[u,d]=c==="beforeChildren"?[s,o]:[o,s];return u().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function KX(e,t,n=0,r=0,i=1,a){const s=[],o=(e.variantChildren.size-1)*r,c=i===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(e.variantChildren).sort(qX).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(Jx(u,t,{...a,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function qX(e,t){return e.sortNodePosition(t)}function GX(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>Jx(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=Jx(e,t,n);else{const i=typeof t=="function"?Bm(e,t,n.custom):t;r=Promise.all(PD(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const YX=Gw.length;function ED(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ED(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<YX;n++){const r=Gw[n],i=e.props[r];(Gu(i)||i===!1)&&(t[r]=i)}return t}const XX=[...qw].reverse(),ZX=qw.length;function QX(e){return t=>Promise.all(t.map(({animation:n,options:r})=>GX(e,n,r)))}function JX(e){let t=QX(e),n=C2(),r=!0;const i=c=>(u,d)=>{var f;const h=Bm(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...y}=h;u={...u,...y,...g}}return u};function a(c){t=c(e)}function s(c){const{props:u}=e,d=ED(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let x=0;x<ZX;x++){const v=XX[x],b=n[v],w=u[v]!==void 0?u[v]:d[v],S=Gu(w),k=v===c?b.isActive:null;k===!1&&(g=x);let j=w===d[v]&&w!==u[v]&&S;if(j&&r&&e.manuallyAnimateOnMount&&(j=!1),b.protectedKeys={...p},!b.isActive&&k===null||!w&&!b.prevProp||zm(w)||typeof w=="boolean")continue;const N=eZ(b.prevProp,w);let P=N||v===c&&b.isActive&&!j&&S||x>g&&S,T=!1;const E=Array.isArray(w)?w:[w];let _=E.reduce(i(v),{});k===!1&&(_={});const{prevResolvedValues:C={}}=b,A={...C,..._},M=Q=>{P=!0,h.has(Q)&&(T=!0,h.delete(Q)),b.needsAnimating[Q]=!0;const I=e.getValue(Q);I&&(I.liveStyle=!1)};for(const Q in A){const I=_[Q],H=C[Q];if(p.hasOwnProperty(Q))continue;let O=!1;Vx(I)&&Vx(H)?O=!B4(I,H):O=I!==H,O?I!=null?M(Q):h.add(Q):I!==void 0&&h.has(Q)?M(Q):b.protectedKeys[Q]=!0}b.prevProp=w,b.prevResolvedValues=_,b.isActive&&(p={...p,..._}),r&&e.blockInitialAnimation&&(P=!1),P&&(!(j&&N)||T)&&f.push(...E.map(Q=>({animation:Q,options:{type:v}})))}if(h.size){const x={};h.forEach(v=>{const b=e.getBaseTarget(v),w=e.getValue(v);w&&(w.liveStyle=!0),x[v]=b??null}),f.push({animation:x})}let y=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function o(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(c,u)}),n[c].isActive=u;const f=s(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:s,setActive:o,setAnimateFunction:a,getState:()=>n,reset:()=>{n=C2(),r=!0}}}function eZ(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!B4(t,e):!1}function Es(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function C2(){return{animate:Es(!0),whileInView:Es(),whileHover:Es(),whileTap:Es(),whileDrag:Es(),whileFocus:Es(),exit:Es()}}class ws{constructor(t){this.isMounted=!1,this.node=t}update(){}}class tZ extends ws{constructor(t){super(t),t.animationState||(t.animationState=JX(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();zm(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let nZ=0;class rZ extends ws{constructor(){super(...arguments),this.id=nZ++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const iZ={animation:{Feature:tZ},exit:{Feature:rZ}};function Qu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Dd(e){return{point:{x:e.pageX,y:e.pageY}}}const aZ=e=>t=>c1(t)&&e(t,Dd(t));function yu(e,t,n,r){return Qu(e,t,aZ(n),r)}const P2=(e,t)=>Math.abs(e-t);function sZ(e,t){const n=P2(e.x,t.x),r=P2(e.y,t.y);return Math.sqrt(n**2+r**2)}class AD{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=K0(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=sZ(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:y}=yn;this.history.push({...g,timestamp:y});const{onStart:x,onMove:v}=this.handlers;h||(x&&x(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=H0(h,this.transformPagePoint),Ct.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=K0(f.type==="pointercancel"?this.lastMoveEventInfo:H0(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,x),g&&g(f,x)},!c1(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=Dd(t),o=H0(s,this.transformPagePoint),{point:c}=o,{timestamp:u}=yn;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,K0(o,this.history)),this.removeListeners=_d(yu(this.contextWindow,"pointermove",this.handlePointerMove),yu(this.contextWindow,"pointerup",this.handlePointerUp),yu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fs(this.updatePoint)}}function H0(e,t){return t?{point:t(e.point)}:e}function E2(e,t){return{x:e.x-t.x,y:e.y-t.y}}function K0({point:e},t){return{point:e,delta:E2(e,TD(t)),offset:E2(e,oZ(t)),velocity:lZ(t,.1)}}function oZ(e){return e[0]}function TD(e){return e[e.length-1]}function lZ(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=TD(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>na(t)));)n--;if(!r)return{x:0,y:0};const a=ra(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const s={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const OD=1e-4,cZ=1-OD,uZ=1+OD,_D=.01,dZ=0-_D,fZ=0+_D;function wr(e){return e.max-e.min}function hZ(e,t,n){return Math.abs(e-t)<=n}function A2(e,t,n,r=.5){e.origin=r,e.originPoint=Mt(t.min,t.max,e.origin),e.scale=wr(n)/wr(t),e.translate=Mt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=cZ&&e.scale<=uZ||isNaN(e.scale))&&(e.scale=1),(e.translate>=dZ&&e.translate<=fZ||isNaN(e.translate))&&(e.translate=0)}function xu(e,t,n,r){A2(e.x,t.x,n.x,r?r.originX:void 0),A2(e.y,t.y,n.y,r?r.originY:void 0)}function T2(e,t,n){e.min=n.min+t.min,e.max=e.min+wr(t)}function pZ(e,t,n){T2(e.x,t.x,n.x),T2(e.y,t.y,n.y)}function O2(e,t,n){e.min=t.min-n.min,e.max=e.min+wr(t)}function vu(e,t,n){O2(e.x,t.x,n.x),O2(e.y,t.y,n.y)}function mZ(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Mt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Mt(n,e,r.max):Math.min(e,n)),e}function _2(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function gZ(e,{top:t,left:n,bottom:r,right:i}){return{x:_2(e.x,n,i),y:_2(e.y,t,r)}}function D2(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function yZ(e,t){return{x:D2(e.x,t.x),y:D2(e.y,t.y)}}function xZ(e,t){let n=.5;const r=wr(e),i=wr(t);return i>r?n=Rl(t.min,t.max-r,e.min):r>i&&(n=Rl(e.min,e.max-i,t.min)),da(0,1,n)}function vZ(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ev=.35;function bZ(e=ev){return e===!1?e=0:e===!0&&(e=ev),{x:M2(e,"left","right"),y:M2(e,"top","bottom")}}function M2(e,t,n){return{min:I2(e,t),max:I2(e,n)}}function I2(e,t){return typeof e=="number"?e:e[t]||0}const L2=()=>({translate:0,scale:1,origin:0,originPoint:0}),ll=()=>({x:L2(),y:L2()}),R2=()=>({min:0,max:0}),Wt=()=>({x:R2(),y:R2()});function _r(e){return[e("x"),e("y")]}function DD({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function wZ({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function SZ(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function q0(e){return e===void 0||e===1}function tv({scale:e,scaleX:t,scaleY:n}){return!q0(e)||!q0(t)||!q0(n)}function Is(e){return tv(e)||MD(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function MD(e){return F2(e.x)||F2(e.y)}function F2(e){return e&&e!=="0%"}function dp(e,t,n){const r=e-n,i=t*r;return n+i}function z2(e,t,n,r,i){return i!==void 0&&(e=dp(e,i,r)),dp(e,n,r)+t}function nv(e,t=0,n=1,r,i){e.min=z2(e.min,t,n,r,i),e.max=z2(e.max,t,n,r,i)}function ID(e,{x:t,y:n}){nv(e.x,t.translate,t.scale,t.originPoint),nv(e.y,n.translate,n.scale,n.originPoint)}const $2=.999999999999,B2=1.0000000000001;function kZ(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,s;for(let o=0;o<i;o++){a=n[o],s=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&ul(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,ID(e,s)),r&&Is(a.latestValues)&&ul(e,a.latestValues))}t.x<B2&&t.x>$2&&(t.x=1),t.y<B2&&t.y>$2&&(t.y=1)}function cl(e,t){e.min=e.min+t,e.max=e.max+t}function U2(e,t,n,r,i=.5){const a=Mt(e.min,e.max,i);nv(e,t,n,a,r)}function ul(e,t){U2(e.x,t.x,t.scaleX,t.scale,t.originX),U2(e.y,t.y,t.scaleY,t.scale,t.originY)}function LD(e,t){return DD(SZ(e.getBoundingClientRect(),t))}function jZ(e,t,n){const r=LD(e,n),{scroll:i}=t;return i&&(cl(r.x,i.offset.x),cl(r.y,i.offset.y)),r}const RD=({current:e})=>e?e.ownerDocument.defaultView:null,NZ=new WeakMap;class CZ{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Wt(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Dd(d).point)},a=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=xY(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),_r(x=>{let v=this.getAxisMotionValue(x).get()||0;if(Ai.test(v)){const{projection:b}=this.visualElement;if(b&&b.layout){const w=b.layout.layoutBox[x];w&&(v=wr(w)*(parseFloat(v)/100))}}this.originPoint[x]=v}),g&&Ct.postRender(()=>g(d,f)),Kx(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},s=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:x}=f;if(p&&this.currentDirection===null){this.currentDirection=PZ(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,x),this.updateAxis("y",f.point,x),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),c=()=>_r(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new AD(t,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:o,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:RD(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Ct.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Tf(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=mZ(s,this.constraints[t],this.elastic[t])),a.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&sl(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=gZ(i.layoutBox,n):this.constraints=!1,this.elastic=bZ(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&_r(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=vZ(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!sl(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=jZ(r,i.root,this.visualElement.getTransformPagePoint());let s=yZ(i.layout.layoutBox,a);if(n){const o=n(wZ(s));this.hasMutatedConstraints=!!o,o&&(s=DD(o))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=_r(d=>{if(!Tf(d,n,this.currentDirection))return;let f=c&&c[d]||{};s&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Kx(this.visualElement,t),r.start(w1(t,r,0,n,this.visualElement,!1))}stopAnimation(){_r(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){_r(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){_r(n=>{const{drag:r}=this.getProps();if(!Tf(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:o}=i.layout.layoutBox[n];a.set(t[n]-Mt(s,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!sl(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};_r(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const c=o.get();i[s]=xZ({min:c,max:c},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),_r(s=>{if(!Tf(s,t,null))return;const o=this.getAxisMotionValue(s),{min:c,max:u}=this.constraints[s];o.set(Mt(c,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;NZ.set(this.visualElement,this);const t=this.visualElement.current,n=yu(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();sl(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ct.read(r);const s=Qu(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(_r(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{s(),n(),a(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:s=ev,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:s,dragMomentum:o}}}function Tf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function PZ(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class EZ extends ws{constructor(t){super(t),this.removeGroupControls=yr,this.removeListeners=yr,this.controls=new CZ(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||yr}unmount(){this.removeGroupControls(),this.removeListeners()}}const V2=e=>(t,n)=>{e&&Ct.postRender(()=>e(t,n))};class AZ extends ws{constructor(){super(...arguments),this.removePointerDownListener=yr}onPointerDown(t){this.session=new AD(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:RD(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:V2(t),onStart:V2(n),onMove:r,onEnd:(a,s)=>{delete this.session,i&&Ct.postRender(()=>i(a,s))}}}mount(){this.removePointerDownListener=yu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const yh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function W2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const _c={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Fe.test(e))e=parseFloat(e);else return e;const n=W2(e,t.target.x),r=W2(e,t.target.y);return`${n}% ${r}%`}},TZ={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hs.parse(e);if(i.length>5)return r;const a=hs.createTransformer(e),s=typeof i[0]!="number"?1:0,o=n.x.scale*t.x,c=n.y.scale*t.y;i[0+s]/=o,i[1+s]/=c;const u=Mt(o,c,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),a(i)}};class OZ extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;ZG(_Z),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),yh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,s=r.projection;return s&&(s.isPresent=a,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?s.promote():s.relegate()||Ct.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Xw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function FD(e){const[t,n]=b4(),r=m.useContext(Uw);return l.jsx(OZ,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(E4),isPresent:t,safeToRemove:n})}const _Z={borderRadius:{..._c,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_c,borderTopRightRadius:_c,borderBottomLeftRadius:_c,borderBottomRightRadius:_c,boxShadow:TZ};function DZ(e,t,n){const r=Mn(e)?e:Xu(e);return r.start(w1("",r,t,n)),r.animation}function MZ(e){return e instanceof SVGElement&&e.tagName!=="svg"}const IZ=(e,t)=>e.depth-t.depth;class LZ{constructor(){this.children=[],this.isDirty=!1}add(t){u1(this.children,t),this.isDirty=!0}remove(t){d1(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(IZ),this.isDirty=!1,this.children.forEach(t)}}function RZ(e,t){const n=Ti.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(fs(r),e(a-t))};return Ct.read(r,!0),()=>fs(r)}const zD=["TopLeft","TopRight","BottomLeft","BottomRight"],FZ=zD.length,H2=e=>typeof e=="string"?parseFloat(e):e,K2=e=>typeof e=="number"||Fe.test(e);function zZ(e,t,n,r,i,a){i?(e.opacity=Mt(0,n.opacity!==void 0?n.opacity:1,$Z(r)),e.opacityExit=Mt(t.opacity!==void 0?t.opacity:1,0,BZ(r))):a&&(e.opacity=Mt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<FZ;s++){const o=`border${zD[s]}Radius`;let c=q2(t,o),u=q2(n,o);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||K2(c)===K2(u)?(e[o]=Math.max(Mt(H2(c),H2(u),r),0),(Ai.test(u)||Ai.test(c))&&(e[o]+="%")):e[o]=u}(t.rotate||n.rotate)&&(e.rotate=Mt(t.rotate||0,n.rotate||0,r))}function q2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $Z=$D(0,.5,iD),BZ=$D(.5,.95,yr);function $D(e,t,n){return r=>r<e?0:r>t?1:n(Rl(e,t,r))}function G2(e,t){e.min=t.min,e.max=t.max}function Pr(e,t){G2(e.x,t.x),G2(e.y,t.y)}function Y2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function X2(e,t,n,r,i){return e-=t,e=dp(e,1/n,r),i!==void 0&&(e=dp(e,1/i,r)),e}function UZ(e,t=0,n=1,r=.5,i,a=e,s=e){if(Ai.test(t)&&(t=parseFloat(t),t=Mt(s.min,s.max,t/100)-s.min),typeof t!="number")return;let o=Mt(a.min,a.max,r);e===a&&(o-=t),e.min=X2(e.min,t,n,o,i),e.max=X2(e.max,t,n,o,i)}function Z2(e,t,[n,r,i],a,s){UZ(e,t[n],t[r],t[i],t.scale,a,s)}const VZ=["x","scaleX","originX"],WZ=["y","scaleY","originY"];function Q2(e,t,n,r){Z2(e.x,t,VZ,n?n.x:void 0,r?r.x:void 0),Z2(e.y,t,WZ,n?n.y:void 0,r?r.y:void 0)}function J2(e){return e.translate===0&&e.scale===1}function BD(e){return J2(e.x)&&J2(e.y)}function eC(e,t){return e.min===t.min&&e.max===t.max}function HZ(e,t){return eC(e.x,t.x)&&eC(e.y,t.y)}function tC(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function UD(e,t){return tC(e.x,t.x)&&tC(e.y,t.y)}function nC(e){return wr(e.x)/wr(e.y)}function rC(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class KZ{constructor(){this.members=[]}add(t){u1(this.members,t),t.scheduleRender()}remove(t){if(d1(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function qZ(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||a||s)&&(r=`translate3d(${i}px, ${a}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const o=e.x.scale*t.x,c=e.y.scale*t.y;return(o!==1||c!==1)&&(r+=`scale(${o}, ${c})`),r||"none"}const Ls={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Jc=typeof window<"u"&&window.MotionDebug!==void 0,G0=["","X","Y","Z"],GZ={visibility:"hidden"},iC=1e3;let YZ=0;function Y0(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function VD(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Z4(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ct,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&VD(r)}function WD({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},o=t==null?void 0:t()){this.id=YZ++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Jc&&(Ls.totalNodes=Ls.resolvedTargetDeltas=Ls.recalculatedProjection=0),this.nodes.forEach(QZ),this.nodes.forEach(rQ),this.nodes.forEach(iQ),this.nodes.forEach(JZ),Jc&&window.MotionDebug.record(Ls)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new LZ)}addEventListener(s,o){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new f1),this.eventHandlers.get(s).add(o)}notifyListeners(s,...o){const c=this.eventHandlers.get(s);c&&c.notify(...o)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,o=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=MZ(s),this.instance=s;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),o&&(u||c)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=RZ(h,250),yh.hasAnimatedSinceResize&&(yh.hasAnimatedSinceResize=!1,this.nodes.forEach(sC))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||cQ,{onLayoutAnimationStart:x,onLayoutAnimationComplete:v}=d.getProps(),b=!this.targetLayout||!UD(this.targetLayout,g)||p,w=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const S={...s1(y,"layout"),onPlay:x,onComplete:v};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else h||sC(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,fs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(aQ),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&VD(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:o,layout:c}=this.options;if(o===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(aC);return}this.isUpdating||this.nodes.forEach(tQ),this.isUpdating=!1,this.nodes.forEach(nQ),this.nodes.forEach(XZ),this.nodes.forEach(ZZ),this.clearAllSnapshots();const o=Ti.now();yn.delta=da(0,1e3/60,o-yn.timestamp),yn.timestamp=o,yn.isProcessing=!0,z0.update.process(yn),z0.preRender.process(yn),z0.render.process(yn),yn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eQ),this.sharedNodes.forEach(sQ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Wt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(o=!1),o){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!BD(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(o||Is(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const o=this.measurePageBox();let c=this.removeElementScroll(o);return s&&(c=this.removeTransform(c)),uQ(c),{animationId:this.root.animationId,measuredBox:o,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:o}=this.options;if(!o)return Wt();const c=o.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(dQ))){const{scroll:d}=this.root;d&&(cl(c.x,d.offset.x),cl(c.y,d.offset.y))}return c}removeElementScroll(s){var o;const c=Wt();if(Pr(c,s),!((o=this.scroll)===null||o===void 0)&&o.wasRoot)return c;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Pr(c,s),cl(c.x,f.offset.x),cl(c.y,f.offset.y))}return c}applyTransform(s,o=!1){const c=Wt();Pr(c,s);for(let u=0;u<this.path.length;u++){const d=this.path[u];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&ul(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Is(d.latestValues)&&ul(c,d.latestValues)}return Is(this.latestValues)&&ul(c,this.latestValues),c}removeTransform(s){const o=Wt();Pr(o,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Is(u.latestValues))continue;tv(u.latestValues)&&u.updateSnapshot();const d=Wt(),f=u.measurePageBox();Pr(d,f),Q2(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Is(this.latestValues)&&Q2(o,this.latestValues),o}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==yn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var o;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=yn.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Wt(),this.relativeTargetOrigin=Wt(),vu(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Pr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Wt(),this.targetWithTransforms=Wt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pZ(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Pr(this.target,this.layout.layoutBox),ID(this.target,this.targetDelta)):Pr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Wt(),this.relativeTargetOrigin=Wt(),vu(this.relativeTargetOrigin,this.target,p.target),Pr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Jc&&Ls.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||tv(this.parent.latestValues)||MD(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const o=this.getLead(),c=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===yn.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;Pr(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;kZ(this.layoutCorrected,this.treeScale,this.path,c),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Wt());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Y2(this.prevProjectionDelta.x,this.projectionDelta.x),Y2(this.prevProjectionDelta.y,this.projectionDelta.y)),xu(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!rC(this.projectionDelta.x,this.prevProjectionDelta.x)||!rC(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),Jc&&Ls.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var o;if((o=this.options.visualElement)===null||o===void 0||o.scheduleRender(),s){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ll(),this.projectionDelta=ll(),this.projectionDeltaWithTransform=ll()}setAnimationOrigin(s,o=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=ll();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const h=Wt(),p=c?c.source:void 0,g=this.layout?this.layout.source:void 0,y=p!==g,x=this.getStack(),v=!x||x.members.length<=1,b=!!(y&&!v&&this.options.crossfade===!0&&!this.path.some(lQ));this.animationProgress=0;let w;this.mixTargetDelta=S=>{const k=S/1e3;oC(f.x,s.x,k),oC(f.y,s.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(vu(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),oQ(this.relativeTarget,this.relativeTargetOrigin,h,k),w&&HZ(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Wt()),Pr(w,this.relativeTarget)),y&&(this.animationValues=d,zZ(d,u,this.latestValues,k,b,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ct.update(()=>{yh.hasAnimatedSinceResize=!0,this.currentAnimation=DZ(0,iC,{...s,onUpdate:o=>{this.mixTargetDelta(o),s.onUpdate&&s.onUpdate(o)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(iC),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:c,layout:u,latestValues:d}=s;if(!(!o||!c||!u)){if(this!==s&&this.layout&&u&&HD(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Wt();const f=wr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+f;const h=wr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+h}Pr(o,c),ul(o,d),xu(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new KZ),this.sharedNodes.get(s).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:o}=this.options;return o?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:o}=this.options;return o?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(o=!0),!o)return;const u={};c.z&&Y0("z",s,u,this.animationValues);for(let d=0;d<G0.length;d++)Y0(`rotate${G0[d]}`,s,u,this.animationValues),Y0(`skew${G0[d]}`,s,u,this.animationValues);s.render();for(const d in u)s.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);s.scheduleRender()}getProjectionStyles(s){var o,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return GZ;const u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=mh(s==null?void 0:s.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=mh(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!Is(this.latestValues)&&(y.transform=d?d({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=qZ(this.projectionDeltaWithTransform,this.treeScale,h),d&&(u.transform=d(h,u.transform));const{x:p,y:g}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,f.animationValues?u.opacity=f===this?(c=(o=h.opacity)!==null&&o!==void 0?o:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in sp){if(h[y]===void 0)continue;const{correct:x,applyTo:v}=sp[y],b=u.transform==="none"?h[y]:x(h[y],f);if(v){const w=v.length;for(let S=0;S<w;S++)u[v[S]]=b}else u[y]=b}return this.options.layoutId&&(u.pointerEvents=f===this?mh(s==null?void 0:s.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var o;return(o=s.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(aC),this.root.sharedNodes.clear()}}}function XZ(e){e.updateLayout()}function ZZ(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,s=n.source!==e.layout.source;a==="size"?_r(f=>{const h=s?n.measuredBox[f]:n.layoutBox[f],p=wr(h);h.min=r[f].min,h.max=h.min+p}):HD(a,n.layoutBox,r)&&_r(f=>{const h=s?n.measuredBox[f]:n.layoutBox[f],p=wr(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const o=ll();xu(o,r,n.layoutBox);const c=ll();s?xu(c,e.applyTransform(i,!0),n.measuredBox):xu(c,r,n.layoutBox);const u=!BD(o);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const g=Wt();vu(g,n.layoutBox,h.layoutBox);const y=Wt();vu(y,r,p.layoutBox),UD(g,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function QZ(e){Jc&&Ls.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function JZ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eQ(e){e.clearSnapshot()}function aC(e){e.clearMeasurements()}function tQ(e){e.isLayoutDirty=!1}function nQ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function sC(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rQ(e){e.resolveTargetDelta()}function iQ(e){e.calcProjection()}function aQ(e){e.resetSkewAndRotation()}function sQ(e){e.removeLeadSnapshot()}function oC(e,t,n){e.translate=Mt(t.translate,0,n),e.scale=Mt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function lC(e,t,n,r){e.min=Mt(t.min,n.min,r),e.max=Mt(t.max,n.max,r)}function oQ(e,t,n,r){lC(e.x,t.x,n.x,r),lC(e.y,t.y,n.y,r)}function lQ(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const cQ={duration:.45,ease:[.4,0,.1,1]},cC=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),uC=cC("applewebkit/")&&!cC("chrome/")?Math.round:yr;function dC(e){e.min=uC(e.min),e.max=uC(e.max)}function uQ(e){dC(e.x),dC(e.y)}function HD(e,t,n){return e==="position"||e==="preserve-aspect"&&!hZ(nC(t),nC(n),.2)}function dQ(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const fQ=WD({attachResizeListener:(e,t)=>Qu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),X0={current:void 0},KD=WD({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!X0.current){const e=new fQ({});e.mount(window),e.setOptions({layoutScroll:!0}),X0.current=e}return X0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),hQ={pan:{Feature:AZ},drag:{Feature:EZ,ProjectionNode:KD,MeasureLayout:FD}};function fC(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=r[i];a&&Ct.postRender(()=>a(t,Dd(t)))}class pQ extends ws{mount(){const{current:t}=this.node;t&&(this.unmount=hY(t,n=>(fC(this.node,n,"Start"),r=>fC(this.node,r,"End"))))}unmount(){}}class mQ extends ws{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=_d(Qu(this.node.current,"focus",()=>this.onFocus()),Qu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function hC(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=r[i];a&&Ct.postRender(()=>a(t,Dd(t)))}class gQ extends ws{mount(){const{current:t}=this.node;t&&(this.unmount=yY(t,n=>(hC(this.node,n,"Start"),(r,{success:i})=>hC(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const rv=new WeakMap,Z0=new WeakMap,yQ=e=>{const t=rv.get(e.target);t&&t(e)},xQ=e=>{e.forEach(yQ)};function vQ({root:e,...t}){const n=e||document;Z0.has(n)||Z0.set(n,{});const r=Z0.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(xQ,{root:e,...t})),r[i]}function bQ(e,t,n){const r=vQ(t);return rv.set(e,n),r.observe(e),()=>{rv.delete(e),r.unobserve(e)}}const wQ={some:0,all:1};class SQ extends ws{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:wQ[i]},o=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return bQ(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(kQ(t,n))&&this.startObserver()}unmount(){}}function kQ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const jQ={inView:{Feature:SQ},tap:{Feature:gQ},focus:{Feature:mQ},hover:{Feature:pQ}},NQ={layout:{ProjectionNode:KD,MeasureLayout:FD}},iv={current:null},qD={current:!1};function CQ(){if(qD.current=!0,!!Hw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>iv.current=e.matches;e.addListener(t),t()}else iv.current=!1}const PQ=[...xD,En,hs],EQ=e=>PQ.find(yD(e)),pC=new WeakMap;function AQ(e,t,n){for(const r in t){const i=t[r],a=n[r];if(Mn(i))e.addValue(r,i);else if(Mn(a))e.addValue(r,Xu(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Xu(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const mC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class TQ{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=x1,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ti.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Ct.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=s;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=!!a,this.isControllingVariants=$m(n),this.isVariantNode=C4(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const g=h[p];c[p]!==void 0&&Mn(g)&&g.set(c[p],!1)}}mount(t){this.current=t,pC.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),qD.current||CQ(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:iv.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){pC.delete(this.current),this.projection&&this.projection.unmount(),fs(this.notifyUpdate),fs(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Eo.has(t),i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Ct.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Fl){const n=Fl[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Wt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<mC.length;r++){const i=mC[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,s=t[a];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=AQ(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Xu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(mD(i)||sD(i))?i=parseFloat(i):!EQ(i)&&hs.test(n)&&(i=fD(t,n)),this.setBaseTarget(t,Mn(i)?i.get():i)),Mn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=Qw(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Mn(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new f1),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class GD extends TQ{constructor(){super(...arguments),this.KeyframeResolver=vD}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Mn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function OQ(e){return window.getComputedStyle(e)}class _Q extends GD{constructor(){super(...arguments),this.type="html",this.renderInstance=I4}readValueFromInstance(t,n){if(Eo.has(n)){const r=y1(n);return r&&r.default||0}else{const r=OQ(t),i=(_4(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return LD(t,n)}build(t,n,r){t1(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return a1(t,n,r)}}class DQ extends GD{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Eo.has(n)){const r=y1(n);return r&&r.default||0}return n=L4.has(n)?n:Yw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return z4(t,n,r)}build(t,n,r){n1(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){R4(t,n,r,i)}mount(t){this.isSVGTag=i1(t.tagName),super.mount(t)}}const MQ=(e,t)=>Zw(e)?new DQ(t):new _Q(t,{allowProjection:e!==m.Fragment}),IQ=sY({...iZ,...jQ,...hQ,...NQ},MQ),Zt=wG(IQ),LQ={Core:mo,Network:Ml,Security:ai,Database:ZO,Utility:qs,Custom:qs,Monitoring:mo,Automation:ai},YD=e=>LQ[e]||qs;async function av(e,t){const n=await e("skill.list",t);return{skills:(n.skills??[]).map(i=>({...i,icon:YD(i.type||"Custom"),version:`v${i.version||1}`,enabled:i.enabled??!0})),hasMore:n.hasMore??!1}}async function sv(e,t){var r,i,a;const n=await e("skill.get",{id:t});return n?{...n,icon:YD(n.type||"Custom"),version:`v${n.version||1}`,enabled:n.enabled??!0,specs:(r=n.files)==null?void 0:r.specs,scripts:(a=(i=n.files)==null?void 0:i.scripts)==null?void 0:a.map((s,o)=>({id:`s-${o}`,info:s.name.endsWith(".py")?"python":"shell",name:s.name,content:s.content})),publishedFiles:n.publishedFiles??null,stagingVersion:n.stagingVersion}:null}async function RQ(e,t,n){var i;const r=(i=t.scripts)==null?void 0:i.map(a=>({name:a.name,content:a.content}));n?await e("skill.create",{name:t.name,type:t.type,specs:t.specs,scripts:r,labels:t.labels}):await e("skill.update",{id:String(t.id),name:t.name,type:t.type,specs:t.specs,scripts:r})}async function FQ(e,t){await e("skill.delete",{id:t})}async function zQ(e,t,n){return e("skill.vote",{id:t,vote:n})}async function $Q(e,t,n){return e("skill.revert",{id:t,reason:n})}async function BQ(e,t,n,r,i){return e("skill.review",{id:t,decision:n,reason:r,stagingVersion:i})}async function UQ(e,t,n){return e("skill.submit",{id:t,contributeToTeam:n})}async function VQ(e,t){return e("skill.withdraw",{id:t})}async function gC(e,t){return e("skill.getReview",{id:t})}async function WQ(e,t){return e("skill.history",{id:t})}async function HQ(e,t,n){return e("skill.diff",{id:t,teamDiff:n})}async function XD(e,t,n){return e("skill.rollback",{id:t,version:n})}async function KQ(e){return(await e("label.list")).labels??[]}async function yC(e,t,n){return e("skill.updateLabels",{id:t,labels:n})}async function qQ(e,t,n){return e("skill.fork",{sourceId:t,...n})}async function ZD(e,t){return qQ(e,String(t))}function xC(e,t){const n={...e,hypotheses:[...e.hypotheses]};switch(t.type){case"phase":n.phase=t.phase,t.detail&&(n.currentAction=t.detail);break;case"hypothesis":{const r=t.id,i=n.hypotheses.findIndex(s=>s.id===r),a={id:r,text:t.text||(i>=0?n.hypotheses[i].text:""),status:t.status,confidence:t.confidence,callsUsed:i>=0?n.hypotheses[i].callsUsed:0,maxCalls:i>=0?n.hypotheses[i].maxCalls:10};i>=0?n.hypotheses[i]={...n.hypotheses[i],...a}:n.hypotheses.push(a);break}case"tool_exec":{const r=t.hypothesisId,i=t.callsUsed,a=t.maxCalls,s=t.tool,o=t.command,c=o.length>60?o.slice(0,57)+"...":o;if(n.currentAction=`${r?r+" ":""}[${i}/${a}] ${s}: ${c}`,r){const u=n.hypotheses.findIndex(d=>d.id===r);u>=0&&(n.hypotheses[u]={...n.hypotheses[u],callsUsed:i,maxCalls:a,lastAction:`[${i}/${a}] ${s}: ${c}`,status:n.hypotheses[u].status==="pending"?"validating":n.hypotheses[u].status})}break}case"budget_exhausted":{const r=t.hypothesisId;if(r){const i=n.hypotheses.findIndex(a=>a.id===r);i>=0&&(n.hypotheses[i]={...n.hypotheses[i],callsUsed:t.callsUsed})}break}}return n}const Q0="siclaw_current_session",J0="siclaw_session_workspace",vC="siclaw_selected_brain";function ey(){return[{id:"triage",label:"Quick triage",status:"pending"},{id:"hypotheses",label:"Propose hypotheses",status:"pending"},{id:"deep_search",label:"Deep search validation",status:"pending"},{id:"conclusion",label:"Present findings",status:"pending"}]}function GQ(e,t){try{const n=JSON.parse(t);return QD(e,n)}catch{return t}}function QD(e,t){if(!t)return"";const n=e.toLowerCase();if(n==="bash"||n==="shell"||n==="command")return t.command||t.cmd||"";if(n==="node_exec"){const i=t.node||"",a=t.command||"";return i&&a?`${i} $ ${a}`:i||a}if(n==="node_script"){const i=t.node||"",a=t.skill||"",s=t.script||"",o=t.args||"",c=[a,s].filter(Boolean).join("/"),u=o?`${c} ${o}`:c;return i&&u?`${i} $ ${u}`:i||u}if(n==="pod_exec"){const i=t.pod||"",a=t.namespace||"",s=t.command||"",o=a?`${i} -n ${a}`:i;return o&&s?`${o} $ ${s}`:o||s}if(n==="pod_script"){const i=t.pod||"",a=t.namespace||"",s=t.skill||"",o=t.script||"",c=t.args||"",u=a?`${i} -n ${a}`:i,d=[s,o].filter(Boolean).join("/"),f=c?`${d} ${c}`:d;return u&&f?`${u} $ ${f}`:u||f}if(n==="pod_nsenter_exec"){const i=t.pod||"",a=t.namespace||"",s=t.command||"",o=a?`${i} -n ${a}`:i;return o&&s?`${o} $ ${s}`:o||s}if(n==="read"||n==="readfile"||n==="write"||n==="writefile"||n==="edit")return t.file_path||t.path||"";if(n==="grep"||n==="search"){const i=t.pattern||"",a=t.path||"";return a?`${i} in ${a}`:i}if(n==="glob")return t.pattern||"";if(n==="create_skill")return t.name||"";if(n==="run_skill"){const i=t.skill||"",a=t.script||"",s=t.args||"",o=[i,a].filter(Boolean).join("/");return s?`${o} ${s}`:o}if(n==="task_plan")return t.title||"";if(n==="deep_search")return t.question||"";if(n==="update_plan"){const i=t.step,a=t.status||"";return i!=null?`Step ${i}: ${a}`:a}return Object.values(t).filter(i=>typeof i=="string"&&i.length>0)[0]||JSON.stringify(t)}function YQ(){const{currentWorkspace:e}=Ad(),t=e==null?void 0:e.id,n=m.useRef(t),[r,i]=m.useState([]),[a,s]=m.useState(null),[o,c]=m.useState(null),[u,d]=m.useState(null),f="siclaw_dp_active",[h,p]=m.useState(()=>sessionStorage.getItem(f)==="true"),[g,y]=m.useState([]),[x,v]=m.useState(()=>{const $=sessionStorage.getItem(Q0);return!$||sessionStorage.getItem(J0)!==(t??"")?null:$}),[b,w]=m.useState(!1),[S,k]=m.useState([]),[j,N]=m.useState(!1),[P,T]=m.useState(!1),[E,_]=m.useState(!1),[C,A]=m.useState(null),[M,B]=m.useState(!1),ae=m.useRef(!1),[Q,I]=m.useState([]),[H,O]=m.useState(null),[oe,re]=m.useState(null),[D,G]=m.useState([]),[te,ee]=m.useState(null),[Z,ce]=m.useState(null),[J,ne]=m.useState(()=>localStorage.getItem(vC)||"pi-agent"),[be,Y]=m.useState(null),R=m.useRef(()=>{}),F=m.useRef(()=>{}),ue=m.useRef(()=>{}),le=m.useRef(()=>{}),ze=m.useRef(0),Be=m.useRef(),et=m.useRef(x);m.useEffect(()=>{et.current=x},[x]);const pt=m.useRef(0),Pt=m.useRef(async()=>{}),Vt=m.useRef(new Set),ut=($,K)=>{const ie=setTimeout(()=>{Vt.current.delete(ie),$()},K);Vt.current.add(ie)},tt=()=>{for(const $ of Vt.current)clearTimeout($);Vt.current.clear()},je=()=>{d(null),c(null),s(null),p(!1)};m.useEffect(()=>{x?(sessionStorage.setItem(Q0,x),sessionStorage.setItem(J0,t??"")):(sessionStorage.removeItem(Q0),sessionStorage.removeItem(J0))},[x,t]),m.useEffect(()=>{sessionStorage.setItem(f,String(h))},[h]),m.useEffect(()=>{localStorage.setItem(vC,J)},[J]);const W=m.useCallback($=>{ne($)},[]),se=m.useCallback($=>{var K,ie,ve;if($.type==="event"&&$.payload){const we=$.payload,ke=we.sessionId;if(ke&&ke!==et.current)return;switch(ze.current=Date.now(),we.type){case"message_update":{const fe=we.assistantMessageEvent;(fe==null?void 0:fe.type)==="text_delta"&&fe.delta&&i(Se=>{const Ne=Se[Se.length-1];return Ne!=null&&Ne.isStreaming&&Ne.role==="assistant"?[...Se.slice(0,-1),{...Ne,content:Ne.content+fe.delta}]:[...Se,{id:`msg-${Date.now()}`,role:"assistant",content:fe.delta,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),isStreaming:!0}]});break}case"tool_execution_start":{const fe=we.toolName,Se=we.args,Ne=QD(fe??"",Se),$e=fe==="update_plan"||fe==="end_investigation";fe==="deep_search"&&(s(Pe=>Pe??{hypotheses:[]}),d(Pe=>{if(Pe)return Pe;const Re=ey();return Re[0].status="done",Re[1].status="done",Re[2].status="in_progress",Re}),c(Pe=>Pe??"deep_search")),fe==="end_investigation"&&je(),i(Pe=>[...Pe,{id:`tool-${Date.now()}`,role:"tool",content:"",toolName:fe??"tool",toolInput:Ne,toolStatus:"running",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),isStreaming:!0,hidden:$e}]);break}case"tool_execution_end":{const fe=we.result,Se=((K=fe==null?void 0:fe.content)==null?void 0:K.filter(st=>st.type==="text").map(st=>st.text??"").join(""))??"",Ne=fe==null?void 0:fe.details,$e=we.isError,Pe=we.dbMessageId;we.toolName==="deep_search"&&(d(st=>st&&st.map(Ye=>Ye.status==="pending"||Ye.status==="in_progress"?{...Ye,status:"done"}:Ye)),c(null),ut(()=>je(),3e3),ut(()=>{s(st=>st&&st.hypotheses.every(Ye=>Ye.status!=="validating"&&Ye.status!=="pending")?null:st)},5e3)),i(st=>{const Ye=st[st.length-1];return(Ye==null?void 0:Ye.role)==="tool"&&Ye.isStreaming?[...st.slice(0,-1),{...Ye,content:Se,toolStatus:$e?"error":"success",isStreaming:!1,...Ne?{toolDetails:Ne}:{},...Pe?{id:Pe}:{}}]:st});break}case"tool_progress":{const fe=we.progress;if(we.toolName==="deep_search"&&fe&&(s(Se=>xC(Se??{hypotheses:[]},fe)),fe.type==="phase")){const Ne=(typeof fe.phase=="string"?fe.phase:"").match(/(\d+)/),$e=Ne?parseInt(Ne[1],10):0;$e>=1&&d(Pe=>{if(!Pe)return Pe;const Re=Pe.map(Ye=>({...Ye}));for(let Ye=0;Ye<Re.length;Ye++)Ye<$e-1?Re[Ye].status!=="done"&&Re[Ye].status!=="skipped"&&(Re[Ye].status="done"):Ye===$e-1&&Re[Ye].status!=="done"&&Re[Ye].status!=="skipped"&&(Re[Ye].status="in_progress");const st=Re.find(Ye=>Ye.status==="in_progress");return c(st?st.id:null),Re})}break}case"message_start":{const fe=we.message;if((fe==null?void 0:fe.customType)==="dp-checklist-sync"&&((ie=fe.details)!=null&&ie.items)){const Se=fe.details.items;d(Ne=>{if(!Ne)return Ne;const $e=Ne.map(Re=>({...Re}));for(const Re of Se){const st=$e.find(Ye=>Ye.id===Re.id);st&&(st.status=Re.status,Re.summary&&(st.summary=Re.summary))}return $e.every(Re=>Re.status==="done"||Re.status==="skipped")&&ut(()=>je(),3e3),$e});break}if((fe==null?void 0:fe.role)==="user"){const Se=((ve=fe.content)==null?void 0:ve.filter(Ne=>Ne.type==="text").map(Ne=>Ne.text??"").join(""))??"";Se&&k(Ne=>{const $e=Ne.indexOf(Se);return $e<0?Ne:(i(Pe=>[...Pe,{id:`msg-${Date.now()}`,role:"user",content:Se,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}]),[...Ne.slice(0,$e),...Ne.slice($e+1)])})}break}case"message_end":{const fe=we.message;if((fe==null?void 0:fe.role)==="toolResult"&&fe.details&&Object.keys(fe.details).length>0){const Se=fe.toolName;i(Ne=>{for(let $e=Ne.length-1;$e>=0;$e--){const Pe=Ne[$e];if(Pe.role==="tool"&&(!Se||Pe.toolName===Se)&&!Pe.toolDetails){const Re=[...Ne];return Re[$e]={...Pe,toolDetails:fe.details},Re}}return Ne})}i(Se=>Se.map(Ne=>Ne.isStreaming&&Ne.role==="assistant"?{...Ne,isStreaming:!1}:Ne));break}case"auto_compaction_start":B(!0);break;case"auto_compaction_end":B(!1),F.current();break;case"turn_end":i(fe=>fe.map(Se=>Se.isStreaming?{...Se,isStreaming:!1}:Se)),k(fe=>fe.length>0?fe.slice(1):fe);break;case"prompt_done":i(fe=>fe.map(Se=>Se.isStreaming?{...Se,isStreaming:!1}:Se)),ae.current||w(!1),k([]),R.current(),F.current(),ue.current(),le.current(),d(fe=>{if(!fe)return fe;const Se=fe.find(Pe=>Pe.id==="hypotheses");if(Se&&Se.status!=="done"&&Se.status!=="skipped"||!fe.some(Pe=>Pe.status==="pending"||Pe.status==="in_progress"))return fe;const $e=fe.map(Pe=>Pe.status==="pending"||Pe.status==="in_progress"?{...Pe,status:"done",summary:Pe.summary||"Auto-completed"}:Pe);return ut(()=>je(),3e3),$e});break}}},[]),{status:Te,sendRpc:pe,isConnected:L}=Rt({onMessage:se}),ye=m.useCallback(async()=>{if(L)try{const $=await av(pe);I($.skills)}catch($){console.error("Failed to load skills:",$)}},[L,pe]),_e=m.useCallback(async()=>{if(L)try{const $=await pe("model.list"),K=$.models??[];if(G(K),ee($.default??null),K.length>0)if($.default){const ie=K.find(ve=>ve.provider===$.default.provider&&ve.id===$.default.modelId);ce(ie||(ve=>ve??K[0]))}else ce(ie=>ie??K[0])}catch($){console.error("Failed to load models:",$)}},[L,pe]),Ue=m.useCallback(async()=>{if(L)try{const $=await pe("system.status");O($)}catch{}},[L,pe]),mt=m.useCallback(async()=>{if(!(!L||!x||Z))try{const $=await pe("model.get",{sessionId:x});$.model&&ce($.model),$.brainType&&Y($.brainType)}catch{}},[L,x,Z,pe]),rt=m.useCallback(($,K)=>{re({id:$,name:K})},[]),gt=m.useCallback(()=>{re(null)},[]),Kt=m.useCallback(async()=>{if(L)try{const $={};t&&($.workspaceId=t);const K=await pe("session.list",$);y(K.sessions??[])}catch($){console.error("Failed to load sessions:",$)}},[L,pe,t]);R.current=Kt,ue.current=_e,le.current=mt;const Et=m.useCallback(async()=>{if(!(!L||!x))try{const $=await pe("chat.context",{sessionId:x});$&&A({tokens:$.tokens,contextWindow:$.contextWindow,percent:$.percent,inputTokens:$.inputTokens,outputTokens:$.outputTokens,cacheReadTokens:$.cacheReadTokens,cacheWriteTokens:$.cacheWriteTokens,cost:$.cost})}catch{}},[L,x,pe]);F.current=Et;const de=$=>$.map(K=>({...K,toolInput:K.role==="tool"&&K.toolInput?GQ(K.toolName??"",K.toolInput):void 0,isoTimestamp:K.timestamp,timestamp:K.timestamp?new Date(K.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"",hidden:K.hidden||K.role==="tool"&&(K.toolName==="update_plan"||K.toolName==="manage_checklist")})),Me=m.useCallback(async $=>{if(!L)return;const K=++pt.current;v($),i([]),T(!1),N(!0),w(!1),k([]),tt(),je();try{const ie=await pe("chat.history",{sessionId:$});if(pt.current!==K)return;i(de(ie.messages??[])),T(ie.hasMore??!1)}catch(ie){pt.current===K&&console.error("Failed to load history:",ie)}finally{pt.current===K&&N(!1)}try{const ie=await pe("model.get",{sessionId:$});if(pt.current!==K)return;ie.model&&ce(ie.model),ie.brainType&&Y(ie.brainType)}catch{}pt.current===K&&await Pt.current($)},[L,pe]),Ke=m.useCallback(async()=>{if(!L||!x||!P||E)return;const $=r[0];if($){_(!0);try{const K=await pe("chat.history",{sessionId:x,before:$.isoTimestamp}),ie=de(K.messages??[]);i(ve=>[...ie,...ve]),T(K.hasMore??!1)}catch(K){console.error("Failed to load more history:",K)}finally{_(!1)}}},[L,x,P,E,r,pe]),yt=m.useCallback(async $=>{if(!L||!$.trim())return;if(b){try{await pe("chat.steer",{text:$,sessionId:et.current}),k(ie=>[...ie,$])}catch(ie){console.error("Failed to steer:",ie)}return}$.startsWith("[Deep Investigation]")&&(d(ey().map(ie=>ie.id==="triage"?{...ie,status:"in_progress"}:ie)),c("triage"));const K={id:`user-${Date.now()}`,role:"user",content:$,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};i(ie=>[...ie,K]),w(!0);try{const ie=await pe("chat.send",{sessionId:x,message:$,modelProvider:Z==null?void 0:Z.provider,modelId:Z==null?void 0:Z.id,brainType:J,workspaceId:t});ie.brainType&&Y(ie.brainType),ie.sessionId&&ie.sessionId!==x&&(v(ie.sessionId),R.current())}catch(ie){console.error("Failed to send message:",ie),w(!1)}},[L,b,x,Z,J,pe]),js=m.useCallback(async()=>{if(L){ae.current=!0,k([]),tt(),je(),i($=>$.map(K=>K.isStreaming?{...K,isStreaming:!1,...K.role==="tool"?{toolStatus:"aborted"}:{}}:K));try{await pe("chat.abort",{sessionId:et.current})}catch($){console.error("Failed to abort:",$)}ae.current=!1,w(!1)}},[L,pe]),_o=m.useCallback(async()=>{if(k([]),!!L)try{await pe("chat.clearQueue",{sessionId:et.current})}catch($){console.error("Failed to clear queue:",$)}},[L,pe]),pc=m.useCallback(async $=>{if(k(K=>{const ie=[...K];return ie.splice($,1),ie}),!!L)try{await pe("chat.clearQueue",{sessionId:et.current}),k(K=>{for(const ie of K)pe("chat.steer",{text:ie,sessionId:et.current}).catch(()=>{});return K})}catch(K){console.error("Failed to remove pending message:",K)}},[L,pe]),Ns=m.useCallback(async($,K)=>{if(i(ie=>ie.map(ve=>ve.id===$?{...ve,metadata:{...ve.metadata,...K}}:ve)),L)try{await pe("message.updateMeta",{id:$,metadata:K})}catch(ie){console.error("Failed to persist message metadata:",ie)}},[L,pe]),qr=m.useCallback(()=>{tt(),je()},[]),pi=m.useCallback(()=>{qr(),yt(`[DP_EXIT]
|
|
607
|
+
Please briefly summarize the current investigation progress and findings.`)},[qr,yt]),Fg=m.useCallback($=>{d(K=>K&&K.map(ie=>ie.id==="triage"&&ie.status!=="done"?{...ie,status:"done",summary:ie.summary||"Done"}:ie.id==="hypotheses"&&ie.status!=="done"?{...ie,status:"done",summary:ie.summary||"Confirmed"}:ie.id==="deep_search"?{...ie,status:"in_progress"}:ie)),c("deep_search"),s({hypotheses:$.map(K=>({id:K.id,text:K.text,status:"pending",confidence:K.confidence,callsUsed:0,maxCalls:10}))}),pe("chat.confirmHypotheses",{sessionId:et.current}).catch(()=>{})},[pe]),zg=m.useCallback(()=>{v(null),i([]),A(null),B(!1),w(!1),k([]);const $=te?D.find(K=>K.provider===te.provider&&K.id===te.modelId):null;ce($??D[0]??null),Y(null),tt(),je(),Ue()},[D,te,Ue]),z=m.useCallback(async $=>{if(L)try{await pe("session.delete",{sessionId:$}),x===$&&(v(null),i([])),Kt()}catch(K){console.error("Failed to delete session:",K)}},[L,pe,x,Kt]),V=m.useRef();m.useEffect(()=>(!L&&b&&(V.current=setTimeout(()=>{w(!1),ae.current=!1,k([]),i($=>$.map(K=>K.isStreaming?{...K,isStreaming:!1,...K.role==="tool"?{toolStatus:"error"}:{}}:K)),tt(),d($=>$?$.map(K=>K.status==="in_progress"||K.status==="pending"?{...K,status:"error",summary:"Connection lost"}:K):null),c(null),s(null),ut(()=>je(),1e4)},15e3)),()=>{V.current&&(clearTimeout(V.current),V.current=void 0)}),[L,b]);const X=u?45e3:12e4;m.useEffect(()=>{if(b)return ze.current=Date.now(),Be.current=setInterval(()=>{Date.now()-ze.current>X&&(console.warn("[usePilot] Stale loading detected — resetting UI"),w(!1),ae.current=!1,k([]),i($=>$.map(K=>K.isStreaming?{...K,isStreaming:!1,...K.role==="tool"?{toolStatus:"error"}:{}}:K)),tt(),d($=>$?$.map(K=>K.status==="in_progress"||K.status==="pending"?{...K,status:"error",summary:"Response timeout"}:K):null),c(null),s(null),ut(()=>je(),1e4))},15e3),()=>clearInterval(Be.current);Be.current&&(clearInterval(Be.current),Be.current=void 0)},[b,X]);const he=m.useCallback(async $=>{var ie;if(!L)return;const K=$??et.current;if(K)try{const ve=await pe("chat.dpProgress",{sessionId:K});if(ve.promptActive&&w(!0),!ve.promptActive)return;let we={hypotheses:[]};if(ve.events&&ve.events.length>0){for(const Ne of ve.events)we=xC(we,Ne);s(we)}const ke=we.phase,Ce=ey(),fe=ke?parseInt(((ie=ke.match(/(\d+)/))==null?void 0:ie[1])??"0"):0;if(fe>=1)for(let Ne=0;Ne<Ce.length;Ne++)Ne<fe-1?Ce[Ne].status="done":Ne===fe-1&&(Ce[Ne].status="in_progress");else Ce[0].status="done",Ce[1].status="done",Ce[2].status="in_progress";d(Ce);const Se=Ce.find(Ne=>Ne.status==="in_progress");c(Se?Se.id:null)}catch{}},[L,pe]);return Pt.current=he,m.useEffect(()=>{n.current!==t&&n.current!==void 0&&(++pt.current,v(null),i([]),A(null),B(!1),Y(null),tt(),je(),L&&(async()=>{try{const $={};t&&($.workspaceId=t);const ie=(await pe("session.list",$)).sessions??[];y(ie),ie.length>0&&Me(ie[0].key)}catch($){console.error("Failed to load sessions:",$)}})()),n.current=t},[t]),m.useEffect(()=>{L&&((async()=>{try{const $={};t&&($.workspaceId=t);const ie=(await pe("session.list",$)).sessions??[];y(ie),x?Me(x):ie.length>0&&Me(ie[0].key)}catch($){console.error("Failed to load sessions:",$)}})(),ye(),_e(),Ue())},[L]),m.useEffect(()=>{const $=new BroadcastChannel("siclaw-model-config");return $.onmessage=()=>{ue.current()},()=>$.close()},[]),{messages:r,investigationProgress:a,dpActive:h,setDpActive:p,dpFocus:o,dpChecklist:u,sessions:g,currentSessionKey:x,isLoading:b,isLoadingHistory:j,hasMore:P,isLoadingMore:E,contextUsage:C,isCompacting:M,skills:Q,systemStatus:H,editingSkill:oe,pendingMessages:S,wsStatus:Te,isConnected:L,sendMessage:yt,abortResponse:js,loadHistory:Me,loadMoreHistory:Ke,createSession:zg,deleteSession:z,loadSessions:Kt,setCurrentSessionKey:v,sendRpc:pe,startEditSkill:rt,clearEditSkill:gt,loadSkills:ye,loadSystemStatus:Ue,updateMessageMeta:Ns,clearPendingMessages:_o,removePendingMessage:pc,confirmHypotheses:Fg,dismissDpChecklist:qr,exitDpMode:pi,models:D,selectedModel:Z,selectedBrain:J,selectBrain:W,sessionBrainType:be}}function wa(e,t){const[n,r]=m.useState({isAdmin:!1,permissions:[],isReviewer:!1,testOnly:!1,loaded:!1});return m.useEffect(()=>{t&&e("permission.mine").then(i=>{const a=i.isAdmin,s=i.permissions;r({isAdmin:a,permissions:s,isReviewer:a||s.includes("skill_reviewer"),testOnly:i.testOnly??!1,loaded:!0})}).catch(i=>{console.warn("[usePermissions] Failed to fetch permissions:",i),r(a=>({...a,loaded:!0}))})},[t,e]),n}function XQ(){const[e,t]=m.useState(!1),[n,r]=m.useState(null),i=zi(),a=va(),s=YQ(),{isAdmin:o}=wa(s.sendRpc,s.isConnected),{currentWorkspace:c}=Ad(),u=m.useRef(new Set);m.useEffect(()=>{s.loadSystemStatus()},[a]);const d=m.useCallback(()=>{s.clearEditSkill(),s.loadSkills()},[s]),f=m.useCallback(async g=>{mu(g.toolName)&&await s.loadSkills(),r(null)},[s]),h=m.useCallback(g=>{r(null)},[]),p=m.useCallback(g=>{r(g)},[]);return m.useEffect(()=>{if(!n)return;const g=n.id;if(!g.startsWith("tool-")&&!g.startsWith("msg-"))return;const y=s.messages.find(x=>x.content===n.content&&x.toolName===n.toolName);y&&y.id!==n.id&&r(y)},[s.messages,n]),m.useEffect(()=>{const g=s.messages;if(g.length!==0)for(let y=g.length-1;y>=0;y--){const x=g[y];if(x.role!=="tool"||x.isStreaming||!x.content||x.isoTimestamp||!mu(x.toolName))continue;const v=`${x.toolName}:${x.content.slice(0,200)}`;if(u.current.has(v))continue;try{const w=JSON.parse(x.content);if(!(w!=null&&w.skill))continue}catch{continue}const b=x.metadata;if(!((b==null?void 0:b.skillCard)==="saved"||(b==null?void 0:b.skillCard)==="dismissed")){u.current.add(v),r(x);break}}},[s.messages]),l.jsxs("div",{className:"flex h-full relative bg-white overflow-hidden font-sans",children:[l.jsx(Ur,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(Zt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>t(!1),className:"absolute inset-0 bg-stone-200/40 backdrop-blur-[2px] z-40 transition-all"}),l.jsxs(Zt.div,{initial:{x:-320},animate:{x:0},exit:{x:-320},transition:{type:"spring",stiffness:350,damping:35},className:"absolute top-0 bottom-0 left-0 w-[300px] bg-[#F7F6F3] border-r border-[#E5E5E5] z-50 shadow-2xl flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-[#E5E5E5]",children:[l.jsx("span",{className:"text-sm font-medium text-[#444]",children:"Recent Sessions"}),l.jsx("button",{onClick:()=>t(!1),className:"text-[#999] hover:text-[#333]",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 overflow-hidden",children:l.jsx(xq,{sessions:s.sessions,currentSessionKey:s.currentSessionKey,onSelectSession:g=>{s.loadHistory(g),t(!1)},onNewSession:()=>{s.createSession(),t(!1)},onDeleteSession:s.deleteSession})})]})]})}),l.jsxs("div",{className:"flex-1 relative flex flex-col bg-white min-w-0",children:[l.jsxs("header",{className:"absolute top-0 left-0 right-0 h-16 flex items-center justify-between px-4 z-30",children:[l.jsx("div",{className:"flex items-center",children:!e&&l.jsx("button",{onClick:()=>t(!0),className:"p-2 rounded-lg text-gray-400 hover:text-gray-800 hover:bg-gray-100 transition-all",title:"View History",children:l.jsx(uw,{className:"w-5 h-5"})})}),l.jsx("div",{className:"flex items-center",children:l.jsx("button",{onClick:()=>s.createSession(),className:"p-2 rounded-lg text-gray-400 hover:text-gray-800 hover:bg-gray-100 transition-all",title:"New Session",children:l.jsx(dn,{className:"w-5 h-5"})})})]}),l.jsx("div",{className:"flex-1 pt-16 flex flex-col min-h-0",children:l.jsx(qq,{messages:s.messages,isLoading:s.isLoading,isLoadingHistory:s.isLoadingHistory,wsStatus:s.wsStatus,isConnected:s.isConnected,hasMore:s.hasMore,isLoadingMore:s.isLoadingMore,sendMessage:s.sendMessage,abortResponse:s.abortResponse,loadMoreHistory:s.loadMoreHistory,sendRpc:s.sendRpc,contextUsage:s.contextUsage,isCompacting:s.isCompacting,skills:s.skills,editingSkill:s.editingSkill,onEditSkill:s.startEditSkill,onClearEditSkill:s.clearEditSkill,onSkillSaved:d,onOpenSkillPanel:p,onOpenSchedulePanel:p,selectedWorkspaceId:(c==null?void 0:c.id)??null,panelMessage:n,updateMessageMeta:s.updateMessageMeta,pendingMessages:s.pendingMessages,onRemovePending:s.removePendingMessage,investigationProgress:s.investigationProgress,dpActive:s.dpActive,onSetDpActive:s.setDpActive,dpFocus:s.dpFocus,dpChecklist:s.dpChecklist,onHypothesesConfirmed:s.confirmHypotheses,onExitDp:s.exitDpMode,systemStatus:s.systemStatus,onNavigateModels:()=>i("/models"),onNavigateCredentials:()=>i("/credentials"),sessionKey:s.currentSessionKey,isAdmin:o})})]}),n&&(mu(n.toolName)?l.jsx(sG,{message:n,sendRpc:s.sendRpc,skills:s.skills,onSave:f,onDismiss:h,onClose:()=>r(null),updateMessageMeta:s.updateMessageMeta}):n.toolName==="manage_schedule"?l.jsx(oG,{message:n,sendRpc:s.sendRpc,onSave:f,onDismiss:h,onClose:()=>r(null),updateMessageMeta:s.updateMessageMeta,selectedWorkspaceId:(c==null?void 0:c.id)??null}):null)]})}const dt=({content:e,children:t,position:n="top",delay:r=.2})=>{const[i,a]=m.useState(!1),s=m.useRef(null),[o,c]=m.useState({top:0,left:0}),u=m.useCallback(()=>{if(s.current){const d=s.current.getBoundingClientRect();let f=0,h=0;const p=8;switch(n){case"top":f=d.top-p,h=d.left+d.width/2;break;case"bottom":f=d.bottom+p,h=d.left+d.width/2;break;case"left":f=d.top+d.height/2,h=d.left-p;break;case"right":f=d.top+d.height/2,h=d.right+p;break}c({top:f,left:h})}a(!0)},[n]);return l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:s,className:"relative flex items-center",onMouseEnter:u,onMouseLeave:()=>a(!1),children:t}),Co.createPortal(l.jsx(Ur,{children:i&&l.jsx(Zt.div,{initial:{opacity:0,scale:.96,y:n==="top"?4:n==="bottom"?-4:0,x:n==="left"?4:n==="right"?-4:0,top:o.top,left:o.left},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.96},transition:{duration:.15,delay:r,ease:"easeOut"},style:{position:"fixed",top:0,left:0,pointerEvents:"none"},className:"z-[9999]",children:l.jsx("div",{className:`
|
|
608
|
+
relative px-3 py-1.5 text-xs font-semibold text-gray-700 bg-white
|
|
609
|
+
border border-gray-100 rounded-lg shadow-[0_4px_12px_-2px_rgba(0,0,0,0.08)]
|
|
610
|
+
whitespace-nowrap select-none
|
|
611
|
+
${n==="top"?"-translate-x-1/2 -translate-y-full":""}
|
|
612
|
+
${n==="bottom"?"-translate-x-1/2":""}
|
|
613
|
+
${n==="left"?"-translate-x-full -translate-y-1/2":""}
|
|
614
|
+
${n==="right"?"-translate-y-1/2":""}
|
|
615
|
+
`,children:e})})}),document.body)]})};function no({isOpen:e,onClose:t,onConfirm:n,title:r,description:i,confirmText:a="Confirm",cancelText:s="Cancel",variant:o="primary"}){if(!e)return null;const u={primary:{icon:Z7,iconColor:"text-primary-600",iconBg:"bg-primary-50",button:"bg-primary-600 hover:bg-primary-700 focus:ring-primary-100"},danger:{icon:si,iconColor:"text-red-600",iconBg:"bg-red-50",button:"bg-red-600 hover:bg-red-700 focus:ring-red-100"},warning:{icon:br,iconColor:"text-orange-600",iconBg:"bg-orange-50",button:"bg-orange-600 hover:bg-orange-700 focus:ring-orange-100"}}[o],d=u.icon;return l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm transition-opacity",onClick:t}),l.jsx("div",{className:"relative w-full max-w-md bg-white rounded-2xl shadow-xl border border-gray-100 overflow-hidden text-left transform transition-all animate-in fade-in zoom-in-95 duration-200",children:l.jsxs("div",{className:"p-6",children:[l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:U("p-3 rounded-xl flex-shrink-0",u.iconBg),children:l.jsx(d,{className:U("w-6 h-6",u.iconColor)})}),l.jsxs("div",{className:"flex-1 pt-1",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 leading-none mb-2",children:r}),l.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:i})]}),l.jsx("button",{onClick:t,className:"p-1 text-gray-400 hover:text-gray-500 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"mt-8 flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-100 transition-colors",children:s}),l.jsx("button",{onClick:()=>{n(),t()},className:U("px-4 py-2 text-sm font-medium text-white rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 transition-all",u.button),children:a})]})]})})]})}const bC=30;function ZQ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),[a,s]=m.useState(!1),[o,c]=m.useState(!1),[u,d]=m.useState("all"),[f,h]=m.useState(""),p=m.useCallback(async(_,C)=>{const A=_??u,M=C??f;d(A),h(M),i(!0);try{const B=await av(e,{limit:bC,offset:0,scope:A==="all"||A==="approvals"?void 0:A,search:M||void 0,pendingOnly:A==="approvals"?!0:void 0});n(B.skills),c(B.hasMore)}catch(B){console.error("[useSkills] Failed to load:",B)}finally{i(!1)}},[e,u,f]),g=m.useCallback(async()=>{if(!(a||!o)){s(!0);try{const _=await av(e,{limit:bC,offset:t.length,scope:u==="all"||u==="approvals"?void 0:u,search:f||void 0,pendingOnly:u==="approvals"?!0:void 0});n(C=>[...C,..._.skills]),c(_.hasMore)}catch(_){console.error("[useSkills] Failed to load more:",_)}finally{s(!1)}}},[e,t.length,u,f,a,o]),y=m.useCallback(async _=>{const C=!_.enabled;try{await e("skill.setEnabled",{name:_.name,enabled:C}),n(A=>A.map(M=>M.name===_.name?{...M,enabled:C}:M))}catch(A){console.error("[useSkills] toggleEnabled failed:",A)}},[e]),x=m.useCallback(async(_,C)=>{await e("skill.submit",{id:String(_.id),contributeToTeam:C}),await p()},[e,p]),v=m.useCallback(async _=>{await UQ(e,String(_.id)),await p()},[e,p]),b=m.useCallback(async _=>{try{await e("skill.review",{id:String(_.id),decision:"approve"}),await p()}catch(C){console.error("[useSkills] approveSkill failed:",C)}},[e,p]),w=m.useCallback(async(_,C)=>{try{await e("skill.review",{id:String(_.id),decision:"reject",reason:C}),await p()}catch(A){console.error("[useSkills] rejectSkill failed:",A)}},[e,p]),S=m.useCallback(async _=>{try{await e("skill.delete",{id:String(_.id)}),n(C=>C.filter(A=>A.id!==_.id))}catch(C){console.error("[useSkills] deleteSkill failed:",C)}},[e]),k=m.useCallback(async _=>{try{await ZD(e,String(_.id)),await p()}catch(C){console.error("[useSkills] copyToPersonal failed:",C)}},[e,p]),j=m.useCallback(async(_,C)=>{try{const A=await zQ(e,String(_.id),C);n(M=>M.map(B=>B.id===_.id?{...B,upvotes:A.upvotes,downvotes:A.downvotes,userVote:A.userVote}:B))}catch(A){console.error("[useSkills] voteSkill failed:",A)}},[e]),N=m.useCallback(async(_,C)=>{try{await $Q(e,String(_.id),C),await p()}catch(A){console.error("[useSkills] revertSkill failed:",A)}},[e,p]),P=m.useCallback(async(_,C,A,M)=>{await BQ(e,String(_.id),C,A,M),await p()},[e,p]),T=m.useCallback(async(_,C)=>{try{await XD(e,String(_.id),C),await p()}catch(A){console.error("[useSkills] rollbackSkill failed:",A)}},[e,p]),E=m.useCallback(async _=>{try{(await VQ(e,String(_.id))).wasNew?n(A=>A.filter(M=>M.id!==_.id)):await p()}catch(C){console.error("[useSkills] withdrawSkill failed:",C)}},[e,p]);return{skills:t,isLoading:r,isLoadingMore:a,hasMore:o,loadSkills:p,loadMore:g,toggleEnabled:y,publishSkill:x,requestPublish:v,approveSkill:b,rejectSkill:w,deleteSkill:S,copyToPersonal:k,voteSkill:j,revertSkill:N,reviewSkill:P,withdrawSkill:E,rollbackSkill:T}}function QQ(){var pe;const e=zi(),[t,n]=wd(),{sendRpc:r,isConnected:i}=Rt(),{skills:a,isLoading:s,isLoadingMore:o,hasMore:c,loadSkills:u,loadMore:d,toggleEnabled:f,requestPublish:h,publishSkill:p,copyToPersonal:g,approveSkill:y,rejectSkill:x,deleteSkill:v,voteSkill:b,revertSkill:w,reviewSkill:S,withdrawSkill:k}=ZQ(r),j=ds(),N=(j==null?void 0:j.username)==="admin",{isReviewer:P}=wa(r,i),T=t.get("tab"),E=sessionStorage.getItem("skills_tab"),[_,C]=m.useState(T||E||"all"),[A,M]=m.useState(""),[B,ae]=m.useState(new Set),[Q,I]=m.useState(!1),[H,O]=m.useState([]),oe=m.useRef(null),re=m.useRef(),D=m.useRef(null),G={kubernetes:"bg-blue-50 text-blue-700 border-blue-200","bare-metal":"bg-blue-50 text-blue-700 border-blue-200",switch:"bg-blue-50 text-blue-700 border-blue-200",network:"bg-purple-50 text-purple-700 border-purple-200",rdma:"bg-purple-50 text-purple-700 border-purple-200",scheduling:"bg-purple-50 text-purple-700 border-purple-200",storage:"bg-purple-50 text-purple-700 border-purple-200",compute:"bg-purple-50 text-purple-700 border-purple-200",general:"bg-purple-50 text-purple-700 border-purple-200",diagnostic:"bg-green-50 text-green-700 border-green-200",monitoring:"bg-green-50 text-green-700 border-green-200",performance:"bg-green-50 text-green-700 border-green-200",configuration:"bg-green-50 text-green-700 border-green-200",sre:"bg-orange-50 text-orange-700 border-orange-200",developer:"bg-orange-50 text-orange-700 border-orange-200"},te={Environment:["kubernetes","bare-metal","switch"],Domain:["network","rdma","scheduling","storage","compute","general"],Operation:["diagnostic","monitoring","performance","configuration"],...N?{Role:["sre","developer"]}:{}},ee=m.useMemo(()=>{const L=new Set(H.map(rt=>rt.label)),ye=new Map(H.map(rt=>[rt.label,rt.count])),_e=[],Ue=new Set;for(const[rt,gt]of Object.entries(te)){const Kt=gt.filter(Et=>L.has(Et)).map(Et=>({label:Et,count:ye.get(Et)??0}));Kt.length>0&&(_e.push({group:rt,labels:Kt}),Kt.forEach(Et=>Ue.add(Et.label)))}const mt=H.filter(rt=>!Ue.has(rt.label)).map(rt=>({label:rt.label,count:rt.count}));return mt.length>0&&_e.push({group:"Other",labels:mt}),_e},[H,N]),Z=L=>{ae(ye=>{const _e=new Set(ye);return _e.has(L)?_e.delete(L):_e.add(L),_e})};m.useEffect(()=>{if(!Q)return;const L=ye=>{oe.current&&!oe.current.contains(ye.target)&&I(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[Q]);const ce=L=>{const ye=L.target.value;M(ye),clearTimeout(re.current),re.current=setTimeout(()=>{u(_,ye)},300)},J=L=>{C(L),sessionStorage.setItem("skills_tab",L),n(L==="all"?{}:{tab:L}),u(L,A)},ne=m.useCallback(()=>{const L=D.current;!L||o||!c||L.scrollHeight-L.scrollTop-L.clientHeight<200&&d()},[o,c,d]),[be,Y]=m.useState({isOpen:!1,skill:null,reason:""}),[R,F]=m.useState({isOpen:!1,title:"",description:"",variant:"primary",confirmText:"Confirm",onConfirm:()=>{}}),ue=()=>F(L=>({...L,isOpen:!1})),le=m.useRef(!1);m.useEffect(()=>{i&&!le.current&&(le.current=!0,u(_,""),KQ(r).then(O).catch(()=>{}))},[i]),m.useEffect(()=>{const L=t.get("tab");if(!L)return;const ye=L;ye!==_&&(C(ye),sessionStorage.setItem("skills_tab",ye),u(ye,A))},[t]);const ze=B.size===0?a:a.filter(L=>{const ye=L.labels??[];return[...B].every(_e=>ye.includes(_e))}),Be=()=>e("/skills/new"),et=(L,ye)=>{L.stopPropagation(),f(ye)},pt=L=>{F({isOpen:!0,title:"Error",description:L,variant:"warning",confirmText:"OK",onConfirm:()=>{}})},Pt=(L,ye)=>{L.stopPropagation(),F({isOpen:!0,title:"Publish Skill",description:`Are you sure you want to publish "${ye.name}"? It will be reviewed by an admin before becoming available in production.`,variant:"primary",confirmText:"Request Publish",onConfirm:()=>{h(ye).catch(_e=>pt((_e==null?void 0:_e.message)||String(_e)))}})},Vt=(L,ye)=>{L.stopPropagation(),F({isOpen:!0,title:"Contribute to Team",description:`Contribute "${ye.name}" to the team? An admin will review before it becomes a shared team skill.`,variant:"primary",confirmText:"Contribute",onConfirm:()=>{p(ye,!0).catch(_e=>pt((_e==null?void 0:_e.message)||String(_e)))}})},ut=(L,ye)=>{L.stopPropagation(),F({isOpen:!0,title:"Fork to Personal",description:`This will fork "${ye.name}" into your personal skills. You can edit and customize the fork, and optionally contribute changes back to the team.`,variant:"primary",confirmText:"Fork Skill",onConfirm:()=>{g(ye)}})},tt=(L,ye,_e)=>{L.stopPropagation(),b(ye,_e)},je=(L,ye)=>{L.stopPropagation(),Y({isOpen:!0,skill:ye,reason:""})},W=()=>{be.skill&&w(be.skill,be.reason||void 0),Y({isOpen:!1,skill:null,reason:""})},se=(L,ye)=>{L.stopPropagation(),F({isOpen:!0,title:"Withdraw Publish Request",description:`Withdraw the publish request for "${ye.name}"? The skill will revert to its previous state.`,variant:"warning",confirmText:"Withdraw",onConfirm:()=>{k(ye)}})},Te=(L,ye)=>{L.stopPropagation(),F({isOpen:!0,title:"Delete Skill",description:`Are you sure you want to permanently delete "${ye.name}"? This action cannot be undone.`,variant:"danger",confirmText:"Delete",onConfirm:()=>{v(ye)}})};return l.jsxs("div",{className:"h-full bg-white flex flex-col relative",children:[l.jsx(no,{isOpen:R.isOpen,onClose:ue,onConfirm:R.onConfirm,title:R.title,description:R.description,variant:R.variant,confirmText:R.confirmText}),be.isOpen&&l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm",onClick:()=>Y({isOpen:!1,skill:null,reason:""})}),l.jsx("div",{className:"relative w-full max-w-md bg-white rounded-2xl shadow-xl border border-gray-100 overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:l.jsxs("div",{className:"p-6",children:[l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"p-3 rounded-xl bg-orange-50 flex-shrink-0",children:l.jsx(Ex,{className:"w-6 h-6 text-orange-600"})}),l.jsxs("div",{className:"flex-1 pt-1",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Revert to Personal"}),l.jsxs("p",{className:"text-sm text-gray-500 mb-4",children:['This will move "',(pe=be.skill)==null?void 0:pe.name,`" back to the author's personal library.`]}),l.jsx("textarea",{value:be.reason,onChange:L=>Y(ye=>({...ye,reason:L.target.value})),placeholder:"Reason for revert (optional)",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-orange-200 resize-none",rows:3})]})]}),l.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:()=>Y({isOpen:!1,skill:null,reason:""}),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",children:"Cancel"}),l.jsx("button",{onClick:W,className:"px-4 py-2 text-sm font-medium text-white bg-orange-600 hover:bg-orange-700 rounded-lg shadow-sm transition-all",children:"Revert"})]})]})})]}),l.jsxs("header",{className:"h-16 flex items-center justify-between px-6 bg-white sticky top-0 z-10",children:[l.jsxs("div",{className:"flex gap-2",children:[[{id:"all",label:"All Skills",icon:fw},{id:"builtin",label:"System Skills",icon:mw},{id:"team",label:"Team Skills",icon:ta},{id:"personal",label:"My Skills",icon:Wu}].map(L=>l.jsx("button",{onClick:()=>J(L.id),className:U("flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-all border",_===L.id?"bg-gray-900 text-white border-gray-900 shadow-sm":"bg-white text-gray-500 border-transparent hover:bg-gray-50 hover:text-gray-700"),children:L.label},L.id)),P&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"w-px h-6 bg-gray-200 self-center mx-1"}),l.jsxs("button",{onClick:()=>J("approvals"),className:U("flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-all border",_==="approvals"?"bg-orange-50 text-orange-700 border-orange-200 shadow-sm":"bg-white text-gray-500 border-transparent hover:bg-orange-50 hover:text-orange-600"),children:[l.jsx(Kj,{className:"w-3.5 h-3.5"}),"Approvals",a.filter(L=>L.contributionStatus==="pending"||L.reviewStatus==="pending").length>0&&l.jsx("span",{className:"flex h-4 w-4 items-center justify-center rounded-full bg-orange-500 text-[10px] text-white",children:a.filter(L=>L.contributionStatus==="pending"||L.reviewStatus==="pending").length})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative group",children:[l.jsx(Kn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search skills...",value:A,onChange:ce,className:"pl-9 pr-3 py-1.5 bg-gray-50 border-none rounded-md text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-200 w-48 transition-all"})]}),_==="personal"&&l.jsx(dt,{content:"Create Skill",children:l.jsx("button",{onClick:Be,className:"p-2 rounded-lg text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-all",children:l.jsx(dn,{className:"w-5 h-5"})})})]})]}),H.length>0&&_!=="approvals"&&l.jsxs("div",{className:"px-6 py-2 border-b border-gray-100 bg-gray-50/50 flex items-center gap-2 flex-wrap",children:[l.jsxs("div",{ref:oe,className:"relative",children:[l.jsxs("button",{onClick:()=>I(L=>!L),className:U("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border transition-all",Q?"bg-gray-100 text-gray-700 border-gray-300":"bg-white text-gray-500 border-gray-200 hover:border-gray-300 hover:text-gray-700"),children:[l.jsx(yw,{className:"w-3 h-3"}),"Labels",B.size>0&&l.jsx("span",{className:"flex h-4 min-w-[16px] items-center justify-center rounded-full bg-gray-700 text-[10px] text-white px-1",children:B.size}),l.jsx(ea,{className:U("w-3 h-3 transition-transform",Q&&"rotate-180")})]}),Q&&l.jsx("div",{className:"absolute left-0 top-full mt-1 w-64 bg-white rounded-lg shadow-lg border border-gray-200 z-30 py-1 max-h-80 overflow-y-auto",children:ee.map(({group:L,labels:ye})=>l.jsxs("div",{children:[l.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold uppercase tracking-wider text-gray-400",children:L}),ye.map(({label:_e,count:Ue})=>l.jsxs("button",{onClick:()=>Z(_e),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs hover:bg-gray-50 transition-colors",children:[l.jsx("span",{className:U("w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0",B.has(_e)?"bg-gray-700 border-gray-700 text-white":"border-gray-300"),children:B.has(_e)&&l.jsx(_n,{className:"w-2.5 h-2.5"})}),l.jsx("span",{className:U("px-1.5 py-0.5 rounded text-[10px] font-medium border",G[_e]||"bg-gray-50 text-gray-600 border-gray-200"),children:_e}),l.jsx("span",{className:"ml-auto text-gray-400 text-[10px]",children:Ue})]},_e))]},L))})]}),[...B].map(L=>l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",G[L]||"bg-gray-100 text-gray-700 border-gray-300"),children:[L,l.jsx("button",{onClick:()=>Z(L),className:"hover:opacity-70",children:l.jsx(Qe,{className:"w-3 h-3"})})]},L)),B.size>0&&l.jsx("button",{onClick:()=>ae(new Set),className:"px-2 py-0.5 rounded-full text-xs text-gray-400 hover:text-gray-600 flex items-center gap-0.5",children:"Clear all"})]}),l.jsxs("div",{ref:D,onScroll:ne,className:"flex-1 overflow-y-auto p-8",children:[s?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Ie,{className:"w-6 h-6 animate-spin text-gray-400"})}):_==="approvals"?l.jsxs("div",{className:"max-w-4xl mx-auto space-y-4",children:[ze.map(L=>{const ye=L.reviewStatus==="pending",_e=L.contributionStatus==="pending";return l.jsx(eJ,{skill:L,isScriptReview:ye,isContributionReview:_e,isAdmin:P,sendRpc:r,onApproveContribution:async()=>{await y(L)},onRejectContribution:async Ue=>{await x(L,Ue)},onReviewDecision:async(Ue,mt,rt)=>{await S(L,Ue,mt,rt)},onNavigate:()=>e(`/skills/${L.id}`)},L.id)}),ze.length===0&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-gray-400 text-sm",children:[l.jsx(Kj,{className:"w-8 h-8 mb-3 opacity-20"}),"No pending approvals"]})]}):l.jsx("div",{className:"max-w-6xl mx-auto",children:ze.length===0&&!s&&_!=="personal"?l.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-gray-400 text-sm",children:[l.jsx(ta,{className:"w-8 h-8 mb-3 opacity-20"}),_==="team"?"No team skills yet. Team skills are promoted from personal skills through the approval process.":"No skills found."]}):l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[ze.map(L=>l.jsxs("div",{className:U("group rounded-xl border p-6 hover:shadow-md transition-all duration-200 flex flex-col relative overflow-hidden",L.reviewStatus==="pending"?"bg-amber-50/30 border-amber-100":L.reviewStatus==="draft"?"bg-gray-50/50 border-gray-200":L.enabled?"bg-white border-gray-200":"bg-gray-50/80 border-gray-100"),children:[l.jsxs("div",{className:"flex justify-between items-start mb-4",children:[l.jsx("div",{className:U("w-8 h-8 rounded-lg border flex items-center justify-center transition-colors",L.enabled?"bg-gray-50 border-gray-100 group-hover:border-gray-200 group-hover:bg-gray-100":"bg-gray-100 border-gray-100"),children:l.jsx(L.icon,{className:U("w-4 h-4",L.enabled?"text-gray-700":"text-gray-400")})}),l.jsx(tJ,{enabled:L.enabled,onToggle:ye=>et(ye,L),disabled:L.reviewStatus==="pending"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("h3",{className:U("font-bold mb-1",L.enabled?"text-gray-900":"text-gray-400"),children:L.name}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mb-2",children:[L.contributionStatus==="pending"&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-orange-50 text-orange-600 text-[10px] font-bold border border-orange-100 whitespace-nowrap",children:[l.jsx(ta,{className:"w-2.5 h-2.5"}),"Team Pending"]}),L.reviewStatus==="draft"&&l.jsx("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-gray-50 text-gray-500 text-[10px] font-bold border border-gray-200 whitespace-nowrap",children:"Draft"}),L.reviewStatus==="pending"&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-amber-50 text-amber-700 text-[10px] font-bold border border-amber-200 whitespace-nowrap",children:[l.jsx(Uu,{className:"w-2.5 h-2.5"}),"Pending Publish"]}),L.reviewStatus==="approved"&&(L.scope==="personal"||L.scope==="team")&&(()=>{const ye=Number(String(L.version).replace(/^v/,""));return L.publishedVersion!=null&&ye>L.publishedVersion?l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-blue-50 text-blue-600 text-[10px] font-bold border border-blue-200 whitespace-nowrap",children:[l.jsx(Ga,{className:"w-2.5 h-2.5"}),"Modified"]}):l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-green-50 text-green-600 text-[10px] font-bold border border-green-200 whitespace-nowrap",children:[l.jsx(_n,{className:"w-2.5 h-2.5"}),"Approved"]})})(),L.scope==="builtin"&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-gray-100 text-gray-600 text-[10px] font-bold border border-gray-200 whitespace-nowrap",children:[l.jsx(Qh,{className:"w-2.5 h-2.5"}),"System"]})]}),l.jsx("p",{className:U("text-sm leading-relaxed line-clamp-2",L.enabled?"text-gray-500":"text-gray-400"),children:L.description}),L.labels&&L.labels.length>0&&(()=>{const _e=L.labels.slice(0,3),Ue=L.labels.length-3;return l.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[_e.map(mt=>l.jsx("span",{onClick:rt=>{rt.stopPropagation(),Z(mt)},className:U("px-1.5 py-0.5 rounded text-[10px] font-medium border cursor-pointer hover:opacity-80 transition-opacity",G[mt]||"bg-gray-50 text-gray-600 border-gray-200"),children:mt},mt)),Ue>0&&l.jsx(dt,{content:L.labels.slice(3).join(", "),position:"bottom",children:l.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-500 border border-gray-200",children:["+",Ue]})})]})})()]}),L.scope==="team"&&l.jsxs("div",{className:"mt-auto pt-3 border-t border-gray-50 flex items-center gap-3",children:[l.jsxs("button",{onClick:ye=>tt(ye,L,1),className:U("flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors",L.userVote===1?"bg-green-100 text-green-700 border border-green-200":"text-gray-400 hover:text-green-600 hover:bg-green-50"),children:[l.jsx(n_,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:L.upvotes||0})]}),l.jsxs("button",{onClick:ye=>tt(ye,L,-1),className:U("flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors",L.userVote===-1?"bg-red-100 text-red-700 border border-red-200":"text-gray-400 hover:text-red-600 hover:bg-red-50"),children:[l.jsx(t_,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:L.downvotes||0})]})]}),l.jsxs("div",{className:U("pt-4 border-t border-gray-50 flex items-center justify-between",L.scope!=="team"&&"mt-auto"),children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-gray-400",children:[l.jsxs("span",{className:U("px-2 py-0.5 rounded flex items-center gap-1",L.scope==="builtin"?"bg-gray-100 text-gray-700":L.scope==="team"?"bg-blue-50 text-blue-700":"bg-purple-50 text-purple-700"),children:[L.scope==="builtin"&&l.jsx(Qh,{className:"w-3 h-3"}),L.scope==="builtin"?"System":L.scope==="team"?"Team":"Personal"]}),(L.scope==="team"||L.scope==="personal")&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-gray-50 text-gray-500 text-[10px] font-medium border border-gray-100",children:L.version})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[L.scope==="personal"&&L.reviewStatus==="pending"&&l.jsx(dt,{content:"Withdraw",children:l.jsx("button",{onClick:ye=>se(ye,L),className:"p-1.5 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded-lg transition-colors",children:l.jsx(e_,{className:"w-4 h-4"})})}),L.scope==="personal"&&L.reviewStatus!=="pending"&&l.jsx(dt,{content:"Request Publish",children:l.jsx("button",{onClick:ye=>Pt(ye,L),className:"p-1.5 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",children:l.jsx(fB,{className:"w-4 h-4"})})}),L.scope==="personal"&&L.reviewStatus==="approved"&&L.contributionStatus!=="pending"&&l.jsx(dt,{content:"Contribute to Team",children:l.jsx("button",{onClick:ye=>Vt(ye,L),className:"p-1.5 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",children:l.jsx(Jh,{className:"w-4 h-4"})})}),L.scope!=="personal"&&l.jsx(dt,{content:"Fork to Personal",children:l.jsx("button",{onClick:ye=>ut(ye,L),className:"p-1.5 text-gray-400 hover:text-purple-600 hover:bg-purple-50 rounded-lg transition-colors",children:l.jsx(cw,{className:"w-4 h-4"})})}),N&&L.scope==="team"&&l.jsx(dt,{content:"Revert to Personal",children:l.jsx("button",{onClick:ye=>je(ye,L),className:"p-1.5 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded-lg transition-colors",children:l.jsx(Ex,{className:"w-4 h-4"})})}),(L.scope==="personal"||N&&L.scope==="team")&&l.jsx(dt,{content:"Version History",children:l.jsx("button",{onClick:ye=>{ye.stopPropagation(),e(`/skills/${L.id}?history=true`)},className:"p-1.5 text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 rounded-lg transition-colors",children:l.jsx(QO,{className:"w-4 h-4"})})}),l.jsx(dt,{content:L.scope==="personal"?"Configure Skill":"View Details",children:l.jsx("button",{onClick:()=>e(`/skills/${L.id}`),className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",children:L.scope==="personal"?l.jsx(Em,{className:"w-4 h-4"}):l.jsx(Zl,{className:"w-4 h-4"})})}),(L.scope==="personal"||N&&L.scope==="team")&&l.jsx(dt,{content:"Delete Skill",children:l.jsx("button",{onClick:ye=>Te(ye,L),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:l.jsx(Fn,{className:"w-4 h-4"})})})]})]})]},L.id)),_==="personal"&&l.jsxs("button",{onClick:Be,className:"border-2 border-dashed border-gray-200 rounded-xl p-6 flex flex-col items-center justify-center text-gray-400 hover:border-primary-300 hover:text-primary-600 hover:bg-primary-50/50 transition-all gap-3 min-h-[200px]",children:[l.jsx("div",{className:"p-3 rounded-full bg-gray-50 group-hover:bg-white",children:l.jsx(dn,{className:"w-6 h-6"})}),l.jsx("span",{className:"font-semibold text-sm",children:"Create Custom Skill"})]})]})}),o&&l.jsx("div",{className:"flex items-center justify-center py-6",children:l.jsx(Ie,{className:"w-5 h-5 animate-spin text-gray-400"})})]})]})}const Of={low:"bg-green-50 text-green-700 border-green-200",medium:"bg-yellow-50 text-yellow-700 border-yellow-200",high:"bg-orange-50 text-orange-700 border-orange-200",critical:"bg-red-50 text-red-700 border-red-200"},JQ={critical:si,high:si,medium:si,low:Nm};function eJ({skill:e,isScriptReview:t,isContributionReview:n,isAdmin:r,sendRpc:i,onApproveContribution:a,onRejectContribution:s,onReviewDecision:o,onNavigate:c}){const[u,d]=m.useState(!1),[f,h]=m.useState([]),[p,g]=m.useState(null),[y,x]=m.useState(!1),[v,b]=m.useState(""),[w,S]=m.useState(!1),[k,j]=m.useState(new Set),[N,P]=m.useState(null),[T,E]=m.useState(!1),[_,C]=m.useState(!1),[A,M]=m.useState({isOpen:!1,title:"",description:"",variant:"primary",confirmText:"",onConfirm:()=>{}}),[B,ae]=m.useState({isOpen:!1,message:""}),[Q,I]=m.useState(!1),H=async()=>{if(u){d(!1);return}d(!0),x(!0);try{const ee=[sv(i,String(e.id)),gC(i,String(e.id))],Z=await Promise.all(ee);g(Z[0]),Z[1]&&h(Z[1].reviews)}catch(ee){((ee==null?void 0:ee.message)||String(ee)).includes("Skill not found")?(I(!0),d(!1)):console.error("[Approvals] Failed to load review data:",ee)}finally{x(!1)}},O=async()=>{if(N!==null){C(!_);return}E(!0),C(!0);try{const ee=await HQ(i,String(e.id),n);P(ee.diff||"No changes detected.")}catch(ee){console.error("[Approvals] Failed to load diff:",ee),P("Failed to load diff.")}finally{E(!1)}},oe=async ee=>{S(!0);try{t?await o(ee,v||void 0,p==null?void 0:p.stagingVersion):n&&(ee==="approve"?await a():await s(v||void 0))}catch(Z){const ce=(Z==null?void 0:Z.message)||String(Z);ce.includes("STAGING_VERSION_CONFLICT")?ae({isOpen:!0,message:"Content has changed since you reviewed it. Please reload and review again."}):ae({isOpen:!0,message:ce})}finally{S(!1)}},re=ee=>{M(ee==="approve"?{isOpen:!0,title:"Approve Skill",description:`Are you sure you want to approve "${e.name}"? It will become active in production.`,variant:"primary",confirmText:n?"Approve & Publish to Team":"Approve",onConfirm:()=>oe("approve")}:{isOpen:!0,title:"Reject Skill",description:`Are you sure you want to reject "${e.name}"?${v?"":" You can add a reason above before confirming."}`,variant:"danger",confirmText:"Reject",onConfirm:()=>oe("reject")})},D=ee=>{j(Z=>{const ce=new Set(Z);return ce.has(ee)?ce.delete(ee):ce.add(ee),ce})},G=f.find(ee=>ee.reviewerType==="ai");m.useEffect(()=>{if(!u||G||!e.id)return;const ee=setInterval(async()=>{try{const Z=await gC(i,String(e.id));Z!=null&&Z.reviews&&Z.reviews.find(J=>J.reviewerType==="ai")&&(h(Z.reviews),clearInterval(ee))}catch{}},3e3);return()=>clearInterval(ee)},[u,G,e.id,i]);const te={builtin:{label:"System Skills",cls:"bg-gray-100 text-gray-700",icon:Qh},team:{label:"Team Skills",cls:"bg-blue-50 text-blue-700 border-blue-100",icon:ta},personal:{label:"Personal",cls:"bg-purple-50 text-purple-700 border-purple-100",icon:Wu}}[e.scope]||{label:e.scope,cls:"bg-gray-100 text-gray-600",icon:Wu};return Q?l.jsxs("div",{className:"bg-gray-50 rounded-xl border border-gray-200 opacity-60 p-4 flex items-center gap-3 text-gray-400 text-sm",children:[l.jsx(Fn,{className:"w-4 h-4"}),l.jsxs("span",{children:[l.jsx("strong",{children:e.name})," — This skill has been deleted or withdrawn."]})]}):l.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 hover:shadow-sm transition-shadow",children:[l.jsx(no,{isOpen:A.isOpen,onClose:()=>M(ee=>({...ee,isOpen:!1})),onConfirm:A.onConfirm,title:A.title,description:A.description,variant:A.variant,confirmText:A.confirmText}),l.jsx(no,{isOpen:B.isOpen,onClose:()=>ae({isOpen:!1,message:""}),onConfirm:()=>{},title:"Operation Failed",description:B.message,variant:"danger",confirmText:"OK"}),l.jsxs("div",{className:"p-4 flex items-center justify-between cursor-pointer",onClick:H,children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:U("w-10 h-10 rounded-lg border flex items-center justify-center",t?"bg-amber-50 border-amber-100 text-amber-600":n?"bg-blue-50 border-blue-100 text-blue-600":"bg-orange-50 border-orange-100 text-orange-600"),children:t?l.jsx(Uu,{className:"w-5 h-5"}):n?l.jsx(ta,{className:"w-5 h-5"}):l.jsx(e.icon,{className:"w-5 h-5"})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("h3",{className:"font-bold text-gray-900",children:e.name}),l.jsxs("span",{className:U("inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium border",te.cls),children:[l.jsx(te.icon,{className:"w-2.5 h-2.5"}),te.label]}),t&&l.jsxs("span",{className:U("inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] font-bold border","bg-amber-50 text-amber-700 border-amber-200"),children:[l.jsx(tB,{className:"w-2.5 h-2.5"})," Publish Request"]}),n&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-blue-50 text-blue-700 text-[10px] font-bold border border-blue-200",children:[l.jsx(ta,{className:"w-2.5 h-2.5"}),"Team Promotion"]}),G&&l.jsx("span",{className:U("px-1.5 py-0.5 rounded-full text-[10px] font-bold border uppercase",Of[G.riskLevel]||Of.low),children:G.riskLevel}),l.jsx("span",{className:"px-2 py-0.5 rounded-full bg-purple-50 text-purple-700 text-[10px] font-medium border border-purple-100",children:e.author||"Unknown"})]}),l.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:e.description})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(dt,{content:"View in Editor",children:l.jsx("button",{onClick:ee=>{ee.stopPropagation(),c()},className:"p-2 text-gray-400 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(Zl,{className:"w-4 h-4"})})}),l.jsx("button",{className:"p-2 text-gray-400 hover:text-gray-700 transition-colors",children:u?l.jsx(fh,{className:"w-4 h-4"}):l.jsx(ea,{className:"w-4 h-4"})})]})]}),u&&l.jsx("div",{className:"border-t border-gray-100 p-6 space-y-4 bg-gray-50/30",children:y?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(Ie,{className:"w-5 h-5 animate-spin text-gray-400"})}):l.jsxs(l.Fragment,{children:[G&&l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[l.jsx("h4",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider mb-3",children:"AI Review Summary"}),l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx("span",{className:"text-sm text-gray-600",children:"Risk Level:"}),l.jsx("span",{className:U("px-2 py-0.5 rounded-full text-xs font-bold border uppercase",Of[G.riskLevel]||Of.low),children:G.riskLevel})]}),l.jsx("p",{className:"text-sm text-gray-600 mb-3",children:G.summary}),G.findings&&G.findings.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("span",{className:"text-xs font-medium text-gray-500",children:[G.findings.length," finding(s):"]}),G.findings.map((ee,Z)=>{const ce=JQ[ee.severity]||Nm;return l.jsxs("div",{className:U("flex items-start gap-2 p-2 rounded-md text-sm border",ee.severity==="critical"?"bg-red-50/50 border-red-100":ee.severity==="high"?"bg-orange-50/50 border-orange-100":ee.severity==="medium"?"bg-yellow-50/50 border-yellow-100":"bg-gray-50 border-gray-100"),children:[l.jsx(ce,{className:U("w-4 h-4 mt-0.5 shrink-0",ee.severity==="critical"?"text-red-500":ee.severity==="high"?"text-orange-500":ee.severity==="medium"?"text-yellow-500":"text-gray-400")}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:"text-gray-700",children:ee.description}),ee.lineRef&&l.jsxs("span",{className:"text-gray-400 text-xs ml-2",children:["(",ee.lineRef,")"]}),ee.snippet&&l.jsx("pre",{className:"mt-1 text-xs bg-gray-100 rounded px-2 py-1 overflow-x-auto text-gray-600",children:ee.snippet})]})]},Z)})]})]}),!G&&l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4 text-center text-sm text-gray-400",children:[l.jsx(Ie,{className:"w-4 h-4 animate-spin inline mr-2"}),"AI review in progress..."]}),(t||n)&&l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:[l.jsxs("button",{onClick:O,className:"w-full flex items-center gap-2 px-4 py-3 text-sm text-left hover:bg-gray-50 transition-colors",children:[l.jsx(QO,{className:"w-4 h-4 text-indigo-500"}),l.jsx("span",{className:"font-bold text-xs text-gray-400 uppercase tracking-wider flex-1",children:"Changes (Diff)"}),T?l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin text-gray-400"}):_?l.jsx(fh,{className:"w-3.5 h-3.5 text-gray-400"}):l.jsx(ea,{className:"w-3.5 h-3.5 text-gray-400"})]}),_&&N!==null&&l.jsx("div",{className:"border-t border-gray-100",children:l.jsx("pre",{className:"p-3 bg-[#1e1e1e] text-xs font-mono overflow-x-auto max-h-80 overflow-y-auto",children:N.split(`
|
|
616
|
+
`).map((ee,Z)=>l.jsx("div",{className:U(ee.startsWith("+")&&!ee.startsWith("+++")?"text-green-400 bg-green-950/30":ee.startsWith("-")&&!ee.startsWith("---")?"text-red-400 bg-red-950/30":ee.startsWith("@@")?"text-cyan-400":"text-[#d4d4d4]"),children:ee},Z))})})]}),(()=>{const ee=p==null?void 0:p.scripts;return ee&&ee.length>0?l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[l.jsx("h4",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider mb-3",children:"Scripts"}),l.jsx("div",{className:"space-y-2",children:ee.map(Z=>l.jsxs("div",{className:"border border-gray-100 rounded-lg overflow-hidden",children:[l.jsxs("button",{onClick:()=>D(Z.name),className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-gray-50 transition-colors",children:[l.jsx("div",{className:U("w-6 h-6 rounded flex items-center justify-center shrink-0",Z.info==="python"?"bg-blue-50 text-blue-600":"bg-green-50 text-green-600"),children:Z.info==="python"?l.jsx(Ga,{className:"w-3 h-3"}):l.jsx(ai,{className:"w-3 h-3"})}),l.jsx("span",{className:"font-medium text-gray-700 flex-1",children:Z.name}),k.has(Z.name)?l.jsx(fh,{className:"w-3.5 h-3.5 text-gray-400"}):l.jsx(ea,{className:"w-3.5 h-3.5 text-gray-400"})]}),k.has(Z.name)&&l.jsx("pre",{className:"p-3 bg-[#1e1e1e] text-[#d4d4d4] text-xs font-mono overflow-x-auto max-h-64 overflow-y-auto",children:Z.content})]},Z.id))})]}):null})(),(p==null?void 0:p.specs)&&l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[l.jsx("h4",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider mb-3",children:"SKILL.md (Specs)"}),l.jsx("pre",{className:"text-xs text-gray-600 bg-gray-50 rounded-lg p-3 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:p.specs})]}),r&&(t||n)&&l.jsxs("div",{className:"space-y-3 pt-2",children:[l.jsx("textarea",{value:v,onChange:ee=>b(ee.target.value),placeholder:"Reason for rejection (optional, visible to the author)",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-amber-200 resize-none",rows:2}),l.jsxs("div",{className:"flex items-center justify-end gap-3",children:[l.jsxs("button",{onClick:()=>re("reject"),disabled:w,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-red-700 bg-red-50 border border-red-200 hover:bg-red-100 rounded-lg transition-all disabled:opacity-50",children:[l.jsx(Qe,{className:"w-4 h-4"}),"Reject"]}),l.jsxs("button",{onClick:()=>re("approve"),disabled:w,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-green-700 bg-green-50 border border-green-200 hover:bg-green-100 rounded-lg transition-all disabled:opacity-50",children:[l.jsx(_n,{className:"w-4 h-4"}),n?"Approve & Publish to Team":"Approve"]})]})]})]})})]})}function tJ({enabled:e,onToggle:t,disabled:n}){return l.jsx(dt,{content:n?"Under review":e?"Disable Skill":"Enable Skill",children:l.jsx("button",{role:"switch","aria-checked":e,onClick:n?void 0:t,disabled:n,className:U("relative inline-flex h-5 w-9 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",n?"bg-gray-200 opacity-50 cursor-not-allowed":e?"bg-green-500 focus-visible:ring-green-500 cursor-pointer":"bg-gray-200 focus-visible:ring-gray-400 cursor-pointer"),children:l.jsx("span",{className:U("pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-in-out",e&&!n?"translate-x-4":"translate-x-0")})})})}var JD={},on=Ln&&Ln.__assign||function(){return on=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},on.apply(this,arguments)},nJ=Ln&&Ln.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),rJ=Ln&&Ln.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),iJ=Ln&&Ln.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&nJ(t,e,n);return rJ(t,e),t},aJ=Ln&&Ln.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(JD,"__esModule",{value:!0});var Er=iJ(m),sJ=89,_f=90,oJ=77,wC=57,SC=219,kC=222,jC=192,NC=100,lJ=3e3,cJ=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),ty=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),xh="npm__react-simple-code-editor__textarea",uJ=`
|
|
617
|
+
/**
|
|
618
|
+
* Reset the text fill color so that placeholder is visible
|
|
619
|
+
*/
|
|
620
|
+
.`.concat(xh,`:empty {
|
|
621
|
+
-webkit-text-fill-color: inherit !important;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Hack to apply on some CSS on IE10 and IE11
|
|
626
|
+
*/
|
|
627
|
+
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
|
628
|
+
/**
|
|
629
|
+
* IE doesn't support '-webkit-text-fill-color'
|
|
630
|
+
* So we use 'color: transparent' to make the text transparent on IE
|
|
631
|
+
* Unlike other browsers, it doesn't affect caret color in IE
|
|
632
|
+
*/
|
|
633
|
+
.`).concat(xh,` {
|
|
634
|
+
color: transparent !important;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.`).concat(xh,`::selection {
|
|
638
|
+
background-color: #accef7 !important;
|
|
639
|
+
color: transparent !important;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
`),dJ=Er.forwardRef(function(t,n){var r=t.autoFocus,i=t.disabled,a=t.form,s=t.highlight,o=t.ignoreTabKey,c=o===void 0?!1:o,u=t.insertSpaces,d=u===void 0?!0:u,f=t.maxLength,h=t.minLength,p=t.name,g=t.onBlur,y=t.onClick,x=t.onFocus,v=t.onKeyDown,b=t.onKeyUp,w=t.onValueChange,S=t.padding,k=S===void 0?0:S,j=t.placeholder,N=t.preClassName,P=t.readOnly,T=t.required,E=t.style,_=t.tabSize,C=_===void 0?2:_,A=t.textareaClassName,M=t.textareaId,B=t.value,ae=aJ(t,["autoFocus","disabled","form","highlight","ignoreTabKey","insertSpaces","maxLength","minLength","name","onBlur","onClick","onFocus","onKeyDown","onKeyUp","onValueChange","padding","placeholder","preClassName","readOnly","required","style","tabSize","textareaClassName","textareaId","value"]),Q=Er.useRef({stack:[],offset:-1}),I=Er.useRef(null),H=Er.useState(!0),O=H[0],oe=H[1],re={paddingTop:typeof k=="object"?k.top:k,paddingRight:typeof k=="object"?k.right:k,paddingBottom:typeof k=="object"?k.bottom:k,paddingLeft:typeof k=="object"?k.left:k},D=s(B),G=function(R,F){return R.substring(0,F).split(`
|
|
643
|
+
`)},te=Er.useCallback(function(R,F){var ue,le,ze;F===void 0&&(F=!1);var Be=Q.current,et=Be.stack,pt=Be.offset;if(et.length&&pt>-1){Q.current.stack=et.slice(0,pt+1);var Pt=Q.current.stack.length;if(Pt>NC){var Vt=Pt-NC;Q.current.stack=et.slice(Vt,Pt),Q.current.offset=Math.max(Q.current.offset-Vt,0)}}var ut=Date.now();if(F){var tt=Q.current.stack[Q.current.offset];if(tt&&ut-tt.timestamp<lJ){var je=/[^a-z0-9]([a-z0-9]+)$/i,W=(ue=G(tt.value,tt.selectionStart).pop())===null||ue===void 0?void 0:ue.match(je),se=(le=G(R.value,R.selectionStart).pop())===null||le===void 0?void 0:le.match(je);if(W!=null&&W[1]&&(!((ze=se==null?void 0:se[1])===null||ze===void 0)&&ze.startsWith(W[1]))){Q.current.stack[Q.current.offset]=on(on({},R),{timestamp:ut});return}}}Q.current.stack.push(on(on({},R),{timestamp:ut})),Q.current.offset++},[]),ee=Er.useCallback(function(){var R=I.current;if(R){var F=R.value,ue=R.selectionStart,le=R.selectionEnd;te({value:F,selectionStart:ue,selectionEnd:le})}},[te]),Z=function(R){var F=I.current;F&&(F.value=R.value,F.selectionStart=R.selectionStart,F.selectionEnd=R.selectionEnd,w==null||w(R.value))},ce=function(R){var F=I.current,ue=Q.current.stack[Q.current.offset];ue&&F&&(Q.current.stack[Q.current.offset]=on(on({},ue),{selectionStart:F.selectionStart,selectionEnd:F.selectionEnd})),te(R),Z(R)},J=function(){var R=Q.current,F=R.stack,ue=R.offset,le=F[ue-1];le&&(Z(le),Q.current.offset=Math.max(ue-1,0))},ne=function(){var R=Q.current,F=R.stack,ue=R.offset,le=F[ue+1];le&&(Z(le),Q.current.offset=Math.min(ue+1,F.length-1))},be=function(R){if(!(v&&(v(R),R.defaultPrevented))){R.key==="Escape"&&R.currentTarget.blur();var F=R.currentTarget,ue=F.value,le=F.selectionStart,ze=F.selectionEnd,Be=(d?" ":" ").repeat(C);if(R.key==="Tab"&&!c&&O)if(R.preventDefault(),R.shiftKey){var et=G(ue,le),pt=et.length-1,Pt=G(ue,ze).length-1,Vt=ue.split(`
|
|
644
|
+
`).map(function(Ue,mt){return mt>=pt&&mt<=Pt&&Ue.startsWith(Be)?Ue.substring(Be.length):Ue}).join(`
|
|
645
|
+
`);if(ue!==Vt){var ut=et[pt];ce({value:Vt,selectionStart:ut!=null&&ut.startsWith(Be)?le-Be.length:le,selectionEnd:ze-(ue.length-Vt.length)})}}else if(le!==ze){var et=G(ue,le),tt=et.length-1,je=G(ue,ze).length-1,ut=et[tt];ce({value:ue.split(`
|
|
646
|
+
`).map(function(rt,gt){return gt>=tt&><=je?Be+rt:rt}).join(`
|
|
647
|
+
`),selectionStart:ut&&/\S/.test(ut)?le+Be.length:le,selectionEnd:ze+Be.length*(je-tt+1)})}else{var W=le+Be.length;ce({value:ue.substring(0,le)+Be+ue.substring(ze),selectionStart:W,selectionEnd:W})}else if(R.key==="Backspace"){var se=le!==ze,Te=ue.substring(0,le);if(Te.endsWith(Be)&&!se){R.preventDefault();var W=le-Be.length;ce({value:ue.substring(0,le-Be.length)+ue.substring(ze),selectionStart:W,selectionEnd:W})}}else if(R.key==="Enter"){if(le===ze){var pe=G(ue,le).pop(),L=pe==null?void 0:pe.match(/^\s+/);if(L!=null&&L[0]){R.preventDefault();var ye=`
|
|
648
|
+
`+L[0],W=le+ye.length;ce({value:ue.substring(0,le)+ye+ue.substring(ze),selectionStart:W,selectionEnd:W})}}}else if(R.keyCode===wC||R.keyCode===SC||R.keyCode===kC||R.keyCode===jC){var _e=void 0;R.keyCode===wC&&R.shiftKey?_e=["(",")"]:R.keyCode===SC?R.shiftKey?_e=["{","}"]:_e=["[","]"]:R.keyCode===kC?R.shiftKey?_e=['"','"']:_e=["'","'"]:R.keyCode===jC&&!R.shiftKey&&(_e=["`","`"]),le!==ze&&_e&&(R.preventDefault(),ce({value:ue.substring(0,le)+_e[0]+ue.substring(le,ze)+_e[1]+ue.substring(ze),selectionStart:le,selectionEnd:ze+2}))}else(ty?R.metaKey&&R.keyCode===_f:R.ctrlKey&&R.keyCode===_f)&&!R.shiftKey&&!R.altKey?(R.preventDefault(),J()):(ty?R.metaKey&&R.keyCode===_f&&R.shiftKey:cJ?R.ctrlKey&&R.keyCode===sJ:R.ctrlKey&&R.keyCode===_f&&R.shiftKey)&&!R.altKey?(R.preventDefault(),ne()):R.keyCode===oJ&&R.ctrlKey&&(!ty||R.shiftKey)&&(R.preventDefault(),oe(function(Ue){return!Ue}))}},Y=function(R){var F=R.currentTarget,ue=F.value,le=F.selectionStart,ze=F.selectionEnd;te({value:ue,selectionStart:le,selectionEnd:ze},!0),w(ue)};return Er.useEffect(function(){ee()},[ee]),Er.useImperativeHandle(n,function(){return{get session(){return{history:Q.current}},set session(R){Q.current=R.history}}},[]),Er.createElement("div",on({},ae,{style:on(on({},Dc.container),E)}),Er.createElement("pre",on({className:N,"aria-hidden":"true",style:on(on(on({},Dc.editor),Dc.highlight),re)},typeof D=="string"?{dangerouslySetInnerHTML:{__html:D+"<br />"}}:{children:D})),Er.createElement("textarea",{ref:function(R){return I.current=R},style:on(on(on({},Dc.editor),Dc.textarea),re),className:xh+(A?" ".concat(A):""),id:M,value:B,onChange:Y,onKeyDown:be,onClick:y,onKeyUp:b,onFocus:x,onBlur:g,disabled:i,form:a,maxLength:f,minLength:h,name:p,placeholder:j,readOnly:P,required:T,autoFocus:r,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),Er.createElement("style",{dangerouslySetInnerHTML:{__html:uJ}}))}),Dc={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}},fJ=JD.default=dJ,eM={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
649
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
650
|
+
*
|
|
651
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
652
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
653
|
+
* @namespace
|
|
654
|
+
* @public
|
|
655
|
+
*/var n=function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,s={},o={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function b(w){return w instanceof c?new c(w.type,b(w.content),w.alias):Array.isArray(w)?w.map(b):w.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(b){return Object.prototype.toString.call(b).slice(8,-1)},objId:function(b){return b.__id||Object.defineProperty(b,"__id",{value:++a}),b.__id},clone:function b(w,S){S=S||{};var k,j;switch(o.util.type(w)){case"Object":if(j=o.util.objId(w),S[j])return S[j];k={},S[j]=k;for(var N in w)w.hasOwnProperty(N)&&(k[N]=b(w[N],S));return k;case"Array":return j=o.util.objId(w),S[j]?S[j]:(k=[],S[j]=k,w.forEach(function(P,T){k[T]=b(P,S)}),k);default:return w}},getLanguage:function(b){for(;b;){var w=i.exec(b.className);if(w)return w[1].toLowerCase();b=b.parentElement}return"none"},setLanguage:function(b,w){b.className=b.className.replace(RegExp(i,"gi"),""),b.classList.add("language-"+w)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(k){var b=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(k.stack)||[])[1];if(b){var w=document.getElementsByTagName("script");for(var S in w)if(w[S].src==b)return w[S]}return null}},isActive:function(b,w,S){for(var k="no-"+w;b;){var j=b.classList;if(j.contains(w))return!0;if(j.contains(k))return!1;b=b.parentElement}return!!S}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(b,w){var S=o.util.clone(o.languages[b]);for(var k in w)S[k]=w[k];return S},insertBefore:function(b,w,S,k){k=k||o.languages;var j=k[b],N={};for(var P in j)if(j.hasOwnProperty(P)){if(P==w)for(var T in S)S.hasOwnProperty(T)&&(N[T]=S[T]);S.hasOwnProperty(P)||(N[P]=j[P])}var E=k[b];return k[b]=N,o.languages.DFS(o.languages,function(_,C){C===E&&_!=b&&(this[_]=N)}),N},DFS:function b(w,S,k,j){j=j||{};var N=o.util.objId;for(var P in w)if(w.hasOwnProperty(P)){S.call(w,P,w[P],k||P);var T=w[P],E=o.util.type(T);E==="Object"&&!j[N(T)]?(j[N(T)]=!0,b(T,S,null,j)):E==="Array"&&!j[N(T)]&&(j[N(T)]=!0,b(T,S,P,j))}}},plugins:{},highlightAll:function(b,w){o.highlightAllUnder(document,b,w)},highlightAllUnder:function(b,w,S){var k={callback:S,container:b,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",k),k.elements=Array.prototype.slice.apply(k.container.querySelectorAll(k.selector)),o.hooks.run("before-all-elements-highlight",k);for(var j=0,N;N=k.elements[j++];)o.highlightElement(N,w===!0,k.callback)},highlightElement:function(b,w,S){var k=o.util.getLanguage(b),j=o.languages[k];o.util.setLanguage(b,k);var N=b.parentElement;N&&N.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(N,k);var P=b.textContent,T={element:b,language:k,grammar:j,code:P};function E(C){T.highlightedCode=C,o.hooks.run("before-insert",T),T.element.innerHTML=T.highlightedCode,o.hooks.run("after-highlight",T),o.hooks.run("complete",T),S&&S.call(T.element)}if(o.hooks.run("before-sanity-check",T),N=T.element.parentElement,N&&N.nodeName.toLowerCase()==="pre"&&!N.hasAttribute("tabindex")&&N.setAttribute("tabindex","0"),!T.code){o.hooks.run("complete",T),S&&S.call(T.element);return}if(o.hooks.run("before-highlight",T),!T.grammar){E(o.util.encode(T.code));return}if(w&&r.Worker){var _=new Worker(o.filename);_.onmessage=function(C){E(C.data)},_.postMessage(JSON.stringify({language:T.language,code:T.code,immediateClose:!0}))}else E(o.highlight(T.code,T.grammar,T.language))},highlight:function(b,w,S){var k={code:b,grammar:w,language:S};if(o.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=o.tokenize(k.code,k.grammar),o.hooks.run("after-tokenize",k),c.stringify(o.util.encode(k.tokens),k.language)},tokenize:function(b,w){var S=w.rest;if(S){for(var k in S)w[k]=S[k];delete w.rest}var j=new f;return h(j,j.head,b),d(b,j,w,j.head,0),g(j)},hooks:{all:{},add:function(b,w){var S=o.hooks.all;S[b]=S[b]||[],S[b].push(w)},run:function(b,w){var S=o.hooks.all[b];if(!(!S||!S.length))for(var k=0,j;j=S[k++];)j(w)}},Token:c};r.Prism=o;function c(b,w,S,k){this.type=b,this.content=w,this.alias=S,this.length=(k||"").length|0}c.stringify=function b(w,S){if(typeof w=="string")return w;if(Array.isArray(w)){var k="";return w.forEach(function(E){k+=b(E,S)}),k}var j={type:w.type,content:b(w.content,S),tag:"span",classes:["token",w.type],attributes:{},language:S},N=w.alias;N&&(Array.isArray(N)?Array.prototype.push.apply(j.classes,N):j.classes.push(N)),o.hooks.run("wrap",j);var P="";for(var T in j.attributes)P+=" "+T+'="'+(j.attributes[T]||"").replace(/"/g,""")+'"';return"<"+j.tag+' class="'+j.classes.join(" ")+'"'+P+">"+j.content+"</"+j.tag+">"};function u(b,w,S,k){b.lastIndex=w;var j=b.exec(S);if(j&&k&&j[1]){var N=j[1].length;j.index+=N,j[0]=j[0].slice(N)}return j}function d(b,w,S,k,j,N){for(var P in S)if(!(!S.hasOwnProperty(P)||!S[P])){var T=S[P];T=Array.isArray(T)?T:[T];for(var E=0;E<T.length;++E){if(N&&N.cause==P+","+E)return;var _=T[E],C=_.inside,A=!!_.lookbehind,M=!!_.greedy,B=_.alias;if(M&&!_.pattern.global){var ae=_.pattern.toString().match(/[imsuy]*$/)[0];_.pattern=RegExp(_.pattern.source,ae+"g")}for(var Q=_.pattern||_,I=k.next,H=j;I!==w.tail&&!(N&&H>=N.reach);H+=I.value.length,I=I.next){var O=I.value;if(w.length>b.length)return;if(!(O instanceof c)){var oe=1,re;if(M){if(re=u(Q,H,b,A),!re||re.index>=b.length)break;var ee=re.index,D=re.index+re[0].length,G=H;for(G+=I.value.length;ee>=G;)I=I.next,G+=I.value.length;if(G-=I.value.length,H=G,I.value instanceof c)continue;for(var te=I;te!==w.tail&&(G<D||typeof te.value=="string");te=te.next)oe++,G+=te.value.length;oe--,O=b.slice(H,G),re.index-=H}else if(re=u(Q,0,O,A),!re)continue;var ee=re.index,Z=re[0],ce=O.slice(0,ee),J=O.slice(ee+Z.length),ne=H+O.length;N&&ne>N.reach&&(N.reach=ne);var be=I.prev;ce&&(be=h(w,be,ce),H+=ce.length),p(w,be,oe);var Y=new c(P,C?o.tokenize(Z,C):Z,B,Z);if(I=h(w,be,Y),J&&h(w,I,J),oe>1){var R={cause:P+","+E,reach:ne};d(b,w,S,I.prev,H,R),N&&R.reach>N.reach&&(N.reach=R.reach)}}}}}}function f(){var b={value:null,prev:null,next:null},w={value:null,prev:b,next:null};b.next=w,this.head=b,this.tail=w,this.length=0}function h(b,w,S){var k=w.next,j={value:S,prev:w,next:k};return w.next=j,k.prev=j,b.length++,j}function p(b,w,S){for(var k=w.next,j=0;j<S&&k!==b.tail;j++)k=k.next;w.next=k,k.prev=w,b.length-=j}function g(b){for(var w=[],S=b.head.next;S!==b.tail;)w.push(S.value),S=S.next;return w}if(!r.document)return r.addEventListener&&(o.disableWorkerMessageHandler||r.addEventListener("message",function(b){var w=JSON.parse(b.data),S=w.language,k=w.code,j=w.immediateClose;r.postMessage(o.highlight(k,o.languages[S],S)),j&&r.close()},!1)),o;var y=o.util.currentScript();y&&(o.filename=y.src,y.hasAttribute("data-manual")&&(o.manual=!0));function x(){o.manual||o.highlightAll()}if(!o.manual){var v=document.readyState;v==="loading"||v==="interactive"&&y&&y.defer?document.addEventListener("DOMContentLoaded",x):window.requestAnimationFrame?window.requestAnimationFrame(x):window.setTimeout(x,16)}return o}(t);e.exports&&(e.exports=n),typeof Ln<"u"&&(Ln.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(i,a){var s={};s["language-"+a]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[a]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};o["language-"+a]={pattern:/[\s\S]+/,inside:n.languages[a]};var c={};c[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:o},n.languages.insertBefore("markup","cdata",c)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,i){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:n.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(r){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var a=r.languages.markup;a&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",i=function(y,x){return"✖ Error "+y+" while fetching file: "+x},a="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},o="data-src-status",c="loading",u="loaded",d="failed",f="pre[data-src]:not(["+o+'="'+u+'"]):not(['+o+'="'+c+'"])';function h(y,x,v){var b=new XMLHttpRequest;b.open("GET",y,!0),b.onreadystatechange=function(){b.readyState==4&&(b.status<400&&b.responseText?x(b.responseText):b.status>=400?v(i(b.status,b.statusText)):v(a))},b.send(null)}function p(y){var x=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(y||"");if(x){var v=Number(x[1]),b=x[2],w=x[3];return b?w?[v,Number(w)]:[v,void 0]:[v,v]}}n.hooks.add("before-highlightall",function(y){y.selector+=", "+f}),n.hooks.add("before-sanity-check",function(y){var x=y.element;if(x.matches(f)){y.code="",x.setAttribute(o,c);var v=x.appendChild(document.createElement("CODE"));v.textContent=r;var b=x.getAttribute("data-src"),w=y.language;if(w==="none"){var S=(/\.(\w+)$/.exec(b)||[,"none"])[1];w=s[S]||S}n.util.setLanguage(v,w),n.util.setLanguage(x,w);var k=n.plugins.autoloader;k&&k.loadLanguages(w),h(b,function(j){x.setAttribute(o,u);var N=p(x.getAttribute("data-range"));if(N){var P=j.split(/\r\n?|\n/g),T=N[0],E=N[1]==null?P.length:N[1];T<0&&(T+=P.length),T=Math.max(0,Math.min(T-1,P.length)),E<0&&(E+=P.length),E=Math.max(0,Math.min(E,P.length)),j=P.slice(T,E).join(`
|
|
656
|
+
`),x.hasAttribute("data-start")||x.setAttribute("data-start",String(T+1))}v.textContent=j,n.highlightElement(v)},function(j){x.setAttribute(o,d),v.textContent=j})}}),n.plugins.fileHighlight={highlight:function(x){for(var v=(x||document).querySelectorAll(f),b=0,w;w=v[b++];)n.highlightElement(w)}};var g=!1;n.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(eM);var hJ=eM.exports;const Df=fi(hJ);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;(function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=r.variable[1].inside,s=0;s<i.length;s++)a[i[s]]=e.languages.bash[i[s]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(Prism);const ny=`---
|
|
657
|
+
name: new-skill
|
|
658
|
+
description: Describe what this skill does
|
|
659
|
+
---
|
|
660
|
+
|
|
661
|
+
# New Skill
|
|
662
|
+
|
|
663
|
+
inputs:
|
|
664
|
+
- name: target
|
|
665
|
+
description: The target resource to analyze
|
|
666
|
+
required: true
|
|
667
|
+
|
|
668
|
+
outputs:
|
|
669
|
+
- name: analysis_report
|
|
670
|
+
description: Markdown formatted analysis result
|
|
671
|
+
|
|
672
|
+
troubleshooting:
|
|
673
|
+
- "Ensure network connectivity to the target"
|
|
674
|
+
|
|
675
|
+
examples:
|
|
676
|
+
- "run analysis --target=payment-service"`,ov=document.createElement("style");ov.textContent=`
|
|
677
|
+
code[class*="language-"], pre[class*="language-"] {
|
|
678
|
+
text-shadow: none !important;
|
|
679
|
+
font-family: "JetBrains Mono", "Fira Code", monospace !important;
|
|
680
|
+
}
|
|
681
|
+
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6a9955; }
|
|
682
|
+
.token.punctuation { color: #d4d4d4; }
|
|
683
|
+
.token.namespace { opacity: .7; }
|
|
684
|
+
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #b5cea8; }
|
|
685
|
+
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #ce9178; }
|
|
686
|
+
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #d4d4d4; }
|
|
687
|
+
.token.atrule, .token.attr-value, .token.keyword { color: #c586c0; }
|
|
688
|
+
.token.function, .token.class-name { color: #dcdcaa; }
|
|
689
|
+
.token.regex, .token.important, .token.variable { color: #d16969; }
|
|
690
|
+
`;document.head.querySelector("style[data-prism-custom]")||(ov.setAttribute("data-prism-custom","true"),document.head.appendChild(ov));const pJ=["Custom","Database","Security","Network","Core","Utility","Monitoring","Automation"],S1="siclaw_skill_draft:";function mJ(e,t){const n={name:t.name,type:t.type,version:t.version,specs:t.specs||"",scripts:(t.scripts||[]).map(r=>({id:r.id,info:r.info,name:r.name,content:r.content})),savedAt:Date.now()};try{localStorage.setItem(S1+e,JSON.stringify(n))}catch{}}function gJ(e){try{const t=localStorage.getItem(S1+e);return t?JSON.parse(t):null}catch{return null}}function Mc(e){localStorage.removeItem(S1+e)}function CC(e,t){return!e||!t?!1:e.name!==t.name||e.specs!==t.specs||e.type!==t.type||e.version!==t.version||JSON.stringify((e.scripts||[]).map(n=>({id:n.id,info:n.info,name:n.name,content:n.content})))!==JSON.stringify((t.scripts||[]).map(n=>({id:n.id,info:n.info,name:n.name,content:n.content})))}function yJ(e){const t=Math.floor((Date.now()-e)/1e3);return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function xJ(){var je,W,se,Te,pe,L,ye,_e,Ue,mt,rt,gt,Kt,Et;const{id:e}=s7(),t=zi(),[n]=wd(),{sendRpc:r,isConnected:i}=Rt(),[a,s]=m.useState(!1),[o,c]=m.useState(null),[u,d]=m.useState(null),[f,h]=m.useState(!1),[p,g]=m.useState(!1),[y,x]=m.useState(!1),v=m.useRef(null),b=m.useRef(null),[w,S]=m.useState(!1),[k,j]=m.useState(!1),[N,P]=m.useState(!1),[T,E]=m.useState([]),[_,C]=m.useState(!1),[A,M]=m.useState(null),[B,ae]=m.useState(null),[Q,I]=m.useState(null),H=e==="new",O=!!o&&o.scope!=="personal",oe=ds(),re=(oe==null?void 0:oe.username)==="admin",D=(o==null?void 0:o.authorId)===(oe==null?void 0:oe.id),G=async()=>{if(!(!o||!e))try{S(!0);const de=await ZD(r,String(o.id));t(`/skills/${de.id}`)}catch(de){console.error("[SkillEditor] Fork failed:",de)}finally{S(!1)}},te=async()=>{if(!(!e||H)){if(N){P(!1);return}C(!0);try{const de=await WQ(r,e);E(de.versions),P(!0)}catch(de){console.error("[SkillEditor] Failed to load history:",de)}finally{C(!1)}}},ee=async de=>{if(!(!e||H))try{await XD(r,e,de);const Me=await sv(r,e);if(Me){const Ke={...Me,specs:Me.specs||ny,scripts:Me.scripts||[]};c(Ke),ae(Ke),Mc(e)}P(!1),M(null)}catch(Me){console.error("[SkillEditor] Rollback failed:",Me)}},Z=(o==null?void 0:o.scope)==="personal"&&D||(o==null?void 0:o.scope)==="team"&&re;m.useEffect(()=>{if(g(!1),x(!1),I(null),!e)return;const de=Ke=>{ae(Ke);const yt=gJ(e);yt&&yt.savedAt>0?(c({...Ke,name:yt.name,type:yt.type,version:yt.version,specs:yt.specs,scripts:yt.scripts}),I({savedAt:yt.savedAt})):c(Ke)};if(e==="new"){b.current=null;const Ke={id:`new-${Date.now()}`,name:"New Custom Skill",description:"Describe what this skill does...",type:"Custom",icon:qs,status:"not_installed",version:"0.0.1",specs:ny,scripts:[],scope:"personal",author:"Current User",contributionStatus:"none",enabled:!0};de(Ke),s(!1),d(null);return}if(!i||b.current===e)return;b.current=e;let Me=!1;return sv(r,e).then(Ke=>{if(!Me)if(Ke){const yt={...Ke,specs:Ke.specs||ny,scripts:Ke.scripts||[]};de(yt)}else t("/skills")}),()=>{Me=!0}},[e,t,i,r]),m.useEffect(()=>{n.get("history")==="true"&&!N&&!H&&te()},[n]);const ce=m.useMemo(()=>CC(o,B),[o,B]);m.useEffect(()=>{if(!e||!o||!B||O)return;const de=setTimeout(()=>{CC(o,B)?mJ(e,o):Mc(e)},1e3);return()=>clearTimeout(de)},[e,o,B,O]),m.useEffect(()=>{const de=Me=>{ce&&Me.preventDefault()};return window.addEventListener("beforeunload",de),()=>window.removeEventListener("beforeunload",de)},[ce]);const J=m.useRef(!1),ne=g7(()=>ce&&!J.current),be=m.useCallback(()=>{e&&B&&(Mc(e),c(B),I(null))},[e,B]),Y=m.useCallback(()=>{I(null)},[]),R=async()=>{if(o)try{h(!0),await RQ(r,o,H),e&&Mc(e),ae(o),J.current=!0,t("/skills")}catch(de){console.error("[SkillEditor] Save failed:",de)}finally{h(!1)}},F=()=>{o&&j(!0)},ue=async()=>{if(o)try{await FQ(r,String(o.id)),e&&Mc(e),J.current=!0,t("/skills")}catch(de){console.error("[SkillEditor] Delete failed:",de)}},[le,ze]=m.useState(null),[Be,et]=m.useState(""),pt=de=>{ze(de),et(de==="python"?"script.py":"script.sh"),g(!1)},Pt=()=>{if(!le||!Be.trim())return;const de={id:`new-${Date.now()}`,info:le,name:Be.trim(),content:le==="python"?'print("New Python Script")':`#!/bin/bash
|
|
691
|
+
|
|
692
|
+
echo "New Shell Script"`};c(Me=>Me?{...Me,scripts:[...Me.scripts||[],de]}:null),d(de.id),ze(null),et("")},Vt=(de,Me)=>{if(de.stopPropagation(),!(o!=null&&o.scripts))return;const Ke=o.scripts.filter(yt=>yt.id!==Me);c({...o,scripts:Ke}),u===Me&&Ke.length>0?d(Ke[0].id):u===Me&&Ke.length===0&&d(null)},ut=de=>{var yt;const Me=(yt=de.target.files)==null?void 0:yt[0];if(!Me)return;const Ke=new FileReader;Ke.onload=js=>{var qr;const _o=(qr=js.target)==null?void 0:qr.result,pc=Me.name.endsWith(".py"),Ns={id:`upload-${Date.now()}`,info:pc?"python":"shell",name:Me.name,content:_o};c(pi=>pi?{...pi,scripts:[...pi.scripts||[],Ns]}:null),d(Ns.id)},Ke.readAsText(Me),de.target.value=""},tt=de=>{o&&c({...o,name:de.target.value})};return o?l.jsxs("div",{className:"h-full bg-white flex flex-col relative",children:[l.jsx(Ur,{children:le&&l.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/20 backdrop-blur-[1px]",children:l.jsxs(Zt.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-xl shadow-2xl border border-gray-100 p-5 w-80 space-y-4",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-bold text-gray-900",children:["New ",le==="python"?"Python":"Shell"," Script"]}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Enter a filename for your script."})]}),l.jsx("input",{autoFocus:!0,type:"text",value:Be,onChange:de=>et(de.target.value),onKeyDown:de=>de.key==="Enter"&&Pt(),className:"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg text-sm text-gray-900 focus:outline-none focus:ring-2 focus:ring-primary-500/50",placeholder:le==="python"?"script.py":"script.sh"}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{onClick:()=>ze(null),className:"px-3 py-1.5 text-xs font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:"Cancel"}),l.jsx("button",{onClick:Pt,disabled:!Be.trim(),className:"px-3 py-1.5 text-xs font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm disabled:opacity-50 transition-all",children:"Create Script"})]})]})})}),l.jsxs("header",{className:"flex items-center justify-between px-6 py-3 border-b border-gray-100 bg-white shrink-0 h-14",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(dt,{content:"Back to Skills",children:l.jsx("button",{onClick:()=>t("/skills"),className:"p-2 -ml-2 text-gray-400 hover:text-gray-700 rounded-lg hover:bg-gray-100 transition-colors",children:l.jsx(G7,{className:"w-5 h-5"})})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[O?l.jsx("span",{className:"text-base font-bold text-gray-900 px-1 -ml-1 h-6 flex items-center",children:o.name}):l.jsx("input",{type:"text",value:o.name,onChange:tt,className:"text-base font-bold text-gray-900 bg-transparent border-none focus:ring-0 p-0 hover:bg-gray-50 rounded px-1 -ml-1 transition-colors w-64 h-6"}),ce&&l.jsx("span",{className:"text-amber-500 text-lg leading-none",title:"Unsaved changes",children:"●"})]}),o.scope&&o.scope!=="personal"&&l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium",o.scope==="builtin"?"bg-gray-100 text-gray-700":"bg-blue-50 text-blue-700"),children:[o.scope==="builtin"?l.jsx(Qh,{className:"w-2.5 h-2.5"}):l.jsx(ta,{className:"w-2.5 h-2.5"}),o.scope==="builtin"?"System Skills":"Team Skills",l.jsx("span",{className:"text-gray-400 ml-0.5",children:"· Read-only"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(dt,{content:a?"Hide Scripts":"Show Scripts",children:l.jsx("button",{onClick:()=>s(!a),className:U("p-2 rounded-lg text-gray-400 transition-all border border-transparent hover:border-gray-200 hover:bg-gray-50",a?"text-primary-600 bg-primary-50 hover:bg-primary-100 hover:border-primary-200":""),children:l.jsx(iB,{className:"w-5 h-5"})})}),!H&&l.jsx(dt,{content:N?"Hide History":"Version History",children:l.jsx("button",{onClick:te,disabled:_,className:U("p-2 rounded-lg text-gray-400 transition-all border border-transparent hover:border-gray-200 hover:bg-gray-50",N?"text-indigo-600 bg-indigo-50 hover:bg-indigo-100 hover:border-indigo-200":""),children:_?l.jsx(Ie,{className:"w-5 h-5 animate-spin"}):l.jsx(uw,{className:"w-5 h-5"})})}),l.jsx("div",{className:"h-5 w-px bg-gray-200 mx-1"}),O?l.jsx(dt,{content:"Fork to Personal",children:l.jsx("button",{onClick:G,disabled:w,className:"p-2 text-purple-600 hover:bg-purple-50 rounded-lg transition-colors disabled:opacity-50",children:w?l.jsx(Ie,{className:"w-5 h-5 animate-spin"}):l.jsx(cw,{className:"w-5 h-5"})})}):l.jsxs(l.Fragment,{children:[l.jsx(dt,{content:f?"Saving...":"Save Changes",children:l.jsx("button",{onClick:R,disabled:f,className:"p-2 text-primary-600 hover:bg-primary-50 rounded-lg transition-colors disabled:opacity-50",children:f?l.jsx(Ie,{className:"w-5 h-5 animate-spin"}):l.jsx(In,{className:"w-5 h-5"})})}),l.jsx(dt,{content:"Delete Skill",children:l.jsx("button",{onClick:F,className:"p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:l.jsx(Fn,{className:"w-5 h-5"})})})]})]})]}),Q&&l.jsxs("div",{className:"px-6 py-2.5 bg-amber-50 border-b border-amber-200 flex items-center gap-2 shrink-0",children:[l.jsxs("span",{className:"text-sm text-amber-800",children:["Unsaved draft found (",yJ(Q.savedAt),")"]}),l.jsx("div",{className:"flex-1"}),l.jsx("button",{onClick:Y,className:"px-3 py-1 text-xs font-medium text-amber-700 hover:bg-amber-100 rounded-md transition-colors",children:"Keep Draft"}),l.jsx("button",{onClick:be,className:"px-3 py-1 text-xs font-medium text-amber-700 hover:bg-amber-100 rounded-md transition-colors",children:"Discard"})]}),o.reviewStatus==="pending"&&l.jsxs("div",{className:"px-6 py-2.5 bg-amber-50 border-b border-amber-200 flex items-center gap-2 shrink-0",children:[l.jsx(Uu,{className:"w-4 h-4 text-amber-600"}),l.jsx("span",{className:"text-sm text-amber-800 font-medium",children:"This skill is pending publish review. Test environment has the latest version."})]}),o.reviewStatus==="approved"&&o.scope==="personal"&&o.publishedVersion!=null&&Number(String(o.version).replace(/^v/,""))>o.publishedVersion&&l.jsxs("div",{className:"px-6 py-2.5 bg-blue-50 border-b border-blue-200 flex items-center gap-2 shrink-0",children:[l.jsx(Ga,{className:"w-4 h-4 text-blue-500"}),l.jsxs("span",{className:"text-sm text-blue-800 font-medium",children:["Modified since published v",o.publishedVersion,". Submit for review to publish changes to production."]})]}),o.reviewStatus==="draft"&&o.scope==="personal"&&l.jsxs("div",{className:"px-6 py-2.5 bg-gray-50 border-b border-gray-200 flex items-center gap-2 shrink-0",children:[l.jsx(Uu,{className:"w-4 h-4 text-gray-400"}),l.jsx("span",{className:"text-sm text-gray-600 font-medium",children:"Draft — available in test environments only. Request publish to use in production."})]}),l.jsxs("div",{className:"flex flex-1 overflow-hidden min-h-0 bg-gray-50/50",children:[l.jsx("div",{className:U("flex flex-col transition-all duration-300 relative bg-white border-r border-gray-200",a?"w-[70%] max-w-[70%]":"w-full"),children:l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 flex flex-col gap-6",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 block",children:"Category"}),l.jsxs("div",{className:"relative group/cat",children:[l.jsx("input",{type:"text",value:o.type,onChange:de=>!O&&c({...o,type:de.target.value}),onFocus:()=>!O&&x(!0),readOnly:O,className:U("w-full px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-700 outline-none transition-all placeholder:text-gray-400",O?"bg-gray-50 cursor-default":"bg-gray-50/50 focus:ring-1 focus:ring-primary-500/50 focus:bg-white focus:border-primary-500"),placeholder:"Select or type..."}),!O&&l.jsx("button",{onClick:()=>x(!y),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 p-1",children:l.jsx(ea,{className:"w-4 h-4"})}),y&&!O&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>x(!1)}),l.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-20 py-1 max-h-48 overflow-y-auto",children:pJ.map(de=>l.jsx("button",{className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 text-gray-700 hover:text-primary-600 transition-colors",onClick:()=>{c({...o,type:de}),x(!1)},children:de},de))})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 block",children:"Version"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",value:o.version,readOnly:!0,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-700 outline-none bg-gray-50 cursor-default",placeholder:"e.g. v1"}),o.publishedVersion!=null&&String(o.publishedVersion)!==((je=o.version)==null?void 0:je.replace(/^v/,""))&&l.jsxs("span",{className:"text-xs text-green-600 whitespace-nowrap",children:["(published: v",o.publishedVersion,")"]})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 block",children:"Labels"}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[(o.labels??[]).map(de=>l.jsxs("span",{className:U("px-1.5 py-0.5 rounded text-[10px] font-medium border bg-gray-50 text-gray-600 border-gray-200 inline-flex items-center gap-1",!O&&"pr-0.5"),children:[de,!O&&l.jsx("button",{onClick:()=>{const Me=(o.labels??[]).filter(Ke=>Ke!==de);c({...o,labels:Me}),H||yC(r,String(o.id),Me).catch(()=>{})},className:"ml-0.5 p-0.5 rounded hover:bg-gray-200 text-gray-400 hover:text-gray-600 transition-colors",children:l.jsx(Qe,{className:"w-2.5 h-2.5"})})]},de)),!O&&l.jsx("input",{type:"text",placeholder:"+ Add label",className:"text-[11px] px-1.5 py-0.5 border border-transparent rounded bg-transparent text-gray-500 outline-none w-20 focus:border-gray-200 focus:bg-white placeholder:text-gray-300",onKeyDown:de=>{if(de.key==="Enter"||de.key===","){de.preventDefault();const Me=de.target.value.trim();if(Me&&!(o.labels??[]).includes(Me)){const Ke=[...o.labels??[],Me];c({...o,labels:Ke}),H||yC(r,String(o.id),Ke).catch(()=>{})}de.target.value=""}}})]})]}),l.jsxs("div",{className:"flex-1 flex flex-col min-h-[400px]",children:[l.jsxs("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 flex justify-between group px-1",children:["Skill Specification (YAML)",l.jsx("span",{className:"text-[10px] text-gray-400 font-medium normal-case group-hover:text-primary-600 cursor-pointer transition-colors opacity-0 group-hover:opacity-100",children:"Reset Template"})]}),l.jsx("div",{className:"relative flex-1 group/editor",children:l.jsx("textarea",{value:o.specs,onChange:de=>!O&&c({...o,specs:de.target.value}),readOnly:O,className:U("w-full h-full px-4 py-3 border border-gray-200 rounded-lg text-xs font-mono text-gray-700 outline-none resize-none leading-relaxed transition-all",O?"bg-gray-50 cursor-default":"bg-gray-50/50 focus:ring-1 focus:ring-primary-500/50 focus:bg-white focus:border-primary-500"),spellCheck:!1})})]})]})}),a&&l.jsxs("div",{className:"flex-1 flex flex-col bg-white",children:[l.jsxs("div",{className:"px-6 py-4 flex items-center justify-between border-b border-gray-100 bg-white",children:[l.jsxs("h3",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:["Scripts (",((W=o.scripts)==null?void 0:W.length)||0,")"]}),!O&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(dt,{content:"Upload Script",children:l.jsx("button",{onClick:()=>{var de;return(de=v.current)==null?void 0:de.click()},className:"p-1.5 text-gray-400 hover:text-gray-700 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(nB,{className:"w-4 h-4"})})}),l.jsxs("div",{className:"relative",children:[l.jsx(dt,{content:"New Script",children:l.jsx("button",{onClick:()=>g(!p),className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",children:l.jsx(dn,{className:"w-4 h-4"})})}),p&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>g(!1)}),l.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 bg-white border border-gray-100 rounded-lg shadow-xl z-20 py-1 flex flex-col overflow-hidden",children:[l.jsxs("button",{onClick:()=>pt("shell"),className:"px-3 py-2.5 text-left text-xs text-gray-700 hover:bg-gray-50 flex items-center gap-2",children:[l.jsx(ai,{className:"w-3.5 h-3.5 text-green-600"}),"Shell Script"]}),l.jsxs("button",{onClick:()=>pt("python"),className:"px-3 py-2.5 text-left text-xs text-gray-700 hover:bg-gray-50 flex items-center gap-2",children:[l.jsx(Ga,{className:"w-3.5 h-3.5 text-blue-600"}),"Python Script"]})]})]})]}),l.jsx("input",{type:"file",ref:v,className:"hidden",accept:".sh,.py,.txt",onChange:ut})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6 pt-2",children:!o.scripts||o.scripts.length===0?l.jsxs("div",{className:"h-40 flex flex-col items-center justify-center border-2 border-dashed border-gray-200 rounded-xl bg-gray-50/50",children:[l.jsx("div",{className:"p-3 bg-white rounded-full shadow-sm mb-3",children:l.jsx(qs,{className:"w-6 h-6 text-gray-300"})}),l.jsx("p",{className:"text-sm text-gray-500 font-medium",children:"No scripts yet"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Add or upload a script to get started"})]}):l.jsx("div",{className:"flex flex-col gap-2",children:o.scripts.map(de=>l.jsxs("div",{onClick:()=>d(de.id),className:"group flex items-center justify-between p-3 bg-white border border-gray-200 hover:border-primary-500/50 hover:shadow-sm rounded-lg cursor-pointer transition-all duration-200",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:U("w-8 h-8 rounded-md flex items-center justify-center shrink-0",de.info==="python"?"bg-blue-50 text-blue-600":"bg-green-50 text-green-600"),children:de.info==="python"?l.jsx(Ga,{className:"w-4 h-4"}):l.jsx(ai,{className:"w-4 h-4"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-900 group-hover:text-primary-600 transition-colors",children:de.name}),l.jsxs("span",{className:"text-[10px] text-gray-400 font-mono",children:[de.info==="python"?"Python":"Bash"," · ",de.content.length,"B"]})]})]}),l.jsxs("div",{className:"flex items-center gap-1 opacity-100 sm:opacity-0 group-hover:opacity-100 transition-opacity pl-4",children:[l.jsx(dt,{content:O?"View Script":"Edit Script",children:l.jsx("button",{onClick:Me=>{Me.stopPropagation(),d(de.id)},className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-md transition-colors",children:O?l.jsx(Zl,{className:"w-4 h-4"}):l.jsx(qs,{className:"w-4 h-4"})})}),!O&&l.jsx(dt,{content:"Delete Script",children:l.jsx("button",{onClick:Me=>Vt(Me,de.id),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors",children:l.jsx(Fn,{className:"w-4 h-4"})})})]})]},de.id))})})]}),l.jsx(Ur,{children:N&&l.jsxs(Zt.div,{initial:{width:0,opacity:0},animate:{width:320,opacity:1},exit:{width:0,opacity:0},transition:{duration:.2},className:"border-l border-gray-200 bg-white flex flex-col overflow-hidden shrink-0",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 flex items-center justify-between",children:[l.jsx("h3",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"Version History"}),l.jsx("button",{onClick:()=>P(!1),className:"p-1 text-gray-400 hover:text-gray-700 rounded",children:l.jsx(Qe,{className:"w-4 h-4"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:T.length===0?l.jsx("p",{className:"text-sm text-gray-400 text-center py-8",children:"No published versions yet"}):T.map(de=>l.jsxs("div",{className:"p-3 rounded-lg border border-gray-100 hover:border-gray-200 transition-colors",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("span",{className:"text-sm font-bold text-gray-900",children:["v",de.version]}),Z&&l.jsx(dt,{content:"Rollback to this version",children:l.jsx("button",{onClick:()=>M(de.version),className:"p-1 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded transition-colors",children:l.jsx(e_,{className:"w-3.5 h-3.5"})})})]}),l.jsx("p",{className:"text-xs text-gray-500 truncate",children:de.message}),l.jsxs("div",{className:"flex items-center gap-2 mt-1.5 text-[10px] text-gray-400",children:[l.jsx("span",{children:de.author}),de.date&&l.jsx("span",{children:new Date(de.date).toLocaleDateString()})]})]},de.hash))})]})}),l.jsx(Ur,{children:u&&l.jsxs(Zt.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.15},className:"absolute inset-0 z-50 bg-[#1e1e1e] flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-[#252526] border-b border-[#1e1e1e]",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:U("w-8 h-8 rounded flex items-center justify-center",((Te=(se=o.scripts)==null?void 0:se.find(de=>de.id===u))==null?void 0:Te.info)==="python"?"bg-[#37373d] text-yellow-400":"bg-[#37373d] text-green-400"),children:((L=(pe=o.scripts)==null?void 0:pe.find(de=>de.id===u))==null?void 0:L.info)==="python"?l.jsx(Ga,{className:"w-4 h-4"}):l.jsx(ai,{className:"w-4 h-4"})}),l.jsx("span",{className:"text-sm font-medium text-gray-200 font-mono",children:(_e=(ye=o.scripts)==null?void 0:ye.find(de=>de.id===u))==null?void 0:_e.name})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[!O&&l.jsx(dt,{content:"Save Script",children:l.jsx("button",{onClick:R,className:"p-1.5 text-gray-400 hover:text-white hover:bg-[#333] rounded transition-colors",children:l.jsx(In,{className:"w-5 h-5"})})}),l.jsx(dt,{content:"Close Editor",children:l.jsx("button",{onClick:()=>d(null),className:"p-1.5 text-gray-400 hover:text-white hover:bg-[#333] rounded transition-colors",children:l.jsx(Qe,{className:"w-5 h-5"})})})]})]}),l.jsx("div",{className:"flex-1 relative font-mono text-sm overflow-y-auto custom-scrollbar",children:l.jsx(fJ,{value:((mt=(Ue=o.scripts)==null?void 0:Ue.find(de=>de.id===u))==null?void 0:mt.content)||"",onValueChange:de=>{var Me;O||c({...o,scripts:(Me=o.scripts)==null?void 0:Me.map(Ke=>Ke.id===u?{...Ke,content:de}:Ke)})},highlight:de=>{var yt;const Me=(yt=o.scripts)==null?void 0:yt.find(js=>js.id===u),Ke=(Me==null?void 0:Me.info)==="python"?Df.languages.python:Df.languages.bash;return Df.highlight(de,Ke||Df.languages.js,(Me==null?void 0:Me.info)||"javascript")},padding:24,style:{fontFamily:'"JetBrains Mono", "Fira Code", monospace',fontSize:14,backgroundColor:"#1e1e1e",color:"#d4d4d4",minHeight:"100%"},className:"min-h-full",textareaClassName:"focus:outline-none"})}),l.jsxs("div",{className:"h-6 bg-[#007acc] text-white flex items-center px-4 text-[11px] font-medium gap-6 select-none border-t border-[#007acc]",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qs,{className:"w-3 h-3 opacity-70"}),l.jsx("span",{children:((gt=(rt=o.scripts)==null?void 0:rt.find(de=>de.id===u))==null?void 0:gt.info)==="python"?"Python 3.10":"Bash 5.0"})]}),l.jsx("span",{className:"flex-1"}),l.jsx("span",{children:"UTF-8"}),l.jsxs("span",{children:["Ln ",(Et=(Kt=o.scripts)==null?void 0:Kt.find(de=>de.id===u))==null?void 0:Et.content.split(`
|
|
693
|
+
`).length,", Col 1"]})]})]})})]}),l.jsx(no,{isOpen:k,onClose:()=>j(!1),onConfirm:ue,title:"Delete Skill",description:"Are you sure you want to delete this skill? This action cannot be undone.",confirmText:"Delete",variant:"danger"}),l.jsx(no,{isOpen:A!==null,onClose:()=>M(null),onConfirm:()=>A!==null&&ee(A),title:"Rollback Version",description:`Are you sure you want to rollback to v${A}? This will overwrite the current working copy and published snapshot.`,confirmText:"Rollback",variant:"warning"}),l.jsx(no,{isOpen:ne.state==="blocked",onClose:()=>{var de;return ne.state==="blocked"&&((de=ne.reset)==null?void 0:de.call(ne))},onConfirm:()=>{var de;return ne.state==="blocked"&&((de=ne.proceed)==null?void 0:de.call(ne))},title:"Unsaved Changes",description:"You have unsaved changes. Your draft has been auto-saved and can be restored next time you open this skill.",confirmText:"Leave",cancelText:"Keep Editing",variant:"warning"})]}):l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Ie,{className:"animate-spin text-gray-400"})})}function vJ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),a=m.useCallback(async()=>{try{const o=await e("channels.list");n(o.channels)}catch(o){console.error("[useChannels] Failed to load:",o)}finally{i(!1)}},[e]),s=m.useCallback(async(o,c,u)=>{await e("channels.save",{id:o,enabled:c,config:u}),await a()},[e,a]);return{channels:t,loading:r,loadChannels:a,saveChannel:s}}const bJ=[{id:"slack",name:"Slack",description:"Slack workspace bot with rich message formatting and threads.",icon:JO},{id:"discord",name:"Discord",description:"Discord server bot with slash commands and channel messaging.",icon:ai},{id:"telegram",name:"Telegram",description:"Bot integration for Telegram groups and direct messages.",icon:Cm},{id:"lark",name:"Lark",description:"Enterprise bot for Lark with interactive cards and approval flows.",icon:oB},{id:"whatsapp",name:"WhatsApp",description:"WhatsApp Business API integration for customer messaging.",icon:cB,comingSoon:!0}];function wJ(e){return bJ.map(t=>{const n=e.find(r=>r.id===t.id);return{...t,status:(n==null?void 0:n.status)??"disconnected",error:n==null?void 0:n.error,config:(n==null?void 0:n.config)??{},enabled:(n==null?void 0:n.enabled)??!1}})}function SJ({channel:e,isOpen:t,onClose:n,onSave:r}){const[i,a]=m.useState({}),[s,o]=m.useState(!1),[c,u]=m.useState(!1);m.useEffect(()=>{e&&(a({...e.config}),o(e.enabled))},[e]);const d=async()=>{if(!(!e||c)){u(!0);try{await r(e.id,s,i)}finally{u(!1)}}};return e?l.jsx(Ur,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(Zt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(Zt.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-white",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-gray-50 rounded-lg border border-gray-100",children:l.jsx(e.icon,{className:"w-5 h-5 text-gray-700"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:e.name}),l.jsx("p",{className:"text-xs text-gray-400",children:"Configuration"})]})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50/50 rounded-xl border border-gray-100",children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-sm font-medium text-gray-900",children:"Enable Integration"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Allow Siclaw to use this channel"})]}),l.jsx("button",{onClick:()=>o(!s),className:U("w-11 h-6 rounded-full transition-colors relative",s?"bg-primary-600":"bg-gray-200"),children:l.jsx("span",{className:U("w-4 h-4 rounded-full bg-white shadow-sm absolute top-1 transition-all",s?"left-6":"left-1")})})]}),l.jsx("div",{className:"h-px bg-gray-100 w-full"}),l.jsxs("div",{className:"space-y-4",children:[e.id==="lark"&&l.jsxs(l.Fragment,{children:[l.jsx(Ma,{label:"App ID",value:i.appId||"",onChange:f=>a({...i,appId:f}),placeholder:"cli_...",required:!0}),l.jsx(Ma,{label:"App Secret",value:i.appSecret||"",onChange:f=>a({...i,appSecret:f}),placeholder:"Your app secret...",type:"password",required:!0})]}),e.id==="telegram"&&l.jsx(Ma,{label:"Bot Token",value:i.botToken||"",onChange:f=>a({...i,botToken:f}),placeholder:"123456:ABC-DEF...",type:"password",required:!0}),e.id==="slack"&&l.jsxs(l.Fragment,{children:[l.jsx(Ma,{label:"Bot Token",value:i.botToken||"",onChange:f=>a({...i,botToken:f}),placeholder:"xoxb-...",type:"password",required:!0}),l.jsx(Ma,{label:"App Token",value:i.appToken||"",onChange:f=>a({...i,appToken:f}),placeholder:"xapp-...",type:"password",required:!0})]}),e.id==="discord"&&l.jsx(Ma,{label:"Bot Token",value:i.token||"",onChange:f=>a({...i,token:f}),placeholder:"Your bot token...",type:"password",required:!0}),e.id==="whatsapp"&&l.jsxs(l.Fragment,{children:[l.jsx(Ma,{label:"Access Token",value:i.accessToken||"",onChange:f=>a({...i,accessToken:f}),placeholder:"Your access token...",type:"password",required:!0}),l.jsx(Ma,{label:"Phone Number ID",value:i.phoneNumberId||"",onChange:f=>a({...i,phoneNumberId:f}),placeholder:"Phone number ID...",required:!0})]})]}),e.status==="error"&&e.error&&l.jsxs("div",{className:"p-3 bg-red-50 border border-red-100 rounded-lg",children:[l.jsx("p",{className:"text-sm text-red-700 font-medium",children:"Connection Error"}),l.jsx("p",{className:"text-xs text-red-600 mt-1",children:e.error})]})]})}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-gray-50/50 flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-400",children:e.status==="connected"?"Currently Connected":e.status==="error"?"Connection Error":"Not Connected"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:d,disabled:c,className:"px-4 py-2 text-sm font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[l.jsx(In,{className:"w-4 h-4"}),c?"Saving...":"Save Configuration"]})]})]})]})]})}):null}function Ma({label:e,value:t,onChange:n,placeholder:r,type:i="text",required:a}){return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700 flex items-center gap-1",children:[e,a&&l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:i,value:t,onChange:s=>n(s.target.value),placeholder:r,className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 transition-all font-mono"})]})}function kJ(){const{sendRpc:e,isConnected:t}=Rt(),{isAdmin:n,loaded:r}=wa(e,t),{channels:i,loading:a,loadChannels:s,saveChannel:o}=vJ(e),[c,u]=m.useState(null),[d,f]=m.useState(!1),h=m.useRef(!1);m.useEffect(()=>{t&&!h.current&&(h.current=!0,s())},[t,s]);const p=wJ(i),g=x=>{x.comingSoon||(u(x),f(!0))},y=async(x,v,b)=>{await o(x,v,b),f(!1)};return r&&!n?l.jsx("div",{className:"h-full flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx(Am,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),l.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-1",children:"Admin access required"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Only administrators can manage channels."})]})}):l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx("header",{className:"h-16 flex items-center justify-end px-6 bg-white sticky top-0 z-10",children:l.jsx("div",{className:"flex items-center gap-2"})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsx("div",{className:"max-w-5xl mx-auto space-y-6",children:a?l.jsx("div",{className:"text-center text-gray-400 py-12",children:"Loading channels..."}):l.jsx("div",{className:"grid grid-cols-1 gap-4",children:p.map(x=>l.jsxs("div",{className:U("group bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between transition-all",x.comingSoon?"opacity-60":"hover:border-primary-200 hover:shadow-sm"),children:[l.jsxs("div",{className:"flex items-center gap-5",children:[l.jsx("div",{className:U("w-8 h-8 rounded-lg flex items-center justify-center border transition-colors",x.status==="connected"?"bg-white border-gray-200":"bg-gray-50 border-gray-200 grayscale"),children:l.jsx(x.icon,{className:U("w-4 h-4",x.status==="connected"?"text-gray-900":"text-gray-400")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[l.jsx("h3",{className:"font-bold text-gray-900",children:x.name}),x.comingSoon&&l.jsx("span",{className:"px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 text-[10px] font-bold uppercase tracking-wide border border-gray-200",children:"Coming Soon"}),!x.comingSoon&&x.status==="connected"&&l.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 text-green-700 text-[10px] font-bold uppercase tracking-wide border border-green-100",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"}),"Active"]}),!x.comingSoon&&x.status==="error"&&l.jsx("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-50 text-red-700 text-[10px] font-bold uppercase tracking-wide border border-red-100",children:"Error"})]}),l.jsx("p",{className:"text-sm text-gray-500 max-w-xl",children:x.description}),x.status==="error"&&x.error&&l.jsx("p",{className:"text-xs text-red-500 mt-1 max-w-xl truncate",children:x.error})]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-right hidden sm:block min-w-[100px]",children:[l.jsx("div",{className:"text-xs font-medium text-gray-400",children:"Status"}),l.jsx("div",{className:U("text-sm font-medium",x.status==="connected"?"text-green-600":x.status==="error"?"text-red-500":"text-gray-400"),children:x.comingSoon?"Coming Soon":x.status==="connected"?"Operational":x.status==="error"?"Error":"Not Configured"})]}),l.jsx("div",{className:"h-8 w-px bg-gray-100 hidden sm:block"}),l.jsx("button",{onClick:()=>g(x),disabled:x.comingSoon,className:U("px-4 py-2 rounded-lg font-medium text-sm transition-colors shadow-sm border min-w-[100px]",x.comingSoon?"bg-gray-100 border-gray-200 text-gray-400 cursor-not-allowed":x.status==="connected"?"bg-white border-gray-200 text-gray-700 hover:bg-gray-50":"bg-primary-600 border-primary-600 text-white hover:bg-primary-700"),children:x.comingSoon?"Coming Soon":x.status==="connected"?"Configure":"Connect"})]})]},x.id))})})}),l.jsx(SJ,{channel:c,isOpen:d,onClose:()=>f(!1),onSave:y})]})}function jJ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),a=m.useCallback(async()=>{try{const c=await e("trigger.list");n((c.triggers??[]).map(u=>{var d,f;return{...u,icon:((d=u.configJson)==null?void 0:d.icon)||"zap",description:((f=u.configJson)==null?void 0:f.description)||u.name}}))}catch(c){console.error("[useTriggers] Failed to load:",c)}finally{i(!1)}},[e]),s=m.useCallback(async c=>{const u=await e("trigger.save",{id:c.id,name:c.name,type:c.type,status:c.status,config:{description:c.description,icon:c.icon}});return await a(),u},[e,a]),o=m.useCallback(async c=>{await e("trigger.delete",{id:c}),await a()},[e,a]);return{triggers:t,loading:r,loadTriggers:a,saveTrigger:s,deleteTrigger:o}}const tM=[{id:"zap",icon:jd,label:"Zap"},{id:"wifi",icon:xw,label:"WiFi"},{id:"activity",icon:q7,label:"Activity"},{id:"server",icon:pB,label:"Server"},{id:"database",icon:ZO,label:"Database"},{id:"cloud",icon:Q7,label:"Cloud"},{id:"box",icon:Y7,label:"Box"},{id:"terminal",icon:ai,label:"Terminal"},{id:"cpu",icon:mo,label:"CPU"},{id:"globe",icon:Ml,label:"Globe"},{id:"message",icon:Cm,label:"Message"},{id:"bell",icon:ow,label:"Bell"}],NJ=e=>{var t;return((t=tM.find(n=>n.id===e))==null?void 0:t.icon)||jd};function CJ({trigger:e,isOpen:t,onClose:n,onSave:r}){const[i,a]=m.useState(""),[s,o]=m.useState(""),[c,u]=m.useState("webhook"),[d,f]=m.useState("zap"),[h,p]=m.useState(!1),[g,y]=m.useState(!1);m.useEffect(()=>{t&&(e?(a(e.name),o(e.description),u(e.type),f(e.icon||"zap")):(a(""),o(""),u("webhook"),f("zap")))},[t,e]);const x=async()=>{if(!(!i.trim()||g)){y(!0);try{await r({id:e==null?void 0:e.id,name:i,description:s,type:c,status:(e==null?void 0:e.status)||"active",icon:d})}finally{y(!1)}}},v=b=>{navigator.clipboard.writeText(b),p(!0),setTimeout(()=>p(!1),2e3)};return l.jsx(Ur,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(Zt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(Zt.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-white",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:e?"Endpoint Details":"New Endpoint"}),l.jsx("p",{className:"text-xs text-gray-400",children:"Configure inbound integration"})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Endpoint Type"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("button",{onClick:()=>u("webhook"),disabled:!!e,className:U("p-3 rounded-lg border text-left transition-all relative overflow-hidden",c==="webhook"?"border-primary-500 bg-primary-50/50 text-primary-700 ring-1 ring-primary-500":"border-gray-200 hover:border-gray-300 hover:bg-gray-50",!!e&&c!=="webhook"&&"opacity-50 cursor-not-allowed"),children:[l.jsx("div",{className:"font-semibold text-sm mb-0.5",children:"Webhook"}),l.jsx("div",{className:"text-[10px] opacity-70",children:"HTTP POST payloads"})]}),l.jsxs("button",{onClick:()=>u("websocket"),disabled:!!e,className:U("p-3 rounded-lg border text-left transition-all relative overflow-hidden",c==="websocket"?"border-primary-500 bg-primary-50/50 text-primary-700 ring-1 ring-primary-500":"border-gray-200 hover:border-gray-300 hover:bg-gray-50",!!e&&c!=="websocket"&&"opacity-50 cursor-not-allowed"),children:[l.jsx("div",{className:"font-semibold text-sm mb-0.5",children:"WebSocket"}),l.jsx("div",{className:"text-[10px] opacity-70",children:"Coming Soon"})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Display Icon"}),l.jsx("div",{className:"grid grid-cols-6 gap-2",children:tM.map(b=>l.jsx("button",{onClick:()=>f(b.id),className:U("aspect-square flex flex-col items-center justify-center rounded-lg border transition-all hover:bg-gray-50",d===b.id?"border-primary-500 bg-primary-50 text-primary-600 ring-1 ring-primary-500":"border-gray-200 text-gray-500"),title:b.label,children:l.jsx(b.icon,{className:"w-5 h-5"})},b.id))})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Name ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:i,onChange:b=>a(b.target.value),placeholder:"e.g. Grafana Production",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Description"}),l.jsx("textarea",{value:s,onChange:b=>o(b.target.value),placeholder:"Optional description...",rows:3,className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 resize-none"})]})]}),e&&e.endpointUrl&&l.jsxs("div",{className:"mt-6 space-y-4 pt-6 border-t border-gray-100",children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Connection Details"}),l.jsxs("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-4 space-y-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("label",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:c==="webhook"?"Endpoint URL":"Stream URL"}),l.jsxs("button",{onClick:()=>v(e.endpointUrl),className:"text-primary-600 hover:text-primary-700 text-xs font-medium flex items-center gap-1",children:[h?l.jsx(_n,{className:"w-3 h-3"}):l.jsx(Cx,{className:"w-3 h-3"}),h?"Copied":"Copy"]})]}),l.jsx("div",{className:"font-mono text-xs text-gray-700 bg-white border border-gray-200 rounded p-2 break-all select-all",children:e.endpointUrl})]}),e.secret&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1.5",children:"Authentication Header"}),l.jsx("div",{className:"bg-white border border-gray-200 rounded p-3",children:l.jsxs("div",{className:"flex gap-2 font-mono text-xs text-blue-600",children:[l.jsx("span",{className:"shrink-0 selection:bg-blue-100",children:"Authorization: Bearer"}),l.jsx("span",{className:"text-gray-600 break-all select-all",children:e.secret})]})})]})]}),l.jsxs("div",{className:"flex gap-3 p-3 bg-blue-50 text-blue-700 rounded-lg text-xs leading-relaxed",children:[l.jsx(Nm,{className:"w-4 h-4 shrink-0 mt-0.5"}),"Use the URL and Secret above to configure your third-party service provider. Incoming events will be processed by the Rules Engine."]})]})]}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-white flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:x,disabled:!i.trim()||g,className:"px-4 py-2 text-sm font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[l.jsx(In,{className:"w-4 h-4"}),g?"Saving...":e?"Save Changes":"Create Endpoint"]})]})]})]})})}function PJ(){const{sendRpc:e,isConnected:t}=Rt(),{triggers:n,loading:r,loadTriggers:i,saveTrigger:a,deleteTrigger:s}=jJ(e),[o,c]=m.useState(!1),[u,d]=m.useState(null),f=m.useRef(!1);m.useEffect(()=>{t&&!f.current&&(f.current=!0,i())},[t,i]);const h=()=>{d(null),c(!0)},p=v=>{d(v),c(!0)},g=async v=>{await a(v),c(!1)},y=async(v,b)=>{v.stopPropagation();const w=b.status==="active"?"inactive":"active";await a({...b,status:w})},x=async(v,b)=>{v.stopPropagation(),await s(b)};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx("header",{className:"h-16 flex items-center justify-end px-6 bg-white sticky top-0 z-10",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative group",children:[l.jsx(Kn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search endpoints...",className:"pl-9 pr-3 py-1.5 bg-gray-50 border-none rounded-md text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-200 w-48 transition-all"})]}),l.jsx(dt,{content:"New Endpoint",children:l.jsx("button",{onClick:h,className:"p-2 rounded-lg text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-all",children:l.jsx(dn,{className:"w-5 h-5"})})})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8 bg-white",children:r?l.jsx("div",{className:"flex items-center justify-center h-40 text-gray-400 text-sm",children:"Loading..."}):l.jsxs("div",{className:"max-w-6xl mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[n.map(v=>l.jsxs("div",{onClick:()=>p(v),className:"group bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-primary-200 transition-all cursor-pointer relative overflow-hidden",children:[l.jsxs("div",{className:"flex justify-between items-start mb-4",children:[l.jsx("div",{className:U("w-8 h-8 flex items-center justify-center rounded-lg border",v.type==="webhook"?"bg-purple-50 border-purple-100 text-purple-600":"bg-emerald-50 border-emerald-100 text-emerald-600"),children:(()=>{const b=NJ(v.icon);return l.jsx(b,{className:"w-4 h-4"})})()}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:b=>y(b,v),className:U("p-2 rounded-lg transition-colors border",v.status==="active"?"bg-white border-gray-200 text-gray-400 hover:text-orange-500 hover:border-orange-200":"bg-green-50 border-green-200 text-green-600"),title:v.status==="active"?"Deactivate Endpoint":"Activate Endpoint",children:v.status==="active"?l.jsx(hw,{className:"w-4 h-4"}):l.jsx(Pm,{className:"w-4 h-4"})}),l.jsx("button",{onClick:b=>x(b,v.id),className:"p-2 rounded-lg transition-colors border bg-white border-gray-200 text-gray-400 hover:text-red-500 hover:border-red-200",title:"Delete Endpoint",children:l.jsx(Fn,{className:"w-4 h-4"})})]})]}),l.jsxs("h3",{className:"font-bold text-gray-900 mb-1 group-hover:text-primary-600 transition-colors flex items-center gap-2",children:[v.name,l.jsx(qO,{className:"w-3 h-3 opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all text-primary-400"})]}),l.jsx("p",{className:"text-sm text-gray-500 mb-4 line-clamp-2 min-h-[40px]",children:v.description||"No description provided."}),l.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-50 text-xs text-gray-400",children:[l.jsxs("span",{className:"font-mono bg-gray-50 px-1.5 py-0.5 rounded text-gray-500",children:["ID: ",v.id.split("_")[1]||v.id]}),l.jsxs("div",{children:["Last active: ",l.jsx("span",{className:"text-gray-600 font-medium",children:v.lastActive||"Never"})]})]})]},v.id)),l.jsxs("button",{onClick:h,className:"flex flex-col items-center justify-center p-6 rounded-xl border-2 border-dashed border-gray-200 text-gray-400 hover:border-primary-300 hover:text-primary-600 hover:bg-primary-50/50 transition-all gap-3 min-h-[200px]",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-50 flex items-center justify-center group-hover:bg-white transition-colors",children:l.jsx(dn,{className:"w-6 h-6"})}),l.jsx("span",{className:"font-medium",children:"Create New Endpoint"})]})]})}),l.jsx(CJ,{isOpen:o,onClose:()=>c(!1),trigger:u,onSave:g})]})}function EJ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),[a,s]=m.useState(null),o=m.useCallback(async()=>{s(null);try{const d=await e("cron.list");n(d.jobs??[])}catch(d){const f=d instanceof Error?d.message:String(d);console.error("[useCronJobs] Failed to load:",f),s(f)}finally{i(!1)}},[e]),c=m.useCallback(async d=>{const f=await e("cron.save",{id:d.id,name:d.name,description:d.description,schedule:d.schedule,skillId:d.skillId,status:d.status,workspaceId:d.workspaceId??null});return await o(),f},[e,o]),u=m.useCallback(async d=>{await e("cron.delete",{id:d}),await o()},[e,o]);return{jobs:t,loading:r,error:a,loadJobs:o,saveJob:c,deleteJob:u}}function AJ({job:e,isOpen:t,onClose:n,onSave:r}){const[i,a]=m.useState(""),[s,o]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState(!1);m.useEffect(()=>{t&&(e?(a(e.name),o(e.description),u(e.schedule)):(a(""),o(""),u("0 9 * * 1-5")),f(!1))},[t,e]);const h=async()=>{if(!(!i.trim()||!c.trim()||d)){f(!0);try{await r({id:e==null?void 0:e.id,name:i,description:s,schedule:c,status:(e==null?void 0:e.status)||"active"})}catch(p){console.error("[CronDrawer] Save failed:",p)}finally{f(!1)}}};return l.jsx(Ur,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(Zt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(Zt.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-white",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:e?"Edit Schedule":"New Schedule"}),l.jsx("p",{className:"text-xs text-gray-400",children:"Automate skills with cron jobs"})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[l.jsx(us,{className:"w-4 h-4 text-primary-500"}),"Cron Schedule ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:"text",value:c,onChange:p=>u(p.target.value),placeholder:"* * * * *",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-lg text-sm font-mono text-gray-900 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 transition-all"}),l.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-gray-400",children:"UTC"})]}),l.jsxs("p",{className:"text-xs text-gray-500",children:["Format: ",l.jsx("code",{children:"min hour day month weekday"}),". ",l.jsx("a",{href:"https://crontab.guru",target:"_blank",className:"text-primary-600 hover:underline",children:"Help?"})]})]}),l.jsx("div",{className:"h-px bg-gray-100 w-full"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Job Name ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:i,onChange:p=>a(p.target.value),placeholder:"e.g. Weekly Report",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Description"}),l.jsx("textarea",{value:s,onChange:p=>o(p.target.value),placeholder:"Describe what this scheduled job does (Natural Language).",rows:4,className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 resize-none"})]})]})]}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-white flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:h,disabled:!i.trim()||!c.trim()||d,className:"px-4 py-2 text-sm font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[d?l.jsx(Ie,{className:"w-4 h-4 animate-spin"}):l.jsx(In,{className:"w-4 h-4"}),d?"Saving...":e?"Save Job":"Create Schedule"]})]})]})]})})}function PC(e){if(!e)return"";const t=new Date(e),r=new Date().getTime()-t.getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const a=Math.floor(i/60);return a<24?`${a}h ago`:t.toLocaleString()}function EC(e){if(!e)return"";if(e<1e3)return`${e}ms`;const t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function TJ({job:e,isOpen:t,onClose:n,sendRpc:r}){const[i,a]=m.useState([]),[s,o]=m.useState(!1),[c,u]=m.useState(null);m.useEffect(()=>{t&&(u(null),d())},[t,e.id]);const d=async()=>{o(!0);try{const f=await r("cron.runs",{jobId:e.id});a(f.runs??[])}catch(f){console.error("[CronRunHistory] Failed to load:",f)}finally{o(!1)}};return l.jsx(Ur,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(Zt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(Zt.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[560px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900 truncate",children:e.name}),l.jsx("p",{className:"text-xs text-gray-400",children:"Execution History"})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors flex-shrink-0",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:s?l.jsxs("div",{className:"flex items-center justify-center h-40 text-gray-400 text-sm gap-2",children:[l.jsx(Ie,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):i.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-gray-400 text-sm",children:[l.jsx(us,{className:"w-8 h-8 mb-2 text-gray-200"}),"No executions yet"]}):c?l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsx("button",{onClick:()=>u(null),className:"px-6 py-2 text-xs text-primary-600 hover:text-primary-700 font-medium text-left border-b border-gray-100 hover:bg-gray-50",children:"← Back to list"}),l.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-gray-50",children:[c.status==="success"?l.jsx(br,{className:"w-4 h-4 text-green-500 flex-shrink-0"}):l.jsx(si,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),l.jsx("span",{className:U("text-sm font-medium",c.status==="success"?"text-green-700":"text-red-700"),children:c.status==="success"?"Success":"Failed"}),l.jsx("span",{className:"text-xs text-gray-400",children:PC(c.createdAt)}),c.durationMs!=null&&l.jsx("span",{className:"text-xs text-gray-400 ml-auto",children:EC(c.durationMs)})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[c.error?l.jsx("div",{className:"text-sm text-red-600 bg-red-50 rounded-lg p-3 mb-3",children:c.error}):null,c.resultText?l.jsx("div",{className:"prose prose-sm prose-gray max-w-none",children:l.jsx(Ed,{children:c.resultText})}):l.jsx("p",{className:"text-sm text-gray-400 italic",children:"No output captured"})]})]}):l.jsx("div",{children:i.map(f=>l.jsxs("button",{onClick:()=>u(f),className:"w-full text-left px-6 py-3 border-b border-gray-50 hover:bg-gray-50/80 transition-colors flex items-center gap-3 group",children:[f.status==="success"?l.jsx(br,{className:"w-4 h-4 text-green-500 flex-shrink-0"}):l.jsx(si,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:U("text-sm font-medium",f.status==="success"?"text-green-700":"text-red-700"),children:f.status==="success"?"Success":"Failed"}),l.jsx("span",{className:"text-xs text-gray-400",children:PC(f.createdAt)}),f.durationMs!=null&&l.jsx("span",{className:"text-xs text-gray-300",children:EC(f.durationMs)})]}),f.error&&l.jsx("p",{className:"text-xs text-red-500 truncate mt-0.5",children:f.error}),!f.error&&f.resultText&&l.jsx("p",{className:"text-xs text-gray-400 truncate mt-0.5",children:f.resultText.replace(/[#*_`~\n]/g," ").slice(0,80)})]}),l.jsx(Sd,{className:"w-3.5 h-3.5 text-gray-300 group-hover:text-primary-500 flex-shrink-0 transition-colors"})]},f.id))})})]})]})})}function OJ(){const{sendRpc:e,isConnected:t}=Rt(),{jobs:n,loading:r,error:i,loadJobs:a,saveJob:s,deleteJob:o}=EJ(e),{currentWorkspace:c}=Ad(),[u,d]=m.useState(!1),[f,h]=m.useState(null),[p,g]=m.useState(null),[y,x]=m.useState(null),v=m.useRef(!1);m.useEffect(()=>{t&&!v.current&&(v.current=!0,a())},[t,a]);const b=()=>{h(null),d(!0)},w=P=>{h(P),d(!0)},S=async P=>{try{await s({...P,workspaceId:P.workspaceId??(c==null?void 0:c.id)??null}),d(!1)}catch(T){console.error("[CronPage] Save failed:",T),alert(T instanceof Error?T.message:"Failed to save schedule")}},k=async(P,T)=>{P.stopPropagation();const E=T.status==="active"?"paused":"active";try{await s({...T,status:E})}catch(_){console.error("[CronPage] Toggle failed:",_)}},j=(P,T)=>{P.stopPropagation(),g(T)},N=async()=>{if(p)try{await o(p)}catch(P){console.error("[CronPage] Delete failed:",P)}finally{g(null)}};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx("header",{className:"h-16 flex items-center justify-end px-6 bg-white sticky top-0 z-10",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative group",children:[l.jsx(Kn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search schedules...",className:"pl-9 pr-3 py-1.5 bg-gray-50 border-none rounded-md text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-200 w-48 transition-all"})]}),l.jsx(dt,{content:"Add Schedule",children:l.jsx("button",{onClick:b,className:"p-2 rounded-lg text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-all",children:l.jsx(dn,{className:"w-5 h-5"})})})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8 bg-white",children:r?l.jsx("div",{className:"flex items-center justify-center h-40 text-gray-400 text-sm",children:"Loading..."}):i?l.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-red-400 text-sm gap-2",children:[l.jsxs("p",{children:["Failed to load schedules: ",i]}),l.jsx("button",{onClick:a,className:"px-3 py-1 rounded bg-gray-100 text-gray-600 hover:bg-gray-200 text-xs",children:"Retry"})]}):l.jsxs("div",{className:"max-w-6xl mx-auto space-y-4",children:[n.map(P=>l.jsxs("div",{onClick:()=>w(P),className:"group bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-primary-200 transition-all cursor-pointer relative overflow-hidden flex items-center gap-6",children:[l.jsx("div",{className:U("w-1 h-12 rounded-full shrink-0",P.status==="active"?"bg-green-500":"bg-gray-300")}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h3",{className:"font-bold text-gray-900 mb-1 group-hover:text-primary-600 transition-colors truncate",children:P.name}),l.jsx("p",{className:"text-sm text-gray-500 truncate mb-2",children:P.description}),l.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-gray-600 font-mono bg-gray-50 px-2 py-0.5 rounded",children:[l.jsx(Vu,{className:"w-3 h-3 text-gray-400"}),P.schedule]}),P.workspaceName&&l.jsxs("div",{className:"flex items-center gap-1.5 text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded font-medium",children:[l.jsx(lw,{className:"w-3 h-3"}),P.workspaceName]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx("button",{onClick:T=>{T.stopPropagation(),x(P)},className:"p-2 rounded-lg text-gray-400 hover:text-primary-600 hover:bg-primary-50 border border-transparent hover:border-primary-200 transition-all",title:"Execution History",children:l.jsx(uw,{className:"w-4 h-4"})}),l.jsx("button",{onClick:T=>k(T,P),className:U("p-2 rounded-lg transition-colors border",P.status==="active"?"bg-white border-gray-200 text-gray-400 hover:text-orange-500 hover:border-orange-200":"bg-green-50 border-green-200 text-green-600"),title:P.status==="active"?"Pause Job":"Resume Job",children:P.status==="active"?l.jsx(hw,{className:"w-4 h-4"}):l.jsx(Pm,{className:"w-4 h-4"})}),l.jsx("button",{onClick:T=>j(T,P.id),className:"p-2 rounded-lg text-gray-400 hover:text-red-600 hover:bg-red-50 hover:border-red-200 border border-transparent transition-all",title:"Delete Job",children:l.jsx(Fn,{className:"w-4 h-4"})})]})]},P.id)),n.length===0&&l.jsxs("div",{className:"text-center py-20 text-gray-400",children:[l.jsx(Vu,{className:"w-12 h-12 mx-auto mb-4 text-gray-200"}),l.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"No Scheduled Jobs"}),l.jsx("p",{className:"mb-6 max-w-sm mx-auto",children:"Create a cron job to automate your skills periodically."}),l.jsx("button",{onClick:b,className:"px-4 py-2 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 transition-colors",children:"+ Create First Schedule"})]})]})}),l.jsx(AJ,{isOpen:u,onClose:()=>d(!1),job:f,onSave:S}),y&&l.jsx(TJ,{job:y,isOpen:!!y,onClose:()=>x(null),sendRpc:e}),l.jsx(no,{isOpen:p!==null,onClose:()=>g(null),onConfirm:N,title:"Delete Schedule",description:"Are you sure you want to delete this scheduled job? This action cannot be undone.",confirmText:"Delete",variant:"danger"})]})}function _J({isOpen:e,onClose:t,user:n,onSave:r}){const[i,a]=m.useState(n);if(m.useEffect(()=>{a(n)},[n,e]),!e)return null;const s=o=>{o.preventDefault(),r(i),t()};return l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm transition-opacity",onClick:t}),l.jsxs("div",{className:"relative w-full max-w-md bg-white rounded-xl shadow-xl border border-gray-100 overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-100",children:[l.jsx("h3",{className:"font-semibold text-gray-900",children:"Edit Profile"}),l.jsx("button",{onClick:t,className:"p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsxs("form",{onSubmit:s,className:"p-6 space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Full Name"}),l.jsx("input",{type:"text",value:i.name,onChange:o=>a({...i,name:o.target.value}),className:"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-100 focus:border-primary-400 transition-all text-sm"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Role / Job Title"}),l.jsx("input",{type:"text",value:i.role,onChange:o=>a({...i,role:o.target.value}),className:"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-100 focus:border-primary-400 transition-all text-sm"})]}),l.jsxs("div",{className:"pt-4 flex justify-end gap-3",children:[l.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-100",children:"Cancel"}),l.jsx("button",{type:"submit",className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",children:"Save Changes"})]})]})]})]})}function DJ(){const[e,t]=m.useState(Il()),[n,r]=m.useState(!1),{sendRpc:i,isConnected:a}=Rt(),s=ds(),[o,c]=m.useState(!0),u=m.useRef(!1);m.useEffect(()=>{!a||u.current||(u.current=!0,i("permission.mine").then(f=>c(f.ssoUser??!1)).catch(()=>{}))},[a,i]),m.useEffect(()=>{const f=()=>{const h=Il();t(h)};return window.addEventListener("user-profile-updated",f),()=>window.removeEventListener("user-profile-updated",f)},[]);const d=async f=>{ep(f);try{await i8(i,f)}catch{}};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx(_J,{isOpen:n,onClose:()=>r(!1),user:e,onSave:d}),l.jsx("header",{className:"h-16 flex items-center justify-end px-6 bg-white sticky top-0 z-10",children:l.jsxs("div",{className:"relative group",children:[l.jsx(Kn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search settings...",className:"pl-9 pr-3 py-1.5 bg-gray-50 border-none rounded-md text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-200 w-48 transition-all"})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto bg-white p-8",children:l.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[l.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6 flex items-center gap-6 shadow-sm",children:[l.jsx("div",{className:"w-20 h-20 rounded-full bg-gray-100 flex items-center justify-center border border-gray-200",children:l.jsx(Wu,{className:"w-10 h-10 text-gray-400"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsx("h2",{className:"text-xl font-bold text-gray-900",children:e.name})}),l.jsx("p",{className:"text-gray-500 text-sm mt-1",children:e.role}),s&&l.jsxs("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-gray-400",children:[l.jsx(JO,{className:"w-3.5 h-3.5"}),l.jsx("span",{className:"font-mono",children:s.id})]})]}),l.jsx("button",{onClick:()=>r(!0),className:"px-4 py-2 bg-white border border-gray-200 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50 hover:border-gray-300 transition-all shadow-sm",children:"Edit Profile"})]}),!o&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider px-1",children:"Security"}),l.jsx(MJ,{sendRpc:i})]}),l.jsx("div",{className:"pt-6",children:l.jsxs("button",{onClick:u_,className:"w-full p-3 rounded-lg border border-red-100 bg-red-50 text-red-600 text-sm font-medium hover:bg-red-100 transition-colors flex items-center justify-center gap-2",children:[l.jsx(sB,{className:"w-4 h-4"}),"Sign Out"]})}),l.jsx("div",{className:"text-center text-xs text-gray-400 pb-8",children:"Siclaw v0.1.0"})]})})]})}function MJ({sendRpc:e}){const[t,n]=m.useState(""),[r,i]=m.useState(""),[a,s]=m.useState(""),[o,c]=m.useState(!1),[u,d]=m.useState(""),[f,h]=m.useState(!1),p=async g=>{if(g.preventDefault(),d(""),h(!1),r!==a){d("New passwords do not match");return}if(r.length<4){d("Password must be at least 4 characters");return}c(!0);try{await e("user.changePassword",{oldPassword:t,newPassword:r}),h(!0),n(""),i(""),s("")}catch(y){d((y==null?void 0:y.message)||"Failed to change password")}finally{c(!1)}};return l.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm p-5",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx(Ql,{className:"w-5 h-5 text-gray-400"}),l.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Change Password"})]}),l.jsxs("form",{onSubmit:p,className:"space-y-3",children:[l.jsx("input",{type:"password",value:t,onChange:g=>n(g.target.value),placeholder:"Current password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",required:!0}),l.jsx("input",{type:"password",value:r,onChange:g=>i(g.target.value),placeholder:"New password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",required:!0}),l.jsx("input",{type:"password",value:a,onChange:g=>s(g.target.value),placeholder:"Confirm new password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",required:!0}),u&&l.jsx("p",{className:"text-xs text-red-600",children:u}),f&&l.jsx("p",{className:"text-xs text-green-600",children:"Password changed successfully."}),l.jsx("div",{className:"flex justify-end",children:l.jsxs("button",{type:"submit",disabled:o,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50 inline-flex items-center gap-2",children:[o&&l.jsx(Ie,{className:"w-4 h-4 animate-spin"}),"Change Password"]})})]})]})}function IJ(){return l.jsx(aw,{})}const Mf=[{key:"jwt",title:"JWT Secret",icon:Ql,fields:[{key:"secret",label:"Secret",type:"password",placeholder:"Enter new JWT secret (leave empty to keep current)",writeOnly:!0}]},{key:"sso",title:"SSO Configuration",icon:pw,fields:[{key:"enabled",label:"Enable SSO",type:"toggle"},{key:"issuer",label:"Issuer URL",type:"text",placeholder:"https://dex.example.com"},{key:"clientId",label:"Client ID",type:"text"},{key:"clientSecret",label:"Client Secret",type:"password"},{key:"redirectUri",label:"Redirect URI",type:"text",placeholder:"https://your-domain/auth/callback"}]},{key:"system",title:"System Settings",icon:Ml,fields:[{key:"grafanaUrl",label:"Grafana URL",type:"text",placeholder:"https://grafana.example.com/d/siclaw/overview?kiosk"}]},{key:"metrics",title:"Metrics & Monitoring",icon:sw,fields:[{key:"port",label:"Metrics Port (AgentBox only)",type:"text",placeholder:"9090"},{key:"token",label:"Bearer Token",type:"password",writeOnly:!0},{key:"includeUserId",label:"Include User ID in Metrics",type:"toggle"}]}];function LJ(){const{sendRpc:e,isConnected:t}=Rt(),{isAdmin:n,loaded:r}=wa(e,t),[i,a]=m.useState({}),[s,o]=m.useState({}),[c,u]=m.useState(null),[d,f]=m.useState(null),h=m.useRef(!1),p=new Set(Mf.flatMap(S=>S.fields.filter(k=>k.writeOnly).map(k=>`${S.key}.${k.key}`))),[g,y]=m.useState(new Set),x=m.useCallback(async()=>{try{const k=(await e("system.getConfig")).config??{},j=new Set,N={};for(const[P,T]of Object.entries(k))p.has(P)?T&&j.add(P):N[P]=T;y(j),a(N),o(N)}catch(S){console.warn("[SystemSettings] Failed to load config:",S)}},[e]);m.useEffect(()=>{!t||!n||h.current||(h.current=!0,x())},[t,n,x]);const v=(S,k)=>{a(j=>({...j,[S]:k})),f(null)},b=S=>{const k=Mf.find(j=>j.key===S);return k?k.fields.some(j=>{const N=`${S}.${j.key}`;return j.writeOnly?!!i[N]:(i[N]??"")!==(s[N]??"")}):!1},w=async S=>{u(S),f(null);try{const k=Mf.find(N=>N.key===S),j={};for(const N of k.fields){const P=`${S}.${N.key}`,T=i[P]??"";T&&!T.includes("****")?j[N.key]=T:T||(j[N.key]="")}await e("system.saveSection",{section:S,values:j}),await x()}catch(k){f((k==null?void 0:k.message)||"Save failed")}finally{u(null)}};return r?n?l.jsxs("div",{className:"h-full overflow-y-auto p-6 space-y-6",children:[d&&l.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:d}),Mf.map(S=>{const k=S.icon,j=b(S.key),N=c===S.key;return l.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k,{className:"w-4 h-4 text-gray-500"}),l.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:S.title})]}),l.jsxs("button",{onClick:()=>w(S.key),disabled:!j||N,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors "+(j&&!N?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-100 text-gray-400 cursor-not-allowed"),children:[N?l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(In,{className:"w-3.5 h-3.5"}),"Save"]})]}),l.jsx("div",{className:"p-5 space-y-4",children:S.fields.map(P=>{const T=`${S.key}.${P.key}`;if(P.type==="toggle"){const M=i[T]==="true";return l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs font-medium text-gray-600",children:P.label}),l.jsx("button",{type:"button",role:"switch","aria-checked":M,onClick:()=>v(T,M?"false":"true"),className:"relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 "+(M?"bg-primary-600":"bg-gray-200"),children:l.jsx("span",{className:"pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out "+(M?"translate-x-4":"translate-x-0")})})]},T)}const E=S.fields.find(M=>M.type==="toggle"),_=E?i[`${S.key}.${E.key}`]!=="true":!1,A=P.writeOnly&&g.has(T);return l.jsxs("div",{className:_?"opacity-50":"",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600",children:P.label}),A&&!i[T]&&l.jsx("span",{className:"text-xs text-green-600 font-medium",children:"Configured"})]}),l.jsx("input",{type:P.type,value:i[T]??"",onChange:M=>v(T,M.target.value),placeholder:P.placeholder,disabled:_,className:"w-full px-3 py-2 border border-gray-200 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"+(_?" bg-gray-50 cursor-not-allowed":"")})]},T)})})]},S.key)})]}):l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-lg font-medium text-gray-500 mb-1",children:"System Settings"}),l.jsx("div",{className:"text-sm",children:"Admin access required"})]})}):l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsx(Ie,{className:"w-5 h-5 animate-spin"})})}function RJ(){const{sendRpc:e,isConnected:t}=Rt(),n=ds(),r=(n==null?void 0:n.username)==="admin",[i,a]=m.useState([]),[s,o]=m.useState(!0),[c,u]=m.useState(null),[d,f]=m.useState(!1),[h,p]=m.useState(null),g=async()=>{try{const b=await e("permission.listUsers");a(b.users)}catch(b){console.error("[Permissions] Failed to load users:",b)}finally{o(!1)}},y=m.useRef(!1);m.useEffect(()=>{t&&r&&!y.current&&(y.current=!0,g())},[t]);const x=async(b,w)=>{const S=b.permissions.includes(w);u(b.id);try{S?await e("permission.revoke",{userId:b.id,permission:w}):await e("permission.grant",{userId:b.id,permission:w}),await g()}catch(k){console.error("[Permissions] Toggle failed:",k)}finally{u(null)}},v=async b=>{u(b.id);try{await e("user.setTestOnly",{userId:b.id,testOnly:!b.testOnly}),await g()}catch(w){console.error("[Permissions] Toggle testOnly failed:",w)}finally{u(null)}};return r?l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsxs("header",{className:"h-16 flex items-center justify-between px-6 bg-white sticky top-0 z-10 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-primary-50 rounded-lg",children:l.jsx(mw,{className:"w-5 h-5 text-primary-600"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900",children:"Permissions"}),l.jsx("p",{className:"text-xs text-gray-500",children:"Manage user permissions and access control"})]})]}),l.jsxs("button",{onClick:()=>f(!0),className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[l.jsx(dn,{className:"w-4 h-4"}),"Create Intern"]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsx("div",{className:"max-w-4xl mx-auto",children:s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(Ie,{className:"w-6 h-6 animate-spin text-gray-400"})}):l.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-100 bg-gray-50/50",children:[l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"User"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Username"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"SSO"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Test Only"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Skill Reviewer"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),l.jsx("tbody",{children:i.map(b=>l.jsxs("tr",{className:"border-b border-gray-50 last:border-0 hover:bg-gray-50/50 transition-colors",children:[l.jsx("td",{className:"px-6 py-4",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:U("w-8 h-8 rounded-full flex items-center justify-center text-xs font-semibold",b.isAdmin?"bg-primary-100 text-primary-700":"bg-gray-100 text-gray-600"),children:(b.name||b.username).charAt(0).toUpperCase()}),l.jsx("span",{className:"text-sm font-medium text-gray-900",children:b.name||b.username})]})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-sm text-gray-500",children:b.username})}),l.jsx("td",{className:"px-6 py-4 text-center",children:b.ssoUser?l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full bg-blue-50 text-blue-700 text-xs font-medium",children:"SSO"}):l.jsx("span",{className:"text-xs text-gray-300",children:"-"})}),l.jsx("td",{className:"px-6 py-4 text-center",children:b.isAdmin?l.jsx("span",{className:"text-xs text-gray-300",children:"-"}):l.jsx("button",{onClick:()=>v(b),disabled:c===b.id,className:"inline-flex items-center justify-center",children:c===b.id?l.jsx(Ie,{className:"w-4 h-4 animate-spin text-gray-400"}):l.jsx("div",{className:U("relative inline-flex h-5 w-9 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out cursor-pointer",b.testOnly?"bg-amber-500":"bg-gray-200"),children:l.jsx("span",{className:U("pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-in-out",b.testOnly?"translate-x-4":"translate-x-0")})})})}),l.jsx("td",{className:"px-6 py-4 text-center",children:b.isAdmin?l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full bg-primary-50 text-primary-700 text-xs font-medium",children:[l.jsx(pw,{className:"w-3 h-3"}),"Always"]}):l.jsx("button",{onClick:()=>x(b,"skill_reviewer"),disabled:c===b.id,className:"inline-flex items-center justify-center",children:c===b.id?l.jsx(Ie,{className:"w-4 h-4 animate-spin text-gray-400"}):l.jsx("div",{className:U("relative inline-flex h-5 w-9 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out cursor-pointer",b.permissions.includes("skill_reviewer")?"bg-green-500":"bg-gray-200"),children:l.jsx("span",{className:U("pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-in-out",b.permissions.includes("skill_reviewer")?"translate-x-4":"translate-x-0")})})})}),l.jsx("td",{className:"px-6 py-4 text-center",children:!b.isAdmin&&!b.ssoUser&&l.jsxs("button",{onClick:()=>p(b.id),className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-gray-600 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",title:"Reset Password",children:[l.jsx(Ql,{className:"w-3 h-3"}),"Reset Pwd"]})})]},b.id))})]})})})}),d&&l.jsx(FJ,{sendRpc:e,onClose:()=>f(!1),onCreated:g}),h&&l.jsx(zJ,{userId:h,sendRpc:e,onClose:()=>p(null)})]}):l.jsx("div",{className:"h-full flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx(Am,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),l.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-1",children:"Admin access required"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Only administrators can manage permissions."})]})})}function FJ({sendRpc:e,onClose:t,onCreated:n}){const[r,i]=m.useState(""),[a,s]=m.useState(""),[o,c]=m.useState(!1),[u,d]=m.useState(""),f=async h=>{if(h.preventDefault(),!(!r||!a)){c(!0),d("");try{await e("user.create",{username:r,password:a,testOnly:!0}),n(),t()}catch(p){d((p==null?void 0:p.message)||"Failed to create user")}finally{c(!1)}}};return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",onClick:t,children:l.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-sm p-6",onClick:h=>h.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Create Intern Account"}),l.jsx("button",{onClick:t,className:"p-1 text-gray-400 hover:text-gray-600 rounded",children:l.jsx(Qe,{className:"w-4 h-4"})})]}),l.jsxs("form",{onSubmit:f,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Username"}),l.jsx("input",{type:"text",value:r,onChange:h=>i(h.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:"intern_username",required:!0})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Password"}),l.jsx("input",{type:"password",value:a,onChange:h=>s(h.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:"Password",required:!0})]}),l.jsxs("p",{className:"text-xs text-gray-500",children:["This account will be created with ",l.jsx("span",{className:"font-medium text-amber-600",children:"Test Only"})," access."]}),u&&l.jsx("p",{className:"text-xs text-red-600",children:u}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",children:"Cancel"}),l.jsx("button",{type:"submit",disabled:o,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50",children:o?l.jsx(Ie,{className:"w-4 h-4 animate-spin"}):"Create"})]})]})]})})}function zJ({userId:e,sendRpc:t,onClose:n}){const[r,i]=m.useState(""),[a,s]=m.useState(!1),[o,c]=m.useState(""),[u,d]=m.useState(!1),f=async h=>{if(h.preventDefault(),!!r){s(!0),c("");try{await t("user.resetPassword",{userId:e,password:r}),d(!0),setTimeout(n,1500)}catch(p){c((p==null?void 0:p.message)||"Failed to reset password")}finally{s(!1)}}};return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",onClick:n,children:l.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-sm p-6",onClick:h=>h.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Reset Password"}),l.jsx("button",{onClick:n,className:"p-1 text-gray-400 hover:text-gray-600 rounded",children:l.jsx(Qe,{className:"w-4 h-4"})})]}),u?l.jsx("p",{className:"text-sm text-green-600 font-medium",children:"Password reset successfully."}):l.jsxs("form",{onSubmit:f,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"New Password"}),l.jsx("input",{type:"password",value:r,onChange:h=>i(h.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:"New password",required:!0})]}),o&&l.jsx("p",{className:"text-xs text-red-600",children:o}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",children:"Cancel"}),l.jsx("button",{type:"submit",disabled:a,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50",children:a?l.jsx(Ie,{className:"w-4 h-4 animate-spin"}):"Reset"})]})]})]})})}function $J({provider:e,models:t,isAdmin:n,onClose:r,onAdd:i,onRemove:a}){const[s,o]=m.useState("llm"),[c,u]=m.useState(!1),[d,f]=m.useState(""),[h,p]=m.useState(""),[g,y]=m.useState(128e3),[x,v]=m.useState(65536),[b,w]=m.useState(!1),[S,k]=m.useState(1024),[j,N]=m.useState(!1),[P,T]=m.useState(null),E=t.filter(I=>I.category!=="embedding"),_=t.filter(I=>I.category==="embedding"),C=s==="llm"?E:_,A=()=>{f(""),p(""),y(128e3),v(65536),w(!1),k(1024),u(!1)},M=async()=>{if(!(!d.trim()||!h.trim())){N(!0);try{await i({id:d.trim(),name:h.trim(),contextWindow:s==="embedding"?0:g,maxTokens:s==="embedding"?0:x,reasoning:s==="embedding"?!1:b,category:s==="embedding"?"embedding":"llm"}),A()}catch(I){console.error("Failed to add model:",I)}finally{N(!1)}}},B=async I=>{T(I);try{await a(I)}catch(H){console.error("Failed to remove model:",H)}finally{T(null)}},ae=I=>{o(I),A()},Q=[{id:"llm",label:"Chat Models"},{id:"embedding",label:"Embedding Models"}];return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:l.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[l.jsxs("div",{className:"px-6 py-4 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:["Models — ",e]}),l.jsx("button",{onClick:r,className:"p-1 rounded-lg hover:bg-gray-100 text-gray-400 hover:text-gray-600",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex items-center gap-2",children:Q.map(I=>l.jsx("button",{onClick:()=>ae(I.id),className:["px-3 py-1 rounded-full text-xs font-medium transition-all border",s===I.id?"bg-gray-900 text-white border-gray-900":"bg-white text-gray-500 border-gray-200 hover:bg-gray-50 hover:text-gray-700"].join(" "),children:I.label},I.id))})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[C.length===0?l.jsxs("p",{className:"text-sm text-gray-400 text-center py-8",children:["No ",s==="embedding"?"embedding":"chat"," models configured"]}):l.jsx("div",{className:"space-y-2",children:C.map(I=>l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 rounded-xl border border-gray-100 bg-gray-50/50",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"text-sm font-medium text-gray-900 truncate",children:I.name}),l.jsx("div",{className:"text-xs text-gray-400 truncate",children:I.id}),l.jsx("div",{className:"flex gap-3 mt-1 text-xs text-gray-400",children:s==="embedding"?l.jsxs("span",{children:["Dimensions: ",I.dimensions??"—"]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:["Context: ",(I.contextWindow/1e3).toFixed(0),"k"]}),l.jsxs("span",{children:["Max: ",(I.maxTokens/1e3).toFixed(0),"k"]}),I.reasoning&&l.jsx("span",{className:"text-indigo-500",children:"Reasoning"})]})})]}),n&&l.jsx("button",{onClick:()=>B(I.id),disabled:P===I.id,className:"ml-3 p-1.5 rounded-lg text-gray-400 hover:text-red-500 hover:bg-red-50 disabled:opacity-50",title:"Remove model",children:l.jsx(Fn,{className:"w-4 h-4"})})]},I.id))}),n&&c&&l.jsxs("div",{className:"mt-4 p-4 rounded-xl border border-indigo-100 bg-indigo-50/30 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Model ID"}),l.jsx("input",{type:"text",value:d,onChange:I=>f(I.target.value),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300",placeholder:s==="embedding"?"e.g. BAAI/bge-m3":"e.g. openai/gpt-4o"})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Display Name"}),l.jsx("input",{type:"text",value:h,onChange:I=>p(I.target.value),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300",placeholder:s==="embedding"?"e.g. BGE-M3":"e.g. GPT-4o"})]}),s==="embedding"?l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Dimensions"}),l.jsx("input",{type:"number",value:S,onChange:I=>k(Number(I.target.value)),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Context Window"}),l.jsx("input",{type:"number",value:g,onChange:I=>y(Number(I.target.value)),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Max Tokens"}),l.jsx("input",{type:"number",value:x,onChange:I=>v(Number(I.target.value)),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300"})]})]})]}),s==="llm"&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"checkbox",id:"reasoning",checked:b,onChange:I=>w(I.target.checked),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-300"}),l.jsx("label",{htmlFor:"reasoning",className:"text-sm text-gray-600",children:"Reasoning model"})]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{onClick:()=>u(!1),className:"px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-100 rounded-lg",children:"Cancel"}),l.jsx("button",{onClick:M,disabled:j||!d.trim()||!h.trim(),className:"px-3 py-1.5 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 disabled:opacity-50",children:j?"Adding...":"Add"})]})]})]}),l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-gray-100",children:[n&&!c?l.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-indigo-600 hover:bg-indigo-50 rounded-lg",children:[l.jsx(dn,{className:"w-4 h-4"}),"Add ",s==="embedding"?"Embedding":"Chat"," Model"]}):l.jsx("div",{}),l.jsx("button",{onClick:r,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 rounded-lg hover:bg-gray-100",children:"Close"})]})]})})}const lv=[{name:"openai",displayName:"OpenAI",baseUrl:"https://api.openai.com/v1",api:"openai-completions",models:[{id:"gpt-5.4",name:"GPT-5.4",reasoning:!1,contextWindow:2e5,maxTokens:32768,category:"llm"},{id:"gpt-4o",name:"GPT-4o",reasoning:!1,contextWindow:128e3,maxTokens:16384,category:"llm"},{id:"gpt-4o-mini",name:"GPT-4o Mini",reasoning:!1,contextWindow:128e3,maxTokens:16384,category:"llm"},{id:"o3",name:"o3",reasoning:!0,contextWindow:2e5,maxTokens:1e5,category:"llm"},{id:"o3-mini",name:"o3-mini",reasoning:!0,contextWindow:2e5,maxTokens:1e5,category:"llm"},{id:"o4-mini",name:"o4-mini",reasoning:!0,contextWindow:2e5,maxTokens:1e5,category:"llm"},{id:"text-embedding-3-small",name:"Text Embedding 3 Small",reasoning:!1,contextWindow:8191,maxTokens:0,category:"embedding",dimensions:1536},{id:"text-embedding-3-large",name:"Text Embedding 3 Large",reasoning:!1,contextWindow:8191,maxTokens:0,category:"embedding",dimensions:3072}]},{name:"anthropic",displayName:"Anthropic",baseUrl:"https://api.anthropic.com",api:"anthropic",authHeader:!0,models:[{id:"claude-opus-4-6",name:"Claude Opus 4.6",reasoning:!0,contextWindow:2e5,maxTokens:32e3,category:"llm"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",reasoning:!1,contextWindow:2e5,maxTokens:16384,category:"llm"},{id:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",reasoning:!1,contextWindow:2e5,maxTokens:8192,category:"llm"}]},{name:"google",displayName:"Google Gemini",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",api:"openai-completions",models:[{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro",reasoning:!0,contextWindow:1048576,maxTokens:65536,category:"llm"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",reasoning:!0,contextWindow:1048576,maxTokens:65536,category:"llm"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",reasoning:!0,contextWindow:1048576,maxTokens:65536,category:"llm"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",reasoning:!1,contextWindow:1048576,maxTokens:8192,category:"llm"}]},{name:"zhipu",displayName:"Zhipu",baseUrl:"https://open.bigmodel.cn/api/paas/v4",api:"openai-completions",models:[{id:"glm-5",name:"GLM-5",reasoning:!0,contextWindow:203e3,maxTokens:8192,category:"llm"},{id:"glm-4-plus",name:"GLM-4 Plus",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"glm-4-long",name:"GLM-4 Long",reasoning:!1,contextWindow:1e6,maxTokens:4096,category:"llm"},{id:"glm-4-air",name:"GLM-4 Air",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"glm-4-airx",name:"GLM-4 AirX",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"glm-4-flash",name:"GLM-4 Flash",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"glm-4-flashx",name:"GLM-4 FlashX",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"embedding-3",name:"Embedding 3",reasoning:!1,contextWindow:8192,maxTokens:0,category:"embedding",dimensions:2048}]},{name:"moonshot",displayName:"Moonshot",baseUrl:"https://api.moonshot.cn/v1",api:"openai-completions",models:[{id:"kimi-k2.5",name:"Kimi K2.5",reasoning:!1,contextWindow:256e3,maxTokens:8192,category:"llm"},{id:"kimi-k2",name:"Kimi K2",reasoning:!1,contextWindow:128e3,maxTokens:8192,category:"llm"},{id:"moonshot-v1-128k",name:"Moonshot v1 128K",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"moonshot-v1-32k",name:"Moonshot v1 32K",reasoning:!1,contextWindow:32e3,maxTokens:4096,category:"llm"}]}];function nM({baseUrl:e,apiKey:t,api:n,disabled:r}){const{sendRpc:i}=Rt(),[a,s]=m.useState("idle"),[o,c]=m.useState(""),u=async()=>{if(!(!e||!t)){s("testing"),c("");try{const p=await i("provider.testConnection",{baseUrl:e,apiKey:t,api:n});s(p.ok?"success":"error"),c(p.message)}catch(p){s("error"),c(p instanceof Error?p.message:"Test failed")}}},d={idle:l.jsx(xw,{className:"w-4 h-4"}),testing:l.jsx(Ie,{className:"w-4 h-4 animate-spin"}),success:l.jsx(br,{className:"w-4 h-4"}),error:l.jsx(vs,{className:"w-4 h-4"})},f={idle:"text-gray-600 border-gray-200 hover:bg-gray-50",testing:"text-indigo-600 border-indigo-200 bg-indigo-50",success:"text-green-600 border-green-200 bg-green-50",error:"text-red-600 border-red-200 bg-red-50"},h=!r&&!!e&&!!t&&a!=="testing";return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs("button",{type:"button",onClick:u,disabled:!h,className:`flex items-center gap-1.5 px-3 py-2 text-sm font-medium border rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${f[a]}`,children:[d[a],a==="testing"?"Testing...":"Test Connection"]}),o&&l.jsx("p",{className:`text-xs ${a==="success"?"text-green-600":"text-red-500"}`,children:o})]})}function BJ({isOpen:e,provider:t,onClose:n,onSave:r}){const i=!!t,[a,s]=m.useState(null),[o,c]=m.useState(""),[u,d]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState("openai-completions"),[y,x]=m.useState(!1),[v,b]=m.useState(!1),[w,S]=m.useState("");m.useEffect(()=>{if(e)if(S(""),b(!1),h(""),t){c(t.name),d(t.baseUrl),g(t.api),x(t.authHeader??!1);const P=lv.find(T=>T.name===t.name);s(P??null)}else s(null),c(""),d(""),g("openai-completions"),x(!1)},[e,t]);const k=P=>{i||(s(P),c(P.name),d(P.baseUrl),g(P.api),x(P.authHeader??!1))},j=()=>{i||(s(null),c(""),d(""),g("openai-completions"),x(!1))},N=async()=>{if(!o.trim()){S("Provider name is required");return}b(!0),S("");try{await r({name:o.trim(),baseUrl:u.trim(),apiKey:f,api:p,authHeader:y}),n()}catch(P){S(P instanceof Error?P.message:"Failed to save")}finally{b(!1)}};return l.jsx(Ur,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(Zt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(Zt.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:i?"Edit Provider":"Add Provider"}),l.jsx("p",{className:"text-xs text-gray-400",children:i?t.name:"Configure a new model provider"})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[!i&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Provider Template"}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[lv.map(P=>l.jsx("button",{onClick:()=>k(P),className:`px-3 py-1.5 text-xs font-medium rounded-lg border transition-colors ${(a==null?void 0:a.name)===P.name?"border-indigo-500 bg-indigo-100 text-indigo-700":"border-gray-200 bg-white text-gray-600 hover:border-gray-300"}`,children:P.displayName},P.name)),l.jsx("button",{onClick:j,className:`px-3 py-1.5 text-xs font-medium rounded-lg border transition-colors ${a?"border-gray-200 bg-white text-gray-600 hover:border-gray-300":"border-indigo-500 bg-indigo-100 text-indigo-700"}`,children:"Custom"})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Provider Name ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:o,onChange:P=>c(P.target.value),disabled:i,className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300 disabled:opacity-60 disabled:bg-gray-50",placeholder:"e.g. openai, deepseek"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"API Type"}),a?l.jsx("div",{className:"px-3 py-2 border border-gray-100 rounded-lg text-sm bg-gray-50 text-gray-500",children:p==="anthropic"?"Anthropic":"OpenAI Compatible"}):l.jsxs("select",{value:p,onChange:P=>{const T=P.target.value;g(T),x(T==="anthropic")},className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",children:[l.jsx("option",{value:"openai-completions",children:"OpenAI Compatible"}),l.jsx("option",{value:"anthropic",children:"Anthropic"})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Base URL"}),l.jsx("input",{type:"text",value:u,onChange:P=>d(P.target.value),className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"https://api.example.com/v1"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["API Key ",i&&t.apiKeySet&&l.jsx("span",{className:"text-gray-400 font-normal",children:"(currently set)"})]}),l.jsx("input",{type:"password",value:f,onChange:P=>h(P.target.value),className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:i&&t.apiKeySet?"Leave blank to keep current key":"sk-..."})]}),l.jsx(nM,{baseUrl:u,apiKey:i&&!f&&t.apiKeySet?"***":f,api:p,disabled:!u||!f&&!(i&&t.apiKeySet)}),w&&l.jsx("p",{className:"text-xs text-red-500",children:w})]}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-white flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:N,disabled:v||!o.trim(),className:"px-4 py-2 text-sm font-medium bg-indigo-600 text-white hover:bg-indigo-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[l.jsx(In,{className:"w-4 h-4"}),v?"Saving...":i?"Save Changes":"Create Provider"]})]})]})]})})}function UJ({onComplete:e}){const{sendRpc:t}=Rt(),[n,r]=m.useState(null),[i,a]=m.useState(!1),[s,o]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState(""),[h,p]=m.useState("openai-completions"),[g,y]=m.useState(null),[x,v]=m.useState(""),[b,w]=m.useState(""),[S,k]=m.useState(!1),[j,N]=m.useState(""),P=A=>{r(A),a(!1),o(A.name),u(A.baseUrl),p(A.api),y(null),N("");const M=A.models.find(B=>B.category==="llm");M&&y(M)},T=()=>{r(null),a(!0),o(""),u(""),p("openai-completions"),y(null),v(""),w(""),N("")},E=async()=>{const A=s.trim();if(!A){N("Provider name is required");return}if(!d){N("API Key is required");return}const M=i?x.trim():g==null?void 0:g.id,B=i?b.trim()||x.trim():g==null?void 0:g.name;if(!M){N("Please select or enter a model");return}k(!0),N("");try{await t("provider.quickSetup",{provider:A,baseUrl:c.trim(),apiKey:d,api:h,authHeader:(n==null?void 0:n.authHeader)??!1,model:{id:M,name:B,reasoning:(g==null?void 0:g.reasoning)??!1,contextWindow:(g==null?void 0:g.contextWindow)??128e3,maxTokens:(g==null?void 0:g.maxTokens)??65536,category:(g==null?void 0:g.category)??"llm"},setAsDefault:!0}),e()}catch(ae){N(ae instanceof Error?ae.message:"Failed to save")}finally{k(!1)}},_=n||i,C=(n==null?void 0:n.models.filter(A=>A.category==="llm"))??[];return l.jsxs("div",{className:"rounded-2xl border-2 border-dashed border-indigo-200 bg-indigo-50/30 p-8",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(jd,{className:"w-5 h-5 text-indigo-500"}),l.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Quick Setup"})]}),l.jsx("p",{className:"text-sm text-gray-500 mb-6",children:"Select a provider to get started. You can add more providers later."}),l.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[lv.map(A=>l.jsx("button",{onClick:()=>P(A),className:`px-4 py-2 text-sm font-medium rounded-lg border transition-colors ${(n==null?void 0:n.name)===A.name?"border-indigo-500 bg-indigo-100 text-indigo-700":"border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50"}`,children:A.displayName},A.name)),l.jsx("button",{onClick:T,className:`px-4 py-2 text-sm font-medium rounded-lg border transition-colors ${i?"border-indigo-500 bg-indigo-100 text-indigo-700":"border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50"}`,children:"Custom"})]}),_&&l.jsxs("div",{className:"space-y-4 max-w-xl",children:[i&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Provider Name"}),l.jsx("input",{type:"text",value:s,onChange:A=>o(A.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"e.g. my-provider"})]}),n&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API Type"}),l.jsx("div",{className:"px-3 py-2 border border-gray-100 rounded-lg text-sm bg-gray-50 text-gray-500",children:n.api==="anthropic"?"Anthropic":"OpenAI Compatible"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Base URL"}),l.jsx("input",{type:"text",value:c,onChange:A=>u(A.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"https://api.example.com/v1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API Key"}),l.jsx("input",{type:"password",value:d,onChange:A=>f(A.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"sk-..."})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model"}),i?l.jsxs("div",{className:"space-y-2",children:[l.jsx("input",{type:"text",value:x,onChange:A=>v(A.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"Model ID (e.g. gpt-4o)"}),l.jsx("input",{type:"text",value:b,onChange:A=>w(A.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"Display name (optional)"})]}):l.jsxs("div",{className:"relative",children:[l.jsxs("select",{value:(g==null?void 0:g.id)??"",onChange:A=>{const M=C.find(B=>B.id===A.target.value);M&&y(M)},className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300 appearance-none pr-8",children:[l.jsx("option",{value:"",children:"Select a model"}),C.map(A=>l.jsxs("option",{value:A.id,children:[A.name," ",A.reasoning?"(reasoning)":""]},A.id))]}),l.jsx(ea,{className:"w-4 h-4 text-gray-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]}),j&&l.jsx("p",{className:"text-sm text-red-500",children:j}),l.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[l.jsx(nM,{baseUrl:c,apiKey:d,api:h}),l.jsx("button",{onClick:E,disabled:S||!d,className:"flex items-center gap-2 px-5 py-2 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:S?"Saving...":"Save & Activate"})]})]})]})}function VJ(){const{sendRpc:e,isConnected:t}=Rt(),{isAdmin:n,loaded:r}=wa(e,t),[i,a]=m.useState([]),[s,o]=m.useState([]),[c,u]=m.useState(""),[d,f]=m.useState(""),[h,p]=m.useState(!1),[g,y]=m.useState(""),[x,v]=m.useState(1024),[b,w]=m.useState(null),[S,k]=m.useState(!1),[j,N]=m.useState(!1),[P,T]=m.useState(null),[E,_]=m.useState(null),C=m.useRef(!1),A=m.useCallback(async()=>{try{const R=await e("provider.list");a(R.providers??[])}catch(R){console.error("Failed to load providers:",R)}},[e]),M=m.useCallback(async()=>{try{const R=await e("model.list");if(o(R.models??[]),R.default){const F=`${R.default.provider}::${R.default.modelId}`;u(F),f(F)}}catch(R){console.error("Failed to load models:",R)}},[e]),B=m.useCallback(async()=>{try{const R=await e("embedding.getConfig");R.config&&(y(`${R.config.provider}::${R.config.model}`),v(R.config.dimensions),w(R.config))}catch(R){console.error("Failed to load embedding config:",R)}},[e]);m.useEffect(()=>{t&&!C.current&&(C.current=!0,A(),M(),B())},[t,A,M,B]);const ae=R=>{const F=R.indexOf("::");return F<0?{provider:"",modelId:""}:{provider:R.slice(0,F),modelId:R.slice(F+2)}},Q=async()=>{const{provider:R,modelId:F}=ae(c);if(!(!R||!F)){p(!0);try{await e("config.setDefaultModel",{provider:R,modelId:F}),f(c);try{new BroadcastChannel("siclaw-model-config").postMessage("default-changed")}catch{}}catch(ue){console.error("Failed to save default model:",ue)}finally{p(!1)}}},I=async()=>{const{provider:R,modelId:F}=ae(g);if(!(!R||!F||!x)){k(!0);try{await e("embedding.setConfig",{provider:R,model:F,dimensions:x}),w({provider:R,model:F,dimensions:x})}catch(ue){console.error("Failed to save embedding config:",ue)}finally{k(!1)}}},H=async R=>{const F={provider:R.name,baseUrl:R.baseUrl,api:R.api,authHeader:R.authHeader};R.apiKey&&(F.apiKey=R.apiKey),await e("provider.save",F),await A()},O=async(R,F)=>{await e("provider.addModel",{provider:R,model:F}),await Promise.all([A(),M()])},oe=async(R,F)=>{await e("provider.removeModel",{provider:R,modelId:F}),await Promise.all([A(),M()])},re=async R=>{if(window.confirm(`Delete provider "${R}" and all its models?`))try{await e("provider.delete",{provider:R}),await Promise.all([A(),M()])}catch(F){console.error("Failed to delete provider:",F)}},D=()=>{A(),M()},G=()=>{T(null),N(!0)},te=R=>{T(R),N(!0)},ee=s.filter(R=>R.category!=="embedding"),Z=s.filter(R=>R.category==="embedding"),ce=R=>{var ue;const F={};for(const le of R)(F[ue=le.provider]??(F[ue]=[])).push(le);return F},J=ce(ee),ne=ce(Z);if(r&&!n)return l.jsx("div",{className:"h-full flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx(Am,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),l.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-1",children:"Admin access required"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Only administrators can manage models."})]})});const be=c!==d,Y=b?g!==`${b.provider}::${b.model}`||x!==b.dimensions:!!g;return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-5xl mx-auto w-full",children:[l.jsxs("section",{className:"mb-10",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Providers"}),n&&i.length>0&&l.jsxs("button",{onClick:G,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 transition-colors",children:[l.jsx(dn,{className:"w-4 h-4"}),"Add Provider"]})]}),i.length===0?n?l.jsx(UJ,{onComplete:D}):l.jsx("p",{className:"text-sm text-gray-400 text-center py-12",children:"No providers configured"}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:i.map(R=>l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 hover:shadow-md transition-shadow",children:[l.jsxs("div",{className:"flex items-start justify-between mb-3",children:[l.jsx("h3",{className:"text-base font-semibold text-gray-900",children:R.name}),l.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-gray-100 text-gray-500",children:R.api})]}),l.jsxs("div",{className:"space-y-2 mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[l.jsx(Ml,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsx("span",{className:"truncate",children:R.baseUrl||"Not set"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[l.jsx(rB,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsx("span",{children:R.apiKeySet?R.apiKey:"Not set"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[l.jsx(dw,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsxs("span",{children:[R.modelCount," model",R.modelCount!==1?"s":""]})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>_(R.name),className:"flex-1 px-3 py-1.5 text-sm font-medium text-indigo-600 bg-indigo-50 hover:bg-indigo-100 rounded-lg transition-colors",children:"Models"}),n&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>te(R),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors",children:[l.jsx(Em,{className:"w-3.5 h-3.5"}),"Settings"]}),l.jsx("button",{onClick:()=>re(R.name),className:"flex items-center px-2 py-1.5 text-sm text-red-500 bg-red-50 hover:bg-red-100 rounded-lg transition-colors",title:"Delete provider",children:l.jsx(Fn,{className:"w-3.5 h-3.5"})})]})]})]},R.name))})]}),i.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"mb-10",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Default Chat Model"}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-gray-50/50 p-6",children:[l.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"The default model for new chat sessions."}),l.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[l.jsxs("div",{className:"flex-1 min-w-[300px]",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model"}),l.jsxs("select",{value:c,onChange:R=>u(R.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",children:[l.jsx("option",{value:"",children:"Select model"}),Object.entries(J).map(([R,F])=>l.jsx("optgroup",{label:R,children:F.map(ue=>l.jsx("option",{value:`${R}::${ue.id}`,children:ue.name},`${R}::${ue.id}`))},R))]})]}),n&&l.jsxs("button",{onClick:Q,disabled:h||!be||!c,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[l.jsx(In,{className:"w-4 h-4"}),h?"Saving...":"Save"]})]})]})]}),l.jsxs("section",{className:"mb-10",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Default Embedding Model"}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-gray-50/50 p-6",children:[l.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"Configure the embedding model used for memory search and semantic retrieval."}),l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[l.jsxs("div",{className:"flex-1 min-w-[300px]",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model"}),l.jsxs("select",{value:g,onChange:R=>y(R.target.value),disabled:!n,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300 disabled:opacity-50",children:[l.jsx("option",{value:"",children:"Select model"}),Object.entries(ne).map(([R,F])=>l.jsx("optgroup",{label:R,children:F.map(ue=>l.jsx("option",{value:`${R}::${ue.id}`,children:ue.name},`${R}::${ue.id}`))},R))]})]}),l.jsxs("div",{className:"w-[120px]",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Dimensions"}),l.jsx("input",{type:"number",value:x,onChange:R=>v(Number(R.target.value)||0),disabled:!n,placeholder:"1024",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300 disabled:opacity-50"})]}),n&&l.jsxs("button",{onClick:I,disabled:S||!Y||!g||!x,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[l.jsx(In,{className:"w-4 h-4"}),S?"Saving...":"Save"]})]})})]})]})]})]}),l.jsx(BJ,{isOpen:j,provider:P,onClose:()=>N(!1),onSave:H}),E&&l.jsx($J,{provider:E,models:s.filter(R=>R.provider===E),isAdmin:n,onClose:()=>_(null),onAdd:R=>O(E,R),onRemove:R=>oe(E,R)})]})}const WJ=[{name:"indigo",class:"bg-indigo-500"},{name:"blue",class:"bg-blue-500"},{name:"green",class:"bg-green-500"},{name:"amber",class:"bg-amber-500"},{name:"rose",class:"bg-rose-500"},{name:"purple",class:"bg-purple-500"},{name:"teal",class:"bg-teal-500"},{name:"gray",class:"bg-gray-400"}];function AC({total:e,selected:t,onSelectAll:n,onDeselectAll:r}){return e===0?null:l.jsxs("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-gray-100",children:[l.jsxs("span",{className:"text-xs text-gray-400",children:[t," / ",e," selected"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:n,disabled:t===e,className:"text-xs text-indigo-600 hover:text-indigo-800 disabled:text-gray-300",children:"Select All"}),l.jsx("button",{onClick:r,disabled:t===0,className:"text-xs text-gray-500 hover:text-gray-700 disabled:text-gray-300",children:"Deselect All"})]})]})}function HJ({workspace:e,onClose:t,onSaved:n,sendRpc:r}){var Y,R;const i=!e,a=(e==null?void 0:e.isDefault)??!1,[s,o]=m.useState("general"),[c,u]=m.useState((e==null?void 0:e.name)??""),[d,f]=m.useState(((Y=e==null?void 0:e.configJson)==null?void 0:Y.color)??"indigo"),[h,p]=m.useState(((R=e==null?void 0:e.configJson)==null?void 0:R.systemPrompt)??""),[g,y]=m.useState(!1),[x,v]=m.useState((e==null?void 0:e.envType)??"prod"),[b,w]=m.useState(new Set),[S,k]=m.useState([]),[j,N]=m.useState(""),[P,T]=m.useState(null),[E,_]=m.useState(new Set),[C,A]=m.useState(new Set),[M,B]=m.useState(new Set),[ae,Q]=m.useState([]),[I,H]=m.useState([]),[O,oe]=m.useState([]);m.useEffect(()=>{r("skill.list",{limit:500}).then(F=>Q(F.skills??[])).catch(()=>{}),r("workspace.availableTools").then(F=>H(F.tools??[])).catch(()=>{}),r("credential.list").then(F=>oe(F.credentials??[])).catch(()=>{}),r("cluster.list").then(F=>k(F.clusters??[])).catch(()=>{}),e&&!e.isDefault&&r("workspace.getConfig",{id:e.id}).then(F=>{_(new Set(F.skills??[])),A(new Set(F.tools??[])),B(new Set(F.credentials??[])),w(new Set(F.clusters??[]))}).catch(()=>{})},[r,e]);const re=m.useMemo(()=>{const F=new Set;for(const ue of ae)ue.labels&&ue.labels.forEach(le=>F.add(le));return[...F].sort()},[ae]),D=m.useMemo(()=>{let F=ae;if(P&&(F=F.filter(ue=>{var le;return(le=ue.labels)==null?void 0:le.includes(P)})),j.trim()){const ue=j.toLowerCase();F=F.filter(le=>le.name.toLowerCase().includes(ue))}return F},[ae,j,P]),G=m.useMemo(()=>x==="test"?S.filter(F=>F.isTest):S,[S,x]),te=m.useCallback(F=>{_(ue=>{const le=new Set(ue);return le.has(F)?le.delete(F):le.add(F),le})},[]),ee=m.useCallback(F=>{A(ue=>{const le=new Set(ue);return le.has(F)?le.delete(F):le.add(F),le})},[]),Z=m.useCallback(F=>{B(ue=>{const le=new Set(ue);return le.has(F)?le.delete(F):le.add(F),le})},[]),ce=m.useCallback(F=>{w(ue=>{const le=new Set(ue);return le.has(F)?le.delete(F):le.add(F),le})},[]),J=async()=>{if(c.trim()){y(!0);try{if(i){const ue=(await r("workspace.create",{name:c.trim(),envType:x,config:{color:d,systemPrompt:h||void 0}})).workspace.id;await Promise.all([r("workspace.setSkills",{workspaceId:ue,skills:[...E]}),r("workspace.setTools",{workspaceId:ue,tools:[...C]}),r("workspace.setCredentials",{workspaceId:ue,credentialIds:[...M]}),r("workspace.setClusters",{workspaceId:ue,clusterIds:[...b]})])}else a||(await r("workspace.update",{id:e.id,name:c.trim(),envType:x,config:{...e.configJson,color:d,systemPrompt:h||void 0}}),await Promise.all([r("workspace.setSkills",{workspaceId:e.id,skills:[...E]}),r("workspace.setTools",{workspaceId:e.id,tools:[...C]}),r("workspace.setCredentials",{workspaceId:e.id,credentialIds:[...M]}),r("workspace.setClusters",{workspaceId:e.id,clusterIds:[...b]})]));n()}catch(F){console.error("Failed to save workspace:",F)}finally{y(!1)}}},ne=M.size+b.size,be=[{key:"general",label:"General"},...a?[]:[{key:"skills",label:`Skills (${E.size})`},{key:"tools",label:`Tools (${C.size})`},{key:"access",label:`Access (${ne})`}]];return l.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",onClick:t,children:l.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg max-h-[85vh] flex flex-col",onClick:F=>F.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:i?"Create Workspace":a?"Default Workspace":`Edit: ${e.name}`}),l.jsx("button",{onClick:t,className:"p-1.5 text-gray-400 hover:text-gray-600 rounded-md",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),!a&&l.jsx("div",{className:"px-6 pt-3",children:l.jsx("input",{type:"text",value:c,onChange:F=>u(F.target.value),placeholder:"Workspace name",className:`w-full px-3 py-2 border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 ${c.trim()?"border-gray-200":"border-red-300 bg-red-50/30"}`})}),l.jsx("div",{className:"flex gap-1 px-6 pt-3 border-b border-gray-100",children:be.map(F=>l.jsx("button",{onClick:()=>o(F.key),className:`px-3 py-2 text-sm font-medium rounded-t-md transition-colors ${s===F.key?"text-indigo-600 border-b-2 border-indigo-600":"text-gray-500 hover:text-gray-700"}`,children:F.label},F.key))}),l.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",children:[s==="general"&&l.jsxs("div",{className:"space-y-4",children:[!a&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Environment Type"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>v("prod"),className:`px-4 py-2 rounded-lg text-sm font-medium border ${x==="prod"?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-200 text-gray-600 hover:border-gray-300"}`,children:"Production"}),l.jsx("button",{onClick:()=>{v("test"),w(new Set)},className:`px-4 py-2 rounded-lg text-sm font-medium border ${x==="test"?"border-amber-500 bg-amber-50 text-amber-700":"border-gray-200 text-gray-600 hover:border-gray-300"}`,children:"Testing"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Color"}),l.jsx("div",{className:"flex gap-2",children:WJ.map(F=>l.jsx("button",{onClick:()=>!a&&f(F.name),disabled:a,className:`w-7 h-7 rounded-full ${F.class} flex items-center justify-center transition-transform ${d===F.name?"ring-2 ring-offset-2 ring-indigo-400 scale-110":"hover:scale-105"} disabled:opacity-50`,children:d===F.name&&l.jsx(_n,{className:"w-3.5 h-3.5 text-white"})},F.name))})]}),!a&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"System Prompt"}),l.jsx("textarea",{value:h,onChange:F=>p(F.target.value),placeholder:"Optional: custom instructions for this workspace...",rows:4,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 resize-none"})]}),a&&l.jsx("p",{className:"text-sm text-gray-400 italic",children:"The default workspace includes all skills, tools, and credentials. It cannot be modified."})]}),s==="skills"&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"relative",children:[l.jsx(Kn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),l.jsx("input",{type:"text",value:j,onChange:F=>N(F.target.value),placeholder:"Search skills...",className:"w-full pl-9 pr-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300"})]}),re.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1",children:[l.jsx("button",{onClick:()=>T(null),className:`px-2 py-0.5 rounded-full text-xs font-medium transition-colors ${P?"bg-gray-100 text-gray-500 hover:bg-gray-200":"bg-indigo-100 text-indigo-700"}`,children:"All"}),re.map(F=>l.jsx("button",{onClick:()=>T(P===F?null:F),className:`px-2 py-0.5 rounded-full text-xs font-medium transition-colors ${P===F?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-500 hover:bg-gray-200"}`,children:F},F))]}),l.jsx(AC,{total:D.length,selected:D.filter(F=>E.has(F.name)).length,onSelectAll:()=>_(F=>{const ue=new Set(F);return D.forEach(le=>ue.add(le.name)),ue}),onDeselectAll:()=>_(F=>{const ue=new Set(F);return D.forEach(le=>ue.delete(le.name)),ue})}),D.length===0?l.jsx("p",{className:"text-sm text-gray-400 py-4 text-center",children:"No skills match"}):l.jsx("div",{className:"space-y-0.5",children:D.map(F=>l.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-gray-50 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:E.has(F.name),onChange:()=>te(F.name),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),l.jsx("span",{className:"text-sm text-gray-900 flex-1 truncate",children:F.name}),F.labels&&F.labels.length>0&&l.jsx("span",{className:"text-xs text-gray-400 truncate max-w-[120px]",children:F.labels.join(", ")}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 text-gray-500 shrink-0",children:F.scope})]},F.name))})]}),s==="tools"&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(AC,{total:I.length,selected:C.size,onSelectAll:()=>A(new Set(I)),onDeselectAll:()=>A(new Set)}),I.length===0?l.jsx("p",{className:"text-sm text-gray-400 py-4 text-center",children:"No tools available"}):l.jsx("div",{className:"space-y-0.5",children:I.map(F=>l.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-gray-50 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:C.has(F),onChange:()=>ee(F),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),l.jsx("span",{className:"text-sm text-gray-900 font-mono",children:F})]},F))})]}),s==="access"&&l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"K8s Clusters"}),G.length===0?l.jsx("p",{className:"text-sm text-gray-400 py-2 text-center",children:"No clusters available"}):l.jsx("div",{className:"space-y-0.5",children:G.map(F=>l.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-gray-50 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:b.has(F.id),onChange:()=>ce(F.id),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),l.jsx("span",{className:"text-sm text-gray-900 flex-1",children:F.name}),l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${F.isTest?"bg-amber-50 text-amber-600":"bg-blue-50 text-blue-600"}`,children:F.isTest?"test":"prod"}),l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:F.apiServer})]},F.id))})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Credentials (SSH / API)"}),O.length===0?l.jsx("p",{className:"text-sm text-gray-400 py-2 text-center",children:"No credentials available"}):l.jsx("div",{className:"space-y-0.5",children:O.map(F=>l.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-gray-50 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:M.has(F.id),onChange:()=>Z(F.id),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),l.jsx("span",{className:"text-sm text-gray-900 flex-1",children:F.name}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 text-gray-500",children:F.type})]},F.id))})]})]})]}),!a&&l.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-gray-200",children:[l.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-lg",children:"Cancel"}),l.jsx("button",{onClick:J,disabled:g||!c.trim(),className:"px-4 py-2 text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg disabled:opacity-50",children:g?"Saving...":i?"Create":"Save"})]})]})})}const KJ={indigo:"bg-indigo-500",blue:"bg-blue-500",green:"bg-green-500",amber:"bg-amber-500",rose:"bg-rose-500",purple:"bg-purple-500",teal:"bg-teal-500",gray:"bg-gray-400"};function qJ(e){return KJ[e??""]??"bg-indigo-500"}function GJ(){const{sendRpc:e,isConnected:t}=Rt(),{reload:n}=Ad(),[r,i]=m.useState([]),[a,s]=m.useState(null),[o,c]=m.useState(!1),[u,d]=m.useState({}),[f,h]=m.useState({}),[p,g]=m.useState({}),y=m.useRef(!1),x=m.useCallback(async()=>{if(t)try{const S=(await e("workspace.list")).workspaces??[];i(S);for(const k of S)k.isDefault||e("workspace.getConfig",{id:k.id}).then(j=>{d(N=>{var P;return{...N,[k.id]:((P=j.skills)==null?void 0:P.length)??0}}),h(N=>{var P;return{...N,[k.id]:((P=j.tools)==null?void 0:P.length)??0}}),g(N=>{var P;return{...N,[k.id]:((P=j.clusters)==null?void 0:P.length)??0}})}).catch(()=>{})}catch(w){console.error("Failed to load workspaces:",w)}},[t,e]);m.useEffect(()=>{t&&!y.current&&(y.current=!0,x())},[t,x]);const v=async w=>{if(!w.isDefault&&window.confirm(`Delete workspace "${w.name}"? Sessions in this workspace will no longer be scoped.`))try{await e("workspace.delete",{id:w.id}),await x(),n()}catch(S){console.error("Failed to delete workspace:",S)}},b=()=>{s(null),c(!1),x(),n()};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-5xl mx-auto w-full",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Workspaces"}),l.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Isolated contexts with scoped skills, tools, and clusters."})]}),l.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700",children:[l.jsx(dn,{className:"w-4 h-4"}),"New Workspace"]})]}),r.length===0?l.jsx("p",{className:"text-sm text-gray-400 text-center py-12",children:"No workspaces configured"}):l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[r.map(w=>{var S;return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 hover:shadow-md transition-shadow",children:[l.jsxs("div",{className:"flex items-start justify-between mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`w-3 h-3 rounded-full ${qJ((S=w.configJson)==null?void 0:S.color)}`}),l.jsx("h3",{className:"text-base font-semibold text-gray-900",children:w.name}),w.envType==="test"&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-amber-50 text-amber-600 font-medium",children:"TEST"}),w.envType==="prod"&&!w.isDefault&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-blue-50 text-blue-600 font-medium",children:"PROD"})]}),w.isDefault&&l.jsxs("span",{className:"flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-amber-50 text-amber-600",children:[l.jsx(xB,{className:"w-3 h-3"}),"Default"]})]}),l.jsx("div",{className:"space-y-1.5 mb-4 text-sm text-gray-500",children:w.isDefault?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(lw,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsx("span",{children:"All skills, tools & clusters"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-3.5 text-center text-xs font-mono text-gray-400",children:"S"}),l.jsxs("span",{children:[u[w.id]??0," skills"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-3.5 text-center text-xs font-mono text-gray-400",children:"T"}),l.jsxs("span",{children:[f[w.id]??0," tools"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-3.5 text-center text-xs font-mono text-gray-400",children:"E"}),l.jsxs("span",{children:[p[w.id]??0," clusters"]})]})]})}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{onClick:()=>s(w),className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 text-sm font-medium text-indigo-600 bg-indigo-50 hover:bg-indigo-100 rounded-lg transition-colors",children:[l.jsx(kd,{className:"w-3.5 h-3.5"}),w.isDefault?"View":"Edit"]}),!w.isDefault&&l.jsx("button",{onClick:()=>v(w),className:"flex items-center px-2 py-1.5 text-sm text-red-500 bg-red-50 hover:bg-red-100 rounded-lg transition-colors",title:"Delete workspace",children:l.jsx(Fn,{className:"w-3.5 h-3.5"})})]})]},w.id)}),l.jsxs("button",{onClick:()=>c(!0),className:"rounded-2xl border-2 border-dashed border-gray-200 p-5 flex flex-col items-center justify-center gap-2 text-gray-400 hover:border-indigo-300 hover:text-indigo-500 transition-colors min-h-[160px]",children:[l.jsx(dn,{className:"w-6 h-6"}),l.jsx("span",{className:"text-sm font-medium",children:"Create Workspace"})]})]})]}),(a||o)&&l.jsx(HJ,{workspace:a,onClose:()=>{s(null),c(!1)},onSaved:b,sendRpc:e})]})}function YJ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),a=m.useCallback(async()=>{try{const d=await e("mcp.list");n(d.servers??[])}catch(d){console.error("[useMcpServers] Failed to load:",d)}finally{i(!1)}},[e]),s=m.useCallback(async d=>{const f=await e("mcp.create",d);return await a(),f},[e,a]),o=m.useCallback(async(d,f)=>{await e("mcp.update",{id:d,...f}),await a()},[e,a]),c=m.useCallback(async d=>{await e("mcp.toggle",{id:d}),await a()},[e,a]),u=m.useCallback(async d=>{await e("mcp.delete",{id:d}),await a()},[e,a]);return{servers:t,loading:r,loadServers:a,createServer:s,updateServer:o,toggleServer:c,deleteServer:u}}const XJ={stdio:"Stdio",sse:"SSE","streamable-http":"Streamable HTTP"},rM=[{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"Stdio"}];function TC(e){const t=e.filter(r=>r.key.trim());if(t.length===0)return;const n={};for(const r of t)n[r.key.trim()]=r.value;return n}function OC(e){return!e||Object.keys(e).length===0?[{key:"",value:""}]:[...Object.entries(e).map(([t,n])=>({key:t,value:n})),{key:"",value:""}]}function _C({label:e,pairs:t,onChange:n}){const r=(s,o,c)=>{const u=t.map((d,f)=>f===s?{...d,[o]:c}:d);n(u)},i=s=>{const o=t.filter((c,u)=>u!==s);o.length===0&&o.push({key:"",value:""}),n(o)},a=()=>{n([...t,{key:"",value:""}])};return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:e}),l.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1 px-2 py-0.5 text-xs font-medium text-primary-600 hover:text-primary-700 hover:bg-primary-50 rounded-md transition-colors",children:[l.jsx(dn,{className:"w-3.5 h-3.5"}),"Add"]})]}),l.jsx("div",{className:"space-y-2",children:t.map((s,o)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",value:s.key,onChange:c=>r(o,"key",c.target.value),placeholder:"Key",className:"flex-1 px-2.5 py-1.5 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),l.jsx("input",{type:"text",value:s.value,onChange:c=>r(o,"value",c.target.value),placeholder:"Value",className:"flex-1 px-2.5 py-1.5 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),t.length>1&&l.jsx("button",{type:"button",onClick:()=>i(o),className:"p-1 text-gray-400 hover:text-red-500 transition-colors",children:l.jsx(Fn,{className:"w-3.5 h-3.5"})})]},o))})]})}function ZJ({server:e,isOpen:t,onClose:n,onSave:r,onUpdate:i}){const a=!!e,[s,o]=m.useState("streamable-http"),[c,u]=m.useState(""),[d,f]=m.useState(""),[h,p]=m.useState(""),[g,y]=m.useState(""),[x,v]=m.useState(""),[b,w]=m.useState([{key:"",value:""}]),[S,k]=m.useState([{key:"",value:""}]),[j,N]=m.useState(""),[P,T]=m.useState(!1);m.useEffect(()=>{var M;t&&(N(""),T(!1),e?(o(e.transport),u(e.name),f(e.description??""),p(e.url??""),y(e.command??""),v(((M=e.argsJson)==null?void 0:M.join(" "))??""),w(OC(e.envJson)),k(OC(e.headersJson))):(o("streamable-http"),u(""),f(""),p(""),y(""),v(""),w([{key:"",value:""}]),k([{key:"",value:""}])))},[t,e]);const E=()=>c.trim()?s==="stdio"?!!g.trim():!!h.trim():!1,_=async()=>{if(!P){T(!0),N("");try{const M={name:c,transport:s,description:d||void 0};s==="stdio"?(M.command=g,x.trim()&&(M.argsJson=x.split(/\s+/).filter(Boolean)),M.envJson=TC(b)):(M.url=h,M.headersJson=TC(S)),a?await i(e.id,M):await r(M),n()}catch(M){N((M==null?void 0:M.message)||"Failed to save")}finally{T(!1)}}},C=a?"Edit MCP Server":"New MCP Server",A=a?e.name:"Register a new MCP server";return l.jsx(Ur,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(Zt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(Zt.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-white",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:C}),l.jsx("p",{className:"text-xs text-gray-400",children:A})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Transport ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("div",{className:"grid grid-cols-3 gap-2",children:rM.map(M=>{const B=s===M.value;return l.jsx("button",{type:"button",disabled:a,onClick:()=>o(M.value),className:U("px-3 py-2 rounded-lg border text-sm font-medium transition-colors text-center",B?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-200 text-gray-600 hover:border-gray-300 hover:bg-gray-50",a&&"opacity-60 cursor-not-allowed"),children:M.label},M.value)})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Name ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:c,onChange:M=>u(M.target.value),placeholder:"e.g. tools-server, filesystem",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Description"}),l.jsx("input",{type:"text",value:d,onChange:M=>f(M.target.value),placeholder:"Optional description",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),s==="stdio"?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Command ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:g,onChange:M=>y(M.target.value),placeholder:"e.g. npx, node, python",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Arguments"}),l.jsx("input",{type:"text",value:x,onChange:M=>v(M.target.value),placeholder:"e.g. -y @modelcontextprotocol/server-filesystem /workspace",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),l.jsx("p",{className:"text-xs text-gray-400",children:"Space-separated arguments"})]}),l.jsx(_C,{label:"Environment Variables",pairs:b,onChange:w})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["URL ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:h,onChange:M=>p(M.target.value),placeholder:"http://localhost:8000/mcp",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsx(_C,{label:"Headers",pairs:S,onChange:k})]}),j&&l.jsx("p",{className:"text-xs text-red-500",children:j})]}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-white flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:_,disabled:!E()||P,className:"px-4 py-2 text-sm font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[l.jsx(In,{className:"w-4 h-4"}),P?"Saving...":a?"Save Changes":"Create Server"]})]})]})]})})}const QJ={"streamable-http":"bg-blue-50 text-blue-700",sse:"bg-purple-50 text-purple-700",stdio:"bg-emerald-50 text-emerald-700"},JJ={seed:"bg-gray-50 text-gray-500",db:"bg-indigo-50 text-indigo-600",file:"bg-amber-50 text-amber-600"};function eee(){const{sendRpc:e,isConnected:t}=Rt(),{isAdmin:n}=wa(e,t),{servers:r,loading:i,loadServers:a,createServer:s,updateServer:o,toggleServer:c,deleteServer:u}=YJ(e),[d,f]=m.useState(""),[h,p]=m.useState(""),[g,y]=m.useState(!1),[x,v]=m.useState(null),[b,w]=m.useState(null),[S,k]=m.useState(null),j=m.useRef(!1);m.useEffect(()=>{t&&!j.current&&(j.current=!0,a())},[t]);const N=m.useMemo(()=>{let C=r;if(h&&(C=C.filter(A=>A.transport===h)),d.trim()){const A=d.toLowerCase();C=C.filter(M=>M.name.toLowerCase().includes(A)||(M.description??"").toLowerCase().includes(A)||(M.url??"").toLowerCase().includes(A)||(M.command??"").toLowerCase().includes(A))}return C},[r,d,h]),P=()=>{v(null),y(!0)},T=C=>{v(C),y(!0)},E=async(C,A)=>{if(C.stopPropagation(),!S){k(A);try{await c(A)}catch(M){console.error("[McpServers] Toggle failed:",M)}finally{k(null)}}},_=async(C,A,M)=>{if(C.stopPropagation(),!b&&window.confirm(`Delete MCP server "${M}"?`)){w(A);try{await u(A)}catch(B){console.error("[McpServers] Delete failed:",B),alert(`Delete failed: ${(B==null?void 0:B.message)||"Unknown error"}`)}finally{w(null)}}};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsxs("header",{className:"h-16 flex items-center justify-between px-6 bg-white sticky top-0 z-10 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-primary-50 rounded-lg",children:l.jsx(Px,{className:"w-5 h-5 text-primary-600"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900",children:"MCP Servers"}),l.jsx("p",{className:"text-xs text-gray-500",children:"Manage Model Context Protocol server connections"})]})]}),n&&l.jsxs("button",{onClick:P,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[l.jsx(dn,{className:"w-4 h-4"}),"New Server"]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsxs("div",{className:"max-w-5xl mx-auto",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsxs("div",{className:"relative flex-1 max-w-xs",children:[l.jsx(Kn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),l.jsx("input",{type:"text",value:d,onChange:C=>f(C.target.value),placeholder:"Search servers...",className:"w-full pl-9 pr-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("select",{value:h,onChange:C=>p(C.target.value),className:"px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 bg-white",children:[l.jsx("option",{value:"",children:"All Transports"}),rM.map(C=>l.jsx("option",{value:C.value,children:C.label},C.value))]})]}),i?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(Ie,{className:"w-6 h-6 animate-spin text-gray-400"})}):N.length===0?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(Px,{className:"w-12 h-12 text-gray-200 mx-auto mb-4"}),l.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:r.length===0?"No MCP servers yet":"No matching servers"}),l.jsx("p",{className:"text-xs text-gray-500",children:r.length===0?"Register your first MCP server to get started.":"Try adjusting your search or filter."})]}):l.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-100 bg-gray-50/50",children:[l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Name"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Transport"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Endpoint"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Status"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Source"}),n&&l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),l.jsx("tbody",{children:N.map(C=>l.jsxs("tr",{onClick:n?()=>T(C):void 0,className:U("border-b border-gray-50 last:border-0 hover:bg-gray-50/50 transition-colors",n&&"cursor-pointer"),children:[l.jsx("td",{className:"px-6 py-4",children:l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-gray-900",children:C.name}),C.description&&l.jsx("p",{className:"text-xs text-gray-400 mt-0.5 truncate max-w-[200px]",children:C.description})]})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:U("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",QJ[C.transport]??"bg-gray-50 text-gray-600"),children:XJ[C.transport]??C.transport})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-xs text-gray-500 font-mono truncate block max-w-[240px]",children:C.url||C.command||"-"})}),l.jsx("td",{className:"px-6 py-4 text-center",children:l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium",C.enabled?"bg-green-50 text-green-700":"bg-gray-100 text-gray-500"),children:[l.jsx("span",{className:U("w-1.5 h-1.5 rounded-full",C.enabled?"bg-green-500":"bg-gray-400")}),C.enabled?"Enabled":"Disabled"]})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:U("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",JJ[C.source??"db"]??"bg-gray-50 text-gray-500"),children:C.source??"db"})}),n&&l.jsx("td",{className:"px-6 py-4 text-center",children:l.jsxs("div",{className:"inline-flex items-center gap-1",children:[l.jsx("button",{onClick:A=>E(A,C.id),disabled:S===C.id,className:U("p-1.5 rounded-lg transition-colors",C.enabled?"text-green-600 hover:text-orange-600 hover:bg-orange-50":"text-gray-400 hover:text-green-600 hover:bg-green-50","disabled:opacity-50"),title:C.enabled?"Disable":"Enable",children:S===C.id?l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(uB,{className:"w-3.5 h-3.5"})}),l.jsx("button",{onClick:A=>{A.stopPropagation(),T(C)},className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",title:"Edit",children:l.jsx(kd,{className:"w-3.5 h-3.5"})}),l.jsx("button",{onClick:A=>_(A,C.id,C.name),disabled:b===C.id,className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors disabled:opacity-50",title:"Delete",children:b===C.id?l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Fn,{className:"w-3.5 h-3.5"})})]})})]},C.id))})]})})]})}),n&&l.jsx(ZJ,{server:x,isOpen:g,onClose:()=>y(!1),onSave:async C=>{await s(C)},onUpdate:async(C,A)=>{await o(C,A)}})]})}function tee(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),a=m.useCallback(async()=>{try{const u=await e("kb.list");n(u.docs??[])}catch(u){console.error("[useKnowledge] Failed to load:",u)}finally{i(!1)}},[e]),s=m.useCallback(async u=>{const d=await e("kb.upload",u);return await a(),d},[e,a]),o=m.useCallback(async u=>e("kb.get",{id:u}),[e]),c=m.useCallback(async u=>{await e("kb.delete",{id:u}),await a()},[e,a]);return{docs:t,loading:r,loadDocs:a,uploadDoc:s,getDoc:o,deleteDoc:c}}function nee({isOpen:e,onClose:t,onSave:n}){const[r,i]=m.useState("file"),[a,s]=m.useState(""),[o,c]=m.useState(""),[u,d]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(!1),y=m.useRef(null);m.useEffect(()=>{e&&(i("file"),s(""),c(""),d(""),h(""),g(!1),y.current&&(y.current.value=""))},[e]);const x=w=>{w!==r&&(i(w),c(""),d(""),y.current&&(y.current.value=""))},v=async w=>{var j;const S=(j=w.target.files)==null?void 0:j[0];if(!S)return;const k=await S.text();c(k),d(S.name),a||s(S.name.replace(/\.md$/,""))},b=async()=>{if(!p){if(!a.trim()){h("Name is required");return}if(!o.trim()){h("Content is required");return}g(!0),h("");try{await n({name:a.trim(),content:o}),t()}catch(w){h((w==null?void 0:w.message)||"Failed to upload")}finally{g(!1)}}};return l.jsx(Ur,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(Zt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(Zt.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[560px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-white",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:"Upload Document"}),l.jsx("p",{className:"text-xs text-gray-400",children:"Add a Markdown document to the knowledge base"})]}),l.jsx("button",{onClick:t,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Name ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:a,onChange:w=>s(w.target.value),placeholder:"e.g. RoCE Networking Guide",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Content ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsxs("div",{className:"flex gap-1 p-1 bg-gray-100 rounded-lg",children:[l.jsxs("button",{type:"button",onClick:()=>x("file"),className:U("flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",r==="file"?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:[l.jsx(Jh,{className:"w-3.5 h-3.5"}),"Upload File"]}),l.jsxs("button",{type:"button",onClick:()=>x("paste"),className:U("flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",r==="paste"?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:[l.jsx(Sd,{className:"w-3.5 h-3.5"}),"Paste Content"]})]}),r==="file"?l.jsxs("div",{className:"space-y-2",children:[l.jsx("input",{ref:y,type:"file",accept:".md,.markdown,.txt",onChange:v,className:"hidden"}),l.jsxs("button",{type:"button",onClick:()=>{var w;return(w=y.current)==null?void 0:w.click()},className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium bg-primary-50 text-primary-600 hover:bg-primary-100 transition-colors",children:[l.jsx(Jh,{className:"w-3.5 h-3.5"}),"Choose File"]}),u&&o&&l.jsx("div",{className:"px-3 py-2 bg-gray-50 rounded-lg border border-gray-200",children:l.jsxs("p",{className:"text-xs text-gray-500",children:[l.jsx("span",{className:"font-medium text-gray-700",children:u})," — ",o.length.toLocaleString()," characters"]})})]}):l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("textarea",{value:o,onChange:w=>c(w.target.value),placeholder:"Paste Markdown content here...",rows:16,className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 resize-none"}),o&&l.jsxs("p",{className:"text-xs text-gray-400",children:[o.length.toLocaleString()," characters"]})]})]}),f&&l.jsx("p",{className:"text-xs text-red-500",children:f})]}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-white flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:b,disabled:!a.trim()||!o.trim()||p,className:"px-4 py-2 text-sm font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[l.jsx(In,{className:"w-4 h-4"}),p?"Uploading...":"Upload"]})]})]})]})})}function ree(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}function iee(e){return e?new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"-"}function aee(){const{sendRpc:e,isConnected:t}=Rt(),{isAdmin:n}=wa(e,t),{docs:r,loading:i,loadDocs:a,uploadDoc:s,getDoc:o,deleteDoc:c}=tee(e),[u,d]=m.useState(""),[f,h]=m.useState(!1),[p,g]=m.useState(null),[y,x]=m.useState(null),[v,b]=m.useState(!1),w=m.useRef(!1);m.useEffect(()=>{t&&!w.current&&(w.current=!0,a())},[t]);const S=m.useMemo(()=>{if(!u.trim())return r;const N=u.toLowerCase();return r.filter(P=>P.name.toLowerCase().includes(N)||P.filePath.toLowerCase().includes(N))},[r,u]),k=async(N,P,T)=>{if(N.stopPropagation(),!p&&window.confirm(`Delete knowledge document "${T}"?`)){g(P);try{await c(P)}catch(E){console.error("[Knowledge] Delete failed:",E),alert(`Delete failed: ${(E==null?void 0:E.message)||"Unknown error"}`)}finally{g(null)}}},j=async N=>{b(!0);try{const P=await o(N.id);x(P)}catch(P){console.error("[Knowledge] Preview failed:",P)}finally{b(!1)}};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsxs("header",{className:"h-16 flex items-center justify-between px-6 bg-white sticky top-0 z-10 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-primary-50 rounded-lg",children:l.jsx(cs,{className:"w-5 h-5 text-primary-600"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900",children:"Knowledge Base"}),l.jsx("p",{className:"text-xs text-gray-500",children:"Team documentation for agent reference"})]})]}),n&&l.jsxs("button",{onClick:()=>h(!0),className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[l.jsx(dn,{className:"w-4 h-4"}),"Upload"]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsxs("div",{className:"max-w-5xl mx-auto",children:[l.jsx("div",{className:"flex items-center gap-3 mb-6",children:l.jsxs("div",{className:"relative flex-1 max-w-xs",children:[l.jsx(Kn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),l.jsx("input",{type:"text",value:u,onChange:N=>d(N.target.value),placeholder:"Search documents...",className:"w-full pl-9 pr-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]})}),i?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(Ie,{className:"w-6 h-6 animate-spin text-gray-400"})}):S.length===0?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(cs,{className:"w-12 h-12 text-gray-200 mx-auto mb-4"}),l.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:r.length===0?"No documents yet":"No matching documents"}),l.jsx("p",{className:"text-xs text-gray-500",children:r.length===0?"Upload your first knowledge document to get started.":"Try adjusting your search."})]}):l.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-100 bg-gray-50/50",children:[l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Name"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"File"}),l.jsx("th",{className:"text-right px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Size"}),l.jsx("th",{className:"text-right px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Chunks"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Uploaded"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),l.jsx("tbody",{children:S.map(N=>l.jsxs("tr",{className:"border-b border-gray-50 last:border-0 hover:bg-gray-50/50 transition-colors",children:[l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-sm font-medium text-gray-900",children:N.name})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-xs text-gray-500 font-mono truncate block max-w-[200px]",children:N.filePath})}),l.jsx("td",{className:"px-6 py-4 text-right",children:l.jsx("span",{className:"text-xs text-gray-500",children:ree(N.sizeBytes)})}),l.jsx("td",{className:"px-6 py-4 text-right",children:l.jsx("span",{className:U("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",N.chunkCount>0?"bg-green-50 text-green-700":"bg-gray-100 text-gray-500"),children:N.chunkCount})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-xs text-gray-500",children:iee(N.createdAt)})}),l.jsx("td",{className:"px-6 py-4 text-center",children:l.jsxs("div",{className:"inline-flex items-center gap-1",children:[l.jsx("button",{onClick:()=>j(N),className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",title:"Preview",children:l.jsx(Zl,{className:"w-3.5 h-3.5"})}),n&&l.jsx("button",{onClick:P=>k(P,N.id,N.name),disabled:p===N.id,className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors disabled:opacity-50",title:"Delete",children:p===N.id?l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Fn,{className:"w-3.5 h-3.5"})})]})})]},N.id))})]})})]})}),y&&l.jsx("div",{className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40 flex items-center justify-center",onClick:()=>x(null),children:l.jsxs("div",{className:"bg-white rounded-xl shadow-2xl w-[720px] max-h-[80vh] flex flex-col",onClick:N=>N.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Sd,{className:"w-4 h-4 text-primary-600"}),l.jsx("h3",{className:"font-semibold text-gray-900",children:y.name})]}),l.jsx("button",{onClick:()=>x(null),className:"p-1 text-gray-400 hover:text-gray-600",children:l.jsx("span",{className:"text-lg",children:"×"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:v?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(Ie,{className:"w-5 h-5 animate-spin text-gray-400"})}):l.jsx("pre",{className:"text-sm text-gray-700 whitespace-pre-wrap font-mono leading-relaxed",children:y.content||"(empty)"})})]})}),n&&l.jsx(nee,{isOpen:f,onClose:()=>h(!1),onSave:s})]})}const see={name:"",infraContext:"",isTest:!1,apiServer:"",debugImage:"",allowedServers:"",defaultKubeconfig:""};function oee({cluster:e,onClose:t,onSaved:n,sendRpc:r}){const i=!e,[a,s]=m.useState(()=>e?{name:e.name,infraContext:e.infraContext??"",isTest:e.isTest,apiServer:e.apiServer,debugImage:e.debugImage??"",allowedServers:e.allowedServers.join(", "),defaultKubeconfig:""}:{...see}),[o,c]=m.useState(!1),u=(f,h)=>{s(p=>({...p,[f]:h}))},d=async()=>{if(!(!a.name.trim()||!a.apiServer.trim())){c(!0);try{const f=a.allowedServers.trim()?a.allowedServers.split(",").map(y=>y.trim()).filter(Boolean):void 0,h=a.isTest&&a.defaultKubeconfig.trim()?a.defaultKubeconfig.trim():void 0,p=a.infraContext.trim()||null,g=a.debugImage.trim()||void 0;i?await r("cluster.create",{name:a.name.trim(),infraContext:p,isTest:a.isTest,apiServer:a.apiServer.trim(),debugImage:g,allowedServers:f,defaultKubeconfig:h}):await r("cluster.update",{id:e.id,name:a.name.trim(),infraContext:p,isTest:a.isTest,apiServer:a.apiServer.trim(),debugImage:a.debugImage.trim()||null,allowedServers:f,defaultKubeconfig:h}),n()}catch(f){console.error("[Clusters] Save failed:",f)}finally{c(!1)}}};return l.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",onClick:t,children:l.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg max-h-[85vh] flex flex-col",onClick:f=>f.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:i?"Create Cluster":`Edit: ${e.name}`}),l.jsx("button",{onClick:t,className:"p-1.5 text-gray-400 hover:text-gray-600 rounded-md",children:l.jsx(Qe,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Name ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:a.name,onChange:f=>u("name",f.target.value),placeholder:"production-us-east",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Infrastructure Context"}),l.jsx("textarea",{value:a.infraContext,onChange:f=>u("infraContext",f.target.value),placeholder:`Describe cluster infrastructure details, e.g.:
|
|
694
|
+
- RDMA network: SR-IOV (switchdev) / macvlan / ipvlan
|
|
695
|
+
- GPU scheduler: volcano / kueue / default
|
|
696
|
+
- CNI: calico / cilium / flannel`,rows:4,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 resize-none"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Filling this helps the SRE agent diagnose issues faster and more accurately — it provides infrastructure context not discoverable via kubectl"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Type"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{type:"button",onClick:()=>u("isTest",!1),className:U("flex-1 px-3 py-2 text-sm font-medium rounded-lg border transition-colors",a.isTest?"bg-white text-gray-500 border-gray-200 hover:bg-gray-50":"bg-blue-50 text-blue-700 border-blue-200"),children:"Production"}),l.jsx("button",{type:"button",onClick:()=>u("isTest",!0),className:U("flex-1 px-3 py-2 text-sm font-medium rounded-lg border transition-colors",a.isTest?"bg-amber-50 text-amber-700 border-amber-200":"bg-white text-gray-500 border-gray-200 hover:bg-gray-50"),children:"Testing"})]})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["API Server ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:a.apiServer,onChange:f=>u("apiServer",f.target.value),placeholder:"https://10.0.1.100:6443",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),l.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["Must include explicit port, e.g. ",l.jsx("span",{className:"font-mono",children:":6443"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Debug Image"}),l.jsx("input",{type:"text",value:a.debugImage,onChange:f=>u("debugImage",f.target.value),placeholder:"registry.example.com/debug:v1",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),l.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["Container image for debug pods on this cluster. Leave empty to use default (",l.jsx("span",{className:"font-mono",children:"busybox:1.36"}),")"]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Allowed Servers"}),l.jsx("input",{type:"text",value:a.allowedServers,onChange:f=>u("allowedServers",f.target.value),placeholder:"server1, server2, server3",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Comma-separated list of allowed server addresses"})]}),a.isTest&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Default Kubeconfig"}),l.jsx("textarea",{value:a.defaultKubeconfig,onChange:f=>u("defaultKubeconfig",f.target.value),placeholder:"Paste kubeconfig YAML here...",rows:6,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 resize-none"}),!i&&e.hasDefaultKubeconfig&&!a.defaultKubeconfig.trim()&&l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"A kubeconfig is already configured. Leave empty to keep the existing one."})]})]}),l.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-gray-200",children:[l.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-lg",children:"Cancel"}),l.jsx("button",{onClick:d,disabled:o||!a.name.trim()||!a.apiServer.trim(),className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg disabled:opacity-50",children:o?"Saving...":i?"Create":"Save"})]})]})})}function lee(e){try{const t=e.split(`
|
|
697
|
+
`),n=[],r=[];let i="",a=!1,s=!1,o="",c="";for(const u of t){const d=u.trim();d.startsWith("current-context:")&&(i=d.replace("current-context:","").trim().replace(/^['"]|['"]$/g,"")),d==="clusters:"&&(a=!0,s=!1),d==="contexts:"&&(s=!0,a=!1),d==="users:"&&(a=!1,s=!1),a&&(d.startsWith("name:")&&u.startsWith("- ")?(o&&r.push({name:o,server:c}),o=d.replace("name:","").trim().replace(/^['"]|['"]$/g,""),c=""):d.startsWith("server:")&&(c=d.replace("server:","").trim().replace(/^['"]|['"]$/g,""))),s&&d.startsWith("name:")&&u.startsWith("- ")&&n.push(d.replace("name:","").trim().replace(/^['"]|['"]$/g,""))}return o&&r.push({name:o,server:c}),r.length===0&&n.length===0?null:{contexts:n,clusters:r,currentContext:i}}catch{return null}}function cee({clusterId:e,clusterName:t,apiServer:n,replacing:r,onClose:i,onUploaded:a,sendRpc:s}){const[o,c]=m.useState(""),[u,d]=m.useState(!1),[f,h]=m.useState(""),p=m.useMemo(()=>o.trim()?lee(o):null,[o]),g=p!==null,y=async()=>{if(o.trim()){d(!0),h("");try{await s("userClusterConfig.set",{clusterId:e,kubeconfig:o}),a()}catch(x){h((x==null?void 0:x.message)||"Failed to upload kubeconfig")}finally{d(!1)}}};return l.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",onClick:i,children:l.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg p-6",onClick:x=>x.stopPropagation(),children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Upload Kubeconfig"}),l.jsxs("div",{className:"mb-4 px-3 py-2.5 bg-gray-50 rounded-lg",children:[l.jsx("p",{className:"text-sm font-medium text-gray-900",children:t}),l.jsx("p",{className:"text-xs text-gray-500 font-mono mt-0.5",children:n}),r&&l.jsx("p",{className:"text-xs text-amber-600 mt-1",children:"Existing kubeconfig will be replaced"})]}),g?l.jsxs("div",{className:"border border-green-200 bg-green-50 rounded-lg p-3 mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(br,{className:"w-4 h-4 text-green-500 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-green-700",children:"Kubeconfig parsed"}),l.jsx("button",{onClick:()=>c(""),className:"ml-auto text-xs text-gray-400 hover:text-gray-600",children:"Clear"})]}),l.jsxs("div",{className:"space-y-1",children:[p.clusters.map(x=>l.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600",children:[l.jsx(Sd,{className:"w-3 h-3 text-gray-400 shrink-0"}),l.jsx("span",{className:"font-medium",children:x.name}),l.jsx("span",{className:"text-gray-400 font-mono truncate",children:x.server})]},x.name)),p.currentContext&&l.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["Context: ",l.jsx("span",{className:"font-mono",children:p.currentContext})]})]})]}):l.jsx("textarea",{value:o,onChange:x=>{c(x.target.value),h("")},placeholder:"Paste kubeconfig YAML content...",rows:8,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-xs font-mono focus:outline-none focus:ring-2 focus:ring-indigo-300 resize-none mb-4"}),f&&l.jsx("p",{className:"text-xs text-red-500 mb-3",children:f}),l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx("button",{onClick:i,className:"px-4 py-2 text-sm font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-lg",children:"Cancel"}),l.jsx("button",{onClick:y,disabled:!o.trim()||u,className:"px-4 py-2 text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg disabled:opacity-50",children:u?"Uploading...":"Upload"})]})]})})}const DC={production:"bg-blue-50 text-blue-700",testing:"bg-amber-50 text-amber-700"};function uee(){const{sendRpc:e,isConnected:t}=Rt(),{isAdmin:n,loaded:r}=wa(e,t),[i,a]=wd(),s=i.get("tab"),o=s==="ssh"?"ssh":s==="api"?"api":s==="credentials"?"ssh":"clusters",c=G=>{a(G==="clusters"?{}:{tab:G})},[u,d]=m.useState([]),[f,h]=m.useState(!1),[p,g]=m.useState(!0),[y,x]=m.useState(""),[v,b]=m.useState(!1),[w,S]=m.useState(null),[k,j]=m.useState(null),[N,P]=m.useState(!1),[T,E]=m.useState(),_=m.useRef(!1),C=m.useCallback(async()=>{g(!0);try{const G=await e("cluster.list");d(G.clusters??[]),h(G.isAdmin??!1)}catch(G){console.error("[Clusters] Failed to load:",G)}finally{g(!1)}},[e]);m.useEffect(()=>{t&&r&&!_.current&&(_.current=!0,C())},[t,r,C]);const A=m.useMemo(()=>{if(!y.trim())return u;const G=y.toLowerCase();return u.filter(te=>te.name.toLowerCase().includes(G)||te.apiServer.toLowerCase().includes(G)||te.allowedServers.some(ee=>ee.toLowerCase().includes(G)))},[u,y]),M=()=>{S(null),b(!0)},B=G=>{S(G),b(!0)},ae=async(G,te)=>{if(G.stopPropagation(),!k&&window.confirm(`Delete cluster "${te.name}"? This action cannot be undone.`)){j(te.id);try{await e("cluster.delete",{id:te.id}),await C()}catch(ee){console.error("[Clusters] Delete failed:",ee)}finally{j(null)}}},Q=()=>{b(!1),S(null),C()},I=G=>{E(G),P(!0)},H=()=>{P(!1),E(void 0),C()},O=async G=>{if(window.confirm("Remove your kubeconfig for this cluster?"))try{await e("userClusterConfig.remove",{clusterId:G}),await C()}catch(te){console.error("Failed to remove cluster config:",te)}},oe=m.useMemo(()=>u.find(G=>G.id===T),[u,T]),re=n||f,D=G=>G.hasUserKubeconfig?l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700",children:"Configured"}):G.hasDefaultKubeconfig&&G.isTest?l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-teal-50 text-teal-700",children:"Default"}):l.jsx("span",{className:"text-xs text-gray-400",children:"—"});return r?l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx("header",{className:"h-16 flex items-center justify-between px-6 bg-white sticky top-0 z-10 border-b border-gray-100",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-primary-50 rounded-lg",children:l.jsx(Ql,{className:"w-5 h-5 text-primary-600"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900",children:"Credentials"}),l.jsx("p",{className:"text-xs text-gray-500",children:"Manage Kubernetes clusters, SSH and API credentials"})]})]})}),l.jsx("div",{className:"border-b border-gray-200 bg-white px-6",children:l.jsx("nav",{className:"flex gap-6 -mb-px",children:[{key:"clusters",label:"Kubernetes"},{key:"ssh",label:"SSH"},{key:"api",label:"API"}].map(G=>l.jsx("button",{onClick:()=>c(G.key),className:U("py-3 text-sm font-medium border-b-2 transition-colors",o===G.key?"border-primary-600 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:G.label},G.key))})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsx("div",{className:"max-w-5xl mx-auto",children:o!=="clusters"?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(Ml,{className:"w-12 h-12 text-gray-200 mx-auto mb-4"}),l.jsx("div",{className:"text-lg font-medium text-gray-500 mb-1",children:o==="ssh"?"SSH Credentials":"API Credentials"}),l.jsx("div",{className:"text-sm text-gray-400",children:"Coming soon"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsxs("div",{className:"relative flex-1 max-w-xs",children:[l.jsx(Kn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),l.jsx("input",{type:"text",value:y,onChange:G=>x(G.target.value),placeholder:"Search clusters...",className:"w-full pl-9 pr-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsx("div",{className:"flex-1"}),re&&l.jsxs("button",{onClick:M,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[l.jsx(dn,{className:"w-4 h-4"}),"New Kubernetes"]})]}),p?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(Ie,{className:"w-6 h-6 animate-spin text-gray-400"})}):A.length===0?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(Ml,{className:"w-12 h-12 text-gray-200 mx-auto mb-4"}),l.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:u.length===0?"No clusters yet":"No matching clusters"}),l.jsx("p",{className:"text-xs text-gray-500",children:u.length===0?re?"Create your first cluster to get started.":"No clusters have been configured yet.":"Try adjusting your search."})]}):l.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-100 bg-gray-50/50",children:[l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Name"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Type"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"API Server"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Status"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),l.jsx("tbody",{children:A.map(G=>l.jsxs("tr",{className:U("border-b border-gray-50 last:border-0 hover:bg-gray-50/50 transition-colors",re&&"cursor-pointer"),onClick:()=>re&&B(G),children:[l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-sm font-medium text-gray-900",children:G.name})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:U("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",G.isTest?DC.testing:DC.production),children:G.isTest?"Testing":"Production"})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-sm text-gray-500 font-mono text-xs",children:G.apiServer})}),l.jsx("td",{className:"px-6 py-4",children:D(G)}),l.jsx("td",{className:"px-6 py-4 text-center",children:l.jsxs("div",{className:"inline-flex items-center gap-1",children:[G.hasUserKubeconfig?l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:te=>{te.stopPropagation(),I(G.id)},className:"px-2 py-1 text-xs font-medium text-indigo-600 bg-indigo-50 hover:bg-indigo-100 rounded transition-colors",title:"Replace kubeconfig",children:"Replace"}),l.jsx("button",{onClick:te=>{te.stopPropagation(),O(G.id)},className:"px-2 py-1 text-xs font-medium text-red-600 bg-red-50 hover:bg-red-100 rounded transition-colors",title:"Remove kubeconfig",children:"Remove"})]}):l.jsxs("button",{onClick:te=>{te.stopPropagation(),I(G.id)},className:"px-2 py-1 text-xs font-medium text-indigo-600 bg-indigo-50 hover:bg-indigo-100 rounded transition-colors",title:"Upload kubeconfig",children:[l.jsx(Jh,{className:"w-3 h-3 inline mr-1"}),"Upload"]}),re&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-px h-4 bg-gray-200 mx-1"}),l.jsx("button",{onClick:te=>{te.stopPropagation(),B(G)},className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",title:"Edit cluster",children:l.jsx(kd,{className:"w-3.5 h-3.5"})}),l.jsx("button",{onClick:te=>ae(te,G),disabled:k===G.id,className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors disabled:opacity-50",title:"Delete cluster",children:k===G.id?l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Fn,{className:"w-3.5 h-3.5"})})]})]})})]},G.id))})]})})]})})}),v&&re&&l.jsx(oee,{cluster:w,onClose:()=>{b(!1),S(null)},onSaved:Q,sendRpc:e}),N&&oe&&l.jsx(cee,{clusterId:oe.id,clusterName:oe.name,apiServer:oe.apiServer,replacing:oe.hasUserKubeconfig,onClose:()=>{P(!1),E(void 0)},onUploaded:H,sendRpc:e})]}):l.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:l.jsx(Ie,{className:"w-5 h-5 animate-spin"})})}function dee(e){const{sendRpc:t,isConnected:n}=Rt(),[r,i]=m.useState(null),[a,s]=m.useState(!0),o=m.useCallback(async()=>{if(n)try{const c=await t("metrics.timeseries",{range:e});i(c)}catch(c){console.warn("[useMetrics] fetch error:",c)}finally{s(!1)}},[t,n,e]);return m.useEffect(()=>{s(!0),o()},[o]),m.useEffect(()=>{const c=setInterval(o,3e4);return()=>clearInterval(c)},[o]),{data:r,loading:a,refresh:o}}function fee(e){const{sendRpc:t,isConnected:n}=Rt(),[r,i]=m.useState(null),[a,s]=m.useState(!0),o=m.useCallback(async()=>{if(n)try{const c=await t("metrics.summary",{period:e});i(c)}catch(c){console.warn("[useSummary] fetch error:",c)}finally{s(!1)}},[t,n,e]);return m.useEffect(()=>{s(!0),o()},[o]),{data:r,loading:a,refresh:o}}function MC(e){return e===0?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function IC(e,t){if(e.length<4)return{label:"Not enough data",color:"text-gray-400"};const n=Math.floor(e.length/2),r=e.slice(0,n).reduce((s,o)=>s+t(o),0),i=e.slice(n).reduce((s,o)=>s+t(o),0);if(r===0&&i===0)return null;if(r===0)return{label:"New",color:"text-green-600"};const a=(i-r)/r*100;return a>=0?{label:`+${a.toFixed(1)}%`,color:"text-green-600"}:{label:`${a.toFixed(1)}%`,color:"text-red-500"}}function hee({buckets:e,snapshot:t,range:n}){const r=e.reduce((g,y)=>g+y.tokensInput+y.tokensOutput,0),i=IC(e,g=>g.tokensInput+g.tokensOutput),a=e.reduce((g,y)=>g+y.promptCount+y.promptErrors,0),s=e.reduce((g,y)=>g+y.promptErrors,0),o=a>0?(s/a*100).toFixed(1):"0",c=e.reduce((g,y)=>g+y.toolCalls+y.toolErrors,0),u=e.reduce((g,y)=>g+y.toolErrors,0),d=IC(e,g=>g.toolCalls+g.toolErrors),f=e.reduce((g,y)=>g+y.skillSuccesses+y.skillErrors,0),h=e.reduce((g,y)=>g+y.skillErrors,0),p=f>0?(h/f*100).toFixed(1):"0";return l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:[l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Total Tokens"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-50 flex items-center justify-center",children:l.jsx(jd,{className:"w-4 h-4 text-indigo-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:MC(r)}),i&&l.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[l.jsx("span",{className:`text-xs font-medium ${i.color}`,children:i.label}),!i.label.includes("Not enough")&&!i.label.includes("New")&&l.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["vs prev ",n]})]})]}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Prompts"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-50 flex items-center justify-center",children:l.jsx(Cm,{className:"w-4 h-4 text-amber-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:a}),l.jsx("div",{className:"flex items-center gap-1 mt-1",children:s>0?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-xs text-red-500 font-medium",children:[s," errors"]}),l.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["(",o,"% error rate)"]})]}):l.jsx("span",{className:"text-xs text-green-600 font-medium",children:"No errors"})})]}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Tool Calls"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-emerald-50 flex items-center justify-center",children:l.jsx(r_,{className:"w-4 h-4 text-emerald-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:MC(c)}),l.jsx("div",{className:"flex items-center gap-1 mt-1",children:u>0?l.jsxs("span",{className:"text-xs text-red-500 font-medium",children:[u," errors"]}):d?l.jsx("span",{className:`text-xs font-medium ${d.color}`,children:d.label}):l.jsx("span",{className:"text-xs text-gray-400",children:"No data"})})]}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Skill Calls"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-50 flex items-center justify-center",children:l.jsx(fw,{className:"w-4 h-4 text-purple-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:f}),l.jsx("div",{className:"flex items-center gap-1 mt-1",children:h>0?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-xs text-red-500 font-medium",children:[h," errors"]}),l.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["(",p,"%)"]})]}):f>0?l.jsx("span",{className:"text-xs text-green-600 font-medium",children:"No errors"}):l.jsx("span",{className:"text-xs text-gray-400",children:"No data"})})]}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Active Sessions"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-50 flex items-center justify-center",children:l.jsx(ta,{className:"w-4 h-4 text-blue-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:t.activeSessions}),l.jsx("div",{className:"flex items-center gap-1 mt-1",children:l.jsxs("span",{className:"text-xs text-gray-500",children:[t.wsConnections," WebSocket connections"]})})]})]})}var pee=["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"];function k1(e){if(typeof e!="string")return!1;var t=pee;return t.includes(e)}var mee=["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"],gee=new Set(mee);function iM(e){return typeof e!="string"?!1:gee.has(e)}function aM(e){return typeof e=="string"&&e.startsWith("data-")}function ui(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(iM(n)||aM(n))&&(t[n]=e[n]);return t}function Vm(e){if(e==null)return null;if(m.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return ui(t)}return typeof e=="object"&&!Array.isArray(e)?ui(e):null}function Sr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(iM(n)||aM(n)||k1(n))&&(t[n]=e[n]);return t}function yee(e){return e==null?null:m.isValidElement(e)?Sr(e.props):typeof e=="object"&&!Array.isArray(e)?Sr(e):null}var xee=["children","width","height","viewBox","className","style","title","desc"];function cv(){return cv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cv.apply(null,arguments)}function vee(e,t){if(e==null)return{};var n,r,i=bee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bee(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}var j1=m.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:s,style:o,title:c,desc:u}=e,d=vee(e,xee),f=a||{width:r,height:i,x:0,y:0},h=ct("recharts-surface",s);return m.createElement("svg",cv({},Sr(d),{className:h,width:r,height:i,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),m.createElement("title",null,c),m.createElement("desc",null,u),n)}),wee=["children","className"];function uv(){return uv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uv.apply(null,arguments)}function See(e,t){if(e==null)return{};var n,r,i=kee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kee(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}var Di=m.forwardRef((e,t)=>{var{children:n,className:r}=e,i=See(e,wee),a=ct("recharts-layer",r);return m.createElement("g",uv({className:a},Sr(i),{ref:t}),n)}),sM=m.createContext(null),jee=()=>m.useContext(sM);function vt(e){return function(){return e}}const oM=Math.cos,fp=Math.sin,hi=Math.sqrt,hp=Math.PI,Wm=2*hp,dv=Math.PI,fv=2*dv,Rs=1e-6,Nee=fv-Rs;function lM(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Cee(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return lM;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 Pee{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?lM:Cee(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,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}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 s=this._x1,o=this._y1,c=r-t,u=i-n,d=s-t,f=o-n,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Rs)if(!(Math.abs(f*c-u*d)>Rs)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-s,g=i-o,y=c*c+u*u,x=p*p+g*g,v=Math.sqrt(y),b=Math.sqrt(h),w=a*Math.tan((dv-Math.acos((y+h-x)/(2*v*b)))/2),S=w/b,k=w/v;Math.abs(S-1)>Rs&&this._append`L${t+S*d},${n+S*f}`,this._append`A${a},${a},0,0,${+(f*p>d*g)},${this._x1=t+k*c},${this._y1=n+k*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),c=r*Math.sin(i),u=t+o,d=n+c,f=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Rs||Math.abs(this._y1-d)>Rs)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%fv+fv),h>Nee?this._append`A${r},${r},0,1,${f},${t-o},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>Rs&&this._append`A${r},${r},0,${+(h>=dv)},${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 N1(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 Pee(t)}function C1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function cM(e){this._context=e}cM.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 Hm(e){return new cM(e)}function uM(e){return e[0]}function dM(e){return e[1]}function fM(e,t){var n=vt(!0),r=null,i=Hm,a=null,s=N1(o);e=typeof e=="function"?e:e===void 0?uM:vt(e),t=typeof t=="function"?t:t===void 0?dM:vt(t);function o(c){var u,d=(c=C1(c)).length,f,h=!1,p;for(r==null&&(a=i(p=s())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,c),+t(f,u,c));if(p)return a=null,p+""||null}return o.x=function(c){return arguments.length?(e=typeof c=="function"?c:vt(+c),o):e},o.y=function(c){return arguments.length?(t=typeof c=="function"?c:vt(+c),o):t},o.defined=function(c){return arguments.length?(n=typeof c=="function"?c:vt(!!c),o):n},o.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),o):i},o.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),o):r},o}function If(e,t,n){var r=null,i=vt(!0),a=null,s=Hm,o=null,c=N1(u);e=typeof e=="function"?e:e===void 0?uM:vt(+e),t=typeof t=="function"?t:vt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?dM:vt(+n);function u(f){var h,p,g,y=(f=C1(f)).length,x,v=!1,b,w=new Array(y),S=new Array(y);for(a==null&&(o=s(b=c())),h=0;h<=y;++h){if(!(h<y&&i(x=f[h],h,f))===v)if(v=!v)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=h-1;g>=p;--g)o.point(w[g],S[g]);o.lineEnd(),o.areaEnd()}v&&(w[h]=+e(x,h,f),S[h]=+t(x,h,f),o.point(r?+r(x,h,f):w[h],n?+n(x,h,f):S[h]))}if(b)return o=null,b+""||null}function d(){return fM().defined(i).curve(s).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:vt(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:vt(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:vt(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:vt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:vt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:vt(+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:vt(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,a!=null&&(o=s(a)),u):s},u.context=function(f){return arguments.length?(f==null?a=o=null:o=s(a=f),u):a},u}class hM{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 Eee(e){return new hM(e,!0)}function Aee(e){return new hM(e,!1)}const P1={draw(e,t){const n=hi(t/hp);e.moveTo(n,0),e.arc(0,0,n,0,Wm)}},Tee={draw(e,t){const n=hi(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()}},pM=hi(1/3),Oee=pM*2,_ee={draw(e,t){const n=hi(t/Oee),r=n*pM;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Dee={draw(e,t){const n=hi(t),r=-n/2;e.rect(r,r,n,n)}},Mee=.8908130915292852,mM=fp(hp/10)/fp(7*hp/10),Iee=fp(Wm/10)*mM,Lee=-oM(Wm/10)*mM,Ree={draw(e,t){const n=hi(t*Mee),r=Iee*n,i=Lee*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=Wm*a/5,o=oM(s),c=fp(s);e.lineTo(c*n,-o*n),e.lineTo(o*r-c*i,c*r+o*i)}e.closePath()}},ry=hi(3),Fee={draw(e,t){const n=-hi(t/(ry*3));e.moveTo(0,n*2),e.lineTo(-ry*n,-n),e.lineTo(ry*n,-n),e.closePath()}},Ar=-.5,Tr=hi(3)/2,hv=1/hi(12),zee=(hv/2+1)*3,$ee={draw(e,t){const n=hi(t/zee),r=n/2,i=n*hv,a=r,s=n*hv+n,o=-a,c=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(o,c),e.lineTo(Ar*r-Tr*i,Tr*r+Ar*i),e.lineTo(Ar*a-Tr*s,Tr*a+Ar*s),e.lineTo(Ar*o-Tr*c,Tr*o+Ar*c),e.lineTo(Ar*r+Tr*i,Ar*i-Tr*r),e.lineTo(Ar*a+Tr*s,Ar*s-Tr*a),e.lineTo(Ar*o+Tr*c,Ar*c-Tr*o),e.closePath()}};function Bee(e,t){let n=null,r=N1(i);e=typeof e=="function"?e:vt(e||P1),t=typeof t=="function"?t:vt(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:vt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:vt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function pp(){}function mp(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 gM(e){this._context=e}gM.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:mp(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:mp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Uee(e){return new gM(e)}function yM(e){this._context=e}yM.prototype={areaStart:pp,areaEnd:pp,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:mp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Vee(e){return new yM(e)}function xM(e){this._context=e}xM.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:mp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Wee(e){return new xM(e)}function vM(e){this._context=e}vM.prototype={areaStart:pp,areaEnd:pp,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 Hee(e){return new vM(e)}function LC(e){return e<0?-1:1}function RC(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(LC(a)+LC(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function FC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function iy(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,s-o*n,a,s)}function gp(e){this._context=e}gp.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:iy(this,this._t0,FC(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,iy(this,FC(this,n=RC(this,e,t)),n);break;default:iy(this,this._t0,n=RC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function bM(e){this._context=new wM(e)}(bM.prototype=Object.create(gp.prototype)).point=function(e,t){gp.prototype.point.call(this,t,e)};function wM(e){this._context=e}wM.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 Kee(e){return new gp(e)}function qee(e){return new bM(e)}function SM(e){this._context=e}SM.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=zC(e),i=zC(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(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 zC(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[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 Gee(e){return new SM(e)}function Km(e,t){this._context=e,this._t=t}Km.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 Yee(e){return new Km(e,.5)}function Xee(e){return new Km(e,0)}function Zee(e){return new Km(e,1)}function yo(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,o=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function pv(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Qee(e,t){return e[t]}function Jee(e){const t=[];return t.key=e,t}function ete(){var e=vt([]),t=pv,n=yo,r=Qee;function i(a){var s=Array.from(e.apply(this,arguments),Jee),o,c=s.length,u=-1,d;for(const f of a)for(o=0,++u;o<c;++o)(s[o][u]=[0,+r(f,s[o].key,u,a)]).data=f;for(o=0,d=C1(t(s));o<c;++o)s[d[o]].index=o;return n(s,d),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:vt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:vt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?pv:typeof a=="function"?a:vt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??yo,i):n},i}function tte(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}yo(e,t)}}function nte(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var s=0,o=0;s<i;++s)o+=e[s][n][1]||0;r[n][1]+=r[n][0]=-o/2}yo(e,t)}}function rte(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var o=0,c=0,u=0;o<s;++o){for(var d=e[t[o]],f=d[r][1]||0,h=d[r-1][1]||0,p=(f-h)/2,g=0;g<o;++g){var y=e[t[g]],x=y[r][1]||0,v=y[r-1][1]||0;p+=x-v}c+=f,u+=p*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,yo(e,t)}}var qm={},kM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(kM);var E1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(E1);var Gm={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var r;return typeof n=="string"||typeof n=="symbol"?n:Object.is((r=n==null?void 0:n.valueOf)==null?void 0:r.call(n),-0)?"-0":String(n)}e.toKey=t})(Gm);var Ym={},jM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(jM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jM,n=Gm;function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],s=i.length;if(s===0)return a;let o=0,c="",u="",d=!1;for(i.charCodeAt(0)===46&&(a.push(""),o++);o<s;){const f=i[o];u?f==="\\"&&o+1<s?(o++,c+=i[o]):f===u?u="":c+=f:d?f==='"'||f==="'"?u=f:f==="]"?(d=!1,a.push(c),c=""):c+=f:f==="["?(d=!0,c&&(a.push(c),c="")):f==="."?c&&(a.push(c),c=""):c+=f,o++}return c&&a.push(c),a}e.toPath=r})(Ym);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kM,n=E1,r=Gm,i=Ym;function a(o,c,u){if(o==null)return u;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return u;const d=o[c];return d===void 0?n.isDeepKey(c)?a(o,i.toPath(c),u):u:d}case"number":case"symbol":{typeof c=="number"&&(c=r.toKey(c));const d=o[c];return d===void 0?u:d}default:{if(Array.isArray(c))return s(o,c,u);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return u;const d=o[c];return d===void 0?u:d}}}function s(o,c,u){if(c.length===0)return u;let d=o;for(let f=0;f<c.length;f++){if(d==null||t.isUnsafeProperty(c[f]))return u;d=d[c[f]]}return d===void 0?u:d}e.get=a})(qm);var ite=qm.get;const Xm=fi(ite);var ate=4;function Ya(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ate,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function xn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,s)=>{var o=n[s-1];return typeof o=="string"?i+o+a:o!==void 0?i+Ya(o)+a:i+a},"")}var Fr=e=>e===0?0:e>0?1:-1,Mi=e=>typeof e=="number"&&e!=+e,xo=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Oe=e=>(typeof e=="number"||e instanceof Number)&&!Mi(e),Ii=e=>Oe(e)||typeof e=="string",ste=0,Ju=e=>{var t=++ste;return"".concat(e||"").concat(t)},ps=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(!Oe(t)&&typeof t!="string")return r;var a;if(xo(t)){if(n==null)return r;var s=t.indexOf("%");a=n*parseFloat(t.slice(0,s))/100}else a=+t;return Mi(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},NM=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function ki(e,t,n){return Oe(e)&&Oe(t)?Ya(e+n*(t-e)):t}function CM(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Xm(r,t))===n)}var jn=e=>e===null||typeof e>"u",Md=e=>jn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function tr(e){return e!=null}function Ao(){}var ote=["type","size","sizeType"];function mv(){return mv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mv.apply(null,arguments)}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 BC(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){lte(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 lte(e,t,n){return(t=cte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cte(e){var t=ute(e,"string");return typeof t=="symbol"?t:t+""}function ute(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dte(e,t){if(e==null)return{};var n,r,i=fte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fte(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}var PM={symbolCircle:P1,symbolCross:Tee,symbolDiamond:_ee,symbolSquare:Dee,symbolStar:Ree,symbolTriangle:Fee,symbolWye:$ee},hte=Math.PI/180,pte=e=>{var t="symbol".concat(Md(e));return PM[t]||P1},mte=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*hte;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},gte=(e,t)=>{PM["symbol".concat(Md(e))]=t},EM=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=dte(e,ote),a=BC(BC({},i),{},{type:t,size:n,sizeType:r}),s="circle";typeof t=="string"&&(s=t);var o=()=>{var h=pte(s),p=Bee().type(h).size(mte(n,r,s)),g=p();if(g!==null)return g},{className:c,cx:u,cy:d}=a,f=Sr(a);return Oe(u)&&Oe(d)&&Oe(n)?m.createElement("path",mv({},f,{className:ct("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:o()})):null};EM.registerSymbol=gte;var AM=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,A1=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(m.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{k1(i)&&typeof n[i]=="function"&&(r[i]=a=>n[i](n,a))}),r},yte=(e,t,n)=>r=>(e(t,n,r),null),TM=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];k1(i)&&typeof a=="function"&&(r||(r={}),r[i]=yte(a,t,n))}),r};function UC(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 xte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UC(Object(n),!0).forEach(function(r){vte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vte(e,t,n){return(t=bte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bte(e){var t=wte(e,"string");return typeof t=="symbol"?t:t+""}function wte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function or(e,t){var n=xte({},e),r=t,i=Object.keys(t),a=i.reduce((s,o)=>(s[o]===void 0&&r[o]!==void 0&&(s[o]=r[o]),s),n);return a}function yp(){return yp=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},yp.apply(null,arguments)}function VC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VC(Object(n),!0).forEach(function(r){Ste(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ste(e,t,n){return(t=kte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kte(e){var t=jte(e,"string");return typeof t=="symbol"?t:t+""}function jte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dr=32,Nte={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Cte(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Pte(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Dr/2,a=Dr/6,s=Dr/3,o=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return m.createElement("line",{strokeWidth:4,fill:"none",stroke:o,strokeDasharray:Cte(t.payload),x1:0,y1:i,x2:Dr,y2:i,className:"recharts-legend-icon"});if(c==="line")return m.createElement("path",{strokeWidth:4,fill:"none",stroke:o,d:"M0,".concat(i,"h").concat(s,`
|
|
698
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(i,`
|
|
699
|
+
H`).concat(Dr,"M").concat(2*s,",").concat(i,`
|
|
700
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return m.createElement("path",{stroke:"none",fill:o,d:"M0,".concat(Dr/8,"h").concat(Dr,"v").concat(Dr*3/4,"h").concat(-Dr,"z"),className:"recharts-legend-icon"});if(m.isValidElement(t.legendIcon)){var u=OM({},t);return delete u.legendIcon,m.cloneElement(t.legendIcon,u)}return m.createElement(EM,{fill:o,cx:i,cy:i,size:Dr,sizeType:"diameter",type:c})}function Ete(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:s,labelStyle:o}=e,c={x:0,y:0,width:Dr,height:Dr},u={display:r==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((f,h)=>{var p=f.formatter||i,g=ct({"recharts-legend-item":!0,["legend-item-".concat(h)]:!0,inactive:f.inactive});if(f.type==="none")return null;var y=typeof o=="object"?OM({},o):{};y.color=f.inactive?a:y.color||f.color;var x=p?p(f.value,f,h):f.value;return m.createElement("li",yp({className:g,style:u,key:"legend-item-".concat(h)},TM(e,f,h)),m.createElement(j1,{width:n,height:n,viewBox:c,style:d,"aria-label":"".concat(x," legend icon")},m.createElement(Pte,{data:f,iconType:s,inactiveColor:a})),m.createElement("span",{className:"recharts-legend-item-text",style:y},x))})}var Ate=e=>{var t=or(e,Nte),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return m.createElement("ul",{className:"recharts-default-legend",style:a},m.createElement(Ete,yp({},t,{payload:n})))},_M={},DM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const s=n[a],o=r(s,a,n);i.has(o)||i.set(o,s)}return Array.from(i.values())}e.uniqBy=t})(DM);var MM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(MM);var T1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(T1);var IM={},O1={},LM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(LM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LM;function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(O1);var RM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(RM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=O1,n=RM;function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(IM);var FM={},zM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qm;function n(r){return function(i){return t.get(i,r)}}e.property=n})(zM);var $M={},_1={},BM={},D1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(D1);var M1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(M1);var I1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(I1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=D1,n=M1,r=I1;function i(d,f,h){return typeof h!="function"?i(d,f,()=>{}):a(d,f,function p(g,y,x,v,b,w){const S=h(g,y,x,v,b,w);return S!==void 0?!!S:a(g,y,p,w)},new Map)}function a(d,f,h,p){if(f===d)return!0;switch(typeof f){case"object":return s(d,f,h,p);case"function":return Object.keys(f).length>0?a(d,{...f},h,p):r.isEqualsSameValueZero(d,f);default:return t.isObject(d)?typeof f=="string"?f==="":!0:r.isEqualsSameValueZero(d,f)}}function s(d,f,h,p){if(f==null)return!0;if(Array.isArray(f))return c(d,f,h,p);if(f instanceof Map)return o(d,f,h,p);if(f instanceof Set)return u(d,f,h,p);const g=Object.keys(f);if(d==null||n.isPrimitive(d))return g.length===0;if(g.length===0)return!0;if(p!=null&&p.has(f))return p.get(f)===d;p==null||p.set(f,d);try{for(let y=0;y<g.length;y++){const x=g[y];if(!n.isPrimitive(d)&&!(x in d)||f[x]===void 0&&d[x]!==void 0||f[x]===null&&d[x]!==null||!h(d[x],f[x],x,d,f,p))return!1}return!0}finally{p==null||p.delete(f)}}function o(d,f,h,p){if(f.size===0)return!0;if(!(d instanceof Map))return!1;for(const[g,y]of f.entries()){const x=d.get(g);if(h(x,y,g,d,f,p)===!1)return!1}return!0}function c(d,f,h,p){if(f.length===0)return!0;if(!Array.isArray(d))return!1;const g=new Set;for(let y=0;y<f.length;y++){const x=f[y];let v=!1;for(let b=0;b<d.length;b++){if(g.has(b))continue;const w=d[b];let S=!1;if(h(w,x,y,d,f,p)&&(S=!0),S){g.add(b),v=!0;break}}if(!v)return!1}return!0}function u(d,f,h,p){return f.size===0?!0:d instanceof Set?c([...d],[...f],h,p):!1}e.isMatchWith=i,e.isSetMatch=u})(BM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=BM;function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(_1);var UM={},L1={},VM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(VM);var Zm={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(Zm);var R1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",s="[object Symbol]",o="[object Date]",c="[object Map]",u="[object Set]",d="[object Array]",f="[object Function]",h="[object ArrayBuffer]",p="[object Object]",g="[object Error]",y="[object DataView]",x="[object Uint8Array]",v="[object Uint8ClampedArray]",b="[object Uint16Array]",w="[object Uint32Array]",S="[object BigUint64Array]",k="[object Int8Array]",j="[object Int16Array]",N="[object Int32Array]",P="[object BigInt64Array]",T="[object Float32Array]",E="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=h,e.arrayTag=d,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=S,e.booleanTag=i,e.dataViewTag=y,e.dateTag=o,e.errorTag=g,e.float32ArrayTag=T,e.float64ArrayTag=E,e.functionTag=f,e.int16ArrayTag=j,e.int32ArrayTag=N,e.int8ArrayTag=k,e.mapTag=c,e.numberTag=r,e.objectTag=p,e.regexpTag=t,e.setTag=u,e.stringTag=n,e.symbolTag=s,e.uint16ArrayTag=b,e.uint32ArrayTag=w,e.uint8ArrayTag=x,e.uint8ClampedArrayTag=v})(R1);var WM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(WM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VM,n=Zm,r=R1,i=M1,a=WM;function s(d,f){return o(d,void 0,d,new Map,f)}function o(d,f,h,p=new Map,g=void 0){const y=g==null?void 0:g(d,f,h,p);if(y!==void 0)return y;if(i.isPrimitive(d))return d;if(p.has(d))return p.get(d);if(Array.isArray(d)){const x=new Array(d.length);p.set(d,x);for(let v=0;v<d.length;v++)x[v]=o(d[v],v,h,p,g);return Object.hasOwn(d,"index")&&(x.index=d.index),Object.hasOwn(d,"input")&&(x.input=d.input),x}if(d instanceof Date)return new Date(d.getTime());if(d instanceof RegExp){const x=new RegExp(d.source,d.flags);return x.lastIndex=d.lastIndex,x}if(d instanceof Map){const x=new Map;p.set(d,x);for(const[v,b]of d)x.set(v,o(b,v,h,p,g));return x}if(d instanceof Set){const x=new Set;p.set(d,x);for(const v of d)x.add(o(v,void 0,h,p,g));return x}if(typeof Buffer<"u"&&Buffer.isBuffer(d))return d.subarray();if(a.isTypedArray(d)){const x=new(Object.getPrototypeOf(d)).constructor(d.length);p.set(d,x);for(let v=0;v<d.length;v++)x[v]=o(d[v],v,h,p,g);return x}if(d instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&d instanceof SharedArrayBuffer)return d.slice(0);if(d instanceof DataView){const x=new DataView(d.buffer.slice(0),d.byteOffset,d.byteLength);return p.set(d,x),c(x,d,h,p,g),x}if(typeof File<"u"&&d instanceof File){const x=new File([d],d.name,{type:d.type});return p.set(d,x),c(x,d,h,p,g),x}if(typeof Blob<"u"&&d instanceof Blob){const x=new Blob([d],{type:d.type});return p.set(d,x),c(x,d,h,p,g),x}if(d instanceof Error){const x=structuredClone(d);return p.set(d,x),x.message=d.message,x.name=d.name,x.stack=d.stack,x.cause=d.cause,x.constructor=d.constructor,c(x,d,h,p,g),x}if(d instanceof Boolean){const x=new Boolean(d.valueOf());return p.set(d,x),c(x,d,h,p,g),x}if(d instanceof Number){const x=new Number(d.valueOf());return p.set(d,x),c(x,d,h,p,g),x}if(d instanceof String){const x=new String(d.valueOf());return p.set(d,x),c(x,d,h,p,g),x}if(typeof d=="object"&&u(d)){const x=Object.create(Object.getPrototypeOf(d));return p.set(d,x),c(x,d,h,p,g),x}return d}function c(d,f,h=d,p,g){const y=[...Object.keys(f),...t.getSymbols(f)];for(let x=0;x<y.length;x++){const v=y[x],b=Object.getOwnPropertyDescriptor(d,v);(b==null||b.writable)&&(d[v]=o(f[v],v,h,p,g))}}function u(d){switch(n.getTag(d)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=s,e.cloneDeepWithImpl=o,e.copyProperties=c})(L1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=L1;function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(UM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_1,n=UM;function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})($M);var HM={},KM={},qM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=L1,n=Zm,r=R1;function i(a,s){return t.cloneDeepWith(a,(o,c,u,d)=>{const f=s==null?void 0:s(o,c,u,d);if(f!==void 0)return f;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const h={};return d.set(a,h),t.copyProperties(h,a,u,d),h}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const h=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(h,a),h}case r.argumentsTag:{const h={};return t.copyProperties(h,a),h.length=a.length,h[Symbol.iterator]=a[Symbol.iterator],h}default:return}}})}e.cloneDeepWith=i})(qM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qM;function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(KM);var GM={},F1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(F1);var YM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zm;function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(YM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=E1,n=F1,r=YM,i=Ym;function a(s,o){let c;if(Array.isArray(o)?c=o:typeof o=="string"&&t.isDeepKey(o)&&(s==null?void 0:s[o])==null?c=i.toPath(o):c=[o],c.length===0)return!1;let u=s;for(let d=0;d<c.length;d++){const f=c[d];if((u==null||!Object.hasOwn(u,f))&&!((Array.isArray(u)||r.isArguments(u))&&n.isIndex(f)&&f<u.length))return!1;u=u[f]}return!0}e.has=a})(GM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_1,n=Gm,r=KM,i=qm,a=GM;function s(o,c){switch(typeof o){case"object":{Object.is(o==null?void 0:o.valueOf(),-0)&&(o="-0");break}case"number":{o=n.toKey(o);break}}return c=r.cloneDeep(c),function(u){const d=i.get(u,o);return d===void 0?a.has(u,o):c===void 0?d===void 0:t.isMatch(d,c)}}e.matchesProperty=s})(HM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=T1,n=zM,r=$M,i=HM;function a(s){if(s==null)return t.identity;switch(typeof s){case"function":return s;case"object":return Array.isArray(s)&&s.length===2?i.matchesProperty(s[0],s[1]):r.matches(s);case"string":case"symbol":case"number":return n.property(s)}}e.iteratee=a})(FM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DM,n=MM,r=T1,i=IM,a=FM;function s(o,c=r.identity){return i.isArrayLikeObject(o)?t.uniqBy(Array.from(o),n.ary(a.iteratee(c),1)):[]}e.uniqBy=s})(_M);var Tte=_M.uniqBy;const WC=fi(Tte);function XM(e,t,n){return t===!0?WC(e,n):typeof t=="function"?WC(e,t):e}var ZM={exports:{}},QM={},JM={exports:{}},eI={};/**
|
|
701
|
+
* @license React
|
|
702
|
+
* use-sync-external-store-shim.production.js
|
|
703
|
+
*
|
|
704
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
705
|
+
*
|
|
706
|
+
* This source code is licensed under the MIT license found in the
|
|
707
|
+
* LICENSE file in the root directory of this source tree.
|
|
708
|
+
*/var $l=m;function Ote(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _te=typeof Object.is=="function"?Object.is:Ote,Dte=$l.useState,Mte=$l.useEffect,Ite=$l.useLayoutEffect,Lte=$l.useDebugValue;function Rte(e,t){var n=t(),r=Dte({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return Ite(function(){i.value=n,i.getSnapshot=t,ay(i)&&a({inst:i})},[e,n,t]),Mte(function(){return ay(i)&&a({inst:i}),e(function(){ay(i)&&a({inst:i})})},[e]),Lte(n),n}function ay(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_te(e,n)}catch{return!0}}function Fte(e,t){return t()}var zte=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Fte:Rte;eI.useSyncExternalStore=$l.useSyncExternalStore!==void 0?$l.useSyncExternalStore:zte;JM.exports=eI;var $te=JM.exports;/**
|
|
709
|
+
* @license React
|
|
710
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
711
|
+
*
|
|
712
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
713
|
+
*
|
|
714
|
+
* This source code is licensed under the MIT license found in the
|
|
715
|
+
* LICENSE file in the root directory of this source tree.
|
|
716
|
+
*/var Qm=m,Bte=$te;function Ute(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vte=typeof Object.is=="function"?Object.is:Ute,Wte=Bte.useSyncExternalStore,Hte=Qm.useRef,Kte=Qm.useEffect,qte=Qm.useMemo,Gte=Qm.useDebugValue;QM.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=Hte(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=qte(function(){function c(p){if(!u){if(u=!0,d=p,p=r(p),i!==void 0&&s.hasValue){var g=s.value;if(i(g,p))return f=g}return f=p}if(g=f,Vte(d,p))return g;var y=r(p);return i!==void 0&&i(g,y)?(d=p,g):(d=p,f=y)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var o=Wte(e,a[0],a[1]);return Kte(function(){s.hasValue=!0,s.value=o},[o]),Gte(o),o};ZM.exports=QM;var Yte=ZM.exports,z1=m.createContext(null),Xte=e=>e,Ut=()=>{var e=m.useContext(z1);return e?e.store.dispatch:Xte},vh=()=>{},Zte=()=>vh,Qte=(e,t)=>e===t;function De(e){var t=m.useContext(z1),n=m.useMemo(()=>t?r=>{if(r!=null)return e(r)}:vh,[t,e]);return Yte.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Zte,t?t.store.getState:vh,t?t.store.getState:vh,n,Qte)}function Jte(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ene(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function tne(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var HC=e=>Array.isArray(e)?e:[e];function nne(e){const t=Array.isArray(e[0])?e[0]:e;return tne(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function rne(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var ine=class{constructor(e){this.value=e}deref(){return this.value}},ane=typeof WeakRef<"u"?WeakRef:ine,sne=0,KC=1;function Lf(){return{s:sne,v:void 0,o:null,p:null}}function tI(e,t={}){let n=Lf();const{resultEqualityCheck:r}=t;let i,a=0;function s(){var f;let o=n;const{length:c}=arguments;for(let h=0,p=c;h<p;h++){const g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=o.o;y===null&&(o.o=y=new WeakMap);const x=y.get(g);x===void 0?(o=Lf(),y.set(g,o)):o=x}else{let y=o.p;y===null&&(o.p=y=new Map);const x=y.get(g);x===void 0?(o=Lf(),y.set(g,o)):o=x}}const u=o;let d;if(o.s===KC)d=o.v;else if(d=e.apply(null,arguments),a++,r){const h=((f=i==null?void 0:i.deref)==null?void 0:f.call(i))??i;h!=null&&r(h,d)&&(d=h,a!==0&&a--),i=typeof d=="object"&&d!==null||typeof d=="function"?new ane(d):d}return u.s=KC,u.v=d,d}return s.clearCache=()=>{n=Lf(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function one(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,s=0,o,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),Jte(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:f,memoizeOptions:h=[],argsMemoize:p=tI,argsMemoizeOptions:g=[]}=d,y=HC(h),x=HC(g),v=nne(i),b=f(function(){return a++,u.apply(null,arguments)},...y),w=p(function(){s++;const k=rne(v,arguments);return o=b.apply(null,k),o},...x);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:v,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>o,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var q=one(tI),lne=Object.assign((e,t=q)=>{ene(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((s,o,c)=>(s[n[c]]=o,s),{}))},{withTypes:()=>lne}),nI={},rI={},iI={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const s=t(r),o=t(i);if(s===o&&s===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?o-s:s-o}return 0};e.compareValues=n})(iI);var aI={},$1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})($1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$1,n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,s){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||s!=null&&Object.hasOwn(s,a)}e.isKey=i})(aI);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iI,n=aI,r=Ym;function i(a,s,o,c){if(a==null)return[];o=c?void 0:o,Array.isArray(a)||(a=Object.values(a)),Array.isArray(s)||(s=s==null?[null]:[s]),s.length===0&&(s=[null]),Array.isArray(o)||(o=o==null?[]:[o]),o=o.map(p=>String(p));const u=(p,g)=>{let y=p;for(let x=0;x<g.length&&y!=null;++x)y=y[g[x]];return y},d=(p,g)=>g==null||p==null?g:typeof p=="object"&&"key"in p?Object.hasOwn(g,p.key)?g[p.key]:u(g,p.path):typeof p=="function"?p(g):Array.isArray(p)?u(g,p):typeof g=="object"?g[p]:g,f=s.map(p=>(Array.isArray(p)&&p.length===1&&(p=p[0]),p==null||typeof p=="function"||Array.isArray(p)||n.isKey(p)?p:{key:p,path:r.toPath(p)}));return a.map(p=>({original:p,criteria:f.map(g=>d(g,p))})).slice().sort((p,g)=>{for(let y=0;y<f.length;y++){const x=t.compareValues(p.criteria[y],g.criteria[y],o[y]);if(x!==0)return x}return 0}).map(p=>p.original)}e.orderBy=i})(rI);var sI={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),s=(o,c)=>{for(let u=0;u<o.length;u++){const d=o[u];Array.isArray(d)&&c<a?s(d,c+1):i.push(d)}};return s(n,0),i}e.flatten=t})(sI);var B1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F1,n=O1,r=D1,i=I1;function a(s,o,c){return r.isObject(c)&&(typeof o=="number"&&n.isArrayLike(c)&&t.isIndex(o)&&o<c.length||typeof o=="string"&&o in c)?i.isEqualsSameValueZero(c[o],s):!1}e.isIterateeCall=a})(B1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rI,n=sI,r=B1;function i(a,...s){const o=s.length;return o>1&&r.isIterateeCall(a,s[0],s[1])?s=[]:o>2&&r.isIterateeCall(s[0],s[1],s[2])&&(s=[s[0]]),t.orderBy(a,n.flatten(s),["asc"])}e.sortBy=i})(nI);var cne=nI.sortBy;const Jm=fi(cne);var oI=e=>e.legend.settings,une=e=>e.legend.size,dne=e=>e.legend.payload,fne=q([dne,oI],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Jm(r,n):r});function hne(){return De(fne)}var Rf=1;function lI(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=m.useState({height:0,left:0,top:0,width:0}),r=m.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),s={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(s.height-t.height)>Rf||Math.abs(s.left-t.left)>Rf||Math.abs(s.top-t.top)>Rf||Math.abs(s.width-t.width)>Rf)&&n({height:s.height,left:s.left,top:s.top,width:s.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function mn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var pne=typeof Symbol=="function"&&Symbol.observable||"@@observable",qC=pne,sy=()=>Math.random().toString(36).substring(7).split("").join("."),mne={INIT:`@@redux/INIT${sy()}`,REPLACE:`@@redux/REPLACE${sy()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${sy()}`},xp=mne;function U1(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function cI(e,t,n){if(typeof e!="function")throw new Error(mn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(mn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(mn(1));return n(cI)(e,t)}let r=e,i=t,a=new Map,s=a,o=0,c=!1;function u(){s===a&&(s=new Map,a.forEach((x,v)=>{s.set(v,x)}))}function d(){if(c)throw new Error(mn(3));return i}function f(x){if(typeof x!="function")throw new Error(mn(4));if(c)throw new Error(mn(5));let v=!0;u();const b=o++;return s.set(b,x),function(){if(v){if(c)throw new Error(mn(6));v=!1,u(),s.delete(b),a=null}}}function h(x){if(!U1(x))throw new Error(mn(7));if(typeof x.type>"u")throw new Error(mn(8));if(typeof x.type!="string")throw new Error(mn(17));if(c)throw new Error(mn(9));try{c=!0,i=r(i,x)}finally{c=!1}return(a=s).forEach(b=>{b()}),x}function p(x){if(typeof x!="function")throw new Error(mn(10));r=x,h({type:xp.REPLACE})}function g(){const x=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(mn(11));function b(){const S=v;S.next&&S.next(d())}return b(),{unsubscribe:x(b)}},[qC](){return this}}}return h({type:xp.INIT}),{dispatch:h,subscribe:f,getState:d,replaceReducer:p,[qC]:g}}function gne(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:xp.INIT})>"u")throw new Error(mn(12));if(typeof n(void 0,{type:xp.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(mn(13))})}function uI(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const s=t[a];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{gne(n)}catch(a){i=a}return function(s={},o){if(i)throw i;let c=!1;const u={};for(let d=0;d<r.length;d++){const f=r[d],h=n[f],p=s[f],g=h(p,o);if(typeof g>"u")throw o&&o.type,new Error(mn(14));u[f]=g,c=c||g!==p}return c=c||r.length!==Object.keys(s).length,c?u:s}}function vp(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function yne(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(mn(15))};const s={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},o=e.map(c=>c(s));return a=vp(...o)(i.dispatch),{...i,dispatch:a}}}function dI(e){return U1(e)&&"type"in e&&typeof e.type=="string"}var fI=Symbol.for("immer-nothing"),GC=Symbol.for("immer-draftable"),qn=Symbol.for("immer-state");function ei(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pr=Object,Bl=pr.getPrototypeOf,bp="constructor",eg="prototype",gv="configurable",wp="enumerable",bh="writable",ed="value",fa=e=>!!e&&!!e[qn];function di(e){var t;return e?hI(e)||ng(e)||!!e[GC]||!!((t=e[bp])!=null&&t[GC])||rg(e)||ig(e):!1}var xne=pr[eg][bp].toString(),YC=new WeakMap;function hI(e){if(!e||!V1(e))return!1;const t=Bl(e);if(t===null||t===pr[eg])return!0;const n=pr.hasOwnProperty.call(t,bp)&&t[bp];if(n===Object)return!0;if(!qo(n))return!1;let r=YC.get(n);return r===void 0&&(r=Function.toString.call(n),YC.set(n,r)),r===xne}function tg(e,t,n=!0){Id(e)===0?(n?Reflect.ownKeys(e):pr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Id(e){const t=e[qn];return t?t.type_:ng(e)?1:rg(e)?2:ig(e)?3:0}var XC=(e,t,n=Id(e))=>n===2?e.has(t):pr[eg].hasOwnProperty.call(e,t),yv=(e,t,n=Id(e))=>n===2?e.get(t):e[t],Sp=(e,t,n,r=Id(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function vne(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ng=Array.isArray,rg=e=>e instanceof Map,ig=e=>e instanceof Set,V1=e=>typeof e=="object",qo=e=>typeof e=="function",oy=e=>typeof e=="boolean";function bne(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ki=e=>e.copy_||e.base_,W1=e=>e.modified_?e.copy_:e.base_;function xv(e,t){if(rg(e))return new Map(e);if(ig(e))return new Set(e);if(ng(e))return Array[eg].slice.call(e);const n=hI(e);if(t===!0||t==="class_only"&&!n){const r=pr.getOwnPropertyDescriptors(e);delete r[qn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],o=r[s];o[bh]===!1&&(o[bh]=!0,o[gv]=!0),(o.get||o.set)&&(r[s]={[gv]:!0,[bh]:!0,[wp]:o[wp],[ed]:e[s]})}return pr.create(Bl(e),r)}else{const r=Bl(e);if(r!==null&&n)return{...e};const i=pr.create(r);return pr.assign(i,e)}}function H1(e,t=!1){return ag(e)||fa(e)||!di(e)||(Id(e)>1&&pr.defineProperties(e,{set:Ff,add:Ff,clear:Ff,delete:Ff}),pr.freeze(e),t&&tg(e,(n,r)=>{H1(r,!0)},!1)),e}function wne(){ei(2)}var Ff={[ed]:wne};function ag(e){return e===null||!V1(e)?!0:pr.isFrozen(e)}var kp="MapSet",vv="Patches",ZC="ArrayMethods",pI={};function vo(e){const t=pI[e];return t||ei(0,e),t}var QC=e=>!!pI[e],td,mI=()=>td,Sne=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:QC(kp)?vo(kp):void 0,arrayMethodsPlugin_:QC(ZC)?vo(ZC):void 0});function JC(e,t){t&&(e.patchPlugin_=vo(vv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function bv(e){wv(e),e.drafts_.forEach(kne),e.drafts_=null}function wv(e){e===td&&(td=e.parent_)}var eP=e=>td=Sne(td,e);function kne(e){const t=e[qn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[qn].modified_&&(bv(t),ei(4)),di(e)&&(e=nP(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[qn].base_,e,t)}else e=nP(t,n);return jne(t,e,!0),bv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fI?e:void 0}function nP(e,t){if(ag(t))return t;const n=t[qn];if(!n)return jp(t,e.handledSet_,e);if(!sg(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);xI(n,e)}return n.copy_}function jne(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&H1(t,n)}function gI(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var sg=(e,t)=>e.scope_===t,Nne=[];function yI(e,t,n,r){const i=Ki(e),a=e.type_;if(r!==void 0&&yv(i,r,a)===t){Sp(i,r,n,a);return}if(!e.draftLocations_){const o=e.draftLocations_=new Map;tg(i,(c,u)=>{if(fa(u)){const d=o.get(u)||[];d.push(c),o.set(u,d)}})}const s=e.draftLocations_.get(t)??Nne;for(const o of s)Sp(i,o,n,a)}function Cne(e,t,n){e.callbacks_.push(function(i){var o;const a=t;if(!a||!sg(a,i))return;(o=i.mapSetPlugin_)==null||o.fixSetContents(a);const s=W1(a);yI(e,a.draft_??a,s,n),xI(a,i)})}function xI(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}gI(e)}}function Pne(e,t,n){const{scope_:r}=e;if(fa(n)){const i=n[qn];sg(i,r)&&i.callbacks_.push(function(){wh(e);const s=W1(i);yI(e,n,s,t)})}else di(n)&&e.callbacks_.push(function(){const a=Ki(e);e.type_===3?a.has(n)&&jp(n,r.handledSet_,r):yv(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&jp(yv(e.copy_,t,e.type_),r.handledSet_,r)})}function jp(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||fa(e)||t.has(e)||!di(e)||ag(e)||(t.add(e),tg(e,(r,i)=>{if(fa(i)){const a=i[qn];if(sg(a,n)){const s=W1(a);Sp(e,r,s,e.type_),gI(a)}}else di(i)&&jp(i,t,n)})),e}function Ene(e,t){const n=ng(e),r={type_:n?1:0,scope_:t?t.scope_:mI(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Np;n&&(i=[r],a=nd);const{revoke:s,proxy:o}=Proxy.revocable(i,a);return r.draft_=o,r.revoke_=s,[o,r]}var Np={get(e,t){if(t===qn)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Ki(e);if(!XC(i,t,e.type_))return Ane(e,i,t);const a=i[t];if(e.finalized_||!di(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&bne(t))return a;if(a===ly(e.base_,t)){wh(e);const s=e.type_===1?+t:t,o=kv(e.scope_,a,e,s);return e.copy_[s]=o}return a},has(e,t){return t in Ki(e)},ownKeys(e){return Reflect.ownKeys(Ki(e))},set(e,t,n){const r=vI(Ki(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ly(Ki(e),t),a=i==null?void 0:i[qn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(vne(n,i)&&(n!==void 0||XC(e.base_,t,e.type_)))return!0;wh(e),Sv(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Pne(e,t,n)),!0},deleteProperty(e,t){return wh(e),ly(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Sv(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ki(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[bh]:!0,[gv]:e.type_!==1||t!=="length",[wp]:r[wp],[ed]:n[t]}},defineProperty(){ei(11)},getPrototypeOf(e){return Bl(e.base_)},setPrototypeOf(){ei(12)}},nd={};for(let e in Np){let t=Np[e];nd[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}nd.deleteProperty=function(e,t){return nd.set.call(this,e,t,void 0)};nd.set=function(e,t,n){return Np.set.call(this,e[0],t,n,e[0])};function ly(e,t){const n=e[qn];return(n?Ki(n):e)[t]}function Ane(e,t,n){var i;const r=vI(t,n);return r?ed in r?r[ed]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function vI(e,t){if(!(t in e))return;let n=Bl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Bl(n)}}function Sv(e){e.modified_||(e.modified_=!0,e.parent_&&Sv(e.parent_))}function wh(e){e.copy_||(e.assigned_=new Map,e.copy_=xv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Tne=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(qo(n)&&!qo(r)){const s=r;r=n;const o=this;return function(u=s,...d){return o.produce(u,f=>r.call(this,f,...d))}}qo(r)||ei(6),i!==void 0&&!qo(i)&&ei(7);let a;if(di(n)){const s=eP(this),o=kv(s,n,void 0);let c=!0;try{a=r(o),c=!1}finally{c?bv(s):wv(s)}return JC(s,i),tP(a,s)}else if(!n||!V1(n)){if(a=r(n),a===void 0&&(a=n),a===fI&&(a=void 0),this.autoFreeze_&&H1(a,!0),i){const s=[],o=[];vo(vv).generateReplacementPatches_(n,a,{patches_:s,inversePatches_:o}),i(s,o)}return a}else ei(1,n)},this.produceWithPatches=(n,r)=>{if(qo(n))return(o,...c)=>this.produceWithPatches(o,u=>n(u,...c));let i,a;return[this.produce(n,r,(o,c)=>{i=o,a=c}),i,a]},oy(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),oy(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),oy(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){di(t)||ei(8),fa(t)&&(t=zr(t));const n=eP(this),r=kv(n,t,void 0);return r[qn].isManual_=!0,wv(n),r}finishDraft(t,n){const r=t&&t[qn];(!r||!r.isManual_)&&ei(9);const{scope_:i}=r;return JC(i,n),tP(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=vo(vv).applyPatches_;return fa(t)?i(t,n):this.produce(t,a=>i(a,n))}};function kv(e,t,n,r){const[i,a]=rg(t)?vo(kp).proxyMap_(t,n):ig(t)?vo(kp).proxySet_(t,n):Ene(t,n);return((n==null?void 0:n.scope_)??mI()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?Cne(n,a,r):a.callbacks_.push(function(c){var d;(d=c.mapSetPlugin_)==null||d.fixSetContents(a);const{patchPlugin_:u}=c;a.modified_&&u&&u.generatePatches_(a,[],c)}),i}function zr(e){return fa(e)||ei(10,e),bI(e)}function bI(e){if(!di(e)||ag(e))return e;const t=e[qn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=xv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=xv(e,!0);return tg(n,(i,a)=>{Sp(n,i,bI(a))},r),t&&(t.finalized_=!1),n}var One=new Tne,wI=One.produce;function SI(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var _ne=SI(),Dne=SI,Mne=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?vp:vp.apply(null,arguments)};function kr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(xr(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>dI(r)&&r.type===e,n}var kI=class eu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,eu.prototype)}static get[Symbol.species](){return eu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new eu(...t[0].concat(this)):new eu(...t.concat(this))}};function rP(e){return di(e)?wI(e,()=>{}):e}function zf(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Ine(e){return typeof e=="boolean"}var Lne=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let s=new kI;return n&&(Ine(n)?s.push(_ne):s.push(Dne(n.extraArgument))),s},jI="RTK_autoBatch",kt=()=>e=>({payload:e,meta:{[jI]:!0}}),iP=e=>t=>{setTimeout(t,e)},NI=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,s=!1;const o=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:iP(10):e.type==="callback"?e.queueNotification:iP(e.timeout),u=()=>{s=!1,a&&(a=!1,o.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const f=()=>i&&d(),h=r.subscribe(f);return o.add(d),()=>{h(),o.delete(d)}},dispatch(d){var f;try{return i=!((f=d==null?void 0:d.meta)!=null&&f[jI]),a=!i,a&&(s||(s=!0,c(u))),r.dispatch(d)}finally{i=!0}}})},Rne=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new kI(e);return r&&i.push(NI(typeof r=="object"?r:void 0)),i};function Fne(e){const t=Lne(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let o;if(typeof n=="function")o=n;else if(U1(n))o=uI(n);else throw new Error(xr(1));let c;typeof r=="function"?c=r(t):c=t();let u=vp;i&&(u=Mne({trace:!1,...typeof i=="object"&&i}));const d=yne(...c),f=Rne(d);let h=typeof s=="function"?s(f):f();const p=u(...h);return cI(o,a,p)}function CI(e){const t={},n=[];let r;const i={addCase(a,s){const o=typeof a=="string"?a:a.type;if(!o)throw new Error(xr(28));if(o in t)throw new Error(xr(29));return t[o]=s,i},addAsyncThunk(a,s){return s.pending&&(t[a.pending.type]=s.pending),s.rejected&&(t[a.rejected.type]=s.rejected),s.fulfilled&&(t[a.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:a.settled,reducer:s.settled}),i},addMatcher(a,s){return n.push({matcher:a,reducer:s}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function zne(e){return typeof e=="function"}function $ne(e,t){let[n,r,i]=CI(t),a;if(zne(e))a=()=>rP(e());else{const o=rP(e);a=()=>o}function s(o=a(),c){let u=[n[c.type],...r.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return u.filter(d=>!!d).length===0&&(u=[i]),u.reduce((d,f)=>{if(f)if(fa(d)){const p=f(d,c);return p===void 0?d:p}else{if(di(d))return wI(d,h=>f(h,c));{const h=f(d,c);if(h===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return d},o)}return s.getInitialState=a,s}var Bne="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Une=(e=21)=>{let t="",n=e;for(;n--;)t+=Bne[Math.random()*64|0];return t},Vne=Symbol.for("rtk-slice-createasyncthunk");function Wne(e,t){return`${e}/${t}`}function Hne({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[Vne];return function(i){const{name:a,reducerPath:s=a}=i;if(!a)throw new Error(xr(11));const o=(typeof i.reducers=="function"?i.reducers(qne()):i.reducers)||{},c=Object.keys(o),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(S,k){const j=typeof S=="string"?S:S.type;if(!j)throw new Error(xr(12));if(j in u.sliceCaseReducersByType)throw new Error(xr(13));return u.sliceCaseReducersByType[j]=k,d},addMatcher(S,k){return u.sliceMatchers.push({matcher:S,reducer:k}),d},exposeAction(S,k){return u.actionCreators[S]=k,d},exposeCaseReducer(S,k){return u.sliceCaseReducersByName[S]=k,d}};c.forEach(S=>{const k=o[S],j={reducerName:S,type:Wne(a,S),createNotation:typeof i.reducers=="function"};Yne(k)?Zne(j,k,d,t):Gne(j,k,d)});function f(){const[S={},k=[],j=void 0]=typeof i.extraReducers=="function"?CI(i.extraReducers):[i.extraReducers],N={...S,...u.sliceCaseReducersByType};return $ne(i.initialState,P=>{for(let T in N)P.addCase(T,N[T]);for(let T of u.sliceMatchers)P.addMatcher(T.matcher,T.reducer);for(let T of k)P.addMatcher(T.matcher,T.reducer);j&&P.addDefaultCase(j)})}const h=S=>S,p=new Map,g=new WeakMap;let y;function x(S,k){return y||(y=f()),y(S,k)}function v(){return y||(y=f()),y.getInitialState()}function b(S,k=!1){function j(P){let T=P[S];return typeof T>"u"&&k&&(T=zf(g,j,v)),T}function N(P=h){const T=zf(p,k,()=>new WeakMap);return zf(T,P,()=>{const E={};for(const[_,C]of Object.entries(i.selectors??{}))E[_]=Kne(C,P,()=>zf(g,P,v),k);return E})}return{reducerPath:S,getSelectors:N,get selectors(){return N(j)},selectSlice:j}}const w={name:a,reducer:x,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:v,...b(s),injectInto(S,{reducerPath:k,...j}={}){const N=k??s;return S.inject({reducerPath:N,reducer:x},j),{...w,...b(N,!0)}}};return w}}function Kne(e,t,n,r){function i(a,...s){let o=t(a);return typeof o>"u"&&r&&(o=n()),e(o,...s)}return i.unwrapped=e,i}var $n=Hne();function qne(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Gne({type:e,reducerName:t,createNotation:n},r,i){let a,s;if("reducer"in r){if(n&&!Xne(r))throw new Error(xr(17));a=r.reducer,s=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?kr(e,s):kr(e))}function Yne(e){return e._reducerDefinitionType==="asyncThunk"}function Xne(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Zne({type:e,reducerName:t},n,r,i){if(!i)throw new Error(xr(18));const{payloadCreator:a,fulfilled:s,pending:o,rejected:c,settled:u,options:d}=n,f=i(e,a,d);r.exposeAction(t,f),s&&r.addCase(f.fulfilled,s),o&&r.addCase(f.pending,o),c&&r.addCase(f.rejected,c),u&&r.addMatcher(f.settled,u),r.exposeCaseReducer(t,{fulfilled:s||$f,pending:o||$f,rejected:c||$f,settled:u||$f})}function $f(){}var Qne="task",PI="listener",EI="completed",K1="cancelled",Jne=`task-${K1}`,ere=`task-${EI}`,jv=`${PI}-${K1}`,tre=`${PI}-${EI}`,og=class{constructor(e){Bg(this,"name","TaskAbortError");Bg(this,"message");this.code=e,this.message=`${Qne} ${K1} (reason: ${e})`}},q1=(e,t)=>{if(typeof e!="function")throw new TypeError(xr(32))},Cp=()=>{},AI=(e,t=Cp)=>(e.catch(t),e),TI=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ro=e=>{if(e.aborted)throw new og(e.reason)};function OI(e,t){let n=Cp;return new Promise((r,i)=>{const a=()=>i(new og(e.reason));if(e.aborted){a();return}n=TI(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Cp})}var nre=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof og?"cancelled":"rejected",error:n}}finally{t==null||t()}},Pp=e=>t=>AI(OI(e,t).then(n=>(ro(e),n))),_I=e=>{const t=Pp(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Sl}=Object,aP={},lg="listenerMiddleware",rre=(e,t)=>{const n=r=>TI(e,()=>r.abort(e.reason));return(r,i)=>{q1(r);const a=new AbortController;n(a);const s=nre(async()=>{ro(e),ro(a.signal);const o=await r({pause:Pp(a.signal),delay:_I(a.signal),signal:a.signal});return ro(a.signal),o},()=>a.abort(ere));return i!=null&&i.autoJoin&&t.push(s.catch(Cp)),{result:Pp(e)(s),cancel(){a.abort(Jne)}}}},ire=(e,t)=>{const n=async(r,i)=>{ro(t);let a=()=>{};const o=[new Promise((c,u)=>{let d=e({predicate:r,effect:(f,h)=>{h.unsubscribe(),c([f,h.getState(),h.getOriginalState()])}});a=()=>{d(),u()}})];i!=null&&o.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await OI(t,Promise.race(o));return ro(t),c}finally{a()}};return(r,i)=>AI(n(r,i))},DI=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=kr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(xr(21));return q1(a),{predicate:i,type:t,effect:a}},MI=Sl(e=>{const{type:t,predicate:n,effect:r}=DI(e);return{id:Une(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(xr(22))}}},{withTypes:()=>MI}),sP=(e,t)=>{const{type:n,effect:r,predicate:i}=DI(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Nv=e=>{e.pending.forEach(t=>{t.abort(jv)})},are=(e,t)=>()=>{for(const n of t.keys())Nv(n);e.clear()},oP=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},II=Sl(kr(`${lg}/add`),{withTypes:()=>II}),sre=kr(`${lg}/removeAll`),LI=Sl(kr(`${lg}/remove`),{withTypes:()=>LI}),ore=(...e)=>{console.error(`${lg}/error`,...e)},Ld=(e={})=>{const t=new Map,n=new Map,r=p=>{const g=n.get(p)??0;n.set(p,g+1)},i=p=>{const g=n.get(p)??1;g===1?n.delete(p):n.set(p,g-1)},{extra:a,onError:s=ore}=e;q1(s);const o=p=>(p.unsubscribe=()=>t.delete(p.id),t.set(p.id,p),g=>{p.unsubscribe(),g!=null&&g.cancelActive&&Nv(p)}),c=p=>{const g=sP(t,p)??MI(p);return o(g)};Sl(c,{withTypes:()=>c});const u=p=>{const g=sP(t,p);return g&&(g.unsubscribe(),p.cancelActive&&Nv(g)),!!g};Sl(u,{withTypes:()=>u});const d=async(p,g,y,x)=>{const v=new AbortController,b=ire(c,v.signal),w=[];try{p.pending.add(v),r(p),await Promise.resolve(p.effect(g,Sl({},y,{getOriginalState:x,condition:(S,k)=>b(S,k).then(Boolean),take:b,delay:_I(v.signal),pause:Pp(v.signal),extra:a,signal:v.signal,fork:rre(v.signal,w),unsubscribe:p.unsubscribe,subscribe:()=>{t.set(p.id,p)},cancelActiveListeners:()=>{p.pending.forEach((S,k,j)=>{S!==v&&(S.abort(jv),j.delete(S))})},cancel:()=>{v.abort(jv),p.pending.delete(v)},throwIfCancelled:()=>{ro(v.signal)}})))}catch(S){S instanceof og||oP(s,S,{raisedBy:"effect"})}finally{await Promise.all(w),v.abort(tre),i(p),p.pending.delete(v)}},f=are(t,n);return{middleware:p=>g=>y=>{if(!dI(y))return g(y);if(II.match(y))return c(y.payload);if(sre.match(y)){f();return}if(LI.match(y))return u(y.payload);let x=p.getState();const v=()=>{if(x===aP)throw new Error(xr(23));return x};let b;try{if(b=g(y),t.size>0){const w=p.getState(),S=Array.from(t.values());for(const k of S){let j=!1;try{j=k.predicate(y,w,x)}catch(N){j=!1,oP(s,N,{raisedBy:"predicate"})}j&&d(k,y,p,v)}}}finally{x=aP}return b},startListening:c,stopListening:u,clearListeners:f}};function xr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var lre={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},RI=$n({name:"chartLayout",initialState:lre,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:cre,setLayout:ure,setChartSize:dre,setScale:fre}=RI.actions,hre=RI.reducer;function FI(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Xe(e){return Number.isFinite(e)}function Li(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function lP(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 dl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lP(Object(n),!0).forEach(function(r){pre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pre(e,t,n){return(t=mre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mre(e){var t=gre(e,"string");return typeof t=="symbol"?t:t+""}function gre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sn(e,t,n){return jn(e)||jn(t)?n:Ii(t)?Xm(e,t,n):typeof t=="function"?t(e):n}var yre=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:s,layout:o}=t;if((o==="vertical"||o==="horizontal"&&s==="middle")&&a!=="center"&&Oe(e[a]))return dl(dl({},e),{},{[a]:e[a]+(r||0)});if((o==="horizontal"||o==="vertical"&&a==="center")&&s!=="middle"&&Oe(e[s]))return dl(dl({},e),{},{[s]:e[s]+(i||0)})}return e},Bi=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",zI=(e,t,n,r)=>{if(r)return e.map(o=>o.coordinate);var i,a,s=e.map(o=>(o.coordinate===t&&(i=!0),o.coordinate===n&&(a=!0),o.coordinate));return i||s.push(t),a||s.push(n),s},$I=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:s,realScaleType:o,isCategorical:c,categoricalDomain:u,tickCount:d,ticks:f,niceTicks:h,axisType:p}=e;if(!s)return null;var g=o==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,y=i==="category"&&s.bandwidth?s.bandwidth()/g:0;if(y=p==="angleAxis"&&a&&a.length>=2?Fr(a[0]-a[1])*2*y:y,f||h){var x=(f||h||[]).map((v,b)=>{var w=r?r.indexOf(v):v,S=s.map(w);return Xe(S)?{coordinate:S+y,value:v,offset:y,index:b}:null}).filter(tr);return x}return c&&u?u.map((v,b)=>{var w=s.map(v);return Xe(w)?{coordinate:w+y,value:v,index:b,offset:y}:null}).filter(tr):s.ticks&&d!=null?s.ticks(d).map((v,b)=>{var w=s.map(v);return Xe(w)?{coordinate:w+y,value:v,index:b,offset:y}:null}).filter(tr):s.domain().map((v,b)=>{var w=s.map(v);return Xe(w)?{coordinate:w+y,value:r?r[v]:v,index:b,offset:y}:null}).filter(tr)},xre=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,s=0,o=0;o<n;++o){var c=e[o],u=c==null?void 0:c[i];if(u!=null){var d=u[1],f=u[0],h=Mi(d)?f:d;h>=0?(u[0]=a,a+=h,u[1]=a):(u[0]=s,s+=h,u[1]=s)}}}},vre=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,s=0;s<n;++s){var o=e[s],c=o==null?void 0:o[i];if(c!=null){var u=Mi(c[1])?c[0]:c[1];u>=0?(c[0]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},bre={sign:xre,expand:tte,none:yo,silhouette:nte,wiggle:rte,positive:vre},wre=(e,t,n)=>{var r,i=(r=bre[n])!==null&&r!==void 0?r:yo,a=ete().keys(t).value((o,c)=>Number(Sn(o,c,0))).order(pv).offset(i),s=a(e);return s.forEach((o,c)=>{o.forEach((u,d)=>{var f=Sn(e[d],t[c],0);Array.isArray(f)&&f.length===2&&Oe(f[0])&&Oe(f[1])&&(u[0]=f[0],u[1]=f[1])})}),s};function Sre(e){return e==null?void 0:String(e)}function cP(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:s}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!jn(i[t.dataKey])){var o=CM(n,"value",i[t.dataKey]);if(o)return o.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=Sn(i,jn(s)?t.dataKey:s),u=t.scale.map(c);return Oe(u)?u:null}var kre=e=>{var t=e.flat(2).filter(Oe);return[Math.min(...t),Math.max(...t)]},jre=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Nre=(e,t,n)=>{if(e!=null)return jre(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:s}=a,o=s.reduce((c,u)=>{var d=FI(u,t,n),f=kre(d);return!Xe(f[0])||!Xe(f[1])?c:[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},uP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ep=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Jm(t,d=>d.coordinate),a=1/0,s=1,o=i.length;s<o;s++){var c=i[s],u=i[s-1];a=Math.min(((c==null?void 0:c.coordinate)||0)-((u==null?void 0:u.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function fP(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return dl(dl({},t),{},{dataKey:n,payload:r,value:i,name:a})}function BI(e,t){if(e)return String(e);if(typeof t=="string")return t}var Cre=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Pre=(e,t)=>t==="centric"?e.angle:e.radius,Sa=e=>e.layout.width,ka=e=>e.layout.height,Ere=e=>e.layout.scale,UI=e=>e.layout.margin,cg=q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),ug=q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Are="data-recharts-item-index",Tre="data-recharts-item-id",Rd=60;function hP(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 Bf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hP(Object(n),!0).forEach(function(r){Ore(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ore(e,t,n){return(t=_re(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _re(e){var t=Dre(e,"string");return typeof t=="symbol"?t:t+""}function Dre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mre=e=>e.brush.height;function Ire(e){var t=ug(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Rd;return n+i}return n},0)}function Lre(e){var t=ug(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Rd;return n+i}return n},0)}function Rre(e){var t=cg(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Fre(e){var t=cg(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Nn=q([Sa,ka,UI,Mre,Ire,Lre,Rre,Fre,oI,une],(e,t,n,r,i,a,s,o,c,u)=>{var d={left:(n.left||0)+i,right:(n.right||0)+a},f={top:(n.top||0)+s,bottom:(n.bottom||0)+o},h=Bf(Bf({},f),d),p=h.bottom;h.bottom+=r,h=yre(h,c,u);var g=e-h.left-h.right,y=t-h.top-h.bottom;return Bf(Bf({brushBottom:p},h),{},{width:Math.max(g,0),height:Math.max(y,0)})}),zre=q(Nn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),VI=q(Sa,ka,(e,t)=>({x:0,y:0,width:e,height:t})),$re=m.createContext(null),lr=()=>m.useContext($re)!=null,dg=e=>e.brush,fg=q([dg,Nn,UI],(e,t,n)=>({height:e.height,x:Oe(e.x)?e.x:t.left,y:Oe(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Oe(e.width)?e.width:t.width})),WI={},HI={},KI={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let s,o=null;const c=a!=null&&a.includes("leading"),u=a==null||a.includes("trailing"),d=()=>{o!==null&&(n.apply(s,o),s=void 0,o=null)},f=()=>{u&&d(),y()};let h=null;const p=()=>{h!=null&&clearTimeout(h),h=setTimeout(()=>{h=null,f()},r)},g=()=>{h!==null&&(clearTimeout(h),h=null)},y=()=>{g(),s=void 0,o=null},x=()=>{d()},v=function(...b){if(i!=null&&i.aborted)return;s=this,o=b;const w=h==null;p(),c&&w&&d()};return v.schedule=p,v.cancel=y,v.flush=x,i==null||i.addEventListener("abort",y,{once:!0}),v}e.debounce=t})(KI);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KI;function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:s=!1,trailing:o=!0,maxWait:c}=a,u=Array(2);s&&(u[0]="leading"),o&&(u[1]="trailing");let d,f=null;const h=t.debounce(function(...y){d=r.apply(this,y),f=null},i,{edges:u}),p=function(...y){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(d=r.apply(this,y),f=Date.now(),h.cancel(),h.schedule(),d):(h.apply(this,y),d)},g=()=>(h.flush(),d);return p.cancel=h.cancel,p.flush=g,p}e.debounce=n})(HI);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=HI;function n(r,i=0,a={}){const{leading:s=!0,trailing:o=!0}=a;return t.debounce(r,i,{leading:s,maxWait:i,trailing:o})}e.throttle=n})(WI);var Bre=WI.throttle;const Ure=fi(Bre);var Ap=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];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(n.replace(/%s/g,()=>i[s++]))}},Ni={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},qI=(e,t,n)=>{var{width:r=Ni.width,height:i=Ni.height,aspect:a,maxHeight:s}=n,o=xo(r)?e:Number(r),c=xo(i)?t:Number(i);return a&&a>0&&(o?c=o/a:c&&(o=c*a),s&&c!=null&&c>s&&(c=s)),{calculatedWidth:o,calculatedHeight:c}},Vre={width:0,height:0,overflow:"visible"},Wre={width:0,overflowX:"visible"},Hre={height:0,overflowY:"visible"},Kre={},qre=e=>{var{width:t,height:n}=e,r=xo(t),i=xo(n);return r&&i?Vre:r?Wre:i?Hre:Kre};function Gre(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Ni.width,a=Ni.height):i===void 0?i=r&&r>0?void 0:Ni.width:a===void 0&&(a=r&&r>0?void 0:Ni.height),{width:i,height:a}}function Cv(){return Cv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cv.apply(null,arguments)}function pP(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 mP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pP(Object(n),!0).forEach(function(r){Yre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yre(e,t,n){return(t=Xre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xre(e){var t=Zre(e,"string");return typeof t=="symbol"?t:t+""}function Zre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var GI=m.createContext(Ni.initialDimension);function Qre(e){return Li(e.width)&&Li(e.height)}function YI(e){var{children:t,width:n,height:r}=e,i=m.useMemo(()=>({width:n,height:r}),[n,r]);return Qre(i)?m.createElement(GI.Provider,{value:i},t):null}var G1=()=>m.useContext(GI),Jre=m.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ni.initialDimension,width:i,height:a,minWidth:s=Ni.minWidth,minHeight:o,maxHeight:c,children:u,debounce:d=Ni.debounce,id:f,className:h,onResize:p,style:g={}}=e,y=m.useRef(null),x=m.useRef();x.current=p,m.useImperativeHandle(t,()=>y.current);var[v,b]=m.useState({containerWidth:r.width,containerHeight:r.height}),w=m.useCallback((P,T)=>{b(E=>{var _=Math.round(P),C=Math.round(T);return E.containerWidth===_&&E.containerHeight===C?E:{containerWidth:_,containerHeight:C}})},[]);m.useEffect(()=>{if(y.current==null||typeof ResizeObserver>"u")return Ao;var P=C=>{var A,M=C[0];if(M!=null){var{width:B,height:ae}=M.contentRect;w(B,ae),(A=x.current)===null||A===void 0||A.call(x,B,ae)}};d>0&&(P=Ure(P,d,{trailing:!0,leading:!1}));var T=new ResizeObserver(P),{width:E,height:_}=y.current.getBoundingClientRect();return w(E,_),T.observe(y.current),()=>{T.disconnect()}},[w,d]);var{containerWidth:S,containerHeight:k}=v;Ap(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:j,calculatedHeight:N}=qI(S,k,{width:i,height:a,aspect:n,maxHeight:c});return Ap(j!=null&&j>0||N!=null&&N>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
717
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
718
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
719
|
+
height and width.`,j,N,i,a,s,o,n),m.createElement("div",{id:f?"".concat(f):void 0,className:ct("recharts-responsive-container",h),style:mP(mP({},g),{},{width:i,height:a,minWidth:s,minHeight:o,maxHeight:c}),ref:y},m.createElement("div",{style:qre({width:i,height:a})},m.createElement(YI,{width:j,height:N},u)))}),Y1=m.forwardRef((e,t)=>{var n=G1();if(Li(n.width)&&Li(n.height))return e.children;var{width:r,height:i}=Gre({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:s}=qI(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Oe(a)&&Oe(s)?m.createElement(YI,{width:a,height:s},e.children):m.createElement(Jre,Cv({},e,{width:r,height:i,ref:t}))});function X1(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var hg=()=>{var e,t=lr(),n=De(zre),r=De(fg),i=(e=De(dg))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},eie={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},XI=()=>{var e;return(e=De(Nn))!==null&&e!==void 0?e:eie},Z1=()=>De(Sa),Q1=()=>De(ka),tie=()=>De(e=>e.layout.margin),_t=e=>e.layout.layoutType,ic=()=>De(_t),J1=()=>{var e=ic();if(e==="horizontal"||e==="vertical")return e},ZI=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},nie=()=>{var e=ic();return e!==void 0},Fd=e=>{var t=Ut(),n=lr(),{width:r,height:i}=e,a=G1(),s=r,o=i;return a&&(s=a.width>0?a.width:r,o=a.height>0?a.height:i),m.useEffect(()=>{!n&&Li(s)&&Li(o)&&t(dre({width:s,height:o}))},[t,n,s,o]),null},QI=Symbol.for("immer-nothing"),gP=Symbol.for("immer-draftable"),jr=Symbol.for("immer-state");function ti(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var rd=Object.getPrototypeOf;function Ul(e){return!!e&&!!e[jr]}function bo(e){var t;return e?JI(e)||Array.isArray(e)||!!e[gP]||!!((t=e.constructor)!=null&&t[gP])||zd(e)||mg(e):!1}var rie=Object.prototype.constructor.toString(),yP=new WeakMap;function JI(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=yP.get(n);return r===void 0&&(r=Function.toString.call(n),yP.set(n,r)),r===rie}function Tp(e,t,n=!0){pg(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function pg(e){const t=e[jr];return t?t.type_:Array.isArray(e)?1:zd(e)?2:mg(e)?3:0}function Pv(e,t){return pg(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function e3(e,t,n){const r=pg(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function iie(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function zd(e){return e instanceof Map}function mg(e){return e instanceof Set}function Fs(e){return e.copy_||e.base_}function Ev(e,t){if(zd(e))return new Map(e);if(mg(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=JI(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[jr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],o=r[s];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[s]})}return Object.create(rd(e),r)}else{const r=rd(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function eS(e,t=!1){return gg(e)||Ul(e)||!bo(e)||(pg(e)>1&&Object.defineProperties(e,{set:Uf,add:Uf,clear:Uf,delete:Uf}),Object.freeze(e),t&&Object.values(e).forEach(n=>eS(n,!0))),e}function aie(){ti(2)}var Uf={value:aie};function gg(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var sie={};function wo(e){const t=sie[e];return t||ti(0,e),t}var id;function t3(){return id}function oie(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function xP(e,t){t&&(wo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Av(e){Tv(e),e.drafts_.forEach(lie),e.drafts_=null}function Tv(e){e===id&&(id=e.parent_)}function vP(e){return id=oie(id,e)}function lie(e){const t=e[jr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[jr].modified_&&(Av(t),ti(4)),bo(e)&&(e=Op(t,e),t.parent_||_p(t,e)),t.patches_&&wo("Patches").generateReplacementPatches_(n[jr].base_,e,t.patches_,t.inversePatches_)):e=Op(t,n,[]),Av(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==QI?e:void 0}function Op(e,t,n){if(gg(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[jr];if(!i)return Tp(t,(a,s)=>wP(e,i,t,a,s,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return _p(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let s=a,o=!1;i.type_===3&&(s=new Set(a),a.clear(),o=!0),Tp(s,(c,u)=>wP(e,i,a,c,u,n,o),r),_p(e,a,!1),n&&e.patches_&&wo("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function wP(e,t,n,r,i,a,s){if(i==null||typeof i!="object"&&!s)return;const o=gg(i);if(!(o&&!s)){if(Ul(i)){const c=a&&t&&t.type_!==3&&!Pv(t.assigned_,r)?a.concat(r):void 0,u=Op(e,i,c);if(e3(n,r,u),Ul(u))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(bo(i)&&!o){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&o)return;Op(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(zd(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&_p(e,i)}}}function _p(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&eS(t,n)}function cie(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:t3(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=tS;n&&(i=[r],a=ad);const{revoke:s,proxy:o}=Proxy.revocable(i,a);return r.draft_=o,r.revoke_=s,o}var tS={get(e,t){if(t===jr)return e;const n=Fs(e);if(!Pv(n,t))return uie(e,n,t);const r=n[t];return e.finalized_||!bo(r)?r:r===cy(e.base_,t)?(uy(e),e.copy_[t]=_v(r,e)):r},has(e,t){return t in Fs(e)},ownKeys(e){return Reflect.ownKeys(Fs(e))},set(e,t,n){const r=n3(Fs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=cy(Fs(e),t),a=i==null?void 0:i[jr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(iie(n,i)&&(n!==void 0||Pv(e.base_,t)))return!0;uy(e),Ov(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cy(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,uy(e),Ov(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Fs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ti(11)},getPrototypeOf(e){return rd(e.base_)},setPrototypeOf(){ti(12)}},ad={};Tp(tS,(e,t)=>{ad[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ad.deleteProperty=function(e,t){return ad.set.call(this,e,t,void 0)};ad.set=function(e,t,n){return tS.set.call(this,e[0],t,n,e[0])};function cy(e,t){const n=e[jr];return(n?Fs(n):e)[t]}function uie(e,t,n){var i;const r=n3(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function n3(e,t){if(!(t in e))return;let n=rd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=rd(n)}}function Ov(e){e.modified_||(e.modified_=!0,e.parent_&&Ov(e.parent_))}function uy(e){e.copy_||(e.copy_=Ev(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var die=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const s=this;return function(c=a,...u){return s.produce(c,d=>n.call(this,d,...u))}}typeof n!="function"&&ti(6),r!==void 0&&typeof r!="function"&&ti(7);let i;if(bo(t)){const a=vP(this),s=_v(t,void 0);let o=!0;try{i=n(s),o=!1}finally{o?Av(a):Tv(a)}return xP(a,r),bP(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===QI&&(i=void 0),this.autoFreeze_&&eS(i,!0),r){const a=[],s=[];wo("Patches").generateReplacementPatches_(t,i,a,s),r(a,s)}return i}else ti(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...o)=>this.produceWithPatches(s,c=>t(c,...o));let r,i;return[this.produce(t,n,(s,o)=>{r=s,i=o}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){bo(e)||ti(8),Ul(e)&&(e=fie(e));const t=vP(this),n=_v(e,void 0);return n[jr].isManual_=!0,Tv(t),n}finishDraft(e,t){const n=e&&e[jr];(!n||!n.isManual_)&&ti(9);const{scope_:r}=n;return xP(r,t),bP(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=wo("Patches").applyPatches_;return Ul(e)?r(e,t):this.produce(e,i=>r(i,t))}};function _v(e,t){const n=zd(e)?wo("MapSet").proxyMap_(e,t):mg(e)?wo("MapSet").proxySet_(e,t):cie(e,t);return(t?t.scope_:t3()).drafts_.push(n),n}function fie(e){return Ul(e)||ti(10,e),r3(e)}function r3(e){if(!bo(e)||gg(e))return e;const t=e[jr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ev(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Ev(e,!0);return Tp(n,(i,a)=>{e3(n,i,r3(a))},r),t&&(t.finalized_=!1),n}var hie=new die;hie.produce;var pie={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},i3=$n({name:"legend",initialState:pie,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:kt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=zr(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:kt()},removeLegendPayload:{reducer(e,t){var n=zr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:kt()}}}),{setLegendSize:SP,setLegendSettings:mie,addLegendPayload:gie,replaceLegendPayload:yie,removeLegendPayload:xie}=i3.actions,vie=i3.reducer,bie={};/**
|
|
720
|
+
* @license React
|
|
721
|
+
* use-sync-external-store-with-selector.production.js
|
|
722
|
+
*
|
|
723
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
724
|
+
*
|
|
725
|
+
* This source code is licensed under the MIT license found in the
|
|
726
|
+
* LICENSE file in the root directory of this source tree.
|
|
727
|
+
*/var $d=m;function wie(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Sie=typeof Object.is=="function"?Object.is:wie,kie=$d.useSyncExternalStore,jie=$d.useRef,Nie=$d.useEffect,Cie=$d.useMemo,Pie=$d.useDebugValue;bie.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=jie(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=Cie(function(){function c(p){if(!u){if(u=!0,d=p,p=r(p),i!==void 0&&s.hasValue){var g=s.value;if(i(g,p))return f=g}return f=p}if(g=f,Sie(d,p))return g;var y=r(p);return i!==void 0&&i(g,y)?(d=p,g):(d=p,f=y)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var o=kie(e,a[0],a[1]);return Nie(function(){s.hasValue=!0,s.value=o},[o]),Pie(o),o};function Eie(e){e()}function Aie(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Eie(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var kP={notify(){},get:()=>[]};function Tie(e,t){let n,r=kP,i=0,a=!1;function s(y){d();const x=r.subscribe(y);let v=!1;return()=>{v||(v=!0,x(),f())}}function o(){r.notify()}function c(){g.onStateChange&&g.onStateChange()}function u(){return a}function d(){i++,n||(n=e.subscribe(c),r=Aie())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=kP)}function h(){a||(a=!0,d())}function p(){a&&(a=!1,f())}const g={addNestedSub:s,notifyNestedSubs:o,handleChangeWrapper:c,isSubscribed:u,trySubscribe:h,tryUnsubscribe:p,getListeners:()=>r};return g}var Oie=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_ie=Oie(),Die=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Mie=Die(),Iie=()=>_ie||Mie?m.useLayoutEffect:m.useEffect,Lie=Iie();function jP(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Rie(e,t){if(jP(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!jP(e[n[i]],t[n[i]]))return!1;return!0}var dy=Symbol.for("react-redux-context"),fy=typeof globalThis<"u"?globalThis:{};function Fie(){if(!m.createContext)return{};const e=fy[dy]??(fy[dy]=new Map);let t=e.get(m.createContext);return t||(t=m.createContext(null),e.set(m.createContext,t)),t}var zie=Fie();function $ie(e){const{children:t,context:n,serverState:r,store:i}=e,a=m.useMemo(()=>{const c=Tie(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),s=m.useMemo(()=>i.getState(),[i]);Lie(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,s]);const o=n||zie;return m.createElement(o.Provider,{value:a},t)}var Bie=$ie,Uie=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Vie(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Bd(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Uie.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Rie(e[r],t[r]))return!1}else if(!Vie(e[r],t[r]))return!1;return!0}var Wie=["contextPayload"];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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dv.apply(null,arguments)}function NP(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 Vl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NP(Object(n),!0).forEach(function(r){Hie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hie(e,t,n){return(t=Kie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kie(e){var t=qie(e,"string");return typeof t=="symbol"?t:t+""}function qie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gie(e,t){if(e==null)return{};var n,r,i=Yie(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yie(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 Xie(e){return e.value}function Zie(e){var{contextPayload:t}=e,n=Gie(e,Wie),r=XM(t,e.payloadUniqBy,Xie),i=Vl(Vl({},n),{},{payload:r});return m.isValidElement(e.content)?m.cloneElement(e.content,i):typeof e.content=="function"?m.createElement(e.content,i):m.createElement(Ate,i)}function Qie(e,t,n,r,i,a){var{layout:s,align:o,verticalAlign:c}=t,u,d;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(o==="center"&&s==="vertical"?u={left:((r||0)-a.width)/2}:u=o==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(c==="middle"?d={top:((i||0)-a.height)/2}:d=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Vl(Vl({},u),d)}function Jie(e){var t=Ut();return m.useEffect(()=>{t(mie(e))},[t,e]),null}function eae(e){var t=Ut();return m.useEffect(()=>(t(SP(e)),()=>{t(SP({width:0,height:0}))}),[t,e]),null}function tae(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var nae={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function rae(e){var t=or(e,nae),n=hne(),r=jee(),i=tie(),{width:a,height:s,wrapperStyle:o,portal:c}=t,[u,d]=lI([n]),f=Z1(),h=Q1();if(f==null||h==null)return null;var p=f-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),g=tae(t.layout,s,a,p),y=c?o:Vl(Vl({position:"absolute",width:(g==null?void 0:g.width)||a||"auto",height:(g==null?void 0:g.height)||s||"auto"},Qie(o,t,i,f,h,u)),o),x=c??r;if(x==null||n==null)return null;var v=m.createElement("div",{className:"recharts-legend-wrapper",style:y,ref:d},m.createElement(Jie,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&m.createElement(eae,{width:u.width,height:u.height}),m.createElement(Zie,Dv({},t,g,{margin:i,chartWidth:f,chartHeight:h,contextPayload:n})));return Co.createPortal(v,x)}var yg=m.memo(rae,Bd);yg.displayName="Legend";function Mv(){return Mv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mv.apply(null,arguments)}function CP(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 Ic(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CP(Object(n),!0).forEach(function(r){iae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iae(e,t,n){return(t=aae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aae(e){var t=sae(e,"string");return typeof t=="symbol"?t:t+""}function sae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oae(e){return Array.isArray(e)&&Ii(e[0])&&Ii(e[1])?e.join(" ~ "):e}var Fo={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function lae(e,t){return t==null?e:Jm(e,t)}var cae=e=>{var{separator:t=Fo.separator,contentStyle:n,itemStyle:r,labelStyle:i=Fo.labelStyle,payload:a,formatter:s,itemSorter:o,wrapperClassName:c,labelClassName:u,label:d,labelFormatter:f,accessibilityLayer:h=Fo.accessibilityLayer}=e,p=()=>{if(a&&a.length){var k={padding:0,margin:0},j=lae(a,o),N=j.map((P,T)=>{if(P.type==="none")return null;var E=P.formatter||s||oae,{value:_,name:C}=P,A=_,M=C;if(E){var B=E(_,C,P,T,a);if(Array.isArray(B))[A,M]=B;else if(B!=null)A=B;else return null}var ae=Ic(Ic({},Fo.itemStyle),{},{color:P.color||Fo.itemStyle.color},r);return m.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(T),style:ae},Ii(M)?m.createElement("span",{className:"recharts-tooltip-item-name"},M):null,Ii(M)?m.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,m.createElement("span",{className:"recharts-tooltip-item-value"},A),m.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return m.createElement("ul",{className:"recharts-tooltip-item-list",style:k},N)}return null},g=Ic(Ic({},Fo.contentStyle),n),y=Ic({margin:0},i),x=!jn(d),v=x?d:"",b=ct("recharts-default-tooltip",c),w=ct("recharts-tooltip-label",u);x&&f&&a!==void 0&&a!==null&&(v=f(d,a));var S=h?{role:"status","aria-live":"assertive"}:{};return m.createElement("div",Mv({className:b,style:g},S),m.createElement("p",{className:w,style:y},m.isValidElement(v)?v:"".concat(v)),p())},Lc="recharts-tooltip-wrapper",uae={visibility:"hidden"};function dae(e){var{coordinate:t,translateX:n,translateY:r}=e;return ct(Lc,{["".concat(Lc,"-right")]:Oe(n)&&t&&Oe(t.x)&&n>=t.x,["".concat(Lc,"-left")]:Oe(n)&&t&&Oe(t.x)&&n<t.x,["".concat(Lc,"-bottom")]:Oe(r)&&t&&Oe(t.y)&&r>=t.y,["".concat(Lc,"-top")]:Oe(r)&&t&&Oe(t.y)&&r<t.y})}function PP(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:s,tooltipDimension:o,viewBox:c,viewBoxDimension:u}=e;if(a&&Oe(a[r]))return a[r];var d=n[r]-o-(i>0?i:0),f=n[r]+i;if(t[r])return s[r]?d:f;var h=c[r];if(h==null)return 0;if(s[r]){var p=d,g=h;return p<g?Math.max(f,h):Math.max(d,h)}if(u==null)return 0;var y=f+o,x=h+u;return y>x?Math.max(d,h):Math.max(f,h)}function fae(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function hae(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:s,tooltipBox:o,useTranslate3d:c,viewBox:u}=e,d,f,h;return o.height>0&&o.width>0&&n?(f=PP({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:s,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),h=PP({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:s,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=fae({translateX:f,translateY:h,useTranslate3d:c})):d=uae,{cssProperties:d,cssClasses:dae({translateX:f,translateY:h,coordinate:n})}}var pae=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Ud={isSsr:pae()};function a3(){var[e,t]=m.useState(()=>Ud.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return m.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function EP(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 zo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EP(Object(n),!0).forEach(function(r){mae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mae(e,t,n){return(t=gae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gae(e){var t=yae(e,"string");return typeof t=="symbol"?t:t+""}function yae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xae(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function vae(e){var t,n,r,i,a,s,o=a3(),[c,u]=m.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));m.useEffect(()=>{var g=y=>{if(y.key==="Escape"){var x,v,b,w;u({dismissed:!0,dismissedAtCoordinate:{x:(x=(v=e.coordinate)===null||v===void 0?void 0:v.x)!==null&&x!==void 0?x:0,y:(b=(w=e.coordinate)===null||w===void 0?void 0:w.y)!==null&&b!==void 0?b:0}})}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),c.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==c.dismissedAtCoordinate.x||((a=(s=e.coordinate)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0)!==c.dismissedAtCoordinate.y)&&u(zo(zo({},c),{},{dismissed:!1}));var{cssClasses:d,cssProperties:f}=hae({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),h=e.hasPortalFromProps?{}:zo(zo({transition:xae({prefersReducedMotion:o,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},f),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),p=zo(zo({},h),{},{visibility:!c.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return m.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:d,style:p,ref:e.innerRef},e.children)}var bae=m.memo(vae),s3=()=>{var e;return(e=De(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iv.apply(null,arguments)}function AP(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?AP(Object(n),!0).forEach(function(r){wae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wae(e,t,n){return(t=Sae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sae(e){var t=kae(e,"string");return typeof t=="symbol"?t:t+""}function kae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var OP={curveBasisClosed:Vee,curveBasisOpen:Wee,curveBasis:Uee,curveBumpX:Eee,curveBumpY:Aee,curveLinearClosed:Hee,curveLinear:Hm,curveMonotoneX:Kee,curveMonotoneY:qee,curveNatural:Gee,curveStep:Yee,curveStepAfter:Zee,curveStepBefore:Xee},Dp=e=>Xe(e.x)&&Xe(e.y),_P=e=>e.base!=null&&Dp(e.base)&&Dp(e),Rc=e=>e.x,Fc=e=>e.y,jae=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Md(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=OP["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return OP[n]||Hm},DP={connectNulls:!1,type:"linear"},Nae=e=>{var{type:t=DP.type,points:n=[],baseLine:r,layout:i,connectNulls:a=DP.connectNulls}=e,s=jae(t,i),o=a?n.filter(Dp):n;if(Array.isArray(r)){var c,u=n.map((g,y)=>TP(TP({},g),{},{base:r[y]}));i==="vertical"?c=If().y(Fc).x1(Rc).x0(g=>g.base.x):c=If().x(Rc).y1(Fc).y0(g=>g.base.y);var d=c.defined(_P).curve(s),f=a?u.filter(_P):u;return d(f)}var h;i==="vertical"&&Oe(r)?h=If().y(Fc).x1(Rc).x0(r):Oe(r)?h=If().x(Rc).y1(Fc).y0(r):h=fM().x(Rc).y(Fc);var p=h.defined(Dp).curve(s);return p(o)},Sh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=ic();if((!n||!n.length)&&!r)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},o=n&&n.length?Nae(s):r;return m.createElement("path",Iv({},ui(e),A1(e),{className:ct("recharts-curve",t),d:o===null?void 0:o,ref:i}))},Cae=["x","y","top","left","width","height","className"];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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lv.apply(null,arguments)}function MP(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 Pae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MP(Object(n),!0).forEach(function(r){Eae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eae(e,t,n){return(t=Aae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aae(e){var t=Tae(e,"string");return typeof t=="symbol"?t:t+""}function Tae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oae(e,t){if(e==null)return{};var n,r,i=_ae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _ae(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}var Dae=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Mae=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:s=0,className:o}=e,c=Oae(e,Cae),u=Pae({x:t,y:n,top:r,left:i,width:a,height:s},c);return!Oe(t)||!Oe(n)||!Oe(a)||!Oe(s)||!Oe(r)||!Oe(i)?null:m.createElement("path",Lv({},Sr(u),{className:ct("recharts-cross",o),d:Dae(t,n,a,s,r,i)}))};function Iae(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 IP(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 LP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IP(Object(n),!0).forEach(function(r){Lae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lae(e,t,n){return(t=Rae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rae(e){var t=Fae(e,"string");return typeof t=="symbol"?t:t+""}function Fae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zae=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),$ae=(e,t,n)=>e.map(r=>"".concat(zae(r)," ").concat(t,"ms ").concat(n)).join(","),Bae=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),sd=(e,t)=>Object.keys(t).reduce((n,r)=>LP(LP({},n),{},{[r]:e(r,t[r])}),{});function RP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RP(Object(n),!0).forEach(function(r){Uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uae(e,t,n){return(t=Vae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vae(e){var t=Wae(e,"string");return typeof t=="symbol"?t:t+""}function Wae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mp=(e,t,n)=>e+(t-e)*n,Rv=e=>{var{from:t,to:n}=e;return t!==n},o3=(e,t,n)=>{var r=sd((i,a)=>{if(Rv(a)){var[s,o]=e(a.from,a.to,a.velocity);return nn(nn({},a),{},{from:s,velocity:o})}return a},t);return n<1?sd((i,a)=>Rv(a)&&r[i]!=null?nn(nn({},a),{},{velocity:Mp(a.velocity,r[i].velocity,n),from:Mp(a.from,r[i].from,n)}):a,t):o3(e,r,n-1)};function Hae(e,t,n,r,i,a){var s,o=r.reduce((h,p)=>nn(nn({},h),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),c=()=>sd((h,p)=>p.from,o),u=()=>!Object.values(o).filter(Rv).length,d=null,f=h=>{s||(s=h);var p=h-s,g=p/n.dt;o=o3(n,o,g),i(nn(nn(nn({},e),t),c())),s=h,u()||(d=a.setTimeout(f))};return()=>(d=a.setTimeout(f),()=>{var h;(h=d)===null||h===void 0||h()})}function Kae(e,t,n,r,i,a,s){var o=null,c=i.reduce((f,h)=>{var p=e[h],g=t[h];return p==null||g==null?f:nn(nn({},f),{},{[h]:[p,g]})},{}),u,d=f=>{u||(u=f);var h=(f-u)/r,p=sd((y,x)=>Mp(...x,n(h)),c);if(a(nn(nn(nn({},e),t),p)),h<1)o=s.setTimeout(d);else{var g=sd((y,x)=>Mp(...x,n(1)),c);a(nn(nn(nn({},e),t),g))}};return()=>(o=s.setTimeout(d),()=>{var f;(f=o)===null||f===void 0||f()})}const qae=(e,t,n,r,i,a)=>{var s=Bae(e,t);return n==null?()=>(i(nn(nn({},e),t)),()=>{}):n.isStepper===!0?Hae(e,t,n,s,i,a):Kae(e,t,n,r,s,i,a)};var Ip=1e-4,l3=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],c3=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),FP=(e,t)=>n=>{var r=l3(e,t);return c3(r,n)},Gae=(e,t)=>n=>{var r=l3(e,t),i=[...r.map((a,s)=>a*s).slice(1),0];return c3(i,n)},Yae=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},Xae=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=Yae(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Zae=(e,t,n,r)=>{var i=FP(e,n),a=FP(t,r),s=Gae(e,n),o=u=>u>1?1:u<0?0:u,c=u=>{for(var d=u>1?1:u,f=d,h=0;h<8;++h){var p=i(f)-d,g=s(f);if(Math.abs(p-d)<Ip||g<Ip)return a(f);f=o(f-p/g)}return a(f)};return c.isStepper=!1,c},zP=function(){return Zae(...Xae(...arguments))},Qae=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(s,o,c)=>{var u=-(s-o)*n,d=c*r,f=c+(u-d)*i/1e3,h=c*i/1e3+s;return Math.abs(h-o)<Ip&&Math.abs(f)<Ip?[o,0]:[h,f]};return a.isStepper=!0,a.dt=i,a},Jae=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return zP(e);case"spring":return Qae();default:if(e.split("(")[0]==="cubic-bezier")return zP(e)}return typeof e=="function"?e:null};function ese(e){var t,n=()=>null,r=!1,i=null,a=s=>{if(!r){if(Array.isArray(s)){if(!s.length)return;var o=s,[c,...u]=o;if(typeof c=="number"){i=e.setTimeout(a.bind(null,u),c);return}a(c),i=e.setTimeout(a.bind(null,u));return}typeof s=="string"&&(t=s,n(t)),typeof s=="object"&&(t=s,n(t)),typeof s=="function"&&s()}};return{stop:()=>{r=!0},start:s=>{r=!1,i&&(i(),i=null),a(s)},subscribe:s=>(n=s,()=>{n=()=>null}),getTimeoutController:()=>e}}class tse{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=s=>{s-r>=n?t(s):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function nse(){return ese(new tse)}var rse=m.createContext(nse);function ise(e,t){var n=m.useContext(rse);return m.useMemo(()=>t??n(e),[e,t,n])}var ase={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},$P={t:0},hy={t:1};function u3(e){var t=or(e,ase),{isActive:n,canBegin:r,duration:i,easing:a,begin:s,onAnimationEnd:o,onAnimationStart:c,children:u}=t,d=a3(),f=n==="auto"?!Ud.isSsr&&!d:n,h=ise(t.animationId,t.animationManager),[p,g]=m.useState(f?$P:hy),y=m.useRef(null);return m.useEffect(()=>{f||g(hy)},[f]),m.useEffect(()=>{if(!f||!r)return Ao;var x=qae($P,hy,Jae(a),i,g,h.getTimeoutController()),v=()=>{y.current=x()};return h.start([c,s,v,i,o]),()=>{h.stop(),y.current&&y.current(),o()}},[f,r,i,a,s,c,o,h]),u(p.t)}function d3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=m.useRef(Ju(t)),r=m.useRef(e);return r.current!==e&&(n.current=Ju(t),r.current=e),n.current}var sse=["radius"],ose=["radius"],BP,UP,VP,WP,HP,KP,qP,GP,YP,XP;function ZP(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 QP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZP(Object(n),!0).forEach(function(r){lse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lse(e,t,n){return(t=cse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cse(e){var t=use(e,"string");return typeof t=="symbol"?t:t+""}function use(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lp(){return Lp=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},Lp.apply(null,arguments)}function JP(e,t){if(e==null)return{};var n,r,i=dse(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dse(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 yi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var eE=(e,t,n,r,i)=>{var a=Ya(n),s=Ya(r),o=Math.min(Math.abs(a)/2,Math.abs(s)/2),c=s>=0?1:-1,u=a>=0?1:-1,d=s>=0&&a>=0||s<0&&a<0?1:0,f;if(o>0&&Array.isArray(i)){for(var h=[0,0,0,0],p=0,g=4;p<g;p++){var y,x=(y=i[p])!==null&&y!==void 0?y:0;h[p]=x>o?o:x}f=xn(BP||(BP=yi(["M",",",""])),e,t+c*h[0]),h[0]>0&&(f+=xn(UP||(UP=yi(["A ",",",",0,0,",",",",",""])),h[0],h[0],d,e+u*h[0],t)),f+=xn(VP||(VP=yi(["L ",",",""])),e+n-u*h[1],t),h[1]>0&&(f+=xn(WP||(WP=yi(["A ",",",",0,0,",`,
|
|
728
|
+
`,",",""])),h[1],h[1],d,e+n,t+c*h[1])),f+=xn(HP||(HP=yi(["L ",",",""])),e+n,t+r-c*h[2]),h[2]>0&&(f+=xn(KP||(KP=yi(["A ",",",",0,0,",`,
|
|
729
|
+
`,",",""])),h[2],h[2],d,e+n-u*h[2],t+r)),f+=xn(qP||(qP=yi(["L ",",",""])),e+u*h[3],t+r),h[3]>0&&(f+=xn(GP||(GP=yi(["A ",",",",0,0,",`,
|
|
730
|
+
`,",",""])),h[3],h[3],d,e,t+r-c*h[3])),f+="Z"}else if(o>0&&i===+i&&i>0){var v=Math.min(o,i);f=xn(YP||(YP=yi(["M ",",",`
|
|
731
|
+
A `,",",",0,0,",",",",",`
|
|
732
|
+
L `,",",`
|
|
733
|
+
A `,",",",0,0,",",",",",`
|
|
734
|
+
L `,",",`
|
|
735
|
+
A `,",",",0,0,",",",",",`
|
|
736
|
+
L `,",",`
|
|
737
|
+
A `,",",",0,0,",",",","," Z"])),e,t+c*v,v,v,d,e+u*v,t,e+n-u*v,t,v,v,d,e+n,t+c*v,e+n,t+r-c*v,v,v,d,e+n-u*v,t+r,e+u*v,t+r,v,v,d,e,t+r-c*v)}else f=xn(XP||(XP=yi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return f},tE={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},fse=e=>{var t=or(e,tE),n=m.useRef(null),[r,i]=m.useState(-1);m.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var Q=n.current.getTotalLength();Q&&i(Q)}catch{}},[]);var{x:a,y:s,width:o,height:c,radius:u,className:d}=t,{animationEasing:f,animationDuration:h,animationBegin:p,isAnimationActive:g,isUpdateAnimationActive:y}=t,x=m.useRef(o),v=m.useRef(c),b=m.useRef(a),w=m.useRef(s),S=m.useMemo(()=>({x:a,y:s,width:o,height:c,radius:u}),[a,s,o,c,u]),k=d3(S,"rectangle-");if(a!==+a||s!==+s||o!==+o||c!==+c||o===0||c===0)return null;var j=ct("recharts-rectangle",d);if(!y){var N=Sr(t),{radius:P}=N,T=JP(N,sse);return m.createElement("path",Lp({},T,{x:Ya(a),y:Ya(s),width:Ya(o),height:Ya(c),radius:typeof u=="number"?u:void 0,className:j,d:eE(a,s,o,c,u)}))}var E=x.current,_=v.current,C=b.current,A=w.current,M="0px ".concat(r===-1?1:r,"px"),B="".concat(r,"px ").concat(r,"px"),ae=$ae(["strokeDasharray"],h,typeof f=="string"?f:tE.animationEasing);return m.createElement(u3,{animationId:k,key:k,canBegin:r>0,duration:h,easing:f,isActive:y,begin:p},Q=>{var I=ki(E,o,Q),H=ki(_,c,Q),O=ki(C,a,Q),oe=ki(A,s,Q);n.current&&(x.current=I,v.current=H,b.current=O,w.current=oe);var re;g?Q>0?re={transition:ae,strokeDasharray:B}:re={strokeDasharray:M}:re={strokeDasharray:B};var D=Sr(t),{radius:G}=D,te=JP(D,ose);return m.createElement("path",Lp({},te,{radius:typeof u=="number"?u:void 0,className:j,d:eE(O,oe,I,H,u),ref:n,style:QP(QP({},re),t.style)}))})};function nE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nE(Object(n),!0).forEach(function(r){hse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hse(e,t,n){return(t=pse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pse(e){var t=mse(e,"string");return typeof t=="symbol"?t:t+""}function mse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rp=Math.PI/180,gse=e=>e*180/Math.PI,bn=(e,t,n,r)=>({x:e+Math.cos(-Rp*r)*n,y:t+Math.sin(-Rp*r)*n}),yse=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},xse=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},vse=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,s=xse({x:n,y:r},{x:i,y:a});if(s<=0)return{radius:s,angle:0};var o=(n-i)/s,c=Math.acos(o);return r>a&&(c=2*Math.PI-c),{radius:s,angle:gse(c),angleInRadian:c}},bse=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},wse=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),s=Math.min(i,a);return e+s*360},Sse=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=vse({x:n,y:r},t),{innerRadius:s,outerRadius:o}=t;if(i<s||i>o||i===0)return null;var{startAngle:c,endAngle:u}=bse(t),d=a,f;if(c<=u){for(;d>u;)d-=360;for(;d<c;)d+=360;f=d>=c&&d<=u}else{for(;d>c;)d-=360;for(;d<u;)d+=360;f=d>=u&&d<=c}return f?rE(rE({},t),{},{radius:i,angle:wse(d,t)}):null};function f3(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,s=bn(t,n,r,i),o=bn(t,n,r,a);return{points:[s,o],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var iE,aE,sE,oE,lE,cE,uE;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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fv.apply(null,arguments)}function Ys(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var kse=(e,t)=>{var n=Fr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Vf=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:s,cornerRadius:o,cornerIsExternal:c}=e,u=o*(s?1:-1)+r,d=Math.asin(o/u)/Rp,f=c?i:i+a*d,h=bn(t,n,u,f),p=bn(t,n,r,f),g=c?i-a*d:i,y=bn(t,n,u*Math.cos(d*Rp),g);return{center:h,circleTangency:p,lineTangency:y,theta:d}},h3=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:s}=e,o=kse(a,s),c=a+o,u=bn(t,n,i,a),d=bn(t,n,i,c),f=xn(iE||(iE=Ys(["M ",",",`
|
|
738
|
+
A `,",",`,0,
|
|
739
|
+
`,",",`,
|
|
740
|
+
`,",",`
|
|
741
|
+
`])),u.x,u.y,i,i,+(Math.abs(o)>180),+(a>c),d.x,d.y);if(r>0){var h=bn(t,n,r,a),p=bn(t,n,r,c);f+=xn(aE||(aE=Ys(["L ",",",`
|
|
742
|
+
A `,",",`,0,
|
|
743
|
+
`,",",`,
|
|
744
|
+
`,","," Z"])),p.x,p.y,r,r,+(Math.abs(o)>180),+(a<=c),h.x,h.y)}else f+=xn(sE||(sE=Ys(["L ",","," Z"])),t,n);return f},jse=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:s,cornerIsExternal:o,startAngle:c,endAngle:u}=e,d=Fr(u-c),{circleTangency:f,lineTangency:h,theta:p}=Vf({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:o}),{circleTangency:g,lineTangency:y,theta:x}=Vf({cx:t,cy:n,radius:i,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:o}),v=o?Math.abs(c-u):Math.abs(c-u)-p-x;if(v<0)return s?xn(oE||(oE=Ys(["M ",",",`
|
|
745
|
+
a`,",",",0,0,1,",`,0
|
|
746
|
+
a`,",",",0,0,1,",`,0
|
|
747
|
+
`])),h.x,h.y,a,a,a*2,a,a,-a*2):h3({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var b=xn(lE||(lE=Ys(["M ",",",`
|
|
748
|
+
A`,",",",0,0,",",",",",`
|
|
749
|
+
A`,",",",0,",",",",",",",`
|
|
750
|
+
A`,",",",0,0,",",",",",`
|
|
751
|
+
`])),h.x,h.y,a,a,+(d<0),f.x,f.y,i,i,+(v>180),+(d<0),g.x,g.y,a,a,+(d<0),y.x,y.y);if(r>0){var{circleTangency:w,lineTangency:S,theta:k}=Vf({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:o}),{circleTangency:j,lineTangency:N,theta:P}=Vf({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:o}),T=o?Math.abs(c-u):Math.abs(c-u)-k-P;if(T<0&&a===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=xn(cE||(cE=Ys(["L",",",`
|
|
752
|
+
A`,",",",0,0,",",",",",`
|
|
753
|
+
A`,",",",0,",",",",",",",`
|
|
754
|
+
A`,",",",0,0,",",",",","Z"])),N.x,N.y,a,a,+(d<0),j.x,j.y,r,r,+(T>180),+(d>0),w.x,w.y,a,a,+(d<0),S.x,S.y)}else b+=xn(uE||(uE=Ys(["L",",","Z"])),t,n);return b},Nse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Cse=e=>{var t=or(e,Nse),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:s,forceCornerRadius:o,cornerIsExternal:c,startAngle:u,endAngle:d,className:f}=t;if(a<i||u===d)return null;var h=ct("recharts-sector",f),p=a-i,g=ps(s,p,0,!0),y;return g>0&&Math.abs(u-d)<360?y=jse({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,p/2),forceCornerRadius:o,cornerIsExternal:c,startAngle:u,endAngle:d}):y=h3({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d}),m.createElement("path",Fv({},Sr(t),{className:h,d:y}))};function Pse(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(AM(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:s,angle:o}=t,c=bn(r,i,a,o),u=bn(r,i,s,o);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return f3(t)}}var p3={},m3={},g3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$1;function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(g3);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=g3;function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(m3);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=B1,n=m3;function r(i,a,s){s&&typeof s!="number"&&t.isIterateeCall(i,a,s)&&(a=s=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),s=s===void 0?i<a?1:-1:n.toFinite(s);const o=Math.max(Math.ceil((a-i)/(s||1)),0),c=new Array(o);for(let u=0;u<o;u++)c[u]=i,i+=s;return c}e.range=r})(p3);var Ese=p3.range;const y3=fi(Ese);var ja=e=>e.chartData,x3=q([ja],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),v3=(e,t,n,r)=>r?x3(e):ja(e),Ase=(e,t,n)=>n?x3(e):ja(e);function Oi(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Xe(t)&&Xe(n))return!0}return!1}function dE(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function b3(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Xe(n))i=n;else if(typeof n=="function")return;if(Xe(r))a=r;else if(typeof r=="function")return;var s=[i,a];if(Oi(s))return s}}function Tse(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Oi(r))return dE(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,s,o;if(i==="auto")t!=null&&(s=Math.min(...t));else if(Oe(i))s=i;else if(typeof i=="function")try{t!=null&&(s=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&uP.test(i)){var c=uP.exec(i);if(c==null||c[1]==null||t==null)s=void 0;else{var u=+c[1];s=t[0]-u}}else s=t==null?void 0:t[0];if(a==="auto")t!=null&&(o=Math.max(...t));else if(Oe(a))o=a;else if(typeof a=="function")try{t!=null&&(o=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&dP.test(a)){var d=dP.exec(a);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[1]+f}}else o=t==null?void 0:t[1];var h=[s,o];if(Oi(h))return t==null?h:dE(h,t,n)}}}var ac=1e9,Ose={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},rS,Ot=!0,Hr="[DecimalError] ",io=Hr+"Invalid argument: ",nS=Hr+"Exponent out of range: ",sc=Math.floor,zs=Math.pow,_se=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fr,ln=1e7,jt=7,w3=9007199254740991,Fp=sc(w3/jt),Ae={};Ae.absoluteValue=Ae.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ae.comparedTo=Ae.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};Ae.decimalPlaces=Ae.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*jt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ae.dividedBy=Ae.div=function(e){return ia(this,new this.constructor(e))};Ae.dividedToIntegerBy=Ae.idiv=function(e){var t=this,n=t.constructor;return ft(ia(t,new n(e),0,1),n.precision)};Ae.equals=Ae.eq=function(e){return!this.cmp(e)};Ae.exponent=function(){return Qt(this)};Ae.greaterThan=Ae.gt=function(e){return this.cmp(e)>0};Ae.greaterThanOrEqualTo=Ae.gte=function(e){return this.cmp(e)>=0};Ae.isInteger=Ae.isint=function(){return this.e>this.d.length-2};Ae.isNegative=Ae.isneg=function(){return this.s<0};Ae.isPositive=Ae.ispos=function(){return this.s>0};Ae.isZero=function(){return this.s===0};Ae.lessThan=Ae.lt=function(e){return this.cmp(e)<0};Ae.lessThanOrEqualTo=Ae.lte=function(e){return this.cmp(e)<1};Ae.logarithm=Ae.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(fr))throw Error(Hr+"NaN");if(n.s<1)throw Error(Hr+(n.s?"NaN":"-Infinity"));return n.eq(fr)?new r(0):(Ot=!1,t=ia(od(n,a),od(e,a),a),Ot=!0,ft(t,i))};Ae.minus=Ae.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?j3(t,e):S3(t,(e.s=-e.s,e))};Ae.modulo=Ae.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Hr+"NaN");return n.s?(Ot=!1,t=ia(n,e,0,1).times(e),Ot=!0,n.minus(t)):ft(new r(n),i)};Ae.naturalExponential=Ae.exp=function(){return k3(this)};Ae.naturalLogarithm=Ae.ln=function(){return od(this)};Ae.negated=Ae.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ae.plus=Ae.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?S3(t,e):j3(t,(e.s=-e.s,e))};Ae.precision=Ae.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(io+e);if(t=Qt(i)+1,r=i.d.length-1,n=r*jt+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};Ae.squareRoot=Ae.sqrt=function(){var e,t,n,r,i,a,s,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(Hr+"NaN")}for(e=Qt(o),Ot=!1,i=Math.sqrt(+o),i==0||i==1/0?(t=Ci(o.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=sc((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=s=n+3;;)if(a=r,r=a.plus(ia(o,a,s+2)).times(.5),Ci(a.d).slice(0,s)===(t=Ci(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(ft(a,n+1,0),a.times(a).eq(o)){r=a;break}}else if(t!="9999")break;s+=4}return Ot=!0,ft(r,n)};Ae.times=Ae.mul=function(e){var t,n,r,i,a,s,o,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=p.length,c<u&&(a=h,h=p,p=a,s=c,c=u,u=s),a=[],s=c+u,r=s;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)o=a[i]+p[r]*h[i-r-1]+t,a[i--]=o%ln|0,t=o/ln|0;a[i]=(a[i]+t)%ln|0}for(;!a[--s];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Ot?ft(e,f.precision):e};Ae.toDecimalPlaces=Ae.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ri(e,0,ac),t===void 0?t=r.rounding:Ri(t,0,8),ft(n,e+Qt(n)+1,t))};Ae.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=So(r,!0):(Ri(e,0,ac),t===void 0?t=i.rounding:Ri(t,0,8),r=ft(new i(r),e+1,t),n=So(r,!0,e+1)),n};Ae.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?So(i):(Ri(e,0,ac),t===void 0?t=a.rounding:Ri(t,0,8),r=ft(new a(i),e+Qt(i)+1,t),n=So(r.abs(),!1,e+Qt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ae.toInteger=Ae.toint=function(){var e=this,t=e.constructor;return ft(new t(e),Qt(e)+1,t.rounding)};Ae.toNumber=function(){return+this};Ae.toPower=Ae.pow=function(e){var t,n,r,i,a,s,o=this,c=o.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(fr);if(o=new c(o),!o.s){if(e.s<1)throw Error(Hr+"Infinity");return o}if(o.eq(fr))return o;if(r=c.precision,e.eq(fr))return ft(o,r);if(t=e.e,n=e.d.length-1,s=t>=n,a=o.s,s){if((n=d<0?-d:d)<=w3){for(i=new c(fr),t=Math.ceil(r/jt+4),Ot=!1;n%2&&(i=i.times(o),hE(i.d,t)),n=sc(n/2),n!==0;)o=o.times(o),hE(o.d,t);return Ot=!0,e.s<0?new c(fr).div(i):ft(i,r)}}else if(a<0)throw Error(Hr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,o.s=1,Ot=!1,i=e.times(od(o,r+u)),Ot=!0,i=k3(i),i.s=a,i};Ae.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Qt(i),r=So(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ri(e,1,ac),t===void 0?t=a.rounding:Ri(t,0,8),i=ft(new a(i),e,t),n=Qt(i),r=So(i,e<=n||n<=a.toExpNeg,e)),r};Ae.toSignificantDigits=Ae.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ri(e,1,ac),t===void 0?t=r.rounding:Ri(t,0,8)),ft(new r(n),e,t)};Ae.toString=Ae.valueOf=Ae.val=Ae.toJSON=Ae[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Qt(e),n=e.constructor;return So(e,t<=n.toExpNeg||t>=n.toExpPos)};function S3(e,t){var n,r,i,a,s,o,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Ot?ft(t,f):t;if(c=e.d,u=t.d,s=e.e,i=t.e,c=c.slice(),a=s-i,a){for(a<0?(r=c,a=-a,o=u.length):(r=u,i=s,o=c.length),s=Math.ceil(f/jt),o=s>o?s+1:o+1,a>o&&(a=o,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(o=c.length,a=u.length,o-a<0&&(a=o,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/ln|0,c[a]%=ln;for(n&&(c.unshift(n),++i),o=c.length;c[--o]==0;)c.pop();return t.d=c,t.e=i,Ot?ft(t,f):t}function Ri(e,t,n){if(e!==~~e||e<t||e>n)throw Error(io+e)}function Ci(e){var t,n,r,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;t<i;t++)r=e[t]+"",n=jt-r.length,n&&(a+=$a(n)),a+=r;s=e[t],r=s+"",n=jt-r.length,n&&(a+=$a(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var ia=function(){function e(r,i){var a,s=0,o=r.length;for(r=r.slice();o--;)a=r[o]*i+s,r[o]=a%ln|0,s=a/ln|0;return s&&r.unshift(s),r}function t(r,i,a,s){var o,c;if(a!=s)c=a>s?1:-1;else for(o=c=0;o<a;o++)if(r[o]!=i[o]){c=r[o]>i[o]?1:-1;break}return c}function n(r,i,a){for(var s=0;a--;)r[a]-=s,s=r[a]<i[a]?1:0,r[a]=s*ln+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,s){var o,c,u,d,f,h,p,g,y,x,v,b,w,S,k,j,N,P,T=r.constructor,E=r.s==i.s?1:-1,_=r.d,C=i.d;if(!r.s)return new T(r);if(!i.s)throw Error(Hr+"Division by zero");for(c=r.e-i.e,N=C.length,k=_.length,p=new T(E),g=p.d=[],u=0;C[u]==(_[u]||0);)++u;if(C[u]>(_[u]||0)&&--c,a==null?b=a=T.precision:s?b=a+(Qt(r)-Qt(i))+1:b=a,b<0)return new T(0);if(b=b/jt+2|0,u=0,N==1)for(d=0,C=C[0],b++;(u<k||d)&&b--;u++)w=d*ln+(_[u]||0),g[u]=w/C|0,d=w%C|0;else{for(d=ln/(C[0]+1)|0,d>1&&(C=e(C,d),_=e(_,d),N=C.length,k=_.length),S=N,y=_.slice(0,N),x=y.length;x<N;)y[x++]=0;P=C.slice(),P.unshift(0),j=C[0],C[1]>=ln/2&&++j;do d=0,o=t(C,y,N,x),o<0?(v=y[0],N!=x&&(v=v*ln+(y[1]||0)),d=v/j|0,d>1?(d>=ln&&(d=ln-1),f=e(C,d),h=f.length,x=y.length,o=t(f,y,h,x),o==1&&(d--,n(f,N<h?P:C,h))):(d==0&&(o=d=1),f=C.slice()),h=f.length,h<x&&f.unshift(0),n(y,f,x),o==-1&&(x=y.length,o=t(C,y,N,x),o<1&&(d++,n(y,N<x?P:C,x))),x=y.length):o===0&&(d++,y=[0]),g[u++]=d,o&&y[0]?y[x++]=_[S]||0:(y=[_[S]],x=1);while((S++<k||y[0]!==void 0)&&b--)}return g[0]||g.shift(),p.e=c,ft(p,s?a+Qt(p)+1:a)}}();function k3(e,t){var n,r,i,a,s,o,c=0,u=0,d=e.constructor,f=d.precision;if(Qt(e)>16)throw Error(nS+Qt(e));if(!e.s)return new d(fr);for(Ot=!1,o=f,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(zs(2,u))/Math.LN10*2+5|0,o+=r,n=i=a=new d(fr),d.precision=o;;){if(i=ft(i.times(e),o),n=n.times(++c),s=a.plus(ia(i,n,o)),Ci(s.d).slice(0,o)===Ci(a.d).slice(0,o)){for(;u--;)a=ft(a.times(a),o);return d.precision=f,t==null?(Ot=!0,ft(a,f)):a}a=s}}function Qt(e){for(var t=e.e*jt,n=e.d[0];n>=10;n/=10)t++;return t}function py(e,t,n){if(t>e.LN10.sd())throw Ot=!0,n&&(e.precision=n),Error(Hr+"LN10 precision limit exceeded");return ft(new e(e.LN10),t)}function $a(e){for(var t="";e--;)t+="0";return t}function od(e,t){var n,r,i,a,s,o,c,u,d,f=1,h=10,p=e,g=p.d,y=p.constructor,x=y.precision;if(p.s<1)throw Error(Hr+(p.s?"NaN":"-Infinity"));if(p.eq(fr))return new y(0);if(t==null?(Ot=!1,u=x):u=t,p.eq(10))return t==null&&(Ot=!0),py(y,u);if(u+=h,y.precision=u,n=Ci(g),r=n.charAt(0),a=Qt(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=Ci(p.d),r=n.charAt(0),f++;a=Qt(p),r>1?(p=new y("0."+n),a++):p=new y(r+"."+n.slice(1))}else return c=py(y,u+2,x).times(a+""),p=od(new y(r+"."+n.slice(1)),u-h).plus(c),y.precision=x,t==null?(Ot=!0,ft(p,x)):p;for(o=s=p=ia(p.minus(fr),p.plus(fr),u),d=ft(p.times(p),u),i=3;;){if(s=ft(s.times(d),u),c=o.plus(ia(s,new y(i),u)),Ci(c.d).slice(0,u)===Ci(o.d).slice(0,u))return o=o.times(2),a!==0&&(o=o.plus(py(y,u+2,x).times(a+""))),o=ia(o,new y(f),u),y.precision=x,t==null?(Ot=!0,ft(o,x)):o;o=c,i+=2}}function fE(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=sc(n/jt),e.d=[],r=(n+1)%jt,n<0&&(r+=jt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=jt;r<i;)e.d.push(+t.slice(r,r+=jt));t=t.slice(r),r=jt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Ot&&(e.e>Fp||e.e<-Fp))throw Error(nS+n)}else e.s=0,e.e=0,e.d=[0];return e}function ft(e,t,n){var r,i,a,s,o,c,u,d,f=e.d;for(s=1,a=f[0];a>=10;a/=10)s++;if(r=t-s,r<0)r+=jt,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/jt),a=f.length,d>=a)return e;for(u=a=f[d],s=1;a>=10;a/=10)s++;r%=jt,i=r-jt+s}if(n!==void 0&&(a=zs(10,s-i-1),o=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(o||c)&&(n==0||n==(e.s<0?3:2)):o>5||o==5&&(n==4||c||n==6&&(r>0?i>0?u/zs(10,s-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Qt(e),f.length=1,t=t-a-1,f[0]=zs(10,(jt-t%jt)%jt),e.e=sc(-t/jt)||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=zs(10,jt-r),f[d]=i>0?(u/zs(10,s-i)%zs(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==ln&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=ln)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(Ot&&(e.e>Fp||e.e<-Fp))throw Error(nS+Qt(e));return e}function j3(e,t){var n,r,i,a,s,o,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Ot?ft(t,p):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),s=u-r,s){for(d=s<0,d?(n=c,s=-s,o=f.length):(n=f,r=u,o=c.length),i=Math.max(Math.ceil(p/jt),o)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,o=f.length,d=i<o,d&&(o=i),i=0;i<o;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}s=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),o=c.length,i=f.length-o;i>0;--i)c[o++]=0;for(i=f.length;i>s;){if(c[--i]<f[i]){for(a=i;a&&c[--a]===0;)c[a]=ln-1;--c[a],c[i]+=ln}c[i]-=f[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Ot?ft(t,p):t):new h(0)}function So(e,t,n){var r,i=Qt(e),a=Ci(e.d),s=a.length;return t?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+$a(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+$a(-i-1)+a,n&&(r=n-s)>0&&(a+=$a(r))):i>=s?(a+=$a(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+$a(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=$a(r))),e.s<0?"-"+a:a}function hE(e,t){if(e.length>t)return e.length=t,!0}function N3(e){var t,n,r;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(io+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return fE(s,a.toString())}else if(typeof a!="string")throw Error(io+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,_se.test(a))fE(s,a);else throw Error(io+a)}if(i.prototype=Ae,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=N3,i.config=i.set=Dse,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 Dse(e){if(!e||typeof e!="object")throw Error(Hr+"Object expected");var t,n,r,i=["precision",1,ac,"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(sc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(io+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(io+n+": "+r);return this}var rS=N3(Ose);fr=new rS(1);const Ze=rS;function C3(e){var t;return e===0?t=1:t=Math.floor(new Ze(e).abs().log(10).toNumber())+1,t}function P3(e,t,n){for(var r=new Ze(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var E3=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},iS=(e,t,n)=>{if(e.lte(0))return new Ze(0);var r=C3(e.toNumber()),i=new Ze(10).pow(r),a=e.div(i),s=r!==1?.05:.1,o=new Ze(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=o.mul(i);return t?new Ze(c.toNumber()):new Ze(Math.ceil(c.toNumber()))},A3=(e,t,n)=>{var r;if(e.lte(0))return new Ze(0);var i=[1,2,2.5,5],a=e.toNumber(),s=Math.floor(new Ze(a).abs().log(10).toNumber()),o=new Ze(10).pow(s),c=e.div(o).toNumber(),u=i.findIndex(p=>p>=c-1e-10);if(u===-1&&(o=o.mul(10),u=0),u+=n,u>=i.length){var d=Math.floor(u/i.length);u%=i.length,o=o.mul(new Ze(10).pow(d))}var f=(r=i[u])!==null&&r!==void 0?r:1,h=new Ze(f).mul(o);return t?h:new Ze(Math.ceil(h.toNumber()))},Mse=(e,t,n)=>{var r=new Ze(1),i=new Ze(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Ze(10).pow(C3(e)-1),i=new Ze(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Ze(Math.floor(e)))}else e===0?i=new Ze(Math.floor((t-1)/2)):n||(i=new Ze(Math.floor(e)));for(var s=Math.floor((t-1)/2),o=[],c=0;c<t;c++)o.push(i.add(new Ze(c-s).mul(r)).toNumber());return o},T3=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:iS;if(!Number.isFinite((n-t)/(r-1)))return{step:new Ze(0),tickMin:new Ze(0),tickMax:new Ze(0)};var o=s(new Ze(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new Ze(0):(c=new Ze(t).add(n).div(2),c=c.sub(new Ze(c).mod(o)));var u=Math.ceil(c.sub(t).div(o).toNumber()),d=Math.ceil(new Ze(n).sub(c).div(o).toNumber()),f=u+d+1;return f>r?T3(t,n,r,i,a+1,s):(f<r&&(d=n>0?d+(r-f):d,u=n>0?u:u+(r-f)),{step:o,tickMin:c.sub(new Ze(u).mul(o)),tickMax:c.add(new Ze(d).mul(o))})},pE=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",o=Math.max(i,2),[c,u]=E3([n,r]);if(c===-1/0||u===1/0){var d=u===1/0?[c,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),u];return n>r?d.reverse():d}if(c===u)return Mse(c,i,a);var f=s==="snap125"?A3:iS,{step:h,tickMin:p,tickMax:g}=T3(c,u,o,a,0,f),y=P3(p,g.add(new Ze(.1).mul(h)),h);return n>r?y.reverse():y},mE=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[o,c]=E3([r,i]);if(o===-1/0||c===1/0)return[r,i];if(o===c)return[o];var u=s==="snap125"?A3:iS,d=Math.max(n,2),f=u(new Ze(c).sub(o).div(d-1),a,0),h=[...P3(new Ze(o),new Ze(c),f),c];return a===!1&&(h=h.map(p=>Math.round(p))),r>i?h.reverse():h},Ise=e=>e.rootProps.barCategoryGap,xg=e=>e.rootProps.stackOffset,O3=e=>e.rootProps.reverseStackOrder,aS=e=>e.options.chartName,sS=e=>e.rootProps.syncId,_3=e=>e.rootProps.syncMethod,oS=e=>e.options.eventEmitter,Lse=e=>e.rootProps.baseValue,Vn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},As={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},xi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},vg=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function bg(e,t,n){if(n!=="auto")return n;if(e!=null)return Bi(e,t)?"category":"number"}function gE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gE(Object(n),!0).forEach(function(r){Rse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rse(e,t,n){return(t=Fse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fse(e){var t=zse(e,"string");return typeof t=="symbol"?t:t+""}function zse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yE={allowDataOverflow:As.allowDataOverflow,allowDecimals:As.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:As.angleAxisId,includeHidden:!1,name:void 0,reversed:As.reversed,scale:As.scale,tick:As.tick,tickCount:void 0,ticks:void 0,type:As.type,unit:void 0,niceTicks:"auto"},xE={allowDataOverflow:xi.allowDataOverflow,allowDecimals:xi.allowDecimals,allowDuplicatedCategory:xi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:xi.radiusAxisId,includeHidden:xi.includeHidden,name:void 0,reversed:xi.reversed,scale:xi.scale,tick:xi.tick,tickCount:xi.tickCount,ticks:void 0,type:xi.type,unit:void 0,niceTicks:"auto"},$se=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},lS=q([$se,ZI],(e,t)=>{var n;if(e!=null)return e;var r=(n=bg(t,"angleAxis",yE.type))!==null&&n!==void 0?n:"category";return zp(zp({},yE),{},{type:r})}),Bse=(e,t)=>e.polarAxis.radiusAxis[t],cS=q([Bse,ZI],(e,t)=>{var n;if(e!=null)return e;var r=(n=bg(t,"radiusAxis",xE.type))!==null&&n!==void 0?n:"category";return zp(zp({},xE),{},{type:r})}),wg=e=>e.polarOptions,uS=q([Sa,ka,Nn],yse),D3=q([wg,uS],(e,t)=>{if(e!=null)return ps(e.innerRadius,t,0)}),M3=q([wg,uS],(e,t)=>{if(e!=null)return ps(e.outerRadius,t,t*.8)}),Use=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},I3=q([wg],Use);q([lS,I3],vg);var L3=q([uS,D3,M3],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});q([cS,L3],vg);var R3=q([_t,wg,D3,M3,Sa,ka],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:s,cy:o,startAngle:c,endAngle:u}=t;return{cx:ps(s,i,i/2),cy:ps(o,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),fn=(e,t)=>t,Sg=(e,t,n)=>n;function dS(e){return e==null?void 0:e.id}function F3(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,s=new Map;return e.forEach(o=>{var c,u=(c=o.data)!==null&&c!==void 0?c:r;if(!(u==null||u.length===0)){var d=dS(o);u.forEach((f,h)=>{var p=a==null||i?h:String(Sn(f,a,null)),g=Sn(f,o.dataKey,0),y;s.has(p)?y=s.get(p):y={},Object.assign(y,{[d]:g}),s.set(p,y)})}}),Array.from(s.values())}function fS(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var kg=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function jg(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Vse(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var hn=e=>{var t=_t(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},oc=e=>e.tooltip.settings.axisId;function hS(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(a){function s(){return a.apply(this,arguments)}return s.toString=function(){return a.toString()},s}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var s=i[0],o=i[1];return s<=o?a>=s&&a<=o:a>=o&&a<=s},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,s)=>{var o=e(a);if(o!=null){if(e.bandwidth&&s!==null&&s!==void 0&&s.position){var c=e.bandwidth();switch(s.position){case"middle":o+=c/2;break;case"end":o+=c;break}}return o}}}}}var Wse=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Oi(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Xe(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function is(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Hse(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function pS(e){let t,n,r;e.length!==2?(t=is,n=(o,c)=>is(e(o),c),r=(o,c)=>e(o)-c):(t=e===is||e===Hse?e:Kse,n=e,r=e);function i(o,c,u=0,d=o.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(o[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(o,c,u=0,d=o.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(o[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function s(o,c,u=0,d=o.length){const f=i(o,c,u,d-1);return f>u&&r(o[f-1],c)>-r(o[f],c)?f-1:f}return{left:i,center:s,right:a}}function Kse(){return 0}function z3(e){return e===null?NaN:+e}function*qse(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Gse=pS(is),Vd=Gse.right;pS(z3).center;class vE extends Map{constructor(t,n=Zse){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(bE(this,t))}has(t){return super.has(bE(this,t))}set(t,n){return super.set(Yse(this,t),n)}delete(t){return super.delete(Xse(this,t))}}function bE({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Yse({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Xse({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Zse(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Qse(e=is){if(e===is)return $3;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 $3(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Jse=Math.sqrt(50),eoe=Math.sqrt(10),toe=Math.sqrt(2);function $p(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=Jse?10:a>=eoe?5:a>=toe?2:1;let o,c,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(e*u),c=Math.round(t*u),o/u<e&&++o,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*s,o=Math.round(e/u),c=Math.round(t/u),o*u<e&&++o,c*u>t&&--c),c<o&&.5<=n&&n<2?$p(e,t,n*2):[o,c,u]}function zv(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?$p(t,e,n):$p(e,t,n);if(!(a>=i))return[];const o=a-i+1,c=new Array(o);if(r)if(s<0)for(let u=0;u<o;++u)c[u]=(a-u)/-s;else for(let u=0;u<o;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<o;++u)c[u]=(i+u)/-s;else for(let u=0;u<o;++u)c[u]=(i+u)*s;return c}function $v(e,t,n){return t=+t,e=+e,n=+n,$p(e,t,n)[2]}function Bv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?$v(t,e,n):$v(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function wE(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function SE(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function B3(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?$3:Qse(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(n,Math.floor(t-u*f/c+h)),g=Math.min(r,Math.floor(t+(c-u)*f/c+h));B3(e,t,p,g,i)}const a=e[t];let s=n,o=r;for(zc(e,n,t),i(e[r],a)>0&&zc(e,n,r);s<o;){for(zc(e,s,o),++s,--o;i(e[s],a)<0;)++s;for(;i(e[o],a)>0;)--o}i(e[n],a)===0?zc(e,n,o):(++o,zc(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function zc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function noe(e,t,n){if(e=Float64Array.from(qse(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return SE(e);if(t>=1)return wE(e);var r,i=(r-1)*t,a=Math.floor(i),s=wE(B3(e,a).subarray(0,a+1)),o=SE(e.subarray(a+1));return s+(o-s)*(i-a)}}function roe(e,t,n=z3){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),s=+n(e[a],a,e),o=+n(e[a+1],a+1,e);return s+(o-s)*(i-a)}}function ioe(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 Kr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Na(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 Uv=Symbol("implicit");function mS(){var e=new vE,t=[],n=[],r=Uv;function i(a){let s=e.get(a);if(s===void 0){if(r!==Uv)return r;e.set(a,s=t.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new vE;for(const s of a)e.has(s)||e.set(s,t.push(s)-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 mS(t,n).unknown(r)},Kr.apply(i,arguments),i}function gS(){var e=mS().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,s,o=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=i<r,g=p?i:r,y=p?r:i;a=(y-g)/Math.max(1,h-c+u*2),o&&(a=Math.floor(a)),g+=(y-g-a*(h-c))*d,s=a*(1-c),o&&(g=Math.round(g),s=Math.round(s));var x=ioe(h).map(function(v){return g+a*v});return n(p?x.reverse():x)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,f()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(o=!!h,f()):o},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return gS(t(),[r,i]).round(o).paddingInner(c).paddingOuter(u).align(d)},Kr.apply(f(),arguments)}function U3(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return U3(t())},e}function aoe(){return U3(gS.apply(null,arguments).paddingInner(1))}function yS(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function V3(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Wd(){}var ld=.7,Bp=1/ld,kl="\\s*([+-]?\\d+)\\s*",cd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",soe=/^#([0-9a-f]{3,8})$/,ooe=new RegExp(`^rgb\\(${kl},${kl},${kl}\\)$`),loe=new RegExp(`^rgb\\(${_i},${_i},${_i}\\)$`),coe=new RegExp(`^rgba\\(${kl},${kl},${kl},${cd}\\)$`),uoe=new RegExp(`^rgba\\(${_i},${_i},${_i},${cd}\\)$`),doe=new RegExp(`^hsl\\(${cd},${_i},${_i}\\)$`),foe=new RegExp(`^hsla\\(${cd},${_i},${_i},${cd}\\)$`),kE={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};yS(Wd,ud,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jE,formatHex:jE,formatHex8:hoe,formatHsl:poe,formatRgb:NE,toString:NE});function jE(){return this.rgb().formatHex()}function hoe(){return this.rgb().formatHex8()}function poe(){return W3(this).formatHsl()}function NE(){return this.rgb().formatRgb()}function ud(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=soe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?CE(t):n===3?new nr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wf(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=ooe.exec(e))?new nr(t[1],t[2],t[3],1):(t=loe.exec(e))?new nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=coe.exec(e))?Wf(t[1],t[2],t[3],t[4]):(t=uoe.exec(e))?Wf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=doe.exec(e))?AE(t[1],t[2]/100,t[3]/100,1):(t=foe.exec(e))?AE(t[1],t[2]/100,t[3]/100,t[4]):kE.hasOwnProperty(e)?CE(kE[e]):e==="transparent"?new nr(NaN,NaN,NaN,0):null}function CE(e){return new nr(e>>16&255,e>>8&255,e&255,1)}function Wf(e,t,n,r){return r<=0&&(e=t=n=NaN),new nr(e,t,n,r)}function moe(e){return e instanceof Wd||(e=ud(e)),e?(e=e.rgb(),new nr(e.r,e.g,e.b,e.opacity)):new nr}function Vv(e,t,n,r){return arguments.length===1?moe(e):new nr(e,t,n,r??1)}function nr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}yS(nr,Vv,V3(Wd,{brighter(e){return e=e==null?Bp:Math.pow(Bp,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ld:Math.pow(ld,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nr(ao(this.r),ao(this.g),ao(this.b),Up(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:PE,formatHex:PE,formatHex8:goe,formatRgb:EE,toString:EE}));function PE(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}`}function goe(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}${Xs((isNaN(this.opacity)?1:this.opacity)*255)}`}function EE(){const e=Up(this.opacity);return`${e===1?"rgb(":"rgba("}${ao(this.r)}, ${ao(this.g)}, ${ao(this.b)}${e===1?")":`, ${e})`}`}function Up(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ao(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xs(e){return e=ao(e),(e<16?"0":"")+e.toString(16)}function AE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ni(e,t,n,r)}function W3(e){if(e instanceof ni)return new ni(e.h,e.s,e.l,e.opacity);if(e instanceof Wd||(e=ud(e)),!e)return new ni;if(e instanceof ni)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),s=NaN,o=a-i,c=(a+i)/2;return o?(t===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-t)/o+2:s=(t-n)/o+4,o/=c<.5?a+i:2-a-i,s*=60):o=c>0&&c<1?0:s,new ni(s,o,c,e.opacity)}function yoe(e,t,n,r){return arguments.length===1?W3(e):new ni(e,t,n,r??1)}function ni(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}yS(ni,yoe,V3(Wd,{brighter(e){return e=e==null?Bp:Math.pow(Bp,e),new ni(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ld:Math.pow(ld,e),new ni(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 nr(my(e>=240?e-240:e+120,i,r),my(e,i,r),my(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ni(TE(this.h),Hf(this.s),Hf(this.l),Up(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=Up(this.opacity);return`${e===1?"hsl(":"hsla("}${TE(this.h)}, ${Hf(this.s)*100}%, ${Hf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function TE(e){return e=(e||0)%360,e<0?e+360:e}function Hf(e){return Math.max(0,Math.min(1,e||0))}function my(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 xS=e=>()=>e;function xoe(e,t){return function(n){return e+n*t}}function voe(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 boe(e){return(e=+e)==1?H3:function(t,n){return n-t?voe(t,n,e):xS(isNaN(t)?n:t)}}function H3(e,t){var n=t-e;return n?xoe(e,n):xS(isNaN(e)?t:e)}const OE=function e(t){var n=boe(t);function r(i,a){var s=n((i=Vv(i)).r,(a=Vv(a)).r),o=n(i.g,a.g),c=n(i.b,a.b),u=H3(i.opacity,a.opacity);return function(d){return i.r=s(d),i.g=o(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function woe(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 Soe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function koe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=lc(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function joe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Vp(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Noe(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]=lc(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Wv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gy=new RegExp(Wv.source,"g");function Coe(e){return function(){return e}}function Poe(e){return function(t){return e(t)+""}}function Eoe(e,t){var n=Wv.lastIndex=gy.lastIndex=0,r,i,a,s=-1,o=[],c=[];for(e=e+"",t=t+"";(r=Wv.exec(e))&&(i=gy.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,c.push({i:s,x:Vp(r,i)})),n=gy.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?c[0]?Poe(c[0].x):Coe(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)o[(f=c[d]).i]=f.x(u);return o.join("")})}function lc(e,t){var n=typeof t,r;return t==null||n==="boolean"?xS(t):(n==="number"?Vp:n==="string"?(r=ud(t))?(t=r,OE):Eoe:t instanceof ud?OE:t instanceof Date?joe:Soe(t)?woe:Array.isArray(t)?koe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Noe:Vp)(e,t)}function vS(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Aoe(e,t){t===void 0&&(t=e,e=lc);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(s){var o=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return a[o](s-o)}}function Toe(e){return function(){return e}}function Wp(e){return+e}var _E=[0,1];function Wn(e){return e}function Hv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Toe(isNaN(t)?NaN:.5)}function Ooe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function _oe(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=Hv(i,r),a=n(s,a)):(r=Hv(r,i),a=n(a,s)),function(o){return a(r(o))}}function Doe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Hv(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(o){var c=Vd(e,o,1,r)-1;return a[c](i[c](o))}}function Hd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ng(){var e=_E,t=_E,n=lc,r,i,a,s=Wn,o,c,u;function d(){var h=Math.min(e.length,t.length);return s!==Wn&&(s=Ooe(e[0],e[h-1])),o=h>2?Doe:_oe,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=o(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((u||(u=o(t,e.map(r),Vp)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Wp),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=vS,d()},f.clamp=function(h){return arguments.length?(s=h?!0:Wn,d()):s!==Wn},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return r=h,i=p,d()}}function bS(){return Ng()(Wn,Wn)}function Moe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Hp(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 Wl(e){return e=Hp(Math.abs(e)),e?e[1]:NaN}function Ioe(e,t){return function(n,r){for(var i=n.length,a=[],s=0,o=e[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),a.push(n.substring(i-=o,i+o)),!((c+=o+1)>r));)o=e[s=(s+1)%e.length];return a.reverse().join(t)}}function Loe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Roe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dd(e){if(!(t=Roe.exec(e)))throw new Error("invalid format: "+e);var t;return new wS({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]})}dd.prototype=wS.prototype;function wS(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+""}wS.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 Foe(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 Kp;function zoe(e,t){var n=Hp(e,t);if(!n)return Kp=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Kp=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Hp(e,Math.max(0,t+a-1))[0]}function DE(e,t){var n=Hp(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 ME={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Moe,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)=>DE(e*100,t),r:DE,s:zoe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function IE(e){return e}var LE=Array.prototype.map,RE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $oe(e){var t=e.grouping===void 0||e.thousands===void 0?IE:Ioe(LE.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?IE:Loe(LE.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=dd(f);var p=f.fill,g=f.align,y=f.sign,x=f.symbol,v=f.zero,b=f.width,w=f.comma,S=f.precision,k=f.trim,j=f.type;j==="n"?(w=!0,j="g"):ME[j]||(S===void 0&&(S=12),k=!0,j="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var N=(h&&h.prefix!==void 0?h.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),P=(x==="$"?r:/[%p]/.test(j)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),T=ME[j],E=/[defgprs%]/.test(j);S=S===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function _(C){var A=N,M=P,B,ae,Q;if(j==="c")M=T(C)+M,C="";else{C=+C;var I=C<0||1/C<0;if(C=isNaN(C)?c:T(Math.abs(C),S),k&&(C=Foe(C)),I&&+C==0&&y!=="+"&&(I=!1),A=(I?y==="("?y:o:y==="-"||y==="("?"":y)+A,M=(j==="s"&&!isNaN(C)&&Kp!==void 0?RE[8+Kp/3]:"")+M+(I&&y==="("?")":""),E){for(B=-1,ae=C.length;++B<ae;)if(Q=C.charCodeAt(B),48>Q||Q>57){M=(Q===46?i+C.slice(B+1):C.slice(B))+M,C=C.slice(0,B);break}}}w&&!v&&(C=t(C,1/0));var H=A.length+C.length+M.length,O=H<b?new Array(b-H+1).join(p):"";switch(w&&v&&(C=t(O+C,O.length?b-M.length:1/0),O=""),g){case"<":C=A+C+M+O;break;case"=":C=A+O+C+M;break;case"^":C=O.slice(0,H=O.length>>1)+A+C+M+O.slice(H);break;default:C=O+A+C+M;break}return a(C)}return _.toString=function(){return f+""},_}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(Wl(h)/3)))*3,g=Math.pow(10,-p),y=u((f=dd(f),f.type="f",f),{suffix:RE[8+p/3]});return function(x){return y(g*x)}}return{format:u,formatPrefix:d}}var Kf,SS,K3;Boe({thousands:",",grouping:[3],currency:["$",""]});function Boe(e){return Kf=$oe(e),SS=Kf.format,K3=Kf.formatPrefix,Kf}function Uoe(e){return Math.max(0,-Wl(Math.abs(e)))}function Voe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Wl(t)/3)))*3-Wl(Math.abs(e)))}function Woe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Wl(t)-Wl(e))+1}function q3(e,t,n,r){var i=Bv(e,t,n),a;switch(r=dd(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Voe(i,s))&&(r.precision=a),K3(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Woe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Uoe(i))&&(r.precision=a-(r.type==="%")*2);break}}return SS(r)}function Ss(e){var t=e.domain;return e.ticks=function(n){var r=t();return zv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return q3(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,s=r[i],o=r[a],c,u,d=10;for(o<s&&(u=s,s=o,o=u,u=i,i=a,a=u);d-- >0;){if(u=$v(s,o,n),u===c)return r[i]=s,r[a]=o,t(r);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;c=u}return e},e}function G3(){var e=bS();return e.copy=function(){return Hd(e,G3())},Kr.apply(e,arguments),Ss(e)}function Y3(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,Wp),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Y3(e).unknown(t)},e=arguments.length?Array.from(e,Wp):[0,1],Ss(n)}function X3(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}function FE(e){return Math.log(e)}function zE(e){return Math.exp(e)}function Hoe(e){return-Math.log(-e)}function Koe(e){return-Math.exp(-e)}function qoe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Goe(e){return e===10?qoe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Yoe(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 $E(e){return(t,n)=>-e(-t,n)}function kS(e){const t=e(FE,zE),n=t.domain;let r=10,i,a;function s(){return i=Yoe(r),a=Goe(r),n()[0]<0?(i=$E(i),a=$E(a),e(Hoe,Koe)):e(FE,zE),t}return t.base=function(o){return arguments.length?(r=+o,s()):r},t.domain=function(o){return arguments.length?(n(o),s()):n()},t.ticks=o=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=i(u),p=i(d),g,y;const x=o==null?10:+o;let v=[];if(!(r%1)&&p-h<x){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(g=1;g<r;++g)if(y=h<0?g/a(-h):g*a(h),!(y<u)){if(y>d)break;v.push(y)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(y=h>0?g/a(-h):g*a(h),!(y<u)){if(y>d)break;v.push(y)}v.length*2<x&&(v=zv(u,d,x))}else v=zv(h,p,Math.min(p-h,x)).map(a);return f?v.reverse():v},t.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=dd(c)).precision==null&&(c.trim=!0),c=SS(c)),o===1/0)return c;const u=Math.max(1,r*o/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(X3(n(),{floor:o=>a(Math.floor(i(o))),ceil:o=>a(Math.ceil(i(o)))})),t}function Z3(){const e=kS(Ng()).domain([1,10]);return e.copy=()=>Hd(e,Z3()).base(e.base()),Kr.apply(e,arguments),e}function BE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function UE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jS(e){var t=1,n=e(BE(t),UE(t));return n.constant=function(r){return arguments.length?e(BE(t=+r),UE(t)):t},Ss(n)}function Q3(){var e=jS(Ng());return e.copy=function(){return Hd(e,Q3()).constant(e.constant())},Kr.apply(e,arguments)}function VE(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Xoe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Zoe(e){return e<0?-e*e:e*e}function NS(e){var t=e(Wn,Wn),n=1;function r(){return n===1?e(Wn,Wn):n===.5?e(Xoe,Zoe):e(VE(n),VE(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Ss(t)}function CS(){var e=NS(Ng());return e.copy=function(){return Hd(e,CS()).exponent(e.exponent())},Kr.apply(e,arguments),e}function Qoe(){return CS.apply(null,arguments).exponent(.5)}function WE(e){return Math.sign(e)*e*e}function Joe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function J3(){var e=bS(),t=[0,1],n=!1,r;function i(a){var s=Joe(e(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return e.invert(WE(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,Wp)).map(WE)),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 J3(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Kr.apply(i,arguments),Ss(i)}function eL(){var e=[],t=[],n=[],r;function i(){var s=0,o=Math.max(1,t.length);for(n=new Array(o-1);++s<o;)n[s-1]=roe(e,s/o);return a}function a(s){return s==null||isNaN(s=+s)?r:t[Vd(n,s)]}return a.invertExtent=function(s){var o=t.indexOf(s);return o<0?[NaN,NaN]:[o>0?n[o-1]:e[0],o<n.length?n[o]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let o of s)o!=null&&!isNaN(o=+o)&&e.push(o);return e.sort(is),i()},a.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return eL().domain(e).range(t).unknown(r)},Kr.apply(a,arguments)}function tL(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[Vd(r,c,0,n)]:a}function o(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,o()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,o()):i.slice()},s.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]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return tL().domain([e,t]).range(i).unknown(a)},Kr.apply(Ss(s),arguments)}function nL(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Vd(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 s=t.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return nL().domain(e).range(t).unknown(n)},Kr.apply(i,arguments)}const yy=new Date,xy=new Date;function an(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 s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const c=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return c;let u;do c.push(u=new Date(+a)),t(a,o),e(a);while(u<a&&a<s);return c},i.filter=a=>an(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!a(s););else for(;--o>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(yy.setTime(+a),xy.setTime(+s),e(yy),e(xy),Math.floor(n(yy,xy))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const qp=an(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);qp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?an(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):qp);qp.range;const Xi=1e3,$r=Xi*60,Zi=$r*60,ha=Zi*24,PS=ha*7,HE=ha*30,vy=ha*365,Zs=an(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xi)},(e,t)=>(t-e)/Xi,e=>e.getUTCSeconds());Zs.range;const ES=an(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xi)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getMinutes());ES.range;const AS=an(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getUTCMinutes());AS.range;const TS=an(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xi-e.getMinutes()*$r)},(e,t)=>{e.setTime(+e+t*Zi)},(e,t)=>(t-e)/Zi,e=>e.getHours());TS.range;const OS=an(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Zi)},(e,t)=>(t-e)/Zi,e=>e.getUTCHours());OS.range;const Kd=an(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$r)/ha,e=>e.getDate()-1);Kd.range;const Cg=an(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ha,e=>e.getUTCDate()-1);Cg.range;const rL=an(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ha,e=>Math.floor(e/ha));rL.range;function To(e){return an(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())*$r)/PS)}const Pg=To(0),Gp=To(1),ele=To(2),tle=To(3),Hl=To(4),nle=To(5),rle=To(6);Pg.range;Gp.range;ele.range;tle.range;Hl.range;nle.range;rle.range;function Oo(e){return an(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)/PS)}const Eg=Oo(0),Yp=Oo(1),ile=Oo(2),ale=Oo(3),Kl=Oo(4),sle=Oo(5),ole=Oo(6);Eg.range;Yp.range;ile.range;ale.range;Kl.range;sle.range;ole.range;const _S=an(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());_S.range;const DS=an(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());DS.range;const pa=an(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());pa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:an(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)});pa.range;const ma=an(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());ma.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:an(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)});ma.range;function iL(e,t,n,r,i,a){const s=[[Zs,1,Xi],[Zs,5,5*Xi],[Zs,15,15*Xi],[Zs,30,30*Xi],[a,1,$r],[a,5,5*$r],[a,15,15*$r],[a,30,30*$r],[i,1,Zi],[i,3,3*Zi],[i,6,6*Zi],[i,12,12*Zi],[r,1,ha],[r,2,2*ha],[n,1,PS],[t,1,HE],[t,3,3*HE],[e,1,vy]];function o(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),g=p?p.range(u,+d+1):[];return h?g.reverse():g}function c(u,d,f){const h=Math.abs(d-u)/f,p=pS(([,,x])=>x).right(s,h);if(p===s.length)return e.every(Bv(u/vy,d/vy,f));if(p===0)return qp.every(Math.max(Bv(u,d,f),1));const[g,y]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(y)}return[o,c]}const[lle,cle]=iL(ma,DS,Eg,rL,OS,AS),[ule,dle]=iL(pa,_S,Pg,Kd,TS,ES);function by(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 wy(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 $c(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function fle(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,c=e.shortMonths,u=Bc(i),d=Uc(i),f=Bc(a),h=Uc(a),p=Bc(s),g=Uc(s),y=Bc(o),x=Uc(o),v=Bc(c),b=Uc(c),w={a:Q,A:I,b:H,B:O,c:null,d:ZE,e:ZE,f:Ile,g:Hle,G:qle,H:_le,I:Dle,j:Mle,L:aL,m:Lle,M:Rle,p:oe,q:re,Q:e5,s:t5,S:Fle,u:zle,U:$le,V:Ble,w:Ule,W:Vle,x:null,X:null,y:Wle,Y:Kle,Z:Gle,"%":JE},S={a:D,A:G,b:te,B:ee,c:null,d:QE,e:QE,f:Qle,g:lce,G:uce,H:Yle,I:Xle,j:Zle,L:oL,m:Jle,M:ece,p:Z,q:ce,Q:e5,s:t5,S:tce,u:nce,U:rce,V:ice,w:ace,W:sce,x:null,X:null,y:oce,Y:cce,Z:dce,"%":JE},k={a:E,A:_,b:C,B:A,c:M,d:YE,e:YE,f:Ele,g:GE,G:qE,H:XE,I:XE,j:jle,L:Ple,m:kle,M:Nle,p:T,q:Sle,Q:Tle,s:Ole,S:Cle,u:yle,U:xle,V:vle,w:gle,W:ble,x:B,X:ae,y:GE,Y:qE,Z:wle,"%":Ale};w.x=j(n,w),w.X=j(r,w),w.c=j(t,w),S.x=j(n,S),S.X=j(r,S),S.c=j(t,S);function j(J,ne){return function(be){var Y=[],R=-1,F=0,ue=J.length,le,ze,Be;for(be instanceof Date||(be=new Date(+be));++R<ue;)J.charCodeAt(R)===37&&(Y.push(J.slice(F,R)),(ze=KE[le=J.charAt(++R)])!=null?le=J.charAt(++R):ze=le==="e"?" ":"0",(Be=ne[le])&&(le=Be(be,ze)),Y.push(le),F=R+1);return Y.push(J.slice(F,R)),Y.join("")}}function N(J,ne){return function(be){var Y=$c(1900,void 0,1),R=P(Y,J,be+="",0),F,ue;if(R!=be.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(ne&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(F=wy($c(Y.y,0,1)),ue=F.getUTCDay(),F=ue>4||ue===0?Yp.ceil(F):Yp(F),F=Cg.offset(F,(Y.V-1)*7),Y.y=F.getUTCFullYear(),Y.m=F.getUTCMonth(),Y.d=F.getUTCDate()+(Y.w+6)%7):(F=by($c(Y.y,0,1)),ue=F.getDay(),F=ue>4||ue===0?Gp.ceil(F):Gp(F),F=Kd.offset(F,(Y.V-1)*7),Y.y=F.getFullYear(),Y.m=F.getMonth(),Y.d=F.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),ue="Z"in Y?wy($c(Y.y,0,1)).getUTCDay():by($c(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(ue+5)%7:Y.w+Y.U*7-(ue+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,wy(Y)):by(Y)}}function P(J,ne,be,Y){for(var R=0,F=ne.length,ue=be.length,le,ze;R<F;){if(Y>=ue)return-1;if(le=ne.charCodeAt(R++),le===37){if(le=ne.charAt(R++),ze=k[le in KE?ne.charAt(R++):le],!ze||(Y=ze(J,be,Y))<0)return-1}else if(le!=be.charCodeAt(Y++))return-1}return Y}function T(J,ne,be){var Y=u.exec(ne.slice(be));return Y?(J.p=d.get(Y[0].toLowerCase()),be+Y[0].length):-1}function E(J,ne,be){var Y=p.exec(ne.slice(be));return Y?(J.w=g.get(Y[0].toLowerCase()),be+Y[0].length):-1}function _(J,ne,be){var Y=f.exec(ne.slice(be));return Y?(J.w=h.get(Y[0].toLowerCase()),be+Y[0].length):-1}function C(J,ne,be){var Y=v.exec(ne.slice(be));return Y?(J.m=b.get(Y[0].toLowerCase()),be+Y[0].length):-1}function A(J,ne,be){var Y=y.exec(ne.slice(be));return Y?(J.m=x.get(Y[0].toLowerCase()),be+Y[0].length):-1}function M(J,ne,be){return P(J,t,ne,be)}function B(J,ne,be){return P(J,n,ne,be)}function ae(J,ne,be){return P(J,r,ne,be)}function Q(J){return s[J.getDay()]}function I(J){return a[J.getDay()]}function H(J){return c[J.getMonth()]}function O(J){return o[J.getMonth()]}function oe(J){return i[+(J.getHours()>=12)]}function re(J){return 1+~~(J.getMonth()/3)}function D(J){return s[J.getUTCDay()]}function G(J){return a[J.getUTCDay()]}function te(J){return c[J.getUTCMonth()]}function ee(J){return o[J.getUTCMonth()]}function Z(J){return i[+(J.getUTCHours()>=12)]}function ce(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var ne=j(J+="",w);return ne.toString=function(){return J},ne},parse:function(J){var ne=N(J+="",!1);return ne.toString=function(){return J},ne},utcFormat:function(J){var ne=j(J+="",S);return ne.toString=function(){return J},ne},utcParse:function(J){var ne=N(J+="",!0);return ne.toString=function(){return J},ne}}}var KE={"-":"",_:" ",0:"0"},pn=/^\s*\d+/,hle=/^%/,ple=/[\\^$*+?|[\]().{}]/g;function at(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 mle(e){return e.replace(ple,"\\$&")}function Bc(e){return new RegExp("^(?:"+e.map(mle).join("|")+")","i")}function Uc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function gle(e,t,n){var r=pn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function yle(e,t,n){var r=pn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function xle(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function vle(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function ble(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function qE(e,t,n){var r=pn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function GE(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function wle(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 Sle(e,t,n){var r=pn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function kle(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function YE(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function jle(e,t,n){var r=pn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function XE(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Nle(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Cle(e,t,n){var r=pn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ple(e,t,n){var r=pn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ele(e,t,n){var r=pn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ale(e,t,n){var r=hle.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Tle(e,t,n){var r=pn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ole(e,t,n){var r=pn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ZE(e,t){return at(e.getDate(),t,2)}function _le(e,t){return at(e.getHours(),t,2)}function Dle(e,t){return at(e.getHours()%12||12,t,2)}function Mle(e,t){return at(1+Kd.count(pa(e),e),t,3)}function aL(e,t){return at(e.getMilliseconds(),t,3)}function Ile(e,t){return aL(e,t)+"000"}function Lle(e,t){return at(e.getMonth()+1,t,2)}function Rle(e,t){return at(e.getMinutes(),t,2)}function Fle(e,t){return at(e.getSeconds(),t,2)}function zle(e){var t=e.getDay();return t===0?7:t}function $le(e,t){return at(Pg.count(pa(e)-1,e),t,2)}function sL(e){var t=e.getDay();return t>=4||t===0?Hl(e):Hl.ceil(e)}function Ble(e,t){return e=sL(e),at(Hl.count(pa(e),e)+(pa(e).getDay()===4),t,2)}function Ule(e){return e.getDay()}function Vle(e,t){return at(Gp.count(pa(e)-1,e),t,2)}function Wle(e,t){return at(e.getFullYear()%100,t,2)}function Hle(e,t){return e=sL(e),at(e.getFullYear()%100,t,2)}function Kle(e,t){return at(e.getFullYear()%1e4,t,4)}function qle(e,t){var n=e.getDay();return e=n>=4||n===0?Hl(e):Hl.ceil(e),at(e.getFullYear()%1e4,t,4)}function Gle(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+at(t/60|0,"0",2)+at(t%60,"0",2)}function QE(e,t){return at(e.getUTCDate(),t,2)}function Yle(e,t){return at(e.getUTCHours(),t,2)}function Xle(e,t){return at(e.getUTCHours()%12||12,t,2)}function Zle(e,t){return at(1+Cg.count(ma(e),e),t,3)}function oL(e,t){return at(e.getUTCMilliseconds(),t,3)}function Qle(e,t){return oL(e,t)+"000"}function Jle(e,t){return at(e.getUTCMonth()+1,t,2)}function ece(e,t){return at(e.getUTCMinutes(),t,2)}function tce(e,t){return at(e.getUTCSeconds(),t,2)}function nce(e){var t=e.getUTCDay();return t===0?7:t}function rce(e,t){return at(Eg.count(ma(e)-1,e),t,2)}function lL(e){var t=e.getUTCDay();return t>=4||t===0?Kl(e):Kl.ceil(e)}function ice(e,t){return e=lL(e),at(Kl.count(ma(e),e)+(ma(e).getUTCDay()===4),t,2)}function ace(e){return e.getUTCDay()}function sce(e,t){return at(Yp.count(ma(e)-1,e),t,2)}function oce(e,t){return at(e.getUTCFullYear()%100,t,2)}function lce(e,t){return e=lL(e),at(e.getUTCFullYear()%100,t,2)}function cce(e,t){return at(e.getUTCFullYear()%1e4,t,4)}function uce(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Kl(e):Kl.ceil(e),at(e.getUTCFullYear()%1e4,t,4)}function dce(){return"+0000"}function JE(){return"%"}function e5(e){return+e}function t5(e){return Math.floor(+e/1e3)}var $o,cL,uL;fce({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 fce(e){return $o=fle(e),cL=$o.format,$o.parse,uL=$o.utcFormat,$o.utcParse,$o}function hce(e){return new Date(e)}function pce(e){return e instanceof Date?+e:+new Date(+e)}function MS(e,t,n,r,i,a,s,o,c,u){var d=bS(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),y=u("%I:%M"),x=u("%I %p"),v=u("%a %d"),b=u("%b %d"),w=u("%B"),S=u("%Y");function k(j){return(c(j)<j?p:o(j)<j?g:s(j)<j?y:a(j)<j?x:r(j)<j?i(j)<j?v:b:n(j)<j?w:S)(j)}return d.invert=function(j){return new Date(f(j))},d.domain=function(j){return arguments.length?h(Array.from(j,pce)):h().map(hce)},d.ticks=function(j){var N=h();return e(N[0],N[N.length-1],j??10)},d.tickFormat=function(j,N){return N==null?k:u(N)},d.nice=function(j){var N=h();return(!j||typeof j.range!="function")&&(j=t(N[0],N[N.length-1],j??10)),j?h(X3(N,j)):d},d.copy=function(){return Hd(d,MS(e,t,n,r,i,a,s,o,c,u))},d}function mce(){return Kr.apply(MS(ule,dle,pa,_S,Pg,Kd,TS,ES,Zs,cL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gce(){return Kr.apply(MS(lle,cle,ma,DS,Eg,Cg,OS,AS,Zs,uL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ag(){var e=0,t=1,n,r,i,a,s=Wn,o=!1,c;function u(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(a(f)-n)*i,o?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?(o=!!f,u):o},u.interpolator=function(f){return arguments.length?(s=f,u):s};function d(f){return function(h){var p,g;return arguments.length?([p,g]=h,s=f(p,g),u):[s(0),s(1)]}}return u.range=d(lc),u.rangeRound=d(vS),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 ks(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function dL(){var e=Ss(Ag()(Wn));return e.copy=function(){return ks(e,dL())},Na.apply(e,arguments)}function fL(){var e=kS(Ag()).domain([1,10]);return e.copy=function(){return ks(e,fL()).base(e.base())},Na.apply(e,arguments)}function hL(){var e=jS(Ag());return e.copy=function(){return ks(e,hL()).constant(e.constant())},Na.apply(e,arguments)}function IS(){var e=NS(Ag());return e.copy=function(){return ks(e,IS()).exponent(e.exponent())},Na.apply(e,arguments)}function yce(){return IS.apply(null,arguments).exponent(.5)}function pL(){var e=[],t=Wn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Vd(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(is),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)=>noe(e,a/r))},n.copy=function(){return pL(t).domain(e)},Na.apply(n,arguments)}function Tg(){var e=0,t=.5,n=1,r=1,i,a,s,o,c,u=Wn,d,f=!1,h;function p(y){return isNaN(y=+y)?h:(y=.5+((y=+d(y))-a)*(r*y<r*a?o:c),u(f?Math.max(0,Math.min(1,y)):y))}p.domain=function(y){return arguments.length?([e,t,n]=y,i=d(e=+e),a=d(t=+t),s=d(n=+n),o=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(y){return arguments.length?(f=!!y,p):f},p.interpolator=function(y){return arguments.length?(u=y,p):u};function g(y){return function(x){var v,b,w;return arguments.length?([v,b,w]=x,u=Aoe(y,[v,b,w]),p):[u(0),u(.5),u(1)]}}return p.range=g(lc),p.rangeRound=g(vS),p.unknown=function(y){return arguments.length?(h=y,p):h},function(y){return d=y,i=y(e),a=y(t),s=y(n),o=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,p}}function mL(){var e=Ss(Tg()(Wn));return e.copy=function(){return ks(e,mL())},Na.apply(e,arguments)}function gL(){var e=kS(Tg()).domain([.1,1,10]);return e.copy=function(){return ks(e,gL()).base(e.base())},Na.apply(e,arguments)}function yL(){var e=jS(Tg());return e.copy=function(){return ks(e,yL()).constant(e.constant())},Na.apply(e,arguments)}function LS(){var e=NS(Tg());return e.copy=function(){return ks(e,LS()).exponent(e.exponent())},Na.apply(e,arguments)}function xce(){return LS.apply(null,arguments).exponent(.5)}const tu=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:gS,scaleDiverging:mL,scaleDivergingLog:gL,scaleDivergingPow:LS,scaleDivergingSqrt:xce,scaleDivergingSymlog:yL,scaleIdentity:Y3,scaleImplicit:Uv,scaleLinear:G3,scaleLog:Z3,scaleOrdinal:mS,scalePoint:aoe,scalePow:CS,scaleQuantile:eL,scaleQuantize:tL,scaleRadial:J3,scaleSequential:dL,scaleSequentialLog:fL,scaleSequentialPow:IS,scaleSequentialQuantile:pL,scaleSequentialSqrt:yce,scaleSequentialSymlog:hL,scaleSqrt:Qoe,scaleSymlog:Q3,scaleThreshold:nL,scaleTime:mce,scaleUtc:gce,tickFormat:q3},Symbol.toStringTag,{value:"Module"}));function vce(e){if(e in tu)return tu[e]();var t="scale".concat(Md(e));if(t in tu)return tu[t]()}function n5(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=vce(e);if(r!=null)return r.domain(t).range(n),r}}function RS(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?n5(e.scale,n,r):n5(t,n,r)}function bce(e){return"scale".concat(Md(e))}function wce(e){return bce(e)in tu}var xL=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return wce(r)?r:"point"}};function Sce(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function vL(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var s;return(s=e(a))!==null&&s!==void 0?s:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var s,o,c=Sce(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var u=(s=r[c-1])!==null&&s!==void 0?s:0,d=(o=r[c])!==null&&o!==void 0?o:0;return Math.abs(a-u)<=Math.abs(a-d)?n[c-1]:n[c]}}}function kce(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):vL(e,void 0)}function r5(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 Xp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r5(Object(n),!0).forEach(function(r){jce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jce(e,t,n){return(t=Nce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nce(e){var t=Cce(e,"string");return typeof t=="symbol"?t:t+""}function Cce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kv=[0,"auto"],Jt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},bL=(e,t)=>e.cartesianAxis.xAxis[t],Ca=(e,t)=>{var n=bL(e,t);return n??Jt},en={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Kv,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:Rd},wL=(e,t)=>e.cartesianAxis.yAxis[t],Pa=(e,t)=>{var n=wL(e,t);return n??en},Pce={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},FS=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Pce},Xn=(e,t,n)=>{switch(t){case"xAxis":return Ca(e,n);case"yAxis":return Pa(e,n);case"zAxis":return FS(e,n);case"angleAxis":return lS(e,n);case"radiusAxis":return cS(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Ece=(e,t,n)=>{switch(t){case"xAxis":return Ca(e,n);case"yAxis":return Pa(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},qd=(e,t,n)=>{switch(t){case"xAxis":return Ca(e,n);case"yAxis":return Pa(e,n);case"angleAxis":return lS(e,n);case"radiusAxis":return cS(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},SL=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function kL(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var jL=e=>e.graphicalItems.cartesianItems,Ace=q([fn,Sg],kL),NL=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Gd=q([jL,Xn,Ace],NL,{memoizeOptions:{resultEqualityCheck:jg}}),CL=q([Gd],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(fS)),PL=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Tce=q([Gd],PL),EL=e=>e.map(t=>t.data).filter(Boolean).flat(1),Oce=q([Gd],EL,{memoizeOptions:{resultEqualityCheck:jg}}),AL=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},zS=q([Oce,v3],AL),TL=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Sn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Sn(i,r)}))):e.map(r=>({value:r})),Yd=q([zS,Xn,Gd],TL);function jl(e){if(Ii(e)||e instanceof Date){var t=Number(e);if(Xe(t))return t}}function i5(e){if(Array.isArray(e)){var t=[jl(e[0]),jl(e[1])];return Oi(t)?t:void 0}var n=jl(e);if(n!=null)return[n,n]}function ga(e){return e.map(jl).filter(tr)}function _ce(e,t){var n=jl(e),r=jl(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Dce=q([Yd],e=>e==null?void 0:e.map(t=>t.value).sort(_ce));function OL(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Mce(e,t,n){return!n||typeof t!="number"||Mi(t)?[]:n.length?ga(n.flatMap(r=>{var i=Sn(e,r.dataKey),a,s;if(Array.isArray(i)?[a,s]=i:a=s=i,!(!Xe(a)||!Xe(s)))return[t-a,t+s]})):[]}var sn=e=>{var t=hn(e),n=oc(e);return qd(e,t,n)},Xd=q([sn],e=>e==null?void 0:e.dataKey),Ice=q([CL,v3,sn],F3),_L=(e,t,n,r)=>{var i={},a=t.reduce((s,o)=>{if(o.stackId==null)return s;var c=s[o.stackId];return c==null&&(c=[]),c.push(o),s[o.stackId]=c,s},i);return Object.fromEntries(Object.entries(a).map(s=>{var[o,c]=s,u=r?[...c].reverse():c,d=u.map(dS);return[o,{stackedData:wre(e,d,n),graphicalItems:u}]}))},DL=q([Ice,CL,xg,O3],_L),ML=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var s=Nre(e,i,a);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},Lce=q([Xn],e=>e.allowDataOverflow),$S=e=>{var t;if(e==null||!("domain"in e))return Kv;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=ga(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:Kv},IL=q([Xn],$S),LL=q([IL,Lce],b3),Rce=q([DL,ja,fn,LL],ML,{memoizeOptions:{resultEqualityCheck:kg}}),BS=e=>e.errorBars,Fce=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>OL(n,r)),Zp=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),s=Math.min(...a),o=Math.max(...a);return[s,o]}},RL=(e,t,n,r,i)=>{var a,s;if(n.length>0&&e.forEach(o=>{n.forEach(c=>{var u,d,f=(u=r[c.id])===null||u===void 0?void 0:u.filter(v=>OL(i,v)),h=Sn(o,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),p=Mce(o,h,f);if(p.length>=2){var g=Math.min(...p),y=Math.max(...p);(a==null||g<a)&&(a=g),(s==null||y>s)&&(s=y)}var x=i5(h);x!=null&&(a=a==null?x[0]:Math.min(a,x[0]),s=s==null?x[1]:Math.max(s,x[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(o=>{var c=i5(Sn(o,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),s=s==null?c[1]:Math.max(s,c[1]))}),Xe(a)&&Xe(s))return[a,s]},zce=q([zS,Xn,Tce,BS,fn],RL,{memoizeOptions:{resultEqualityCheck:kg}});function $ce(e){var{value:t}=e;if(Ii(t)||t instanceof Date)return t}var Bce=(e,t,n)=>{var r=e.map($ce).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&NM(r))?y3(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},FL=e=>e.referenceElements.dots,cc=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Uce=q([FL,fn,Sg],cc),zL=e=>e.referenceElements.areas,Vce=q([zL,fn,Sg],cc),$L=e=>e.referenceElements.lines,Wce=q([$L,fn,Sg],cc),BL=(e,t)=>{if(e!=null){var n=ga(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Hce=q(Uce,fn,BL),UL=(e,t)=>{if(e!=null){var n=ga(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Kce=q([Vce,fn],UL);function qce(e){var t;if(e.x!=null)return ga([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:ga(n)}function Gce(e){var t;if(e.y!=null)return ga([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:ga(n)}var VL=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?qce(r):Gce(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Yce=q([Wce,fn],VL),Xce=q(Hce,Yce,Kce,(e,t,n)=>Zp(e,n,t)),WL=(e,t,n,r,i,a,s,o)=>{if(n!=null)return n;var c=s==="vertical"&&o==="xAxis"||s==="horizontal"&&o==="yAxis",u=c?Zp(r,a,i):Zp(a,i);return Tse(t,u,e.allowDataOverflow)},Zce=q([Xn,IL,LL,Rce,zce,Xce,_t,fn],WL,{memoizeOptions:{resultEqualityCheck:kg}}),Qce=[0,1],HL=(e,t,n,r,i,a,s)=>{if(!((e==null||n==null||n.length===0)&&s===void 0)){var{dataKey:o,type:c}=e,u=Bi(t,a);if(u&&o==null){var d;return y3(0,(d=n==null?void 0:n.length)!==null&&d!==void 0?d:0)}return c==="category"?Bce(r,e,u):i==="expand"?Qce:s}},US=q([Xn,_t,zS,Yd,xg,fn,Zce],HL),uc=q([Xn,SL,aS],xL),KL=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=$S(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Oi(e)){if(a)return pE(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return mE(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Oi(e))return pE(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Oi(e))return mE(e,t.tickCount,t.allowDecimals,"adaptive")}}},VS=q([US,qd,uc],KL),qL=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Oi(t)&&Array.isArray(n)&&n.length>0){var i,a,s=t[0],o=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],u=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(s,o),Math.max(c,u)]}return t},Jce=q([Xn,US,VS,fn],qL),eue=q(Yd,Xn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(ga(e.map(f=>f.value))).sort((f,h)=>f-h),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var s=a-i;if(s===0)return 1/0;for(var o=0;o<r.length-1;o++){var c=r[o],u=r[o+1];if(!(c==null||u==null)){var d=u-c;n=Math.min(n,d)}}return n/s}}),GL=q(eue,_t,Ise,Nn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Xe(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var s=ps(n,e*a),o=e*a/2;return o-s-(o-s)/a*s}return 0}),tue=(e,t,n)=>{var r=Ca(e,t);return r==null||typeof r.padding!="string"?0:GL(e,"xAxis",t,n,r.padding)},nue=(e,t,n)=>{var r=Pa(e,t);return r==null||typeof r.padding!="string"?0:GL(e,"yAxis",t,n,r.padding)},rue=q(Ca,tue,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),iue=q(Pa,nue,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),aue=q([Nn,rue,fg,dg,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),sue=q([Nn,_t,iue,fg,dg,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:s}=i;return a?[r.height-s.bottom,s.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Zd=(e,t,n,r)=>{var i;switch(t){case"xAxis":return aue(e,n,r);case"yAxis":return sue(e,n,r);case"zAxis":return(i=FS(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return I3(e);case"radiusAxis":return L3(e,n);default:return}},YL=q([Xn,Zd],vg),oue=q([uc,Jce],Wse),WS=q([Xn,uc,oue,YL],RS),XL=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,s=Bi(e,r);if(s&&(i==="number"||a!=="auto"))return t.map(o=>o.value)}},HS=q([_t,Yd,qd,fn],XL),Og=q([WS],hS);q([WS],kce);q([WS,Dce],vL);q([Gd,BS,fn],Fce);function ZL(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var _g=(e,t)=>t,Dg=(e,t,n)=>n,lue=q(cg,_g,Dg,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(ZL)),cue=q(ug,_g,Dg,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(ZL)),QL=(e,t)=>({width:e.width,height:t.height}),uue=(e,t)=>{var n=typeof t.width=="number"?t.width:Rd;return{width:n,height:e.height}},due=q(Nn,Ca,QL),fue=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},hue=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},pue=q(ka,Nn,lue,_g,Dg,(e,t,n,r,i)=>{var a={},s;return n.forEach(o=>{var c=QL(t,o);s==null&&(s=fue(t,r,e));var u=r==="top"&&!i||r==="bottom"&&i;a[o.id]=s-Number(u)*c.height,s+=(u?-1:1)*c.height}),a}),mue=q(Sa,Nn,cue,_g,Dg,(e,t,n,r,i)=>{var a={},s;return n.forEach(o=>{var c=uue(t,o);s==null&&(s=hue(t,r,e));var u=r==="left"&&!i||r==="right"&&i;a[o.id]=s-Number(u)*c.width,s+=(u?-1:1)*c.width}),a}),gue=(e,t)=>{var n=Ca(e,t);if(n!=null)return pue(e,n.orientation,n.mirror)},yue=q([Nn,Ca,gue,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),xue=(e,t)=>{var n=Pa(e,t);if(n!=null)return mue(e,n.orientation,n.mirror)},vue=q([Nn,Pa,xue,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),bue=q(Nn,Pa,(e,t)=>{var n=typeof t.width=="number"?t.width:Rd;return{width:n,height:e.height}}),JL=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:s}=n,o=Bi(e,r),c=t.map(u=>u.value);if(s&&o&&a==="category"&&i&&NM(c))return c}},KS=q([_t,Yd,Xn,fn],JL),a5=q([_t,Ece,uc,Og,KS,HS,Zd,VS,fn],(e,t,n,r,i,a,s,o,c)=>{if(t!=null){var u=Bi(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:u,niceTicks:o,range:s,realScaleType:n,scale:r}}}),wue=(e,t,n,r,i,a,s,o,c)=>{if(!(t==null||r==null)){var u=Bi(e,c),{type:d,ticks:f,tickCount:h}=t,p=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,g=d==="category"&&r.bandwidth?r.bandwidth()/p:0;g=c==="angleAxis"&&a!=null&&a.length>=2?Fr(a[0]-a[1])*2*g:g;var y=f||i;return y?y.map((x,v)=>{var b=s?s.indexOf(x):x,w=r.map(b);return Xe(w)?{index:v,coordinate:w+g,value:x,offset:g}:null}).filter(tr):u&&o?o.map((x,v)=>{var b=r.map(x);return Xe(b)?{coordinate:b+g,value:x,index:v,offset:g}:null}).filter(tr):r.ticks?r.ticks(h).map((x,v)=>{var b=r.map(x);return Xe(b)?{coordinate:b+g,value:x,index:v,offset:g}:null}).filter(tr):r.domain().map((x,v)=>{var b=r.map(x);return Xe(b)?{coordinate:b+g,value:s?s[x]:x,index:v,offset:g}:null}).filter(tr)}},eR=q([_t,qd,uc,Og,VS,Zd,KS,HS,fn],wue),Sue=(e,t,n,r,i,a,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var o=Bi(e,s),{tickCount:c}=t,u=0;return u=s==="angleAxis"&&(r==null?void 0:r.length)>=2?Fr(r[0]-r[1])*2*u:u,o&&a?a.map((d,f)=>{var h=n.map(d);return Xe(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter(tr):n.ticks?n.ticks(c).map((d,f)=>{var h=n.map(d);return Xe(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter(tr):n.domain().map((d,f)=>{var h=n.map(d);return Xe(h)?{coordinate:h+u,value:i?i[d]:d,index:f,offset:u}:null}).filter(tr)}},tR=q([_t,qd,Og,Zd,KS,HS,fn],Sue),nR=q(Xn,Og,(e,t)=>{if(!(e==null||t==null))return Xp(Xp({},e),{},{scale:t})}),kue=q([Xn,uc,US,YL],RS),jue=q([kue],hS);q((e,t,n)=>FS(e,n),jue,(e,t)=>{if(!(e==null||t==null))return Xp(Xp({},e),{},{scale:t})});var Nue=q([_t,cg,ug],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),Cue=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};q([Cue],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var s=Math.abs(a.coordinate-t);s<r&&(r=s,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var rR=e=>e.options.defaultTooltipEventType,iR=e=>e.options.validateTooltipEventTypes;function aR(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function qS(e,t){var n=rR(e),r=iR(e);return aR(t,n,r)}function Pue(e){return De(t=>qS(t,e))}var sR=(e,t)=>{var n,r=Number(t);if(!(Mi(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Eue=e=>e.tooltip.settings,Wa={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Aue={itemInteraction:{click:Wa,hover:Wa},axisInteraction:{click:Wa,hover:Wa},keyboardInteraction:Wa,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},oR=$n({name:"tooltip",initialState:Aue,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:kt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=zr(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:kt()},removeTooltipEntrySettings:{reducer(e,t){var n=zr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:kt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Tue,replaceTooltipEntrySettings:Oue,removeTooltipEntrySettings:_ue,setTooltipSettingsState:Due,setActiveMouseOverItemIndex:Mue,mouseLeaveItem:dye,mouseLeaveChart:lR,setActiveClickItemIndex:fye,setMouseOverAxisIndex:cR,setMouseClickAxisIndex:Iue,setSyncInteraction:qv,setKeyboardInteraction:Qp}=oR.actions,Lue=oR.reducer;function s5(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 qf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s5(Object(n),!0).forEach(function(r){Rue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rue(e,t,n){return(t=Fue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fue(e){var t=zue(e,"string");return typeof t=="symbol"?t:t+""}function zue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $ue(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Bue(e){return e.index!=null}var uR=(e,t,n,r)=>{if(t==null)return Wa;var i=$ue(e,t,n);if(i==null)return Wa;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(Bue(i)){if(a)return qf(qf({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return qf(qf({},Wa),{},{coordinate:i.coordinate})};function Uue(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function Vue(e,t){var n=Uue(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),s=Math.max(r,i);return n>=a&&n<=s}function Wue(e,t,n){if(n==null||t==null)return!0;var r=Sn(e,t);return r==null||!Oi(n)?!0:Vue(r,n)}var GS=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Xe(a))return i;var s=0,o=1/0;t.length>0&&(o=t.length-1);var c=Math.max(s,Math.min(a,o)),u=t[c];return u==null||Wue(u,n,r)?String(c):null},dR=(e,t,n,r,i,a,s)=>{if(a!=null){var o=s[0],c=o==null?void 0:o.getPosition(a);if(c!=null)return c;var u=i==null?void 0:i[Number(a)];if(u)switch(n){case"horizontal":return{x:u.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:u.coordinate}}}},fR=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(s=>{var o;return((o=s.settings)===null||o===void 0?void 0:o.graphicalItemId)===i})},hR=e=>e.options.tooltipPayloadSearcher,dc=e=>e.tooltip;function o5(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 l5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o5(Object(n),!0).forEach(function(r){Hue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hue(e,t,n){return(t=Kue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kue(e){var t=que(e,"string");return typeof t=="symbol"?t:t+""}function que(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gue(e){if(typeof e=="string"||typeof e=="number")return e}function Yue(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Xue(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function c5(e){if(typeof e=="string")return e}function Zue(e){if(!(e==null||typeof e!="object")){var t="name"in e?Gue(e.name):void 0,n="unit"in e?Yue(e.unit):void 0,r="dataKey"in e?Xue(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?c5(e.color):void 0,s="fill"in e?c5(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:s}}}function Que(e,t){return e??t}var pR=(e,t,n,r,i,a,s)=>{if(!(t==null||a==null)){var{chartData:o,computedData:c,dataStartIndex:u,dataEndIndex:d}=n,f=[];return e.reduce((h,p)=>{var g,{dataDefinedOnItem:y,settings:x}=p,v=Que(y,o),b=Array.isArray(v)?FI(v,u,d):v,w=(g=x==null?void 0:x.dataKey)!==null&&g!==void 0?g:r,S=x==null?void 0:x.nameKey,k;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&s==="axis"?k=CM(b,r,i):k=a(b,t,c,S),Array.isArray(k))k.forEach(N=>{var P,T,E=Zue(N),_=E==null?void 0:E.name,C=E==null?void 0:E.dataKey,A=E==null?void 0:E.payload,M=l5(l5({},x),{},{name:_,unit:E==null?void 0:E.unit,color:(P=E==null?void 0:E.color)!==null&&P!==void 0?P:x==null?void 0:x.color,fill:(T=E==null?void 0:E.fill)!==null&&T!==void 0?T:x==null?void 0:x.fill});h.push(fP({tooltipEntrySettings:M,dataKey:C,payload:A,value:Sn(A,C),name:_==null?void 0:String(_)}))});else{var j;h.push(fP({tooltipEntrySettings:x,dataKey:w,payload:k,value:Sn(k,w),name:(j=Sn(k,S))!==null&&j!==void 0?j:x==null?void 0:x.name}))}return h},f)}},YS=q([sn,SL,aS],xL),Jue=q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),ede=q([hn,oc],kL),fc=q([Jue,sn,ede],NL,{memoizeOptions:{resultEqualityCheck:jg}}),tde=q([fc],e=>e.filter(fS)),nde=q([fc],EL,{memoizeOptions:{resultEqualityCheck:jg}}),hc=q([nde,ja],AL),rde=q([tde,ja,sn],F3),XS=q([hc,sn,fc],TL),mR=q([sn],$S),ide=q([sn],e=>e.allowDataOverflow),gR=q([mR,ide],b3),ade=q([fc],e=>e.filter(fS)),sde=q([rde,ade,xg,O3],_L),ode=q([sde,ja,hn,gR],ML),lde=q([fc],PL),cde=q([hc,sn,lde,BS,hn],RL,{memoizeOptions:{resultEqualityCheck:kg}}),ude=q([FL,hn,oc],cc),dde=q([ude,hn],BL),fde=q([zL,hn,oc],cc),hde=q([fde,hn],UL),pde=q([$L,hn,oc],cc),mde=q([pde,hn],VL),gde=q([dde,mde,hde],Zp),yde=q([sn,mR,gR,ode,cde,gde,_t,hn],WL),Qd=q([sn,_t,hc,XS,xg,hn,yde],HL),xde=q([Qd,sn,YS],KL),vde=q([sn,Qd,xde,hn],qL),yR=e=>{var t=hn(e),n=oc(e),r=!1;return Zd(e,t,n,r)},xR=q([sn,yR],vg),bde=q([sn,YS,vde,xR],RS),vR=q([bde],hS),wde=q([_t,XS,sn,hn],JL),Sde=q([_t,XS,sn,hn],XL),kde=(e,t,n,r,i,a,s,o)=>{if(t){var{type:c}=t,u=Bi(e,o);if(r){var d=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,f=c==="category"&&r.bandwidth?r.bandwidth()/d:0;return f=o==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?Fr(i[0]-i[1])*2*f:f,u&&s?s.map((h,p)=>{var g=r.map(h);return Xe(g)?{coordinate:g+f,value:h,index:p,offset:f}:null}).filter(tr):r.domain().map((h,p)=>{var g=r.map(h);return Xe(g)?{coordinate:g+f,value:a?a[h]:h,index:p,offset:f}:null}).filter(tr)}}},Ea=q([_t,sn,YS,vR,yR,wde,Sde,hn],kde),ZS=q([rR,iR,Eue],(e,t,n)=>aR(n.shared,e,t)),bR=e=>e.tooltip.settings.trigger,QS=e=>e.tooltip.settings.defaultIndex,Jd=q([dc,ZS,bR,QS],uR),fd=q([Jd,hc,Xd,Qd],GS),wR=q([Ea,fd],sR),jde=q([Jd],e=>{if(e)return e.dataKey}),Nde=q([Jd],e=>{if(e)return e.graphicalItemId}),SR=q([dc,ZS,bR,QS],fR),Cde=q([Sa,ka,_t,Nn,Ea,QS,SR],dR),Pde=q([Jd,Cde],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Ede=q([Jd],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),Ade=q([SR,fd,ja,Xd,wR,hR,ZS],pR),Tde=q([Ade],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function u5(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 d5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u5(Object(n),!0).forEach(function(r){Ode(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ode(e,t,n){return(t=_de(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _de(e){var t=Dde(e,"string");return typeof t=="symbol"?t:t+""}function Dde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mde=()=>De(sn),Ide=()=>{var e=Mde(),t=De(Ea),n=De(vR);return Ep(!e||!n?void 0:d5(d5({},e),{},{scale:n}),t)};function f5(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 Bo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f5(Object(n),!0).forEach(function(r){Lde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lde(e,t,n){return(t=Rde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rde(e){var t=Fde(e,"string");return typeof t=="symbol"?t:t+""}function Fde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zde=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},$de=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:s}=r;return Bo(Bo(Bo({},r),bn(r.cx,r.cy,s,a)),{},{angle:a,radius:s})}var o=i.coordinate,{angle:c}=r;return Bo(Bo(Bo({},r),bn(r.cx,r.cy,o,c)),{},{angle:c,radius:o})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Bde(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var kR=(e,t,n,r,i)=>{var a,s=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(s<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<s;o++){var c,u,d,f,h,p=o>0?(c=n[o-1])===null||c===void 0?void 0:c.coordinate:(u=n[s-1])===null||u===void 0?void 0:u.coordinate,g=(d=n[o])===null||d===void 0?void 0:d.coordinate,y=o>=s-1?(f=n[0])===null||f===void 0?void 0:f.coordinate:(h=n[o+1])===null||h===void 0?void 0:h.coordinate,x=void 0;if(!(p==null||g==null||y==null))if(Fr(g-p)!==Fr(y-g)){var v=[];if(Fr(y-g)===Fr(i[1]-i[0])){x=y;var b=g+i[1]-i[0];v[0]=Math.min(b,(b+p)/2),v[1]=Math.max(b,(b+p)/2)}else{x=p;var w=y+i[1]-i[0];v[0]=Math.min(g,(w+g)/2),v[1]=Math.max(g,(w+g)/2)}var S=[Math.min(g,(x+g)/2),Math.max(g,(x+g)/2)];if(e>S[0]&&e<=S[1]||e>=v[0]&&e<=v[1]){var k;return(k=n[o])===null||k===void 0?void 0:k.index}}else{var j=Math.min(p,y),N=Math.max(p,y);if(e>(j+g)/2&&e<=(N+g)/2){var P;return(P=n[o])===null||P===void 0?void 0:P.index}}}else if(t)for(var T=0;T<s;T++){var E=t[T];if(E!=null){var _=t[T+1],C=t[T-1];if(T===0&&_!=null&&e<=(E.coordinate+_.coordinate)/2||T===s-1&&C!=null&&e>(E.coordinate+C.coordinate)/2||T>0&&T<s-1&&C!=null&&_!=null&&e>(E.coordinate+C.coordinate)/2&&e<=(E.coordinate+_.coordinate)/2)return E.index}}return-1},jR=()=>De(aS),JS=(e,t)=>t,NR=(e,t,n)=>n,ek=(e,t,n,r)=>r,Ude=q(Ea,e=>Jm(e,t=>t.coordinate)),tk=q([dc,JS,NR,ek],uR),nk=q([tk,hc,Xd,Qd],GS),Vde=(e,t,n)=>{if(t!=null){var r=dc(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},CR=q([dc,JS,NR,ek],fR),Jp=q([Sa,ka,_t,Nn,Ea,ek,CR],dR),Wde=q([tk,Jp],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),PR=q([Ea,nk],sR),Hde=q([CR,nk,ja,Xd,PR,hR,JS],pR),Kde=q([tk,nk],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),qde=(e,t,n,r,i,a,s)=>{if(!(!e||!n||!r||!i)&&Bde(e,s)){var o=Cre(e,t),c=kR(o,a,i,n,r),u=zde(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},Gde=(e,t,n,r,i,a,s)=>{if(!(!e||!r||!i||!a||!n)){var o=Sse(e,n);if(o){var c=Pre(o,t),u=kR(c,s,a,r,i),d=$de(t,a,u,o);return{activeIndex:String(u),activeCoordinate:d}}}},Yde=(e,t,n,r,i,a,s,o)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?qde(e,t,r,i,a,s,o):Gde(e,t,n,r,i,a,s)},Xde=q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Zde=q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Vn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Vse}});function h5(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 p5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h5(Object(n),!0).forEach(function(r){Qde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qde(e,t,n){return(t=Jde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jde(e){var t=efe(e,"string");return typeof t=="symbol"?t:t+""}function efe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tfe={},nfe={zIndexMap:Object.values(Vn).reduce((e,t)=>p5(p5({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),tfe)},rfe=new Set(Object.values(Vn));function ife(e){return rfe.has(e)}var ER=$n({name:"zIndex",initialState:nfe,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:kt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!ife(n)&&delete e.zIndexMap[n])},prepare:kt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:kt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:kt()}}}),{registerZIndexPortal:afe,unregisterZIndexPortal:sfe,registerZIndexPortalElement:ofe,unregisterZIndexPortalElement:lfe}=ER.actions,cfe=ER.reducer;function Aa(e){var{zIndex:t,children:n}=e,r=nie(),i=r&&t!==void 0&&t!==0,a=lr(),s=Ut();m.useLayoutEffect(()=>i?(s(afe({zIndex:t})),()=>{s(sfe({zIndex:t}))}):Ao,[s,t,i]);var o=De(c=>Xde(c,t,a));return i?o?Co.createPortal(n,o):null:n}function Gv(){return Gv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gv.apply(null,arguments)}function m5(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 Gf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m5(Object(n),!0).forEach(function(r){ufe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ufe(e,t,n){return(t=dfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dfe(e){var t=ffe(e,"string");return typeof t=="symbol"?t:t+""}function ffe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hfe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return m.isValidElement(t)?m.cloneElement(t,r):m.createElement(n,r)}function pfe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:s,layout:o,cursor:c,tooltipEventType:u,chartName:d}=e,f=n,h=r,p=i;if(!c||!f||d!=="ScatterChart"&&u!=="axis")return null;var g,y,x;if(d==="ScatterChart")g=f,y=Mae,x=Vn.cursorLine;else if(d==="BarChart")g=Iae(o,f,a,s),y=fse,x=Vn.cursorRectangle;else if(o==="radial"&&AM(f)){var{cx:v,cy:b,radius:w,startAngle:S,endAngle:k}=f3(f);g={cx:v,cy:b,startAngle:S,endAngle:k,innerRadius:w,outerRadius:w},y=Cse,x=Vn.cursorLine}else g={points:Pse(o,f,a)},y=Sh,x=Vn.cursorLine;var j=typeof c=="object"&&"className"in c?c.className:void 0,N=Gf(Gf(Gf(Gf({stroke:"#ccc",pointerEvents:"none"},a),g),Vm(c)),{},{payload:h,payloadIndex:p,className:ct("recharts-tooltip-cursor",j)});return m.createElement(Aa,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:x},m.createElement(hfe,{cursor:c,cursorComp:y,cursorProps:N}))}function mfe(e){var t=Ide(),n=XI(),r=ic(),i=jR();return t==null||n==null||r==null||i==null?null:m.createElement(pfe,Gv({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var AR=m.createContext(null),gfe=()=>m.useContext(AR),TR={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,f||c,h),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=p,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function o(){this._events=new r,this._eventsCount=0}o.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},o.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,g=new Array(p);h<p;h++)g[h]=f[h].fn;return g},o.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},o.prototype.emit=function(u,d,f,h,p,g){var y=n?n+u:u;if(!this._events[y])return!1;var x=this._events[y],v=arguments.length,b,w;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),v){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,d),!0;case 3:return x.fn.call(x.context,d,f),!0;case 4:return x.fn.call(x.context,d,f,h),!0;case 5:return x.fn.call(x.context,d,f,h,p),!0;case 6:return x.fn.call(x.context,d,f,h,p,g),!0}for(w=1,b=new Array(v-1);w<v;w++)b[w-1]=arguments[w];x.fn.apply(x.context,b)}else{var S=x.length,k;for(w=0;w<S;w++)switch(x[w].once&&this.removeListener(u,x[w].fn,void 0,!0),v){case 1:x[w].fn.call(x[w].context);break;case 2:x[w].fn.call(x[w].context,d);break;case 3:x[w].fn.call(x[w].context,d,f);break;case 4:x[w].fn.call(x[w].context,d,f,h);break;default:if(!b)for(k=1,b=new Array(v-1);k<v;k++)b[k-1]=arguments[k];x[w].fn.apply(x[w].context,b)}}return!0},o.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},o.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},o.prototype.removeListener=function(u,d,f,h){var p=n?n+u:u;if(!this._events[p])return this;if(!d)return s(this,p),this;var g=this._events[p];if(g.fn)g.fn===d&&(!h||g.once)&&(!f||g.context===f)&&s(this,p);else{for(var y=0,x=[],v=g.length;y<v;y++)(g[y].fn!==d||h&&!g[y].once||f&&g[y].context!==f)&&x.push(g[y]);x.length?this._events[p]=x.length===1?x[0]:x:s(this,p)}return this},o.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&s(this,d)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o})(TR);var yfe=TR.exports;const xfe=fi(yfe);var hd=new xfe,Yv="recharts.syncEvent.tooltip",g5="recharts.syncEvent.brush",vfe=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Mi(n))return e[n]}},bfe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},OR=$n({name:"options",initialState:bfe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),wfe=OR.reducer,{createEventEmitter:Sfe}=OR.actions;function kfe(e){return e.tooltip.syncInteraction}var jfe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},_R=$n({name:"chartData",initialState:jfe,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:y5,setDataStartEndIndexes:Nfe,setComputedData:hye}=_R.actions,Cfe=_R.reducer,Pfe=["x","y"];function x5(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 Uo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x5(Object(n),!0).forEach(function(r){Efe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Efe(e,t,n){return(t=Afe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Afe(e){var t=Tfe(e,"string");return typeof t=="symbol"?t:t+""}function Tfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ofe(e,t){if(e==null)return{};var n,r,i=_fe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _fe(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 Dfe(){var e=De(sS),t=De(oS),n=Ut(),r=De(_3),i=De(Ea),a=ic(),s=hg(),o=De(c=>c.rootProps.className);m.useEffect(()=>{if(e==null)return Ao;var c=(u,d,f)=>{if(t!==f&&e===u){if(r==="index"){var h;if(s&&d!==null&&d!==void 0&&(h=d.payload)!==null&&h!==void 0&&h.coordinate&&d.payload.sourceViewBox){var p=d.payload.coordinate,{x:g,y}=p,x=Ofe(p,Pfe),{x:v,y:b,width:w,height:S}=d.payload.sourceViewBox,k=Uo(Uo({},x),{},{x:s.x+(w?(g-v)/w:0)*s.width,y:s.y+(S?(y-b)/S:0)*s.height});n(Uo(Uo({},d),{},{payload:Uo(Uo({},d.payload),{},{coordinate:k})}))}else n(d);return}if(i!=null){var j;if(typeof r=="function"){var N={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},P=r(i,N);j=i[P]}else r==="value"&&(j=i.find(ae=>String(ae.value)===d.payload.label));var{coordinate:T}=d.payload;if(j==null||d.payload.active===!1||T==null||s==null){n(qv({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:E,y:_}=T,C=Math.min(E,s.x+s.width),A=Math.min(_,s.y+s.height),M={x:a==="horizontal"?j.coordinate:C,y:a==="horizontal"?A:j.coordinate},B=qv({active:d.payload.active,coordinate:M,dataKey:d.payload.dataKey,index:String(j.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(B)}}};return hd.on(Yv,c),()=>{hd.off(Yv,c)}},[o,n,t,e,r,i,a,s])}function Mfe(){var e=De(sS),t=De(oS),n=Ut();m.useEffect(()=>{if(e==null)return Ao;var r=(i,a,s)=>{t!==s&&e===i&&n(Nfe(a))};return hd.on(g5,r),()=>{hd.off(g5,r)}},[n,t,e])}function Ife(){var e=Ut();m.useEffect(()=>{e(Sfe())},[e]),Dfe(),Mfe()}function Lfe(e,t,n,r,i,a){var s=De(g=>Vde(g,e,t)),o=De(Nde),c=De(oS),u=De(sS),d=De(_3),f=De(kfe),h=f==null?void 0:f.active,p=hg();m.useEffect(()=>{if(!h&&u!=null&&c!=null){var g=qv({active:a,coordinate:n,dataKey:s,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:p,graphicalItemId:o});hd.emit(Yv,u,g,c)}},[h,n,s,o,i,r,c,u,d,a,p])}function v5(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 b5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v5(Object(n),!0).forEach(function(r){Rfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rfe(e,t,n){return(t=Ffe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ffe(e){var t=zfe(e,"string");return typeof t=="symbol"?t:t+""}function zfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $fe(e){return e.dataKey}function Bfe(e,t){return m.isValidElement(e)?m.cloneElement(e,t):typeof e=="function"?m.createElement(e,t):m.createElement(cae,t)}var w5=[],Ufe={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function rk(e){var t,n,r=or(e,Ufe),{active:i,allowEscapeViewBox:a,animationDuration:s,animationEasing:o,content:c,filterNull:u,isAnimationActive:d,offset:f,payloadUniqBy:h,position:p,reverseDirection:g,useTranslate3d:y,wrapperStyle:x,cursor:v,shared:b,trigger:w,defaultIndex:S,portal:k,axisId:j}=r,N=Ut(),P=typeof S=="number"?String(S):S;m.useEffect(()=>{N(Due({shared:b,trigger:w,axisId:j,active:i,defaultIndex:P}))},[N,b,w,j,i,P]);var T=hg(),E=s3(),_=Pue(b),{activeIndex:C,isActive:A}=(t=De(ce=>Kde(ce,_,w,P)))!==null&&t!==void 0?t:{},M=De(ce=>Hde(ce,_,w,P)),B=De(ce=>PR(ce,_,w,P)),ae=De(ce=>Wde(ce,_,w,P)),Q=M,I=gfe(),H=(n=i??A)!==null&&n!==void 0?n:!1,[O,oe]=lI([Q,H]),re=_==="axis"?B:void 0;Lfe(_,w,ae,re,C,H);var D=k??I;if(D==null||T==null||_==null)return null;var G=Q??w5;H||(G=w5),u&&G.length&&(G=XM(G.filter(ce=>ce.value!=null&&(ce.hide!==!0||r.includeHidden)),h,$fe));var te=G.length>0,ee=b5(b5({},r),{},{payload:G,label:re,active:H,activeIndex:C,coordinate:ae,accessibilityLayer:E}),Z=m.createElement(bae,{allowEscapeViewBox:a,animationDuration:s,animationEasing:o,isAnimationActive:d,active:H,coordinate:ae,hasPayload:te,offset:f,position:p,reverseDirection:g,useTranslate3d:y,viewBox:T,wrapperStyle:x,lastBoundingBox:O,innerRef:oe,hasPortalFromProps:!!k},Bfe(c,ee));return m.createElement(m.Fragment,null,Co.createPortal(Z,D),H&&m.createElement(mfe,{cursor:v,tooltipEventType:_,coordinate:ae,payload:G,index:C}))}function Vfe(e,t,n){return(t=Wfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wfe(e){var t=Hfe(e,"string");return typeof t=="symbol"?t:t+""}function Hfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Kfe{constructor(t){Vfe(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function S5(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 qfe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S5(Object(n),!0).forEach(function(r){Gfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gfe(e,t,n){return(t=Yfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yfe(e){var t=Xfe(e,"string");return typeof t=="symbol"?t:t+""}function Xfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zfe={cacheSize:2e3,enableCache:!0},DR=qfe({},Zfe),k5=new Kfe(DR.cacheSize),Qfe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},j5="recharts_measurement_span";function Jfe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",s=t.letterSpacing||"",o=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(s,"|").concat(o)}var N5=(e,t)=>{try{var n=document.getElementById(j5);n||(n=document.createElement("span"),n.setAttribute("id",j5),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Qfe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},bu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ud.isSsr)return{width:0,height:0};if(!DR.enableCache)return N5(t,n);var r=Jfe(t,n),i=k5.get(r);if(i)return i;var a=N5(t,n);return k5.set(r,a),a},MR;function ehe(e,t,n){return(t=the(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function the(e){var t=nhe(e,"string");return typeof t=="symbol"?t:t+""}function nhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var C5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,P5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,rhe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,ihe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,ahe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},she=["cm","mm","pt","pc","in","Q","px"];function ohe(e){return she.includes(e)}var fl="NaN";function lhe(e,t){return e*ahe[t]}class vn{static parse(t){var n,[,r,i]=(n=ihe.exec(t))!==null&&n!==void 0?n:[];return r==null?vn.NaN:new vn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Mi(t)&&(this.unit=""),n!==""&&!rhe.test(n)&&(this.num=NaN,this.unit=""),ohe(n)&&(this.num=lhe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new vn(NaN,""):new vn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new vn(NaN,""):new vn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new vn(NaN,""):new vn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new vn(NaN,""):new vn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Mi(this.num)}}MR=vn;ehe(vn,"NaN",new MR(NaN,""));function IR(e){if(e==null||e.includes(fl))return fl;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=C5.exec(t))!==null&&n!==void 0?n:[],s=vn.parse(r??""),o=vn.parse(a??""),c=i==="*"?s.multiply(o):s.divide(o);if(c.isNaN())return fl;t=t.replace(C5,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,h]=(u=P5.exec(t))!==null&&u!==void 0?u:[],p=vn.parse(d??""),g=vn.parse(h??""),y=f==="+"?p.add(g):p.subtract(g);if(y.isNaN())return fl;t=t.replace(P5,y.toString())}return t}var E5=/\(([^()]*)\)/;function che(e){for(var t=e,n;(n=E5.exec(t))!=null;){var[,r]=n;t=t.replace(E5,IR(r))}return t}function uhe(e){var t=e.replace(/\s+/g,"");return t=che(t),t=IR(t),t}function dhe(e){try{return uhe(e)}catch{return fl}}function Sy(e){var t=dhe(e.slice(5,-1));return t===fl?"":t}var fhe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],hhe=["dx","dy","angle","className","breakAll"];function Xv(){return Xv=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},Xv.apply(null,arguments)}function A5(e,t){if(e==null)return{};var n,r,i=phe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function phe(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}var LR=/[ \f\n\r\t\v\u2028\u2029]+/,RR=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];jn(t)||(n?i=t.toString().split(""):i=t.toString().split(LR));var a=i.map(o=>({word:o,width:bu(o,r).width})),s=n?0:bu(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}};function FR(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function mhe(e){return jn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var zR=(e,t,n,r)=>e.reduce((i,a)=>{var{word:s,width:o}=a,c=i[i.length-1];if(c&&o!=null&&(t==null||r||c.width+o+n<Number(t)))c.words.push(s),c.width+=o+n;else{var u={words:[s],width:o};i.push(u)}return i},[]),$R=e=>e.reduce((t,n)=>t.width>n.width?t:n),ghe="…",T5=(e,t,n,r,i,a,s,o)=>{var c=e.slice(0,t),u=RR({breakAll:n,style:r,children:c+ghe});if(!u)return[!1,[]];var d=zR(u.wordsWithComputedWidth,a,s,o),f=d.length>i||$R(d).width>Number(a);return[f,d]},yhe=(e,t,n,r,i)=>{var{maxLines:a,children:s,style:o,breakAll:c}=e,u=Oe(a),d=String(s),f=zR(t,r,n,i);if(!u||i)return f;var h=f.length>a||$R(f).width>Number(r);if(!h)return f;for(var p=0,g=d.length-1,y=0,x;p<=g&&y<=d.length-1;){var v=Math.floor((p+g)/2),b=v-1,[w,S]=T5(d,b,c,o,a,r,n,i),[k]=T5(d,v,c,o,a,r,n,i);if(!w&&!k&&(p=v+1),w&&k&&(g=v-1),!w&&k){x=S;break}y++}return x||f},O5=e=>{var t=jn(e)?[]:e.toString().split(LR);return[{words:t,width:void 0}]},xhe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:s}=e;if((t||n)&&!Ud.isSsr){var o,c,u=RR({breakAll:a,children:r,style:i});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;o=d,c=f}else return O5(r);return yhe({breakAll:a,children:r,maxLines:s,style:i},o,c,t,!!n)}return O5(r)},BR="#808080",vhe={angle:0,breakAll:!1,capHeight:"0.71em",fill:BR,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},ik=m.forwardRef((e,t)=>{var n=or(e,vhe),{x:r,y:i,lineHeight:a,capHeight:s,fill:o,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,f=A5(n,fhe),h=m.useMemo(()=>xhe({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:p,dy:g,angle:y,className:x,breakAll:v}=f,b=A5(f,hhe);if(!Ii(r)||!Ii(i)||h.length===0)return null;var w=Number(r)+(Oe(p)?p:0),S=Number(i)+(Oe(g)?g:0);if(!Xe(w)||!Xe(S))return null;var k;switch(d){case"start":k=Sy("calc(".concat(s,")"));break;case"middle":k=Sy("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(s," / 2))"));break;default:k=Sy("calc(".concat(h.length-1," * -").concat(a,")"));break}var j=[],N=h[0];if(c&&N!=null){var P=N.width,{width:T}=f;j.push("scale(".concat(Oe(T)&&Oe(P)?T/P:1,")"))}return y&&j.push("rotate(".concat(y,", ").concat(w,", ").concat(S,")")),j.length&&(b.transform=j.join(" ")),m.createElement("text",Xv({},Sr(b),{ref:t,x:w,y:S,className:ct("recharts-text",x),textAnchor:u,fill:o.includes("url")?BR:o}),h.map((E,_)=>{var C=E.words.join(v?"":" ");return m.createElement("tspan",{x:w,dy:_===0?k:a,key:"".concat(C,"-").concat(_)},C)}))});ik.displayName="Text";function _5(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 vi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_5(Object(n),!0).forEach(function(r){bhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bhe(e,t,n){return(t=whe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function whe(e){var t=She(e,"string");return typeof t=="symbol"?t:t+""}function She(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var khe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:s,height:o,upperWidth:c,lowerWidth:u}=X1(t),d=a,f=a+(c-u)/2,h=(d+f)/2,p=(c+u)/2,g=d+c/2,y=o>=0?1:-1,x=y*r,v=y>0?"end":"start",b=y>0?"start":"end",w=c>=0?1:-1,S=w*r,k=w>0?"end":"start",j=w>0?"start":"end",N=i;if(n==="top"){var P={x:d+c/2,y:s-x,horizontalAnchor:"middle",verticalAnchor:v};return N&&(P.height=Math.max(s-N.y,0),P.width=c),P}if(n==="bottom"){var T={x:f+u/2,y:s+o+x,horizontalAnchor:"middle",verticalAnchor:b};return N&&(T.height=Math.max(N.y+N.height-(s+o),0),T.width=u),T}if(n==="left"){var E={x:h-S,y:s+o/2,horizontalAnchor:k,verticalAnchor:"middle"};return N&&(E.width=Math.max(E.x-N.x,0),E.height=o),E}if(n==="right"){var _={x:h+p+S,y:s+o/2,horizontalAnchor:j,verticalAnchor:"middle"};return N&&(_.width=Math.max(N.x+N.width-_.x,0),_.height=o),_}var C=N?{width:p,height:o}:{};return n==="insideLeft"?vi({x:h+S,y:s+o/2,horizontalAnchor:j,verticalAnchor:"middle"},C):n==="insideRight"?vi({x:h+p-S,y:s+o/2,horizontalAnchor:k,verticalAnchor:"middle"},C):n==="insideTop"?vi({x:d+c/2,y:s+x,horizontalAnchor:"middle",verticalAnchor:b},C):n==="insideBottom"?vi({x:f+u/2,y:s+o-x,horizontalAnchor:"middle",verticalAnchor:v},C):n==="insideTopLeft"?vi({x:d+S,y:s+x,horizontalAnchor:j,verticalAnchor:b},C):n==="insideTopRight"?vi({x:d+c-S,y:s+x,horizontalAnchor:k,verticalAnchor:b},C):n==="insideBottomLeft"?vi({x:f+S,y:s+o-x,horizontalAnchor:j,verticalAnchor:v},C):n==="insideBottomRight"?vi({x:f+u-S,y:s+o-x,horizontalAnchor:k,verticalAnchor:v},C):n&&typeof n=="object"&&(Oe(n.x)||xo(n.x))&&(Oe(n.y)||xo(n.y))?vi({x:a+ps(n.x,p),y:s+ps(n.y,o),horizontalAnchor:"end",verticalAnchor:"end"},C):vi({x:g,y:s+o/2,horizontalAnchor:"middle",verticalAnchor:"middle"},C)},jhe=["labelRef"],Nhe=["content"];function D5(e,t){if(e==null)return{};var n,r,i=Che(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Che(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 M5(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 nu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M5(Object(n),!0).forEach(function(r){Phe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Phe(e,t,n){return(t=Ehe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ehe(e){var t=Ahe(e,"string");return typeof t=="symbol"?t:t+""}function Ahe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qi(){return qi=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},qi.apply(null,arguments)}var UR=m.createContext(null),The=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:s,children:o}=e,c=m.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:s}),[t,n,r,i,a,s]);return m.createElement(UR.Provider,{value:c},o)},VR=()=>{var e=m.useContext(UR),t=hg();return e||(t?X1(t):void 0)},Ohe=m.createContext(null),_he=()=>{var e=m.useContext(Ohe),t=De(R3);return e||t},Dhe=e=>{var{value:t,formatter:n}=e,r=jn(e.children)?t:e.children;return typeof n=="function"?n(r):r},ak=e=>e!=null&&typeof e=="function",Mhe=(e,t)=>{var n=Fr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Ihe=(e,t,n,r,i)=>{var{offset:a,className:s}=e,{cx:o,cy:c,innerRadius:u,outerRadius:d,startAngle:f,endAngle:h,clockWise:p}=i,g=(u+d)/2,y=Mhe(f,h),x=y>=0?1:-1,v,b;switch(t){case"insideStart":v=f+x*a,b=p;break;case"insideEnd":v=h-x*a,b=!p;break;case"end":v=h+x*a,b=p;break;default:throw new Error("Unsupported position ".concat(t))}b=y<=0?b:!b;var w=bn(o,c,g,v),S=bn(o,c,g,v+(b?1:-1)*359),k="M".concat(w.x,",").concat(w.y,`
|
|
755
|
+
A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
|
|
756
|
+
`).concat(S.x,",").concat(S.y),j=jn(e.id)?Ju("recharts-radial-line-"):e.id;return m.createElement("text",qi({},r,{dominantBaseline:"central",className:ct("recharts-radial-bar-label",s)}),m.createElement("defs",null,m.createElement("path",{id:j,d:k})),m.createElement("textPath",{xlinkHref:"#".concat(j)},n))},Lhe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:s,startAngle:o,endAngle:c}=e,u=(o+c)/2;if(n==="outside"){var{x:d,y:f}=bn(r,i,s+t,u);return{x:d,y:f,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var h=(a+s)/2,{x:p,y:g}=bn(r,i,h,u);return{x:p,y:g,textAnchor:"middle",verticalAnchor:"middle"}},kh=e=>e!=null&&"cx"in e&&Oe(e.cx),Rhe={angle:0,offset:5,zIndex:Vn.label,position:"middle",textBreakAll:!1};function Fhe(e){if(!kh(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function Ba(e){var t=or(e,Rhe),{viewBox:n,parentViewBox:r,position:i,value:a,children:s,content:o,className:c="",textBreakAll:u,labelRef:d}=t,f=_he(),h=VR(),p=i==="center"?h:f??h,g,y,x;n==null?g=p:kh(n)?g=n:g=X1(n);var v=Fhe(g);if(!g||jn(a)&&jn(s)&&!m.isValidElement(o)&&typeof o!="function")return null;var b=nu(nu({},t),{},{viewBox:g});if(m.isValidElement(o)){var{labelRef:w}=b,S=D5(b,jhe);return m.cloneElement(o,S)}if(typeof o=="function"){var{content:k}=b,j=D5(b,Nhe);if(y=m.createElement(o,j),m.isValidElement(y))return y}else y=Dhe(t);var N=Sr(t);if(kh(g)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Ihe(t,i,y,N,g);x=Lhe(g,t.offset,t.position)}else{if(!v)return null;var P=khe({viewBox:v,position:i,offset:t.offset,parentViewBox:kh(r)?void 0:r});x=nu(nu({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return m.createElement(Aa,{zIndex:t.zIndex},m.createElement(ik,qi({ref:d,className:ct("recharts-label",c)},N,x,{textAnchor:FR(N.textAnchor)?N.textAnchor:x.textAnchor,breakAll:u}),y))}Ba.displayName="Label";var zhe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?m.createElement(Ba,qi({key:"label-implicit"},r)):Ii(e)?m.createElement(Ba,qi({key:"label-implicit",value:e},r)):m.isValidElement(e)?e.type===Ba?m.cloneElement(e,nu({key:"label-implicit"},r)):m.createElement(Ba,qi({key:"label-implicit",content:e},r)):ak(e)?m.createElement(Ba,qi({key:"label-implicit",content:e},r)):e&&typeof e=="object"?m.createElement(Ba,qi({},e,{key:"label-implicit"},r)):null};function $he(e){var{label:t,labelRef:n}=e,r=VR();return zhe(t,r,n)||null}var Bhe=["valueAccessor"],Uhe=["dataKey","clockWise","id","textBreakAll","zIndex"];function em(){return em=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},em.apply(null,arguments)}function I5(e,t){if(e==null)return{};var n,r,i=Vhe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Vhe(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}var Whe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(mhe(t))return t},WR=m.createContext(void 0),Hhe=WR.Provider,HR=m.createContext(void 0);HR.Provider;function Khe(){return m.useContext(WR)}function qhe(){return m.useContext(HR)}function jh(e){var{valueAccessor:t=Whe}=e,n=I5(e,Bhe),{dataKey:r,clockWise:i,id:a,textBreakAll:s,zIndex:o}=n,c=I5(n,Uhe),u=Khe(),d=qhe(),f=u||d;return!f||!f.length?null:m.createElement(Aa,{zIndex:o??Vn.label},m.createElement(Di,{className:"recharts-label-list"},f.map((h,p)=>{var g,y=jn(r)?t(h,p):Sn(h.payload,r),x=jn(a)?{}:{id:"".concat(a,"-").concat(p)};return m.createElement(Ba,em({key:"label-".concat(p)},Sr(h),c,x,{fill:(g=n.fill)!==null&&g!==void 0?g:h.fill,parentViewBox:h.parentViewBox,value:y,textBreakAll:s,viewBox:h.viewBox,index:p,zIndex:0}))})))}jh.displayName="LabelList";function Ghe(e){var{label:t}=e;return t?t===!0?m.createElement(jh,{key:"labelList-implicit"}):m.isValidElement(t)||ak(t)?m.createElement(jh,{key:"labelList-implicit",content:t}):typeof t=="object"?m.createElement(jh,em({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Zv(){return Zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zv.apply(null,arguments)}var KR=e=>{var{cx:t,cy:n,r,className:i}=e,a=ct("recharts-dot",i);return Oe(t)&&Oe(n)&&Oe(r)?m.createElement("circle",Zv({},ui(e),A1(e),{className:a,cx:t,cy:n,r})):null},Yhe={radiusAxis:{},angleAxis:{}},qR=$n({name:"polarAxis",initialState:Yhe,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:pye,removeRadiusAxis:mye,addAngleAxis:gye,removeAngleAxis:yye}=qR.actions,Xhe=qR.reducer;function Zhe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var GR=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function Qhe(e){var{tooltipEntrySettings:t}=e,n=Ut(),r=lr(),i=m.useRef(null);return m.useLayoutEffect(()=>{r||(i.current===null?n(Tue(t)):i.current!==t&&n(Oue({prev:i.current,next:t})),i.current=t)},[t,n,r]),m.useLayoutEffect(()=>()=>{i.current&&(n(_ue(i.current)),i.current=null)},[n]),null}function Jhe(e){var{legendPayload:t}=e,n=Ut(),r=lr(),i=m.useRef(null);return m.useLayoutEffect(()=>{r||(i.current===null?n(gie(t)):i.current!==t&&n(yie({prev:i.current,next:t})),i.current=t)},[n,r,t]),m.useLayoutEffect(()=>()=>{i.current&&(n(xie(i.current)),i.current=null)},[n]),null}var ky,epe=()=>{var[e]=m.useState(()=>Ju("uid-"));return e},tpe=(ky=NA.useId)!==null&&ky!==void 0?ky:epe;function npe(e,t){var n=tpe();return t||(e?"".concat(e,"-").concat(n):n)}var rpe=m.createContext(void 0),ipe=e=>{var{id:t,type:n,children:r}=e,i=npe("recharts-".concat(n),t);return m.createElement(rpe.Provider,{value:i},r(i))},ape={cartesianItems:[],polarItems:[]},YR=$n({name:"graphicalItems",initialState:ape,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:kt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=zr(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:kt()},removeCartesianGraphicalItem:{reducer(e,t){var n=zr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:kt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:kt()},removePolarGraphicalItem:{reducer(e,t){var n=zr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:kt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=zr(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:kt()}}}),{addCartesianGraphicalItem:spe,replaceCartesianGraphicalItem:ope,removeCartesianGraphicalItem:lpe,addPolarGraphicalItem:xye,removePolarGraphicalItem:vye,replacePolarGraphicalItem:bye}=YR.actions,cpe=YR.reducer,upe=e=>{var t=Ut(),n=m.useRef(null);return m.useLayoutEffect(()=>{n.current===null?t(spe(e)):n.current!==e&&t(ope({prev:n.current,next:e})),n.current=e},[t,e]),m.useLayoutEffect(()=>()=>{n.current&&(t(lpe(n.current)),n.current=null)},[t]),null},dpe=m.memo(upe),fpe=["points"];function L5(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 jy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L5(Object(n),!0).forEach(function(r){hpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hpe(e,t,n){return(t=ppe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ppe(e){var t=mpe(e,"string");return typeof t=="symbol"?t:t+""}function mpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tm(){return tm=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},tm.apply(null,arguments)}function gpe(e,t){if(e==null)return{};var n,r,i=ype(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ype(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 xpe(e){var{option:t,dotProps:n,className:r}=e;if(m.isValidElement(t))return m.cloneElement(t,n);if(typeof t=="function")return t(n);var i=ct(r,typeof t!="boolean"?t.className:""),a=n??{},{points:s}=a,o=gpe(a,fpe);return m.createElement(KR,tm({},o,{className:i}))}function vpe(e,t){return e==null?!1:t?!0:e.length===1}function bpe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:s,needClip:o,clipPathId:c,zIndex:u=Vn.scatter}=e;if(!vpe(t,n))return null;var d=GR(n),f=yee(n),h=t.map((g,y)=>{var x,v,b=jy(jy(jy({r:3},s),f),{},{index:y,cx:(x=g.x)!==null&&x!==void 0?x:void 0,cy:(v=g.y)!==null&&v!==void 0?v:void 0,dataKey:a,value:g.value,payload:g.payload,points:t});return m.createElement(xpe,{key:"dot-".concat(y),option:n,dotProps:b,className:i})}),p={};return o&&c!=null&&(p.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),m.createElement(Aa,{zIndex:u},m.createElement(Di,tm({className:r},p),h))}function R5(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 F5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R5(Object(n),!0).forEach(function(r){wpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wpe(e,t,n){return(t=Spe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Spe(e){var t=kpe(e,"string");return typeof t=="symbol"?t:t+""}function kpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var XR=0,jpe={xAxis:{},yAxis:{},zAxis:{}},ZR=$n({name:"cartesianAxis",initialState:jpe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:kt()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:kt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:kt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:kt()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:kt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:kt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:kt()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:kt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:kt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,s=i.widthHistory||[];if(s.length===3&&s[0]===s[2]&&r===s[1]&&r!==i.width&&Math.abs(r-((a=s[0])!==null&&a!==void 0?a:0))<=1)return;var o=[...s,r].slice(-3);e.yAxis[n]=F5(F5({},i),{},{width:r,widthHistory:o})}}}}),{addXAxis:Npe,replaceXAxis:Cpe,removeXAxis:Ppe,addYAxis:Epe,replaceYAxis:Ape,removeYAxis:Tpe,addZAxis:wye,replaceZAxis:Sye,removeZAxis:kye,updateYAxisWidth:Ope}=ZR.actions,_pe=ZR.reducer,Dpe=q([Nn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Mpe=q([Dpe,Sa,ka],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),sk=()=>De(Mpe),Ipe=()=>De(Tde);function z5(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 Ny(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z5(Object(n),!0).forEach(function(r){Lpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lpe(e,t,n){return(t=Rpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rpe(e){var t=Fpe(e,"string");return typeof t=="symbol"?t:t+""}function Fpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zpe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:s}=e;if(i===!1||t.x==null||t.y==null)return null;var o={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=Ny(Ny(Ny({},o),Vm(i)),A1(i)),u;return m.isValidElement(i)?u=m.cloneElement(i,c):typeof i=="function"?u=i(c):u=m.createElement(KR,c),m.createElement(Di,{className:"recharts-active-dot",clipPath:s},u)};function $5(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:s=Vn.activeDot}=e,o=De(fd),c=Ipe();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return jn(u)?null:m.createElement(Aa,{zIndex:s},m.createElement(zpe,{point:u,childIndex:Number(o),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var $pe=e=>{var{chartData:t}=e,n=Ut(),r=lr();return m.useEffect(()=>r?()=>{}:(n(y5(t)),()=>{n(y5(void 0))}),[t,n,r]),null},B5={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},QR=$n({name:"brush",initialState:B5,reducers:{setBrushSettings(e,t){return t.payload==null?B5:t.payload}}}),{setBrushSettings:jye}=QR.actions,Bpe=QR.reducer;function Upe(e){return(e%180+180)%180}var Vpe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Upe(i),s=a*Math.PI/180,o=Math.atan(r/n),c=s>o&&s<Math.PI-o?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},Wpe={dots:[],areas:[],lines:[]},JR=$n({name:"referenceElements",initialState:Wpe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=zr(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=zr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=zr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Nye,removeDot:Cye,addArea:Pye,removeArea:Eye,addLine:Aye,removeLine:Tye}=JR.actions,Hpe=JR.reducer,Kpe=m.createContext(void 0),qpe=e=>{var{children:t}=e,[n]=m.useState("".concat(Ju("recharts"),"-clip")),r=sk();if(r==null)return null;var{x:i,y:a,width:s,height:o}=r;return m.createElement(Kpe.Provider,{value:n},m.createElement("defs",null,m.createElement("clipPath",{id:n},m.createElement("rect",{x:i,y:a,height:o,width:s}))),t)};function e6(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function Gpe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Vpe(r,n)}function Ype(e,t,n){var r=n==="width",{x:i,y:a,width:s,height:o}=e;return t===1?{start:r?i:a,end:r?i+s:a+o}:{start:r?i+s:a+o,end:r?i:a}}function pd(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 Xpe(e,t){return e6(e,t+1)}function Zpe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:s,end:o}=t,c=0,u=1,d=s,f=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:e6(r,u)};var y=c,x,v=()=>(x===void 0&&(x=n(g,y)),x),b=g.coordinate,w=c===0||pd(e,b,v,d,o);w||(c=0,d=s,u+=1),w&&(d=b+e*(v()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function Qpe(e,t,n,r,i){var a=(r||[]).slice(),s=a.length;if(s===0)return[];for(var{start:o,end:c}=t,u=1;u<=s;u++){for(var d=(s-1)%u,f=o,h=!0,p=function(){var S=r[y];if(S==null)return 0;var k=y,j,N=()=>(j===void 0&&(j=n(S,k)),j),P=S.coordinate,T=y===d||pd(e,P,N,f,c);if(!T)return h=!1,1;T&&(f=P+e*(N()/2+i))},g,y=d;y<s&&(g=p(),!(g!==0&&g===1));y+=u);if(h){for(var x=[],v=d;v<s;v+=u){var b=r[v];b!=null&&x.push(b)}return x}}return[]}function U5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function An(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U5(Object(n),!0).forEach(function(r){Jpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jpe(e,t,n){return(t=eme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eme(e){var t=tme(e,"string");return typeof t=="symbol"?t:t+""}function tme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nme(e,t,n,r,i){for(var a=(r||[]).slice(),s=a.length,{start:o}=t,{end:c}=t,u=function(h){var p=a[h];if(p==null)return 1;var g=p,y,x=()=>(y===void 0&&(y=n(p,h)),y);if(h===s-1){var v=e*(g.coordinate+e*x()/2-c);a[h]=g=An(An({},g),{},{tickCoord:v>0?g.coordinate-v*e:g.coordinate})}else a[h]=g=An(An({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var b=pd(e,g.tickCoord,x,o,c);b&&(c=g.tickCoord-e*(x()/2+i),a[h]=An(An({},g),{},{isShow:!0}))}},d=s-1;d>=0;d--)u(d);return a}function rme(e,t,n,r,i,a){var s=(r||[]).slice(),o=s.length,{start:c,end:u}=t;if(a){var d=r[o-1];if(d!=null){var f=n(d,o-1),h=e*(d.coordinate+e*f/2-u);if(s[o-1]=d=An(An({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=pd(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+i),s[o-1]=An(An({},d),{},{isShow:!0}))}}}for(var g=a?o-1:o,y=function(b){var w=s[b];if(w==null)return 1;var S=w,k,j=()=>(k===void 0&&(k=n(w,b)),k);if(b===0){var N=e*(S.coordinate-e*j()/2-c);s[b]=S=An(An({},S),{},{tickCoord:N<0?S.coordinate-N*e:S.coordinate})}else s[b]=S=An(An({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var P=pd(e,S.tickCoord,j,c,u);P&&(c=S.tickCoord+e*(j()/2+i),s[b]=An(An({},S),{},{isShow:!0}))}},x=0;x<g;x++)y(x);return s}function ok(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:s,orientation:o,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!i||!i.length||!r)return[];if(Oe(c)||Ud.isSsr){var h;return(h=Xpe(i,Oe(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],g=o==="top"||o==="bottom"?"width":"height",y=d&&g==="width"?bu(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},x=(k,j)=>{var N=typeof u=="function"?u(k.value,j):k.value;return g==="width"?Gpe(bu(N,{fontSize:t,letterSpacing:n}),y,f):bu(N,{fontSize:t,letterSpacing:n})[g]},v=i[0],b=i[1],w=i.length>=2&&v!=null&&b!=null?Fr(b.coordinate-v.coordinate):1,S=Ype(a,w,g);return c==="equidistantPreserveStart"?Zpe(w,S,x,i,s):c==="equidistantPreserveEnd"?Qpe(w,S,x,i,s):(c==="preserveStart"||c==="preserveStartEnd"?p=rme(w,S,x,i,s,c==="preserveStartEnd"):p=nme(w,S,x,i,s),p.filter(k=>k.isShow))}var ime=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,s=0;if(t){Array.from(t).forEach(d=>{if(d){var f=d.getBoundingClientRect();f.width>s&&(s=f.width)}});var o=n?n.getBoundingClientRect().width:0,c=i+a,u=s+c+o+(n?r:0);return Math.round(u)}return 0},ame={xAxis:{},yAxis:{}},t6=$n({name:"renderedTicks",initialState:ame,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:sme,removeRenderedTicks:ome}=t6.actions,lme=t6.reducer,cme=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function ume(e,t){if(e==null)return{};var n,r,i=dme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dme(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 ko(){return ko=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},ko.apply(null,arguments)}function V5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V5(Object(n),!0).forEach(function(r){fme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fme(e,t,n){return(t=hme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hme(e){var t=pme(e,"string");return typeof t=="symbol"?t:t+""}function pme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aa={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",zIndex:Vn.axis};function mme(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:s,axisLine:o,otherSvgProps:c}=e;if(!o)return null;var u=zt(zt(zt({},c),ui(o)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!s||a==="bottom"&&s);u=zt(zt({},u),{},{x1:t,y1:n+d*i,x2:t+r,y2:n+d*i})}else{var f=+(a==="left"&&!s||a==="right"&&s);u=zt(zt({},u),{},{x1:t+f*r,y1:n,x2:t+f*r,y2:n+i})}return m.createElement("line",ko({},u,{className:ct("recharts-cartesian-axis-line",Xm(o,"className"))}))}function gme(e,t,n,r,i,a,s,o,c){var u,d,f,h,p,g,y=o?-1:1,x=e.tickSize||s,v=Oe(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=n+ +!o*i,f=h-y*x,g=f-y*c,p=v;break;case"left":f=h=e.coordinate,d=t+ +!o*r,u=d-y*x,p=u-y*c,g=v;break;case"right":f=h=e.coordinate,d=t+ +o*r,u=d+y*x,p=u+y*c,g=v;break;default:u=d=e.coordinate,h=n+ +o*i,f=h+y*x,g=f+y*c,p=v;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:g}}}function yme(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function xme(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function vme(e){var{option:t,tickProps:n,value:r}=e,i,a=ct(n.className,"recharts-cartesian-axis-tick-value");if(m.isValidElement(t))i=m.cloneElement(t,zt(zt({},n),{},{className:a}));else if(typeof t=="function")i=t(zt(zt({},n),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=ct(s,Zhe(t))),i=m.createElement(ik,ko({},n,{className:s}),r)}return i}function bme(e){var{ticks:t,axisType:n,axisId:r}=e,i=Ut();return m.useEffect(()=>{if(r==null||n==null)return Ao;var a=t.map(s=>({value:s.value,coordinate:s.coordinate,offset:s.offset,index:s.index}));return i(sme({ticks:a,axisId:r,axisType:n})),()=>{i(ome({axisId:r,axisType:n}))}},[i,t,r,n]),null}var wme=m.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:s,unit:o,padding:c,tickTextProps:u,orientation:d,mirror:f,x:h,y:p,width:g,height:y,tickSize:x,tickMargin:v,fontSize:b,letterSpacing:w,getTicksConfig:S,events:k,axisType:j,axisId:N}=e,P=ok(zt(zt({},S),{},{ticks:n}),b,w),T=ui(S),E=Vm(r),_=FR(T.textAnchor)?T.textAnchor:yme(d,f),C=xme(d,f),A={};typeof i=="object"&&(A=i);var M=zt(zt({},T),{},{fill:"none"},A),B=P.map(I=>zt({entry:I},gme(I,h,p,g,y,d,x,f,v))),ae=B.map(I=>{var{entry:H,line:O}=I;return m.createElement(Di,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(H.value,"-").concat(H.coordinate,"-").concat(H.tickCoord)},i&&m.createElement("line",ko({},M,O,{className:ct("recharts-cartesian-axis-tick-line",Xm(i,"className"))})))}),Q=B.map((I,H)=>{var O,oe,{entry:re,tick:D}=I,G=zt(zt(zt(zt({verticalAnchor:C},T),{},{textAnchor:_,stroke:"none",fill:a},D),{},{index:H,payload:re,visibleTicksCount:P.length,tickFormatter:s,padding:c},u),{},{angle:(O=(oe=u==null?void 0:u.angle)!==null&&oe!==void 0?oe:T.angle)!==null&&O!==void 0?O:0}),te=zt(zt({},G),E);return m.createElement(Di,ko({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(re.value,"-").concat(re.coordinate,"-").concat(re.tickCoord)},TM(k,re,H)),r&&m.createElement(vme,{option:r,tickProps:te,value:"".concat(typeof s=="function"?s(re.value,H):re.value).concat(o||"")}))});return m.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(j,"-ticks")},m.createElement(bme,{ticks:P,axisId:N,axisType:j}),Q.length>0&&m.createElement(Aa,{zIndex:Vn.label},m.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(j,"-tick-labels"),ref:t},Q)),ae.length>0&&m.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(j,"-tick-lines")},ae))}),Sme=m.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:s,ticks:o,axisType:c,axisId:u}=e,d=ume(e,cme),[f,h]=m.useState(""),[p,g]=m.useState(""),y=m.useRef(null);m.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return ime({ticks:y.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var x=m.useCallback(v=>{if(v){var b=v.getElementsByClassName("recharts-cartesian-axis-tick-value");y.current=b;var w=b[0];if(w){var S=window.getComputedStyle(w),k=S.fontSize,j=S.letterSpacing;(k!==f||j!==p)&&(h(k),g(j))}}},[f,p]);return s||r!=null&&r<=0||i!=null&&i<=0?null:m.createElement(Aa,{zIndex:e.zIndex},m.createElement(Di,{className:ct("recharts-cartesian-axis",a)},m.createElement(mme,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:ui(e)}),m.createElement(wme,{ref:x,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:o,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),m.createElement(The,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},m.createElement($he,{label:e.label,labelRef:e.labelRef}),e.children)))}),lk=m.forwardRef((e,t)=>{var n=or(e,aa);return m.createElement(Sme,ko({},n,{ref:t}))});lk.displayName="CartesianAxis";var kme=["x1","y1","x2","y2","key"],jme=["offset"],Nme=["xAxisId","yAxisId"],Cme=["xAxisId","yAxisId"];function W5(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 On(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W5(Object(n),!0).forEach(function(r){Pme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pme(e,t,n){return(t=Eme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eme(e){var t=Ame(e,"string");return typeof t=="symbol"?t:t+""}function Ame(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qs(){return Qs=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},Qs.apply(null,arguments)}function nm(e,t){if(e==null)return{};var n,r,i=Tme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Tme(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}var Ome=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:s,ry:o}=e;return m.createElement("rect",{x:r,y:i,ry:o,width:a,height:s,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function n6(e){var{option:t,lineItemProps:n}=e,r;if(m.isValidElement(t))r=m.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:s,x2:o,y2:c,key:u}=n,d=nm(n,kme),f=(i=ui(d))!==null&&i!==void 0?i:{},{offset:h}=f,p=nm(f,jme);r=m.createElement("line",Qs({},p,{x1:a,y1:s,x2:o,y2:c,fill:"none",key:u}))}return r}function _me(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:s}=e,o=nm(e,Nme),c=i.map((u,d)=>{var f=On(On({},o),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return m.createElement(n6,{key:"line-".concat(d),option:r,lineItemProps:f})});return m.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function Dme(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:s}=e,o=nm(e,Cme),c=i.map((u,d)=>{var f=On(On({},o),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return m.createElement(n6,{option:r,lineItemProps:f,key:"line-".concat(d)})});return m.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function Mme(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:s,horizontalPoints:o,horizontal:c=!0}=e;if(!c||!t||!t.length||o==null)return null;var u=o.map(f=>Math.round(f+i-i)).sort((f,h)=>f-h);i!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],g=p==null,y=g?i+s-f:p-f;if(y<=0)return null;var x=h%t.length;return m.createElement("rect",{key:"react-".concat(h),y:f,x:r,height:y,width:a,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return m.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function Ime(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:s,height:o,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var u=c.map(f=>Math.round(f+i-i)).sort((f,h)=>f-h);i!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],g=p==null,y=g?i+s-f:p-f;if(y<=0)return null;var x=h%n.length;return m.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:y,height:o,stroke:"none",fill:n[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return m.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var Lme=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return zI(ok(On(On(On({},aa),n),{},{ticks:$I(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Rme=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return zI(ok(On(On(On({},aa),n),{},{ticks:$I(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Fme={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Vn.grid};function Mg(e){var t=Z1(),n=Q1(),r=XI(),i=On(On({},or(e,Fme)),{},{x:Oe(e.x)?e.x:r.left,y:Oe(e.y)?e.y:r.top,width:Oe(e.width)?e.width:r.width,height:Oe(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:s,x:o,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:h,verticalValues:p}=i,g=lr(),y=De(T=>a5(T,"xAxis",a,g)),x=De(T=>a5(T,"yAxis",s,g));if(!Li(u)||!Li(d)||!Oe(o)||!Oe(c))return null;var v=i.verticalCoordinatesGenerator||Lme,b=i.horizontalCoordinatesGenerator||Rme,{horizontalPoints:w,verticalPoints:S}=i;if((!w||!w.length)&&typeof b=="function"){var k=h&&h.length,j=b({yAxis:x?On(On({},x),{},{ticks:k?h:x.ticks}):void 0,width:t??u,height:n??d,offset:r},k?!0:f);Ap(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(w=j)}if((!S||!S.length)&&typeof v=="function"){var N=p&&p.length,P=v({xAxis:y?On(On({},y),{},{ticks:N?p:y.ticks}):void 0,width:t??u,height:n??d,offset:r},N?!0:f);Ap(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(S=P)}return m.createElement(Aa,{zIndex:i.zIndex},m.createElement("g",{className:"recharts-cartesian-grid"},m.createElement(Ome,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),m.createElement(Mme,Qs({},i,{horizontalPoints:w})),m.createElement(Ime,Qs({},i,{verticalPoints:S})),m.createElement(_me,Qs({},i,{offset:r,horizontalPoints:w,xAxis:y,yAxis:x})),m.createElement(Dme,Qs({},i,{offset:r,verticalPoints:S,xAxis:y,yAxis:x}))))}Mg.displayName="CartesianGrid";var zme={},r6=$n({name:"errorBars",initialState:zme,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:Oye,replaceErrorBar:_ye,removeErrorBar:Dye}=r6.actions,$me=r6.reducer;function i6(e,t){var n,r,i=De(u=>Ca(u,e)),a=De(u=>Pa(u,t)),s=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Jt.allowDataOverflow,o=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:en.allowDataOverflow,c=s||o;return{needClip:c,needClipX:s,needClipY:o}}function Bme(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=sk(),{needClipX:a,needClipY:s,needClip:o}=i6(t,n);if(!o||!i)return null;var{x:c,y:u,width:d,height:f}=i;return m.createElement("clipPath",{id:"clipPath-".concat(r)},m.createElement("rect",{x:a?c:c-d/2,y:s?u:u-f/2,width:a?d:d*2,height:s?f:f*2}))}function Ume(e){var t=Vm(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,s=Number(i),o=Number(a);return(Number.isNaN(s)||s<0)&&(s=n),(Number.isNaN(o)||o<0)&&(o=r),{r:s,strokeWidth:o}}return{r:n,strokeWidth:r}}function ck(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:XR}function uk(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:XR}var a6=(e,t,n)=>nR(e,"xAxis",ck(e,t),n),s6=(e,t,n)=>tR(e,"xAxis",ck(e,t),n),o6=(e,t,n)=>nR(e,"yAxis",uk(e,t),n),l6=(e,t,n)=>tR(e,"yAxis",uk(e,t),n),Vme=q([_t,a6,o6,s6,l6],(e,t,n,r,i)=>Bi(e,"xAxis")?Ep(t,r,!1):Ep(n,i,!1)),Wme=(e,t)=>t,c6=q([jL,Wme],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),u6=e=>{var t=_t(e),n=Bi(t,"xAxis");return n?"yAxis":"xAxis"},Hme=(e,t)=>{var n=u6(e);return n==="yAxis"?uk(e,t):ck(e,t)},Kme=(e,t,n)=>DL(e,u6(e),Hme(e,t),n),qme=q([c6,Kme],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=dS(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,s=a==null?void 0:a.find(o=>o.key===i);if(s!=null)return s.map(o=>[o[0],o[1]])}}}),Gme=q([_t,a6,o6,s6,l6,qme,Ase,Vme,c6,Lse],(e,t,n,r,i,a,s,o,c,u)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:h}=s;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null)){var{data:p}=c,g;if(p&&p.length>0?g=p:g=d==null?void 0:d.slice(f,h+1),g!=null)return pge({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:g,chartBaseValue:u,bandSize:o})}}),Yme=["id"],Xme=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function so(){return so=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},so.apply(null,arguments)}function d6(e,t){if(e==null)return{};var n,r,i=Zme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Zme(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 H5(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 hl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H5(Object(n),!0).forEach(function(r){Qme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qme(e,t,n){return(t=Jme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jme(e){var t=ege(e,"string");return typeof t=="symbol"?t:t+""}function ege(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rm(e,t){return e&&e!=="none"?e:t}var tge=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:s}=e;return[{inactive:s,dataKey:t,type:a,color:rm(r,i),value:BI(n,t),payload:e}]},nge=m.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:s,hide:o,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:n,getPosition:Ao,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:BI(s,t),hide:o,type:u,color:rm(r,a),unit:c,graphicalItemId:d}};return m.createElement(Qhe,{tooltipEntrySettings:f})});function rge(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:s}=r,o=ui(r);return m.createElement(bpe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:s,baseProps:o,needClip:i,clipPathId:t})}function ige(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var s,o,c={x:(s=a.x)!==null&&s!==void 0?s:0,y:(o=a.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return hl(hl({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return m.createElement(Hhe,{value:t?i:void 0},n)}function K5(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:s,type:o,stroke:c,connectNulls:u,isRange:d}=a,{id:f}=a,h=d6(a,Yme),p=ui(h),g=Sr(h);return m.createElement(m.Fragment,null,(t==null?void 0:t.length)>1&&m.createElement(Di,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},m.createElement(Sh,so({},g,{id:f,points:t,connectNulls:u,type:o,baseLine:n,layout:s,stroke:"none",className:"recharts-area-area"})),c!=="none"&&m.createElement(Sh,so({},p,{className:"recharts-area-curve",layout:s,type:o,connectNulls:u,fill:"none",points:t})),c!=="none"&&d&&Array.isArray(n)&&m.createElement(Sh,so({},p,{className:"recharts-area-curve",layout:s,type:o,connectNulls:u,fill:"none",points:n}))),m.createElement(rge,{points:t,props:h,clipPathId:i}))}function age(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:s}=e,o=(t=a[0])===null||t===void 0?void 0:t.y,c=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!Xe(o)||!Xe(c))return null;var u=r*Math.abs(o-c),d=Math.max(...a.map(f=>f.x||0));return Oe(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.x||0),d)),Oe(d)?m.createElement("rect",{x:0,y:o<c?o:o-u,width:d+(s?parseInt("".concat(s),10):1),height:Math.floor(u)}):null}function sge(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:s}=e,o=(t=a[0])===null||t===void 0?void 0:t.x,c=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!Xe(o)||!Xe(c))return null;var u=r*Math.abs(o-c),d=Math.max(...a.map(f=>f.y||0));return Oe(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.y||0),d)),Oe(d)?m.createElement("rect",{x:o<c?o:o-u,y:0,width:u,height:Math.floor(d+(s?parseInt("".concat(s),10):1))}):null}function oge(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?m.createElement(age,{alpha:t,points:r,baseLine:i,strokeWidth:a}):m.createElement(sge,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function lge(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:s,baseLine:o,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,onAnimationStart:h,onAnimationEnd:p}=r,g=m.useMemo(()=>({points:s,baseLine:o}),[s,o]),y=d3(g,"recharts-area-"),x=J1(),[v,b]=m.useState(!1),w=!v,S=m.useCallback(()=>{typeof p=="function"&&p(),b(!1)},[p]),k=m.useCallback(()=>{typeof h=="function"&&h(),b(!0)},[h]);if(x==null)return null;var j=i.current,N=a.current;return m.createElement(ige,{showLabels:w,points:s},r.children,m.createElement(u3,{animationId:y,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:S,onAnimationStart:k,key:y},P=>{if(j){var T=j.length/s.length,E=P===1?s:s.map((C,A)=>{var M=Math.floor(A*T);if(j[M]){var B=j[M];return hl(hl({},C),{},{x:ki(B.x,C.x,P),y:ki(B.y,C.y,P)})}return C}),_;return Oe(o)?_=ki(N,o,P):jn(o)||Mi(o)?_=ki(N,0,P):_=o.map((C,A)=>{var M=Math.floor(A*T);if(Array.isArray(N)&&N[M]){var B=N[M];return hl(hl({},C),{},{x:ki(B.x,C.x,P),y:ki(B.y,C.y,P)})}return C}),P>0&&(i.current=E,a.current=_),m.createElement(K5,{points:E,baseLine:_,needClip:t,clipPathId:n,props:r})}return P>0&&(i.current=s,a.current=o),m.createElement(Di,null,c&&m.createElement("defs",null,m.createElement("clipPath",{id:"animationClipPath-".concat(n)},m.createElement(oge,{alpha:P,points:s,baseLine:o,layout:x,strokeWidth:r.strokeWidth}))),m.createElement(Di,{clipPath:"url(#animationClipPath-".concat(n,")")},m.createElement(K5,{points:s,baseLine:o,needClip:t,clipPathId:n,props:r})))}),m.createElement(Ghe,{label:r.label}))}function cge(e){var{needClip:t,clipPathId:n,props:r}=e,i=m.useRef(null),a=m.useRef();return m.createElement(lge,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class uge extends m.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:s,needClip:o,xAxisId:c,yAxisId:u,width:d,height:f,id:h,baseLine:p,zIndex:g}=this.props;if(t)return null;var y=ct("recharts-area",i),x=h,{r:v,strokeWidth:b}=Ume(n),w=GR(n),S=v*2+b,k=o?"url(#clipPath-".concat(w?"":"dots-").concat(x,")"):void 0;return m.createElement(Aa,{zIndex:g},m.createElement(Di,{className:y},o&&m.createElement("defs",null,m.createElement(Bme,{clipPathId:x,xAxisId:c,yAxisId:u}),!w&&m.createElement("clipPath",{id:"clipPath-dots-".concat(x)},m.createElement("rect",{x:s-S/2,y:a-S/2,width:d+S,height:f+S}))),m.createElement(cge,{needClip:o,clipPathId:x,props:this.props})),m.createElement($5,{points:r,mainColor:rm(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}),this.props.isRange&&Array.isArray(p)&&m.createElement($5,{points:p,mainColor:rm(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}))}}var dge={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Vn.area};function fge(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:s,dot:o,fill:c,fillOpacity:u,hide:d,isAnimationActive:f,legendType:h,stroke:p,xAxisId:g,yAxisId:y}=e,x=d6(e,Xme),v=ic(),b=jR(),{needClip:w}=i6(g,y),S=lr(),{points:k,isRange:j,baseLine:N}=(t=De(A=>Gme(A,e.id,S)))!==null&&t!==void 0?t:{},P=sk();if(v!=="horizontal"&&v!=="vertical"||P==null||b!=="AreaChart"&&b!=="ComposedChart")return null;var{height:T,width:E,x:_,y:C}=P;return!k||!k.length?null:m.createElement(uge,so({},x,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:N,connectNulls:s,dot:o,fill:c,fillOpacity:u,height:T,hide:d,layout:v,isAnimationActive:f,isRange:j,legendType:h,needClip:w,points:k,stroke:p,width:E,left:_,top:C,xAxisId:g,yAxisId:y}))}var hge=(e,t,n,r,i)=>{var a=n??t;if(Oe(a))return a;var s=e==="horizontal"?i:r,o=s.scale.domain();if(s.type==="number"){var c=Math.max(o[0],o[1]),u=Math.min(o[0],o[1]);return a==="dataMin"?u:a==="dataMax"||c<0?c:Math.max(Math.min(o[0],o[1]),0)}return a==="dataMin"?o[0]:a==="dataMax"?o[1]:o[0]};function pge(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:s,xAxis:o,yAxis:c,displayedData:u,dataStartIndex:d,xAxisTicks:f,yAxisTicks:h,bandSize:p}=e,g=i&&i.length,y=hge(a,s,n,o,c),x=a==="horizontal",v=!1,b=u.map((S,k)=>{var j,N,P,T;if(g)T=i[d+k];else{var E=Sn(S,r);Array.isArray(E)?(T=E,v=!0):T=[y,E]}var _=(j=(N=T)===null||N===void 0?void 0:N[1])!==null&&j!==void 0?j:null,C=_==null||g&&!t&&Sn(S,r)==null;if(x){var A;return{x:cP({axis:o,ticks:f,bandSize:p,entry:S,index:k}),y:C?null:(A=c.scale.map(_))!==null&&A!==void 0?A:null,value:T,payload:S}}return{x:C?null:(P=o.scale.map(_))!==null&&P!==void 0?P:null,y:cP({axis:c,ticks:h,bandSize:p,entry:S,index:k}),value:T,payload:S}}),w;return g||v?w=b.map(S=>{var k,j=Array.isArray(S.value)?S.value[0]:null;if(x){var N;return{x:S.x,y:j!=null&&S.y!=null&&(N=c.scale.map(j))!==null&&N!==void 0?N:null,payload:S.payload}}return{x:j!=null&&(k=o.scale.map(j))!==null&&k!==void 0?k:null,y:S.y,payload:S.payload}}):w=x?c.scale.map(y):o.scale.map(y),{points:b,baseLine:w??0,isRange:v}}function mge(e){var t=or(e,dge),n=lr();return m.createElement(ipe,{id:t.id,type:"area"},r=>m.createElement(m.Fragment,null,m.createElement(Jhe,{legendPayload:tge(t)}),m.createElement(nge,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),m.createElement(dpe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Sre(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),m.createElement(fge,so({},t,{id:r}))))}var as=m.memo(mge,Bd);as.displayName="Area";var gge=["domain","range"],yge=["domain","range"];function q5(e,t){if(e==null)return{};var n,r,i=xge(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xge(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 G5(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function f6(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=q5(e,gge),{domain:a,range:s}=t,o=q5(t,yge);return!G5(n,a)||!G5(r,s)?!1:Bd(i,o)}var vge=["type"],bge=["dangerouslySetInnerHTML","ticks","scale"],wge=["id","scale"];function Qv(){return Qv=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},Qv.apply(null,arguments)}function Y5(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 X5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y5(Object(n),!0).forEach(function(r){Sge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sge(e,t,n){return(t=kge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kge(e){var t=jge(e,"string");return typeof t=="symbol"?t:t+""}function jge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jv(e,t){if(e==null)return{};var n,r,i=Nge(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Nge(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 Cge(e){var t=Ut(),n=m.useRef(null),r=J1(),{type:i}=e,a=Jv(e,vge),s=bg(r,"xAxis",i),o=m.useMemo(()=>{if(s!=null)return X5(X5({},a),{},{type:s})},[a,s]);return m.useLayoutEffect(()=>{o!=null&&(n.current===null?t(Npe(o)):n.current!==o&&t(Cpe({prev:n.current,next:o})),n.current=o)},[o,t]),m.useLayoutEffect(()=>()=>{n.current&&(t(Ppe(n.current)),n.current=null)},[t]),null}var Pge=e=>{var{xAxisId:t,className:n}=e,r=De(VI),i=lr(),a="xAxis",s=De(v=>eR(v,a,t,i)),o=De(v=>due(v,t)),c=De(v=>yue(v,t)),u=De(v=>bL(v,t));if(o==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Jv(e,bge),{id:g,scale:y}=u,x=Jv(u,wge);return m.createElement(lk,Qv({},p,x,{x:c.x,y:c.y,width:o.width,height:o.height,className:ct("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:s,axisType:a,axisId:t}))},Ege={allowDataOverflow:Jt.allowDataOverflow,allowDecimals:Jt.allowDecimals,allowDuplicatedCategory:Jt.allowDuplicatedCategory,angle:Jt.angle,axisLine:aa.axisLine,height:Jt.height,hide:!1,includeHidden:Jt.includeHidden,interval:Jt.interval,label:!1,minTickGap:Jt.minTickGap,mirror:Jt.mirror,orientation:Jt.orientation,padding:Jt.padding,reversed:Jt.reversed,scale:Jt.scale,tick:Jt.tick,tickCount:Jt.tickCount,tickLine:aa.tickLine,tickSize:aa.tickSize,type:Jt.type,niceTicks:Jt.niceTicks,xAxisId:0},Age=e=>{var t=or(e,Ege);return m.createElement(m.Fragment,null,m.createElement(Cge,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),m.createElement(Pge,t))},Ig=m.memo(Age,f6);Ig.displayName="XAxis";var Tge=["type"],Oge=["dangerouslySetInnerHTML","ticks","scale"],_ge=["id","scale"];function eb(){return eb=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},eb.apply(null,arguments)}function Z5(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 Q5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z5(Object(n),!0).forEach(function(r){Dge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dge(e,t,n){return(t=Mge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mge(e){var t=Ige(e,"string");return typeof t=="symbol"?t:t+""}function Ige(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tb(e,t){if(e==null)return{};var n,r,i=Lge(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lge(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 Rge(e){var t=Ut(),n=m.useRef(null),r=J1(),{type:i}=e,a=tb(e,Tge),s=bg(r,"yAxis",i),o=m.useMemo(()=>{if(s!=null)return Q5(Q5({},a),{},{type:s})},[s,a]);return m.useLayoutEffect(()=>{o!=null&&(n.current===null?t(Epe(o)):n.current!==o&&t(Ape({prev:n.current,next:o})),n.current=o)},[o,t]),m.useLayoutEffect(()=>()=>{n.current&&(t(Tpe(n.current)),n.current=null)},[t]),null}function Fge(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=m.useRef(null),s=m.useRef(null),o=De(VI),c=lr(),u=Ut(),d="yAxis",f=De(j=>bue(j,t)),h=De(j=>vue(j,t)),p=De(j=>eR(j,d,t,c)),g=De(j=>wL(j,t));if(m.useLayoutEffect(()=>{if(!(r!=="auto"||!f||ak(i)||m.isValidElement(i)||g==null)){var j=a.current;if(j){var N=j.getCalculatedWidth();Math.round(f.width)!==Math.round(N)&&u(Ope({id:t,width:N}))}}},[p,f,u,i,t,r,g]),f==null||h==null||g==null)return null;var{dangerouslySetInnerHTML:y,ticks:x,scale:v}=e,b=tb(e,Oge),{id:w,scale:S}=g,k=tb(g,_ge);return m.createElement(lk,eb({},b,k,{ref:a,labelRef:s,x:h.x,y:h.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:f.width,height:f.height,className:ct("recharts-".concat(d," ").concat(d),n),viewBox:o,ticks:p,axisType:d,axisId:t}))}var zge={allowDataOverflow:en.allowDataOverflow,allowDecimals:en.allowDecimals,allowDuplicatedCategory:en.allowDuplicatedCategory,angle:en.angle,axisLine:aa.axisLine,hide:!1,includeHidden:en.includeHidden,interval:en.interval,label:!1,minTickGap:en.minTickGap,mirror:en.mirror,orientation:en.orientation,padding:en.padding,reversed:en.reversed,scale:en.scale,tick:en.tick,tickCount:en.tickCount,tickLine:aa.tickLine,tickSize:aa.tickSize,type:en.type,niceTicks:en.niceTicks,width:en.width,yAxisId:0},$ge=e=>{var t=or(e,zge);return m.createElement(m.Fragment,null,m.createElement(Rge,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),m.createElement(Fge,t))},Lg=m.memo($ge,f6);Lg.displayName="YAxis";var Bge=(e,t)=>t,dk=q([Bge,_t,R3,hn,xR,Ea,Ude,Nn],Yde);function Uge(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function fk(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Uge(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var s=(o,c)=>({relativeX:Math.round((o-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(o=>s(o.clientX,o.clientY)):s(e.clientX,e.clientY)}var h6=kr("mouseClick"),p6=Ld();p6.startListening({actionCreator:h6,effect:(e,t)=>{var n=e.payload,r=dk(t.getState(),fk(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(Iue({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var nb=kr("mouseMove"),m6=Ld(),Vo=null,Ts=null,Cy=null;m6.startListening({actionCreator:nb,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,s=a==="all"||(a==null?void 0:a.includes("mousemove"));Vo!==null&&(cancelAnimationFrame(Vo),Vo=null),Ts!==null&&(typeof i!="number"||!s)&&(clearTimeout(Ts),Ts=null),Cy=fk(n);var o=()=>{var c=t.getState(),u=qS(c,c.tooltip.settings.shared);if(!Cy){Vo=null,Ts=null;return}if(u==="axis"){var d=dk(c,Cy);(d==null?void 0:d.activeIndex)!=null?t.dispatch(cR({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(lR())}Vo=null,Ts=null};if(!s){o();return}i==="raf"?Vo=requestAnimationFrame(o):typeof i=="number"&&Ts===null&&(Ts=setTimeout(o,i))}});function Vge(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var J5={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},g6=$n({name:"rootProps",initialState:J5,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:J5.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Wge=g6.reducer,{updateOptions:Hge}=g6.actions,Kge=null,qge={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},y6=$n({name:"polarOptions",initialState:Kge,reducers:qge}),{updatePolarOptions:Mye}=y6.actions,Gge=y6.reducer,x6=kr("keyDown"),v6=kr("focus"),b6=kr("blur"),Rg=Ld(),Wo=null,Os=null,Yf=null;Rg.startListening({actionCreator:x6,effect:(e,t)=>{Yf=e.payload,Wo!==null&&(cancelAnimationFrame(Wo),Wo=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Os!==null&&(typeof r!="number"||!a)&&(clearTimeout(Os),Os=null);var s=()=>{try{var o=t.getState(),c=o.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=o.tooltip,d=Yf;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=GS(u,hc(o),Xd(o),Qd(o)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=Ea(o);if(d==="Enter"){var g=Jp(o,"axis","hover",String(u.index));t.dispatch(Qp({active:!u.active,activeIndex:u.index,activeCoordinate:g}));return}var y=Nue(o),x=y==="left-to-right"?1:-1,v=d==="ArrowRight"?1:-1,b=h+v*x;if(p==null||b>=p.length||b<0)return;var w=Jp(o,"axis","hover",String(b));t.dispatch(Qp({active:!0,activeIndex:b.toString(),activeCoordinate:w}))}finally{Wo=null,Os=null}};if(!a){s();return}r==="raf"?Wo=requestAnimationFrame(s):typeof r=="number"&&Os===null&&(s(),Yf=null,Os=setTimeout(()=>{Yf?s():(Os=null,Wo=null)},r))}});Rg.startListening({actionCreator:v6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",s=Jp(n,"axis","hover",String(a));t.dispatch(Qp({active:!0,activeIndex:a,activeCoordinate:s}))}}}});Rg.startListening({actionCreator:b6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Qp({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function w6(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Or=kr("externalEvent"),S6=Ld(),Xf=new Map,Vc=new Map,Py=new Map;S6.startListening({actionCreator:Or,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=w6(r);Py.set(i,{handler:n,reactEvent:a});var s=Xf.get(i);s!==void 0&&(cancelAnimationFrame(s),Xf.delete(i));var o=t.getState(),{throttleDelay:c,throttledEvents:u}=o.eventSettings,d=u,f=d==="all"||(d==null?void 0:d.includes(i)),h=Vc.get(i);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),Vc.delete(i));var p=()=>{var x=Py.get(i);try{if(!x)return;var{handler:v,reactEvent:b}=x,w=t.getState(),S={activeCoordinate:Pde(w),activeDataKey:jde(w),activeIndex:fd(w),activeLabel:wR(w),activeTooltipIndex:fd(w),isTooltipActive:Ede(w)};v&&v(S,b)}finally{Xf.delete(i),Vc.delete(i),Py.delete(i)}};if(!f){p();return}if(c==="raf"){var g=requestAnimationFrame(p);Xf.set(i,g)}else if(typeof c=="number"){if(!Vc.has(i)){p();var y=setTimeout(p,c);Vc.set(i,y)}}else p()}}});var Yge=q([dc],e=>e.tooltipItemPayloads),Xge=q([Yge,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),k6=kr("touchMove"),j6=Ld(),_s=null,Ia=null,eA=null,Wc=null;j6.startListening({actionCreator:k6,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Wc=w6(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,s=a==="all"||a.includes("touchmove");_s!==null&&(cancelAnimationFrame(_s),_s=null),Ia!==null&&(typeof i!="number"||!s)&&(clearTimeout(Ia),Ia=null),eA=Array.from(n.touches).map(c=>fk({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var o=()=>{if(Wc!=null){var c=t.getState(),u=qS(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=eA)===null||d===void 0?void 0:d[0];if(f==null){_s=null,Ia=null;return}var h=dk(c,f);(h==null?void 0:h.activeIndex)!=null&&t.dispatch(cR({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,g=Wc.touches[0];if(document.elementFromPoint==null||g==null)return;var y=document.elementFromPoint(g.clientX,g.clientY);if(!y||!y.getAttribute)return;var x=y.getAttribute(Are),v=(p=y.getAttribute(Tre))!==null&&p!==void 0?p:void 0,b=fc(c).find(k=>k.id===v);if(x==null||b==null||v==null)return;var{dataKey:w}=b,S=Xge(c,x,v);t.dispatch(Mue({activeDataKey:w,activeIndex:x,activeCoordinate:S,activeGraphicalItemId:v}))}_s=null,Ia=null}};if(!s){o();return}i==="raf"?_s=requestAnimationFrame(o):typeof i=="number"&&Ia===null&&(o(),Wc=null,Ia=setTimeout(()=>{Wc?o():(Ia=null,_s=null)},i))}}});var N6={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},C6=$n({name:"eventSettings",initialState:N6,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Zge}=C6.actions,Qge=C6.reducer,Jge=uI({brush:Bpe,cartesianAxis:_pe,chartData:Cfe,errorBars:$me,eventSettings:Qge,graphicalItems:cpe,layout:hre,legend:vie,options:wfe,polarAxis:Xhe,polarOptions:Gge,referenceElements:Hpe,renderedTicks:lme,rootProps:Wge,tooltip:Lue,zIndex:cfe}),e0e=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Fne({reducer:Jge,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([p6.middleware,m6.middleware,Rg.middleware,S6.middleware,j6.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(NI({type:"raf"}))},devTools:{serialize:{replacer:Vge},name:"recharts-".concat(n)}})};function t0e(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=lr(),a=m.useRef(null);if(i)return n;a.current==null&&(a.current=e0e(t,r));var s=z1;return m.createElement(Bie,{context:s,store:a.current},n)}function n0e(e){var{layout:t,margin:n}=e,r=Ut(),i=lr();return m.useEffect(()=>{i||(r(ure(t)),r(cre(n)))},[r,i,t,n]),null}var r0e=m.memo(n0e,Bd);function i0e(e){var t=Ut();return m.useEffect(()=>{t(Hge(e))},[t,e]),null}var a0e=e=>{var t=Ut();return m.useEffect(()=>{t(Zge(e))},[t,e]),null},s0e=m.memo(a0e,Bd);function tA(e){var{zIndex:t,isPanorama:n}=e,r=m.useRef(null),i=Ut();return m.useLayoutEffect(()=>(r.current&&i(ofe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(lfe({zIndex:t,isPanorama:n}))}),[i,t,n]),m.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function nA(e){var{children:t,isPanorama:n}=e,r=De(Zde);if(!r||r.length===0)return t;var i=r.filter(s=>s<0),a=r.filter(s=>s>0);return m.createElement(m.Fragment,null,i.map(s=>m.createElement(tA,{key:s,zIndex:s,isPanorama:n})),t,a.map(s=>m.createElement(tA,{key:s,zIndex:s,isPanorama:n})))}var o0e=["children"];function l0e(e,t){if(e==null)return{};var n,r,i=c0e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c0e(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 im(){return im=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},im.apply(null,arguments)}var u0e={width:"100%",height:"100%",display:"block"},d0e=m.forwardRef((e,t)=>{var n=Z1(),r=Q1(),i=s3();if(!Li(n)||!Li(r))return null;var{children:a,otherAttributes:s,title:o,desc:c}=e,u,d;return s!=null&&(typeof s.tabIndex=="number"?u=s.tabIndex:u=i?0:void 0,typeof s.role=="string"?d=s.role:d=i?"application":void 0),m.createElement(j1,im({},s,{title:o,desc:c,role:d,tabIndex:u,width:n,height:r,style:u0e,ref:t}),a)}),f0e=e=>{var{children:t}=e,n=De(fg);if(!n)return null;var{width:r,height:i,y:a,x:s}=n;return m.createElement(j1,{width:r,height:i,x:s,y:a},t)},rA=m.forwardRef((e,t)=>{var{children:n}=e,r=l0e(e,o0e),i=lr();return i?m.createElement(f0e,null,m.createElement(nA,{isPanorama:!0},n)):m.createElement(d0e,im({ref:t},r),m.createElement(nA,{isPanorama:!1},n))});function h0e(){var e=Ut(),[t,n]=m.useState(null),r=De(Ere);return m.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Xe(a)&&a!==r&&e(fre(a))}},[t,e,r]),n}function iA(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 p0e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iA(Object(n),!0).forEach(function(r){m0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m0e(e,t,n){return(t=g0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g0e(e){var t=y0e(e,"string");return typeof t=="symbol"?t:t+""}function y0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ss(){return ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ss.apply(null,arguments)}var x0e=()=>(Ife(),null);function am(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var v0e=m.forwardRef((e,t)=>{var n,r,i=m.useRef(null),[a,s]=m.useState({containerWidth:am((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:am((r=e.style)===null||r===void 0?void 0:r.height)}),o=m.useCallback((u,d)=>{s(f=>{var h=Math.round(u),p=Math.round(d);return f.containerWidth===h&&f.containerHeight===p?f:{containerWidth:h,containerHeight:p}})},[]),c=m.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();o(d,f);var h=g=>{var y=g[0];if(y!=null){var{width:x,height:v}=y.contentRect;o(x,v)}},p=new ResizeObserver(h);p.observe(u),i.current=p}},[t,o]);return m.useEffect(()=>()=>{var u=i.current;u!=null&&u.disconnect()},[o]),m.createElement(m.Fragment,null,m.createElement(Fd,{width:a.containerWidth,height:a.containerHeight}),m.createElement("div",ss({ref:c},e)))}),b0e=m.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=m.useState({containerWidth:am(n),containerHeight:am(r)}),s=m.useCallback((c,u)=>{a(d=>{var f=Math.round(c),h=Math.round(u);return d.containerWidth===f&&d.containerHeight===h?d:{containerWidth:f,containerHeight:h}})},[]),o=m.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();s(u,d)}},[t,s]);return m.createElement(m.Fragment,null,m.createElement(Fd,{width:i.containerWidth,height:i.containerHeight}),m.createElement("div",ss({ref:o},e)))}),w0e=m.forwardRef((e,t)=>{var{width:n,height:r}=e;return m.createElement(m.Fragment,null,m.createElement(Fd,{width:n,height:r}),m.createElement("div",ss({ref:t},e)))}),S0e=m.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?m.createElement(b0e,ss({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?m.createElement(w0e,ss({},e,{width:n,height:r,ref:t})):m.createElement(m.Fragment,null,m.createElement(Fd,{width:n,height:r}),m.createElement("div",ss({ref:t},e)))});function k0e(e){return e?v0e:S0e}var j0e=m.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:s,onDoubleClick:o,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchEnd:p,onTouchMove:g,onTouchStart:y,style:x,width:v,responsive:b,dispatchTouchEvents:w=!0}=e,S=m.useRef(null),k=Ut(),[j,N]=m.useState(null),[P,T]=m.useState(null),E=h0e(),_=G1(),C=(_==null?void 0:_.width)>0?_.width:v,A=(_==null?void 0:_.height)>0?_.height:i,M=m.useCallback(ne=>{E(ne),typeof t=="function"&&t(ne),N(ne),T(ne),ne!=null&&(S.current=ne)},[E,t,N,T]),B=m.useCallback(ne=>{k(h6(ne)),k(Or({handler:a,reactEvent:ne}))},[k,a]),ae=m.useCallback(ne=>{k(nb(ne)),k(Or({handler:u,reactEvent:ne}))},[k,u]),Q=m.useCallback(ne=>{k(lR()),k(Or({handler:d,reactEvent:ne}))},[k,d]),I=m.useCallback(ne=>{k(nb(ne)),k(Or({handler:f,reactEvent:ne}))},[k,f]),H=m.useCallback(()=>{k(v6())},[k]),O=m.useCallback(()=>{k(b6())},[k]),oe=m.useCallback(ne=>{k(x6(ne.key))},[k]),re=m.useCallback(ne=>{k(Or({handler:s,reactEvent:ne}))},[k,s]),D=m.useCallback(ne=>{k(Or({handler:o,reactEvent:ne}))},[k,o]),G=m.useCallback(ne=>{k(Or({handler:c,reactEvent:ne}))},[k,c]),te=m.useCallback(ne=>{k(Or({handler:h,reactEvent:ne}))},[k,h]),ee=m.useCallback(ne=>{k(Or({handler:y,reactEvent:ne}))},[k,y]),Z=m.useCallback(ne=>{w&&k(k6(ne)),k(Or({handler:g,reactEvent:ne}))},[k,w,g]),ce=m.useCallback(ne=>{k(Or({handler:p,reactEvent:ne}))},[k,p]),J=k0e(b);return m.createElement(AR.Provider,{value:j},m.createElement(sM.Provider,{value:P},m.createElement(J,{width:C??(x==null?void 0:x.width),height:A??(x==null?void 0:x.height),className:ct("recharts-wrapper",r),style:p0e({position:"relative",cursor:"default",width:C,height:A},x),onClick:B,onContextMenu:re,onDoubleClick:D,onFocus:H,onBlur:O,onKeyDown:oe,onMouseDown:G,onMouseEnter:ae,onMouseLeave:Q,onMouseMove:I,onMouseUp:te,onTouchEnd:ce,onTouchMove:Z,onTouchStart:ee,ref:M},m.createElement(x0e,null),n)))}),N0e=["width","height","responsive","children","className","style","compact","title","desc"];function C0e(e,t){if(e==null)return{};var n,r,i=P0e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function P0e(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}var E0e=m.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:s,style:o,compact:c,title:u,desc:d}=e,f=C0e(e,N0e),h=ui(f);return c?m.createElement(m.Fragment,null,m.createElement(Fd,{width:n,height:r}),m.createElement(rA,{otherAttributes:h,title:u,desc:d},a)):m.createElement(j0e,{className:s,style:o,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},m.createElement(rA,{otherAttributes:h,title:u,desc:d,ref:t},m.createElement(qpe,null,a)))});function rb(){return rb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rb.apply(null,arguments)}function aA(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 A0e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aA(Object(n),!0).forEach(function(r){T0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T0e(e,t,n){return(t=O0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O0e(e){var t=_0e(e,"string");return typeof t=="symbol"?t:t+""}function _0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var D0e={top:5,right:5,bottom:5,left:5},M0e=A0e({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:D0e,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},N6),I0e=m.forwardRef(function(t,n){var r,i=or(t.categoricalChartProps,M0e),{chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:o,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,d={chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:o,tooltipPayloadSearcher:c,eventEmitter:void 0};return m.createElement(t0e,{preloadedState:{options:d},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},m.createElement($pe,{chartData:u.data}),m.createElement(r0e,{layout:i.layout,margin:i.margin}),m.createElement(s0e,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),m.createElement(i0e,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),m.createElement(E0e,rb({},i,{ref:n})))}),L0e=["axis"],hk=m.forwardRef((e,t)=>m.createElement(I0e,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:L0e,tooltipPayloadSearcher:vfe,categoricalChartProps:e,ref:t}));function sA(e){return e===0?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function oA(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function R0e({buckets:e}){const t=e.map(n=>({time:n.timestamp,input:n.tokensInput,output:n.tokensOutput,cache:n.tokensCacheRead+n.tokensCacheWrite}));return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 min-w-0",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Token Usage"}),l.jsx("div",{className:"min-w-0",children:l.jsx(Y1,{width:"100%",height:200,children:l.jsxs(hk,{data:t,children:[l.jsx(Mg,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),l.jsx(Ig,{dataKey:"time",tickFormatter:oA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(Lg,{tickFormatter:sA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1,width:50}),l.jsx(rk,{labelFormatter:n=>oA(Number(n)),formatter:(n,r)=>[sA(Number(n)),r]}),l.jsx(yg,{verticalAlign:"top",align:"right",iconType:"circle",iconSize:8}),l.jsx(as,{type:"monotone",dataKey:"input",name:"Input",stroke:"#6366f1",fill:"#6366f1",fillOpacity:.1,strokeWidth:2}),l.jsx(as,{type:"monotone",dataKey:"output",name:"Output",stroke:"#a78bfa",fill:"#a78bfa",fillOpacity:.1,strokeWidth:2}),l.jsx(as,{type:"monotone",dataKey:"cache",name:"Cache",stroke:"#cbd5e1",fill:"#cbd5e1",fillOpacity:.1,strokeWidth:2,strokeDasharray:"4 4"})]})})})]})}function lA(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function Hc(e){return e===0?"0s":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function F0e({buckets:e}){const t=e.map(o=>({time:o.timestamp,avg:o.promptDurationAvg,max:o.promptDurationMax})),n=e.filter(o=>o.promptDurationAvg>0),r=n.length>0?n.reduce((o,c)=>o+c.promptDurationAvg,0)/n.length:0,i=e.reduce((o,c)=>Math.max(o,c.promptDurationMax),0),a=n.map(o=>o.promptDurationMax).sort((o,c)=>o-c),s=a.length>0?a[Math.floor(a.length*.95)]:0;return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 min-w-0",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Prompt Latency"}),l.jsx("div",{className:"min-w-0",children:l.jsx(Y1,{width:"100%",height:200,children:l.jsxs(hk,{data:t,children:[l.jsx(Mg,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),l.jsx(Ig,{dataKey:"time",tickFormatter:lA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(Lg,{tickFormatter:Hc,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1,width:50}),l.jsx(rk,{labelFormatter:o=>lA(Number(o)),formatter:(o,c)=>[Hc(Number(o)),c]}),l.jsx(yg,{verticalAlign:"top",align:"right",iconType:"circle",iconSize:8}),l.jsx(as,{type:"monotone",dataKey:"avg",name:"Avg",stroke:"#6366f1",fill:"#6366f1",fillOpacity:.1,strokeWidth:2}),l.jsx(as,{type:"monotone",dataKey:"max",name:"Max",stroke:"#fb7185",fill:"none",fillOpacity:0,strokeWidth:2})]})})}),l.jsxs("div",{className:"flex items-center gap-6 mt-3 pt-3 border-t border-gray-100",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Avg"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:Hc(r)})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"P95"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:Hc(s)})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Max"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:Hc(i)})]})]})]})}function cA(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function z0e({buckets:e}){const t=e.map(i=>({time:i.timestamp,sessions:i.activeSessions,ws:i.wsConnections})),n=e.reduce((i,a)=>Math.max(i,a.activeSessions),0),r=e.reduce((i,a)=>Math.max(i,a.wsConnections),0);return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 min-w-0",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Sessions & Connections"}),l.jsx("div",{className:"min-w-0",children:l.jsx(Y1,{width:"100%",height:200,children:l.jsxs(hk,{data:t,children:[l.jsx(Mg,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),l.jsx(Ig,{dataKey:"time",tickFormatter:cA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(Lg,{allowDecimals:!1,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1,width:30}),l.jsx(rk,{labelFormatter:i=>cA(Number(i)),formatter:(i,a)=>[Number(i),a]}),l.jsx(yg,{verticalAlign:"top",align:"right",iconType:"circle",iconSize:8}),l.jsx(as,{type:"stepAfter",dataKey:"sessions",name:"Sessions",stroke:"#3b82f6",fill:"#3b82f6",fillOpacity:.1,strokeWidth:2}),l.jsx(as,{type:"stepAfter",dataKey:"ws",name:"WebSocket",stroke:"#22d3ee",fill:"none",fillOpacity:0,strokeWidth:2})]})})}),l.jsxs("div",{className:"flex items-center gap-6 mt-3 pt-3 border-t border-gray-100",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Peak Sessions"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:n})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Peak WS"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:r})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Stuck"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"0"})]})]})]})}function $0e({topTools:e}){const t=e.reduce((r,i)=>r+i.total,0),n=e.length>0?e[0].total:0;return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"Tool Calls Top 10"}),l.jsxs("div",{className:"text-xs text-gray-400",children:[t," total · Since start"]})]}),l.jsxs("div",{className:"space-y-2",children:[e.length===0&&l.jsx("div",{className:"text-sm text-gray-400 text-center py-8",children:"No tool calls yet"}),e.map(r=>{const i=n>0?r.total/n*100:0;return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-32 truncate font-mono text-xs text-gray-600",title:r.toolName,children:r.toolName}),l.jsxs("div",{className:"flex-1 bg-gray-100 rounded-md h-6 relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-y-0 left-0 bg-indigo-100 rounded-md",style:{width:`${i}%`}}),l.jsxs("div",{className:"absolute inset-0 flex items-center justify-between px-2",children:[l.jsx("span",{className:"text-xs font-medium text-gray-700",children:r.total}),r.error>0&&l.jsxs("span",{className:"text-xs font-medium text-red-500",children:[r.error," err"]})]})]})]},r.toolName)})]})]})}const B0e={builtin:"bg-blue-100 text-blue-800",team:"bg-amber-100 text-amber-800",personal:"bg-purple-100 text-purple-800"},U0e={builtin:"core",team:"team",personal:"personal"};function V0e({scope:e}){return l.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${B0e[e]??"bg-gray-100 text-gray-600"}`,children:U0e[e]??e})}function W0e({topSkills:e}){const t=e.reduce((i,a)=>i+a.total,0),n=e.length>0?e[0].total:0,r={builtin:0,team:0,personal:0};for(const i of e)i.scope in r&&(r[i.scope]+=i.total);return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"Skill Calls Top 10"}),l.jsxs("div",{className:"text-xs text-gray-400",children:[t," total"]})]}),e.length===0?l.jsx("div",{className:"text-sm text-gray-400 text-center py-8",children:"No skill calls yet"}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"space-y-2",children:e.map(i=>{const a=n>0?i.total/n*100:0;return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-32 truncate font-mono text-xs text-gray-600",title:i.skillName,children:i.skillName}),l.jsxs("div",{className:"flex-1 bg-gray-100 rounded-md h-6 relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-y-0 left-0 bg-purple-100 rounded-md",style:{width:`${a}%`}}),l.jsxs("div",{className:"absolute inset-0 flex items-center px-2",children:[l.jsx("span",{className:"text-xs font-medium text-purple-700",children:i.total}),i.error>0&&l.jsxs("span",{className:"text-xs text-red-400 ml-1",children:[i.error," err"]}),l.jsx("span",{className:"ml-auto",children:l.jsx(V0e,{scope:i.scope})})]})]})]},i.skillName)})}),l.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[l.jsx("span",{className:"text-gray-400",children:"By scope:"}),r.builtin>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-300"}),"core ",l.jsx("span",{className:"font-medium text-gray-700",children:r.builtin})]}),r.team>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-300"}),"team ",l.jsx("span",{className:"font-medium text-gray-700",children:r.team})]}),r.personal>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2 h-2 rounded-full bg-purple-300"}),"personal ",l.jsx("span",{className:"font-medium text-gray-700",children:r.personal})]})]}),t>0&&l.jsxs("div",{className:"flex h-1.5 mt-2 rounded-full overflow-hidden bg-gray-100",children:[r.builtin>0&&l.jsx("div",{className:"bg-blue-300",style:{width:`${r.builtin/t*100}%`}}),r.team>0&&l.jsx("div",{className:"bg-amber-300",style:{width:`${r.team/t*100}%`}}),r.personal>0&&l.jsx("div",{className:"bg-purple-300",style:{width:`${r.personal/t*100}%`}})]})]})]})]})}const uA=["bg-indigo-500","bg-violet-400","bg-emerald-400","bg-amber-400"];function ib(e){return e===0?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function Zf({label:e,value:t,total:n}){const r=n>0?t/n*100:0;return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsx("span",{className:"text-gray-600 font-medium",children:e}),l.jsxs("span",{className:"text-gray-400",children:[ib(t)," (",r.toFixed(1),"%)"]})]}),l.jsx("div",{className:"h-2 bg-gray-100 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-indigo-400",style:{width:`${Math.min(r,100)}%`}})})]})}function H0e(){var o;const[e,t]=m.useState("today"),{data:n,loading:r}=fee(e),i=["today","7d","30d"],a=(n==null?void 0:n.tokenBreakdown)??{input:0,output:0,cacheRead:0,cacheWrite:0},s=a.input+a.output+a.cacheRead+a.cacheWrite;return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"Cumulative Statistics"}),l.jsx("div",{className:"flex rounded-lg overflow-hidden border border-gray-200",children:i.map(c=>l.jsx("button",{onClick:()=>t(c),className:U("px-2.5 py-1 text-xs font-medium transition",e===c?"bg-primary-600 text-white":"bg-gray-50 text-gray-600 hover:bg-gray-200"),children:c==="today"?"Today":c},c))})]}),r&&!n?l.jsx("div",{className:"text-sm text-gray-400 text-center py-8",children:"Loading..."}):l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[l.jsxs("div",{className:"rounded-xl bg-gray-50 p-3 text-center",children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Tokens"}),l.jsx("div",{className:"text-lg font-bold text-gray-900",children:ib((n==null?void 0:n.totalTokens)??0)})]}),l.jsxs("div",{className:"rounded-xl bg-gray-50 p-3 text-center",children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Sessions"}),l.jsx("div",{className:"text-lg font-bold text-gray-900",children:(n==null?void 0:n.totalSessions)??0})]}),l.jsxs("div",{className:"rounded-xl bg-gray-50 p-3 text-center",children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Prompts"}),l.jsx("div",{className:"text-lg font-bold text-gray-900",children:(n==null?void 0:n.totalPrompts)??0})]})]}),l.jsx("div",{className:"text-xs text-gray-400 mb-2",children:"Token Breakdown"}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx(Zf,{label:"Input",value:a.input,total:s}),l.jsx(Zf,{label:"Output",value:a.output,total:s}),l.jsx(Zf,{label:"Cache Read",value:a.cacheRead,total:s}),l.jsx(Zf,{label:"Cache Write",value:a.cacheWrite,total:s})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-2",children:"Model Distribution"}),l.jsxs("div",{className:"space-y-3",children:[(!(n!=null&&n.byModel)||n.byModel.length===0)&&l.jsx("div",{className:"text-sm text-gray-400 text-center py-4",children:"No data"}),(o=n==null?void 0:n.byModel)==null?void 0:o.map((c,u)=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("span",{className:"text-xs font-medium text-gray-700 truncate",children:[c.provider,"/",c.model]}),l.jsxs("span",{className:"text-xs text-gray-400 ml-2 shrink-0",children:[ib(c.tokens)," · ",c.sessions," sessions · ",c.percentage.toFixed(1),"%"]})]}),l.jsx("div",{className:"h-2 bg-gray-100 rounded-full overflow-hidden",children:l.jsx("div",{className:U("h-full rounded-full",uA[Math.min(u,uA.length-1)]),style:{width:`${c.percentage}%`}})})]},`${c.provider}-${c.model}`))]})]})]})]})}function K0e({data:e,range:t,loading:n}){if(n&&!e)return l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsx("div",{className:"text-sm",children:"Loading metrics..."})});const r=(e==null?void 0:e.buckets)??[],i=(e==null?void 0:e.snapshot)??{activeSessions:0,wsConnections:0},a=(e==null?void 0:e.topTools)??[],s=(e==null?void 0:e.topSkills)??[];return l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"px-6 py-6 max-w-[1400px] mx-auto w-full space-y-6",children:[l.jsx(hee,{buckets:r,snapshot:i,range:t}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(R0e,{buckets:r}),l.jsx(F0e,{buckets:r})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx($0e,{topTools:a}),l.jsx(W0e,{topSkills:s})]}),l.jsx(z0e,{buckets:r}),l.jsx(H0e,{})]})})}const dA=[{label:"Last 1h",value:"1h",ms:36e5},{label:"Last 6h",value:"6h",ms:216e5},{label:"Last 24h",value:"24h",ms:864e5},{label:"Last 7d",value:"7d",ms:6048e5},{label:"Last 30d",value:"30d",ms:2592e6}],q0e=["All","bash","restricted_bash","run_skill","node_exec","pod_exec","kubectl"],G0e=["All","success","error","blocked"];function Y0e(e,t){if(!t)return"—";try{const n=JSON.parse(t);switch(e){case"bash":case"restricted_bash":return n.command??t;case"run_skill":return[n.skill,n.script].filter(Boolean).join("/");case"node_exec":case"pod_exec":return n.command??t;default:return t.length>100?t.slice(0,100)+"...":t}}catch{return t.length>100?t.slice(0,100)+"...":t}}function P6(e){return e==null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function X0e(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Z0e(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function Q0e({outcome:e}){switch(e){case"success":return l.jsx(X7,{className:"w-4 h-4 text-green-500"});case"error":return l.jsx(vs,{className:"w-4 h-4 text-red-500"});case"blocked":return l.jsx(GO,{className:"w-4 h-4 text-amber-500"});default:return l.jsx("span",{className:"text-gray-400 text-xs",children:"—"})}}function J0e(){const{sendRpc:e,isConnected:t}=Rt(),{isAdmin:n}=wa(e,t),[r,i]=m.useState(""),[a,s]=m.useState("All"),[o,c]=m.useState("All"),[u,d]=m.useState("24h"),[f,h]=m.useState([]),[p,g]=m.useState(!1),[y,x]=m.useState(!1),[v,b]=m.useState(!1),[w,S]=m.useState(null),[k,j]=m.useState({}),[N,P]=m.useState(!1),T=m.useRef(r);T.current=r;const E=m.useCallback(async A=>{var M;x(!0);try{const B=((M=dA.find(oe=>oe.value===u))==null?void 0:M.ms)??864e5,ae=new Date,Q=new Date(ae.getTime()-B).toISOString(),I=ae.toISOString(),H={startDate:Q,endDate:I,limit:50};n&&T.current&&(H.userName=T.current),a!=="All"&&(H.toolName=a),o!=="All"&&(H.outcome=o),A&&(H.cursorTs=A.ts,H.cursorId=A.id);const O=await e("audit.list",H);h(A?oe=>[...oe,...O.logs]:O.logs),g(O.hasMore),b(!0)}catch(B){console.error("[AuditTab] search failed:",B)}finally{x(!1)}},[e,n,a,o,u]);m.useEffect(()=>{t&&E()},[t,E]);const _=m.useCallback(()=>{if(f.length===0)return;const A=f[f.length-1],M=Math.floor(new Date(A.timestamp).getTime()/1e3);E({ts:M,id:A.id})},[f,E]),C=m.useCallback(async A=>{if(w===A){S(null);return}if(S(A),!k[A]){P(!0);try{const M=await e("audit.detail",{messageId:A});j(B=>{const ae=Object.entries(B);return{...ae.length>=50?Object.fromEntries(ae.slice(-49)):B,[A]:M}})}catch(M){console.error("[AuditTab] detail load failed:",M)}finally{P(!1)}}},[w,k,e]);return l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsxs("div",{className:"px-6 py-4 border-b border-gray-200 flex flex-wrap items-center gap-3",children:[n&&l.jsx("input",{type:"text",placeholder:"Username",value:r,onChange:A=>i(A.target.value),onKeyDown:A=>{A.key==="Enter"&&E()},className:"h-8 px-3 text-sm border border-gray-200 rounded-lg bg-white focus:outline-none focus:ring-1 focus:ring-primary-500 w-36"}),l.jsx("select",{value:a,onChange:A=>s(A.target.value),className:"h-8 px-2 text-sm border border-gray-200 rounded-lg bg-white focus:outline-none focus:ring-1 focus:ring-primary-500",children:q0e.map(A=>l.jsx("option",{value:A,children:A==="All"?"All Tools":A},A))}),l.jsx("select",{value:o,onChange:A=>c(A.target.value),className:"h-8 px-2 text-sm border border-gray-200 rounded-lg bg-white focus:outline-none focus:ring-1 focus:ring-primary-500",children:G0e.map(A=>l.jsx("option",{value:A,children:A==="All"?"All Status":A},A))}),l.jsx("select",{value:u,onChange:A=>d(A.target.value),className:"h-8 px-2 text-sm border border-gray-200 rounded-lg bg-white focus:outline-none focus:ring-1 focus:ring-primary-500",children:dA.map(A=>l.jsx("option",{value:A.value,children:A.label},A.value))}),l.jsxs("button",{onClick:()=>E(),disabled:y,className:"h-8 px-4 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 disabled:opacity-50 flex items-center gap-1.5",children:[l.jsx(Kn,{className:"w-3.5 h-3.5"}),"Search"]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:v?f.length===0?l.jsx("div",{className:"flex items-center justify-center h-full text-gray-400 text-sm",children:"No audit logs found"}):l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"sticky top-0 bg-gray-50 border-b border-gray-200",children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left px-6 py-2.5 font-medium text-gray-500 w-10"}),l.jsx("th",{className:"text-left px-3 py-2.5 font-medium text-gray-500",children:"Time"}),l.jsx("th",{className:"text-left px-3 py-2.5 font-medium text-gray-500",children:"User"}),l.jsx("th",{className:"text-left px-3 py-2.5 font-medium text-gray-500",children:"Tool"}),l.jsx("th",{className:"text-left px-3 py-2.5 font-medium text-gray-500",children:"Command"}),l.jsx("th",{className:"text-center px-3 py-2.5 font-medium text-gray-500 w-16",children:"Status"}),l.jsx("th",{className:"text-right px-6 py-2.5 font-medium text-gray-500 w-20",children:"Duration"})]})}),l.jsx("tbody",{children:f.map(A=>l.jsx(eye,{log:A,expanded:w===A.id,detail:k[A.id],detailLoading:N&&w===A.id,onToggle:()=>C(A.id)},A.id))})]}):l.jsx("div",{className:"flex items-center justify-center h-full text-gray-400 text-sm",children:"Click Search to load audit logs"})}),p&&l.jsx("div",{className:"px-6 py-3 border-t border-gray-200 flex justify-center",children:l.jsxs("button",{onClick:_,disabled:y,className:"px-4 py-1.5 text-sm text-primary-600 hover:bg-primary-50 rounded-lg disabled:opacity-50 flex items-center gap-1.5",children:[y&&l.jsx(Ie,{className:"w-3.5 h-3.5 animate-spin"}),"Load More"]})})]})}function eye({log:e,expanded:t,detail:n,detailLoading:r,onToggle:i}){const a=Y0e(e.toolName,e.toolInput);return l.jsxs(l.Fragment,{children:[l.jsxs("tr",{onClick:i,className:U("cursor-pointer hover:bg-gray-50 border-b border-gray-100",t&&"bg-gray-50"),children:[l.jsx("td",{className:"px-6 py-2.5 text-gray-400",children:t?l.jsx(ea,{className:"w-4 h-4"}):l.jsx(ua,{className:"w-4 h-4"})}),l.jsxs("td",{className:"px-3 py-2.5 text-gray-600 whitespace-nowrap",children:[l.jsx("span",{className:"text-gray-400 text-xs mr-1",children:Z0e(e.timestamp)}),X0e(e.timestamp)]}),l.jsx("td",{className:"px-3 py-2.5 text-gray-700 font-medium",children:e.userName??e.userId??"—"}),l.jsx("td",{className:"px-3 py-2.5",children:l.jsx("span",{className:"inline-block px-1.5 py-0.5 text-xs font-mono bg-gray-100 text-gray-600 rounded",children:e.toolName??"—"})}),l.jsx("td",{className:"px-3 py-2.5 text-gray-600 max-w-xs truncate font-mono text-xs",title:a,children:a}),l.jsx("td",{className:"px-3 py-2.5 text-center",children:l.jsx(Q0e,{outcome:e.outcome})}),l.jsx("td",{className:"px-6 py-2.5 text-right text-gray-500 tabular-nums",children:P6(e.durationMs)})]}),t&&l.jsx("tr",{className:"bg-gray-50",children:l.jsx("td",{colSpan:7,className:"px-6 py-4",children:r?l.jsxs("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[l.jsx(Ie,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):n?l.jsx(tye,{detail:n}):l.jsx("div",{className:"text-gray-400 text-sm",children:"Failed to load details"})})})]})}function tye({detail:e}){const[t,n]=m.useState(!1),r=e.content||"",i=r.length>500;let a=null;try{e.toolInput&&(a=JSON.parse(e.toolInput))}catch{}return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:[l.jsx("span",{className:"text-gray-400",children:"Tool"}),l.jsx("span",{className:"font-mono text-gray-700",children:e.toolName}),a&&e.toolName==="run_skill"&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-gray-400",children:"Skill"}),l.jsx("span",{className:"font-mono text-gray-700",children:a.skill}),l.jsx("span",{className:"text-gray-400",children:"Script"}),l.jsx("span",{className:"font-mono text-gray-700",children:a.script}),a.args&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-gray-400",children:"Args"}),l.jsx("span",{className:"font-mono text-gray-700",children:a.args})]})]}),l.jsx("span",{className:"text-gray-400",children:"Outcome"}),l.jsx("span",{className:U("font-medium",e.outcome==="success"&&"text-green-600",e.outcome==="error"&&"text-red-600",e.outcome==="blocked"&&"text-amber-600"),children:e.outcome??"—"}),l.jsx("span",{className:"text-gray-400",children:"Duration"}),l.jsx("span",{className:"text-gray-700",children:P6(e.durationMs)})]}),e.toolInput&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Command"}),l.jsx("pre",{className:"p-3 bg-gray-900 text-gray-100 rounded-lg text-xs font-mono overflow-auto max-h-64",children:e.toolInput})]}),r&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Output"}),l.jsx("pre",{className:U("p-3 bg-gray-900 text-gray-100 rounded-lg text-xs font-mono overflow-auto",!t&&i&&"max-h-48"),children:t||!i?r:r.slice(0,500)+"..."}),i&&l.jsx("button",{onClick:()=>n(s=>!s),className:"mt-1 text-xs text-primary-600 hover:text-primary-700",children:t?"Show less":"Show full output"})]})]})}function nye({grafanaUrl:e}){return e?l.jsx("iframe",{src:e,className:"flex-1 w-full border-0",allow:"fullscreen",title:"Grafana Dashboard"}):l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsxs("div",{className:"text-center",children:[l.jsx(sw,{className:"w-12 h-12 mx-auto mb-3 text-gray-300"}),l.jsx("div",{className:"text-lg font-medium text-gray-500 mb-1",children:"Grafana"}),l.jsxs("div",{className:"text-sm",children:["Configure Grafana URL in"," ",l.jsx(HO,{to:"/settings/system",className:"text-primary-600 hover:underline",children:"System Settings"})," ","to enable."]})]})})}function rye(){const[e,t]=m.useState("dashboard"),[n,r]=m.useState("1h"),[i,a]=m.useState(null),{sendRpc:s,isConnected:o}=Rt(),{data:c,loading:u,refresh:d}=dee(n);m.useEffect(()=>{o&&s("system.getConfig").then(y=>{var x;a(((x=y.config)==null?void 0:x["system.grafanaUrl"])||null)}).catch(()=>{})},[s,o]);const[f,h]=m.useState(!1),p=m.useCallback(()=>{h(!0),d(),setTimeout(()=>h(!1),600)},[d]),g=["1h","6h","24h"];return l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden bg-white",children:[l.jsxs("div",{className:"h-14 flex items-center justify-between px-6 border-b border-gray-200 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Dashboard"}),l.jsxs("div",{className:"flex gap-4 ml-4",children:[l.jsx("button",{onClick:()=>t("dashboard"),className:U("pb-[13px] pt-[14px] text-sm px-1 transition border-b-2",e==="dashboard"?"border-primary-600 text-primary-600 font-semibold":"border-transparent text-gray-500 hover:text-gray-700"),children:"Metrics"}),l.jsx("button",{onClick:()=>t("audit"),className:U("pb-[13px] pt-[14px] text-sm px-1 transition border-b-2",e==="audit"?"border-primary-600 text-primary-600 font-semibold":"border-transparent text-gray-500 hover:text-gray-700"),children:"Audit"}),i&&l.jsx("button",{onClick:()=>t("grafana"),className:U("pb-[13px] pt-[14px] text-sm px-1 transition border-b-2",e==="grafana"?"border-primary-600 text-primary-600 font-semibold":"border-transparent text-gray-500 hover:text-gray-700"),children:"Grafana"})]})]}),e==="dashboard"&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex rounded-lg overflow-hidden border border-gray-200",children:g.map(y=>l.jsx("button",{onClick:()=>r(y),className:U("px-3 py-1.5 text-xs font-medium transition",n===y?"bg-primary-600 text-white":"bg-gray-50 text-gray-600 hover:bg-gray-200"),children:y},y))}),l.jsx("button",{onClick:p,className:"p-2 rounded-lg hover:bg-gray-100 text-gray-400 hover:text-gray-600 transition",children:l.jsx(dB,{className:U("w-4 h-4 transition-transform duration-500",f&&"animate-spin")})})]})]}),e==="dashboard"?l.jsx(K0e,{data:c,range:n,loading:u}):e==="audit"?l.jsx(J0e,{}):l.jsx(nye,{grafanaUrl:i})]})}function iye({title:e}){return l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-lg font-medium text-gray-500 mb-1",children:e}),l.jsx("div",{className:"text-sm",children:"Coming soon"})]})})}const aye=E7([{path:"/login",element:l.jsx(gq,{})},{path:"/login/sso-callback",element:l.jsx(yq,{})},{element:l.jsx(mq,{}),children:[{path:"/",element:l.jsx(pq,{}),children:[{index:!0,element:l.jsx(dh,{to:"/pilot",replace:!0})},{path:"pilot",element:l.jsx(XQ,{})},{path:"skills",children:[{index:!0,element:l.jsx(QQ,{})},{path:":id",element:l.jsx(xJ,{})}]},{path:"channels",element:l.jsx(kJ,{})},{path:"triggers",element:l.jsx(PJ,{})},{path:"cron",element:l.jsx(OJ,{})},{path:"permissions",element:l.jsx(RJ,{})},{path:"settings",element:l.jsx(IJ,{}),children:[{index:!0,element:l.jsx(DJ,{})},{path:"system",element:l.jsx(LJ,{})}]},{path:"credentials",element:l.jsx(uee,{})},{path:"sessions",element:l.jsx(iye,{title:"Sessions"})},{path:"workspace",element:l.jsx(GJ,{})},{path:"mcp",element:l.jsx(eee,{})},{path:"knowledge",element:l.jsx(aee,{})},{path:"environments",element:l.jsx(dh,{to:"/credentials",replace:!0})},{path:"models",element:l.jsx(VJ,{})},{path:"monitoring",element:l.jsx(rye,{})}]}]},{path:"*",element:l.jsx(dh,{to:"/login",replace:!0})}]);function sye(){return l.jsx(L7,{router:aye})}class oye extends m.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary] Uncaught error:",t,n.componentStack)}render(){var t;return this.state.hasError?l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100vh",fontFamily:"system-ui, sans-serif",color:"#374151"},children:[l.jsx("h1",{style:{fontSize:"1.5rem",marginBottom:"0.5rem"},children:"Something went wrong"}),l.jsx("p",{style:{color:"#6b7280",marginBottom:"1rem"},children:((t=this.state.error)==null?void 0:t.message)||"An unexpected error occurred."}),l.jsx("button",{onClick:()=>window.location.reload(),style:{padding:"0.5rem 1rem",borderRadius:"0.375rem",border:"1px solid #d1d5db",background:"#fff",cursor:"pointer"},children:"Reload"})]}):this.props.children}}Ey.createRoot(document.getElementById("root")).render(l.jsx(oye,{children:l.jsx(sye,{})}));
|