siclaw 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -114
- package/dist/agentbox/gateway-client.d.ts +2 -1
- package/dist/agentbox/gateway-client.js +6 -2
- package/dist/agentbox/gateway-client.js.map +1 -1
- package/dist/agentbox/http-server.js +184 -19
- package/dist/agentbox/http-server.js.map +1 -1
- package/dist/agentbox/resource-handlers.d.ts +1 -0
- package/dist/agentbox/resource-handlers.js +23 -23
- package/dist/agentbox/resource-handlers.js.map +1 -1
- package/dist/agentbox/session.js +85 -5
- package/dist/agentbox/session.js.map +1 -1
- package/dist/agentbox-main.d.ts +2 -1
- package/dist/agentbox-main.js +65 -18
- package/dist/agentbox-main.js.map +1 -1
- package/dist/cli-credentials.d.ts +1 -0
- package/dist/cli-credentials.js +109 -0
- package/dist/cli-credentials.js.map +1 -0
- package/dist/cli-first-run.d.ts +11 -0
- package/dist/cli-first-run.js +99 -0
- package/dist/cli-first-run.js.map +1 -0
- package/dist/cli-main.js +33 -11
- package/dist/cli-main.js.map +1 -1
- package/dist/cli-setup.d.ts +5 -11
- package/dist/cli-setup.js +12 -225
- package/dist/cli-setup.js.map +1 -1
- package/dist/core/agent-factory.d.ts +4 -0
- package/dist/core/agent-factory.js +102 -151
- package/dist/core/agent-factory.js.map +1 -1
- package/dist/core/config.d.ts +10 -3
- package/dist/core/config.js +11 -95
- package/dist/core/config.js.map +1 -1
- package/dist/core/extensions/deep-investigation.d.ts +2 -1
- package/dist/core/extensions/deep-investigation.js +144 -24
- package/dist/core/extensions/deep-investigation.js.map +1 -1
- package/dist/core/extensions/setup.d.ts +8 -0
- package/dist/core/extensions/setup.js +669 -0
- package/dist/core/extensions/setup.js.map +1 -0
- package/dist/core/llm-proxy.js +7 -3
- package/dist/core/llm-proxy.js.map +1 -1
- package/dist/core/mcp-client.d.ts +0 -10
- package/dist/core/mcp-client.js +0 -65
- package/dist/core/mcp-client.js.map +1 -1
- package/dist/core/prompt.d.ts +1 -1
- package/dist/core/prompt.js +42 -5
- package/dist/core/prompt.js.map +1 -1
- package/dist/core/provider-presets.d.ts +14 -0
- package/dist/core/provider-presets.js +81 -0
- package/dist/core/provider-presets.js.map +1 -0
- package/dist/cron/cron-coordinator.d.ts +2 -0
- package/dist/cron/cron-coordinator.js +46 -14
- package/dist/cron/cron-coordinator.js.map +1 -1
- package/dist/cron/cron-executor.js +33 -8
- package/dist/cron/cron-executor.js.map +1 -1
- package/dist/cron/cron-scheduler.d.ts +1 -1
- package/dist/cron/gateway-client.d.ts +5 -0
- package/dist/cron/gateway-client.js +43 -8
- package/dist/cron/gateway-client.js.map +1 -1
- package/dist/cron-main.js +39 -9
- package/dist/cron-main.js.map +1 -1
- package/dist/gateway/agentbox/client.d.ts +11 -0
- package/dist/gateway/agentbox/client.js +18 -0
- package/dist/gateway/agentbox/client.js.map +1 -1
- package/dist/gateway/agentbox/k8s-spawner.d.ts +11 -2
- package/dist/gateway/agentbox/k8s-spawner.js +95 -52
- package/dist/gateway/agentbox/k8s-spawner.js.map +1 -1
- package/dist/gateway/agentbox/local-spawner.d.ts +1 -1
- package/dist/gateway/agentbox/local-spawner.js +4 -2
- package/dist/gateway/agentbox/local-spawner.js.map +1 -1
- package/dist/gateway/agentbox/manager.d.ts +0 -10
- package/dist/gateway/agentbox/manager.js +11 -30
- package/dist/gateway/agentbox/manager.js.map +1 -1
- package/dist/gateway/agentbox/types.d.ts +6 -4
- package/dist/gateway/cron/cron-service.d.ts +49 -0
- package/dist/gateway/cron/cron-service.js +259 -0
- package/dist/gateway/cron/cron-service.js.map +1 -0
- package/dist/gateway/db/init-schema.js +44 -0
- package/dist/gateway/db/init-schema.js.map +1 -1
- package/dist/gateway/db/migrate-sqlite.js +73 -4
- package/dist/gateway/db/migrate-sqlite.js.map +1 -1
- package/dist/gateway/db/repositories/chat-repo.d.ts +56 -2
- package/dist/gateway/db/repositories/chat-repo.js +132 -2
- package/dist/gateway/db/repositories/chat-repo.js.map +1 -1
- package/dist/gateway/db/repositories/config-repo.d.ts +31 -2
- package/dist/gateway/db/repositories/config-repo.js +57 -7
- package/dist/gateway/db/repositories/config-repo.js.map +1 -1
- package/dist/gateway/db/repositories/env-repo.d.ts +14 -0
- package/dist/gateway/db/repositories/env-repo.js +15 -2
- package/dist/gateway/db/repositories/env-repo.js.map +1 -1
- package/dist/gateway/db/repositories/model-config-repo.d.ts +1 -1
- package/dist/gateway/db/repositories/model-config-repo.js +26 -12
- package/dist/gateway/db/repositories/model-config-repo.js.map +1 -1
- package/dist/gateway/db/repositories/skill-repo.d.ts +0 -5
- package/dist/gateway/db/repositories/skill-review-repo.d.ts +1 -0
- package/dist/gateway/db/repositories/skill-review-repo.js +4 -1
- package/dist/gateway/db/repositories/skill-review-repo.js.map +1 -1
- package/dist/gateway/db/repositories/skill-version-repo.js +0 -1
- package/dist/gateway/db/repositories/skill-version-repo.js.map +1 -1
- package/dist/gateway/db/repositories/system-config-repo.d.ts +1 -1
- package/dist/gateway/db/repositories/system-config-repo.js +2 -1
- package/dist/gateway/db/repositories/system-config-repo.js.map +1 -1
- package/dist/gateway/db/repositories/user-env-config-repo.d.ts +13 -0
- package/dist/gateway/db/repositories/user-env-config-repo.js +11 -0
- package/dist/gateway/db/repositories/user-env-config-repo.js.map +1 -1
- package/dist/gateway/db/repositories/workspace-repo.d.ts +3 -2
- package/dist/gateway/db/repositories/workspace-repo.js +6 -2
- package/dist/gateway/db/repositories/workspace-repo.js.map +1 -1
- package/dist/gateway/db/schema-mysql.d.ts +473 -51
- package/dist/gateway/db/schema-mysql.js +35 -4
- package/dist/gateway/db/schema-mysql.js.map +1 -1
- package/dist/gateway/db/schema-sqlite.d.ts +522 -57
- package/dist/gateway/db/schema-sqlite.js +38 -6
- package/dist/gateway/db/schema-sqlite.js.map +1 -1
- package/dist/gateway/db/schema.d.ts +471 -51
- package/dist/gateway/db/schema.js +1 -1
- package/dist/gateway/db/schema.js.map +1 -1
- package/dist/gateway/metrics-aggregator.d.ts +65 -0
- package/dist/gateway/metrics-aggregator.js +244 -0
- package/dist/gateway/metrics-aggregator.js.map +1 -0
- package/dist/gateway/plugins/channel-bridge.d.ts +4 -1
- package/dist/gateway/plugins/channel-bridge.js +78 -86
- package/dist/gateway/plugins/channel-bridge.js.map +1 -1
- package/dist/gateway/rpc-methods.d.ts +4 -2
- package/dist/gateway/rpc-methods.js +962 -163
- package/dist/gateway/rpc-methods.js.map +1 -1
- package/dist/gateway/security/cert-manager.d.ts +2 -2
- package/dist/gateway/security/cert-manager.js +4 -2
- package/dist/gateway/security/cert-manager.js.map +1 -1
- package/dist/gateway/server.d.ts +4 -8
- package/dist/gateway/server.js +297 -261
- package/dist/gateway/server.js.map +1 -1
- package/dist/gateway/skills/file-writer.js +17 -11
- package/dist/gateway/skills/file-writer.js.map +1 -1
- package/dist/gateway/skills/script-evaluator.js +12 -9
- package/dist/gateway/skills/script-evaluator.js.map +1 -1
- package/dist/gateway/web/dist/assets/index-0p17ZeTP.js +740 -0
- package/dist/gateway/web/dist/assets/index-9eP6nPUq.js +741 -0
- package/dist/gateway/web/dist/assets/index-9eP6nPUq.js.map +1 -0
- package/dist/gateway/web/dist/assets/index-CAmSY91d.js +675 -0
- package/dist/gateway/web/dist/assets/index-DMFEh8Pp.css +1 -0
- package/dist/gateway/web/dist/assets/index-DyowBCEj.css +1 -0
- package/dist/gateway/web/dist/assets/index-PDK5JJDO.css +1 -0
- package/dist/gateway/web/dist/index.html +2 -2
- package/dist/gateway-main.js +27 -10
- package/dist/gateway-main.js.map +1 -1
- package/dist/memory/embeddings.js +5 -4
- package/dist/memory/embeddings.js.map +1 -1
- package/dist/memory/indexer.d.ts +23 -3
- package/dist/memory/indexer.js +235 -23
- package/dist/memory/indexer.js.map +1 -1
- package/dist/memory/schema.js +15 -1
- package/dist/memory/schema.js.map +1 -1
- package/dist/memory/types.d.ts +18 -0
- package/dist/memory/types.js +6 -1
- package/dist/memory/types.js.map +1 -1
- package/dist/shared/detect-language.d.ts +12 -0
- package/dist/shared/detect-language.js +78 -0
- package/dist/shared/detect-language.js.map +1 -0
- package/dist/shared/diagnostic-events.d.ts +70 -0
- package/dist/shared/diagnostic-events.js +38 -0
- package/dist/shared/diagnostic-events.js.map +1 -0
- package/dist/shared/local-collector.d.ts +56 -0
- package/dist/shared/local-collector.js +284 -0
- package/dist/shared/local-collector.js.map +1 -0
- package/dist/shared/metrics-types.d.ts +64 -0
- package/dist/shared/metrics-types.js +25 -0
- package/dist/shared/metrics-types.js.map +1 -0
- package/dist/shared/metrics.d.ts +19 -0
- package/dist/shared/metrics.js +185 -0
- package/dist/shared/metrics.js.map +1 -0
- package/dist/shared/path-utils.d.ts +15 -0
- package/dist/shared/path-utils.js +23 -0
- package/dist/shared/path-utils.js.map +1 -0
- package/dist/shared/retry.d.ts +35 -0
- package/dist/shared/retry.js +61 -0
- package/dist/shared/retry.js.map +1 -0
- package/dist/tools/command-sets.d.ts +18 -2
- package/dist/tools/command-sets.js +207 -32
- package/dist/tools/command-sets.js.map +1 -1
- package/dist/tools/command-validator.d.ts +56 -0
- package/dist/tools/command-validator.js +357 -0
- package/dist/tools/command-validator.js.map +1 -0
- package/dist/tools/create-skill.js +26 -1
- package/dist/tools/create-skill.js.map +1 -1
- package/dist/tools/credential-list.js +1 -23
- package/dist/tools/credential-list.js.map +1 -1
- package/dist/tools/credential-manager.d.ts +98 -0
- package/dist/tools/credential-manager.js +313 -0
- package/dist/tools/credential-manager.js.map +1 -0
- package/dist/tools/deep-search/engine.js +184 -127
- package/dist/tools/deep-search/engine.js.map +1 -1
- package/dist/tools/deep-search/prompts.d.ts +10 -2
- package/dist/tools/deep-search/prompts.js +37 -36
- package/dist/tools/deep-search/prompts.js.map +1 -1
- package/dist/tools/deep-search/schemas.d.ts +87 -0
- package/dist/tools/deep-search/schemas.js +85 -0
- package/dist/tools/deep-search/schemas.js.map +1 -0
- package/dist/tools/deep-search/sub-agent.d.ts +21 -0
- package/dist/tools/deep-search/sub-agent.js +153 -4
- package/dist/tools/deep-search/sub-agent.js.map +1 -1
- package/dist/tools/deep-search/tool.js +1 -0
- package/dist/tools/deep-search/tool.js.map +1 -1
- package/dist/tools/deep-search/types.d.ts +2 -0
- package/dist/tools/deep-search/types.js.map +1 -1
- package/dist/tools/dp-tools.js +29 -5
- package/dist/tools/dp-tools.js.map +1 -1
- package/dist/tools/exec-utils.d.ts +85 -0
- package/dist/tools/exec-utils.js +294 -0
- package/dist/tools/exec-utils.js.map +1 -0
- package/dist/tools/fork-skill.js +14 -2
- package/dist/tools/fork-skill.js.map +1 -1
- package/dist/tools/investigation-feedback.d.ts +3 -0
- package/dist/tools/investigation-feedback.js +71 -0
- package/dist/tools/investigation-feedback.js.map +1 -0
- package/dist/tools/manage-schedule.js +16 -6
- package/dist/tools/manage-schedule.js.map +1 -1
- package/dist/tools/netns-script.js +27 -281
- package/dist/tools/netns-script.js.map +1 -1
- package/dist/tools/node-exec.d.ts +2 -14
- package/dist/tools/node-exec.js +18 -225
- package/dist/tools/node-exec.js.map +1 -1
- package/dist/tools/node-script.js +14 -168
- package/dist/tools/node-script.js.map +1 -1
- package/dist/tools/pod-exec.d.ts +1 -1
- package/dist/tools/pod-exec.js +10 -26
- package/dist/tools/pod-exec.js.map +1 -1
- package/dist/tools/pod-nsenter-exec.js +21 -225
- package/dist/tools/pod-nsenter-exec.js.map +1 -1
- package/dist/tools/pod-script.js +10 -19
- package/dist/tools/pod-script.js.map +1 -1
- package/dist/tools/restricted-bash.d.ts +1 -17
- package/dist/tools/restricted-bash.js +38 -252
- package/dist/tools/restricted-bash.js.map +1 -1
- package/dist/tools/run-skill.d.ts +3 -1
- package/dist/tools/run-skill.js +21 -1
- package/dist/tools/run-skill.js.map +1 -1
- package/dist/tools/script-resolver.d.ts +3 -1
- package/dist/tools/script-resolver.js +74 -30
- package/dist/tools/script-resolver.js.map +1 -1
- package/dist/tools/update-skill.js +17 -6
- package/dist/tools/update-skill.js.map +1 -1
- package/package.json +8 -6
- package/siclaw.mjs +10 -1
- package/skills/core/cluster-events/SKILL.md +1 -1
- package/skills/core/deep-investigation/SKILL.md +11 -0
- package/skills/core/deployment-rollout-debug/SKILL.md +1 -1
- package/skills/core/dns-debug/SKILL.md +1 -0
- package/skills/core/meta.json +12 -1
- package/skills/core/networkpolicy-debug/SKILL.md +332 -0
- package/skills/core/node-logs/scripts/get-node-logs.sh +19 -9
- package/skills/core/pod-pending-debug/SKILL.md +1 -0
- package/skills/core/quota-debug/SKILL.md +203 -0
- package/skills/core/service-debug/SKILL.md +1 -0
- package/skills/core/statefulset-debug/SKILL.md +280 -0
- package/skills/core/volcano-diagnose-pod/SKILL.md +196 -0
- package/skills/core/volcano-diagnose-pod/scripts/diagnose-pod.sh +175 -0
- package/skills/core/volcano-gang-scheduling/SKILL.md +299 -0
- package/skills/core/volcano-job-diagnose/SKILL.md +319 -0
- package/skills/core/volcano-job-diagnose/scripts/diagnose-job.sh +253 -0
- package/skills/core/volcano-node-resources/SKILL.md +334 -0
- package/skills/core/volcano-node-resources/scripts/get-node-resources.sh +281 -0
- package/skills/core/volcano-queue-diagnose/SKILL.md +294 -0
- package/skills/core/volcano-queue-diagnose/scripts/diagnose-queue.sh +283 -0
- package/skills/core/volcano-resource-insufficient/SKILL.md +315 -0
- package/skills/core/volcano-scheduler-config/SKILL.md +371 -0
- package/skills/core/volcano-scheduler-config/scripts/get-scheduler-config.sh +297 -0
- package/skills/core/volcano-scheduler-logs/SKILL.md +241 -0
- package/skills/core/volcano-scheduler-logs/scripts/get-scheduler-logs.sh +159 -0
- package/skills/platform/create-skill/SKILL.md +35 -3
- package/skills/platform/manage-skill/SKILL.md +9 -2
- package/skills/platform/update-skill/SKILL.md +17 -6
|
@@ -0,0 +1,741 @@
|
|
|
1
|
+
var E6=Object.defineProperty;var A6=(e,t,n)=>t in e?E6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fg=(e,t,n)=>A6(e,typeof t!="symbol"?t+"":t,n);function dA(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 Dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fA={exports:{}},am={},hA={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 pd=Symbol.for("react.element"),T6=Symbol.for("react.portal"),O6=Symbol.for("react.fragment"),_6=Symbol.for("react.strict_mode"),D6=Symbol.for("react.profiler"),M6=Symbol.for("react.provider"),I6=Symbol.for("react.context"),L6=Symbol.for("react.forward_ref"),R6=Symbol.for("react.suspense"),F6=Symbol.for("react.memo"),z6=Symbol.for("react.lazy"),hk=Symbol.iterator;function $6(e){return e===null||typeof e!="object"?null:(e=hk&&e[hk]||e["@@iterator"],typeof e=="function"?e:null)}var pA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mA=Object.assign,gA={};function ql(e,t,n){this.props=e,this.context=t,this.refs=gA,this.updater=n||pA}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 yA(){}yA.prototype=ql.prototype;function nb(e,t,n){this.props=e,this.context=t,this.refs=gA,this.updater=n||pA}var rb=nb.prototype=new yA;rb.constructor=nb;mA(rb,ql.prototype);rb.isPureReactComponent=!0;var pk=Array.isArray,xA=Object.prototype.hasOwnProperty,ib={current:null},vA={key:!0,ref:!0,__self:!0,__source:!0};function bA(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)xA.call(t,r)&&!vA.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:pd,type:e,key:a,ref:s,props:i,_owner:ib.current}}function B6(e,t){return{$$typeof:pd,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ab(e){return typeof e=="object"&&e!==null&&e.$$typeof===pd}function U6(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var mk=/\/+/g;function zg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?U6(""+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 pd:case T6:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+zg(s,0):r,pk(i)?(n="",e!=null&&(n=e.replace(mk,"$&/")+"/"),Qf(i,t,n,"",function(u){return u})):i!=null&&(ab(i)&&(i=B6(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(mk,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",pk(e))for(var o=0;o<e.length;o++){a=e[o];var c=r+zg(a,o);s+=Qf(a,t,n,c,i)}else if(c=$6(e),typeof c=="function")for(e=c.call(e),o=0;!(a=e.next()).done;)a=a.value,c=r+zg(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 tf(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 V6(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},W6={ReactCurrentDispatcher:Gn,ReactCurrentBatchConfig:Jf,ReactCurrentOwner:ib};function wA(){throw Error("act(...) is not supported in production builds of React.")}Ge.Children={map:tf,forEach:function(e,t,n){tf(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return tf(e,function(){t++}),t},toArray:function(e){return tf(e,function(t){return t})||[]},only:function(e){if(!ab(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ge.Component=ql;Ge.Fragment=O6;Ge.Profiler=D6;Ge.PureComponent=nb;Ge.StrictMode=_6;Ge.Suspense=R6;Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W6;Ge.act=wA;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=mA({},e.props),i=e.key,a=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,s=ib.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)xA.call(t,c)&&!vA.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:pd,type:e.type,key:i,ref:a,props:r,_owner:s}};Ge.createContext=function(e){return e={$$typeof:I6,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:M6,_context:e},e.Consumer=e};Ge.createElement=bA;Ge.createFactory=function(e){var t=bA.bind(null,e);return t.type=e,t};Ge.createRef=function(){return{current:null}};Ge.forwardRef=function(e){return{$$typeof:L6,render:e}};Ge.isValidElement=ab;Ge.lazy=function(e){return{$$typeof:z6,_payload:{_status:-1,_result:e},_init:V6}};Ge.memo=function(e,t){return{$$typeof:F6,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=wA;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";hA.exports=Ge;var m=hA.exports;const H6=hi(m),SA=dA({__proto__:null,default:H6},[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 K6=m,G6=Symbol.for("react.element"),q6=Symbol.for("react.fragment"),Y6=Object.prototype.hasOwnProperty,X6=K6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Z6={key:!0,ref:!0,__self:!0,__source:!0};function kA(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)Y6.call(t,r)&&!Z6.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:X6.current}}am.Fragment=q6;am.jsx=kA;am.jsxs=kA;fA.exports=am;var l=fA.exports,Ny={},jA={exports:{}},Pr={},NA={exports:{}},CA={};/**
|
|
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(M,K){var O=M.length;M.push(K);e:for(;0<O;){var ie=O-1>>>1,J=M[ie];if(0<i(J,K))M[ie]=K,M[O]=J,O=ie;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var K=M[0],O=M.pop();if(O!==K){M[0]=O;e:for(var ie=0,J=M.length,D=J>>>1;ie<D;){var H=2*(ie+1)-1,ee=M[H],be=H+1,ne=M[be];if(0>i(ee,O))be<J&&0>i(ne,ee)?(M[ie]=ne,M[be]=O,ie=be):(M[ie]=ee,M[H]=O,ie=H);else if(be<J&&0>i(ne,O))M[ie]=ne,M[be]=O,ie=be;else break e}}return K}function i(M,K){var O=M.sortIndex-K.sortIndex;return O!==0?O:M.id-K.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,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,v=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(M){for(var K=n(u);K!==null;){if(K.callback===null)r(u);else if(K.startTime<=M)r(u),K.sortIndex=K.expirationTime,t(c,K);else break;K=n(u)}}function k(M){if(y=!1,w(M),!g)if(n(c)!==null)g=!0,oe(S);else{var K=n(u);K!==null&&Z(k,K.startTime-M)}}function S(M,K){g=!1,y&&(y=!1,x(P),P=-1),p=!0;var O=h;try{for(w(K),f=n(c);f!==null&&(!(f.expirationTime>K)||M&&!_());){var ie=f.callback;if(typeof ie=="function"){f.callback=null,h=f.priorityLevel;var J=ie(f.expirationTime<=K);K=e.unstable_now(),typeof J=="function"?f.callback=J:f===n(c)&&r(c),w(K)}else r(c);f=n(c)}if(f!==null)var D=!0;else{var H=n(u);H!==null&&Z(k,H.startTime-K),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 M=e.unstable_now();E=M;var K=!0;try{K=N(!0,M)}finally{K?A():(j=!1,N=null)}}else j=!1}var A;if(typeof v=="function")A=function(){v(C)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,$=I.port2;I.port1.onmessage=C,A=function(){$.postMessage(null)}}else A=function(){b(C,0)};function oe(M){N=M,j||(j=!0,A())}function Z(M,K){P=b(function(){M(e.unstable_now())},K)}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(M){M.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,oe(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(M){switch(h){case 1:case 2:case 3:var K=3;break;default:K=h}var O=h;h=K;try{return M()}finally{h=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,K){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var O=h;h=M;try{return K()}finally{h=O}},e.unstable_scheduleCallback=function(M,K,O){var ie=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?ie+O:ie):O=ie,M){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=O+J,M={id:d++,callback:K,priorityLevel:M,startTime:O,expirationTime:J,sortIndex:-1},O>ie?(M.sortIndex=O,t(u,M),n(c)===null&&M===n(u)&&(y?(x(P),P=-1):y=!0,Z(k,O-ie))):(M.sortIndex=J,t(c,M),g||p||(g=!0,oe(S))),M},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(M){var K=h;return function(){var O=h;h=K;try{return M.apply(this,arguments)}finally{h=O}}}})(CA);NA.exports=CA;var Q6=NA.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 J6=m,wr=Q6;function he(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 PA=new Set,bu={};function jo(e,t){Nl(e,t),Nl(e+"Capture",t)}function Nl(e,t){for(bu[e]=t,e=0;e<t.length;e++)PA.add(t[e])}var sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cy=Object.prototype.hasOwnProperty,eF=/^[: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]*$/,gk={},yk={};function tF(e){return Cy.call(yk,e)?!0:Cy.call(gk,e)?!1:eF.test(e)?yk[e]=!0:(gk[e]=!0,!1)}function nF(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 rF(e,t,n,r){if(t===null||typeof t>"u"||nF(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 qn(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 Sn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Sn[e]=new qn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Sn[t]=new qn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Sn[e]=new qn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Sn[e]=new qn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Sn[e]=new qn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Sn[e]=new qn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Sn[e]=new qn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Sn[e]=new qn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Sn[e]=new qn(e,5,!1,e.toLowerCase(),null,!1,!1)});var sb=/[\-:]([a-z])/g;function ob(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(sb,ob);Sn[t]=new qn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(sb,ob);Sn[t]=new qn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(sb,ob);Sn[t]=new qn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Sn[e]=new qn(e,1,!1,e.toLowerCase(),null,!1,!1)});Sn.xlinkHref=new qn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Sn[e]=new qn(e,1,!1,e.toLowerCase(),null,!0,!0)});function lb(e,t,n,r){var i=Sn.hasOwnProperty(t)?Sn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(rF(t,n,i,r)&&(n=null),r||i===null?tF(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=J6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nf=Symbol.for("react.element"),qo=Symbol.for("react.portal"),Yo=Symbol.for("react.fragment"),cb=Symbol.for("react.strict_mode"),Py=Symbol.for("react.profiler"),EA=Symbol.for("react.provider"),AA=Symbol.for("react.context"),ub=Symbol.for("react.forward_ref"),Ey=Symbol.for("react.suspense"),Ay=Symbol.for("react.suspense_list"),db=Symbol.for("react.memo"),Ra=Symbol.for("react.lazy"),TA=Symbol.for("react.offscreen"),xk=Symbol.iterator;function yc(e){return e===null||typeof e!="object"?null:(e=xk&&e[xk]||e["@@iterator"],typeof e=="function"?e:null)}var Mt=Object.assign,$g;function Kc(e){if($g===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);$g=t&&t[1]||""}return`
|
|
34
|
+
`+$g+e}var Bg=!1;function Ug(e,t){if(!e||Bg)return"";Bg=!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{Bg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Kc(e):""}function iF(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=Ug(e.type,!1),e;case 11:return e=Ug(e.type.render,!1),e;case 1:return e=Ug(e.type,!0),e;default:return""}}function Ty(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 qo:return"Portal";case Py:return"Profiler";case cb:return"StrictMode";case Ey:return"Suspense";case Ay:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case AA:return(e.displayName||"Context")+".Consumer";case EA:return(e._context.displayName||"Context")+".Provider";case ub:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case db:return t=e.displayName||null,t!==null?t:Ty(e.type)||"Memo";case Ra:t=e._payload,e=e._init;try{return Ty(e(t))}catch{}}return null}function aF(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 Ty(t);case 8:return t===cb?"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 ss(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function OA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sF(e){var t=OA(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 rf(e){e._valueTracker||(e._valueTracker=sF(e))}function _A(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=OA(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 Oy(e,t){var n=t.checked;return Mt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function vk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ss(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 DA(e,t){t=t.checked,t!=null&&lb(e,"checked",t,!1)}function _y(e,t){DA(e,t);var n=ss(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")?Dy(e,t.type,n):t.hasOwnProperty("defaultValue")&&Dy(e,t.type,ss(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function bk(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 Dy(e,t,n){(t!=="number"||Nh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Gc=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=""+ss(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 My(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(he(91));return Mt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function wk(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(he(92));if(Gc(n)){if(1<n.length)throw Error(he(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ss(n)}}function MA(e,t){var n=ss(t.value),r=ss(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 Sk(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function IA(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 Iy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?IA(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var af,LA=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(af=af||document.createElement("div"),af.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=af.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function wu(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},oF=["Webkit","ms","Moz","O"];Object.keys(ru).forEach(function(e){oF.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ru[t]=ru[e]})});function RA(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 FA(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=RA(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var lF=Mt({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 Ly(e,t){if(t){if(lF[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(he(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(he(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(he(61))}if(t.style!=null&&typeof t.style!="object")throw Error(he(62))}}function Ry(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 Fy=null;function fb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zy=null,ml=null,gl=null;function kk(e){if(e=yd(e)){if(typeof zy!="function")throw Error(he(280));var t=e.stateNode;t&&(t=um(t),zy(e.stateNode,e.type,t))}}function zA(e){ml?gl?gl.push(e):gl=[e]:ml=e}function $A(){if(ml){var e=ml,t=gl;if(gl=ml=null,kk(e),t)for(e=0;e<t.length;e++)kk(t[e])}}function BA(e,t){return e(t)}function UA(){}var Vg=!1;function VA(e,t,n){if(Vg)return e(t,n);Vg=!0;try{return BA(e,t,n)}finally{Vg=!1,(ml!==null||gl!==null)&&(UA(),$A())}}function Su(e,t){var n=e.stateNode;if(n===null)return null;var r=um(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(he(231,t,typeof n));return n}var $y=!1;if(sa)try{var xc={};Object.defineProperty(xc,"passive",{get:function(){$y=!0}}),window.addEventListener("test",xc,xc),window.removeEventListener("test",xc,xc)}catch{$y=!1}function cF(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,By=null,uF={onError:function(e){iu=!0,Ch=e}};function dF(e,t,n,r,i,a,s,o,c){iu=!1,Ch=null,cF.apply(uF,arguments)}function fF(e,t,n,r,i,a,s,o,c){if(dF.apply(this,arguments),iu){if(iu){var u=Ch;iu=!1,Ch=null}else throw Error(he(198));Ph||(Ph=!0,By=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 WA(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 jk(e){if(No(e)!==e)throw Error(he(188))}function hF(e){var t=e.alternate;if(!t){if(t=No(e),t===null)throw Error(he(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 jk(i),e;if(a===r)return jk(i),t;a=a.sibling}throw Error(he(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(he(189))}}if(n.alternate!==r)throw Error(he(190))}if(n.tag!==3)throw Error(he(188));return n.stateNode.current===n?e:t}function HA(e){return e=hF(e),e!==null?KA(e):null}function KA(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=KA(e);if(t!==null)return t;e=e.sibling}return null}var GA=wr.unstable_scheduleCallback,Nk=wr.unstable_cancelCallback,pF=wr.unstable_shouldYield,mF=wr.unstable_requestPaint,Vt=wr.unstable_now,gF=wr.unstable_getCurrentPriorityLevel,hb=wr.unstable_ImmediatePriority,qA=wr.unstable_UserBlockingPriority,Eh=wr.unstable_NormalPriority,yF=wr.unstable_LowPriority,YA=wr.unstable_IdlePriority,sm=null,Pi=null;function xF(e){if(Pi&&typeof Pi.onCommitFiberRoot=="function")try{Pi.onCommitFiberRoot(sm,e,void 0,(e.current.flags&128)===128)}catch{}}var ii=Math.clz32?Math.clz32:wF,vF=Math.log,bF=Math.LN2;function wF(e){return e>>>=0,e===0?32:31-(vF(e)/bF|0)|0}var sf=64,of=4194304;function qc(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=qc(o):(a&=s,a!==0&&(r=qc(a)))}else s=n&~i,s!==0?r=qc(s):a!==0&&(r=qc(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-ii(t),i=1<<n,r|=e[n],t&=~i;return r}function SF(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 kF(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-ii(a),o=1<<s,c=i[s];c===-1?(!(o&n)||o&r)&&(i[s]=SF(o,t)):c<=t&&(e.expiredLanes|=o),a&=~o}}function Uy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function XA(){var e=sf;return sf<<=1,!(sf&4194240)&&(sf=64),e}function Wg(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function md(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ii(t),e[t]=n}function jF(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-ii(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function pb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ii(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var st=0;function ZA(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var QA,mb,JA,eT,tT,Vy=!1,lf=[],Ya=null,Xa=null,Za=null,ku=new Map,ju=new Map,Ba=[],NF="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 Ck(e,t){switch(e){case"focusin":case"focusout":Ya=null;break;case"dragenter":case"dragleave":Xa=null;break;case"mouseover":case"mouseout":Za=null;break;case"pointerover":case"pointerout":ku.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ju.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=yd(t),t!==null&&mb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function CF(e,t,n,r,i){switch(t){case"focusin":return Ya=vc(Ya,e,t,n,r,i),!0;case"dragenter":return Xa=vc(Xa,e,t,n,r,i),!0;case"mouseover":return Za=vc(Za,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return ku.set(a,vc(ku.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,ju.set(a,vc(ju.get(a)||null,e,t,n,r,i)),!0}return!1}function nT(e){var t=Vs(e.target);if(t!==null){var n=No(t);if(n!==null){if(t=n.tag,t===13){if(t=WA(n),t!==null){e.blockedOn=t,tT(e.priority,function(){JA(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=Wy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Fy=r,n.target.dispatchEvent(r),Fy=null}else return t=yd(n),t!==null&&mb(t),e.blockedOn=n,!1;t.shift()}return!0}function Pk(e,t,n){eh(e)&&n.delete(t)}function PF(){Vy=!1,Ya!==null&&eh(Ya)&&(Ya=null),Xa!==null&&eh(Xa)&&(Xa=null),Za!==null&&eh(Za)&&(Za=null),ku.forEach(Pk),ju.forEach(Pk)}function bc(e,t){e.blockedOn===t&&(e.blockedOn=null,Vy||(Vy=!0,wr.unstable_scheduleCallback(wr.unstable_NormalPriority,PF)))}function Nu(e){function t(i){return bc(i,e)}if(0<lf.length){bc(lf[0],e);for(var n=1;n<lf.length;n++){var r=lf[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ya!==null&&bc(Ya,e),Xa!==null&&bc(Xa,e),Za!==null&&bc(Za,e),ku.forEach(t),ju.forEach(t),n=0;n<Ba.length;n++)r=Ba[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ba.length&&(n=Ba[0],n.blockedOn===null);)nT(n),n.blockedOn===null&&Ba.shift()}var yl=ya.ReactCurrentBatchConfig,Th=!0;function EF(e,t,n,r){var i=st,a=yl.transition;yl.transition=null;try{st=1,gb(e,t,n,r)}finally{st=i,yl.transition=a}}function AF(e,t,n,r){var i=st,a=yl.transition;yl.transition=null;try{st=4,gb(e,t,n,r)}finally{st=i,yl.transition=a}}function gb(e,t,n,r){if(Th){var i=Wy(e,t,n,r);if(i===null)e0(e,t,r,Oh,n),Ck(e,r);else if(CF(i,e,t,n,r))r.stopPropagation();else if(Ck(e,r),t&4&&-1<NF.indexOf(e)){for(;i!==null;){var a=yd(i);if(a!==null&&QA(a),a=Wy(e,t,n,r),a===null&&e0(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else e0(e,t,r,null,n)}}var Oh=null;function Wy(e,t,n,r){if(Oh=null,e=fb(r),e=Vs(e),e!==null)if(t=No(e),t===null)e=null;else if(n=t.tag,n===13){if(e=WA(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 rT(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(gF()){case hb:return 1;case qA:return 4;case Eh:case yF:return 16;case YA:return 536870912;default:return 16}default:return 16}}var Wa=null,yb=null,th=null;function iT(){if(th)return th;var e,t=yb,n=t.length,r,i="value"in Wa?Wa.value:Wa.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 cf(){return!0}function Ek(){return!1}function Er(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)?cf:Ek,this.isPropagationStopped=Ek,this}return Mt(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=cf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=cf)},persist:function(){},isPersistent:cf}),t}var Yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xb=Er(Yl),gd=Mt({},Yl,{view:0,detail:0}),TF=Er(gd),Hg,Kg,wc,om=Mt({},gd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vb,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"?(Hg=e.screenX-wc.screenX,Kg=e.screenY-wc.screenY):Kg=Hg=0,wc=e),Hg)},movementY:function(e){return"movementY"in e?e.movementY:Kg}}),Ak=Er(om),OF=Mt({},om,{dataTransfer:0}),_F=Er(OF),DF=Mt({},gd,{relatedTarget:0}),Gg=Er(DF),MF=Mt({},Yl,{animationName:0,elapsedTime:0,pseudoElement:0}),IF=Er(MF),LF=Mt({},Yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),RF=Er(LF),FF=Mt({},Yl,{data:0}),Tk=Er(FF),zF={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$F={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"},BF={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UF(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BF[e])?!!t[e]:!1}function vb(){return UF}var VF=Mt({},gd,{key:function(e){if(e.key){var t=zF[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"?$F[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vb,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}}),WF=Er(VF),HF=Mt({},om,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ok=Er(HF),KF=Mt({},gd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vb}),GF=Er(KF),qF=Mt({},Yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),YF=Er(qF),XF=Mt({},om,{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}),ZF=Er(XF),QF=[9,13,27,32],bb=sa&&"CompositionEvent"in window,au=null;sa&&"documentMode"in document&&(au=document.documentMode);var JF=sa&&"TextEvent"in window&&!au,aT=sa&&(!bb||au&&8<au&&11>=au),_k=" ",Dk=!1;function sT(e,t){switch(e){case"keyup":return QF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xo=!1;function ez(e,t){switch(e){case"compositionend":return oT(t);case"keypress":return t.which!==32?null:(Dk=!0,_k);case"textInput":return e=t.data,e===_k&&Dk?null:e;default:return null}}function tz(e,t){if(Xo)return e==="compositionend"||!bb&&sT(e,t)?(e=iT(),th=yb=Wa=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 aT&&t.locale!=="ko"?null:t.data;default:return null}}var nz={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 Mk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!nz[e.type]:t==="textarea"}function lT(e,t,n,r){zA(r),t=_h(t,"onChange"),0<t.length&&(n=new xb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var su=null,Cu=null;function rz(e){vT(e,0)}function lm(e){var t=Jo(e);if(_A(t))return e}function iz(e,t){if(e==="change")return t}var cT=!1;if(sa){var qg;if(sa){var Yg="oninput"in document;if(!Yg){var Ik=document.createElement("div");Ik.setAttribute("oninput","return;"),Yg=typeof Ik.oninput=="function"}qg=Yg}else qg=!1;cT=qg&&(!document.documentMode||9<document.documentMode)}function Lk(){su&&(su.detachEvent("onpropertychange",uT),Cu=su=null)}function uT(e){if(e.propertyName==="value"&&lm(Cu)){var t=[];lT(t,Cu,e,fb(e)),VA(rz,t)}}function az(e,t,n){e==="focusin"?(Lk(),su=t,Cu=n,su.attachEvent("onpropertychange",uT)):e==="focusout"&&Lk()}function sz(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return lm(Cu)}function oz(e,t){if(e==="click")return lm(t)}function lz(e,t){if(e==="input"||e==="change")return lm(t)}function cz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ci=typeof Object.is=="function"?Object.is:cz;function Pu(e,t){if(ci(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(!Cy.call(t,i)||!ci(e[i],t[i]))return!1}return!0}function Rk(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fk(e,t){var n=Rk(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=Rk(n)}}function dT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fT(){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 wb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function uz(e){var t=fT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dT(n.ownerDocument.documentElement,n)){if(r!==null&&wb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Fk(n,a);var s=Fk(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 dz=sa&&"documentMode"in document&&11>=document.documentMode,Zo=null,Hy=null,ou=null,Ky=!1;function zk(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ky||Zo==null||Zo!==Nh(r)||(r=Zo,"selectionStart"in r&&wb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ou&&Pu(ou,r)||(ou=r,r=_h(Hy,"onSelect"),0<r.length&&(t=new xb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zo)))}function uf(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qo={animationend:uf("Animation","AnimationEnd"),animationiteration:uf("Animation","AnimationIteration"),animationstart:uf("Animation","AnimationStart"),transitionend:uf("Transition","TransitionEnd")},Xg={},hT={};sa&&(hT=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 cm(e){if(Xg[e])return Xg[e];if(!Qo[e])return e;var t=Qo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in hT)return Xg[e]=t[n];return e}var pT=cm("animationend"),mT=cm("animationiteration"),gT=cm("animationstart"),yT=cm("transitionend"),xT=new Map,$k="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 hs(e,t){xT.set(e,t),jo(t,[e])}for(var Zg=0;Zg<$k.length;Zg++){var Qg=$k[Zg],fz=Qg.toLowerCase(),hz=Qg[0].toUpperCase()+Qg.slice(1);hs(fz,"on"+hz)}hs(pT,"onAnimationEnd");hs(mT,"onAnimationIteration");hs(gT,"onAnimationStart");hs("dblclick","onDoubleClick");hs("focusin","onFocus");hs("focusout","onBlur");hs(yT,"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(" "),pz=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yc));function Bk(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,fF(r,t,void 0,e),e.currentTarget=null}function vT(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;Bk(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;Bk(i,o,u),a=c}}}if(Ph)throw e=By,Ph=!1,By=null,e}function bt(e,t){var n=t[Zy];n===void 0&&(n=t[Zy]=new Set);var r=e+"__bubble";n.has(r)||(bT(t,e,2,!1),n.add(r))}function Jg(e,t,n){var r=0;t&&(r|=4),bT(n,e,r,t)}var df="_reactListening"+Math.random().toString(36).slice(2);function Eu(e){if(!e[df]){e[df]=!0,PA.forEach(function(n){n!=="selectionchange"&&(pz.has(n)||Jg(n,!1,e),Jg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[df]||(t[df]=!0,Jg("selectionchange",!1,t))}}function bT(e,t,n,r){switch(rT(t)){case 1:var i=EF;break;case 4:i=AF;break;default:i=gb}n=i.bind(null,t,n,e),i=void 0,!$y||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 e0(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}VA(function(){var u=a,d=fb(n),f=[];e:{var h=xT.get(e);if(h!==void 0){var p=xb,g=e;switch(e){case"keypress":if(nh(n)===0)break e;case"keydown":case"keyup":p=WF;break;case"focusin":g="focus",p=Gg;break;case"focusout":g="blur",p=Gg;break;case"beforeblur":case"afterblur":p=Gg;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=Ak;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=_F;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=GF;break;case pT:case mT:case gT:p=IF;break;case yT:p=YF;break;case"scroll":p=TF;break;case"wheel":p=ZF;break;case"copy":case"cut":case"paste":p=RF;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Ok}var y=(t&4)!==0,b=!y&&e==="scroll",x=y?h!==null?h+"Capture":null:h;y=[];for(var v=u,w;v!==null;){w=v;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,x!==null&&(k=Su(v,x),k!=null&&y.push(Au(v,k,w)))),b)break;v=v.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!==Fy&&(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&&(b=No(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(y=Ak,k="onMouseLeave",x="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(y=Ok,k="onPointerLeave",x="onPointerEnter",v="pointer"),b=p==null?h:Jo(p),w=g==null?h:Jo(g),h=new y(k,v+"leave",p,n,d),h.target=b,h.relatedTarget=w,k=null,Vs(d)===u&&(y=new y(x,v+"enter",g,n,d),y.target=w,y.relatedTarget=b,k=y),b=k,p&&g)t:{for(y=p,x=g,v=0,w=y;w;w=Io(w))v++;for(w=0,k=x;k;k=Io(k))w++;for(;0<v-w;)y=Io(y),v--;for(;0<w-v;)x=Io(x),w--;for(;v--;){if(y===x||x!==null&&y===x.alternate)break t;y=Io(y),x=Io(x)}y=null}else y=null;p!==null&&Uk(f,h,p,y,!1),g!==null&&b!==null&&Uk(f,b,g,y,!0)}}e:{if(h=u?Jo(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=iz;else if(Mk(h))if(cT)S=lz;else{S=sz;var j=az}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=oz);if(S&&(S=S(e,u))){lT(f,S,n,d);break e}j&&j(e,h,u),e==="focusout"&&(j=h._wrapperState)&&j.controlled&&h.type==="number"&&Dy(h,"number",h.value)}switch(j=u?Jo(u):window,e){case"focusin":(Mk(j)||j.contentEditable==="true")&&(Zo=j,Hy=u,ou=null);break;case"focusout":ou=Hy=Zo=null;break;case"mousedown":Ky=!0;break;case"contextmenu":case"mouseup":case"dragend":Ky=!1,zk(f,n,d);break;case"selectionchange":if(dz)break;case"keydown":case"keyup":zk(f,n,d)}var N;if(bb)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?sT(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(aT&&n.locale!=="ko"&&(Xo||P!=="onCompositionStart"?P==="onCompositionEnd"&&Xo&&(N=iT()):(Wa=d,yb="value"in Wa?Wa.value:Wa.textContent,Xo=!0)),j=_h(u,P),0<j.length&&(P=new Tk(P,e,null,n,d),f.push({event:P,listeners:j}),N?P.data=N:(N=oT(n),N!==null&&(P.data=N)))),(N=JF?ez(e,n):tz(e,n))&&(u=_h(u,"onBeforeInput"),0<u.length&&(d=new Tk("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=N))}vT(f,t)})}function Au(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=Su(e,n),a!=null&&r.unshift(Au(e,a,i)),a=Su(e,t),a!=null&&r.push(Au(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 Uk(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=Su(n,a),c!=null&&s.unshift(Au(n,c,o))):i||(c=Su(n,a),c!=null&&s.push(Au(n,c,o)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var mz=/\r\n?/g,gz=/\u0000|\uFFFD/g;function Vk(e){return(typeof e=="string"?e:""+e).replace(mz,`
|
|
38
|
+
`).replace(gz,"")}function ff(e,t,n){if(t=Vk(t),Vk(e)!==t&&n)throw Error(he(425))}function Dh(){}var Gy=null,qy=null;function Yy(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 Xy=typeof setTimeout=="function"?setTimeout:void 0,yz=typeof clearTimeout=="function"?clearTimeout:void 0,Wk=typeof Promise=="function"?Promise:void 0,xz=typeof queueMicrotask=="function"?queueMicrotask:typeof Wk<"u"?function(e){return Wk.resolve(null).then(e).catch(vz)}:Xy;function vz(e){setTimeout(function(){throw e})}function t0(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),Nu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Nu(t)}function Qa(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 Hk(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 Xl=Math.random().toString(36).slice(2),ji="__reactFiber$"+Xl,Tu="__reactProps$"+Xl,oa="__reactContainer$"+Xl,Zy="__reactEvents$"+Xl,bz="__reactListeners$"+Xl,wz="__reactHandles$"+Xl;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=Hk(e);e!==null;){if(n=e[ji])return n;e=Hk(e)}return t}e=n,n=e.parentNode}return null}function yd(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(he(33))}function um(e){return e[Tu]||null}var Qy=[],el=-1;function ps(e){return{current:e}}function kt(e){0>el||(e.current=Qy[el],Qy[el]=null,el--)}function yt(e,t){el++,Qy[el]=e.current,e.current=t}var os={},Mn=ps(os),rr=ps(!1),oo=os;function Cl(e,t){var n=e.type.contextTypes;if(!n)return os;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(){kt(rr),kt(Mn)}function Kk(e,t,n){if(Mn.current!==os)throw Error(he(168));yt(Mn,t),yt(rr,n)}function wT(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(he(108,aF(e)||"Unknown",i));return Mt({},n,r)}function Ih(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||os,oo=Mn.current,yt(Mn,e),yt(rr,rr.current),!0}function Gk(e,t,n){var r=e.stateNode;if(!r)throw Error(he(169));n?(e=wT(e,t,oo),r.__reactInternalMemoizedMergedChildContext=e,kt(rr),kt(Mn),yt(Mn,e)):kt(rr),yt(rr,n)}var Hi=null,dm=!1,n0=!1;function ST(e){Hi===null?Hi=[e]:Hi.push(e)}function Sz(e){dm=!0,ST(e)}function ms(){if(!n0&&Hi!==null){n0=!0;var e=0,t=st;try{var n=Hi;for(st=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Hi=null,dm=!1}catch(i){throw Hi!==null&&(Hi=Hi.slice(e+1)),GA(hb,ms),i}finally{st=t,n0=!1}}return null}var tl=[],nl=0,Lh=null,Rh=0,Lr=[],Rr=0,lo=null,qi=1,Yi="";function Ds(e,t){tl[nl++]=Rh,tl[nl++]=Lh,Lh=e,Rh=t}function kT(e,t,n){Lr[Rr++]=qi,Lr[Rr++]=Yi,Lr[Rr++]=lo,lo=e;var r=qi;e=Yi;var i=32-ii(r)-1;r&=~(1<<i),n+=1;var a=32-ii(t)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,qi=1<<32-ii(t)+i|n<<i|r,Yi=a+e}else qi=1<<a|n<<i|r,Yi=e}function Sb(e){e.return!==null&&(Ds(e,1),kT(e,1,0))}function kb(e){for(;e===Lh;)Lh=tl[--nl],tl[nl]=null,Rh=tl[--nl],tl[nl]=null;for(;e===lo;)lo=Lr[--Rr],Lr[Rr]=null,Yi=Lr[--Rr],Lr[Rr]=null,qi=Lr[--Rr],Lr[Rr]=null}var yr=null,mr=null,Et=!1,ei=null;function jT(e,t){var n=zr(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 qk(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,yr=e,mr=Qa(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,yr=e,mr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=lo!==null?{id:qi,overflow:Yi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=zr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,yr=e,mr=null,!0):!1;default:return!1}}function Jy(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ex(e){if(Et){var t=mr;if(t){var n=t;if(!qk(e,t)){if(Jy(e))throw Error(he(418));t=Qa(n.nextSibling);var r=yr;t&&qk(e,t)?jT(r,n):(e.flags=e.flags&-4097|2,Et=!1,yr=e)}}else{if(Jy(e))throw Error(he(418));e.flags=e.flags&-4097|2,Et=!1,yr=e}}}function Yk(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;yr=e}function hf(e){if(e!==yr)return!1;if(!Et)return Yk(e),Et=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Yy(e.type,e.memoizedProps)),t&&(t=mr)){if(Jy(e))throw NT(),Error(he(418));for(;t;)jT(e,t),t=Qa(t.nextSibling)}if(Yk(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(he(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){mr=Qa(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}mr=null}}else mr=yr?Qa(e.stateNode.nextSibling):null;return!0}function NT(){for(var e=mr;e;)e=Qa(e.nextSibling)}function Pl(){mr=yr=null,Et=!1}function jb(e){ei===null?ei=[e]:ei.push(e)}var kz=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(he(309));var r=n.stateNode}if(!r)throw Error(he(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(he(284));if(!n._owner)throw Error(he(290,e))}return e}function pf(e,t){throw e=Object.prototype.toString.call(t),Error(he(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Xk(e){var t=e._init;return t(e._payload)}function CT(e){function t(x,v){if(e){var w=x.deletions;w===null?(x.deletions=[v],x.flags|=16):w.push(v)}}function n(x,v){if(!e)return null;for(;v!==null;)t(x,v),v=v.sibling;return null}function r(x,v){for(x=new Map;v!==null;)v.key!==null?x.set(v.key,v):x.set(v.index,v),v=v.sibling;return x}function i(x,v){return x=ns(x,v),x.index=0,x.sibling=null,x}function a(x,v,w){return x.index=w,e?(w=x.alternate,w!==null?(w=w.index,w<v?(x.flags|=2,v):w):(x.flags|=2,v)):(x.flags|=1048576,v)}function s(x){return e&&x.alternate===null&&(x.flags|=2),x}function o(x,v,w,k){return v===null||v.tag!==6?(v=c0(w,x.mode,k),v.return=x,v):(v=i(v,w),v.return=x,v)}function c(x,v,w,k){var S=w.type;return S===Yo?d(x,v,w.props.children,k,w.key):v!==null&&(v.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ra&&Xk(S)===v.type)?(k=i(v,w.props),k.ref=Sc(x,v,w),k.return=x,k):(k=ch(w.type,w.key,w.props,null,x.mode,k),k.ref=Sc(x,v,w),k.return=x,k)}function u(x,v,w,k){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=u0(w,x.mode,k),v.return=x,v):(v=i(v,w.children||[]),v.return=x,v)}function d(x,v,w,k,S){return v===null||v.tag!==7?(v=eo(w,x.mode,k,S),v.return=x,v):(v=i(v,w),v.return=x,v)}function f(x,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=c0(""+v,x.mode,w),v.return=x,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case nf:return w=ch(v.type,v.key,v.props,null,x.mode,w),w.ref=Sc(x,null,v),w.return=x,w;case qo:return v=u0(v,x.mode,w),v.return=x,v;case Ra:var k=v._init;return f(x,k(v._payload),w)}if(Gc(v)||yc(v))return v=eo(v,x.mode,w,null),v.return=x,v;pf(x,v)}return null}function h(x,v,w,k){var S=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:o(x,v,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case nf:return w.key===S?c(x,v,w,k):null;case qo:return w.key===S?u(x,v,w,k):null;case Ra:return S=w._init,h(x,v,S(w._payload),k)}if(Gc(w)||yc(w))return S!==null?null:d(x,v,w,k,null);pf(x,w)}return null}function p(x,v,w,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return x=x.get(w)||null,o(v,x,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case nf:return x=x.get(k.key===null?w:k.key)||null,c(v,x,k,S);case qo:return x=x.get(k.key===null?w:k.key)||null,u(v,x,k,S);case Ra:var j=k._init;return p(x,v,w,j(k._payload),S)}if(Gc(k)||yc(k))return x=x.get(w)||null,d(v,x,k,S,null);pf(v,k)}return null}function g(x,v,w,k){for(var S=null,j=null,N=v,P=v=0,T=null;N!==null&&P<w.length;P++){N.index>P?(T=N,N=null):T=N.sibling;var E=h(x,N,w[P],k);if(E===null){N===null&&(N=T);break}e&&N&&E.alternate===null&&t(x,N),v=a(E,v,P),j===null?S=E:j.sibling=E,j=E,N=T}if(P===w.length)return n(x,N),Et&&Ds(x,P),S;if(N===null){for(;P<w.length;P++)N=f(x,w[P],k),N!==null&&(v=a(N,v,P),j===null?S=N:j.sibling=N,j=N);return Et&&Ds(x,P),S}for(N=r(x,N);P<w.length;P++)T=p(N,x,P,w[P],k),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?P:T.key),v=a(T,v,P),j===null?S=T:j.sibling=T,j=T);return e&&N.forEach(function(_){return t(x,_)}),Et&&Ds(x,P),S}function y(x,v,w,k){var S=yc(w);if(typeof S!="function")throw Error(he(150));if(w=S.call(w),w==null)throw Error(he(151));for(var j=S=null,N=v,P=v=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(x,N,E.value,k);if(_===null){N===null&&(N=T);break}e&&N&&_.alternate===null&&t(x,N),v=a(_,v,P),j===null?S=_:j.sibling=_,j=_,N=T}if(E.done)return n(x,N),Et&&Ds(x,P),S;if(N===null){for(;!E.done;P++,E=w.next())E=f(x,E.value,k),E!==null&&(v=a(E,v,P),j===null?S=E:j.sibling=E,j=E);return Et&&Ds(x,P),S}for(N=r(x,N);!E.done;P++,E=w.next())E=p(N,x,P,E.value,k),E!==null&&(e&&E.alternate!==null&&N.delete(E.key===null?P:E.key),v=a(E,v,P),j===null?S=E:j.sibling=E,j=E);return e&&N.forEach(function(C){return t(x,C)}),Et&&Ds(x,P),S}function b(x,v,w,k){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 nf:e:{for(var S=w.key,j=v;j!==null;){if(j.key===S){if(S=w.type,S===Yo){if(j.tag===7){n(x,j.sibling),v=i(j,w.props.children),v.return=x,x=v;break e}}else if(j.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ra&&Xk(S)===j.type){n(x,j.sibling),v=i(j,w.props),v.ref=Sc(x,j,w),v.return=x,x=v;break e}n(x,j);break}else t(x,j);j=j.sibling}w.type===Yo?(v=eo(w.props.children,x.mode,k,w.key),v.return=x,x=v):(k=ch(w.type,w.key,w.props,null,x.mode,k),k.ref=Sc(x,v,w),k.return=x,x=k)}return s(x);case qo:e:{for(j=w.key;v!==null;){if(v.key===j)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(x,v.sibling),v=i(v,w.children||[]),v.return=x,x=v;break e}else{n(x,v);break}else t(x,v);v=v.sibling}v=u0(w,x.mode,k),v.return=x,x=v}return s(x);case Ra:return j=w._init,b(x,v,j(w._payload),k)}if(Gc(w))return g(x,v,w,k);if(yc(w))return y(x,v,w,k);pf(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(x,v.sibling),v=i(v,w),v.return=x,x=v):(n(x,v),v=c0(w,x.mode,k),v.return=x,x=v),s(x)):n(x,v)}return b}var El=CT(!0),PT=CT(!1),Fh=ps(null),zh=null,rl=null,Nb=null;function Cb(){Nb=rl=zh=null}function Pb(e){var t=Fh.current;kt(Fh),e._currentValue=t}function tx(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,Nb=rl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(er=!0),e.firstContext=null)}function Wr(e){var t=e._currentValue;if(Nb!==e)if(e={context:e,memoizedValue:t,next:null},rl===null){if(zh===null)throw Error(he(308));rl=e,zh.dependencies={lanes:0,firstContext:e}}else rl=rl.next=e;return t}var Ws=null;function Eb(e){Ws===null?Ws=[e]:Ws.push(e)}function ET(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Eb(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 Fa=!1;function Ab(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function AT(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 Ja(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Je&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,Eb(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,pb(e,n)}}function Zk(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;Fa=!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=Mt({},f,h);break e;case 2:Fa=!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 Qk(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(he(191,i));i.call(r)}}}var xd={},Ei=ps(xd),Ou=ps(xd),_u=ps(xd);function Hs(e){if(e===xd)throw Error(he(174));return e}function Tb(e,t){switch(yt(_u,t),yt(Ou,e),yt(Ei,xd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Iy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Iy(t,e)}kt(Ei),yt(Ei,t)}function Al(){kt(Ei),kt(Ou),kt(_u)}function TT(e){Hs(_u.current);var t=Hs(Ei.current),n=Iy(t,e.type);t!==n&&(yt(Ou,e),yt(Ei,n))}function Ob(e){Ou.current===e&&(kt(Ei),kt(Ou))}var Ot=ps(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 r0=[];function _b(){for(var e=0;e<r0.length;e++)r0[e]._workInProgressVersionPrimary=null;r0.length=0}var ih=ya.ReactCurrentDispatcher,i0=ya.ReactCurrentBatchConfig,co=0,Dt=null,Jt=null,on=null,Uh=!1,lu=!1,Du=0,jz=0;function Nn(){throw Error(he(321))}function Db(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ci(e[n],t[n]))return!1;return!0}function Mb(e,t,n,r,i,a){if(co=a,Dt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ih.current=e===null||e.memoizedState===null?Ez:Az,e=n(r,i),lu){a=0;do{if(lu=!1,Du=0,25<=a)throw Error(he(301));a+=1,on=Jt=null,t.updateQueue=null,ih.current=Tz,e=n(r,i)}while(lu)}if(ih.current=Vh,t=Jt!==null&&Jt.next!==null,co=0,on=Jt=Dt=null,Uh=!1,t)throw Error(he(300));return e}function Ib(){var e=Du!==0;return Du=0,e}function bi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Dt.memoizedState=on=e:on=on.next=e,on}function Hr(){if(Jt===null){var e=Dt.alternate;e=e!==null?e.memoizedState:null}else e=Jt.next;var t=on===null?Dt.memoizedState:on.next;if(t!==null)on=t,Jt=e;else{if(e===null)throw Error(he(310));Jt=e,e={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},on===null?Dt.memoizedState=on=e:on=on.next=e}return on}function Mu(e,t){return typeof t=="function"?t(e):t}function a0(e){var t=Hr(),n=t.queue;if(n===null)throw Error(he(311));n.lastRenderedReducer=e;var r=Jt,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,Dt.lanes|=d,uo|=d}u=u.next}while(u!==null&&u!==a);c===null?s=r:c.next=o,ci(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,Dt.lanes|=a,uo|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function s0(e){var t=Hr(),n=t.queue;if(n===null)throw Error(he(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);ci(a,t.memoizedState)||(er=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function OT(){}function _T(e,t){var n=Dt,r=Hr(),i=t(),a=!ci(r.memoizedState,i);if(a&&(r.memoizedState=i,er=!0),r=r.queue,Lb(IT.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||on!==null&&on.memoizedState.tag&1){if(n.flags|=2048,Iu(9,MT.bind(null,n,r,i,t),void 0,null),ln===null)throw Error(he(349));co&30||DT(n,t,i)}return i}function DT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Dt.updateQueue,t===null?(t={lastEffect:null,stores:null},Dt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function MT(e,t,n,r){t.value=n,t.getSnapshot=r,LT(t)&&RT(e)}function IT(e,t,n){return n(function(){LT(t)&&RT(e)})}function LT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ci(e,n)}catch{return!0}}function RT(e){var t=la(e,1);t!==null&&ai(t,e,1,-1)}function Jk(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:Mu,lastRenderedState:e},t.queue=e,e=e.dispatch=Pz.bind(null,Dt,e),[t.memoizedState,e]}function Iu(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Dt.updateQueue,t===null?(t={lastEffect:null,stores:null},Dt.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 FT(){return Hr().memoizedState}function ah(e,t,n,r){var i=bi();Dt.flags|=e,i.memoizedState=Iu(1|t,n,void 0,r===void 0?null:r)}function fm(e,t,n,r){var i=Hr();r=r===void 0?null:r;var a=void 0;if(Jt!==null){var s=Jt.memoizedState;if(a=s.destroy,r!==null&&Db(r,s.deps)){i.memoizedState=Iu(t,n,a,r);return}}Dt.flags|=e,i.memoizedState=Iu(1|t,n,a,r)}function ej(e,t){return ah(8390656,8,e,t)}function Lb(e,t){return fm(2048,8,e,t)}function zT(e,t){return fm(4,2,e,t)}function $T(e,t){return fm(4,4,e,t)}function BT(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 UT(e,t,n){return n=n!=null?n.concat([e]):null,fm(4,4,BT.bind(null,t,e),n)}function Rb(){}function VT(e,t){var n=Hr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Db(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function WT(e,t){var n=Hr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Db(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function HT(e,t,n){return co&21?(ci(n,t)||(n=XA(),Dt.lanes|=n,uo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,er=!0),e.memoizedState=n)}function Nz(e,t){var n=st;st=n!==0&&4>n?n:4,e(!0);var r=i0.transition;i0.transition={};try{e(!1),t()}finally{st=n,i0.transition=r}}function KT(){return Hr().memoizedState}function Cz(e,t,n){var r=ts(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},GT(e))qT(t,n);else if(n=ET(e,t,n,r),n!==null){var i=Vn();ai(n,e,r,i),YT(n,t,r)}}function Pz(e,t,n){var r=ts(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(GT(e))qT(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,ci(o,s)){var c=t.interleaved;c===null?(i.next=i,Eb(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=ET(e,t,i,r),n!==null&&(i=Vn(),ai(n,e,r,i),YT(n,t,r))}}function GT(e){var t=e.alternate;return e===Dt||t!==null&&t===Dt}function qT(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 YT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pb(e,n)}}var Vh={readContext:Wr,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useInsertionEffect:Nn,useLayoutEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useDeferredValue:Nn,useTransition:Nn,useMutableSource:Nn,useSyncExternalStore:Nn,useId:Nn,unstable_isNewReconciler:!1},Ez={readContext:Wr,useCallback:function(e,t){return bi().memoizedState=[e,t===void 0?null:t],e},useContext:Wr,useEffect:ej,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ah(4194308,4,BT.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=Cz.bind(null,Dt,e),[r.memoizedState,e]},useRef:function(e){var t=bi();return e={current:e},t.memoizedState=e},useState:Jk,useDebugValue:Rb,useDeferredValue:function(e){return bi().memoizedState=e},useTransition:function(){var e=Jk(!1),t=e[0];return e=Nz.bind(null,e[1]),bi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Dt,i=bi();if(Et){if(n===void 0)throw Error(he(407));n=n()}else{if(n=t(),ln===null)throw Error(he(349));co&30||DT(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,ej(IT.bind(null,r,a,e),[e]),r.flags|=2048,Iu(9,MT.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=bi(),t=ln.identifierPrefix;if(Et){var n=Yi,r=qi;n=(r&~(1<<32-ii(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Du++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=jz++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Az={readContext:Wr,useCallback:VT,useContext:Wr,useEffect:Lb,useImperativeHandle:UT,useInsertionEffect:zT,useLayoutEffect:$T,useMemo:WT,useReducer:a0,useRef:FT,useState:function(){return a0(Mu)},useDebugValue:Rb,useDeferredValue:function(e){var t=Hr();return HT(t,Jt.memoizedState,e)},useTransition:function(){var e=a0(Mu)[0],t=Hr().memoizedState;return[e,t]},useMutableSource:OT,useSyncExternalStore:_T,useId:KT,unstable_isNewReconciler:!1},Tz={readContext:Wr,useCallback:VT,useContext:Wr,useEffect:Lb,useImperativeHandle:UT,useInsertionEffect:zT,useLayoutEffect:$T,useMemo:WT,useReducer:s0,useRef:FT,useState:function(){return s0(Mu)},useDebugValue:Rb,useDeferredValue:function(e){var t=Hr();return Jt===null?t.memoizedState=e:HT(t,Jt.memoizedState,e)},useTransition:function(){var e=s0(Mu)[0],t=Hr().memoizedState;return[e,t]},useMutableSource:OT,useSyncExternalStore:_T,useId:KT,unstable_isNewReconciler:!1};function Zr(e,t){if(e&&e.defaultProps){t=Mt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function nx(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Mt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hm={isMounted:function(e){return(e=e._reactInternals)?No(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vn(),i=ts(e),a=Qi(r,i);a.payload=t,n!=null&&(a.callback=n),t=Ja(e,a,i),t!==null&&(ai(t,e,i,r),rh(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vn(),i=ts(e),a=Qi(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Ja(e,a,i),t!==null&&(ai(t,e,i,r),rh(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vn(),r=ts(e),i=Qi(n,r);i.tag=2,t!=null&&(i.callback=t),t=Ja(e,i,r),t!==null&&(ai(t,e,r,n),rh(t,e,r))}};function tj(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?!Pu(n,r)||!Pu(i,a):!0}function XT(e,t,n){var r=!1,i=os,a=t.contextType;return typeof a=="object"&&a!==null?a=Wr(a):(i=ir(t)?oo:Mn.current,r=t.contextTypes,a=(r=r!=null)?Cl(e,i):os),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=hm,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function nj(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&&hm.enqueueReplaceState(t,t.state,null)}function rx(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ab(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Wr(a):(a=ir(t)?oo:Mn.current,i.context=Cl(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(nx(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&&hm.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+=iF(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 o0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ix(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Oz=typeof WeakMap=="function"?WeakMap:Map;function ZT(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,px=r),ix(e,t)},n}function QT(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(){ix(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ix(e,t),typeof r!="function"&&(es===null?es=new Set([this]):es.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function rj(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Oz;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=Hz.bind(null,e,t,n),t.then(e,e))}function ij(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 aj(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,Ja(n,t,1))),n.lanes|=1),e)}var _z=ya.ReactCurrentOwner,er=!1;function Fn(e,t,n,r){t.child=e===null?PT(t,null,n,r):El(t,e.child,n,r)}function sj(e,t,n,r,i){n=n.render;var a=t.ref;return xl(t,i),r=Mb(e,t,n,r,a,i),n=Ib(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):(Et&&n&&Sb(t),t.flags|=1,Fn(e,t,r,i),t.child)}function oj(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!Hb(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,JT(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:Pu,n(s,r)&&e.ref===t.ref)return ca(e,t,i)}return t.flags|=1,e=ns(a,r),e.ref=t.ref,e.return=t,t.child=e}function JT(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Pu(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 ax(e,t,n,r,i)}function eO(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},yt(al,fr),fr|=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,yt(al,fr),fr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,yt(al,fr),fr|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,yt(al,fr),fr|=r;return Fn(e,t,i,n),t.child}function tO(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ax(e,t,n,r,i){var a=ir(n)?oo:Mn.current;return a=Cl(t,a),xl(t,i),n=Mb(e,t,n,r,a,i),r=Ib(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):(Et&&r&&Sb(t),t.flags|=1,Fn(e,t,n,i),t.child)}function lj(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),XT(t,n,r),rx(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=Wr(u):(u=ir(n)?oo:Mn.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)&&nj(t,s,r,u),Fa=!1;var h=t.memoizedState;s.state=h,$h(t,r,s,i),c=t.memoizedState,o!==r||h!==c||rr.current||Fa?(typeof d=="function"&&(nx(t,n,d,r),c=t.memoizedState),(o=Fa||tj(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,AT(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:Zr(t.type,o),s.props=u,f=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=Wr(c):(c=ir(n)?oo:Mn.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)&&nj(t,s,r,c),Fa=!1,h=t.memoizedState,s.state=h,$h(t,r,s,i);var g=t.memoizedState;o!==f||h!==g||rr.current||Fa?(typeof p=="function"&&(nx(t,n,p,r),g=t.memoizedState),(u=Fa||tj(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 sx(e,t,n,r,a,i)}function sx(e,t,n,r,i,a){tO(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Gk(t,n,!1),ca(e,t,a);r=t.stateNode,_z.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)):Fn(e,t,o,a),t.memoizedState=r.state,i&&Gk(t,n,!0),t.child}function nO(e){var t=e.stateNode;t.pendingContext?Kk(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Kk(e,t.context,!1),Tb(e,t.containerInfo)}function cj(e,t,n,r,i){return Pl(),jb(i),t.flags|=256,Fn(e,t,n,r),t.child}var ox={dehydrated:null,treeContext:null,retryLane:0};function lx(e){return{baseLanes:e,cachePool:null,transitions:null}}function rO(e,t,n){var r=t.pendingProps,i=Ot.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),yt(Ot,i&1),e===null)return ex(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=gm(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=lx(n),t.memoizedState=ox,e):Fb(t,s));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Dz(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=ns(i,c),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?a=ns(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?lx(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=ox,r}return a=e.child,e=a.sibling,r=ns(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 Fb(e,t){return t=gm({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function mf(e,t,n,r){return r!==null&&jb(r),El(t,e.child,null,n),e=Fb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dz(e,t,n,r,i,a,s){if(n)return t.flags&256?(t.flags&=-257,r=o0(Error(he(422))),mf(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=gm({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=lx(s),t.memoizedState=ox,a);if(!(t.mode&1))return mf(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(he(419)),r=o0(a,r,void 0),mf(e,t,s,r)}if(o=(s&e.childLanes)!==0,er||o){if(r=ln,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),ai(r,e,i,-1))}return Wb(),r=o0(Error(he(421))),mf(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Kz.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,mr=Qa(i.nextSibling),yr=t,Et=!0,ei=null,e!==null&&(Lr[Rr++]=qi,Lr[Rr++]=Yi,Lr[Rr++]=lo,qi=e.id,Yi=e.overflow,lo=t),t=Fb(t,r.children),t.flags|=4096,t)}function uj(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),tx(e.return,t,n)}function l0(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 iO(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Fn(e,t,r.children,n),r=Ot.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&&uj(e,n,t);else if(e.tag===19)uj(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(yt(Ot,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),l0(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}l0(t,!0,n,null,a);break;case"together":l0(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(he(153));if(t.child!==null){for(e=t.child,n=ns(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ns(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Mz(e,t,n){switch(t.tag){case 3:nO(t),Pl();break;case 5:TT(t);break;case 1:ir(t.type)&&Ih(t);break;case 4:Tb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;yt(Fh,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(yt(Ot,Ot.current&1),t.flags|=128,null):n&t.child.childLanes?rO(e,t,n):(yt(Ot,Ot.current&1),e=ca(e,t,n),e!==null?e.sibling:null);yt(Ot,Ot.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return iO(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),yt(Ot,Ot.current),r)break;return null;case 22:case 23:return t.lanes=0,eO(e,t,n)}return ca(e,t,n)}var aO,cx,sO,oO;aO=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}};cx=function(){};sO=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=Oy(e,i),r=Oy(e,r),a=[];break;case"select":i=Mt({},i,{value:void 0}),r=Mt({},r,{value:void 0}),a=[];break;case"textarea":i=My(e,i),r=My(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Dh)}Ly(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"&&(bu.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"&&(bu.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&bt("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)}};oO=function(e,t,n,r){n!==r&&(t.flags|=4)};function kc(e,t){if(!Et)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Cn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Iz(e,t,n){var r=t.pendingProps;switch(kb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cn(t),null;case 1:return ir(t.type)&&Mh(),Cn(t),null;case 3:return r=t.stateNode,Al(),kt(rr),kt(Mn),_b(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(hf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ei!==null&&(yx(ei),ei=null))),cx(e,t),Cn(t),null;case 5:Ob(t);var i=Hs(_u.current);if(n=t.type,e!==null&&t.stateNode!=null)sO(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(he(166));return Cn(t),null}if(e=Hs(Ei.current),hf(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[ji]=t,r[Tu]=a,e=(t.mode&1)!==0,n){case"dialog":bt("cancel",r),bt("close",r);break;case"iframe":case"object":case"embed":bt("load",r);break;case"video":case"audio":for(i=0;i<Yc.length;i++)bt(Yc[i],r);break;case"source":bt("error",r);break;case"img":case"image":case"link":bt("error",r),bt("load",r);break;case"details":bt("toggle",r);break;case"input":vk(r,a),bt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},bt("invalid",r);break;case"textarea":wk(r,a),bt("invalid",r)}Ly(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&&ff(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&ff(r.textContent,o,e),i=["children",""+o]):bu.hasOwnProperty(s)&&o!=null&&s==="onScroll"&&bt("scroll",r)}switch(n){case"input":rf(r),bk(r,a,!0);break;case"textarea":rf(r),Sk(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=IA(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[Tu]=r,aO(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ry(n,r),n){case"dialog":bt("cancel",e),bt("close",e),i=r;break;case"iframe":case"object":case"embed":bt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Yc.length;i++)bt(Yc[i],e);i=r;break;case"source":bt("error",e),i=r;break;case"img":case"image":case"link":bt("error",e),bt("load",e),i=r;break;case"details":bt("toggle",e),i=r;break;case"input":vk(e,r),i=Oy(e,r),bt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Mt({},r,{value:void 0}),bt("invalid",e);break;case"textarea":wk(e,r),i=My(e,r),bt("invalid",e);break;default:i=r}Ly(n,i),o=i;for(a in o)if(o.hasOwnProperty(a)){var c=o[a];a==="style"?FA(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&LA(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&wu(e,c):typeof c=="number"&&wu(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(bu.hasOwnProperty(a)?c!=null&&a==="onScroll"&&bt("scroll",e):c!=null&&lb(e,a,c,s))}switch(n){case"input":rf(e),bk(e,r,!1);break;case"textarea":rf(e),Sk(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ss(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 Cn(t),null;case 6:if(e&&t.stateNode!=null)oO(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(he(166));if(n=Hs(_u.current),Hs(Ei.current),hf(t)){if(r=t.stateNode,n=t.memoizedProps,r[ji]=t,(a=r.nodeValue!==n)&&(e=yr,e!==null))switch(e.tag){case 3:ff(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ff(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 Cn(t),null;case 13:if(kt(Ot),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Et&&mr!==null&&t.mode&1&&!(t.flags&128))NT(),Pl(),t.flags|=98560,a=!1;else if(a=hf(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(he(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(he(317));a[ji]=t}else Pl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cn(t),a=!1}else ei!==null&&(yx(ei),ei=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||Ot.current&1?tn===0&&(tn=3):Wb())),t.updateQueue!==null&&(t.flags|=4),Cn(t),null);case 4:return Al(),cx(e,t),e===null&&Eu(t.stateNode.containerInfo),Cn(t),null;case 10:return Pb(t.type._context),Cn(t),null;case 17:return ir(t.type)&&Mh(),Cn(t),null;case 19:if(kt(Ot),a=t.memoizedState,a===null)return Cn(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)kc(a,!1);else{if(tn!==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 yt(Ot,Ot.current&1|2),t.child}e=e.sibling}a.tail!==null&&Vt()>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&&!Et)return Cn(t),null}else 2*Vt()-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=Vt(),t.sibling=null,n=Ot.current,yt(Ot,r?n&1|2:n&1),t):(Cn(t),null);case 22:case 23:return Vb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fr&1073741824&&(Cn(t),t.subtreeFlags&6&&(t.flags|=8192)):Cn(t),null;case 24:return null;case 25:return null}throw Error(he(156,t.tag))}function Lz(e,t){switch(kb(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(),kt(rr),kt(Mn),_b(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ob(t),null;case 13:if(kt(Ot),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(he(340));Pl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(Ot),null;case 4:return Al(),null;case 10:return Pb(t.type._context),null;case 22:case 23:return Vb(),null;case 24:return null;default:return null}}var gf=!1,An=!1,Rz=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function il(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){zt(e,t,r)}else n.current=null}function ux(e,t,n){try{n()}catch(r){zt(e,t,r)}}var dj=!1;function Fz(e,t){if(Gy=Th,e=fT(),wb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var 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(qy={focusedElem:e,selectionRange:n},Th=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;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,b=g.memoizedState,x=t.stateNode,v=x.getSnapshotBeforeUpdate(t.elementType===t.type?y:Zr(t.type,y),b);x.__reactInternalSnapshotBeforeUpdate=v}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(he(163))}}catch(k){zt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return g=dj,dj=!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&&ux(t,n,a)}i=i.next}while(i!==r)}}function pm(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 dx(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 lO(e){var t=e.alternate;t!==null&&(e.alternate=null,lO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ji],delete t[Tu],delete t[Zy],delete t[bz],delete t[wz])),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 cO(e){return e.tag===5||e.tag===3||e.tag===4}function fj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cO(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 fx(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(fx(e,t,n),e=e.sibling;e!==null;)fx(e,t,n),e=e.sibling}function hx(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(hx(e,t,n),e=e.sibling;e!==null;)hx(e,t,n),e=e.sibling}var mn=null,Qr=!1;function Aa(e,t,n){for(n=n.child;n!==null;)uO(e,t,n),n=n.sibling}function uO(e,t,n){if(Pi&&typeof Pi.onCommitFiberUnmount=="function")try{Pi.onCommitFiberUnmount(sm,n)}catch{}switch(n.tag){case 5:An||il(n,t);case 6:var r=mn,i=Qr;mn=null,Aa(e,t,n),mn=r,Qr=i,mn!==null&&(Qr?(e=mn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):mn.removeChild(n.stateNode));break;case 18:mn!==null&&(Qr?(e=mn,n=n.stateNode,e.nodeType===8?t0(e.parentNode,n):e.nodeType===1&&t0(e,n),Nu(e)):t0(mn,n.stateNode));break;case 4:r=mn,i=Qr,mn=n.stateNode.containerInfo,Qr=!0,Aa(e,t,n),mn=r,Qr=i;break;case 0:case 11:case 14:case 15:if(!An&&(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)&&ux(n,t,s),i=i.next}while(i!==r)}Aa(e,t,n);break;case 1:if(!An&&(il(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){zt(n,t,o)}Aa(e,t,n);break;case 21:Aa(e,t,n);break;case 22:n.mode&1?(An=(r=An)||n.memoizedState!==null,Aa(e,t,n),An=r):Aa(e,t,n);break;default:Aa(e,t,n)}}function hj(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Rz),t.forEach(function(r){var i=Gz.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Yr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 5:mn=o.stateNode,Qr=!1;break e;case 3:mn=o.stateNode.containerInfo,Qr=!0;break e;case 4:mn=o.stateNode.containerInfo,Qr=!0;break e}o=o.return}if(mn===null)throw Error(he(160));uO(a,s,i),mn=null,Qr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){zt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)dO(t,e),t=t.sibling}function dO(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Yr(t,e),gi(e),r&4){try{cu(3,e,e.return),pm(3,e)}catch(y){zt(e,e.return,y)}try{cu(5,e,e.return)}catch(y){zt(e,e.return,y)}}break;case 1:Yr(t,e),gi(e),r&512&&n!==null&&il(n,n.return);break;case 5:if(Yr(t,e),gi(e),r&512&&n!==null&&il(n,n.return),e.flags&32){var i=e.stateNode;try{wu(i,"")}catch(y){zt(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&&DA(i,a),Ry(o,s);var u=Ry(o,a);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?FA(i,f):d==="dangerouslySetInnerHTML"?LA(i,f):d==="children"?wu(i,f):lb(i,d,f,u)}switch(o){case"input":_y(i,a);break;case"textarea":MA(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[Tu]=a}catch(y){zt(e,e.return,y)}}break;case 6:if(Yr(t,e),gi(e),r&4){if(e.stateNode===null)throw Error(he(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){zt(e,e.return,y)}}break;case 3:if(Yr(t,e),gi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Nu(t.containerInfo)}catch(y){zt(e,e.return,y)}break;case 4:Yr(t,e),gi(e);break;case 13:Yr(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||(Bb=Vt())),r&4&&hj(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(An=(u=An)||d,Yr(t,e),An=u):Yr(t,e),gi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Ne=e,d=e.child;d!==null;){for(f=Ne=d;Ne!==null;){switch(h=Ne,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){zt(r,n,y)}}break;case 5:il(h,h.return);break;case 22:if(h.memoizedState!==null){mj(f);continue}}p!==null?(p.return=h,Ne=p):mj(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=RA("display",s))}catch(y){zt(e,e.return,y)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(y){zt(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:Yr(t,e),gi(e),r&4&&hj(e);break;case 21:break;default:Yr(t,e),gi(e)}}function gi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(cO(n)){var r=n;break e}n=n.return}throw Error(he(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(wu(i,""),r.flags&=-33);var a=fj(e);hx(e,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,o=fj(e);fx(e,o,s);break;default:throw Error(he(161))}}catch(c){zt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zz(e,t,n){Ne=e,fO(e)}function fO(e,t,n){for(var r=(e.mode&1)!==0;Ne!==null;){var i=Ne,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||gf;if(!s){var o=i.alternate,c=o!==null&&o.memoizedState!==null||An;o=gf;var u=An;if(gf=s,(An=c)&&!u)for(Ne=i;Ne!==null;)s=Ne,c=s.child,s.tag===22&&s.memoizedState!==null?gj(i):c!==null?(c.return=s,Ne=c):gj(i);for(;a!==null;)Ne=a,fO(a),a=a.sibling;Ne=i,gf=o,An=u}pj(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Ne=a):pj(e)}}function pj(e){for(;Ne!==null;){var t=Ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:An||pm(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!An)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Zr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Qk(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}Qk(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&&Nu(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(he(163))}An||t.flags&512&&dx(t)}catch(h){zt(t,t.return,h)}}if(t===e){Ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function mj(e){for(;Ne!==null;){var t=Ne;if(t===e){Ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function gj(e){for(;Ne!==null;){var t=Ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pm(4,t)}catch(c){zt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){zt(t,i,c)}}var a=t.return;try{dx(t)}catch(c){zt(t,a,c)}break;case 5:var s=t.return;try{dx(t)}catch(c){zt(t,s,c)}}}catch(c){zt(t,t.return,c)}if(t===e){Ne=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Ne=o;break}Ne=t.return}}var $z=Math.ceil,Wh=ya.ReactCurrentDispatcher,zb=ya.ReactCurrentOwner,Vr=ya.ReactCurrentBatchConfig,Je=0,ln=null,qt=null,bn=0,fr=0,al=ps(0),tn=0,Lu=null,uo=0,mm=0,$b=0,uu=null,Jn=null,Bb=0,Ol=1/0,Wi=null,Hh=!1,px=null,es=null,yf=!1,Ha=null,Kh=0,du=0,mx=null,oh=-1,lh=0;function Vn(){return Je&6?Vt():oh!==-1?oh:oh=Vt()}function ts(e){return e.mode&1?Je&2&&bn!==0?bn&-bn:kz.transition!==null?(lh===0&&(lh=XA()),lh):(e=st,e!==0||(e=window.event,e=e===void 0?16:rT(e.type)),e):1}function ai(e,t,n,r){if(50<du)throw du=0,mx=null,Error(he(185));md(e,n,r),(!(Je&2)||e!==ln)&&(e===ln&&(!(Je&2)&&(mm|=n),tn===4&&Ua(e,bn)),ar(e,r),n===1&&Je===0&&!(t.mode&1)&&(Ol=Vt()+500,dm&&ms()))}function ar(e,t){var n=e.callbackNode;kF(e,t);var r=Ah(e,e===ln?bn:0);if(r===0)n!==null&&Nk(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Nk(n),t===1)e.tag===0?Sz(yj.bind(null,e)):ST(yj.bind(null,e)),xz(function(){!(Je&6)&&ms()}),n=null;else{switch(ZA(r)){case 1:n=hb;break;case 4:n=qA;break;case 16:n=Eh;break;case 536870912:n=YA;break;default:n=Eh}n=bO(n,hO.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function hO(e,t){if(oh=-1,lh=0,Je&6)throw Error(he(327));var n=e.callbackNode;if(vl()&&e.callbackNode!==n)return null;var r=Ah(e,e===ln?bn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Gh(e,r);else{t=r;var i=Je;Je|=2;var a=mO();(ln!==e||bn!==t)&&(Wi=null,Ol=Vt()+500,Js(e,t));do try{Vz();break}catch(o){pO(e,o)}while(!0);Cb(),Wh.current=a,Je=i,qt!==null?t=0:(ln=null,bn=0,t=tn)}if(t!==0){if(t===2&&(i=Uy(e),i!==0&&(r=i,t=gx(e,i))),t===1)throw n=Lu,Js(e,0),Ua(e,r),ar(e,Vt()),n;if(t===6)Ua(e,r);else{if(i=e.current.alternate,!(r&30)&&!Bz(i)&&(t=Gh(e,r),t===2&&(a=Uy(e),a!==0&&(r=a,t=gx(e,a))),t===1))throw n=Lu,Js(e,0),Ua(e,r),ar(e,Vt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(he(345));case 2:Ms(e,Jn,Wi);break;case 3:if(Ua(e,r),(r&130023424)===r&&(t=Bb+500-Vt(),10<t)){if(Ah(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Vn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Xy(Ms.bind(null,e,Jn,Wi),t);break}Ms(e,Jn,Wi);break;case 4:if(Ua(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ii(r);a=1<<s,s=t[s],s>i&&(i=s),r&=~a}if(r=i,r=Vt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$z(r/1960))-r,10<r){e.timeoutHandle=Xy(Ms.bind(null,e,Jn,Wi),r);break}Ms(e,Jn,Wi);break;case 5:Ms(e,Jn,Wi);break;default:throw Error(he(329))}}}return ar(e,Vt()),e.callbackNode===n?hO.bind(null,e):null}function gx(e,t){var n=uu;return e.current.memoizedState.isDehydrated&&(Js(e,t).flags|=256),e=Gh(e,t),e!==2&&(t=Jn,Jn=n,t!==null&&yx(t)),e}function yx(e){Jn===null?Jn=e:Jn.push.apply(Jn,e)}function Bz(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(!ci(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 Ua(e,t){for(t&=~$b,t&=~mm,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ii(t),r=1<<n;e[n]=-1,t&=~r}}function yj(e){if(Je&6)throw Error(he(327));vl();var t=Ah(e,0);if(!(t&1))return ar(e,Vt()),null;var n=Gh(e,t);if(e.tag!==0&&n===2){var r=Uy(e);r!==0&&(t=r,n=gx(e,r))}if(n===1)throw n=Lu,Js(e,0),Ua(e,t),ar(e,Vt()),n;if(n===6)throw Error(he(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ms(e,Jn,Wi),ar(e,Vt()),null}function Ub(e,t){var n=Je;Je|=1;try{return e(t)}finally{Je=n,Je===0&&(Ol=Vt()+500,dm&&ms())}}function fo(e){Ha!==null&&Ha.tag===0&&!(Je&6)&&vl();var t=Je;Je|=1;var n=Vr.transition,r=st;try{if(Vr.transition=null,st=1,e)return e()}finally{st=r,Vr.transition=n,Je=t,!(Je&6)&&ms()}}function Vb(){fr=al.current,kt(al)}function Js(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,yz(n)),qt!==null)for(n=qt.return;n!==null;){var r=n;switch(kb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Mh();break;case 3:Al(),kt(rr),kt(Mn),_b();break;case 5:Ob(r);break;case 4:Al();break;case 13:kt(Ot);break;case 19:kt(Ot);break;case 10:Pb(r.type._context);break;case 22:case 23:Vb()}n=n.return}if(ln=e,qt=e=ns(e.current,null),bn=fr=t,tn=0,Lu=null,$b=mm=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 pO(e,t){do{var n=qt;try{if(Cb(),ih.current=Vh,Uh){for(var r=Dt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Uh=!1}if(co=0,on=Jt=Dt=null,lu=!1,Du=0,zb.current=null,n===null||n.return===null){tn=1,Lu=t,qt=null;break}e:{var a=e,s=n.return,o=n,c=t;if(t=bn,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=ij(s);if(p!==null){p.flags&=-257,aj(p,s,o,a,t),p.mode&1&&rj(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)){rj(a,u,t),Wb();break e}c=Error(he(426))}}else if(Et&&o.mode&1){var b=ij(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),aj(b,s,o,a,t),jb(Tl(c,o));break e}}a=c=Tl(c,o),tn!==4&&(tn=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 x=ZT(a,c,t);Zk(a,x);break e;case 1:o=c;var v=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(es===null||!es.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var k=QT(a,o,t);Zk(a,k);break e}}a=a.return}while(a!==null)}yO(n)}catch(S){t=S,qt===n&&n!==null&&(qt=n=n.return);continue}break}while(!0)}function mO(){var e=Wh.current;return Wh.current=Vh,e===null?Vh:e}function Wb(){(tn===0||tn===3||tn===2)&&(tn=4),ln===null||!(uo&268435455)&&!(mm&268435455)||Ua(ln,bn)}function Gh(e,t){var n=Je;Je|=2;var r=mO();(ln!==e||bn!==t)&&(Wi=null,Js(e,t));do try{Uz();break}catch(i){pO(e,i)}while(!0);if(Cb(),Je=n,Wh.current=r,qt!==null)throw Error(he(261));return ln=null,bn=0,tn}function Uz(){for(;qt!==null;)gO(qt)}function Vz(){for(;qt!==null&&!pF();)gO(qt)}function gO(e){var t=vO(e.alternate,e,fr);e.memoizedProps=e.pendingProps,t===null?yO(e):qt=t,zb.current=null}function yO(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Lz(n,t),n!==null){n.flags&=32767,qt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{tn=6,qt=null;return}}else if(n=Iz(n,t,fr),n!==null){qt=n;return}if(t=t.sibling,t!==null){qt=t;return}qt=t=e}while(t!==null);tn===0&&(tn=5)}function Ms(e,t,n){var r=st,i=Vr.transition;try{Vr.transition=null,st=1,Wz(e,t,n,r)}finally{Vr.transition=i,st=r}return null}function Wz(e,t,n,r){do vl();while(Ha!==null);if(Je&6)throw Error(he(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(he(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(jF(e,a),e===ln&&(qt=ln=null,bn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||yf||(yf=!0,bO(Eh,function(){return vl(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Vr.transition,Vr.transition=null;var s=st;st=1;var o=Je;Je|=4,zb.current=null,Fz(e,n),dO(n,e),uz(qy),Th=!!Gy,qy=Gy=null,e.current=n,zz(n),mF(),Je=o,st=s,Vr.transition=a}else e.current=n;if(yf&&(yf=!1,Ha=e,Kh=i),a=e.pendingLanes,a===0&&(es=null),xF(n.stateNode),ar(e,Vt()),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=px,px=null,e;return Kh&1&&e.tag!==0&&vl(),a=e.pendingLanes,a&1?e===mx?du++:(du=0,mx=e):du=0,ms(),null}function vl(){if(Ha!==null){var e=ZA(Kh),t=Vr.transition,n=st;try{if(Vr.transition=null,st=16>e?16:e,Ha===null)var r=!1;else{if(e=Ha,Ha=null,Kh=0,Je&6)throw Error(he(331));var i=Je;for(Je|=4,Ne=e.current;Ne!==null;){var a=Ne,s=a.child;if(Ne.flags&16){var o=a.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(Ne=u;Ne!==null;){var d=Ne;switch(d.tag){case 0:case 11:case 15:cu(8,d,a)}var f=d.child;if(f!==null)f.return=d,Ne=f;else for(;Ne!==null;){d=Ne;var h=d.sibling,p=d.return;if(lO(d),d===u){Ne=null;break}if(h!==null){h.return=p,Ne=h;break}Ne=p}}}var g=a.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var b=y.sibling;y.sibling=null,y=b}while(y!==null)}}Ne=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,Ne=s;else e:for(;Ne!==null;){if(a=Ne,a.flags&2048)switch(a.tag){case 0:case 11:case 15:cu(9,a,a.return)}var x=a.sibling;if(x!==null){x.return=a.return,Ne=x;break e}Ne=a.return}}var v=e.current;for(Ne=v;Ne!==null;){s=Ne;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,Ne=w;else e:for(s=v;Ne!==null;){if(o=Ne,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:pm(9,o)}}catch(S){zt(o,o.return,S)}if(o===s){Ne=null;break e}var k=o.sibling;if(k!==null){k.return=o.return,Ne=k;break e}Ne=o.return}}if(Je=i,ms(),Pi&&typeof Pi.onPostCommitFiberRoot=="function")try{Pi.onPostCommitFiberRoot(sm,e)}catch{}r=!0}return r}finally{st=n,Vr.transition=t}}return!1}function xj(e,t,n){t=Tl(n,t),t=ZT(e,t,1),e=Ja(e,t,1),t=Vn(),e!==null&&(md(e,1,t),ar(e,t))}function zt(e,t,n){if(e.tag===3)xj(e,e,n);else for(;t!==null;){if(t.tag===3){xj(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(es===null||!es.has(r))){e=Tl(n,e),e=QT(t,e,1),t=Ja(t,e,1),e=Vn(),t!==null&&(md(t,1,e),ar(t,e));break}}t=t.return}}function Hz(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Vn(),e.pingedLanes|=e.suspendedLanes&n,ln===e&&(bn&n)===n&&(tn===4||tn===3&&(bn&130023424)===bn&&500>Vt()-Bb?Js(e,0):$b|=n),ar(e,t)}function xO(e,t){t===0&&(e.mode&1?(t=of,of<<=1,!(of&130023424)&&(of=4194304)):t=1);var n=Vn();e=la(e,t),e!==null&&(md(e,t,n),ar(e,n))}function Kz(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xO(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(he(314))}r!==null&&r.delete(t),xO(e,n)}var vO;vO=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,Mz(e,t,n);er=!!(e.flags&131072)}else er=!1,Et&&t.flags&1048576&&kT(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,Mn.current);xl(t,n),i=Mb(null,t,r,e,i,n);var a=Ib();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,Ab(t),i.updater=hm,t.stateNode=i,i._reactInternals=t,rx(t,r,e,n),t=sx(null,t,r,!0,a,n)):(t.tag=0,Et&&a&&Sb(t),Fn(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=Yz(r),e=Zr(r,e),i){case 0:t=ax(null,t,r,e,n);break e;case 1:t=lj(null,t,r,e,n);break e;case 11:t=sj(null,t,r,e,n);break e;case 14:t=oj(null,t,r,Zr(r.type,e),n);break e}throw Error(he(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zr(r,i),ax(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zr(r,i),lj(e,t,r,i,n);case 3:e:{if(nO(t),e===null)throw Error(he(387));r=t.pendingProps,a=t.memoizedState,i=a.element,AT(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(he(423)),t),t=cj(e,t,r,n,i);break e}else if(r!==i){i=Tl(Error(he(424)),t),t=cj(e,t,r,n,i);break e}else for(mr=Qa(t.stateNode.containerInfo.firstChild),yr=t,Et=!0,ei=null,n=PT(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}Fn(e,t,r,n)}t=t.child}return t;case 5:return TT(t),e===null&&ex(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,Yy(r,i)?s=null:a!==null&&Yy(r,a)&&(t.flags|=32),tO(e,t),Fn(e,t,s,n),t.child;case 6:return e===null&&ex(t),null;case 13:return rO(e,t,n);case 4:return Tb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=El(t,null,r,n):Fn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zr(r,i),sj(e,t,r,i,n);case 7:return Fn(e,t,t.pendingProps,n),t.child;case 8:return Fn(e,t,t.pendingProps.children,n),t.child;case 12:return Fn(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,yt(Fh,r._currentValue),r._currentValue=s,a!==null)if(ci(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),tx(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(he(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),tx(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}Fn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,xl(t,n),i=Wr(i),r=r(i),t.flags|=1,Fn(e,t,r,n),t.child;case 14:return r=t.type,i=Zr(r,t.pendingProps),i=Zr(r.type,i),oj(e,t,r,i,n);case 15:return JT(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zr(r,i),sh(e,t),t.tag=1,ir(r)?(e=!0,Ih(t)):e=!1,xl(t,n),XT(t,r,i),rx(t,r,i,n),sx(null,t,r,!0,e,n);case 19:return iO(e,t,n);case 22:return eO(e,t,n)}throw Error(he(156,t.tag))};function bO(e,t){return GA(e,t)}function qz(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 zr(e,t,n,r){return new qz(e,t,n,r)}function Hb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yz(e){if(typeof e=="function")return Hb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ub)return 11;if(e===db)return 14}return 2}function ns(e,t){var n=e.alternate;return n===null?(n=zr(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")Hb(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Yo:return eo(n.children,i,a,t);case cb:s=8,i|=8;break;case Py:return e=zr(12,n,t,i|2),e.elementType=Py,e.lanes=a,e;case Ey:return e=zr(13,n,t,i),e.elementType=Ey,e.lanes=a,e;case Ay:return e=zr(19,n,t,i),e.elementType=Ay,e.lanes=a,e;case TA:return gm(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case EA:s=10;break e;case AA:s=9;break e;case ub:s=11;break e;case db:s=14;break e;case Ra:s=16,r=null;break e}throw Error(he(130,e==null?e:typeof e,""))}return t=zr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function eo(e,t,n,r){return e=zr(7,e,r,t),e.lanes=n,e}function gm(e,t,n,r){return e=zr(22,e,r,t),e.elementType=TA,e.lanes=n,e.stateNode={isHidden:!1},e}function c0(e,t,n){return e=zr(6,e,null,t),e.lanes=n,e}function u0(e,t,n){return t=zr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xz(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=Wg(0),this.expirationTimes=Wg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wg(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Kb(e,t,n,r,i,a,s,o,c){return e=new Xz(e,t,n,o,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=zr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ab(a),e}function Zz(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function wO(e){if(!e)return os;e=e._reactInternals;e:{if(No(e)!==e||e.tag!==1)throw Error(he(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(he(171))}if(e.tag===1){var n=e.type;if(ir(n))return wT(e,n,t)}return t}function SO(e,t,n,r,i,a,s,o,c){return e=Kb(n,r,!0,e,i,a,s,o,c),e.context=wO(null),n=e.current,r=Vn(),i=ts(n),a=Qi(r,i),a.callback=t??null,Ja(n,a,i),e.current.lanes=i,md(e,i,r),ar(e,r),e}function ym(e,t,n,r){var i=t.current,a=Vn(),s=ts(i);return n=wO(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=Ja(i,t,s),e!==null&&(ai(e,i,s,a),rh(e,i,s)),s}function qh(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 vj(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gb(e,t){vj(e,t),(e=e.alternate)&&vj(e,t)}function Qz(){return null}var kO=typeof reportError=="function"?reportError:function(e){console.error(e)};function qb(e){this._internalRoot=e}xm.prototype.render=qb.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(he(409));ym(e,t,null,null)};xm.prototype.unmount=qb.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fo(function(){ym(null,e,null,null)}),t[oa]=null}};function xm(e){this._internalRoot=e}xm.prototype.unstable_scheduleHydration=function(e){if(e){var t=eT();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ba.length&&t!==0&&t<Ba[n].priority;n++);Ba.splice(n,0,e),n===0&&nT(e)}};function Yb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function bj(){}function Jz(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=qh(s);a.call(u)}}var s=SO(t,r,e,0,null,!1,!1,"",bj);return e._reactRootContainer=s,e[oa]=s.current,Eu(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=qh(c);o.call(u)}}var c=Kb(e,0,!1,null,null,!1,!1,"",bj);return e._reactRootContainer=c,e[oa]=c.current,Eu(e.nodeType===8?e.parentNode:e),fo(function(){ym(t,c,n,r)}),c}function bm(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=qh(s);o.call(c)}}ym(t,s,e,i)}else s=Jz(n,t,e,i,r);return qh(s)}QA=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=qc(t.pendingLanes);n!==0&&(pb(t,n|1),ar(t,Vt()),!(Je&6)&&(Ol=Vt()+500,ms()))}break;case 13:fo(function(){var r=la(e,1);if(r!==null){var i=Vn();ai(r,e,1,i)}}),Gb(e,1)}};mb=function(e){if(e.tag===13){var t=la(e,134217728);if(t!==null){var n=Vn();ai(t,e,134217728,n)}Gb(e,134217728)}};JA=function(e){if(e.tag===13){var t=ts(e),n=la(e,t);if(n!==null){var r=Vn();ai(n,e,t,r)}Gb(e,t)}};eT=function(){return st};tT=function(e,t){var n=st;try{return st=e,t()}finally{st=n}};zy=function(e,t,n){switch(t){case"input":if(_y(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=um(r);if(!i)throw Error(he(90));_A(r),_y(r,i)}}}break;case"textarea":MA(e,n);break;case"select":t=n.value,t!=null&&pl(e,!!n.multiple,t,!1)}};BA=Ub;UA=fo;var e$={usingClientEntryPoint:!1,Events:[yd,Jo,um,zA,$A,Ub]},jc={findFiberByHostInstance:Vs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t$={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=HA(e),e===null?null:e.stateNode},findFiberByHostInstance:jc.findFiberByHostInstance||Qz,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 xf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xf.isDisabled&&xf.supportsFiber)try{sm=xf.inject(t$),Pi=xf}catch{}}Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e$;Pr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yb(t))throw Error(he(200));return Zz(e,t,null,n)};Pr.createRoot=function(e,t){if(!Yb(e))throw Error(he(299));var n=!1,r="",i=kO;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Kb(e,1,!1,null,null,n,!1,r,i),e[oa]=t.current,Eu(e.nodeType===8?e.parentNode:e),new qb(t)};Pr.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(he(188)):(e=Object.keys(e).join(","),Error(he(268,e)));return e=HA(t),e=e===null?null:e.stateNode,e};Pr.flushSync=function(e){return fo(e)};Pr.hydrate=function(e,t,n){if(!vm(t))throw Error(he(200));return bm(null,e,t,!0,n)};Pr.hydrateRoot=function(e,t,n){if(!Yb(e))throw Error(he(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=kO;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=SO(t,null,e,1,n??null,i,!1,a,s),e[oa]=t.current,Eu(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 xm(t)};Pr.render=function(e,t,n){if(!vm(t))throw Error(he(200));return bm(null,e,t,!1,n)};Pr.unmountComponentAtNode=function(e){if(!vm(e))throw Error(he(40));return e._reactRootContainer?(fo(function(){bm(null,null,e,!1,function(){e._reactRootContainer=null,e[oa]=null})}),!0):!1};Pr.unstable_batchedUpdates=Ub;Pr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vm(n))throw Error(he(200));if(e==null||e._reactInternals===void 0)throw Error(he(38));return bm(e,t,n,!1,r)};Pr.version="18.3.1-next-f1338f8080-20240426";function jO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jO)}catch(e){console.error(e)}}jO(),jA.exports=Pr;var Co=jA.exports;const n$=hi(Co),r$=dA({__proto__:null,default:n$},[Co]);var wj=Co;Ny.createRoot=wj.createRoot,Ny.hydrateRoot=wj.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 Pt(){return Pt=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},Pt.apply(this,arguments)}var Gt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Gt||(Gt={}));const Sj="popstate";function i$(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:s,hash:o}=r.location;return Ru("",{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 s$(t,n,null,e)}function Ve(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 a$(){return Math.random().toString(36).substr(2,8)}function kj(e,t){return{usr:e.state,key:e.key,idx:t}}function Ru(e,t,n,r){return n===void 0&&(n=null),Pt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?gs(t):t,{state:n,key:t&&t.key||r||a$()})}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 gs(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 s$(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,o=Gt.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(Pt({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){o=Gt.Pop;let b=d(),x=b==null?null:b-u;u=b,c&&c({action:o,location:y.location,delta:x})}function h(b,x){o=Gt.Push;let v=Ru(y.location,b,x);u=d()+1;let w=kj(v,u),k=y.createHref(v);try{s.pushState(w,"",k)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(k)}a&&c&&c({action:o,location:y.location,delta:1})}function p(b,x){o=Gt.Replace;let v=Ru(y.location,b,x);u=d();let w=kj(v,u),k=y.createHref(v);s.replaceState(w,"",k),a&&c&&c({action:o,location:y.location,delta:0})}function g(b){let x=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof b=="string"?b:po(b);return v=v.replace(/ $/,"%20"),Ve(x,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,x)}let y={get action(){return o},get location(){return e(i,s)},listen(b){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Sj,f),c=b,()=>{i.removeEventListener(Sj,f),c=null}},createHref(b){return t(i,b)},createURL:g,encodeLocation(b){let x=g(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:p,go(b){return s.go(b)}};return y}var at;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(at||(at={}));const o$=new Set(["lazy","caseSensitive","path","id","index","children"]);function l$(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(Ve(i.index!==!0||!i.children,"Cannot specify children on an index route"),Ve(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),l$(i)){let c=Pt({},i,t(i),{id:o});return r[o]=c,c}else{let c=Pt({},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"?gs(t):t,a=ui(i.pathname||"/",n);if(a==null)return null;let s=NO(e);u$(s);let o=null;for(let c=0;o==null&&c<s.length;++c){let u=w$(a);o=v$(s[c],u,r)}return o}function c$(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 NO(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("/")&&(Ve(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&&(Ve(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),NO(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:y$(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 CO(a.path))i(a,s,c)}),t}function CO(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=CO(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 u$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:x$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const d$=/^:[\w-]+$/,f$=3,h$=2,p$=1,m$=10,g$=-2,jj=e=>e==="*";function y$(e,t){let n=e.split("/"),r=n.length;return n.some(jj)&&(r+=g$),t&&(r+=h$),n.filter(i=>!jj(i)).reduce((i,a)=>i+(d$.test(a)?f$:a===""?p$:m$),r)}function x$(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 v$(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:N$(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]=b$(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 b$(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 w$(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 ui(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 S$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,k$=e=>S$.test(e);function j$(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?gs(e):e,a;if(n)if(k$(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=Nj(n.substring(1),"/"):a=Nj(n,t)}else a=t;return{pathname:a,search:C$(r),hash:P$(i)}}function Nj(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 d0(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 PO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wm(e,t){let n=PO(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Sm(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=gs(e):(i=Pt({},e),Ve(!i.pathname||!i.pathname.includes("?"),d0("?","pathname","search",i)),Ve(!i.pathname||!i.pathname.includes("#"),d0("#","pathname","hash",i)),Ve(!i.search||!i.search.includes("#"),d0("#","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=j$(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,"/"),N$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),C$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,P$=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 Fu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const EO=["post","put","patch","delete"],E$=new Set(EO),A$=["get",...EO],T$=new Set(A$),O$=new Set([301,302,303,307,308]),_$=new Set([307,308]),f0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},D$={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},Xb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,M$=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),AO="remix-router-transitions";function I$(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;Ve(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 F=e.detectErrorBoundary;i=V=>({hasErrorBoundary:F(V)})}else i=M$;let a={},s=Yh(e.routes,i,void 0,a),o,c=e.basename||"/",u=e.dataStrategy||z$,d=e.patchRoutesOnNavigation,f=Pt({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,b=null,x=e.hydrationData!=null,v=$s(s,e.history.location,c),w=!1,k=null;if(v==null&&!d){let F=Qn(404,{pathname:e.history.location.pathname}),{matches:V,route:Y}=Lj(s);v=V,k={[Y.id]:F}}v&&!e.hydrationData&&qr(v,s,e.history.location.pathname).active&&(v=null);let S;if(v)if(v.some(F=>F.route.lazy))S=!1;else if(!v.some(F=>F.route.loader))S=!0;else if(f.v7_partialHydration){let F=e.hydrationData?e.hydrationData.loaderData:null,V=e.hydrationData?e.hydrationData.errors:null;if(V){let Y=v.findIndex(ue=>V[ue.route.id]!==void 0);S=v.slice(0,Y+1).every(ue=>!vx(ue.route,F,V))}else S=v.every(Y=>!vx(Y.route,F,V))}else S=e.hydrationData!=null;else if(S=!1,v=[],f.v7_partialHydration){let F=qr(null,s,e.history.location.pathname);F.active&&F.matches&&(w=!0,v=F.matches)}let j,N={historyAction:e.history.action,location:e.history.location,matches:v,initialized:S,navigation:f0,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||k,fetchers:new Map,blockers:new Map},P=Gt.Pop,T=!1,E,_=!1,C=new Map,A=null,I=!1,$=!1,oe=[],Z=new Set,M=new Map,K=0,O=-1,ie=new Map,J=new Set,D=new Map,H=new Map,ee=new Set,be=new Map,ne=new Map,ye;function Q(){if(h=e.history.listen(F=>{let{action:V,location:Y,delta:ue}=F;if(ye){ye(),ye=void 0;return}ho(ne.size===0||ue!=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 B=Me({currentLocation:N.location,nextLocation:Y,historyAction:V});if(B&&ue!=null){let G=new Promise(se=>{ye=se});e.history.go(ue*-1),le(B,{state:"blocked",location:Y,proceed(){le(B,{state:"proceeding",proceed:void 0,reset:void 0,location:Y}),G.then(()=>e.history.go(ue))},reset(){let se=new Map(N.blockers);se.set(B,Ho),L({blockers:se})}});return}return ae(V,Y)}),n){J$(t,C);let F=()=>e7(t,C);t.addEventListener("pagehide",F),A=()=>t.removeEventListener("pagehide",F)}return N.initialized||ae(Gt.Pop,N.location,{initialHydration:!0}),j}function re(){h&&h(),A&&A(),p.clear(),E&&E.abort(),N.fetchers.forEach((F,V)=>me(V)),N.blockers.forEach((F,V)=>Ct(V))}function ve(F){return p.add(F),()=>p.delete(F)}function L(F,V){V===void 0&&(V={}),N=Pt({},N,F);let Y=[],ue=[];f.v7_fetcherPersist&&N.fetchers.forEach((B,G)=>{B.state==="idle"&&(ee.has(G)?ue.push(G):Y.push(G))}),ee.forEach(B=>{!N.fetchers.has(B)&&!M.has(B)&&ue.push(B)}),[...p].forEach(B=>B(N,{deletedFetchers:ue,viewTransitionOpts:V.viewTransitionOpts,flushSync:V.flushSync===!0})),f.v7_fetcherPersist?(Y.forEach(B=>N.fetchers.delete(B)),ue.forEach(B=>me(B))):ue.forEach(B=>ee.delete(B))}function W(F,V,Y){var ue,B;let{flushSync:G}=Y===void 0?{}:Y,se=N.actionData!=null&&N.navigation.formMethod!=null&&Jr(N.navigation.formMethod)&&N.navigation.state==="loading"&&((ue=F.state)==null?void 0:ue._isRedirect)!==!0,xe;V.actionData?Object.keys(V.actionData).length>0?xe=V.actionData:xe=null:se?xe=N.actionData:xe=null;let we=V.loaderData?Mj(N.loaderData,V.loaderData,V.matches||[],V.errors):N.loaderData,ke=N.blockers;ke.size>0&&(ke=new Map(ke),ke.forEach((Se,Pe)=>ke.set(Pe,Ho)));let je=T===!0||N.navigation.formMethod!=null&&Jr(N.navigation.formMethod)&&((B=F.state)==null?void 0:B._isRedirect)!==!0;o&&(s=o,o=void 0),I||P===Gt.Pop||(P===Gt.Push?e.history.push(F,F.state):P===Gt.Replace&&e.history.replace(F,F.state));let ce;if(P===Gt.Pop){let Se=C.get(N.location.pathname);Se&&Se.has(F.pathname)?ce={currentLocation:N.location,nextLocation:F}:C.has(F.pathname)&&(ce={currentLocation:F,nextLocation:N.location})}else if(_){let Se=C.get(N.location.pathname);Se?Se.add(F.pathname):(Se=new Set([F.pathname]),C.set(N.location.pathname,Se)),ce={currentLocation:N.location,nextLocation:F}}L(Pt({},V,{actionData:xe,loaderData:we,historyAction:P,location:F,initialized:!0,navigation:f0,revalidation:"idle",restoreScrollPosition:ks(F,V.matches||N.matches),preventScrollReset:je,blockers:ke}),{viewTransitionOpts:ce,flushSync:G===!0}),P=Gt.Pop,T=!1,_=!1,I=!1,$=!1,oe=[]}async function z(F,V){if(typeof F=="number"){e.history.go(F);return}let Y=xx(N.location,N.matches,c,f.v7_prependBasename,F,f.v7_relativeSplatPath,V==null?void 0:V.fromRouteId,V==null?void 0:V.relative),{path:ue,submission:B,error:G}=Cj(f.v7_normalizeFormMethod,!1,Y,V),se=N.location,xe=Ru(N.location,ue,V&&V.state);xe=Pt({},xe,e.history.encodeLocation(xe));let we=V&&V.replace!=null?V.replace:void 0,ke=Gt.Push;we===!0?ke=Gt.Replace:we===!1||B!=null&&Jr(B.formMethod)&&B.formAction===N.location.pathname+N.location.search&&(ke=Gt.Replace);let je=V&&"preventScrollReset"in V?V.preventScrollReset===!0:void 0,ce=(V&&V.flushSync)===!0,Se=Me({currentLocation:se,nextLocation:xe,historyAction:ke});if(Se){le(Se,{state:"blocked",location:xe,proceed(){le(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:xe}),z(F,V)},reset(){let Pe=new Map(N.blockers);Pe.set(Se,Ho),L({blockers:Pe})}});return}return await ae(ke,xe,{submission:B,pendingError:G,preventScrollReset:je,replace:V&&V.replace,enableViewTransition:V&&V.viewTransition,flushSync:ce})}function te(){if(de(),L({revalidation:"loading"}),N.navigation.state!=="submitting"){if(N.navigation.state==="idle"){ae(N.historyAction,N.location,{startUninterruptedRevalidation:!0});return}ae(P||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:_===!0})}}async function ae(F,V,Y){E&&E.abort(),E=null,P=F,I=(Y&&Y.startUninterruptedRevalidation)===!0,mc(N.location,N.matches),T=(Y&&Y.preventScrollReset)===!0,_=(Y&&Y.enableViewTransition)===!0;let ue=o||s,B=Y&&Y.overrideNavigation,G=Y!=null&&Y.initialHydration&&N.matches&&N.matches.length>0&&!w?N.matches:$s(ue,V,c),se=(Y&&Y.flushSync)===!0;if(G&&N.initialized&&!$&&H$(N.location,V)&&!(Y&&Y.submission&&Jr(Y.submission.formMethod))){W(V,{matches:G},{flushSync:se});return}let xe=qr(G,ue,V.pathname);if(xe.active&&xe.matches&&(G=xe.matches),!G){let{error:ze,notFoundMatches:Ee,route:Ie}=He(V.pathname);W(V,{matches:Ee,loaderData:{},errors:{[Ie.id]:ze}},{flushSync:se});return}E=new AbortController;let we=Lo(e.history,V,E.signal,Y&&Y.submission),ke;if(Y&&Y.pendingError)ke=[Bs(G).route.id,{type:at.error,error:Y.pendingError}];else if(Y&&Y.submission&&Jr(Y.submission.formMethod)){let ze=await _e(we,V,Y.submission,G,xe.active,{replace:Y.replace,flushSync:se});if(ze.shortCircuited)return;if(ze.pendingActionResult){let[Ee,Ie]=ze.pendingActionResult;if(hr(Ie)&&Fu(Ie.error)&&Ie.error.status===404){E=null,W(V,{matches:ze.matches,loaderData:{},errors:{[Ee]:Ie.error}});return}}G=ze.matches||G,ke=ze.pendingActionResult,B=h0(V,Y.submission),se=!1,xe.active=!1,we=Lo(e.history,we.url,we.signal)}let{shortCircuited:je,matches:ce,loaderData:Se,errors:Pe}=await We(we,V,G,xe.active,B,Y&&Y.submission,Y&&Y.fetcherSubmission,Y&&Y.replace,Y&&Y.initialHydration===!0,se,ke);je||(E=null,W(V,Pt({matches:ce||G},Ij(ke),{loaderData:Se,errors:Pe})))}async function _e(F,V,Y,ue,B,G){G===void 0&&(G={}),de();let se=Z$(V,Y);if(L({navigation:se},{flushSync:G.flushSync===!0}),B){let ke=await mi(ue,V.pathname,F.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){let je=Bs(ke.partialMatches).route.id;return{matches:ke.partialMatches,pendingActionResult:[je,{type:at.error,error:ke.error}]}}else if(ke.matches)ue=ke.matches;else{let{notFoundMatches:je,error:ce,route:Se}=He(V.pathname);return{matches:je,pendingActionResult:[Se.id,{type:at.error,error:ce}]}}}let xe,we=Xc(ue,V);if(!we.route.action&&!we.route.lazy)xe={type:at.error,error:Qn(405,{method:F.method,pathname:V.pathname,routeId:we.route.id})};else if(xe=(await it("action",N,F,[we],ue,null))[we.route.id],F.signal.aborted)return{shortCircuited:!0};if(Ks(xe)){let ke;return G&&G.replace!=null?ke=G.replace:ke=Oj(xe.response.headers.get("Location"),new URL(F.url),c,e.history)===N.location.pathname+N.location.search,await rt(F,xe,!0,{submission:Y,replace:ke}),{shortCircuited:!0}}if(Ka(xe))throw Qn(400,{type:"defer-action"});if(hr(xe)){let ke=Bs(ue,we.route.id);return(G&&G.replace)!==!0&&(P=Gt.Push),{matches:ue,pendingActionResult:[ke.route.id,xe]}}return{matches:ue,pendingActionResult:[we.route.id,xe]}}async function We(F,V,Y,ue,B,G,se,xe,we,ke,je){let ce=B||h0(V,G),Se=G||se||Fj(ce),Pe=!I&&(!f.v7_partialHydration||!we);if(ue){if(Pe){let Lt=Qe(je);L(Pt({navigation:ce},Lt!==void 0?{actionData:Lt}:{}),{flushSync:ke})}let tt=await mi(Y,V.pathname,F.signal);if(tt.type==="aborted")return{shortCircuited:!0};if(tt.type==="error"){let Lt=Bs(tt.partialMatches).route.id;return{matches:tt.partialMatches,loaderData:{},errors:{[Lt]:tt.error}}}else if(tt.matches)Y=tt.matches;else{let{error:Lt,notFoundMatches:Do,route:gc}=He(V.pathname);return{matches:Do,loaderData:{},errors:{[gc.id]:Lt}}}}let ze=o||s,[Ee,Ie]=Ej(e.history,N,Y,Se,V,f.v7_partialHydration&&we===!0,f.v7_skipActionErrorRevalidation,$,oe,Z,ee,D,J,ze,c,je);if(lt(tt=>!(Y&&Y.some(Lt=>Lt.route.id===tt))||Ee&&Ee.some(Lt=>Lt.route.id===tt)),O=++K,Ee.length===0&&Ie.length===0){let tt=et();return W(V,Pt({matches:Y,loaderData:{},errors:je&&hr(je[1])?{[je[0]]:je[1].error}:null},Ij(je),tt?{fetchers:new Map(N.fetchers)}:{}),{flushSync:ke}),{shortCircuited:!0}}if(Pe){let tt={};if(!ue){tt.navigation=ce;let Lt=Qe(je);Lt!==void 0&&(tt.actionData=Lt)}Ie.length>0&&(tt.fetchers=Nt(Ie)),L(tt,{flushSync:ke})}Ie.forEach(tt=>{$e(tt.key),tt.controller&&M.set(tt.key,tt.controller)});let It=()=>Ie.forEach(tt=>$e(tt.key));E&&E.signal.addEventListener("abort",It);let{loaderResults:Xn,fetcherResults:ur}=await X(N,Y,Ee,Ie,F);if(F.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener("abort",It),Ie.forEach(tt=>M.delete(tt.key));let ct=vf(Xn);if(ct)return await rt(F,ct.result,!0,{replace:xe}),{shortCircuited:!0};if(ct=vf(ur),ct)return J.add(ct.key),await rt(F,ct.result,!0,{replace:xe}),{shortCircuited:!0};let{loaderData:js,errors:Ns}=Dj(N,Y,Xn,je,Ie,ur,be);be.forEach((tt,Lt)=>{tt.subscribe(Do=>{(Do||tt.done)&&be.delete(Lt)})}),f.v7_partialHydration&&we&&N.errors&&(Ns=Pt({},N.errors,Ns));let Cs=et(),Jd=pt(O),ef=Cs||Jd||Ie.length>0;return Pt({matches:Y,loaderData:js,errors:Ns},ef?{fetchers:new Map(N.fetchers)}:{})}function Qe(F){if(F&&!hr(F[1]))return{[F[0]]:F[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Nt(F){return F.forEach(V=>{let Y=N.fetchers.get(V.key),ue=Nc(void 0,Y?Y.data:void 0);N.fetchers.set(V.key,ue)}),new Map(N.fetchers)}function hn(F,V,Y,ue){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.");$e(F);let B=(ue&&ue.flushSync)===!0,G=o||s,se=xx(N.location,N.matches,c,f.v7_prependBasename,Y,f.v7_relativeSplatPath,V,ue==null?void 0:ue.relative),xe=$s(G,se,c),we=qr(xe,G,se);if(we.active&&we.matches&&(xe=we.matches),!xe){fe(F,V,Qn(404,{pathname:se}),{flushSync:B});return}let{path:ke,submission:je,error:ce}=Cj(f.v7_normalizeFormMethod,!0,se,ue);if(ce){fe(F,V,ce,{flushSync:B});return}let Se=Xc(xe,ke),Pe=(ue&&ue.preventScrollReset)===!0;if(je&&Jr(je.formMethod)){Xt(F,V,ke,Se,xe,we.active,B,Pe,je);return}D.set(F,{routeId:V,path:ke}),xt(F,V,ke,Se,xe,we.active,B,Pe,je)}async function Xt(F,V,Y,ue,B,G,se,xe,we){de(),D.delete(F);function ke(Ht){if(!Ht.route.action&&!Ht.route.lazy){let Mo=Qn(405,{method:we.formMethod,pathname:Y,routeId:V});return fe(F,V,Mo,{flushSync:se}),!0}return!1}if(!G&&ke(ue))return;let je=N.fetchers.get(F);Te(F,Q$(we,je),{flushSync:se});let ce=new AbortController,Se=Lo(e.history,Y,ce.signal,we);if(G){let Ht=await mi(B,new URL(Se.url).pathname,Se.signal,F);if(Ht.type==="aborted")return;if(Ht.type==="error"){fe(F,V,Ht.error,{flushSync:se});return}else if(Ht.matches){if(B=Ht.matches,ue=Xc(B,Y),ke(ue))return}else{fe(F,V,Qn(404,{pathname:Y}),{flushSync:se});return}}M.set(F,ce);let Pe=K,Ee=(await it("action",N,Se,[ue],B,F))[ue.route.id];if(Se.signal.aborted){M.get(F)===ce&&M.delete(F);return}if(f.v7_fetcherPersist&&ee.has(F)){if(Ks(Ee)||hr(Ee)){Te(F,Ia(void 0));return}}else{if(Ks(Ee))if(M.delete(F),O>Pe){Te(F,Ia(void 0));return}else return J.add(F),Te(F,Nc(we)),rt(Se,Ee,!1,{fetcherSubmission:we,preventScrollReset:xe});if(hr(Ee)){fe(F,V,Ee.error);return}}if(Ka(Ee))throw Qn(400,{type:"defer-action"});let Ie=N.navigation.location||N.location,It=Lo(e.history,Ie,ce.signal),Xn=o||s,ur=N.navigation.state!=="idle"?$s(Xn,N.navigation.location,c):N.matches;Ve(ur,"Didn't find any matches after fetcher action");let ct=++K;ie.set(F,ct);let js=Nc(we,Ee.data);N.fetchers.set(F,js);let[Ns,Cs]=Ej(e.history,N,ur,we,Ie,!1,f.v7_skipActionErrorRevalidation,$,oe,Z,ee,D,J,Xn,c,[ue.route.id,Ee]);Cs.filter(Ht=>Ht.key!==F).forEach(Ht=>{let Mo=Ht.key,fk=N.fetchers.get(Mo),P6=Nc(void 0,fk?fk.data:void 0);N.fetchers.set(Mo,P6),$e(Mo),Ht.controller&&M.set(Mo,Ht.controller)}),L({fetchers:new Map(N.fetchers)});let Jd=()=>Cs.forEach(Ht=>$e(Ht.key));ce.signal.addEventListener("abort",Jd);let{loaderResults:ef,fetcherResults:tt}=await X(N,ur,Ns,Cs,It);if(ce.signal.aborted)return;ce.signal.removeEventListener("abort",Jd),ie.delete(F),M.delete(F),Cs.forEach(Ht=>M.delete(Ht.key));let Lt=vf(ef);if(Lt)return rt(It,Lt.result,!1,{preventScrollReset:xe});if(Lt=vf(tt),Lt)return J.add(Lt.key),rt(It,Lt.result,!1,{preventScrollReset:xe});let{loaderData:Do,errors:gc}=Dj(N,ur,ef,void 0,Cs,tt,be);if(N.fetchers.has(F)){let Ht=Ia(Ee.data);N.fetchers.set(F,Ht)}pt(ct),N.navigation.state==="loading"&&ct>O?(Ve(P,"Expected pending action"),E&&E.abort(),W(N.navigation.location,{matches:ur,loaderData:Do,errors:gc,fetchers:new Map(N.fetchers)})):(L({errors:gc,loaderData:Mj(N.loaderData,Do,ur,gc),fetchers:new Map(N.fetchers)}),$=!1)}async function xt(F,V,Y,ue,B,G,se,xe,we){let ke=N.fetchers.get(F);Te(F,Nc(we,ke?ke.data:void 0),{flushSync:se});let je=new AbortController,ce=Lo(e.history,Y,je.signal);if(G){let Ee=await mi(B,new URL(ce.url).pathname,ce.signal,F);if(Ee.type==="aborted")return;if(Ee.type==="error"){fe(F,V,Ee.error,{flushSync:se});return}else if(Ee.matches)B=Ee.matches,ue=Xc(B,Y);else{fe(F,V,Qn(404,{pathname:Y}),{flushSync:se});return}}M.set(F,je);let Se=K,ze=(await it("loader",N,ce,[ue],B,F))[ue.route.id];if(Ka(ze)&&(ze=await Zb(ze,ce.signal,!0)||ze),M.get(F)===je&&M.delete(F),!ce.signal.aborted){if(ee.has(F)){Te(F,Ia(void 0));return}if(Ks(ze))if(O>Se){Te(F,Ia(void 0));return}else{J.add(F),await rt(ce,ze,!1,{preventScrollReset:xe});return}if(hr(ze)){fe(F,V,ze.error);return}Ve(!Ka(ze),"Unhandled fetcher deferred data"),Te(F,Ia(ze.data))}}async function rt(F,V,Y,ue){let{submission:B,fetcherSubmission:G,preventScrollReset:se,replace:xe}=ue===void 0?{}:ue;V.response.headers.has("X-Remix-Revalidate")&&($=!0);let we=V.response.headers.get("Location");Ve(we,"Expected a Location header on the redirect Response"),we=Oj(we,new URL(F.url),c,e.history);let ke=Ru(N.location,we,{_isRedirect:!0});if(n){let Ee=!1;if(V.response.headers.has("X-Remix-Reload-Document"))Ee=!0;else if(Xb.test(we)){const Ie=e.history.createURL(we);Ee=Ie.origin!==t.location.origin||ui(Ie.pathname,c)==null}if(Ee){xe?t.location.replace(we):t.location.assign(we);return}}E=null;let je=xe===!0||V.response.headers.has("X-Remix-Replace")?Gt.Replace:Gt.Push,{formMethod:ce,formAction:Se,formEncType:Pe}=N.navigation;!B&&!G&&ce&&Se&&Pe&&(B=Fj(N.navigation));let ze=B||G;if(_$.has(V.response.status)&&ze&&Jr(ze.formMethod))await ae(je,ke,{submission:Pt({},ze,{formAction:we}),preventScrollReset:se||T,enableViewTransition:Y?_:void 0});else{let Ee=h0(ke,B);await ae(je,ke,{overrideNavigation:Ee,fetcherSubmission:G,preventScrollReset:se||T,enableViewTransition:Y?_:void 0})}}async function it(F,V,Y,ue,B,G){let se,xe={};try{se=await $$(u,F,V,Y,ue,B,G,a,i)}catch(we){return ue.forEach(ke=>{xe[ke.route.id]={type:at.error,error:we}}),xe}for(let[we,ke]of Object.entries(se))if(K$(ke)){let je=ke.result;xe[we]={type:at.redirect,response:V$(je,Y,we,B,c,f.v7_relativeSplatPath)}}else xe[we]=await U$(ke);return xe}async function X(F,V,Y,ue,B){let G=F.matches,se=it("loader",F,B,Y,V,null),xe=Promise.all(ue.map(async je=>{if(je.matches&&je.match&&je.controller){let Se=(await it("loader",F,Lo(e.history,je.path,je.controller.signal),[je.match],je.matches,je.key))[je.match.route.id];return{[je.key]:Se}}else return Promise.resolve({[je.key]:{type:at.error,error:Qn(404,{pathname:je.path})}})})),we=await se,ke=(await xe).reduce((je,ce)=>Object.assign(je,ce),{});return await Promise.all([Y$(V,we,B.signal,G,F.loaderData),X$(V,ke,ue)]),{loaderResults:we,fetcherResults:ke}}function de(){$=!0,oe.push(...lt()),D.forEach((F,V)=>{M.has(V)&&Z.add(V),$e(V)})}function Te(F,V,Y){Y===void 0&&(Y={}),N.fetchers.set(F,V),L({fetchers:new Map(N.fetchers)},{flushSync:(Y&&Y.flushSync)===!0})}function fe(F,V,Y,ue){ue===void 0&&(ue={});let B=Bs(N.matches,V);me(F),L({errors:{[B.route.id]:Y},fetchers:new Map(N.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function R(F){return H.set(F,(H.get(F)||0)+1),ee.has(F)&&ee.delete(F),N.fetchers.get(F)||D$}function me(F){let V=N.fetchers.get(F);M.has(F)&&!(V&&V.state==="loading"&&ie.has(F))&&$e(F),D.delete(F),ie.delete(F),J.delete(F),f.v7_fetcherPersist&&ee.delete(F),Z.delete(F),N.fetchers.delete(F)}function Oe(F){let V=(H.get(F)||0)-1;V<=0?(H.delete(F),ee.add(F),f.v7_fetcherPersist||me(F)):H.set(F,V),L({fetchers:new Map(N.fetchers)})}function $e(F){let V=M.get(F);V&&(V.abort(),M.delete(F))}function ht(F){for(let V of F){let Y=R(V),ue=Ia(Y.data);N.fetchers.set(V,ue)}}function et(){let F=[],V=!1;for(let Y of J){let ue=N.fetchers.get(Y);Ve(ue,"Expected fetcher: "+Y),ue.state==="loading"&&(J.delete(Y),F.push(Y),V=!0)}return ht(F),V}function pt(F){let V=[];for(let[Y,ue]of ie)if(ue<F){let B=N.fetchers.get(Y);Ve(B,"Expected fetcher: "+Y),B.state==="loading"&&($e(Y),ie.delete(Y),V.push(Y))}return ht(V),V.length>0}function Wt(F,V){let Y=N.blockers.get(F)||Ho;return ne.get(F)!==V&&ne.set(F,V),Y}function Ct(F){N.blockers.delete(F),ne.delete(F)}function le(F,V){let Y=N.blockers.get(F)||Ho;Ve(Y.state==="unblocked"&&V.state==="blocked"||Y.state==="blocked"&&V.state==="blocked"||Y.state==="blocked"&&V.state==="proceeding"||Y.state==="blocked"&&V.state==="unblocked"||Y.state==="proceeding"&&V.state==="unblocked","Invalid blocker state transition: "+Y.state+" -> "+V.state);let ue=new Map(N.blockers);ue.set(F,V),L({blockers:ue})}function Me(F){let{currentLocation:V,nextLocation:Y,historyAction:ue}=F;if(ne.size===0)return;ne.size>1&&ho(!1,"A router only supports one blocker at a time");let B=Array.from(ne.entries()),[G,se]=B[B.length-1],xe=N.blockers.get(G);if(!(xe&&xe.state==="proceeding")&&se({currentLocation:V,nextLocation:Y,historyAction:ue}))return G}function He(F){let V=Qn(404,{pathname:F}),Y=o||s,{matches:ue,route:B}=Lj(Y);return lt(),{notFoundMatches:ue,route:B,error:V}}function lt(F){let V=[];return be.forEach((Y,ue)=>{(!F||F(ue))&&(Y.cancel(),V.push(ue),be.delete(ue))}),V}function Ss(F,V,Y){if(g=F,b=V,y=Y||null,!x&&N.navigation===f0){x=!0;let ue=ks(N.location,N.matches);ue!=null&&L({restoreScrollPosition:ue})}return()=>{g=null,b=null,y=null}}function _o(F,V){return y&&y(F,V.map(ue=>c$(ue,N.loaderData)))||F.key}function mc(F,V){if(g&&b){let Y=_o(F,V);g[Y]=b()}}function ks(F,V){if(g){let Y=_o(F,V),ue=g[Y];if(typeof ue=="number")return ue}return null}function qr(F,V,Y){if(d)if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:uh(V,Y,c,!0)}}else return{active:!0,matches:uh(V,Y,c,!0)||[]};return{active:!1,matches:null}}async function mi(F,V,Y,ue){if(!d)return{type:"success",matches:F};let B=F;for(;;){let G=o==null,se=o||s,xe=a;try{await d({signal:Y,path:V,matches:B,fetcherKey:ue,patch:(je,ce)=>{Y.aborted||Tj(je,ce,se,xe,i)}})}catch(je){return{type:"error",error:je,partialMatches:B}}finally{G&&!Y.aborted&&(s=[...s])}if(Y.aborted)return{type:"aborted"};let we=$s(se,V,c);if(we)return{type:"success",matches:we};let ke=uh(se,V,c,!0);if(!ke||B.length===ke.length&&B.every((je,ce)=>je.route.id===ke[ce].route.id))return{type:"success",matches:null};B=ke}}function Lg(F){a={},o=Yh(F,i,void 0,a)}function Rg(F,V){let Y=o==null;Tj(F,V,o||s,a,i),Y&&(s=[...s],L({}))}return j={get basename(){return c},get future(){return f},get state(){return N},get routes(){return s},get window(){return t},initialize:Q,subscribe:ve,enableScrollRestoration:Ss,navigate:z,fetch:hn,revalidate:te,createHref:F=>e.history.createHref(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:R,deleteFetcher:Oe,dispose:re,getBlocker:Wt,deleteBlocker:Ct,patchRoutes:Rg,_internalFetchControllers:M,_internalActiveDeferreds:be,_internalSetRoutes:Lg},j}function L$(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xx(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=Sm(i||".",wm(c,a),ui(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=Qb(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 Cj(e,t,n,r){if(!r||!L$(r))return{path:n};if(r.formMethod&&!q$(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=_O(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Jr(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,b]=g;return""+p+y+"="+b+`
|
|
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(!Jr(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()}}}Ve(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=bx(r.formData),u=r.formData;else if(r.body instanceof FormData)c=bx(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=_j(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=_j(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(Jr(d.formMethod))return{path:n,submission:d};let f=gs(n);return t&&f.search&&Qb(f.search)&&c.append("index",""),f.search="?"+c,{path:po(f),submission:d}}function Pj(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 Ej(e,t,n,r,i,a,s,o,c,u,d,f,h,p,g,y){let b=y?hr(y[1])?y[1].error:y[1].data:void 0,x=e.createURL(t.location),v=e.createURL(i),w=n;a&&t.errors?w=Pj(n,Object.keys(t.errors)[0],!0):y&&hr(y[1])&&(w=Pj(n,y[0]));let k=y?y[1].statusCode:void 0,S=s&&k&&k>=400,j=w.filter((P,T)=>{let{route:E}=P;if(E.lazy)return!0;if(E.loader==null)return!1;if(a)return vx(E,t.loaderData,t.errors);if(R$(t.loaderData,t.matches[T],P)||c.some(A=>A===P.route.id))return!0;let _=t.matches[T],C=P;return Aj(P,Pt({currentUrl:x,currentParams:_.params,nextUrl:v,nextParams:C.params},r,{actionResult:b,actionStatus:k,defaultShouldRevalidate:S?!1:o||x.pathname+x.search===v.pathname+v.search||x.search!==v.search||TO(_,C)}))}),N=[];return f.forEach((P,T)=>{if(a||!n.some(I=>I.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=Aj(C,Pt({currentUrl:x,currentParams:t.matches[t.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:b,actionStatus:k,defaultShouldRevalidate:S?!1:o})),A&&N.push({key:T,routeId:P.routeId,path:P.path,matches:E,match:C,controller:new AbortController})}),[j,N]}function vx(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 R$(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function TO(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Aj(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Tj(e,t,n,r,i){var a;let s;if(e){let u=r[e];Ve(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=>OO(u,d))),c=Yh(o,i,[e||"_","patch",String(((a=s)==null?void 0:a.length)||"0")],r);s.push(...c)}function OO(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=>OO(n,a))}):!1}async function F$(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];Ve(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&&!o$.has(s)&&(a[s]=r[s])}Object.assign(i,a),Object.assign(i,Pt({},t(i),{lazy:void 0}))}async function z$(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 $$(e,t,n,r,i,a,s,o,c,u){let d=a.map(p=>p.route.lazy?F$(p.route,c,o):void 0),f=a.map((p,g)=>{let y=d[g],b=i.some(v=>v.route.id===p.route.id);return Pt({},p,{shouldLoad:b,resolve:async v=>(v&&r.method==="GET"&&(p.route.lazy||p.route.loader)&&(b=!0),b?B$(t,r,p,y,v,u):Promise.resolve({type:at.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 B$(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:at.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})}Ve(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:at.error,result:u}}finally{o&&t.signal.removeEventListener("abort",o)}return s}async function U$(e){let{result:t,type:n}=e;if(DO(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:at.error,error:h}}return n===at.error?{type:at.error,error:new Zh(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:at.data,data:f,statusCode:t.status,headers:t.headers}}if(n===at.error){if(Rj(t)){var r,i;if(t.data instanceof Error){var a,s;return{type:at.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:at.error,error:new Zh(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:Fu(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:at.error,error:t,statusCode:Fu(t)?t.status:void 0}}if(G$(t)){var o,c;return{type:at.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(Rj(t)){var u,d;return{type:at.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:at.data,data:t}}function V$(e,t,n,r,i,a){let s=e.headers.get("Location");if(Ve(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Xb.test(s)){let o=r.slice(0,r.findIndex(c=>c.route.id===n)+1);s=xx(new URL(t.url),o,i,!0,s,a),e.headers.set("Location",s)}return e}function Oj(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Xb.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=ui(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(_O(t)).toString(),a={signal:n};if(r&&Jr(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=bx(r.formData):a.body=r.formData}return new Request(i,a)}function bx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function _j(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function W$(e,t,n,r,i){let a={},s=null,o,c=!1,u={},d=n&&hr(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(Ve(!Ks(p),"Cannot handle redirect results in processLoaderData"),hr(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=Fu(p.error)?p.error.status:500),p.headers&&(u[h]=p.headers)}else Ka(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 Dj(e,t,n,r,i,a,s){let{loaderData:o,errors:c}=W$(t,n,r,s);return i.forEach(u=>{let{key:d,match:f,controller:h}=u,p=a[d];if(Ve(p,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(hr(p)){let g=Bs(e.matches,f==null?void 0:f.route.id);c&&c[g.route.id]||(c=Pt({},c,{[g.route.id]:p.error})),e.fetchers.delete(d)}else if(Ks(p))Ve(!1,"Unhandled fetcher revalidation redirect");else if(Ka(p))Ve(!1,"Unhandled fetcher deferred data");else{let g=Ia(p.data);e.fetchers.set(d,g)}}),{loaderData:o,errors:c}}function Mj(e,t,n,r){let i=Pt({},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 Ij(e){return e?hr(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 Lj(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 vf(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 _O(e){let t=typeof e=="string"?gs(e):e;return po(Pt({},t,{hash:""}))}function H$(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function K$(e){return DO(e.result)&&O$.has(e.result.status)}function Ka(e){return e.type===at.deferred}function hr(e){return e.type===at.error}function Ks(e){return(e&&e.type)===at.redirect}function Rj(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 DO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function q$(e){return T$.has(e.toLowerCase())}function Jr(e){return E$.has(e.toLowerCase())}async function Y$(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&&!TO(d,u)&&(i&&i[u.route.id])!==void 0;Ka(c)&&f&&await Zb(c,n,!1).then(h=>{h&&(t[o]=h)})}}async function X$(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)&&Ka(o)&&(Ve(s,"Expected an AbortController for revalidating fetcher deferred result"),await Zb(o,s.signal,!0).then(u=>{u&&(t[i]=u)}))}}async function Zb(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:at.data,data:e.deferredData.unwrappedData}}catch(i){return{type:at.error,error:i}}return{type:at.data,data:e.deferredData.data}}}function Qb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Xc(e,t){let n=typeof t=="string"?gs(t).search:t.search;if(e[e.length-1].route.index&&Qb(n||""))return e[e.length-1];let r=PO(e);return r[r.length-1]}function Fj(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 h0(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 Z$(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 Q$(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 Ia(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 J$(e,t){try{let n=e.sessionStorage.getItem(AO);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 e7(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(AO,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 vd=m.createContext(null),Jb=m.createContext(null),xa=m.createContext(null),ew=m.createContext(null),zi=m.createContext({outlet:null,matches:[],isDataRoute:!1}),MO=m.createContext(null);function t7(e,t){let{relative:n}=t===void 0?{}:t;Zl()||Ve(!1);let{basename:r,navigator:i}=m.useContext(xa),{hash:a,pathname:s,search:o}=km(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:Ji([r,s])),i.createHref({pathname:c,search:o,hash:a})}function Zl(){return m.useContext(ew)!=null}function va(){return Zl()||Ve(!1),m.useContext(ew).location}function IO(e){m.useContext(xa).static||m.useLayoutEffect(e)}function $i(){let{isDataRoute:e}=m.useContext(zi);return e?g7():n7()}function n7(){Zl()||Ve(!1);let e=m.useContext(vd),{basename:t,future:n,navigator:r}=m.useContext(xa),{matches:i}=m.useContext(zi),{pathname:a}=va(),s=JSON.stringify(wm(i,n.v7_relativeSplatPath)),o=m.useRef(!1);return IO(()=>{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=Sm(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 r7=m.createContext(null);function i7(e){let t=m.useContext(zi).outlet;return t&&m.createElement(r7.Provider,{value:e},t)}function a7(){let{matches:e}=m.useContext(zi),t=e[e.length-1];return t?t.params:{}}function km(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(xa),{matches:i}=m.useContext(zi),{pathname:a}=va(),s=JSON.stringify(wm(i,r.v7_relativeSplatPath));return m.useMemo(()=>Sm(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}function s7(e,t,n,r){Zl()||Ve(!1);let{navigator:i}=m.useContext(xa),{matches:a}=m.useContext(zi),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 d7(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 o7(){let e=h7(),t=Fu(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 l7=m.createElement(o7,null);class c7 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(zi.Provider,{value:this.props.routeContext},m.createElement(MO.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function u7(e){let{routeContext:t,match:n,children:r}=e,i=m.useContext(vd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(zi.Provider,{value:t},r)}function d7(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||Ve(!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,b=null;n&&(p=o&&f.route.id?o[f.route.id]:void 0,y=f.route.errorElement||l7,c&&(u<0&&h===0?(y7("route-fallback"),g=!0,b=null):u===h&&(g=!0,b=f.route.hydrateFallbackElement||null)));let x=t.concat(s.slice(0,h+1)),v=()=>{let w;return p?w=y:g?w=b:f.route.Component?w=m.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,m.createElement(u7,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(c7,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:v(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):v()},null)}var tw=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(tw||{}),LO=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}(LO||{});function RO(e){let t=m.useContext(vd);return t||Ve(!1),t}function FO(e){let t=m.useContext(Jb);return t||Ve(!1),t}function f7(e){let t=m.useContext(zi);return t||Ve(!1),t}function zO(e){let t=f7(),n=t.matches[t.matches.length-1];return n.route.id||Ve(!1),n.route.id}function h7(){var e;let t=m.useContext(MO),n=FO(LO.UseRouteError),r=zO();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let p7=0;function m7(e){let{router:t,basename:n}=RO(tw.UseBlocker),r=FO(),[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:ui(c.pathname,n)||c.pathname}),nextLocation:_l({},u,{pathname:ui(u.pathname,n)||u.pathname}),historyAction:d})},[n,e]);return m.useEffect(()=>{let o=String(++p7);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 g7(){let{router:e}=RO(tw.UseNavigateStable),t=zO(),n=m.useRef(!1);return IO(()=>{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 zj={};function y7(e,t,n){zj[e]||(zj[e]=!0)}function x7(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;Zl()||Ve(!1);let{future:a,static:s}=m.useContext(xa),{matches:o}=m.useContext(zi),{pathname:c}=va(),u=$i(),d=Sm(t,wm(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 nw(e){return i7(e.context)}function v7(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Gt.Pop,navigator:a,static:s=!1,future:o}=e;Zl()&&Ve(!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=gs(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,y=m.useMemo(()=>{let b=ui(d,c);return b==null?null:{location:{pathname:b,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(ew.Provider,{children:n,value:y}))}new Promise(()=>{});function b7(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 $O(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 w7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function S7(e,t){return e.button===0&&(!t||t==="_self")&&!w7(e)}function wx(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 k7(e,t){let n=wx(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const j7=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],N7=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],C7="6";try{window.__reactRouterVersion=C7}catch{}function P7(e,t){return I$({basename:void 0,future:Dl({},void 0,{v7_prependBasename:!0}),history:i$({window:void 0}),hydrationData:E7(),routes:e,mapRouteProperties:b7,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function E7(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Dl({},t,{errors:A7(t.errors)})),t}function A7(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 BO=m.createContext({isTransitioning:!1}),T7=m.createContext(new Map),O7="startTransition",$j=SA[O7],_7="flushSync",Bj=r$[_7];function D7(e){$j?$j(e):e()}function Cc(e){Bj?Bj(e):e()}class M7{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 I7(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(),b=m.useRef(new Map),{v7_startTransition:x}=r||{},v=m.useCallback(P=>{x?D7(P):P()},[x]),w=m.useCallback((P,T)=>{let{deletedFetchers:E,flushSync:_,viewTransitionOpts:C}=T;P.fetchers.forEach((I,$)=>{I.data!==void 0&&b.current.set($,I.data)}),E.forEach(I=>b.current.delete(I));let A=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!C||A){_?Cc(()=>a(P)):v(()=>a(P));return}if(_){Cc(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:C.currentLocation,nextLocation:C.nextLocation})});let I=n.window.document.startViewTransition(()=>{Cc(()=>a(P))});I.finished.finally(()=>{Cc(()=>{f(void 0),p(void 0),o(void 0),u({isTransitioning:!1})})}),Cc(()=>p(I));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,b,v]);m.useLayoutEffect(()=>n.subscribe(w),[n,w]),m.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new M7)},[c]),m.useEffect(()=>{if(d&&s&&n.window){let P=s,T=d.promise,E=n.window.document.startViewTransition(async()=>{v(()=>a(P)),await T});E.finished.finally(()=>{f(void 0),p(void 0),o(void 0),u({isTransitioning:!1})}),p(E)}},[v,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 k=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]),S=n.basename||"/",j=m.useMemo(()=>({router:n,navigator:k,static:!1,basename:S}),[n,k,S]),N=m.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return m.useEffect(()=>x7(r,n.future),[r,n.future]),m.createElement(m.Fragment,null,m.createElement(vd.Provider,{value:j},m.createElement(Jb.Provider,{value:i},m.createElement(T7.Provider,{value:b.current},m.createElement(BO.Provider,{value:c},m.createElement(v7,{basename:S,location:i.location,navigationType:i.historyAction,navigator:k,future:N},i.initialized||n.future.v7_partialHydration?m.createElement(L7,{routes:n.routes,future:n.future,state:i}):t))))),null)}const L7=m.memo(R7);function R7(e){let{routes:t,future:n,state:r}=e;return s7(t,void 0,r,n)}const F7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",z7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,UO=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=$O(t,j7),{basename:p}=m.useContext(xa),g,y=!1;if(typeof u=="string"&&z7.test(u)&&(g=u,F7))try{let w=new URL(window.location.href),k=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=ui(k.pathname,p);k.origin===w.origin&&S!=null?u=S+k.search+k.hash:y=!0}catch{}let b=t7(u,{relative:i}),x=B7(u,{replace:s,state:o,target:c,preventScrollReset:d,relative:i,viewTransition:f});function v(w){r&&r(w),w.defaultPrevented||x(w)}return m.createElement("a",Dl({},h,{href:g||b,onClick:y||a?r:v,ref:n,target:c}))}),p0=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=$O(t,N7),h=km(c,{relative:f.relative}),p=va(),g=m.useContext(Jb),{navigator:y,basename:b}=m.useContext(xa),x=g!=null&&U7(h)&&u===!0,v=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,w=p.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(w=w.toLowerCase(),k=k?k.toLowerCase():null,v=v.toLowerCase()),k&&b&&(k=ui(k,b)||k);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let j=w===v||!s&&w.startsWith(v)&&w.charAt(S)==="/",N=k!=null&&(k===v||!s&&k.startsWith(v)&&k.charAt(v.length)==="/"),P={isActive:j,isPending:N,isTransitioning:x},T=j?r:void 0,E;typeof a=="function"?E=a(P):E=[a,j?"active":null,N?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let _=typeof o=="function"?o(P):o;return m.createElement(UO,Dl({},f,{"aria-current":T,className:E,ref:n,style:_,to:c,viewTransition:u}),typeof d=="function"?d(P):d)});var Sx;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Sx||(Sx={}));var Uj;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Uj||(Uj={}));function $7(e){let t=m.useContext(vd);return t||Ve(!1),t}function B7(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:o}=t===void 0?{}:t,c=$i(),u=va(),d=km(e,{relative:s});return m.useCallback(f=>{if(S7(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 bd(e){let t=m.useRef(wx(e)),n=m.useRef(!1),r=va(),i=m.useMemo(()=>k7(r.search,n.current?null:t.current),[r.search]),a=$i(),s=m.useCallback((o,c)=>{const u=wx(typeof o=="function"?o(i):o);n.current=!0,a("?"+u,c)},[a,i]);return[i,s]}function U7(e,t){t===void 0&&(t={});let n=m.useContext(BO);n==null&&Ve(!1);let{basename:r}=$7(Sx.useViewTransitionState),i=km(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=ui(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=ui(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 V7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),VO=(...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 W7={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 H7=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,...W7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:VO("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 pe=(e,t)=>{const n=m.forwardRef(({className:r,...i},a)=>m.createElement(H7,{ref:a,iconNode:t,className:VO(`lucide-${V7(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 K7=pe("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=pe("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 WO=pe("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 Vj=pe("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 HO=pe("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 rw=pe("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 iw=pe("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 Ml=pe("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 q7=pe("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 aw=pe("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=pe("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=pe("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=pe("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=pe("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 zu=pe("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 Y7=pe("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 Sr=pe("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 X7=pe("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 ys=pe("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 KO=pe("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 Wj=pe("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 ls=pe("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 Z7=pe("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 Gs=pe("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 GO=pe("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 Q7=pe("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 kx=pe("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=pe("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 qO=pe("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 J7=pe("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 wd=pe("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=pe("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 eB=pe("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 sw=pe("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 tB=pe("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 YO=pe("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 ow=pe("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 Il=pe("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 XO=pe("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 lw=pe("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 jm=pe("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=pe("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 nB=pe("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 cw=pe("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 uw=pe("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 rB=pe("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 Fe=pe("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=pe("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 iB=pe("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 aB=pe("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 sB=pe("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 Nm=pe("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"}]]);/**
|
|
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 dw=pe("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"}]]);/**
|
|
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 Sd=pe("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"}]]);/**
|
|
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 oB=pe("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"}]]);/**
|
|
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 Cm=pe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 jx=pe("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"}]]);/**
|
|
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 In=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 lB=pe("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
|
|
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 cB=pe("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"}]]);/**
|
|
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 ZO=pe("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"}]]);/**
|
|
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 Wn=pe("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"}]]);/**
|
|
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 $u=pe("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"}]]);/**
|
|
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 Hn=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 uB=pe("SendHorizontal",[["path",{d:"m3 3 3 9-3 9 19-9Z",key:"1aobqy"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
|
|
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 dB=pe("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
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 fB=pe("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"}]]);/**
|
|
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 Pm=pe("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"}]]);/**
|
|
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 hB=pe("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"}]]);/**
|
|
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 Bu=pe("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"}]]);/**
|
|
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 fw=pe("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"}]]);/**
|
|
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 QO=pe("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"}]]);/**
|
|
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 hw=pe("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"}]]);/**
|
|
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 pw=pe("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
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 pB=pe("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"}]]);/**
|
|
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 mB=pe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 gB=pe("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"}]]);/**
|
|
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 mw=pe("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"}]]);/**
|
|
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 si=pe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
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 JO=pe("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"}]]);/**
|
|
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 e_=pe("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"}]]);/**
|
|
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 Uu=pe("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"}]]);/**
|
|
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 sr=pe("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"}]]);/**
|
|
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 Ai=pe("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"}]]);/**
|
|
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 Nx=pe("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"}]]);/**
|
|
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 t_=pe("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"}]]);/**
|
|
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 Vu=pe("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"}]]);/**
|
|
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 ta=pe("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"}]]);/**
|
|
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 yB=pe("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"}]]);/**
|
|
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 gw=pe("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"}]]);/**
|
|
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 n_=pe("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"}]]);/**
|
|
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 Ze=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 kd=pe("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 r_(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=r_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ot(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=r_(e))&&(r&&(r+=" "),r+=t);return r}const yw="-",xB=e=>{const t=bB(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const o=s.split(yw);return o[0]===""&&o.length!==1&&o.shift(),i_(o,t)||vB(s)},getConflictingClassGroupIds:(s,o)=>{const c=n[s]||[];return o&&r[s]?[...c,...r[s]]:c}}},i_=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?i_(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(yw);return(s=t.validators.find(({validator:o})=>o(a)))==null?void 0:s.classGroupId},Hj=/^\[(.+)\]$/,vB=e=>{if(Hj.test(e)){const t=Hj.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},bB=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return SB(Object.entries(e.classGroups),n).forEach(([a,s])=>{Cx(s,r,a,t)}),r},Cx=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:Kj(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(wB(i)){Cx(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,s])=>{Cx(s,Kj(t,a),n,r)})})},Kj=(e,t)=>{let n=e;return t.split(yw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},wB=e=>e.isThemeGetter,SB=(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,kB=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)}}},a_="!",jB=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 b=0;b<o.length;b++){let x=o[b];if(u===0){if(x===i&&(r||o.slice(b,b+a)===t)){c.push(o.slice(d,b)),d=b+a;continue}if(x==="/"){f=b;continue}}x==="["?u++:x==="]"&&u--}const h=c.length===0?o:o.substring(d),p=h.startsWith(a_),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},NB=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},CB=e=>({cache:kB(e.cacheSize),parseClassName:jB(e),...xB(e)}),PB=/\s+/,EB=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],s=e.trim().split(PB);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 b=NB(d).join(":"),x=f?b+a_:b,v=x+y;if(a.includes(v))continue;a.push(v);const w=i(y,g);for(let k=0;k<w.length;++k){const S=w[k];a.push(x+S)}o=u+(o.length>0?" "+o:o)}return o};function AB(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=s_(t))&&(r&&(r+=" "),r+=n);return r}const s_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=s_(e[r]))&&(n&&(n+=" "),n+=t);return n};function TB(e,...t){let n,r,i,a=s;function s(c){const u=t.reduce((d,f)=>f(d),e());return n=CB(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=EB(c,n);return i(c,d),d}return function(){return a(AB.apply(null,arguments))}}const vt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},o_=/^\[(?:([a-z-]+):)?(.+)\]$/i,OB=/^\d+\/\d+$/,_B=new Set(["px","full","screen"]),DB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,MB=/\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$/,IB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,LB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vi=e=>bl(e)||_B.has(e)||OB.test(e),Ta=e=>Jl(e,"length",HB),bl=e=>!!e&&!Number.isNaN(Number(e)),m0=e=>Jl(e,"number",bl),Pc=e=>!!e&&Number.isInteger(Number(e)),FB=e=>e.endsWith("%")&&bl(e.slice(0,-1)),Be=e=>o_.test(e),Oa=e=>DB.test(e),zB=new Set(["length","size","percentage"]),$B=e=>Jl(e,zB,l_),BB=e=>Jl(e,"position",l_),UB=new Set(["image","url"]),VB=e=>Jl(e,UB,GB),WB=e=>Jl(e,"",KB),Ec=()=>!0,Jl=(e,t,n)=>{const r=o_.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},HB=e=>MB.test(e)&&!IB.test(e),l_=()=>!1,KB=e=>LB.test(e),GB=e=>RB.test(e),qB=()=>{const e=vt("colors"),t=vt("spacing"),n=vt("blur"),r=vt("brightness"),i=vt("borderColor"),a=vt("borderRadius"),s=vt("borderSpacing"),o=vt("borderWidth"),c=vt("contrast"),u=vt("grayscale"),d=vt("hueRotate"),f=vt("invert"),h=vt("gap"),p=vt("gradientColorStops"),g=vt("gradientColorStopPositions"),y=vt("inset"),b=vt("margin"),x=vt("opacity"),v=vt("padding"),w=vt("saturate"),k=vt("scale"),S=vt("sepia"),j=vt("skew"),N=vt("space"),P=vt("translate"),T=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",Be,t],C=()=>[Be,t],A=()=>["",Vi,Ta],I=()=>["auto",bl,Be],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Be],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[bl,Be];return{cacheSize:500,separator:":",theme:{colors:[Ec],spacing:[Vi,Ta],blur:["none","",Oa,Be],brightness:ie(),borderColor:[e],borderRadius:["none","","full",Oa,Be],borderSpacing:C(),borderWidth:A(),contrast:ie(),grayscale:K(),hueRotate:ie(),invert:K(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[FB,Ta],inset:_(),margin:_(),opacity:ie(),padding:C(),saturate:ie(),scale:ie(),sepia:K(),skew:ie(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",Be]}],container:["container"],columns:[{columns:[Oa]}],"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:[...$(),Be]}],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,Be]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Be]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Pc,Be]}],"grid-cols":[{"grid-cols":[Ec]}],"col-start-end":[{col:["auto",{span:["full",Pc,Be]},Be]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Ec]}],"row-start-end":[{row:["auto",{span:[Pc,Be]},Be]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Be]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"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",Be,t]}],"min-w":[{"min-w":[Be,t,"min","max","fit"]}],"max-w":[{"max-w":[Be,t,"none","full","min","max","fit","prose",{screen:[Oa]},Oa]}],h:[{h:[Be,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Be,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Be,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Be,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Oa,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",m0]}],"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",Be]}],"line-clamp":[{"line-clamp":["none",bl,m0]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vi,Be]}],"list-image":[{"list-image":["none",Be]}],"list-style-type":[{list:["none","disc","decimal",Be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vi,Ta]}],"underline-offset":[{"underline-offset":["auto",Vi,Be]}],"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",Be]}],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",Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),BB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$B]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},VB]}],"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":[x]}],"border-style":[{border:[...oe(),"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":[x]}],"divide-style":[{divide:oe()}],"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:["",...oe()]}],"outline-offset":[{"outline-offset":[Vi,Be]}],"outline-w":[{outline:[Vi,Ta]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Vi,Ta]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Oa,WB]}],"shadow-color":[{shadow:[Ec]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Oa,Be]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"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":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",Be]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",Be]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",Be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Pc,Be]}],"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",Be]}],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",Be]}],"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",Be]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Vi,Ta,m0]}],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"]}}},YB=TB(qB);function U(...e){return YB(ot(e))}const Wu="siclaw_auth",Em=()=>{try{const e=localStorage.getItem(Wu);if(e)return JSON.parse(e)}catch{localStorage.removeItem(Wu)}return{isAuthenticated:!1}},XB=e=>{localStorage.setItem(Wu,JSON.stringify(e))},ZB=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 XB(r),{ok:!0,token:n.token,user:n.user}}return{ok:!1,error:n.error||"Login failed"}}catch{return{ok:!1,error:"Network error"}}},c_=()=>{localStorage.removeItem(Wu),window.location.href="/login"},QB=()=>Em().token,cs=()=>Em().user;function JB(e){try{const t=JSON.parse(atob(e.split(".")[1]));return t.exp?t.exp*1e3<Date.now()-6e4:!0}catch{return!0}}const g0=()=>{const e=Em();return!e.isAuthenticated||!e.token?!1:JB(e.token)?(localStorage.removeItem(Wu),window.location.href="/login",!1):!0},e8=()=>{const e=QB(),n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return e?`${n}?token=${encodeURIComponent(e)}`:n};var cA,uA;let u_={name:((cA=cs())==null?void 0:cA.username)||"User",role:"",initials:xw(((uA=cs())==null?void 0:uA.username)||"User"),avatarBg:"bg-primary-100"};function xw(e){const t=e.split(" ");return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():e.substring(0,2).toUpperCase()}const Ll=()=>{const e=localStorage.getItem("siclaw_user_profile");return e?JSON.parse(e):u_},Jh=e=>{const n={...Ll(),...e};return e.name&&(n.initials=xw(e.name)),u_=n,localStorage.setItem("siclaw_user_profile",JSON.stringify(n)),window.dispatchEvent(new Event("user-profile-updated")),n};async function t8(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:xw(r),avatarBg:n.avatarBg||"bg-primary-100"}}catch{return null}}async function n8(e,t){await e("profile.update",t),Jh(t)}async function r8(e){const t=cs(),n=await t8(e);if(n)Jh(n);else if(t){const r=Ll();(r.name==="User"||r.name==="SRE Admin")&&Jh({name:t.username})}}const d_=m.createContext(null),Gj=1e3,i8=3e4;function a8({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||!g0())return;const w=Gj*Math.pow(2,o.current),k=Math.random()*Gj,S=Math.min(w+k,i8);o.current++,console.log(`[ws] Reconnecting in ${Math.round(S)}ms (attempt ${o.current})`),c.current=setTimeout(()=>{g()},S)},[]),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),!g0()){console.warn("[ws] Not authenticated, skipping connect");return}h("connecting");const w=e8();console.log(`[ws] Connecting to: ${w} (attempt ${o.current})`);const k=new WebSocket(w);r.current=k,d.current=setTimeout(()=>{k.readyState!==WebSocket.OPEN&&(console.warn(`[ws] Connection timeout (3s), readyState=${k.readyState}, retrying...`),k.onclose=null,k.close(),r.current=null,h("disconnected"),p())},3e3),k.onopen=()=>{clearTimeout(d.current),console.log("[ws] Connected"),o.current=0,h("connected")},k.onmessage=S=>{try{const j=JSON.parse(S.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)}},k.onclose=S=>{clearTimeout(d.current),console.log(`[ws] Closed: code=${S.code} reason=${S.reason}`),r.current=null,h("disconnected"),p()},k.onerror=S=>{console.error("[ws] Error:",S)}},[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]),b=m.useCallback((w,k)=>new Promise((S,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")){c_();return}j(new Error(T.message))}else S(P)}),r.current.send(JSON.stringify({type:"req",id:N,method:w,params:k??{}}))}),[]),x=m.useCallback(w=>(s.current.add(w),()=>{s.current.delete(w)}),[]);m.useEffect(()=>(g0()&&(u.current=!1,g()),()=>{y()}),[g,y]);const v={status:t,isConnected:t==="connected",sendRpc:b,connect:g,disconnect:y,subscribe:x};return l.jsx(d_.Provider,{value:v,children:e})}function $t(e={}){const t=m.useContext(d_);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 s8=new Set(["cron_success","cron_failure","cron_result"]);function o8(e){const t=new Map,n=[];for(const r of e)if(s8.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 l8(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 c8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const u8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f8={};function qj(e,t){return(f8.jsx?d8:u8).test(e)}const h8=/[ \t\n\f\r]/g;function p8(e){return typeof e=="object"?e.type==="text"?Yj(e.value):!1:Yj(e)}function Yj(e){return e.replace(h8,"")===""}class jd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}jd.prototype.normal={};jd.prototype.property={};jd.prototype.space=void 0;function f_(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new jd(n,r,t)}function Px(e){return e.toLowerCase()}class or{constructor(t,n){this.attribute=n,this.property=t}}or.prototype.attribute="";or.prototype.booleanish=!1;or.prototype.boolean=!1;or.prototype.commaOrSpaceSeparated=!1;or.prototype.commaSeparated=!1;or.prototype.defined=!1;or.prototype.mustUseProperty=!1;or.prototype.number=!1;or.prototype.overloadedBoolean=!1;or.prototype.property="";or.prototype.spaceSeparated=!1;or.prototype.space=void 0;let m8=0;const Ue=Po(),Kt=Po(),Ex=Po(),ge=Po(),mt=Po(),wl=Po(),dr=Po();function Po(){return 2**++m8}const Ax=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Kt,commaOrSpaceSeparated:dr,commaSeparated:wl,number:ge,overloadedBoolean:Ex,spaceSeparated:mt},Symbol.toStringTag,{value:"Module"})),y0=Object.keys(Ax);class vw extends or{constructor(t,n,r,i){let a=-1;if(super(t,n),Xj(this,"space",i),typeof r=="number")for(;++a<y0.length;){const s=y0[a];Xj(this,y0[a],(r&Ax[s])===Ax[s])}}}vw.prototype.defined=!0;function Xj(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 vw(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Px(r)]=r,n[Px(a.attribute)]=r}return new jd(t,n,e.space)}const h_=ec({properties:{ariaActiveDescendant:null,ariaAtomic:Kt,ariaAutoComplete:null,ariaBusy:Kt,ariaChecked:Kt,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:mt,ariaCurrent:null,ariaDescribedBy:mt,ariaDetails:null,ariaDisabled:Kt,ariaDropEffect:mt,ariaErrorMessage:null,ariaExpanded:Kt,ariaFlowTo:mt,ariaGrabbed:Kt,ariaHasPopup:null,ariaHidden:Kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mt,ariaLevel:ge,ariaLive:null,ariaModal:Kt,ariaMultiLine:Kt,ariaMultiSelectable:Kt,ariaOrientation:null,ariaOwns:mt,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:Kt,ariaReadOnly:Kt,ariaRelevant:null,ariaRequired:Kt,ariaRoleDescription:mt,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:Kt,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function p_(e,t){return t in e?e[t]:t}function m_(e,t){return p_(e,t.toLowerCase())}const g8=ec({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:wl,acceptCharset:mt,accessKey:mt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:mt,autoFocus:Ue,autoPlay:Ue,blocking:mt,capture:null,charSet:null,checked:Ue,cite:null,className:mt,cols:ge,colSpan:null,content:null,contentEditable:Kt,controls:Ue,controlsList:mt,coords:ge|wl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Ex,draggable:Kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:mt,height:ge,hidden:Ex,high:ge,href:null,hrefLang:null,htmlFor:mt,httpEquiv:mt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:mt,itemRef:mt,itemScope:Ue,itemType:mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:ge,pattern:null,ping:mt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:mt,required:Ue,reversed:Ue,rows:ge,rowSpan:ge,sandbox:mt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:Kt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Kt,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mt,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:Kt,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:m_}),y8=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:dr,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:mt,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:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,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:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:dr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,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:ge,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:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dr,rev:dr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dr,requiredFeatures:dr,requiredFonts:dr,requiredFormats:dr,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:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:dr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dr,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:p_}),g_=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()}}),y_=ec({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:m_}),x_=ec({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),x8={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"},v8=/[A-Z]/g,Zj=/-[a-z]/g,b8=/^data[-\w.:]+$/i;function w8(e,t){const n=Px(t);let r=t,i=or;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&b8.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Zj,k8);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Zj.test(a)){let s=a.replace(v8,S8);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=vw}return new i(r,t)}function S8(e){return"-"+e.toLowerCase()}function k8(e){return e.charAt(1).toUpperCase()}const j8=f_([h_,g8,g_,y_,x_],"html"),bw=f_([h_,y8,g_,y_,x_],"svg");function N8(e){return e.join(" ").trim()}var ww={},Qj=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,C8=/\n/g,P8=/^\s*/,E8=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,A8=/^:\s*/,T8=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,O8=/^[;\s]*/,_8=/^\s+|\s+$/g,D8=`
|
|
554
|
+
`,Jj="/",eN="*",Us="",M8="comment",I8="declaration";function L8(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(C8);y&&(n+=y.length);var b=g.lastIndexOf(D8);r=~b?g.length-b: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 b=y[0];return i(b),e=e.slice(b.length),y}}function u(){c(P8)}function d(g){var y;for(g=g||[];y=f();)y!==!1&&g.push(y);return g}function f(){var g=a();if(!(Jj!=e.charAt(0)||eN!=e.charAt(1))){for(var y=2;Us!=e.charAt(y)&&(eN!=e.charAt(y)||Jj!=e.charAt(y+1));)++y;if(y+=2,Us===e.charAt(y-1))return o("End of comment missing");var b=e.slice(2,y-2);return r+=2,i(b),e=e.slice(y),r+=2,g({type:M8,comment:b})}}function h(){var g=a(),y=c(E8);if(y){if(f(),!c(A8))return o("property missing ':'");var b=c(T8),x=g({type:I8,property:tN(y[0].replace(Qj,Us)),value:b?tN(b[0].replace(Qj,Us)):Us});return c(O8),x}}function p(){var g=[];d(g);for(var y;y=h();)y!==!1&&(g.push(y),d(g));return g}return u(),p()}function tN(e){return e?e.replace(_8,Us):Us}var R8=L8,F8=Dn&&Dn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ww,"__esModule",{value:!0});ww.default=$8;const z8=F8(R8);function $8(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,z8.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 Am={};Object.defineProperty(Am,"__esModule",{value:!0});Am.camelCase=void 0;var B8=/^--[a-zA-Z0-9_-]+$/,U8=/-([a-z])/g,V8=/^[^-]+$/,W8=/^-(webkit|moz|ms|o|khtml)-/,H8=/^-(ms)-/,K8=function(e){return!e||V8.test(e)||B8.test(e)},G8=function(e,t){return t.toUpperCase()},nN=function(e,t){return"".concat(t,"-")},q8=function(e,t){return t===void 0&&(t={}),K8(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(H8,nN):e=e.replace(W8,nN),e.replace(U8,G8))};Am.camelCase=q8;var Y8=Dn&&Dn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},X8=Y8(ww),Z8=Am;function Tx(e,t){var n={};return!e||typeof e!="string"||(0,X8.default)(e,function(r,i){r&&i&&(n[(0,Z8.camelCase)(r,t)]=i)}),n}Tx.default=Tx;var Q8=Tx;const J8=hi(Q8),v_=b_("end"),Sw=b_("start");function b_(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 e9(e){const t=Sw(e),n=v_(e);if(t&&n)return{start:t,end:n}}function fu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rN(e.position):"start"in e||"end"in e?rN(e):"line"in e||"column"in e?Ox(e):""}function Ox(e){return iN(e&&e.line)+":"+iN(e&&e.column)}function rN(e){return Ox(e&&e.start)+"-"+Ox(e&&e.end)}function iN(e){return e&&typeof e=="number"?e:1}class Ln 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}}Ln.prototype.file="";Ln.prototype.name="";Ln.prototype.reason="";Ln.prototype.message="";Ln.prototype.stack="";Ln.prototype.column=void 0;Ln.prototype.line=void 0;Ln.prototype.ancestors=void 0;Ln.prototype.cause=void 0;Ln.prototype.fatal=void 0;Ln.prototype.place=void 0;Ln.prototype.ruleId=void 0;Ln.prototype.source=void 0;const kw={}.hasOwnProperty,t9=new Map,n9=/[A-Z]/g,r9=new Set(["table","tbody","thead","tfoot","tr"]),i9=new Set(["td","th"]),w_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function a9(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=h9(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=f9(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"?bw:j8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=S_(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function S_(e,t,n){if(t.type==="element")return s9(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return o9(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return c9(e,t,n);if(t.type==="mdxjsEsm")return l9(e,t);if(t.type==="root")return u9(e,t,n);if(t.type==="text")return d9(e,t)}function s9(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=bw,e.schema=i),e.ancestors.push(t);const a=j_(e,t.tagName,!1),s=p9(e,t);let o=Nw(e,t);return r9.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!p8(c):!0})),k_(e,s,a,t),jw(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function o9(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)}Hu(e,t.position)}function l9(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Hu(e,t.position)}function c9(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=bw,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:j_(e,t.name,!0),s=m9(e,t),o=Nw(e,t);return k_(e,s,a,t),jw(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function u9(e,t,n){const r={};return jw(r,Nw(e,t)),e.create(t,e.Fragment,r,n)}function d9(e,t){return t.value}function k_(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function f9(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 h9(e,t){return n;function n(r,i,a,s){const o=Array.isArray(a.children),c=Sw(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 p9(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&kw.call(t.properties,i)){const a=g9(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&i9.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 m9(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 Hu(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 Hu(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Nw(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:t9;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=S_(e,a,s);o!==void 0&&n.push(o)}return n}function g9(e,t,n){const r=w8(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?c8(n):N8(n)),r.property==="style"){let i=typeof n=="object"?n:y9(e,String(n));return e.stylePropertyNameCase==="css"&&(i=x9(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?x8[r.property]||r.property:r.attribute,n]}}function y9(e,t){try{return J8(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ln("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=w_+"#cannot-parse-style-attribute",i}}function j_(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=qj(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=qj(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return kw.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Hu(e)}function Hu(e,t){const n=new Ln("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=w_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function x9(e){const t={};let n;for(n in e)kw.call(e,n)&&(t[v9(n)]=e[n]);return t}function v9(e){let t=e.replace(n9,b9);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function b9(e){return"-"+e.toLowerCase()}const x0={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"]},w9={};function Cw(e,t){const n=w9,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return N_(e,r,i)}function N_(e,t,n){if(S9(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 aN(e.children,t,n)}return Array.isArray(e)?aN(e,t,n):""}function aN(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=N_(e[i],t,n);return r.join("")}function S9(e){return!!(e&&typeof e=="object")}const sN=document.createElement("i");function Pw(e){const t="&"+e+";";sN.innerHTML=t;const n=sN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xr(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 Fr(e,t){return e.length>0?(xr(e,e.length,0,t),e):t}const oN={}.hasOwnProperty;function C_(e){const t={};let n=-1;for(;++n<e.length;)k9(t,e[n]);return t}function k9(e,t){let n;for(n in t){const i=(oN.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){oN.call(i,s)||(i[s]=[]);const o=a[s];j9(i[s],Array.isArray(o)?o:o?[o]:[])}}}function j9(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);xr(e,0,0,r)}function P_(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 zn=xs(/[A-Za-z]/),On=xs(/[\dA-Za-z]/),N9=xs(/[#-'*+\--9=?A-Z^-~]/);function ep(e){return e!==null&&(e<32||e===127)}const _x=xs(/\d/),C9=xs(/[\dA-Fa-f]/),P9=xs(/[!-/:-@[-`{-~]/);function Le(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Tm=xs(new RegExp("\\p{P}|\\p{S}","u")),go=xs(/\s/);function xs(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&&On(e.charCodeAt(n+1))&&On(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 Xe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(c){return Ke(c)?(e.enter(n),o(c)):t(c)}function o(c){return Ke(c)&&a++<i?(e.consume(c),o):(e.exit(n),t(c))}}const E9={tokenize:A9};function A9(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"),Xe(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 T9={tokenize:O9},lN={tokenize:_9};function O9(e){const t=this,n=[];let r=0,i,a,s;return o;function o(w){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const k=t.events.length;let S=k,j;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){j=t.events[S][1].end;break}x(r);let N=k;for(;N<t.events.length;)t.events[N][1].end={...j},N++;return xr(t.events,S+1,0,t.events.slice(k)),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(lN,d,f)(w)}function d(w){return i&&v(),x(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(lN,p,g)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function g(w){if(w===null){i&&v(),x(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){b(e.exit("chunkFlow"),!0),x(0),e.consume(w);return}return Le(w)?(e.consume(w),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(w),y)}function b(w,k){const S=t.sliceStream(w);if(k&&S.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(S),t.parser.lazy[w.start.line]){let 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(x(r),j=N;j<t.events.length;)t.events[j][1].end={...E},j++;xr(t.events,P+1,0,t.events.slice(N)),t.events.length=j}}function x(w){let k=n.length;for(;k-- >w;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function _9(e,t,n){return Xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rl(e){if(e===null||ft(e)||go(e))return 1;if(Tm(e))return 2}function Om(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 Dx={name:"attention",resolveAll:D9,tokenize:M9};function D9(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};cN(f,-c),cN(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=Fr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Fr(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),u=Fr(u,Om(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Fr(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=Fr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,xr(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 M9(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Rl(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=Rl(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 cN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const I9={name:"autolink",tokenize:L9};function L9(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 zn(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||On(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||On(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||ep(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):N9(p)?(e.consume(p),u):n(p)}function d(p){return On(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||On(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const Nd={partial:!0,tokenize:R9};function R9(e,t,n){return r;function r(a){return Ke(a)?Xe(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Le(a)?t(a):n(a)}}const E_={continuation:{tokenize:z9},exit:$9,name:"blockQuote",tokenize:F9};function F9(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 Ke(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function z9(e,t,n){const r=this;return i;function i(s){return Ke(s)?Xe(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(E_,t,n)(s)}}function $9(e){e.exit("blockQuote")}const A_={name:"characterEscape",tokenize:B9};function B9(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 P9(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const T_={name:"characterReference",tokenize:U9};function U9(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=On,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=C9,d):(e.enter("characterReferenceValue"),a=7,s=_x,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===On&&!Pw(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 uN={partial:!0,tokenize:W9},dN={concrete:!0,name:"codeFenced",tokenize:V9};function V9(e,t,n){const r=this,i={partial:!0,tokenize:S};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"),Ke(j)?Xe(e,f,"whitespace")(j):f(j))}function f(j){return j===null||Le(j)?(e.exit("codeFencedFence"),r.interrupt?t(j):e.check(uN,y,k)(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)):Ke(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xe(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,k,b)(j)}function b(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),x}function x(j){return a>0&&Ke(j)?Xe(e,v,"linePrefix",a+1)(j):v(j)}function v(j){return j===null||Le(j)?e.check(uN,y,k)(j):(e.enter("codeFlowValue"),w(j))}function w(j){return j===null||Le(j)?(e.exit("codeFlowValue"),v(j)):(e.consume(j),w)}function k(j){return e.exit("codeFenced"),t(j)}function S(j,N,P){let T=0;return E;function E($){return j.enter("lineEnding"),j.consume($),j.exit("lineEnding"),_}function _($){return j.enter("codeFencedFence"),Ke($)?Xe(j,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):C($)}function C($){return $===o?(j.enter("codeFencedFenceSequence"),A($)):P($)}function A($){return $===o?(T++,j.consume($),A):T>=s?(j.exit("codeFencedFenceSequence"),Ke($)?Xe(j,I,"whitespace")($):I($)):P($)}function I($){return $===null||Le($)?(j.exit("codeFencedFence"),N($)):P($)}}}function W9(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 v0={name:"codeIndented",tokenize:K9},H9={partial:!0,tokenize:G9};function K9(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Xe(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(H9,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 G9(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):Xe(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 q9={name:"codeText",previous:X9,resolve:Y9,tokenize:Z9};function Y9(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 X9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Z9(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 Q9{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 O_(e){const t={};let n=-1,r,i,a,s,o,c,u;const d=new Q9(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,J9(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 xr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function J9(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 b=[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,b.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):b.pop(),h=b.length;h--;){const x=o.slice(b[h],b[h+1]),v=a.pop();c.push([v,v+x.length-1]),e.splice(v,2,x)}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 eU={resolve:nU,tokenize:rU},tU={partial:!0,tokenize:iU};function nU(e){return O_(e),e}function rU(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(tU,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 iU(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Xe(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 __(e,t,n,r,i,a,s,o,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(x),e.exit(a),h):x===null||x===32||x===41||ep(x)?n(x):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(x))}function h(x){return x===62?(e.enter(a),e.consume(x),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(o),h(x)):x===null||x===60||Le(x)?n(x):(e.consume(x),x===92?g:p)}function g(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function y(x){return!d&&(x===null||x===41||ft(x))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(x)):d<u&&x===40?(e.consume(x),d++,y):x===41?(e.consume(x),d--,y):x===null||x===32||x===40||ep(x)?n(x):(e.consume(x),x===92?b:y)}function b(x){return x===40||x===41||x===92?(e.consume(x),y):y(x)}}function D_(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=!Ke(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function M_(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"),Xe(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):Ke(i)?Xe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const aU={name:"definition",tokenize:oU},sU={partial:!0,tokenize:lU};function oU(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),s(p)}function s(p){return D_.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 ft(p)?hu(e,u)(p):u(p)}function u(p){return __(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(sU,f,f)(p)}function f(p){return Ke(p)?Xe(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 lU(e,t,n){return r;function r(o){return ft(o)?hu(e,i)(o):n(o)}function i(o){return M_(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return Ke(o)?Xe(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Le(o)?t(o):n(o)}}const cU={name:"hardBreakEscape",tokenize:uU};function uU(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 dU={name:"headingAtx",resolve:fU,tokenize:hU};function fU(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"},xr(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function hU(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||ft(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)):Ke(d)?Xe(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||ft(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const pU=["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"],fN=["pre","script","style","textarea"],mU={concrete:!0,name:"htmlFlow",resolveTo:xU,tokenize:vU},gU={partial:!0,tokenize:wU},yU={partial:!0,tokenize:bU};function xU(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 vU(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):zn(D)?(e.consume(D),s=String.fromCharCode(D),b):n(D)}function h(D){return D===45?(e.consume(D),i=2,p):D===91?(e.consume(D),i=5,o=0,g):zn(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 H="CDATA[";return D===H.charCodeAt(o++)?(e.consume(D),o===H.length?r.interrupt?t:C:g):n(D)}function y(D){return zn(D)?(e.consume(D),s=String.fromCharCode(D),b):n(D)}function b(D){if(D===null||D===47||D===62||ft(D)){const H=D===47,ee=s.toLowerCase();return!H&&!a&&fN.includes(ee)?(i=1,r.interrupt?t(D):C(D)):pU.includes(s.toLowerCase())?(i=6,H?(e.consume(D),x):r.interrupt?t(D):C(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?v(D):w(D))}return D===45||On(D)?(e.consume(D),s+=String.fromCharCode(D),b):n(D)}function x(D){return D===62?(e.consume(D),r.interrupt?t:C):n(D)}function v(D){return Ke(D)?(e.consume(D),v):E(D)}function w(D){return D===47?(e.consume(D),E):D===58||D===95||zn(D)?(e.consume(D),k):Ke(D)?(e.consume(D),w):E(D)}function k(D){return D===45||D===46||D===58||D===95||On(D)?(e.consume(D),k):S(D)}function S(D){return D===61?(e.consume(D),j):Ke(D)?(e.consume(D),S):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):Ke(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||ft(D)?S(D):(e.consume(D),P)}function T(D){return D===47||D===62||Ke(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):Ke(D)?(e.consume(D),_):n(D)}function C(D){return D===45&&i===2?(e.consume(D),oe):D===60&&i===1?(e.consume(D),Z):D===62&&i===4?(e.consume(D),ie):D===63&&i===3?(e.consume(D),O):D===93&&i===5?(e.consume(D),K):Le(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(gU,J,A)(D)):D===null||Le(D)?(e.exit("htmlFlowData"),A(D)):(e.consume(D),C)}function A(D){return e.check(yU,I,J)(D)}function I(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),$}function $(D){return D===null||Le(D)?A(D):(e.enter("htmlFlowData"),C(D))}function oe(D){return D===45?(e.consume(D),O):C(D)}function Z(D){return D===47?(e.consume(D),s="",M):C(D)}function M(D){if(D===62){const H=s.toLowerCase();return fN.includes(H)?(e.consume(D),ie):C(D)}return zn(D)&&s.length<8?(e.consume(D),s+=String.fromCharCode(D),M):C(D)}function K(D){return D===93?(e.consume(D),O):C(D)}function O(D){return D===62?(e.consume(D),ie):D===45&&i===2?(e.consume(D),O):C(D)}function ie(D){return D===null||Le(D)?(e.exit("htmlFlowData"),J(D)):(e.consume(D),ie)}function J(D){return e.exit("htmlFlow"),t(D)}}function bU(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 wU(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Nd,t,n)}}const SU={name:"htmlText",tokenize:kU};function kU(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),S):O===63?(e.consume(O),w):zn(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):zn(O)?(e.consume(O),v):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,Z(O)):(e.consume(O),f)}function h(O){return O===45?(e.consume(O),p):f(O)}function p(O){return O===62?oe(O):O===45?h(O):f(O)}function g(O){const ie="CDATA[";return O===ie.charCodeAt(a++)?(e.consume(O),a===ie.length?y:g):n(O)}function y(O){return O===null?n(O):O===93?(e.consume(O),b):Le(O)?(s=y,Z(O)):(e.consume(O),y)}function b(O){return O===93?(e.consume(O),x):y(O)}function x(O){return O===62?oe(O):O===93?(e.consume(O),x):y(O)}function v(O){return O===null||O===62?oe(O):Le(O)?(s=v,Z(O)):(e.consume(O),v)}function w(O){return O===null?n(O):O===63?(e.consume(O),k):Le(O)?(s=w,Z(O)):(e.consume(O),w)}function k(O){return O===62?oe(O):w(O)}function S(O){return zn(O)?(e.consume(O),j):n(O)}function j(O){return O===45||On(O)?(e.consume(O),j):N(O)}function N(O){return Le(O)?(s=N,Z(O)):Ke(O)?(e.consume(O),N):oe(O)}function P(O){return O===45||On(O)?(e.consume(O),P):O===47||O===62||ft(O)?T(O):n(O)}function T(O){return O===47?(e.consume(O),oe):O===58||O===95||zn(O)?(e.consume(O),E):Le(O)?(s=T,Z(O)):Ke(O)?(e.consume(O),T):oe(O)}function E(O){return O===45||O===46||O===58||O===95||On(O)?(e.consume(O),E):_(O)}function _(O){return O===61?(e.consume(O),C):Le(O)?(s=_,Z(O)):Ke(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,Z(O)):Ke(O)?(e.consume(O),C):(e.consume(O),I)}function A(O){return O===i?(e.consume(O),i=void 0,$):O===null?n(O):Le(O)?(s=A,Z(O)):(e.consume(O),A)}function I(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||ft(O)?T(O):(e.consume(O),I)}function $(O){return O===47||O===62||ft(O)?T(O):n(O)}function oe(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Z(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),M}function M(O){return Ke(O)?Xe(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):K(O)}function K(O){return e.enter("htmlTextData"),s(O)}}const Ew={name:"labelEnd",resolveAll:PU,resolveTo:EU,tokenize:AU},jU={tokenize:TU},NU={tokenize:OU},CU={tokenize:_U};function PU(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&&xr(e,0,e.length,n),e}function EU(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=Fr(o,e.slice(a+1,a+r+3)),o=Fr(o,[["enter",d,t]]),o=Fr(o,Om(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),o=Fr(o,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),o=Fr(o,e.slice(s+1)),o=Fr(o,[["exit",c,t]]),xr(e,a,e.length,o),e}function AU(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(jU,d,s?d:f)(h):h===91?e.attempt(NU,d,s?u:f)(h):s?d(h):f(h)}function u(h){return e.attempt(CU,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function TU(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 ft(f)?hu(e,a)(f):a(f)}function a(f){return f===41?d(f):__(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ft(f)?hu(e,c)(f):d(f)}function o(f){return n(f)}function c(f){return f===34||f===39||f===40?M_(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return ft(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 OU(e,t,n){const r=this;return i;function i(o){return D_.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 _U(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 DU={name:"labelStartImage",resolveAll:Ew.resolveAll,tokenize:MU};function MU(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 IU={name:"labelStartLink",resolveAll:Ew.resolveAll,tokenize:LU};function LU(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 b0={name:"lineEnding",tokenize:RU};function RU(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xe(e,t,"linePrefix")}}const hh={name:"thematicBreak",tokenize:FU};function FU(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"),Ke(u)?Xe(e,o,"whitespace")(u):o(u))}}const Zn={continuation:{tokenize:UU},exit:WU,name:"list",tokenize:BU},zU={partial:!0,tokenize:HU},$U={partial:!0,tokenize:VU};function BU(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:_x(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 _x(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(Nd,r.interrupt?n:d,e.attempt(zU,h,f))}function d(p){return r.containerState.initialBlankLine=!0,a++,h(p)}function f(p){return Ke(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 UU(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Nd,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xe(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!Ke(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($U,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xe(e,e.attempt(Zn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function VU(e,t,n){const r=this;return Xe(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 WU(e){e.exit(this.containerState.type)}function HU(e,t,n){const r=this;return Xe(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!Ke(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const hN={name:"setextUnderline",resolveTo:KU,tokenize:GU};function KU(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 GU(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"),Ke(u)?Xe(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Le(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const qU={tokenize:YU};function YU(e){const t=this,n=e.attempt(Nd,r,e.attempt(this.parser.constructs.flowInitial,i,Xe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(eU,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 XU={resolveAll:L_()},ZU=I_("string"),QU=I_("text");function I_(e){return{resolveAll:L_(e==="text"?JU: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 L_(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 JU(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 eV={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:E_},tV={91:aU},nV={[-2]:v0,[-1]:v0,32:v0},rV={35:dU,42:hh,45:[hN,hh],60:mU,61:hN,95:hh,96:dN,126:dN},iV={38:T_,92:A_},aV={[-5]:b0,[-4]:b0,[-3]:b0,33:DU,38:T_,42:Dx,60:[I9,SU],91:IU,92:[cU,A_],93:Ew,95:Dx,96:q9},sV={null:[Dx,XU]},oV={null:[42,95]},lV={null:[]},cV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:oV,contentInitial:tV,disable:lV,document:eV,flow:rV,flowInitial:nV,insideSpan:sV,string:iV,text:aV},Symbol.toStringTag,{value:"Module"}));function uV(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(S),check:N(j),consume:v,enter:w,exit:k,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=Fr(s,_),b(),s[s.length-1]!==null?[]:(P(t,0),u.events=Om(a,u.events,u),u.events)}function h(_,C){return fV(p(_),C)}function p(_){return dV(s,_)}function g(){const{_bufferIndex:_,_index:C,line:A,column:I,offset:$}=r;return{_bufferIndex:_,_index:C,line:A,column:I,offset:$}}function y(_){i[_.line]=_.column,E()}function b(){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;)x(C.charCodeAt(r._bufferIndex));else x(C)}}function x(_){d=d(_)}function v(_){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 k(_){const C=o.pop();return C.end=g(),u.events.push(["exit",C,u]),C}function S(_,C){P(_,C.from)}function j(_,C){C.restore()}function N(_,C){return A;function A(I,$,oe){let Z,M,K,O;return Array.isArray(I)?J(I):"tokenize"in I?J([I]):ie(I);function ie(be){return ne;function ne(ye){const Q=ye!==null&&be[ye],re=ye!==null&&be.null,ve=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(re)?re:re?[re]:[]];return J(ve)(ye)}}function J(be){return Z=be,M=0,be.length===0?oe:D(be[M])}function D(be){return ne;function ne(ye){return O=T(),K=be,be.partial||(u.currentConstruct=be),be.name&&u.parser.constructs.disable.null.includes(be.name)?ee():be.tokenize.call(C?Object.assign(Object.create(u),C):u,c,H,ee)(ye)}}function H(be){return _(K,O),$}function ee(be){return O.restore(),++M<Z.length?D(Z[M]):oe}}}function P(_,C){_.resolveAll&&!a.includes(_)&&a.push(_),_.resolve&&xr(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,I=u.events.length,$=Array.from(o);return{from:I,restore:oe};function oe(){r=_,u.previous=C,u.currentConstruct=A,u.events.length=I,o=$,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function dV(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 fV(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=`
|
|
555
|
+
`;break}case-3:{s=`\r
|
|
556
|
+
`;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 hV(e){const r={constructs:C_([cV,...(e||{}).extensions||[]]),content:i(E9),defined:[],document:i(T9),flow:i(qU),lazy:{},string:i(ZU),text:i(QU)};return r;function i(a){return s;function s(o){return uV(r,a,o)}}}function pV(e){for(;!O_(e););return e}const pN=/[\0\t\n\r]/g;function mV(){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(pN.lastIndex=f,u=pN.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 gV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yV(e){return e.replace(gV,xV)}function xV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return P_(n.slice(a?2:1),a?16:10)}return Pw(n)||e}const R_={}.hasOwnProperty;function vV(e,t,n){return typeof t!="string"&&(n=t,t=void 0),bV(n)(pV(hV(n).document().write(mV()(e,t,!0))))}function bV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Qe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(te),blockQuote:a(re),characterEscape:T,characterReference:T,codeFenced:a(ve),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(ve,s),codeText:a(L,s),codeTextData:T,data:T,codeFlowValue:T,definition:a(W),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(z),hardBreakEscape:a(ae),hardBreakTrailing:a(ae),htmlFlow:a(_e,s),htmlFlowData:T,htmlText:a(_e,s),htmlTextData:T,image:a(We),label:s,link:a(Qe),listItem:a(hn),listItemValue:h,listOrdered:a(Nt,f),listUnordered:a(Nt),paragraph:a(Xt),reference:D,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(te),strong:a(xt),thematicBreak:a(it)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:Q,autolinkProtocol:ye,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:be,characterReference:ne,codeFenced:c(b),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:E,codeIndented:c(x),codeText:c($),codeTextData:E,data:E,definition:c(),definitionDestinationString:k,definitionLabelString:v,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(C),hardBreakTrailing:c(C),htmlFlow:c(A),htmlFlowData:E,htmlText:c(I),htmlTextData:E,image:c(Z),label:K,labelText:M,lineEnding:_,link:c(oe),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:H,resourceDestinationString:O,resourceTitleString:ie,resource:J,setextHeading:c(P),setextHeadingLineSequence:N,setextHeadingText:j,strong:c(),thematicBreak:c()}};F_(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(X){let de={type:"root",children:[]};const Te={stack:[de],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:d,data:n},fe=[];let R=-1;for(;++R<X.length;)if(X[R][1].type==="listOrdered"||X[R][1].type==="listUnordered")if(X[R][0]==="enter")fe.push(R);else{const me=fe.pop();R=i(X,me,R)}for(R=-1;++R<X.length;){const me=t[X[R][0]];R_.call(me,X[R][1].type)&&me[X[R][1].type].call(Object.assign({sliceSerialize:X[R][2].sliceSerialize},Te),X[R][1])}if(Te.tokenStack.length>0){const me=Te.tokenStack[Te.tokenStack.length-1];(me[1]||mN).call(Te,void 0,me[0])}for(de.position={start:_a(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:_a(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},R=-1;++R<t.transforms.length;)de=t.transforms[R](de)||de;return de}function i(X,de,Te){let fe=de-1,R=-1,me=!1,Oe,$e,ht,et;for(;++fe<=Te;){const pt=X[fe];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?R++:R--,et=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(Oe&&!et&&!R&&!ht&&(ht=fe),et=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:et=void 0}if(!R&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||R===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(Oe){let Wt=fe;for($e=void 0;Wt--;){const Ct=X[Wt];if(Ct[1].type==="lineEnding"||Ct[1].type==="lineEndingBlank"){if(Ct[0]==="exit")continue;$e&&(X[$e][1].type="lineEndingBlank",me=!0),Ct[1].type="lineEnding",$e=Wt}else if(!(Ct[1].type==="linePrefix"||Ct[1].type==="blockQuotePrefix"||Ct[1].type==="blockQuotePrefixWhitespace"||Ct[1].type==="blockQuoteMarker"||Ct[1].type==="listItemIndent"))break}ht&&(!$e||ht<$e)&&(Oe._spread=!0),Oe.end=Object.assign({},$e?X[$e][1].start:pt[1].end),X.splice($e||fe,0,["exit",Oe,pt[2]]),fe++,Te++}if(pt[1].type==="listItemPrefix"){const Wt={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};Oe=Wt,X.splice(fe,0,["enter",Wt,pt[2]]),fe++,Te++,ht=void 0,et=!0}}}return X[de][1]._spread=me,Te}function a(X,de){return Te;function Te(fe){o.call(this,X(fe),fe),de&&de.call(this,fe)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(X,de,Te){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([de,Te||void 0]),X.position={start:_a(de.start),end:void 0}}function c(X){return de;function de(Te){X&&X.call(this,Te),u.call(this,Te)}}function u(X,de){const Te=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==X.type&&(de?de.call(this,X,fe[0]):(fe[1]||mN).call(this,X,fe[0]));else throw new Error("Cannot close `"+X.type+"` ("+fu({start:X.start,end:X.end})+"): it’s not open");Te.position.end=_a(X.end)}function d(){return Cw(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(X){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function p(){const X=this.resume(),de=this.stack[this.stack.length-1];de.lang=X}function g(){const X=this.resume(),de=this.stack[this.stack.length-1];de.meta=X}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X.replace(/(\r?\n|\r)$/g,"")}function v(X){const de=this.resume(),Te=this.stack[this.stack.length-1];Te.label=de,Te.identifier=oi(this.sliceSerialize(X)).toLowerCase()}function w(){const X=this.resume(),de=this.stack[this.stack.length-1];de.title=X}function k(){const X=this.resume(),de=this.stack[this.stack.length-1];de.url=X}function S(X){const de=this.stack[this.stack.length-1];if(!de.depth){const Te=this.sliceSerialize(X).length;de.depth=Te}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function N(X){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function T(X){const Te=this.stack[this.stack.length-1].children;let fe=Te[Te.length-1];(!fe||fe.type!=="text")&&(fe=rt(),fe.position={start:_a(X.start),end:void 0},Te.push(fe)),this.stack.push(fe)}function E(X){const de=this.stack.pop();de.value+=this.sliceSerialize(X),de.position.end=_a(X.end)}function _(X){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=de.children[de.children.length-1];Te.position.end=_a(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(T.call(this,X),E.call(this,X))}function C(){this.data.atHardBreak=!0}function A(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X}function I(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X}function $(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X}function oe(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=de,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function Z(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=de,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function M(X){const de=this.sliceSerialize(X),Te=this.stack[this.stack.length-2];Te.label=yV(de),Te.identifier=oi(de).toLowerCase()}function K(){const X=this.stack[this.stack.length-1],de=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const fe=X.children;Te.children=fe}else Te.alt=de}function O(){const X=this.resume(),de=this.stack[this.stack.length-1];de.url=X}function ie(){const X=this.resume(),de=this.stack[this.stack.length-1];de.title=X}function J(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function H(X){const de=this.resume(),Te=this.stack[this.stack.length-1];Te.label=de,Te.identifier=oi(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function ee(X){this.data.characterReferenceType=X.type}function be(X){const de=this.sliceSerialize(X),Te=this.data.characterReferenceType;let fe;Te?(fe=P_(de,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=Pw(de);const R=this.stack[this.stack.length-1];R.value+=fe}function ne(X){const de=this.stack.pop();de.position.end=_a(X.end)}function ye(X){E.call(this,X);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(X)}function Q(X){E.call(this,X);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(X)}function re(){return{type:"blockquote",children:[]}}function ve(){return{type:"code",lang:null,meta:null,value:""}}function L(){return{type:"inlineCode",value:""}}function W(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function z(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function ae(){return{type:"break"}}function _e(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Qe(){return{type:"link",title:null,url:"",children:[]}}function Nt(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[]}}function hn(X){return{type:"listItem",spread:X._spread,checked:null,children:[]}}function Xt(){return{type:"paragraph",children:[]}}function xt(){return{type:"strong",children:[]}}function rt(){return{type:"text",value:""}}function it(){return{type:"thematicBreak"}}}function _a(e){return{line:e.line,column:e.column,offset:e.offset}}function F_(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?F_(e,r):wV(e,r)}}function wV(e,t){let n;for(n in t)if(R_.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 mN(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 SV(e){const t=this;t.parser=n;function n(r){return vV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function kV(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 jV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
557
|
+
`}]}function NV(e,t){const n=t.value?t.value+`
|
|
558
|
+
`:"",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 CV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EV(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 AV(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 TV(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function z_(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 OV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return z_(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 _V(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 DV(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 MV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return z_(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 IV(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 LV(e,t,n){const r=e.all(t),i=n?RV(n):$_(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:`
|
|
559
|
+
`}),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:`
|
|
560
|
+
`});const u={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,u),e.applyData(t,u)}function RV(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=$_(n[r])}return t}function $_(e){const t=e.spread;return t??e.children.length>1}function FV(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 zV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $V(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function BV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UV(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=Sw(t.children[1]),c=v_(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 VV(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 WV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const gN=9,yN=32;function HV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(xN(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(xN(t.slice(i),i>0,!1)),a.join("")}function xN(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===gN||a===yN;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===gN||a===yN;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function KV(e,t){const n={type:"text",value:HV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function GV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const qV={blockquote:kV,break:jV,code:NV,delete:CV,emphasis:PV,footnoteReference:EV,heading:AV,html:TV,imageReference:OV,image:_V,inlineCode:DV,linkReference:MV,link:IV,listItem:LV,list:FV,paragraph:zV,root:$V,strong:BV,table:UV,tableCell:WV,tableRow:VV,text:KV,thematicBreak:GV,toml:bf,yaml:bf,definition:bf,footnoteDefinition:bf};function bf(){}const B_=-1,_m=0,pu=1,tp=2,Aw=3,Tw=4,Ow=5,_w=6,U_=7,V_=8,vN=typeof self=="object"?self:globalThis,YV=(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 _m:case B_:return n(s,i);case pu:{const o=n([],i);for(const c of s)o.push(r(c));return o}case tp:{const o=n({},i);for(const[c,u]of s)o[r(c)]=r(u);return o}case Aw:return n(new Date(s),i);case Tw:{const{source:o,flags:c}=s;return n(new RegExp(o,c),i)}case Ow:{const o=n(new Map,i);for(const[c,u]of s)o.set(r(c),r(u));return o}case _w:{const o=n(new Set,i);for(const c of s)o.add(r(c));return o}case U_:{const{name:o,message:c}=s;return n(new vN[o](c),i)}case V_: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 vN[a](s),i)};return r},bN=e=>YV(new Map,e)(0),Ro="",{toString:XV}={},{keys:ZV}=Object,Tc=e=>{const t=typeof e;if(t!=="object"||!e)return[_m,t];const n=XV.call(e).slice(8,-1);switch(n){case"Array":return[pu,Ro];case"Object":return[tp,Ro];case"Date":return[Aw,Ro];case"RegExp":return[Tw,Ro];case"Map":return[Ow,Ro];case"Set":return[_w,Ro];case"DataView":return[pu,n]}return n.includes("Array")?[pu,n]:n.includes("Error")?[U_,n]:[tp,n]},wf=([e,t])=>e===_m&&(t==="function"||t==="symbol"),QV=(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 _m:{let d=s;switch(c){case"bigint":o=V_,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([B_],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 tp:{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 ZV(s))(e||!wf(Tc(s[h])))&&d.push([a(h),a(s[h])]);return f}case Aw:return i([o,s.toISOString()],s);case Tw:{const{source:d,flags:f}=s;return i([o,{source:d,flags:f}],s)}case Ow:{const d=[],f=i([o,d],s);for(const[h,p]of s)(e||!(wf(Tc(h))||wf(Tc(p))))&&d.push([a(h),a(p)]);return f}case _w:{const d=[],f=i([o,d],s);for(const h of s)(e||!wf(Tc(h)))&&d.push(a(h));return f}}const{message:u}=s;return i([o,{name:c,message:u}],s)};return a},wN=(e,{json:t,lossy:n}={})=>{const r=[];return QV(!(t||n),!!t,new Map,r)(e),r},np=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bN(wN(e,t)):structuredClone(e):(e,t)=>bN(wN(e,t));function JV(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 eW(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function tW(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||JV,r=e.options.footnoteBackLabel||eW,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 v=typeof n=="string"?n:n(c,p);typeof v=="string"&&(v={type:"text",value:v}),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(v)?v:[v]})}const b=d[d.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const v=b.children[b.children.length-1];v&&v.type==="text"?v.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...g)}else d.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,x),o.push(x)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...np(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
561
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
562
|
+
`}]}}const Dm=function(e){if(e==null)return aW;if(typeof e=="function")return Mm(e);if(typeof e=="object")return Array.isArray(e)?nW(e):rW(e);if(typeof e=="string")return iW(e);throw new Error("Expected function, string, or object as test")};function nW(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Dm(e[n]);return Mm(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function rW(e){const t=e;return Mm(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function iW(e){return Mm(t);function t(n){return n&&n.type===e}}function Mm(e){return t;function t(n,r,i){return!!(sW(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function aW(){return!0}function sW(e){return e!==null&&typeof e=="object"&&"type"in e}const W_=[],oW=!0,Mx=!1,lW="skip";function H_(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Dm(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=W_,g,y,b;if((!t||a(c,u,d[d.length-1]||void 0))&&(p=cW(n(c,d)),p[0]===Mx))return p;if("children"in c&&c.children){const x=c;if(x.children&&p[0]!==lW)for(y=(r?x.children.length:-1)+s,b=d.concat(x);y>-1&&y<x.children.length;){const v=x.children[y];if(g=o(v,y,b)(),g[0]===Mx)return g;y=typeof g[1]=="number"?g[1]:y+s}}return p}}}function cW(e){return Array.isArray(e)?e:typeof e=="number"?[oW,e]:e==null?W_:[e]}function Dw(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),H_(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 Ix={}.hasOwnProperty,uW={};function dW(e,t){const n=t||uW,r=new Map,i=new Map,a=new Map,s={...qV,...n.handlers},o={all:u,applyData:hW,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:c,options:n,patch:fW,wrap:mW};return Dw(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(Ix.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,...b}=d,x=np(b);return x.children=o.all(d),x}return np(d)}return(o.options.unknownHandler||pW)(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=SN(g.value)),!Array.isArray(g)&&g.type==="element")){const y=g.children[0];y&&y.type==="text"&&(y.value=SN(y.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function fW(e,t){e.position&&(t.position=e9(e))}function hW(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,np(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function pW(e,t){const n=t.data||{},r="value"in t&&!(Ix.call(n,"hProperties")||Ix.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 mW(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
563
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
564
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
565
|
+
`}),n}function SN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function kN(e,t){const n=dW(e,t),r=n.one(e,void 0),i=tW(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
566
|
+
`},i),a}function gW(e,t){return e&&"run"in e?async function(n,r){const i=kN(n,{file:r,...t});await e.run(i,r)}:function(n,r){return kN(n,{file:r,...e||t})}}function jN(e){if(e)throw e}var ph=Object.prototype.hasOwnProperty,K_=Object.prototype.toString,NN=Object.defineProperty,CN=Object.getOwnPropertyDescriptor,PN=function(t){return typeof Array.isArray=="function"?Array.isArray(t):K_.call(t)==="[object Array]"},EN=function(t){if(!t||K_.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)},AN=function(t,n){NN&&n.name==="__proto__"?NN(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},TN=function(t,n){if(n==="__proto__")if(ph.call(t,n)){if(CN)return CN(t,n).value}else return;return t[n]},yW=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=TN(o,n),i=TN(t,n),o!==i&&(d&&i&&(EN(i)||(a=PN(i)))?(a?(a=!1,s=r&&PN(r)?r:[]):s=r&&EN(r)?r:{},AN(o,{name:n,newValue:e(d,s,i)})):typeof i<"u"&&AN(o,{name:n,newValue:i}));return o};const w0=hi(yW);function Lx(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 xW(){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?vW(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 vW(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:bW,dirname:wW,extname:SW,join:kW,sep:"/"};function bW(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Cd(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 wW(e){if(Cd(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 SW(e){Cd(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 kW(...e){let t=-1,n;for(;++t<e.length;)Cd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":jW(n)}function jW(e){Cd(e);const t=e.codePointAt(0)===47;let n=NW(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function NW(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 Cd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const CW={cwd:PW};function PW(){return"/"}function Rx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function EW(e){if(typeof e=="string")e=new URL(e);else if(!Rx(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 AW(e)}function AW(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 S0=["history","path","basename","stem","extname","dirname"];class G_{constructor(t){let n;t?Rx(t)?n={path:t}:typeof t=="string"||TW(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":CW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<S0.length;){const a=S0[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)S0.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?wi.basename(this.path):void 0}set basename(t){j0(t,"basename"),k0(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){ON(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(k0(t,"extname"),ON(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){Rx(t)&&(t=EW(t)),j0(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){j0(t,"stem"),k0(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 Ln(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 k0(e,t){if(e&&e.includes(wi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wi.sep+"`")}function j0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ON(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function TW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OW=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},_W={}.hasOwnProperty;class Mw extends OW{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=xW()}copy(){const t=new Mw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(w0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(P0("data",this.frozen),this.namespace[t]=n,this):_W.call(this.namespace,t)&&this.namespace[t]||void 0:t?(P0("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=Sf(t),r=this.parser||this.Parser;return N0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),N0("process",this.parser||this.Parser),C0("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const o=Sf(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);IW(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(),N0("processSync",this.parser||this.Parser),C0("processSync",this.compiler||this.Compiler),this.process(t,i),DN("processSync","process",n),r;function i(a,s){n=!0,jN(a),r=s}}run(t,n,r){_N(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=Sf(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),DN("runSync","run",r),i;function a(s,o){jN(s),i=o,r=!0}}stringify(t,n){this.freeze();const r=Sf(n),i=this.compiler||this.Compiler;return C0("stringify",i),_N(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(P0("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=w0(!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];Lx(y)&&Lx(p)&&(p=w0(!0,y,p)),r[h]=[u,p,...g]}}}}const DW=new Mw().freeze();function N0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function C0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function P0(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 _N(e){if(!Lx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function DN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Sf(e){return MW(e)?e:new G_(e)}function MW(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function IW(e){return typeof e=="string"||LW(e)}function LW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const RW="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",MN=[],IN={allowDangerousHtml:!0},FW=/^(https?|ircs?|mailto|xmpp)$/i,zW=[{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 $W(e){const t=BW(e),n=UW(e);return VW(t.runSync(t.parse(n),n),e)}function BW(e){const t=e.rehypePlugins||MN,n=e.remarkPlugins||MN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...IN}:IN;return DW().use(SV).use(n).use(gW,r).use(t)}function UW(e){const t=e.children||"",n=new G_;return typeof t=="string"&&(n.value=t),n}function VW(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||WW;for(const d of zW)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+RW+d.id,void 0);return Dw(e,u),a9(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 x0)if(Object.hasOwn(x0,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],y=x0[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 WW(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||FW.test(e.slice(0,t))?e:""}function LN(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 HW(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function KW(e,t,n){const i=Dm((n||{}).ignore||[]),a=GW(t);let s=-1;for(;++s<a.length;)H_(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 b=f.children.indexOf(u);let x=!1,v=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const k=w.index,S={index:w.index,input:w.input,stack:[...d,u]};let j=p(...w,S);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?h.lastIndex=k+1:(g!==k&&v.push({type:"text",value:u.value.slice(g,k)}),Array.isArray(j)?v.push(...j):j&&v.push(j),g=k+w[0].length,x=!0),!h.global)break;w=h.exec(u.value)}return x?(g<u.value.length&&v.push({type:"text",value:u.value.slice(g)}),f.children.splice(b,1,...v)):v=[u],b+v.length}}function GW(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([qW(i[0]),YW(i[1])])}return t}function qW(e){return typeof e=="string"?new RegExp(HW(e),"g"):e}function YW(e){return typeof e=="function"?e:function(){return e}}const E0="phrasing",A0=["autolink","link","image","label"];function XW(){return{transforms:[rH],enter:{literalAutolink:QW,literalAutolinkEmail:T0,literalAutolinkHttp:T0,literalAutolinkWww:T0},exit:{literalAutolink:nH,literalAutolinkEmail:tH,literalAutolinkHttp:JW,literalAutolinkWww:eH}}}function ZW(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:E0,notInConstruct:A0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:E0,notInConstruct:A0},{character:":",before:"[ps]",after:"\\/",inConstruct:E0,notInConstruct:A0}]}}function QW(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function T0(e){this.config.enter.autolinkProtocol.call(this,e)}function JW(e){this.config.exit.autolinkProtocol.call(this,e)}function eH(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 tH(e){this.config.exit.autolinkEmail.call(this,e)}function nH(e){this.exit(e)}function rH(e){KW(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iH],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),aH]],{ignore:["link","linkReference"]})}function iH(e,t,n,r,i){let a="";if(!q_(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!sH(n)))return!1;const s=oH(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 aH(e,t,n,r){return!q_(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function sH(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 oH(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=LN(e,"(");let a=LN(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 q_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||go(n)||Tm(n))&&(!t||n!==47)}Y_.peek=gH;function lH(){this.buffer()}function cH(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function uH(){this.buffer()}function dH(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function fH(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 hH(e){this.exit(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(){return"["}function Y_(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 yH(){return{enter:{gfmFootnoteCallString:lH,gfmFootnoteCall:cH,gfmFootnoteDefinitionLabelString:uH,gfmFootnoteDefinition:dH},exit:{gfmFootnoteCallString:fH,gfmFootnoteCall:hH,gfmFootnoteDefinitionLabelString:pH,gfmFootnoteDefinition:mH}}}function xH(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Y_},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?`
|
|
567
|
+
`:" ")+a.indentLines(a.containerFlow(r,o.current()),t?X_:vH))),u(),c}}function vH(e,t,n){return t===0?e:X_(e,t,n)}function X_(e,t,n){return(n?"":" ")+e}const bH=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Z_.peek=NH;function wH(){return{canContainEols:["delete"],enter:{strikethrough:kH},exit:{strikethrough:jH}}}function SH(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:bH}],handlers:{delete:Z_}}}function kH(e){this.enter({type:"delete",children:[]},e)}function jH(e){this.exit(e)}function Z_(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 NH(){return"~"}function CH(e){return e.length}function PH(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||CH,a=[],s=[],o=[],c=[];let u=0,d=-1;for(;++d<e.length;){const y=[],b=[];let x=-1;for(e[d].length>u&&(u=e[d].length);++x<e[d].length;){const v=EH(e[d][x]);if(n.alignDelimiters!==!1){const w=i(v);b[x]=w,(c[x]===void 0||w>c[x])&&(c[x]=w)}y.push(v)}s[d]=y,o[d]=b}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)a[f]=RN(r[f]);else{const y=RN(r);for(;++f<u;)a[f]=y}f=-1;const h=[],p=[];for(;++f<u;){const y=a[f];let b="",x="";y===99?(b=":",x=":"):y===108?b=":":y===114&&(x=":");let v=n.alignDelimiters===!1?1:Math.max(1,c[f]-b.length-x.length);const w=b+"-".repeat(v)+x;n.alignDelimiters!==!1&&(v=b.length+v+x.length,v>c[f]&&(c[f]=v),p[f]=v),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],b=o[d];f=-1;const x=[];for(;++f<u;){const v=y[f]||"";let w="",k="";if(n.alignDelimiters!==!1){const S=c[f]-(b[f]||0),j=a[f];j===114?w=" ".repeat(S):j===99?S%2?(w=" ".repeat(S/2+.5),k=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),k=w):k=" ".repeat(S)}n.delimiterStart!==!1&&!f&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||f)&&x.push(" "),n.alignDelimiters!==!1&&x.push(w),x.push(v),n.alignDelimiters!==!1&&x.push(k),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&x.push("|")}g.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
|
|
568
|
+
`)}function EH(e){return e==null?"":String(e)}function RN(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 AH(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()),TH);return i(),s}function TH(e,t,n){return">"+(n?"":" ")+e}function OH(e,t){return FN(e,t.inConstruct,!0)&&!FN(e,t.notInConstruct,!1)}function FN(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function zN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
569
|
+
`&&OH(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
570
|
+
`}function _H(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 DH(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 MH(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 IH(e,t,n,r){const i=MH(n),a=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(DH(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,LH);return f(),h}const o=n.createTracker(r),c=i.repeat(Math.max(_H(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:`
|
|
571
|
+
`,encode:["`"],...o.current()})),f()}return d+=o.move(`
|
|
572
|
+
`),a&&(d+=o.move(a+`
|
|
573
|
+
`)),d+=o.move(c),u(),d}function LH(e,t,n){return(n?"":" ")+e}function Iw(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 RH(e,t,n,r){const i=Iw(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?" ":`
|
|
574
|
+
`,...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 FH(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ku(e){return"&#x"+e.toString(16).toUpperCase()+";"}function rp(e,t,n){const r=Rl(e),i=Rl(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}}Q_.peek=zH;function Q_(e,t,n,r){const i=FH(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=rp(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Ku(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=rp(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+Ku(f));const p=s.move(i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function zH(e,t,n){return n.options.emphasis||"*"}function $H(e,t){let n=!1;return Dw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Mx}),!!((!e.depth||e.depth<3)&&Cw(e)&&(t.options.setext||n))}function BH(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if($H(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...a.current(),before:`
|
|
575
|
+
`,after:`
|
|
576
|
+
`});return f(),d(),h+`
|
|
577
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
578
|
+
`))+1))}const s="#".repeat(i),o=n.enter("headingAtx"),c=n.enter("phrasing");a.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
579
|
+
`,...a.current()});return/^[\t ]/.test(u)&&(u=Ku(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),c(),o(),u}J_.peek=UH;function J_(e){return e.value||""}function UH(){return"<"}e4.peek=VH;function e4(e,t,n,r){const i=Iw(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 VH(){return"!"}t4.peek=WH;function t4(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 WH(){return"!"}n4.peek=HH;function n4(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 HH(){return"`"}function r4(e,t){const n=Cw(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))}i4.peek=KH;function i4(e,t,n,r){const i=Iw(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,c;if(r4(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 KH(e,t,n){return r4(e,n)?"<":"["}a4.peek=GH;function a4(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 GH(){return"["}function Lw(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 qH(e){const t=Lw(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 YH(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 s4(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 XH(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=e.ordered?YH(n):Lw(n);const o=e.ordered?s==="."?")":".":qH(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),s4(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 ZH(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 QH(e,t,n,r){const i=ZH(n);let a=n.bulletCurrent||Lw(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 JH(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(e,r);return a(),i(),s}const eK=Dm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tK(e,t,n,r){return(e.children.some(function(s){return eK(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}o4.peek=rK;function o4(e,t,n,r){const i=nK(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=rp(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Ku(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=rp(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+Ku(f));const p=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function rK(e,t,n){return n.options.strong||"*"}function iK(e,t,n,r){return n.safe(e.value,r)}function aK(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 sK(e,t,n){const r=(s4(n)+(n.options.ruleSpaces?" ":"")).repeat(aK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const l4={blockquote:AH,break:zN,code:IH,definition:RH,emphasis:Q_,hardBreak:zN,heading:BH,html:J_,image:e4,imageReference:t4,inlineCode:n4,link:i4,linkReference:a4,list:XH,listItem:QH,paragraph:JH,root:tK,strong:o4,text:iK,thematicBreak:sK};function oK(){return{enter:{table:lK,tableData:$N,tableHeader:$N,tableRow:uK},exit:{codeText:dK,table:cK,tableData:O0,tableHeader:O0,tableRow:O0}}}function lK(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 cK(e){this.exit(e),this.data.inTable=void 0}function uK(e){this.enter({type:"tableRow",children:[]},e)}function O0(e){this.exit(e)}function $N(e){this.enter({type:"tableCell",children:[]},e)}function dK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,fK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function fK(e,t){return t==="|"?t:e}function hK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
580
|
+
`,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,b){return u(d(p,y,b),p.align)}function o(p,g,y,b){const x=f(p,y,b),v=u([x]);return v.slice(0,v.indexOf(`
|
|
581
|
+
`))}function c(p,g,y,b){const x=y.enter("tableCell"),v=y.enter("phrasing"),w=y.containerPhrasing(p,{...b,before:a,after:a});return v(),x(),w}function u(p,g){return PH(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,y){const b=p.children;let x=-1;const v=[],w=g.enter("table");for(;++x<b.length;)v[x]=f(b[x],g,y);return w(),v}function f(p,g,y){const b=p.children;let x=-1;const v=[],w=g.enter("tableRow");for(;++x<b.length;)v[x]=c(b[x],p,g,y);return w(),v}function h(p,g,y){let b=l4.inlineCode(p,g,y);return y.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function pK(){return{exit:{taskListCheckValueChecked:BN,taskListCheckValueUnchecked:BN,paragraph:gK}}}function mK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:yK}}}function BN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function gK(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 yK(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=l4.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 xK(){return[XW(),yH(),wH(),oK(),pK()]}function vK(e){return{extensions:[ZW(),xH(e),SH(),hK(e),mK()]}}const bK={tokenize:CK,partial:!0},c4={tokenize:PK,partial:!0},u4={tokenize:EK,partial:!0},d4={tokenize:AK,partial:!0},wK={tokenize:TK,partial:!0},f4={name:"wwwAutolink",tokenize:jK,previous:p4},h4={name:"protocolAutolink",tokenize:NK,previous:m4},ba={name:"emailAutolink",tokenize:kK,previous:g4},Bi={};function SK(){return{text:Bi}}let Ps=48;for(;Ps<123;)Bi[Ps]=ba,Ps++,Ps===58?Ps=65:Ps===91&&(Ps=97);Bi[43]=ba;Bi[45]=ba;Bi[46]=ba;Bi[95]=ba;Bi[72]=[ba,h4];Bi[104]=[ba,h4];Bi[87]=[ba,f4];Bi[119]=[ba,f4];function kK(e,t,n){const r=this;let i,a;return s;function s(f){return!Fx(f)||!g4.call(r,r.previous)||Rw(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Fx(f)?(e.consume(f),o):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(wK,d,u)(f):f===45||f===95||On(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&&zn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function jK(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!p4.call(r,r.previous)||Rw(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(bK,e.attempt(c4,e.attempt(u4,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function NK(e,t,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&m4.call(r,r.previous)&&!Rw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(zn(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||ep(f)||ft(f)||go(f)||Tm(f)?n(f):e.attempt(c4,e.attempt(u4,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function CK(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 PK(e,t,n){let r,i,a;return s;function s(u){return u===46||u===95?e.check(d4,c,o)(u):u===null||ft(u)||go(u)||u!==45&&Tm(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 EK(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(d4,t,a)(s):s===null||ft(s)||go(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function AK(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||ft(o)||go(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||ft(o)||go(o)?t(o):r(o)}function a(o){return zn(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):zn(o)?(e.consume(o),s):n(o)}}function TK(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return On(a)?n(a):t(a)}}function p4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ft(e)}function m4(e){return!zn(e)}function g4(e){return!(e===47||Fx(e))}function Fx(e){return e===43||e===45||e===46||e===95||On(e)}function Rw(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 OK={tokenize:zK,partial:!0};function _K(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LK,continuation:{tokenize:RK},exit:FK}},text:{91:{name:"gfmFootnoteCall",tokenize:IK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:DK,resolveTo:MK}}}}function DK(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 MK(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 IK(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||ft(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 ft(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 LK(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||ft(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 ft(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),Xe(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function RK(e,t,n){return e.check(Nd,t,e.attempt(OK,t,n))}function FK(e){e.exit("gfmFootnoteDefinition")}function zK(e,t,n){const r=this;return Xe(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 $K(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&&xr(h,h.length,0,Om(p,s.slice(u+1,c),o)),xr(h,h.length,0,[["exit",f,o],["enter",s[c][1],o],["exit",s[c][1],o],["exit",d,o]]),xr(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=Rl(u);if(g===126)return f>1?c(g):(s.consume(g),f++,p);if(f<2&&!n)return c(g);const b=s.exit("strikethroughSequenceTemporary"),x=Rl(g);return b._open=!x||x===2&&!!y,b._close=!y||y===2&&!!x,o(g)}}}class BK{constructor(){this.map=[]}add(t,n,r){UK(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 UK(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 VK(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 WK(){return{flow:{null:{name:"table",tokenize:HK,resolveAll:KK}}}}function HK(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 I=r.events[_][1].type;if(I==="lineEnding"||I==="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):Ke(E)?Xe(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||ft(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,Ke(E)?Xe(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):g(E))}function g(E){return E===45||E===58?b(E):E===124?(s=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),y):S(E)}function y(E){return Ke(E)?Xe(e,b,"whitespace")(E):b(E)}function b(E){return E===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),x):E===45?(a+=1,x(E)):E===null||Le(E)?k(E):S(E)}function x(E){return E===45?(e.enter("tableDelimiterFiller"),v(E)):S(E)}function v(E){return E===45?(e.consume(E),v):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 Ke(E)?Xe(e,k,"whitespace")(E):k(E)}function k(E){return E===124?g(E):E===null||Le(E)?!s||i!==a?S(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):S(E)}function S(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)):Ke(E)?Xe(e,N,"whitespace")(E):(e.enter("data"),P(E))}function P(E){return E===null||E===124||ft(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 KK(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 BK;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,c!==0&&(UN(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=kf(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=kf(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=kf(h,t,a,i,n,f)):s[1]!==0&&(f=kf(h,t,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(c!==0&&UN(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=VK(t.events,n))}return e}function kf(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 UN(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 GK={name:"tasklistCheck",tokenize:YK};function qK(){return{text:{91:GK}}}function YK(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 ft(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):Ke(c)?e.check({tokenize:XK},t,n)(c):n(c)}}function XK(e,t,n){return Xe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ZK(e){return C_([SK(),_K(),$K(e),WK(),qK()])}const QK={};function JK(e){const t=this,n=e||QK,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ZK(n)),a.push(xK()),s.push(vK(n))}function eG(e){return e.split(/(```[\s\S]*?```|`[^`]+`)/g).map((n,r)=>r%2===1?n:n.replace(new RegExp("(?<=\\w)_(?=\\w)","g"),"\\_")).join("")}function Pd({children:e}){return l.jsx($W,{remarkPlugins:[JK],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:eG(e)})}const tG={cron_success:{icon:Sr,chipLabel:"Scheduled Task",bgClass:"bg-green-100",textClass:"text-green-600",chipBg:"bg-green-50",chipText:"text-green-700"},cron_failure:{icon:Ai,chipLabel:"Scheduled Task",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},cron_result:{icon:Uu,chipLabel:"Scheduled Task",bgClass:"bg-blue-100",textClass:"text-blue-600",chipBg:"bg-blue-50",chipText:"text-blue-700"},vote_up:{icon:e_,chipLabel:"Vote",bgClass:"bg-green-100",textClass:"text-green-600",chipBg:"bg-green-50",chipText:"text-green-700"},vote_down:{icon:JO,chipLabel:"Vote",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},skill_reverted:{icon:Nx,chipLabel:"Skill Reverted",bgClass:"bg-orange-100",textClass:"text-orange-600",chipBg:"bg-orange-50",chipText:"text-orange-700"},skill_approved:{icon:fw,chipLabel:"Approved",bgClass:"bg-green-100",textClass:"text-green-600",chipBg:"bg-green-50",chipText:"text-green-700"},skill_rejected:{icon:QO,chipLabel:"Rejected",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},contribution_rejected:{icon:ys,chipLabel:"Rejected",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},skill_review_requested:{icon:Bu,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"}},nG={icon:iw,chipLabel:"Notification",bgClass:"bg-gray-100",textClass:"text-gray-600",chipBg:"bg-gray-50",chipText:"text-gray-700"};function Fw(e){return tG[e]??nG}const y4=new Set(["cron_success","cron_failure","cron_result"]);function zw(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 rG(e){for(const t of e.split(`
|
|
582
|
+
`)){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 iG({notif:e,onClose:t}){const n=Fw(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:zw(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(Ze,{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(Pd,{children:e.message??""})})})]})]})}const VN=new Set(["skill_approved","skill_rejected","contribution_rejected","skill_reverted"]),_0=new Set(["skill_review_requested","contribution_review_requested"]),aG=300;function WN({notif:e,onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i,nested:a}){var y;const[s,o]=m.useState(!0),c=$i(),u=Fw(e.type),d=u.icon,f=(((y=e.message)==null?void 0:y.length)??0)>aG,h=y4.has(e.type),p=(VN.has(e.type)||_0.has(e.type))&&e.relatedId,g=()=>{e.isRead||t(e.id),_0.has(e.type)&&e.relatedId?(r==null||r(),c("/skills?tab=approvals")):VN.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:zw(e.createdAt)})]}),l.jsx("button",{onClick:b=>{b.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(Ze,{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:rG(e.message)}),l.jsxs("button",{onClick:b=>{b.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(sw,{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:b=>{b.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:b=>{b.stopPropagation(),g()},className:"mt-1 text-[11px] text-primary-600 hover:text-primary-700 font-medium hover:underline",children:[_0.has(e.type)?"Go to Approvals":"View Skill Details"," →"]})]})]})})})}function sG({group:e,onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i}){const[a,s]=m.useState(!1);if(e.notifications.length===1)return l.jsx(WN,{notif:e.notifications[0],onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i});const o=Fw(e.type),c=o.icon,u=y4.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:zw(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(WN,{notif:h,onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i,nested:!0},h.id))})]})}function oG(){const{sendRpc:e,isConnected:t}=$t({onMessage:x=>u(x)}),{notifications:n,unreadCount:r,loadNotifications:i,markRead:a,markAllRead:s,dismissOne:o,dismissAll:c,handleWsEvent:u}=l8(e),[d,f]=m.useState(!1),[h,p]=m.useState(null),g=m.useRef(null),y=m.useCallback(x=>{f(!1),p(x)},[]),b=m.useMemo(()=>o8(n),[n]);return m.useEffect(()=>{t&&i()},[t,i]),m.useEffect(()=>{if(!d)return;const x=v=>{g.current&&!g.current.contains(v.target)&&f(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[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(iw,{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(sr,{className:"w-3 h-3"}),"Clear all"]})]})]}),l.jsx("div",{className:"max-h-[480px] overflow-y-auto",children:b.length===0?l.jsx("div",{className:"py-8 text-center text-sm text-gray-400",children:"No notifications"}):b.map(x=>l.jsx(sG,{group:x,onMarkRead:a,onDelete:o,onClose:()=>f(!1),onShowDetail:y},x.key))})]}),h&&l.jsx(iG,{notif:h,onClose:()=>p(null)})]})}const x4=m.createContext(null),HN="siclaw_workspace_id";function lG({children:e}){const{sendRpc:t,isConnected:n}=$t(),[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(HN),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(HN,d.id)},[]);return m.useEffect(()=>{n&&!o.current&&(o.current=!0,c())},[n,c]),l.jsx(x4.Provider,{value:{workspaces:r,currentWorkspace:a,setCurrentWorkspace:u,reload:c},children:e})}function Ed(){const e=m.useContext(x4);if(!e)throw new Error("useWorkspace must be used within a WorkspaceProvider");return e}const cG=[{icon:Q7,label:"Pilot",to:"/pilot"},{icon:aw,label:"Workspace",to:"/workspace"},{icon:Uu,label:"Cron Jobs",to:"/cron"},{icon:kd,label:"Triggers",to:"/triggers"}],D0=[{icon:pB,label:"Agent",key:"agent",items:[{icon:uw,label:"Skills",to:"/skills"},{icon:jx,label:"MCP",to:"/mcp"}]},{icon:Pm,label:"Settings",key:"settings",items:[{icon:hB,label:"Channels",to:"/channels",adminOnly:!0},{icon:mo,label:"Models",to:"/models",adminOnly:!0},{icon:Ql,label:"Credentials",to:"/credentials"},{icon:hw,label:"Permissions",to:"/permissions",adminOnly:!0},{icon:n_,label:"System",to:"/settings/system",adminOnly:!0}]}];function KN(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 GN={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 uG(){var b;const e=$i(),t=va(),[n,r]=m.useState(Ll()),i=cs(),a=(i==null?void 0:i.username)==="admin",{workspaces:s,currentWorkspace:o,setCurrentWorkspace:c}=Ed(),[u,d]=m.useState(!1),f=m.useRef(null);m.useEffect(()=>{const x=v=>{f.current&&!f.current.contains(v.target)&&d(!1)};return u&&document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[u]);const h=x=>x.items.filter(v=>!v.adminOnly||a).some(v=>t.pathname.startsWith(v.to)),p=KN("agent",h(D0[0])),g=KN("settings",h(D0[1])),y=[p,g];return m.useEffect(()=>{const x=()=>r(Ll());return window.addEventListener("user-profile-updated",x),()=>window.removeEventListener("user-profile-updated",x)},[]),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(GO,{className:"w-5 h-5"})}),l.jsx("span",{className:"font-bold text-gray-900 tracking-tight",children:"Siclaw"})]}),l.jsx(oG,{})]}),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",GN[((b=o==null?void 0:o.configJson)==null?void 0:b.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(x=>{var v;return l.jsxs("button",{onClick:()=>{c(x),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)===x.id&&"bg-indigo-50 text-indigo-700"),children:[l.jsx("span",{className:U("w-2 h-2 rounded-full shrink-0",GN[((v=x.configJson)==null?void 0:v.color)??"indigo"]??"bg-indigo-500")}),l.jsx("span",{className:"truncate",children:x.name}),x.envType==="test"&&l.jsx("span",{className:"text-xs px-1 py-0.5 rounded bg-amber-50 text-amber-600 ml-1",children:"TEST"}),x.isDefault&&l.jsx("span",{className:"text-xs text-gray-400 ml-auto",children:"default"})]},x.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:[cG.map(x=>l.jsxs(p0,{to:x.to,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(x.icon,{className:"w-[18px] h-[18px] stroke-[1.25]"}),x.label]},x.to)),D0.map((x,v)=>{const w=x.items.filter(N=>!N.adminOnly||a);if(w.length===0)return null;const{expanded:k,toggle:S}=y[v],j=h(x);return l.jsxs("div",{className:"pt-2",children:[l.jsxs("button",{onClick:S,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(x.icon,{className:"w-[18px] h-[18px] stroke-[1.25]"}),l.jsx("span",{className:"flex-1",children:x.label}),l.jsx(ua,{className:U("w-3.5 h-3.5 stroke-[1.5] text-gray-400 transition-transform",k&&"rotate-90")})]}),k&&w.map(N=>l.jsxs(p0,{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))]},x.key)})]}),l.jsx("div",{className:"px-3 pb-2",children:l.jsxs(p0,{to:"/metrics",className:({isActive:x})=>U("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-normal transition-all",x?"bg-primary-50 text-primary-700":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:[l.jsx(rw,{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(Pm,{className:"w-4 h-4 text-gray-400 group-hover:text-gray-600"})]})})]})}function dG(){const{sendRpc:e,isConnected:t}=$t(),n=m.useRef(!1);return m.useEffect(()=>{t&&!n.current&&(n.current=!0,r8(e))},[t,e]),l.jsxs("div",{className:"flex h-screen bg-white overflow-hidden",children:[l.jsx(uG,{}),l.jsx("main",{className:"flex-1 flex flex-col relative overflow-hidden bg-white",children:l.jsx(nw,{})})]})}function fG(){return l.jsx(a8,{children:l.jsx(lG,{children:l.jsx(dG,{})})})}const hG=()=>{const{isAuthenticated:e}=Em();return e?l.jsx(nw,{}):l.jsx(dh,{to:"/login",replace:!0})};function pG(){const e=$i(),[t]=bd(),[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 ZB({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(GO,{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(zu,{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(J7,{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(Fe,{className:"w-5 h-5 animate-spin"}):l.jsx(iB,{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 mG(){const e=$i(),[t]=bd(),[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(Fe,{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 gG({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(Hn,{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(In,{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(sr,{className:"w-3 h-3"})})]})]}),l.jsx("p",{className:"text-xs text-gray-500 truncate",children:u.preview||" "})]},u.key)})]})]})}function qN(e){return e<1e3?String(e):e<1e4||e<1e5?(e/1e3).toFixed(1)+"k":Math.round(e/1e3)+"k"}function yG(e){return e<.01?"$"+e.toFixed(3):"$"+e.toFixed(2)}function xG({onSend:e,onAbort:t,disabled:n,isLoading:r,contextUsage:i,isCompacting:a,editingSkill:s,onClearEditSkill:o,skills:c,onEditSkill:u,pendingMessages:d,onRemovePending:f,dpFocus:h,dpActive:p,onSetDpActive:g}){const[y,b]=m.useState(""),[x,v]=m.useState(!1),w=m.useRef(!1),k=p??!1,S=g??(()=>{}),[j,N]=m.useState(!1),[P,T]=m.useState(""),E=m.useRef(null),_=m.useCallback(async()=>{const I=y.trim();if(!I||n)return;let $="";k&&($+=`[Deep Investigation]
|
|
583
|
+
`),s&&($+=`[Skill: ${s.name}]
|
|
584
|
+
`),$+=I,e($.trim()),b("")},[y,n,e,s,k]),C=m.useCallback(I=>{I.key==="Enter"&&!I.shiftKey&&!w.current&&!I.nativeEvent.isComposing&&(I.preventDefault(),_())},[_]),A=y.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",x?"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:[c&&c.length>0&&u&&l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",onClick:()=>{N(!j),T("")},disabled:n,className:U("p-1.5 rounded-lg transition-colors disabled:opacity-50",j?"text-indigo-600 bg-indigo-50":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:"Select skill to edit",children:l.jsx(Ml,{className:"w-4 h-4"})}),j&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>N(!1)}),l.jsxs("div",{className:"absolute bottom-full left-0 mb-1 bg-white rounded-xl shadow-xl border border-gray-200 z-20 w-[280px] max-h-[360px] flex flex-col",children:[l.jsx("div",{className:"px-3 pt-3 pb-2",children:l.jsxs("div",{className:"relative",children:[l.jsx(Hn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400"}),l.jsx("input",{ref:E,type:"text",value:P,onChange:I=>T(I.target.value),placeholder:"Search skills...",className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-1 focus:ring-indigo-300 focus:border-indigo-300",autoFocus:!0})]})}),l.jsx("div",{className:"overflow-y-auto flex-1 pb-2",children:(()=>{const I=P.toLowerCase(),$=c.filter(M=>M.name.toLowerCase().includes(I)||M.description.toLowerCase().includes(I)),oe=[{label:"Personal",scope:"personal"},{label:"Team Skills",scope:"team"},{label:"System Skills",scope:"builtin"}];return $.length>0?oe.map(({label:M,scope:K})=>{const O=$.filter(ie=>ie.scope===K);return O.length===0?null:l.jsxs("div",{children:[l.jsx("div",{className:"px-3 pt-2 pb-1",children:l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:M})}),O.map(ie=>{const J=(s==null?void 0:s.id)===String(ie.id);return l.jsxs("button",{type:"button",className:U("flex flex-col w-full px-3 py-1.5 text-left transition-colors",J?"bg-indigo-50 border-l-2 border-indigo-500":"hover:bg-gray-50 border-l-2 border-transparent"),onClick:()=>{u(String(ie.id),ie.name),N(!1)},children:[l.jsx("span",{className:U("text-sm font-medium truncate",J?"text-indigo-700":"text-gray-700"),children:ie.name}),ie.description&&l.jsx("span",{className:"text-xs text-gray-400 truncate",children:ie.description})]},ie.id)})]},K)}):l.jsx("div",{className:"px-3 py-4 text-center text-sm text-gray-400",children:"No skills found"})})()})]})]})]}),l.jsx("button",{type:"button",onClick:()=>S(!k),disabled:n,className:U("p-1.5 rounded-lg transition-colors disabled:opacity-50",k?"text-blue-600 bg-blue-50":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:k?"Deep Investigation enabled — click to disable":"Enable Deep Investigation",children:l.jsx($u,{className:"w-4 h-4"})}),l.jsx("div",{className:"ml-auto flex items-center gap-3 shrink-0"})]}),(k||s)&&l.jsx("div",{className:"flex flex-wrap gap-2 px-4 pb-1",children:k&&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($u,{className:"w-3.5 h-3.5 text-blue-500"}),l.jsx("span",{children:"Deep Investigation"}),h&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 text-[10px] font-semibold uppercase",children:h.replace(/_/g," ")}),l.jsx("button",{type:"button",className:"ml-0.5 p-0.5 rounded hover:bg-blue-200 transition-colors",onClick:()=>S(!1),children:l.jsx(Ze,{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(Ml,{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(Ze,{className:"w-3 h-3"})})]})}),d&&d.length>0&&l.jsx("div",{className:"flex flex-col gap-1 px-4 pb-1",children:d.map((I,$)=>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:I}),l.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-amber-200 transition-colors shrink-0",onClick:()=>f==null?void 0:f($),title:"Remove this instruction",children:l.jsx(Ze,{className:"w-3 h-3"})})]},$))}),l.jsx("textarea",{value:y,onFocus:()=>v(!0),onBlur:()=>v(!1),onChange:I=>b(I.target.value),onKeyDown:C,onCompositionStart:()=>{w.current=!0},onCompositionEnd:()=>{w.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"}}),r&&y.trim()?l.jsx("button",{onClick:_,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(Vj,{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(mB,{className:"w-5 h-5"})}):l.jsx("button",{onClick:_,disabled:!A||n,className:U("absolute right-3 bottom-3 p-2 rounded-lg transition-all",A&&!n?"bg-primary-600 text-white shadow-md hover:bg-primary-700":"bg-gray-100 text-gray-300 cursor-not-allowed"),children:l.jsx(Vj,{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(Fe,{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:["↑ ",qN(i.inputTokens)]}),l.jsxs("span",{title:`Output: ${i.outputTokens.toLocaleString()} tokens`,children:["↓ ",qN(i.outputTokens)]}),i.cost>0&&l.jsx("span",{title:"API cost this session",children:yG(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 vG({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";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(Ml,{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":"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(Ze,{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(cw,{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(ls,{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(wd,{className:"w-3 h-3"}),"View"]})]})})}async function jf(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 bG({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 k;if(!(!f||!r||!i)){if(!a){o("error"),u("Please select a workspace first");return}o("executing");try{const S=f.action;if(S==="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(S==="update"&&f.schedule){const j=f.name??((k=f.schedule)==null?void 0:k.name)??f.id,N=await jf(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(S==="delete"){const j=await jf(r,f.name??f.id,a);if(!j)throw new Error("Schedule not found");await r("cron.delete",{id:j.id})}else if(S==="pause"||S==="resume"){const j=await jf(r,f.name??f.id,a);if(!j)throw new Error("Schedule not found");await r("cron.setStatus",{id:j.id,status:S==="pause"?"paused":"active"})}else if(S==="rename"){const j=await jf(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(S){o("error"),u((S==null?void 0:S.message)||"Operation failed")}}};if(!f||f.error)return null;const p=f.action,g=p==="rename",y=p==="delete",b=g?`${f.name||f.id} → ${f.newName}`:((w=f.schedule)==null?void 0:w.name)||f.name||f.id||"...",x=()=>{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"}},v=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",v==="saved"&&"border-green-200 bg-green-50/50",v==="dismissed"&&"border-gray-200 bg-gray-50/50 opacity-60",v==="superseded"&&"border-gray-200 bg-gray-50/50 opacity-40",v==="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(ls,{className:U("w-4 h-4 shrink-0",v==="saved"?"text-green-500":v==="dismissed"?"text-gray-400":v==="superseded"?"text-gray-300":s==="error"||y?"text-red-500":"text-amber-500")}),l.jsx("span",{className:U("text-sm font-medium",v==="superseded"?"text-gray-400":"text-gray-800"),children:b}),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(Fe,{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(zu,{className:"w-2.5 h-2.5"}),c]}),s!=="executing"&&s!=="error"&&v==="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"}),x()]}),v==="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(Ze,{className:"w-2.5 h-2.5"}),"Dismissed"]}),v==="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(cw,{className:"w-2.5 h-2.5"}),"Superseded"]}),v!=="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(wd,{className:"w-3 h-3"}),"View"]})]})})}const wG={VALIDATED:"validated",INVALIDATED:"invalidated",INCONCLUSIVE:"inconclusive",PENDING:"pending",SKIPPED:"skipped"};function SG(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],b=p[3],x=parseInt(p[4],10);r.push({id:y,text:b,status:wG[g]??"pending",confidence:x})}if(r.length===0){const g=f.split(`
|
|
585
|
+
`);let y=null;for(const b of g){const x=b.match(/^- .+?\*\*(\w+)\*\*:\s+(.+?)\s+—\s+(\d+)%/);if(x){let v="pending";b.includes("VALIDATED")&&!b.includes("INVALIDATED")?v="validated":b.includes("INVALIDATED")?v="invalidated":b.includes("INCONCLUSIVE")?v="inconclusive":b.includes("SKIPPED")?v="skipped":b.includes("PENDING")&&(v="pending"),y&&r.push(y),y={id:x[1],text:x[2],status:v,confidence:parseInt(x[3],10)}}else b.trim()&&y&&b.startsWith(" ")&&(y.reasoning=b.trim())}y&&r.push(y)}else{const g=f.split(`
|
|
586
|
+
`);let y=-1;for(const b of g)b.startsWith("- ")?y++:b.startsWith(" ")&&b.trim()&&y>=0&&y<r.length&&(r[y].reasoning=b.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 kG(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 M0({status:e,className:t}){const n=U("w-4 h-4 shrink-0",t);switch(e){case"validated":return l.jsx(Sr,{className:U(n,"text-green-500")});case"invalidated":return l.jsx(ys,{className:U(n,"text-red-400")});case"inconclusive":return l.jsx(Ai,{className:U(n,"text-amber-500")});case"skipped":return l.jsx(pw,{className:U(n,"text-gray-400")});case"validating":return l.jsx(Fe,{className:U(n,"text-blue-500 animate-spin")});case"pending":default:return l.jsx(ls,{className:U(n,"text-gray-400")})}}const I0={validated:"VALIDATED",invalidated:"INVALIDATED",inconclusive:"INCONCLUSIVE",pending:"PENDING",skipped:"SKIPPED",validating:"VALIDATING"},jG={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 NG(){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 CG({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,b=()=>{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")},x=s?null:SG(e.content),v=e.toolDetails?kG(e.toolDetails):null,w=((_=e.toolDetails)==null?void 0:_.reportPath)??(x==null?void 0:x.reportPath),k=e.toolInput||"",j=(v??(x==null?void 0:x.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(Hn,{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(NG,{}),l.jsx(Fe,{className:"w-4 h-4 animate-spin text-blue-500"})]})]}),k&&l.jsxs("p",{className:"text-sm text-gray-600 mb-3 line-clamp-2",children:["“",k,"”"]}),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(M0,{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",jG[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"?`${I0[A.status]||A.status} (${A.confidence}%)`:I0[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(Fe,{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||!x)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(Hn,{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(ys,{className:"w-4 h-4 text-red-500 ml-auto shrink-0"})]}),k&&l.jsxs("p",{className:"text-sm text-gray-600 mb-2",children:["“",k,"”"]}),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(Hn,{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(Sr,{className:"w-3 h-3"}),"Done"]})]}),(x==null?void 0:x.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(Pd,{children:x.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(M0,{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(M0,{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:[I0[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,I)=>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})]},I))]}),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=(x==null?void 0:x.stats.toolCalls)??((A=e.toolDetails)==null?void 0:A.totalToolCalls)??0;return C>0?l.jsxs("span",{children:[C," calls"]}):null})(),(()=>{var A;if(x!=null&&x.stats.duration)return l.jsx("span",{children:x.stats.duration});const C=(A=e.toolDetails)==null?void 0:A.durationMs;return C?l.jsxs("span",{children:[(C/1e3).toFixed(1),"s"]}):null})(),(x==null?void 0:x.stats.hypothesesSummary)&&l.jsx("span",{children:x.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"&&b()}}),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:b,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 PG(e){if(!e)return[];const t=e.split(/\n---\s*\n/).filter(a=>a.trim());if(t.length>=2)return t.map((a,s)=>Nf(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)=>Nf(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)=>Nf(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)=>Nf(o.trim(),c+1))}return EG(e)}function Nf(e,t){const n=e.split(`
|
|
587
|
+
`).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 EG(e){const t=[],n=e.split(`
|
|
588
|
+
`);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 AG({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,b=(_=e.toolDetails)==null?void 0:_.hypotheses;let x;if(Array.isArray(b))x=b.map((A,I)=>({index:I+1,title:A.text??`Hypothesis ${I+1}`,confidence:A.confidence,description:A.description,detailLines:[]}));else{const A=b||e.toolInput||"";x=PG(A)}const v=Array.isArray(b)?"":b||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(Hn,{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:[x.length," items"]}),l.jsx("span",{className:"ml-auto text-xs text-gray-400",children:"Superseded"})]})})});const k=y&&((C=e.toolDetails)==null?void 0:C.autoConfirmed)===!0,S=y&&!g&&!s&&!k&&!w,j=()=>{r&&x.length>0&&r(x.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(Hn,{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&&(k||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(Sr,{className:"w-3 h-3"}),"Confirmed"]}),y&&!k&&!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"})]}),x.length>0?l.jsx("div",{className:"space-y-1 mb-3",children:x.map(A=>{const I=d===A.index,$=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",$?"hover:bg-indigo-100/60 cursor-pointer":"cursor-default",I&&"bg-indigo-100/60"),onClick:()=>$&&E(A.index),children:[$?l.jsx(ua,{className:U("w-3 h-3 text-gray-400 shrink-0 transition-transform",I&&"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,"%"]})]}),I&&$&&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((oe,Z)=>l.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:oe},Z))]})]},A.index)})}):l.jsx("div",{className:"mb-3 text-sm text-gray-600",children:l.jsx(Pd,{children:v})}),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(dB,{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(Ze,{className:"w-3.5 h-3.5"})})]}),S&&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(Cm,{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(Nm,{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(Ze,{className:"w-3 h-3"}),"Cancel"]})]})]})})}function TG({status:e}){return e==="done"?l.jsx(Sr,{className:"w-4 h-4 text-green-500 shrink-0 mt-0.5"}):e==="in_progress"?l.jsx(Fe,{className:"w-4 h-4 text-blue-500 animate-spin shrink-0 mt-0.5"}):e==="skipped"?l.jsx(pw,{className:"w-3.5 h-3.5 text-gray-400 shrink-0 mt-0.5"}):e==="error"?l.jsx(ys,{className:"w-4 h-4 text-red-500 shrink-0 mt-0.5"}):l.jsx(KO,{className:"w-4 h-4 text-gray-300 shrink-0 mt-0.5"})}function OG({status:e}){const t="w-3.5 h-3.5 shrink-0";switch(e){case"validated":return l.jsx(Sr,{className:U(t,"text-green-500")});case"invalidated":return l.jsx(ys,{className:U(t,"text-red-400")});case"inconclusive":return l.jsx(Ai,{className:U(t,"text-amber-500")});case"validating":return l.jsx(Fe,{className:U(t,"text-blue-500 animate-spin")});case"skipped":return l.jsx(pw,{className:U(t,"text-gray-400")});default:return l.jsx(ls,{className:U(t,"text-gray-300")})}}function _G({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 YN={validated:"text-green-600",invalidated:"text-red-500",inconclusive:"text-amber-600",validating:"text-blue-500",pending:"text-gray-400",skipped:"text-gray-400"},DG={validated:"VALIDATED",invalidated:"INVALIDATED",inconclusive:"INCONCLUSIVE",validating:"validating...",pending:"pending",skipped:"SKIPPED"};function MG({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(OG,{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",YN[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(_G,{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",YN[e.status]),children:[DG[e.status],e.callsUsed>0&&` · ${e.callsUsed} calls`]})]})]})}function IG({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($u,{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(Ze,{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(TG,{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(MG,{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(Fe,{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 LG=[{icon:Ml,title:"Skills",description:"Reusable diagnostic scripts for common SRE tasks"},{icon:$u,title:"Deep Investigation",description:"Hypothesis-driven root cause analysis with evidence"},{icon:mo,title:"Memory",description:"Remembers findings and context across sessions"},{icon:Uu,title:"Scheduled Jobs",description:"Automated health checks on a cron schedule"}],RG=["Check my cluster health","List available skills","What happened since my last session?"],XN="Introduce yourself and help me get started",FG={kubeconfig:"Kubeconfig",ssh_password:"SSH",ssh_key:"SSH Key",api_token:"API Token",api_basic_auth:"API Auth"};function zG({systemStatus:e,onSendPrompt:t,onNavigateModels:n,onNavigateCredentials:r}){const i=(e==null?void 0:e.hasProfile)===!1,a=(e==null?void 0:e.hasModels)??!1,s=(e==null?void 0:e.credentials)??{},o=Object.keys(s).length>0,c=(e==null?void 0:e.sessionCount)??0,u=a&&o&&c>0,d=f=>{if(!a){n();return}t(f)};return l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 max-w-2xl mx-auto space-y-8",children:[i&&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&&!u&&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.jsxs("div",{className:"space-y-2",children:[l.jsx(L0,{step:1,done:a,label:"Configure AI Model",subtitle:"Add a model provider to start chatting",onClick:n}),l.jsx(L0,{step:2,done:o,label:"Add Credentials",subtitle:"Connect to your clusters and servers via SSH or Kubeconfig",onClick:r}),l.jsx(L0,{step:3,done:c>0,label:"Start your first conversation",subtitle:"Ask Siclaw to diagnose an issue or run a skill"})]})]}),i&&l.jsx("div",{className:"w-full grid grid-cols-2 gap-3",children:LG.map(f=>l.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm p-4 space-y-1.5",children:[l.jsx(f.icon,{className:"w-5 h-5 text-gray-400"}),l.jsx("p",{className:"text-sm font-medium text-gray-700",children:f.title}),l.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:f.description})]},f.title))}),u&&o&&l.jsx($G,{credentials:s}),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:[i&&l.jsx("button",{onClick:()=>d(XN),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:XN}),RG.map(f=>l.jsx("button",{onClick:()=>d(f),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:f},f))]}),!a&&l.jsx("p",{className:"text-xs text-center text-amber-600",children:"Configure a model first to start chatting"})]})]})}function L0({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(Sr,{className:"w-5 h-5 text-green-500 mt-0.5 shrink-0"}):l.jsx(KO,{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(WO,{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 $G({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:[FG[n]||n," ×",r]},n))})]})}function BG(e){const t=new Map,n=new Map;for(const r of e){if(r.role!=="tool"||r.toolName!=="create_skill"&&r.toolName!=="update_skill")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 UG(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 VG({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:b,onSkillSaved:x,onOpenSkillPanel:v,onOpenSchedulePanel:w,panelMessage:k,updateMessageMeta:S,pendingMessages:j,onRemovePending:N,investigationProgress:P,dpActive:T,onSetDpActive:E,dpFocus:_,dpChecklist:C,onHypothesesConfirmed:A,onExitDp:I,systemStatus:$,onNavigateModels:oe,onNavigateCredentials:Z,sessionKey:M,selectedWorkspaceId:K}){const O=m.useRef(null),ie=m.useRef(null),J=m.useRef(0),D=m.useRef(0),H=m.useRef(!1),ee=m.useRef(!1),be=m.useRef(!1),ne=m.useRef(null),ye=m.useRef(M);m.useEffect(()=>{ye.current!==M&&(ye.current=M,H.current=!1,D.current=0,ee.current=!0,be.current=!0,ne.current&&(clearTimeout(ne.current),ne.current=null))},[M]),m.useEffect(()=>()=>{ne.current&&clearTimeout(ne.current)},[]);const Q=m.useCallback((te=!0)=>{requestAnimationFrame(()=>{var ae;(ae=O.current)==null||ae.scrollIntoView(te?{behavior:"smooth"}:void 0)})},[]),re=m.useMemo(()=>BG(e),[e]),ve=m.useMemo(()=>UG(e),[e]),L=m.useMemo(()=>{for(let te=e.length-1;te>=0;te--)if(e[te].toolName==="propose_hypotheses"&&!e[te].isStreaming)return e[te].id;return null},[e]),W=m.useMemo(()=>{if(!L)return!1;const te=e.findIndex(_e=>_e.id===L);if(te<0)return!1;const ae=e.slice(te+1);return!!(ae.some(_e=>_e.toolName==="deep_search")||ae.some(_e=>_e.role==="user"&&_e.content.includes("confirmed hypotheses"))||C!=null&&C.some(_e=>_e.id==="deep_search"&&(_e.status==="in_progress"||_e.status==="done")))},[e,L,C]);m.useEffect(()=>{const te=ie.current;if(te){if(J.current){const ae=te.scrollHeight-J.current;ae>0&&(te.scrollTop+=ae),J.current=0}else if(ee.current&&e.length>0)ee.current=!1,H.current=!1,Q(!1);else if(D.current===0&&e.length>0)H.current=!1,Q(!1);else if(e.length>D.current){const ae=e[e.length-1];(ae==null?void 0:ae.role)==="user"?(H.current=!1,Q(!1)):H.current||Q(!0)}else H.current||Q(!0);D.current=e.length}},[e,Q]),m.useEffect(()=>{if(be.current){if(H.current){be.current=!1,ne.current&&(clearTimeout(ne.current),ne.current=null);return}e.length!==0&&(Q(!1),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(()=>{be.current=!1,ne.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,Q]);const z=m.useCallback(()=>{const te=ie.current;if(!te)return;const{scrollTop:ae,scrollHeight:_e,clientHeight:We}=te,Qe=_e-ae-We;H.current=Qe>300,H.current&&(be.current=!1,ne.current&&(clearTimeout(ne.current),ne.current=null)),!(!a||s||!u)&&te.scrollTop<80&&(J.current=te.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(gw,{className:"w-3 h-3"}):r==="connecting"?l.jsx(Fe,{className:"w-3 h-3 animate-spin"}):l.jsx(yB,{className:"w-3 h-3"}),l.jsx("span",{children:i?"Connected":r==="connecting"?"Connecting...":"Disconnected"})]})}),l.jsx("div",{ref:ie,className:"flex-1 overflow-y-auto px-4 lg:px-8 py-8",onScroll:z,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(Fe,{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(zG,{systemStatus:$??null,onSendPrompt:o,onNavigateModels:oe??(()=>{}),onNavigateCredentials:Z??(()=>{})}):l.jsxs(l.Fragment,{children:[s&&l.jsx("div",{className:"flex justify-center py-2",children:l.jsx(Fe,{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(te=>!te.hidden).map(te=>l.jsx(GG,{message:te,sendRpc:d,skills:p,editingSkill:g,onEditSkill:y,onSkillSaved:x,skillStatus:re.get(te.id),scheduleStatus:ve.get(te.id),onOpenSkillPanel:v,onOpenSchedulePanel:w,updateMessageMeta:S,isInPanel:(k==null?void 0:k.id)===te.id,investigationProgress:P,sendMessage:o,abortResponse:c,dpFocus:_,dpChecklistActive:C!=null&&C.length>0,onHypothesesConfirmed:A,hypothesesSuperseded:L!=null&&te.toolName==="propose_hypotheses"&&te.id!==L,hypothesesAlreadyConfirmed:te.id===L&&W,selectedWorkspaceId:K},te.id)),C&&C.length>0&&l.jsx(IG,{items:C,investigationProgress:P,onDismiss:I}),t&&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(Fe,{className:"w-4 h-4 animate-spin"}),l.jsx("span",{className:"text-sm",children:"Thinking..."})]})]})]}),l.jsx("div",{ref:O})]})}),l.jsx(xG,{onSend:o,onAbort:c,disabled:!i,isLoading:t,contextUsage:f,isCompacting:h,editingSkill:g,onClearEditSkill:b,skills:p,onEditSkill:y,pendingMessages:j,onRemovePending:N,dpFocus:_,dpActive:T,onSetDpActive:E})]})}function WG(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 HG(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 KG(e){const t=e.match(/\[Deep Investigation\]\n*/);return t?{isDeepInvestigation:!0,text:e.replace(t[0],"").trim()}:{isDeepInvestigation:!1,text:e}}function GG({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:b,selectedWorkspaceId:x}){const v=e.role==="user";if(e.role==="tool")return(e.toolName==="create_skill"||e.toolName==="update_skill")&&!e.isStreaming?l.jsx(vG,{message:e,status:r??"pending",onOpenPanel:a}):e.toolName==="manage_schedule"&&!e.isStreaming?l.jsx(bG,{message:e,status:i??"pending",onOpenPanel:s,sendRpc:o,updateMessageMeta:c,selectedWorkspaceId:x}):e.toolName==="deep_search"?e.isStreaming&&(h||p)?null:l.jsx(CG,{message:e,progress:e.isStreaming?u:void 0,sendMessage:d,updateMessageMeta:c}):e.toolName==="propose_hypotheses"&&!e.isStreaming?l.jsx(AG,{message:e,sendMessage:d,abortResponse:f,onHypothesesConfirmed:g,superseded:y,alreadyConfirmed:b}):l.jsx(qG,{message:e,skills:t,onEditSkill:n});const{isDeepInvestigation:k,text:S}=v?KG(e.content):{isDeepInvestigation:!1,text:e.content},{scripts:j,text:N}=v?WG(S):{scripts:[],text:S},{skillName:P,text:T}=v?HG(N):{skillName:null,text:N};return l.jsxs("div",{className:U("flex gap-4 group",v?"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",v?"bg-primary-600 border-primary-600 text-white":"bg-white border-gray-200 text-primary-600"),children:v?l.jsx(Vu,{className:"w-4 h-4"}):l.jsx(mo,{className:"w-5 h-5"})}),l.jsxs("div",{className:U("flex flex-col min-w-0",v?"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:v?"You":"Siclaw"}),l.jsx("span",{className:"text-xs text-gray-400",children:e.timestamp}),e.isStreaming&&!v&&l.jsx(Fe,{className:"w-3 h-3 animate-spin text-gray-400"})]}),(k||P||j.length>0)&&l.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:[k&&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($u,{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})]}),P&&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(Ml,{className:"w-3.5 h-3.5 text-indigo-500"}),l.jsx("span",{children:P})]}),j.map((E,_)=>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:[E.lang==="python"?l.jsx(Ga,{className:"w-3.5 h-3.5 text-blue-600"}):l.jsx(si,{className:"w-3.5 h-3.5 text-green-600"}),l.jsx("span",{children:E.name})]},_))]}),T&&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",v?"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(Pd,{children:T})})]})]})}function qG({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(si,{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(Fe,{className:"w-3 h-3 animate-spin text-blue-400 ml-auto shrink-0"}),e.toolStatus==="success"&&l.jsx(Sr,{className:"w-3.5 h-3.5 text-green-500 ml-auto shrink-0"}),e.toolStatus==="error"&&l.jsx(ys,{className:"w-3.5 h-3.5 text-red-500 ml-auto shrink-0"}),e.toolStatus==="aborted"&&l.jsx(HO,{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(Sd,{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 YG{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=v=>{if(v=this.postProcess(v,r),i){setTimeout(function(){i(v)},0);return}else return v},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,b=1/0;const x=()=>{for(let v=Math.max(y,-u);v<=Math.min(b,u);v+=2){let w;const k=p[v-1],S=p[v+1];k&&(p[v-1]=void 0);let j=!1;if(S){const P=S.oldPos-v;j=S&&0<=P&&P<o}const N=k&&k.oldPos+1<c;if(!j&&!N){p[v]=void 0;continue}if(!N||j&&k.oldPos<S.oldPos?w=this.addToPath(S,!0,!1,0,r):w=this.addToPath(k,!1,!0,1,r),g=this.extractCommon(w,n,t,v,r),w.oldPos+1>=c&&g+1>=o)return s(this.buildValues(w.lastComponent,n,t))||!0;p[v]=w,w.oldPos+1>=c&&(b=Math.min(b,v-1)),g+1>=o&&(y=Math.max(y,v+1))}u++};if(i)(function v(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);x()||v()},0)})();else for(;u<=d&&Date.now()<=h;){const v=x();if(v)return v}}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 XG extends YG{constructor(){super(...arguments),this.tokenize=QG}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
589
|
+
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
590
|
+
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
591
|
+
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
592
|
+
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const ZG=new XG;function zx(e,t,n){return ZG.diff(e,t,n)}function QG(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
593
|
+
`));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 JG({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,b]=m.useState(d==="saved"?"Saved":""),[x,v]=m.useState(u),[w,k]=m.useState(null),[S,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",I=e.toolName==="fork_skill"||!!(_!=null&&_.fork),$=C?n.find(ne=>ne.name===C.name&&ne.scope==="personal")??n.find(ne=>ne.name===C.name)??(_!=null&&_.skillId?n.find(ne=>ne.name===_.skillId&&ne.scope==="personal")??n.find(ne=>ne.name===_.skillId):void 0):void 0,oe=I?n.find(ne=>ne.name===((_==null?void 0:_.sourceSkillName)??(C==null?void 0:C.name))&&ne.scope!=="personal")??n.find(ne=>ne.name===((_==null?void 0:_.sourceSkillName)??(C==null?void 0:C.name))):void 0,Z=$?String($.id):(_==null?void 0:_.skillId)||void 0,M=!A&&!I?$:void 0,K=!!M;m.useEffect(()=>{(c==="saved"||c==="dismissed")&&(h("saved"),b(c==="saved"?"Saved":"Dismissed"))},[c]),m.useEffect(()=>{const ne=A?Z:I&&oe?String(oe.id):void 0;!ne||!t||(j(!0),t("skill.get",{id:ne}).then(ye=>{k(ye.files??null)}).catch(()=>k(null)).finally(()=>j(!1)))},[A,I,Z,oe,t]);const O=A||I&&!!w,ie=m.useMemo(()=>{if(!O||!(C!=null&&C.specs)||!(w!=null&&w.specs))return null;const ne=zx(w.specs??"",C.specs??"");return ne.every(ye=>!ye.added&&!ye.removed)?null:ne},[O,C==null?void 0:C.specs,w==null?void 0:w.specs]),J=m.useMemo(()=>{if(!O||!(C!=null&&C.scripts))return null;const ne=new Map(((w==null?void 0:w.scripts)??[]).map(Q=>[Q.name,Q.content])),ye=[];for(const Q of C.scripts){const re=ne.get(Q.name);if(!re)ye.push({name:Q.name,status:"new"});else{const ve=zx(re??"",Q.content??""),L=ve.some(W=>W.added||W.removed);ye.push({name:Q.name,status:L?"changed":"unchanged",changes:L?ve:void 0})}}return ye},[A,C==null?void 0:C.scripts,w==null?void 0:w.scripts]),D=A&&ie===null&&(J==null?void 0:J.every(ne=>ne.status==="unchanged")),H=()=>{if(!C)return"";let ne=2,ye=`${C.name}-${ne}`;for(;n.some(Q=>Q.name===ye);)ne++,ye=`${C.name}-${ne}`;return ye},ee=async ne=>{var ye;if(C){h("saving"),g(""),b("");try{const Q=(ye=C.scripts)==null?void 0:ye.map(ve=>({name:ve.name,content:ve.content}));let re;if(I&&ne!=="create-new-name"){const ve=oe?String(oe.id):void 0;if(!ve)throw new Error(`Source skill "${(_==null?void 0:_.sourceSkillName)??C.name}" not found`);re=(await t("skill.fork",{sourceId:ve,name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Q})).reviewStatus,b("Forked to Personal")}else if(ne==="update")$&&$.scope!=="personal"?(re=(await t("skill.fork",{sourceId:String($.id),name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Q})).reviewStatus,b("Saved to Personal")):(re=(await t("skill.update",{id:Z,name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Q})).reviewStatus,b("Updated"));else if(ne==="update-existing"&&M)M.scope==="personal"?(re=(await t("skill.update",{id:String(M.id),name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Q})).reviewStatus,b("Updated")):(re=(await t("skill.fork",{sourceId:String(M.id),name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Q})).reviewStatus,b("Saved to Personal"));else if(ne==="create-new-name"){const ve=H();re=(await t("skill.create",{name:ve,description:C.description,type:C.type,specs:C.specs,scripts:Q})).reviewStatus,b(`Saved as "${ve}"`)}else re=(await t("skill.create",{name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Q})).reviewStatus,b("Saved");v(re),h("saved"),await s(e.id,{skillCard:"saved",reviewStatus:re}),r(e)}catch(Q){h("error"),g((Q==null?void 0:Q.message)||"Failed to save skill")}}},be=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(Ml,{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(mw,{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(Ze,{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:S?l.jsxs("div",{className:"flex items-center justify-center py-12 text-gray-400",children:[l.jsx(Fe,{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&&ie&&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&&ie?l.jsx(ZN,{changes:ie}):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((ne,ye)=>{const Q=J==null?void 0:J[ye],re=N.has(ne.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(ve=>{const L=new Set(ve);return L.has(ne.name)?L.delete(ne.name):L.add(ne.name),L}),children:[l.jsx(ua,{className:U("w-3 h-3 text-gray-400 transition-transform",re&&"rotate-90")}),ne.name.endsWith(".py")?l.jsx(Ga,{className:"w-3.5 h-3.5 text-blue-500"}):l.jsx(si,{className:"w-3.5 h-3.5 text-green-500"}),l.jsx("span",{className:"text-xs font-mono text-gray-700",children:ne.name}),Q&&l.jsx("span",{className:U("ml-auto text-[10px] font-medium px-1.5 py-0.5 rounded",Q.status==="new"?"text-green-600 bg-green-50":Q.status==="changed"?"text-amber-600 bg-amber-50":"text-gray-400 bg-gray-50"),children:Q.status})]}),re&&l.jsx("div",{className:"px-4 pb-3 max-h-64 overflow-y-auto",children:Q!=null&&Q.changes?l.jsx(ZN,{changes:Q.changes}):l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-gray-600 whitespace-pre-wrap",children:ne.content})})]},ne.name)})]})]})}),f==="idle"&&K&&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(Ai,{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 ",M.scope," skill named ",l.jsxs("strong",{children:['"',C.name,'"']})," already exists."]})]}),f==="saved"&&x==="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(jm,{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 environments. Request publish to use in production."})]}),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:be,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(I&&oe){const ne=n.some(ye=>ye.name===C.name&&ye.scope==="personal");return l.jsxs("button",{onClick:()=>ee(ne?"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(ow,{className:"w-3.5 h-3.5"}),"Fork to Personal"]})}if(A&&Z){const ne=$&&$.scope!=="personal";return l.jsx("button",{onClick:()=>ee("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:ne?l.jsxs(l.Fragment,{children:[l.jsx(kx,{className:"w-3.5 h-3.5"})," Save to Personal"]}):l.jsxs(l.Fragment,{children:[l.jsx(Wn,{className:"w-3.5 h-3.5"})," Update Skill"]})})}return K?l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>ee("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:M.scope==="personal"?l.jsxs(l.Fragment,{children:[l.jsx(Wn,{className:"w-3.5 h-3.5"})," Update Existing"]}):l.jsxs(l.Fragment,{children:[l.jsx(kx,{className:"w-3.5 h-3.5"})," Save to Personal"]})}),l.jsx("button",{onClick:()=>ee("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:()=>ee("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(Wn,{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(Fe,{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(zu,{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(Ze,{className:"w-4 h-4 text-gray-400"})})]})})}function ZN({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 eq({message:e,sendRpc:t,onSave:n,onDismiss:r,onClose:i,updateMessageMeta:a,selectedWorkspaceId:s}){var H;const o=(H=e.metadata)==null?void 0:H.scheduleCard,c=o==="saved"||o==="dismissed"?"saved":"idle",[u,d]=m.useState(c),[f,h]=m.useState(""),[p,g]=m.useState(null),[y,b]=m.useState(!1),[x,v]=m.useState(!0),[w,k]=m.useState(!0);let S=null;try{S=JSON.parse(e.content)}catch{}const j=S==null?void 0:S.action,N=S==null?void 0:S.schedule,P=j==="create",T=j==="update",E=j==="delete",_=j==="pause",C=j==="resume",A=j==="rename",I=A?(S==null?void 0:S.name)||(S==null?void 0:S.id)||"...":(N==null?void 0:N.name)||(S==null?void 0:S.name)||(S==null?void 0:S.id)||"...";m.useEffect(()=>{(o==="saved"||o==="dismissed")&&d("saved")},[o]);const $=m.useRef(!1);m.useEffect(()=>{if($.current||u!=="idle")return;const ee=e.metadata;ee!=null&&ee.scheduleCard||(_||C)&&($.current=!0,O())},[_,C,u]),m.useEffect(()=>{!T||!t||(b(!0),Oc(t,S==null?void 0:S.id,(S==null?void 0:S.name)??(N==null?void 0:N.name)).then(ee=>g(ee)).catch(()=>g(null)).finally(()=>b(!1)))},[T,S==null?void 0:S.id,S==null?void 0:S.name,N==null?void 0:N.name,t]);const oe=T&&p&&N&&p.schedule!==N.schedule,Z=T&&p&&N&&p.status!==N.status,M=m.useMemo(()=>{if(!T||!p||!N)return null;const ee=p.description??"",be=N.description??"";if(ee===be)return null;const ne=zx(ee,be);return ne.every(ye=>!ye.added&&!ye.removed)?null:ne},[T,p,N]),K=T&&p&&!oe&&!Z&&!M,O=async()=>{if(S){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 ee=await Oc(t,S.id,S.name);if(!ee)throw new Error("Schedule not found");await t("cron.save",{id:ee.id,name:N.name,description:N.description,schedule:N.schedule,status:N.status||"active",workspaceId:s??null})}else if(E){const ee=await Oc(t,S.id,S.name);if(!ee)throw new Error("Schedule not found");await t("cron.delete",{id:ee.id})}else if(_||C){const ee=await Oc(t,S.id,S.name);if(!ee)throw new Error("Schedule not found");await t("cron.setStatus",{id:ee.id,status:_?"paused":"active"})}else if(A){const ee=await Oc(t,S.id,S.name);if(!ee)throw new Error("Schedule not found");await t("cron.rename",{id:ee.id,newName:S.newName})}d("saved"),await a(e.id,{scheduleCard:"saved"}),n(e)}catch(ee){d("error"),h((ee==null?void 0:ee.message)||"Operation failed")}}},ie=async()=>{await a(e.id,{scheduleCard:"dismissed"}),r(e)};if(!S||S.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(Ze,{className:"w-4 h-4 text-gray-400"})})]})});const J=tq(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",J.gradient),children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(ls,{className:U("w-4 h-4 shrink-0",J.iconColor)}),l.jsx("span",{className:"font-semibold text-sm text-gray-900 truncate",children:I})]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-white/60 transition-colors shrink-0",children:l.jsx(Ze,{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(Fe,{className:U("w-8 h-8 mb-3 animate-spin",J.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(zu,{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(""),$.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(Fe,{className:U("w-8 h-8 mb-3 animate-spin",J.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",J.gradient),children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(ls,{className:U("w-4 h-4 shrink-0",J.iconColor)}),l.jsx("span",{className:"font-semibold text-sm text-gray-900 truncate",children:I}),l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium shrink-0",J.badgeColor),children:[l.jsx(mw,{className:"w-2.5 h-2.5"}),J.badge]})]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-white/60 transition-colors shrink-0",children:l.jsx(Ze,{className:"w-4 h-4 text-gray-500"})})]}),S.summary&&l.jsx("div",{className:"px-4 py-2 border-b border-gray-100 text-xs text-gray-600",children:S.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(Fe,{className:"w-5 h-5 animate-spin mr-2"}),l.jsx("span",{className:"text-sm",children:"Loading current version..."})]}):K?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:()=>v(!x),children:[l.jsx(ua,{className:U("w-3.5 h-3.5 text-gray-400 transition-transform",x&&"rotate-90")}),l.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Schedule"}),T&&(oe||Z)&&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"})]}),x&&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&&oe&&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&&Z&&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:(S==null?void 0:S.name)||(S==null?void 0:S.id)}),l.jsx("div",{className:"text-xs bg-green-50 text-green-700 px-2 py-1 rounded",children:S==null?void 0:S.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:()=>k(!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"}),M&&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:M?l.jsx(nq,{changes:M}):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(J.Icon,{className:U("w-8 h-8 mb-3",J.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:ie,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"&&!K&&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",J.btnClass),children:[l.jsx(J.Icon,{className:"w-3.5 h-3.5"}),J.label]}),u==="idle"&&K&&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(Fe,{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(zu,{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 tq(e){switch(e){case"delete":return{label:"Delete Schedule",Icon:sr,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:dw,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:Cm,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:Sd,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:Wn,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:Wn,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 nq({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 $w=m.createContext({});function Bw(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Im=m.createContext(null),Uw=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class rq 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 iq({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(Uw);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(`
|
|
594
|
+
[data-motion-pop-id="${n}"] {
|
|
595
|
+
position: absolute !important;
|
|
596
|
+
width: ${s}px !important;
|
|
597
|
+
height: ${o}px !important;
|
|
598
|
+
top: ${c}px !important;
|
|
599
|
+
left: ${u}px !important;
|
|
600
|
+
}
|
|
601
|
+
`),()=>{document.head.removeChild(d)}},[t]),l.jsx(rq,{isPresent:t,childRef:r,sizeRef:i,children:m.cloneElement(e,{ref:r})})}const aq=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s})=>{const o=Bw(sq),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(iq,{isPresent:n,children:e})),l.jsx(Im.Provider,{value:d,children:e})};function sq(){return new Map}function v4(e=!0){const t=m.useContext(Im);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 Cf=e=>e.key||"";function QN(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const Vw=typeof window<"u",b4=Vw?m.useLayoutEffect:m.useEffect,li=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:s=!1})=>{const[o,c]=v4(s),u=m.useMemo(()=>QN(e),[e]),d=s&&!o?[]:u.map(Cf),f=m.useRef(!0),h=m.useRef(u),p=Bw(()=>new Map),[g,y]=m.useState(u),[b,x]=m.useState(u);b4(()=>{f.current=!1,h.current=u;for(let k=0;k<b.length;k++){const S=Cf(b[k]);d.includes(S)?p.delete(S):p.get(S)!==!0&&p.set(S,!1)}},[b,d.length,d.join("-")]);const v=[];if(u!==g){let k=[...u];for(let S=0;S<b.length;S++){const j=b[S],N=Cf(j);d.includes(N)||(k.splice(S,0,j),v.push(j))}a==="wait"&&v.length&&(k=v),x(QN(k)),y(u);return}const{forceRender:w}=m.useContext($w);return l.jsx(l.Fragment,{children:b.map(k=>{const S=Cf(k),j=s&&!o?!1:u===b||d.includes(S),N=()=>{if(p.has(S))p.set(S,!0);else return;let P=!0;p.forEach(T=>{T||(P=!1)}),P&&(w==null||w(),x(h.current),s&&(c==null||c()),r&&r())};return l.jsx(aq,{isPresent:j,initial:!f.current||n?void 0:!1,custom:j?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:j?void 0:N,children:k},S)})})},vr=e=>e;let w4=vr;function Ww(e){let t;return()=>(t===void 0&&(t=e()),t)}const Fl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},na=e=>e*1e3,ra=e=>e/1e3,oq={useManualTiming:!1};function lq(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 Pf=["read","resolveKeyframes","update","preRender","render","postRender"],cq=40;function S4(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,s=Pf.reduce((x,v)=>(x[v]=lq(a),x),{}),{read:o,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=s,p=()=>{const x=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,cq),1),i.timestamp=x,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:Pf.reduce((x,v)=>{const w=s[v];return x[v]=(k,S=!1,j=!1)=>(n||g(),w.schedule(k,S,j)),x},{}),cancel:x=>{for(let v=0;v<Pf.length;v++)s[Pf[v]].cancel(x)},state:i,steps:s}}const{schedule:jt,cancel:us,state:gn,steps:R0}=S4(typeof requestAnimationFrame<"u"?requestAnimationFrame:vr,!0),k4=m.createContext({strict:!1}),JN={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"]},zl={};for(const e in JN)zl[e]={isEnabled:t=>JN[e].some(n=>!!t[n])};function uq(e){for(const t in e)zl[t]={...zl[t],...e[t]}}const dq=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 ip(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dq.has(e)}let j4=e=>!ip(e);function fq(e){e&&(j4=t=>t.startsWith("on")?!ip(t):e(t))}try{fq(require("@emotion/is-prop-valid").default)}catch{}function hq(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(j4(i)||n===!0&&ip(i)||!t&&!ip(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function pq(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 Lm=m.createContext({});function Gu(e){return typeof e=="string"||Array.isArray(e)}function Rm(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Hw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Kw=["initial",...Hw];function Fm(e){return Rm(e.animate)||Kw.some(t=>Gu(e[t]))}function N4(e){return!!(Fm(e)||e.variants)}function mq(e,t){if(Fm(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 gq(e){const{initial:t,animate:n}=mq(e,m.useContext(Lm));return m.useMemo(()=>({initial:t,animate:n}),[e2(t),e2(n)])}function e2(e){return Array.isArray(e)?e.join(" "):e}const yq=Symbol.for("motionComponentSymbol");function sl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function xq(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 Gw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vq="framerAppearId",C4="data-"+Gw(vq),{schedule:qw}=S4(queueMicrotask,!1),P4=m.createContext({});function bq(e,t,n,r,i){var a,s;const{visualElement:o}=m.useContext(Lm),c=m.useContext(k4),u=m.useContext(Im),d=m.useContext(Uw).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(P4);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&wq(f.current,n,i,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const y=n[C4],b=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 b4(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),qw.render(h.render),b.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,y)}),b.current=!1))}),h}function wq(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:E4(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 E4(e){if(e)return e.options.allowProjection!==!1?e.projection:E4(e.parent)}function Sq({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var a,s;e&&uq(e);function o(u,d){let f;const h={...m.useContext(Uw),...u,layoutId:kq(u)},{isStatic:p}=h,g=gq(u),y=r(u,p);if(!p&&Vw){jq();const b=Nq(h);f=b.MeasureLayout,g.visualElement=bq(i,y,h,t,b.ProjectionNode)}return l.jsxs(Lm.Provider,{value:g,children:[f&&g.visualElement?l.jsx(f,{visualElement:g.visualElement,...h}):null,n(i,u,xq(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[yq]=i,c}function kq({layoutId:e}){const t=m.useContext($w).id;return t&&e!==void 0?t+"-"+e:e}function jq(e,t){m.useContext(k4).strict}function Nq(e){const{drag:t,layout:n}=zl;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 Cq=["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 Yw(e){return typeof e!="string"||e.includes("-")?!1:!!(Cq.indexOf(e)>-1||/[A-Z]/u.test(e))}function t2(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xw(e,t,n,r){if(typeof t=="function"){const[i,a]=t2(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]=t2(r);t=t(n!==void 0?n:e.custom,i,a)}return t}const $x=e=>Array.isArray(e),Pq=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Eq=e=>$x(e)?e[e.length-1]||0:e,_n=e=>!!(e&&e.getVelocity);function mh(e){const t=_n(e)?e.get():e;return Pq(t)?t.toValue():t}function Aq({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){const s={latestValues:Tq(r,i,a,e),renderState:t()};return n&&(s.onMount=o=>n({props:r,current:o,...s}),s.onUpdate=o=>n(o)),s}const A4=e=>(t,n)=>{const r=m.useContext(Lm),i=m.useContext(Im),a=()=>Aq(e,t,r,i);return n?a():Bw(a)};function Tq(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=Fm(e),u=N4(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"&&!Rm(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=Xw(e,h[p]);if(g){const{transitionEnd:y,transition:b,...x}=g;for(const v in x){let w=x[v];if(Array.isArray(w)){const k=d?w.length-1:0;w=w[k]}w!==null&&(i[v]=w)}for(const v in y)i[v]=y[v]}}}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),T4=e=>t=>typeof t=="string"&&t.startsWith(e),O4=T4("--"),Oq=T4("var(--"),Zw=e=>Oq(e)?_q.test(e.split("/*")[0].trim()):!1,_q=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,_4=(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},qu={...rc,transform:e=>da(0,1,e)},Ef={...rc,default:1},Ad=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),La=Ad("deg"),Ti=Ad("%"),Re=Ad("px"),Dq=Ad("vh"),Mq=Ad("vw"),n2={...Ti,parse:e=>Ti.parse(e)/100,transform:e=>Ti.transform(e*100)},Iq={borderWidth:Re,borderTopWidth:Re,borderRightWidth:Re,borderBottomWidth:Re,borderLeftWidth:Re,borderRadius:Re,radius:Re,borderTopLeftRadius:Re,borderTopRightRadius:Re,borderBottomRightRadius:Re,borderBottomLeftRadius:Re,width:Re,maxWidth:Re,height:Re,maxHeight:Re,top:Re,right:Re,bottom:Re,left:Re,padding:Re,paddingTop:Re,paddingRight:Re,paddingBottom:Re,paddingLeft:Re,margin:Re,marginTop:Re,marginRight:Re,marginBottom:Re,marginLeft:Re,backgroundPositionX:Re,backgroundPositionY:Re},Lq={rotate:La,rotateX:La,rotateY:La,rotateZ:La,scale:Ef,scaleX:Ef,scaleY:Ef,scaleZ:Ef,skew:La,skewX:La,skewY:La,distance:Re,translateX:Re,translateY:Re,translateZ:Re,x:Re,y:Re,z:Re,perspective:Re,transformPerspective:Re,opacity:qu,originX:n2,originY:n2,originZ:Re},r2={...rc,transform:Math.round},Qw={...Iq,...Lq,zIndex:r2,size:Re,fillOpacity:qu,strokeOpacity:qu,numOctaves:r2},Rq={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Fq=nc.length;function zq(e,t,n){let r="",i=!0;for(let a=0;a<Fq;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=_4(o,Qw[s]);if(!c){i=!1;const d=Rq[s]||s;r+=`${d}(${u}) `}n&&(t[s]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Jw(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(O4(c)){i[c]=u;continue}else{const d=_4(u,Qw[c]);c.startsWith("origin")?(o=!0,a[c]=d):r[c]=d}}if(t.transform||(s||n?r.transform=zq(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 $q={offset:"stroke-dashoffset",array:"stroke-dasharray"},Bq={offset:"strokeDashoffset",array:"strokeDasharray"};function Uq(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?$q:Bq;e[a.offset]=Re.transform(-r);const s=Re.transform(t),o=Re.transform(n);e[a.array]=`${s} ${o}`}function i2(e,t,n){return typeof e=="string"?e:Re.transform(t+n*e)}function Vq(e,t,n){const r=i2(t,e.x,e.width),i=i2(n,e.y,e.height);return`${r} ${i}`}function e1(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:s,pathSpacing:o=1,pathOffset:c=0,...u},d,f){if(Jw(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=Vq(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&&Uq(h,s,o,c,!1)}const t1=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),D4=()=>({...t1(),attrs:{}}),n1=e=>typeof e=="string"&&e.toLowerCase()==="svg";function M4(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 I4=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 L4(e,t,n,r){M4(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(I4.has(i)?i:Gw(i),t.attrs[i])}const ap={};function Wq(e){Object.assign(ap,e)}function R4(e,{layout:t,layoutId:n}){return Eo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ap[e]||e==="opacity")}function r1(e,t,n){var r;const{style:i}=e,a={};for(const s in i)(_n(i[s])||t.style&&_n(t.style[s])||R4(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 F4(e,t,n){const r=r1(e,t,n);for(const i in e)if(_n(e[i])||_n(t[i])){const a=nc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function Hq(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 a2=["x","y","width","height","cx","cy","r"],Kq={useVisualState:A4({scrapeMotionValuesFromProps:F4,createRenderState:D4,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<a2.length;o++){const c=a2[o];e[c]!==t[c]&&(s=!0)}s&&jt.read(()=>{Hq(n,r),jt.render(()=>{e1(r,i,n1(n.tagName),e.transformTemplate),L4(n,r)})})}})},Gq={useVisualState:A4({scrapeMotionValuesFromProps:r1,createRenderState:t1})};function z4(e,t,n){for(const r in t)!_n(t[r])&&!R4(r,n)&&(e[r]=t[r])}function qq({transformTemplate:e},t){return m.useMemo(()=>{const n=t1();return Jw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Yq(e,t){const n=e.style||{},r={};return z4(r,n,e),Object.assign(r,qq(e,t)),r}function Xq(e,t){const n={},r=Yq(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 Zq(e,t,n,r){const i=m.useMemo(()=>{const a=D4();return e1(a,t,n1(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};z4(a,e.style,e),i.style={...a,...i.style}}return i}function Qq(e=!1){return(n,r,i,{latestValues:a},s)=>{const c=(Yw(n)?Zq:Xq)(r,a,s,n),u=hq(r,typeof n=="string",e),d=n!==m.Fragment?{...u,...c,ref:i}:{},{children:f}=r,h=m.useMemo(()=>_n(f)?f.get():f,[f]);return m.createElement(n,{...d,children:h})}}function Jq(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...Yw(r)?Kq:Gq,preloadedFeatures:e,useRender:Qq(i),createVisualElement:t,Component:r};return Sq(s)}}function $4(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 zm(e,t,n){const r=e.getProps();return Xw(r,t,n!==void 0?n:r.custom,e)}const eY=Ww(()=>window.ScrollTimeline!==void 0);class tY{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(eY()&&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 nY extends tY{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function i1(e,t){return e?e[t]||e.default||e:void 0}const Bx=2e4;function B4(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Bx;)t+=n,r=e.next(t);return t>=Bx?1/0:t}function a1(e){return typeof e=="function"}function s2(e,t){e.timeline=t,e.onfinish=null}const s1=e=>Array.isArray(e)&&typeof e[0]=="number",rY={linearEasing:void 0};function iY(e,t){const n=Ww(e);return()=>{var r;return(r=rY[t])!==null&&r!==void 0?r:n()}}const sp=iY(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),U4=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=e(Fl(0,i-1,a))+", ";return`linear(${r.substring(0,r.length-2)})`};function V4(e){return!!(typeof e=="function"&&sp()||!e||typeof e=="string"&&(e in Ux||sp())||s1(e)||Array.isArray(e)&&e.every(V4))}const Zc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ux={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 W4(e,t){if(e)return typeof e=="function"&&sp()?U4(e,t):s1(e)?Zc(e):Array.isArray(e)?e.map(n=>W4(n,t)||Ux.easeOut):Ux[e]}const Xr={x:!1,y:!1};function H4(){return Xr.x||Xr.y}function aY(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 K4(e,t){const n=aY(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function o2(e){return t=>{t.pointerType==="touch"||H4()||e(t)}}function sY(e,t,n={}){const[r,i,a]=K4(e,n),s=o2(o=>{const{target:c}=o,u=t(o);if(typeof u!="function"||!c)return;const d=o2(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,o1=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,oY=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function lY(e){return oY.has(e.tagName)||e.tabIndex!==-1}const Qc=new WeakSet;function l2(e){return t=>{t.key==="Enter"&&e(t)}}function F0(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const cY=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=l2(()=>{if(Qc.has(n))return;F0(n,"down");const i=l2(()=>{F0(n,"up")}),a=()=>F0(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 c2(e){return o1(e)&&!H4()}function uY(e,t,n={}){const[r,i,a]=K4(e,n),s=o=>{const c=o.currentTarget;if(!c2(o)||Qc.has(c))return;Qc.add(c);const u=t(o),d=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!c2(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=>{!lY(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",s,i),o.addEventListener("focus",u=>cY(u,i),i)}),a}function dY(e){return e==="x"||e==="y"?Xr[e]?null:(Xr[e]=!0,()=>{Xr[e]=!1}):Xr.x||Xr.y?null:(Xr.x=Xr.y=!0,()=>{Xr.x=Xr.y=!1})}const q4=new Set(["width","height","top","left","right","bottom",...nc]);let gh;function fY(){gh=void 0}const Oi={now:()=>(gh===void 0&&Oi.set(gn.isProcessing||oq.useManualTiming?gn.timestamp:performance.now()),gh),set:e=>{gh=e,queueMicrotask(fY)}};function l1(e,t){e.indexOf(t)===-1&&e.push(t)}function c1(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class u1{constructor(){this.subscriptions=[]}add(t){return l1(this.subscriptions,t),()=>c1(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 Y4(e,t){return t?e*(1e3/t):0}const u2=30,hY=e=>!isNaN(parseFloat(e));class pY{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=Oi.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=Oi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=hY(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 u1);const r=this.events[t].add(n);return t==="change"?()=>{r(),jt.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=Oi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>u2)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,u2);return Y4(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 Yu(e,t){return new pY(e,t)}function mY(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Yu(n))}function gY(e,t){const n=zm(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const s in a){const o=Eq(a[s]);mY(e,s,o)}}function yY(e){return!!(_n(e)&&e.add)}function Vx(e,t){const n=e.getValue("willChange");if(yY(n))return n.add(t)}function X4(e){return e.props[C4]}const Z4=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,xY=1e-7,vY=12;function bY(e,t,n,r,i){let a,s,o=0;do s=t+(n-t)/2,a=Z4(s,r,i)-e,a>0?n=s:t=s;while(Math.abs(a)>xY&&++o<vY);return s}function Td(e,t,n,r){if(e===t&&n===r)return vr;const i=a=>bY(a,0,1,e,n);return a=>a===0||a===1?a:Z4(i(a),t,r)}const Q4=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,J4=e=>t=>1-e(1-t),eD=Td(.33,1.53,.69,.99),d1=J4(eD),tD=Q4(d1),nD=e=>(e*=2)<1?.5*d1(e):.5*(2-Math.pow(2,-10*(e-1))),f1=e=>1-Math.sin(Math.acos(e)),rD=J4(f1),iD=Q4(f1),aD=e=>/^0[^.\s]+$/u.test(e);function wY(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||aD(e):!0}const mu=e=>Math.round(e*1e5)/1e5,h1=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function SY(e){return e==null}const kY=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,p1=(e,t)=>n=>!!(typeof n=="string"&&kY.test(n)&&n.startsWith(e)||t&&!SY(n)&&Object.prototype.hasOwnProperty.call(n,t)),sD=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,s,o]=r.match(h1);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},jY=e=>da(0,255,e),z0={...rc,transform:e=>Math.round(jY(e))},qs={test:p1("rgb","red"),parse:sD("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+z0.transform(e)+", "+z0.transform(t)+", "+z0.transform(n)+", "+mu(qu.transform(r))+")"};function NY(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 Wx={test:p1("#"),parse:NY,transform:qs.transform},ol={test:p1("hsl","hue"),parse:sD("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ti.transform(mu(t))+", "+Ti.transform(mu(n))+", "+mu(qu.transform(r))+")"},Pn={test:e=>qs.test(e)||Wx.test(e)||ol.test(e),parse:e=>qs.test(e)?qs.parse(e):ol.test(e)?ol.parse(e):Wx.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qs.transform(e):ol.transform(e)},CY=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function PY(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(h1))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(CY))===null||n===void 0?void 0:n.length)||0)>0}const oD="number",lD="color",EY="var",AY="var(",d2="${}",TY=/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 Xu(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(TY,c=>(Pn.test(c)?(r.color.push(a),i.push(lD),n.push(Pn.parse(c))):c.startsWith(AY)?(r.var.push(a),i.push(EY),n.push(c)):(r.number.push(a),i.push(oD),n.push(parseFloat(c))),++a,d2)).split(d2);return{values:n,split:o,indexes:r,types:i}}function cD(e){return Xu(e).values}function uD(e){const{split:t,types:n}=Xu(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===oD?a+=mu(i[s]):o===lD?a+=Pn.transform(i[s]):a+=i[s]}return a}}const OY=e=>typeof e=="number"?0:e;function _Y(e){const t=cD(e);return uD(e)(t.map(OY))}const ds={test:PY,parse:cD,createTransformer:uD,getAnimatableNone:_Y},DY=new Set(["brightness","contrast","saturate","opacity"]);function MY(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(h1)||[];if(!r)return e;const i=n.replace(r,"");let a=DY.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const IY=/\b([a-z-]*)\(.*?\)/gu,Hx={...ds,getAnimatableNone:e=>{const t=e.match(IY);return t?t.map(MY).join(" "):e}},LY={...Qw,color:Pn,backgroundColor:Pn,outlineColor:Pn,fill:Pn,stroke:Pn,borderColor:Pn,borderTopColor:Pn,borderRightColor:Pn,borderBottomColor:Pn,borderLeftColor:Pn,filter:Hx,WebkitFilter:Hx},m1=e=>LY[e];function dD(e,t){let n=m1(e);return n!==Hx&&(n=ds),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const RY=new Set(["auto","none","0"]);function FY(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!RY.has(a)&&Xu(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=dD(n,i)}const f2=e=>e===rc||e===Re,h2=(e,t)=>parseFloat(e.split(", ")[t]),p2=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return h2(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?h2(a[1],e):0}},zY=new Set(["x","y","z"]),$Y=nc.filter(e=>!zY.has(e));function BY(e){const t=[];return $Y.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const $l={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:p2(4,13),y:p2(5,14)};$l.translateX=$l.x;$l.translateY=$l.y;const to=new Set;let Kx=!1,Gx=!1;function fD(){if(Gx){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=BY(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)})}Gx=!1,Kx=!1,to.forEach(e=>e.complete()),to.clear()}function hD(){to.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Gx=!0)})}function UY(){hD(),fD()}class g1{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),Kx||(Kx=!0,jt.read(hD),jt.resolveKeyframes(fD))):(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 pD=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),VY=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function WY(e){const t=VY.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function mD(e,t,n=1){const[r,i]=WY(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const s=a.trim();return pD(s)?parseFloat(s):s}return Zw(i)?mD(i,t,n+1):i}const gD=e=>t=>t.test(e),HY={test:e=>e==="auto",parse:e=>e},yD=[rc,Re,Ti,La,Mq,Dq,HY],m2=e=>yD.find(gD(e));class xD extends g1{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(),Zw(u))){const d=mD(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!q4.has(r)||t.length!==2)return;const[i,a]=t,s=m2(i),o=m2(a);if(s!==o)if(f2(s)&&f2(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++)wY(t[i])&&r.push(i);r.length&&FY(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=$l[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]=$l[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 g2=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ds.test(e)||e==="0")&&!e.startsWith("url("));function KY(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 GY(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=g2(i,t),o=g2(a,t);return!s||!o?!1:KY(e)||(n==="spring"||a1(n))&&r}const qY=e=>e!==null;function $m(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(qY),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const YY=40;class vD{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=Oi.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>YY?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&UY(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Oi.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:s,onComplete:o,onUpdate:c,isGenerator:u}=this.options;if(!u&&!GY(t,r,i,a))if(s)this.options.duration=0;else{c&&c($m(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 _t=(e,t,n)=>e+(t-e)*n;function $0(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 XY({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=$0(c,o,e+1/3),a=$0(c,o,e),s=$0(c,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:r}}function op(e,t){return n=>n>0?t:e}const B0=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},ZY=[Wx,qs,ol],QY=e=>ZY.find(t=>t.test(e));function y2(e){const t=QY(e);if(!t)return!1;let n=t.parse(e);return t===ol&&(n=XY(n)),n}const x2=(e,t)=>{const n=y2(e),r=y2(t);if(!n||!r)return op(e,t);const i={...n};return a=>(i.red=B0(n.red,r.red,a),i.green=B0(n.green,r.green,a),i.blue=B0(n.blue,r.blue,a),i.alpha=_t(n.alpha,r.alpha,a),qs.transform(i))},JY=(e,t)=>n=>t(e(n)),Od=(...e)=>e.reduce(JY),qx=new Set(["none","hidden"]);function eX(e,t){return qx.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tX(e,t){return n=>_t(e,t,n)}function y1(e){return typeof e=="number"?tX:typeof e=="string"?Zw(e)?op:Pn.test(e)?x2:iX:Array.isArray(e)?bD:typeof e=="object"?Pn.test(e)?x2:nX:op}function bD(e,t){const n=[...e],r=n.length,i=e.map((a,s)=>y1(a)(a,t[s]));return a=>{for(let s=0;s<r;s++)n[s]=i[s](a);return n}}function nX(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=y1(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function rX(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 iX=(e,t)=>{const n=ds.createTransformer(t),r=Xu(e),i=Xu(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?qx.has(e)&&!i.values.length||qx.has(t)&&!r.values.length?eX(e,t):Od(bD(rX(r,i),i.values),n):op(e,t)};function wD(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?_t(e,t,n):y1(e)(e,t)}const aX=5;function SD(e,t,n){const r=Math.max(t-aX,0);return Y4(n-e(r),t-r)}const Ft={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},U0=.001;function sX({duration:e=Ft.duration,bounce:t=Ft.bounce,velocity:n=Ft.velocity,mass:r=Ft.mass}){let i,a,s=1-t;s=da(Ft.minDamping,Ft.maxDamping,s),e=da(Ft.minDuration,Ft.maxDuration,ra(e)),s<1?(i=u=>{const d=u*s,f=d*e,h=d-n,p=Yx(u,s),g=Math.exp(-f);return U0-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=Yx(Math.pow(u,2),s);return(-i(u)+U0>0?-1:1)*((h-p)*g)/y}):(i=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-U0+d*f},a=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const o=5/e,c=lX(i,a,o);if(e=na(e),isNaN(c))return{stiffness:Ft.stiffness,damping:Ft.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const oX=12;function lX(e,t,n){let r=n;for(let i=1;i<oX;i++)r=r-e(r)/t(r);return r}function Yx(e,t){return e*Math.sqrt(1-t*t)}const cX=["duration","bounce"],uX=["stiffness","damping","mass"];function v2(e,t){return t.some(n=>e[n]!==void 0)}function dX(e){let t={velocity:Ft.velocity,stiffness:Ft.stiffness,damping:Ft.damping,mass:Ft.mass,isResolvedFromDuration:!1,...e};if(!v2(e,uX)&&v2(e,cX))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:Ft.mass,stiffness:i,damping:a}}else{const n=sX(e);t={...t,...n,mass:Ft.mass},t.isResolvedFromDuration=!0}return t}function kD(e=Ft.visualDuration,t=Ft.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}=dX({...n,velocity:-ra(n.velocity||0)}),g=h||0,y=u/(2*Math.sqrt(c*d)),b=s-a,x=ra(Math.sqrt(c/d)),v=Math.abs(b)<5;r||(r=v?Ft.restSpeed.granular:Ft.restSpeed.default),i||(i=v?Ft.restDelta.granular:Ft.restDelta.default);let w;if(y<1){const S=Yx(x,y);w=j=>{const N=Math.exp(-y*x*j);return s-N*((g+y*x*b)/S*Math.sin(S*j)+b*Math.cos(S*j))}}else if(y===1)w=S=>s-Math.exp(-x*S)*(b+(g+x*b)*S);else{const S=x*Math.sqrt(y*y-1);w=j=>{const N=Math.exp(-y*x*j),P=Math.min(S*j,300);return s-N*((g+y*x*b)*Math.sinh(P)+S*b*Math.cosh(P))/S}}const k={calculatedDuration:p&&f||null,next:S=>{const j=w(S);if(p)o.done=S>=f;else{let N=0;y<1&&(N=S===0?na(g):SD(w,S,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 S=Math.min(B4(k),Bx),j=U4(N=>k.next(S*N).value,S,30);return S+"ms "+j}};return k}function b2({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 b=f+y,x=s===void 0?b:s(b);x!==b&&(y=x-f);const v=P=>-y*Math.exp(-P/r),w=P=>x+v(P),k=P=>{const T=v(P),E=w(P);h.done=Math.abs(T)<=u,h.value=h.done?x:E};let S,j;const N=P=>{p(h.value)&&(S=P,j=kD({keyframes:[h.value,g(h.value)],velocity:SD(w,P,h.value),damping:i,stiffness:a,restDelta:u,restSpeed:d}))};return N(0),{calculatedDuration:null,next:P=>{let T=!1;return!j&&S===void 0&&(T=!0,k(P),N(P)),S!==void 0&&P>=S?j.next(P-S):(!T&&k(P),h)}}}const fX=Td(.42,0,1,1),hX=Td(0,0,.58,1),jD=Td(.42,0,.58,1),pX=e=>Array.isArray(e)&&typeof e[0]!="number",mX={linear:vr,easeIn:fX,easeInOut:jD,easeOut:hX,circIn:f1,circInOut:iD,circOut:rD,backIn:d1,backInOut:tD,backOut:eD,anticipate:nD},w2=e=>{if(s1(e)){w4(e.length===4);const[t,n,r,i]=e;return Td(t,n,r,i)}else if(typeof e=="string")return mX[e];return e};function gX(e,t,n){const r=[],i=n||wD,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]||vr:t;o=Od(c,o)}r.push(o)}return r}function yX(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(w4(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=gX(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=Fl(e[f],e[f+1],d);return o[f](h)};return n?d=>u(da(e[0],e[a-1],d)):u}function xX(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Fl(0,t,r);e.push(_t(n,1,i))}}function vX(e){const t=[0];return xX(t,e.length-1),t}function bX(e,t){return e.map(n=>n*t)}function wX(e,t){return e.map(()=>t||jD).splice(0,e.length-1)}function lp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=pX(r)?r.map(w2):w2(r),a={done:!1,value:t[0]},s=bX(n&&n.length===t.length?n:vX(t),e),o=yX(s,t,{ease:Array.isArray(i)?i:wX(t,i)});return{calculatedDuration:e,next:c=>(a.value=o(c),a.done=c>=e,a)}}const SX=e=>{const t=({timestamp:n})=>e(n);return{start:()=>jt.update(t,!0),stop:()=>us(t),now:()=>gn.isProcessing?gn.timestamp:Oi.now()}},kX={decay:b2,inertia:b2,tween:lp,keyframes:lp,spring:kD},jX=e=>e/100;class x1 extends vD{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)||g1,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=a1(n)?n:kX[n]||lp;let c,u;o!==lp&&typeof t[0]!="number"&&(c=Od(jX,wD(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=B4(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:b}=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 x=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?x<0:x>d;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,k=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"&&(k=s)),w=da(0,1,E)*f}const S=v?{done:!1,value:c[0]}:k.next(w);o&&(S.value=o(S.value));let{done:j}=S;!v&&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&&(S.value=$m(c,this.options,i)),b&&b(S.value),N&&this.finish(),S}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=SX,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 NX=new Set(["opacity","clipPath","filter","transform"]);function CX(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=W4(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 PX=Ww(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),cp=10,EX=2e4;function AX(e){return a1(e.type)||e.type==="spring"||!V4(e.ease)}function TX(e,t){const n=new x1({...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<EX;)r=n.sample(a),i.push(r.value),a+=cp;return{times:void 0,keyframes:i,duration:a-cp,ease:"linear"}}const ND={anticipate:nD,backInOut:tD,circInOut:iD};function OX(e){return e in ND}class S2 extends vD{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new xD(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"&&sp()&&OX(a)&&(a=ND[a]),AX(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:g,...y}=this.options,b=TX(t,y);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,i=b.times,a=b.ease,s="keyframes"}const d=CX(o.owner.current,c,t,{...this.options,duration:r,times:i,ease:a});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(s2(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set($m(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 vr;const{animation:r}=n;s2(r,t)}return vr}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 x1({...p,keyframes:r,duration:i,type:a,ease:s,times:o,isGenerator:!0}),y=na(this.time);u.setWithVelocity(g.sample(y-cp).value,g.sample(y).value,cp)}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 PX()&&r&&NX.has(r)&&!c&&!u&&!i&&a!=="mirror"&&s!==0&&o!=="inertia"}}const _X={type:"spring",stiffness:500,damping:25,restSpeed:10},DX=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),MX={type:"keyframes",duration:.8},IX={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LX=(e,{keyframes:t})=>t.length>2?MX:Eo.has(e)?e.startsWith("scale")?DX(t[1]):_X:IX;function RX({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 v1=(e,t,n,r={},i,a)=>s=>{const o=i1(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};RX(o)||(d={...d,...LX(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=$m(d.keyframes,o);if(h!==void 0)return jt.update(()=>{d.onUpdate(h),d.onComplete()}),new nY([])}return!a&&S2.supports(d)?new S2(d):new x1(d)};function FX({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function CD(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&&FX(d,f))continue;const g={delay:n,...i1(s||{},f)};let y=!1;if(window.MotionHandoffAnimation){const x=X4(e);if(x){const v=window.MotionHandoffAnimation(x,f,jt);v!==null&&(g.startTime=v,y=!0)}}Vx(e,f),h.start(v1(f,h,p,e.shouldReduceMotion&&q4.has(f)?{type:!1}:g,e,y));const b=h.animation;b&&u.push(b)}return o&&Promise.all(u).then(()=>{jt.update(()=>{o&&gY(e,o)})}),u}function Xx(e,t,n={}){var r;const i=zm(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(CD(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=a;return zX(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 zX(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($X).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(Xx(u,t,{...a,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function $X(e,t){return e.sortNodePosition(t)}function BX(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>Xx(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=Xx(e,t,n);else{const i=typeof t=="function"?zm(e,t,n.custom):t;r=Promise.all(CD(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const UX=Kw.length;function PD(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?PD(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<UX;n++){const r=Kw[n],i=e.props[r];(Gu(i)||i===!1)&&(t[r]=i)}return t}const VX=[...Hw].reverse(),WX=Hw.length;function HX(e){return t=>Promise.all(t.map(({animation:n,options:r})=>BX(e,n,r)))}function KX(e){let t=HX(e),n=k2(),r=!0;const i=c=>(u,d)=>{var f;const h=zm(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=PD(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let b=0;b<WX;b++){const x=VX[b],v=n[x],w=u[x]!==void 0?u[x]:d[x],k=Gu(w),S=x===c?v.isActive:null;S===!1&&(g=b);let j=w===d[x]&&w!==u[x]&&k;if(j&&r&&e.manuallyAnimateOnMount&&(j=!1),v.protectedKeys={...p},!v.isActive&&S===null||!w&&!v.prevProp||Rm(w)||typeof w=="boolean")continue;const N=GX(v.prevProp,w);let P=N||x===c&&v.isActive&&!j&&k||b>g&&k,T=!1;const E=Array.isArray(w)?w:[w];let _=E.reduce(i(x),{});S===!1&&(_={});const{prevResolvedValues:C={}}=v,A={...C,..._},I=Z=>{P=!0,h.has(Z)&&(T=!0,h.delete(Z)),v.needsAnimating[Z]=!0;const M=e.getValue(Z);M&&(M.liveStyle=!1)};for(const Z in A){const M=_[Z],K=C[Z];if(p.hasOwnProperty(Z))continue;let O=!1;$x(M)&&$x(K)?O=!$4(M,K):O=M!==K,O?M!=null?I(Z):h.add(Z):M!==void 0&&h.has(Z)?I(Z):v.protectedKeys[Z]=!0}v.prevProp=w,v.prevResolvedValues=_,v.isActive&&(p={...p,..._}),r&&e.blockInitialAnimation&&(P=!1),P&&(!(j&&N)||T)&&f.push(...E.map(Z=>({animation:Z,options:{type:x}})))}if(h.size){const b={};h.forEach(x=>{const v=e.getBaseTarget(x),w=e.getValue(x);w&&(w.liveStyle=!0),b[x]=v??null}),f.push({animation:b})}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=k2(),r=!0}}}function GX(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!$4(t,e):!1}function Es(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function k2(){return{animate:Es(!0),whileInView:Es(),whileHover:Es(),whileTap:Es(),whileDrag:Es(),whileFocus:Es(),exit:Es()}}class vs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class qX extends vs{constructor(t){super(t),t.animationState||(t.animationState=KX(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Rm(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 YX=0;class XX extends vs{constructor(){super(...arguments),this.id=YX++}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 ZX={animation:{Feature:qX},exit:{Feature:XX}};function Zu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _d(e){return{point:{x:e.pageX,y:e.pageY}}}const QX=e=>t=>o1(t)&&e(t,_d(t));function gu(e,t,n,r){return Zu(e,t,QX(n),r)}const j2=(e,t)=>Math.abs(e-t);function JX(e,t){const n=j2(e.x,t.x),r=j2(e.y,t.y);return Math.sqrt(n**2+r**2)}class ED{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=W0(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=JX(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:y}=gn;this.history.push({...g,timestamp:y});const{onStart:b,onMove:x}=this.handlers;h||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=V0(h,this.transformPagePoint),jt.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 b=W0(f.type==="pointercancel"?this.lastMoveEventInfo:V0(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,b),g&&g(f,b)},!o1(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=_d(t),o=V0(s,this.transformPagePoint),{point:c}=o,{timestamp:u}=gn;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,W0(o,this.history)),this.removeListeners=Od(gu(this.contextWindow,"pointermove",this.handlePointerMove),gu(this.contextWindow,"pointerup",this.handlePointerUp),gu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),us(this.updatePoint)}}function V0(e,t){return t?{point:t(e.point)}:e}function N2(e,t){return{x:e.x-t.x,y:e.y-t.y}}function W0({point:e},t){return{point:e,delta:N2(e,AD(t)),offset:N2(e,eZ(t)),velocity:tZ(t,.1)}}function eZ(e){return e[0]}function AD(e){return e[e.length-1]}function tZ(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=AD(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 TD=1e-4,nZ=1-TD,rZ=1+TD,OD=.01,iZ=0-OD,aZ=0+OD;function kr(e){return e.max-e.min}function sZ(e,t,n){return Math.abs(e-t)<=n}function C2(e,t,n,r=.5){e.origin=r,e.originPoint=_t(t.min,t.max,e.origin),e.scale=kr(n)/kr(t),e.translate=_t(n.min,n.max,e.origin)-e.originPoint,(e.scale>=nZ&&e.scale<=rZ||isNaN(e.scale))&&(e.scale=1),(e.translate>=iZ&&e.translate<=aZ||isNaN(e.translate))&&(e.translate=0)}function yu(e,t,n,r){C2(e.x,t.x,n.x,r?r.originX:void 0),C2(e.y,t.y,n.y,r?r.originY:void 0)}function P2(e,t,n){e.min=n.min+t.min,e.max=e.min+kr(t)}function oZ(e,t,n){P2(e.x,t.x,n.x),P2(e.y,t.y,n.y)}function E2(e,t,n){e.min=t.min-n.min,e.max=e.min+kr(t)}function xu(e,t,n){E2(e.x,t.x,n.x),E2(e.y,t.y,n.y)}function lZ(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?_t(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?_t(n,e,r.max):Math.min(e,n)),e}function A2(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 cZ(e,{top:t,left:n,bottom:r,right:i}){return{x:A2(e.x,n,i),y:A2(e.y,t,r)}}function T2(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 uZ(e,t){return{x:T2(e.x,t.x),y:T2(e.y,t.y)}}function dZ(e,t){let n=.5;const r=kr(e),i=kr(t);return i>r?n=Fl(t.min,t.max-r,e.min):r>i&&(n=Fl(e.min,e.max-i,t.min)),da(0,1,n)}function fZ(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 Zx=.35;function hZ(e=Zx){return e===!1?e=0:e===!0&&(e=Zx),{x:O2(e,"left","right"),y:O2(e,"top","bottom")}}function O2(e,t,n){return{min:_2(e,t),max:_2(e,n)}}function _2(e,t){return typeof e=="number"?e:e[t]||0}const D2=()=>({translate:0,scale:1,origin:0,originPoint:0}),ll=()=>({x:D2(),y:D2()}),M2=()=>({min:0,max:0}),Ut=()=>({x:M2(),y:M2()});function Mr(e){return[e("x"),e("y")]}function _D({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function pZ({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function mZ(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 H0(e){return e===void 0||e===1}function Qx({scale:e,scaleX:t,scaleY:n}){return!H0(e)||!H0(t)||!H0(n)}function Is(e){return Qx(e)||DD(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function DD(e){return I2(e.x)||I2(e.y)}function I2(e){return e&&e!=="0%"}function up(e,t,n){const r=e-n,i=t*r;return n+i}function L2(e,t,n,r,i){return i!==void 0&&(e=up(e,i,r)),up(e,n,r)+t}function Jx(e,t=0,n=1,r,i){e.min=L2(e.min,t,n,r,i),e.max=L2(e.max,t,n,r,i)}function MD(e,{x:t,y:n}){Jx(e.x,t.translate,t.scale,t.originPoint),Jx(e.y,n.translate,n.scale,n.originPoint)}const R2=.999999999999,F2=1.0000000000001;function gZ(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,MD(e,s)),r&&Is(a.latestValues)&&ul(e,a.latestValues))}t.x<F2&&t.x>R2&&(t.x=1),t.y<F2&&t.y>R2&&(t.y=1)}function cl(e,t){e.min=e.min+t,e.max=e.max+t}function z2(e,t,n,r,i=.5){const a=_t(e.min,e.max,i);Jx(e,t,n,a,r)}function ul(e,t){z2(e.x,t.x,t.scaleX,t.scale,t.originX),z2(e.y,t.y,t.scaleY,t.scale,t.originY)}function ID(e,t){return _D(mZ(e.getBoundingClientRect(),t))}function yZ(e,t,n){const r=ID(e,n),{scroll:i}=t;return i&&(cl(r.x,i.offset.x),cl(r.y,i.offset.y)),r}const LD=({current:e})=>e?e.ownerDocument.defaultView:null,xZ=new WeakMap;class vZ{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=Ut(),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(_d(d).point)},a=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=dY(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),Mr(b=>{let x=this.getAxisMotionValue(b).get()||0;if(Ti.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[b];w&&(x=kr(w)*(parseFloat(x)/100))}}this.originPoint[b]=x}),g&&jt.postRender(()=>g(d,f)),Vx(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:b}=f;if(p&&this.currentDirection===null){this.currentDirection=bZ(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),c=()=>Mr(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 ED(t,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:o,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:LD(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&&jt.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||!Af(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=lZ(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=cZ(i.layoutBox,n):this.constraints=!1,this.elastic=hZ(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Mr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=fZ(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=yZ(r,i.root,this.visualElement.getTransformPagePoint());let s=uZ(i.layout.layoutBox,a);if(n){const o=n(pZ(s));this.hasMutatedConstraints=!!o,o&&(s=_D(o))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=Mr(d=>{if(!Af(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 Vx(this.visualElement,t),r.start(v1(t,r,0,n,this.visualElement,!1))}stopAnimation(){Mr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Mr(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){Mr(n=>{const{drag:r}=this.getProps();if(!Af(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]-_t(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};Mr(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const c=o.get();i[s]=dZ({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(),Mr(s=>{if(!Af(s,t,null))return;const o=this.getAxisMotionValue(s),{min:c,max:u}=this.constraints[s];o.set(_t(c,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;xZ.set(this.visualElement,this);const t=this.visualElement.current,n=gu(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()),jt.read(r);const s=Zu(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Mr(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=Zx,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:s,dragMomentum:o}}}function Af(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function bZ(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wZ extends vs{constructor(t){super(t),this.removeGroupControls=vr,this.removeListeners=vr,this.controls=new vZ(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vr}unmount(){this.removeGroupControls(),this.removeListeners()}}const $2=e=>(t,n)=>{e&&jt.postRender(()=>e(t,n))};class SZ extends vs{constructor(){super(...arguments),this.removePointerDownListener=vr}onPointerDown(t){this.session=new ED(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:LD(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:$2(t),onStart:$2(n),onMove:r,onEnd:(a,s)=>{delete this.session,i&&jt.postRender(()=>i(a,s))}}}mount(){this.removePointerDownListener=gu(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 B2(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(Re.test(e))e=parseFloat(e);else return e;const n=B2(e,t.target.x),r=B2(e,t.target.y);return`${n}% ${r}%`}},kZ={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ds.parse(e);if(i.length>5)return r;const a=ds.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=_t(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 jZ extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;Wq(NZ),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()||jt.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),qw.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 RD(e){const[t,n]=v4(),r=m.useContext($w);return l.jsx(jZ,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(P4),isPresent:t,safeToRemove:n})}const NZ={borderRadius:{..._c,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_c,borderTopRightRadius:_c,borderBottomLeftRadius:_c,borderBottomRightRadius:_c,boxShadow:kZ};function CZ(e,t,n){const r=_n(e)?e:Yu(e);return r.start(v1("",r,t,n)),r.animation}function PZ(e){return e instanceof SVGElement&&e.tagName!=="svg"}const EZ=(e,t)=>e.depth-t.depth;class AZ{constructor(){this.children=[],this.isDirty=!1}add(t){l1(this.children,t),this.isDirty=!0}remove(t){c1(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(EZ),this.isDirty=!1,this.children.forEach(t)}}function TZ(e,t){const n=Oi.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(us(r),e(a-t))};return jt.read(r,!0),()=>us(r)}const FD=["TopLeft","TopRight","BottomLeft","BottomRight"],OZ=FD.length,U2=e=>typeof e=="string"?parseFloat(e):e,V2=e=>typeof e=="number"||Re.test(e);function _Z(e,t,n,r,i,a){i?(e.opacity=_t(0,n.opacity!==void 0?n.opacity:1,DZ(r)),e.opacityExit=_t(t.opacity!==void 0?t.opacity:1,0,MZ(r))):a&&(e.opacity=_t(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<OZ;s++){const o=`border${FD[s]}Radius`;let c=W2(t,o),u=W2(n,o);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||V2(c)===V2(u)?(e[o]=Math.max(_t(U2(c),U2(u),r),0),(Ti.test(u)||Ti.test(c))&&(e[o]+="%")):e[o]=u}(t.rotate||n.rotate)&&(e.rotate=_t(t.rotate||0,n.rotate||0,r))}function W2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const DZ=zD(0,.5,rD),MZ=zD(.5,.95,vr);function zD(e,t,n){return r=>r<e?0:r>t?1:n(Fl(e,t,r))}function H2(e,t){e.min=t.min,e.max=t.max}function Ar(e,t){H2(e.x,t.x),H2(e.y,t.y)}function K2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function G2(e,t,n,r,i){return e-=t,e=up(e,1/n,r),i!==void 0&&(e=up(e,1/i,r)),e}function IZ(e,t=0,n=1,r=.5,i,a=e,s=e){if(Ti.test(t)&&(t=parseFloat(t),t=_t(s.min,s.max,t/100)-s.min),typeof t!="number")return;let o=_t(a.min,a.max,r);e===a&&(o-=t),e.min=G2(e.min,t,n,o,i),e.max=G2(e.max,t,n,o,i)}function q2(e,t,[n,r,i],a,s){IZ(e,t[n],t[r],t[i],t.scale,a,s)}const LZ=["x","scaleX","originX"],RZ=["y","scaleY","originY"];function Y2(e,t,n,r){q2(e.x,t,LZ,n?n.x:void 0,r?r.x:void 0),q2(e.y,t,RZ,n?n.y:void 0,r?r.y:void 0)}function X2(e){return e.translate===0&&e.scale===1}function $D(e){return X2(e.x)&&X2(e.y)}function Z2(e,t){return e.min===t.min&&e.max===t.max}function FZ(e,t){return Z2(e.x,t.x)&&Z2(e.y,t.y)}function Q2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function BD(e,t){return Q2(e.x,t.x)&&Q2(e.y,t.y)}function J2(e){return kr(e.x)/kr(e.y)}function eC(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class zZ{constructor(){this.members=[]}add(t){l1(this.members,t),t.scheduleRender()}remove(t){if(c1(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 $Z(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,K0=["","X","Y","Z"],BZ={visibility:"hidden"},tC=1e3;let UZ=0;function G0(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function UD(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=X4(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",jt,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&UD(r)}function VD({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},o=t==null?void 0:t()){this.id=UZ++,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(HZ),this.nodes.forEach(XZ),this.nodes.forEach(ZZ),this.nodes.forEach(KZ),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 AZ)}addEventListener(s,o){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new u1),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=PZ(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=TZ(h,250),yh.hasAnimatedSinceResize&&(yh.hasAnimatedSinceResize=!1,this.nodes.forEach(rC))})}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()||nQ,{onLayoutAnimationStart:b,onLayoutAnimationComplete:x}=d.getProps(),v=!this.targetLayout||!BD(this.targetLayout,g)||p,w=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const k={...i1(y,"layout"),onPlay:b,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else h||rC(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,us(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(QZ),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&&UD(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(nC);return}this.isUpdating||this.nodes.forEach(qZ),this.isUpdating=!1,this.nodes.forEach(YZ),this.nodes.forEach(VZ),this.nodes.forEach(WZ),this.clearAllSnapshots();const o=Oi.now();gn.delta=da(0,1e3/60,o-gn.timestamp),gn.timestamp=o,gn.isProcessing=!0,R0.update.process(gn),R0.preRender.process(gn),R0.render.process(gn),gn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(GZ),this.sharedNodes.forEach(JZ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,jt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){jt.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=Ut(),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&&!$D(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)),rQ(c),{animationId:this.root.animationId,measuredBox:o,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:o}=this.options;if(!o)return Ut();const c=o.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(iQ))){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=Ut();if(Ar(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&&Ar(c,s),cl(c.x,f.offset.x),cl(c.y,f.offset.y))}return c}applyTransform(s,o=!1){const c=Ut();Ar(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=Ut();Ar(o,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Is(u.latestValues))continue;Qx(u.latestValues)&&u.updateSnapshot();const d=Ut(),f=u.measurePageBox();Ar(d,f),Y2(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Is(this.latestValues)&&Y2(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!==gn.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=gn.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ut(),this.relativeTargetOrigin=Ut(),xu(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Ar(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Ut(),this.targetWithTransforms=Ut()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),oZ(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ar(this.target,this.layout.layoutBox),MD(this.target,this.targetDelta)):Ar(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=Ut(),this.relativeTargetOrigin=Ut(),xu(this.relativeTargetOrigin,this.target,p.target),Ar(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Jc&&Ls.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Qx(this.parent.latestValues)||DD(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===gn.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;Ar(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;gZ(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=Ut());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(K2(this.prevProjectionDelta.x,this.projectionDelta.x),K2(this.prevProjectionDelta.y,this.projectionDelta.y)),yu(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!eC(this.projectionDelta.x,this.prevProjectionDelta.x)||!eC(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=Ut(),p=c?c.source:void 0,g=this.layout?this.layout.source:void 0,y=p!==g,b=this.getStack(),x=!b||b.members.length<=1,v=!!(y&&!x&&this.options.crossfade===!0&&!this.path.some(tQ));this.animationProgress=0;let w;this.mixTargetDelta=k=>{const S=k/1e3;iC(f.x,s.x,S),iC(f.y,s.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xu(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),eQ(this.relativeTarget,this.relativeTargetOrigin,h,S),w&&FZ(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Ut()),Ar(w,this.relativeTarget)),y&&(this.animationValues=d,_Z(d,u,this.latestValues,S,v,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},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&&(us(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=jt.update(()=>{yh.hasAnimatedSinceResize=!0,this.currentAnimation=CZ(0,tC,{...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(tC),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&&WD(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Ut();const f=kr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+f;const h=kr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+h}Ar(o,c),ul(o,d),yu(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new zZ),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&&G0("z",s,u,this.animationValues);for(let d=0;d<K0.length;d++)G0(`rotate${K0[d]}`,s,u,this.animationValues),G0(`skew${K0[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 BZ;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=$Z(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 ap){if(h[y]===void 0)continue;const{correct:b,applyTo:x}=ap[y],v=u.transform==="none"?h[y]:b(h[y],f);if(x){const w=x.length;for(let k=0;k<w;k++)u[x[k]]=v}else u[y]=v}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(nC),this.root.sharedNodes.clear()}}}function VZ(e){e.updateLayout()}function WZ(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"?Mr(f=>{const h=s?n.measuredBox[f]:n.layoutBox[f],p=kr(h);h.min=r[f].min,h.max=h.min+p}):WD(a,n.layoutBox,r)&&Mr(f=>{const h=s?n.measuredBox[f]:n.layoutBox[f],p=kr(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();yu(o,r,n.layoutBox);const c=ll();s?yu(c,e.applyTransform(i,!0),n.measuredBox):yu(c,r,n.layoutBox);const u=!$D(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=Ut();xu(g,n.layoutBox,h.layoutBox);const y=Ut();xu(y,r,p.layoutBox),BD(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 HZ(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 KZ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function GZ(e){e.clearSnapshot()}function nC(e){e.clearMeasurements()}function qZ(e){e.isLayoutDirty=!1}function YZ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function rC(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function XZ(e){e.resolveTargetDelta()}function ZZ(e){e.calcProjection()}function QZ(e){e.resetSkewAndRotation()}function JZ(e){e.removeLeadSnapshot()}function iC(e,t,n){e.translate=_t(t.translate,0,n),e.scale=_t(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function aC(e,t,n,r){e.min=_t(t.min,n.min,r),e.max=_t(t.max,n.max,r)}function eQ(e,t,n,r){aC(e.x,t.x,n.x,r),aC(e.y,t.y,n.y,r)}function tQ(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const nQ={duration:.45,ease:[.4,0,.1,1]},sC=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),oC=sC("applewebkit/")&&!sC("chrome/")?Math.round:vr;function lC(e){e.min=oC(e.min),e.max=oC(e.max)}function rQ(e){lC(e.x),lC(e.y)}function WD(e,t,n){return e==="position"||e==="preserve-aspect"&&!sZ(J2(t),J2(n),.2)}function iQ(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const aQ=VD({attachResizeListener:(e,t)=>Zu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),q0={current:void 0},HD=VD({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!q0.current){const e=new aQ({});e.mount(window),e.setOptions({layoutScroll:!0}),q0.current=e}return q0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),sQ={pan:{Feature:SZ},drag:{Feature:wZ,ProjectionNode:HD,MeasureLayout:RD}};function cC(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&&jt.postRender(()=>a(t,_d(t)))}class oQ extends vs{mount(){const{current:t}=this.node;t&&(this.unmount=sY(t,n=>(cC(this.node,n,"Start"),r=>cC(this.node,r,"End"))))}unmount(){}}class lQ extends vs{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=Od(Zu(this.node.current,"focus",()=>this.onFocus()),Zu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uC(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&&jt.postRender(()=>a(t,_d(t)))}class cQ extends vs{mount(){const{current:t}=this.node;t&&(this.unmount=uY(t,n=>(uC(this.node,n,"Start"),(r,{success:i})=>uC(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ev=new WeakMap,Y0=new WeakMap,uQ=e=>{const t=ev.get(e.target);t&&t(e)},dQ=e=>{e.forEach(uQ)};function fQ({root:e,...t}){const n=e||document;Y0.has(n)||Y0.set(n,{});const r=Y0.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(dQ,{root:e,...t})),r[i]}function hQ(e,t,n){const r=fQ(t);return ev.set(e,n),r.observe(e),()=>{ev.delete(e),r.unobserve(e)}}const pQ={some:0,all:1};class mQ extends vs{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:pQ[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 hQ(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(gQ(t,n))&&this.startObserver()}unmount(){}}function gQ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const yQ={inView:{Feature:mQ},tap:{Feature:cQ},focus:{Feature:lQ},hover:{Feature:oQ}},xQ={layout:{ProjectionNode:HD,MeasureLayout:RD}},tv={current:null},KD={current:!1};function vQ(){if(KD.current=!0,!!Vw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>tv.current=e.matches;e.addListener(t),t()}else tv.current=!1}const bQ=[...yD,Pn,ds],wQ=e=>bQ.find(gD(e)),dC=new WeakMap;function SQ(e,t,n){for(const r in t){const i=t[r],a=n[r];if(_n(i))e.addValue(r,i);else if(_n(a))e.addValue(r,Yu(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,Yu(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const fC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class kQ{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=g1,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=Oi.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,jt.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=Fm(n),this.isVariantNode=N4(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&&_n(g)&&g.set(c[p],!1)}}mount(t){this.current=t,dC.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)),KD.current||vQ(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:tv.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){dC.delete(this.current),this.projection&&this.projection.unmount(),us(this.notifyUpdate),us(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&&jt.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 zl){const n=zl[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):Ut()}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<fC.length;r++){const i=fC[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=SQ(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=Yu(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"&&(pD(i)||aD(i))?i=parseFloat(i):!wQ(i)&&ds.test(n)&&(i=dD(t,n)),this.setBaseTarget(t,_n(i)?i.get():i)),_n(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=Xw(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&&!_n(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 u1),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class GD extends kQ{constructor(){super(...arguments),this.KeyframeResolver=xD}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;_n(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function jQ(e){return window.getComputedStyle(e)}class NQ extends GD{constructor(){super(...arguments),this.type="html",this.renderInstance=M4}readValueFromInstance(t,n){if(Eo.has(n)){const r=m1(n);return r&&r.default||0}else{const r=jQ(t),i=(O4(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ID(t,n)}build(t,n,r){Jw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return r1(t,n,r)}}class CQ extends GD{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ut}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Eo.has(n)){const r=m1(n);return r&&r.default||0}return n=I4.has(n)?n:Gw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return F4(t,n,r)}build(t,n,r){e1(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){L4(t,n,r,i)}mount(t){this.isSVGTag=n1(t.tagName),super.mount(t)}}const PQ=(e,t)=>Yw(e)?new CQ(t):new NQ(t,{allowProjection:e!==m.Fragment}),EQ=Jq({...ZX,...yQ,...sQ,...xQ},PQ),cn=pq(EQ),AQ={Core:mo,Network:Il,Security:si,Database:qO,Utility:Gs,Custom:Gs,Monitoring:mo,Automation:si},qD=e=>AQ[e]||Gs;async function nv(e,t){const n=await e("skill.list",t);return{skills:(n.skills??[]).map(i=>({...i,icon:qD(i.type||"Custom"),version:`v${i.version||1}`,enabled:i.enabled??!0})),hasMore:n.hasMore??!1}}async function rv(e,t){var r,i,a;const n=await e("skill.get",{id:t});return n?{...n,icon:qD(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 TQ(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,description:t.description,type:t.type,specs:t.specs,scripts:r,labels:t.labels}):await e("skill.update",{id:String(t.id),name:t.name,description:t.description,type:t.type,specs:t.specs,scripts:r})}async function OQ(e,t){await e("skill.delete",{id:t})}async function _Q(e,t,n){return e("skill.vote",{id:t,vote:n})}async function DQ(e,t,n){return e("skill.revert",{id:t,reason:n})}async function MQ(e,t,n,r,i){return e("skill.review",{id:t,decision:n,reason:r,stagingVersion:i})}async function IQ(e,t,n){return e("skill.submit",{id:t,contributeToTeam:n})}async function LQ(e,t){return e("skill.withdraw",{id:t})}async function hC(e,t){return e("skill.getReview",{id:t})}async function RQ(e,t){return e("skill.history",{id:t})}async function FQ(e,t,n){return e("skill.diff",{id:t,teamDiff:n})}async function YD(e,t,n){return e("skill.rollback",{id:t,version:n})}async function zQ(e){return(await e("label.list")).labels??[]}async function pC(e,t,n){return e("skill.updateLabels",{id:t,labels:n})}async function $Q(e,t,n){return e("skill.fork",{sourceId:t,...n})}async function XD(e,t){return $Q(e,String(t))}function mC(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 X0="siclaw_current_session",Z0="siclaw_session_workspace",gC="siclaw_selected_brain";function Tf(){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 BQ(e,t){try{const n=JSON.parse(t);return ZD(e,n)}catch{return t}}function ZD(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 UQ(){const{currentWorkspace:e}=Ed(),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(()=>localStorage.getItem(f)==="true"),[g,y]=m.useState([]),[b,x]=m.useState(()=>{const B=sessionStorage.getItem(X0);return!B||sessionStorage.getItem(Z0)!==(t??"")?null:B}),[v,w]=m.useState(!1),[k,S]=m.useState([]),[j,N]=m.useState(!1),[P,T]=m.useState(!1),[E,_]=m.useState(!1),[C,A]=m.useState(null),[I,$]=m.useState(!1),oe=m.useRef(!1),[Z,M]=m.useState([]),[K,O]=m.useState(null),[ie,J]=m.useState(null),[D,H]=m.useState([]),[ee,be]=m.useState(null),[ne,ye]=m.useState(null),[Q,re]=m.useState(()=>localStorage.getItem(gC)||"pi-agent"),[ve,L]=m.useState(null),W=m.useRef(()=>{}),z=m.useRef(()=>{}),te=m.useRef(()=>{}),ae=m.useRef(()=>{}),_e=m.useRef(0),We=m.useRef(),Qe=m.useRef(b);m.useEffect(()=>{Qe.current=b},[b]);const Nt=m.useRef(0),hn=m.useRef(async()=>{}),Xt=m.useRef(new Set),xt=(B,G)=>{const se=setTimeout(()=>{Xt.current.delete(se),B()},G);Xt.current.add(se)},rt=()=>{for(const B of Xt.current)clearTimeout(B);Xt.current.clear()},it=()=>{d(null),c(null),s(null)};m.useEffect(()=>{b?(sessionStorage.setItem(X0,b),sessionStorage.setItem(Z0,t??"")):(sessionStorage.removeItem(X0),sessionStorage.removeItem(Z0))},[b,t]),m.useEffect(()=>{localStorage.setItem(f,String(h))},[h]),m.useEffect(()=>{localStorage.setItem(gC,Q)},[Q]);const X=m.useCallback(B=>{re(B)},[]),de=m.useCallback(B=>{var G,se,xe;if(B.type==="event"&&B.payload){const we=B.payload,ke=we.sessionId;if(ke&&ke!==Qe.current)return;switch(_e.current=Date.now(),we.type){case"message_update":{const ce=we.assistantMessageEvent;(ce==null?void 0:ce.type)==="text_delta"&&ce.delta&&i(Se=>{const Pe=Se[Se.length-1];return Pe!=null&&Pe.isStreaming&&Pe.role==="assistant"?[...Se.slice(0,-1),{...Pe,content:Pe.content+ce.delta}]:[...Se,{id:`msg-${Date.now()}`,role:"assistant",content:ce.delta,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),isStreaming:!0}]});break}case"tool_execution_start":{const ce=we.toolName,Se=we.args,Pe=ZD(ce??"",Se),ze=ce==="update_plan"||ce==="manage_checklist"||ce==="end_investigation";if(ce==="deep_search"&&(s(Ee=>Ee??{hypotheses:[]}),d(Ee=>{if(Ee)return Ee;const Ie=Tf();return Ie[0].status="done",Ie[1].status="done",Ie[2].status="in_progress",Ie}),c(Ee=>Ee??"deep_search")),ce==="manage_checklist"){const Ee=(Se==null?void 0:Se.updates)||[];d(Ie=>{const It=Ie?Ie.map(ct=>({...ct})):Tf();for(const ct of Ee){const js=It.find(Ns=>Ns.id===ct.id);js&&(ct.status&&(ct.status==="done"||ct.status==="skipped"||ct.status==="in_progress"||ct.status==="pending")&&(js.status=ct.status),ct.summary&&(js.summary=ct.summary))}const Xn=It.find(ct=>ct.status==="in_progress");return c(Xn?Xn.id:null),It.every(ct=>ct.status==="done"||ct.status==="skipped")&&xt(()=>it(),3e3),It})}ce==="end_investigation"&&it(),i(Ee=>[...Ee,{id:`tool-${Date.now()}`,role:"tool",content:"",toolName:ce??"tool",toolInput:Pe,toolStatus:"running",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),isStreaming:!0,hidden:ze}]);break}case"tool_execution_end":{const ce=we.result,Se=((G=ce==null?void 0:ce.content)==null?void 0:G.filter(Ie=>Ie.type==="text").map(Ie=>Ie.text??"").join(""))??"",Pe=ce==null?void 0:ce.details,ze=we.isError,Ee=we.dbMessageId;i(Ie=>{const It=Ie[Ie.length-1];return(It==null?void 0:It.role)==="tool"&&It.isStreaming?(It.toolName==="deep_search"&&xt(()=>{s(Xn=>Xn&&Xn.hypotheses.every(ur=>ur.status!=="validating"&&ur.status!=="pending")?null:Xn)},5e3),[...Ie.slice(0,-1),{...It,content:Se,toolStatus:ze?"error":"success",isStreaming:!1,...Pe?{toolDetails:Pe}:{},...Ee?{id:Ee}:{}}]):Ie});break}case"tool_progress":{const ce=we.progress;we.toolName==="deep_search"&&ce&&s(Se=>mC(Se??{hypotheses:[]},ce));break}case"message_start":{const ce=we.message;if((ce==null?void 0:ce.customType)==="dp-checklist-sync"&&((se=ce.details)!=null&&se.items)){const Se=ce.details.items;d(Pe=>{if(!Pe)return Pe;const ze=Pe.map(Ie=>({...Ie}));for(const Ie of Se){const It=ze.find(Xn=>Xn.id===Ie.id);It&&(It.status=Ie.status,Ie.summary&&(It.summary=Ie.summary))}return ze.every(Ie=>Ie.status==="done"||Ie.status==="skipped")&&xt(()=>it(),3e3),ze});break}if((ce==null?void 0:ce.role)==="user"){const Se=((xe=ce.content)==null?void 0:xe.filter(Pe=>Pe.type==="text").map(Pe=>Pe.text??"").join(""))??"";Se&&S(Pe=>{const ze=Pe.indexOf(Se);return ze<0?Pe:(i(Ee=>[...Ee,{id:`msg-${Date.now()}`,role:"user",content:Se,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}]),[...Pe.slice(0,ze),...Pe.slice(ze+1)])})}break}case"message_end":{const ce=we.message;if((ce==null?void 0:ce.role)==="toolResult"&&ce.details&&Object.keys(ce.details).length>0){const Se=ce.toolName;i(Pe=>{for(let ze=Pe.length-1;ze>=0;ze--){const Ee=Pe[ze];if(Ee.role==="tool"&&(!Se||Ee.toolName===Se)&&!Ee.toolDetails){const Ie=[...Pe];return Ie[ze]={...Ee,toolDetails:ce.details},Ie}}return Pe})}i(Se=>Se.map(Pe=>Pe.isStreaming&&Pe.role==="assistant"?{...Pe,isStreaming:!1}:Pe));break}case"auto_compaction_start":$(!0);break;case"auto_compaction_end":$(!1),z.current();break;case"turn_end":i(ce=>ce.map(Se=>Se.isStreaming?{...Se,isStreaming:!1}:Se)),S(ce=>ce.length>0?ce.slice(1):ce);break;case"prompt_done":i(ce=>ce.map(Se=>Se.isStreaming?{...Se,isStreaming:!1}:Se)),oe.current||w(!1),S([]),W.current(),z.current(),te.current(),ae.current(),d(ce=>{if(!ce)return ce;const Se=ce.find(Ee=>Ee.id==="hypotheses");if(Se&&Se.status!=="done"&&Se.status!=="skipped"||!ce.some(Ee=>Ee.status==="pending"||Ee.status==="in_progress"))return ce;const ze=ce.map(Ee=>Ee.status==="pending"||Ee.status==="in_progress"?{...Ee,status:"done",summary:Ee.summary||"Auto-completed"}:Ee);return xt(()=>it(),3e3),ze});break}}},[]),{status:Te,sendRpc:fe,isConnected:R}=$t({onMessage:de}),me=m.useCallback(async()=>{if(R)try{const B=await nv(fe);M(B.skills)}catch(B){console.error("Failed to load skills:",B)}},[R,fe]),Oe=m.useCallback(async()=>{if(R)try{const B=await fe("model.list"),G=B.models??[];if(H(G),be(B.default??null),G.length>0)if(B.default){const se=G.find(xe=>xe.provider===B.default.provider&&xe.id===B.default.modelId);ye(se||(xe=>xe??G[0]))}else ye(se=>se??G[0])}catch(B){console.error("Failed to load models:",B)}},[R,fe]),$e=m.useCallback(async()=>{if(R)try{const B=await fe("system.status");O(B)}catch{}},[R,fe]),ht=m.useCallback(async()=>{if(!(!R||!b||ne))try{const B=await fe("model.get",{sessionId:b});B.model&&ye(B.model),B.brainType&&L(B.brainType)}catch{}},[R,b,ne,fe]),et=m.useCallback((B,G)=>{J({id:B,name:G})},[]),pt=m.useCallback(()=>{J(null)},[]),Wt=m.useCallback(async()=>{if(R)try{const B={};t&&(B.workspaceId=t);const G=await fe("session.list",B);y(G.sessions??[])}catch(B){console.error("Failed to load sessions:",B)}},[R,fe,t]);W.current=Wt,te.current=Oe,ae.current=ht;const Ct=m.useCallback(async()=>{if(!(!R||!b))try{const B=await fe("chat.context",{sessionId:b});B&&A({tokens:B.tokens,contextWindow:B.contextWindow,percent:B.percent,inputTokens:B.inputTokens,outputTokens:B.outputTokens,cacheReadTokens:B.cacheReadTokens,cacheWriteTokens:B.cacheWriteTokens,cost:B.cost})}catch{}},[R,b,fe]);z.current=Ct;const le=B=>B.map(G=>({...G,toolInput:G.role==="tool"&&G.toolInput?BQ(G.toolName??"",G.toolInput):void 0,isoTimestamp:G.timestamp,timestamp:G.timestamp?new Date(G.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"",hidden:G.hidden||G.role==="tool"&&(G.toolName==="update_plan"||G.toolName==="manage_checklist")})),Me=m.useCallback(async B=>{if(!R)return;const G=++Nt.current;x(B),i([]),T(!1),N(!0),w(!1),S([]),rt(),it();try{const se=await fe("chat.history",{sessionId:B});if(Nt.current!==G)return;i(le(se.messages??[])),T(se.hasMore??!1)}catch(se){Nt.current===G&&console.error("Failed to load history:",se)}finally{Nt.current===G&&N(!1)}try{const se=await fe("model.get",{sessionId:B});if(Nt.current!==G)return;se.model&&ye(se.model),se.brainType&&L(se.brainType)}catch{}Nt.current===G&&await hn.current(B)},[R,fe]),He=m.useCallback(async()=>{if(!R||!b||!P||E)return;const B=r[0];if(B){_(!0);try{const G=await fe("chat.history",{sessionId:b,before:B.isoTimestamp}),se=le(G.messages??[]);i(xe=>[...se,...xe]),T(G.hasMore??!1)}catch(G){console.error("Failed to load more history:",G)}finally{_(!1)}}},[R,b,P,E,r,fe]),lt=m.useCallback(async B=>{if(!R||!B.trim())return;if(v){try{await fe("chat.steer",{text:B,sessionId:Qe.current}),S(se=>[...se,B])}catch(se){console.error("Failed to steer:",se)}return}B.startsWith("[Deep Investigation]")&&(d(Tf().map(se=>se.id==="triage"?{...se,status:"in_progress"}:se)),c("triage"));const G={id:`user-${Date.now()}`,role:"user",content:B,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};i(se=>[...se,G]),w(!0);try{const se=await fe("chat.send",{sessionId:b,message:B,modelProvider:ne==null?void 0:ne.provider,modelId:ne==null?void 0:ne.id,brainType:Q,workspaceId:t});se.brainType&&L(se.brainType),se.sessionId&&se.sessionId!==b&&(x(se.sessionId),W.current())}catch(se){console.error("Failed to send message:",se),w(!1)}},[R,v,b,ne,Q,fe]),Ss=m.useCallback(async()=>{if(R){oe.current=!0,S([]),rt(),it(),i(B=>B.map(G=>G.isStreaming?{...G,isStreaming:!1,...G.role==="tool"?{toolStatus:"aborted"}:{}}:G));try{await fe("chat.abort",{sessionId:Qe.current})}catch(B){console.error("Failed to abort:",B)}oe.current=!1,w(!1)}},[R,fe]),_o=m.useCallback(async()=>{if(S([]),!!R)try{await fe("chat.clearQueue",{sessionId:Qe.current})}catch(B){console.error("Failed to clear queue:",B)}},[R,fe]),mc=m.useCallback(async B=>{if(S(G=>{const se=[...G];return se.splice(B,1),se}),!!R)try{await fe("chat.clearQueue",{sessionId:Qe.current}),S(G=>{for(const se of G)fe("chat.steer",{text:se,sessionId:Qe.current}).catch(()=>{});return G})}catch(G){console.error("Failed to remove pending message:",G)}},[R,fe]),ks=m.useCallback(async(B,G)=>{if(i(se=>se.map(xe=>xe.id===B?{...xe,metadata:{...xe.metadata,...G}}:xe)),R)try{await fe("message.updateMeta",{id:B,metadata:G})}catch(se){console.error("Failed to persist message metadata:",se)}},[R,fe]),qr=m.useCallback(()=>{rt(),it()},[]),mi=m.useCallback(()=>{qr(),lt(`[DP_EXIT]
|
|
602
|
+
Please briefly summarize the current investigation progress and findings.`)},[qr,lt]),Lg=m.useCallback(B=>{d(G=>G&&G.map(se=>se.id==="triage"&&se.status!=="done"?{...se,status:"done",summary:se.summary||"Done"}:se.id==="hypotheses"&&se.status!=="done"?{...se,status:"done",summary:se.summary||"Confirmed"}:se.id==="deep_search"?{...se,status:"in_progress"}:se)),c("deep_search"),s({hypotheses:B.map(G=>({id:G.id,text:G.text,status:"pending",confidence:G.confidence,callsUsed:0,maxCalls:10}))}),fe("chat.confirmHypotheses",{sessionId:Qe.current}).catch(()=>{})},[fe]),Rg=m.useCallback(()=>{x(null),i([]),A(null),$(!1),w(!1),S([]);const B=ee?D.find(G=>G.provider===ee.provider&&G.id===ee.modelId):null;ye(B??D[0]??null),L(null),rt(),it(),$e()},[D,ee,$e]),F=m.useCallback(async B=>{if(R)try{await fe("session.delete",{sessionId:B}),b===B&&(x(null),i([])),Wt()}catch(G){console.error("Failed to delete session:",G)}},[R,fe,b,Wt]),V=m.useRef();m.useEffect(()=>(!R&&v&&(V.current=setTimeout(()=>{w(!1),oe.current=!1,S([]),i(B=>B.map(G=>G.isStreaming?{...G,isStreaming:!1,...G.role==="tool"?{toolStatus:"error"}:{}}:G)),rt(),d(B=>B?B.map(G=>G.status==="in_progress"||G.status==="pending"?{...G,status:"error",summary:"Connection lost"}:G):null),c(null),s(null),xt(()=>it(),1e4)},15e3)),()=>{V.current&&(clearTimeout(V.current),V.current=void 0)}),[R,v]);const Y=u?45e3:12e4;m.useEffect(()=>{if(v)return _e.current=Date.now(),We.current=setInterval(()=>{Date.now()-_e.current>Y&&(console.warn("[usePilot] Stale loading detected — resetting UI"),w(!1),oe.current=!1,S([]),i(B=>B.map(G=>G.isStreaming?{...G,isStreaming:!1,...G.role==="tool"?{toolStatus:"error"}:{}}:G)),rt(),d(B=>B?B.map(G=>G.status==="in_progress"||G.status==="pending"?{...G,status:"error",summary:"Response timeout"}:G):null),c(null),s(null),xt(()=>it(),1e4))},15e3),()=>clearInterval(We.current);We.current&&(clearInterval(We.current),We.current=void 0)},[v,Y]);const ue=m.useCallback(async B=>{var se;if(!R)return;const G=B??Qe.current;if(G)try{const xe=await fe("chat.dpProgress",{sessionId:G});if(xe.promptActive&&w(!0),!xe.promptActive)return;let we={hypotheses:[]};if(xe.events&&xe.events.length>0){for(const Pe of xe.events)we=mC(we,Pe);s(we)}const ke=we.phase,je=Tf(),ce=ke?parseInt(((se=ke.match(/(\d+)/))==null?void 0:se[1])??"0"):0;if(ce>=1)for(let Pe=0;Pe<je.length;Pe++)Pe<ce-1?je[Pe].status="done":Pe===ce-1&&(je[Pe].status="in_progress");else je[0].status="done",je[1].status="done",je[2].status="in_progress";d(je);const Se=je.find(Pe=>Pe.status==="in_progress");c(Se?Se.id:null)}catch{}},[R,fe]);return hn.current=ue,m.useEffect(()=>{n.current!==t&&n.current!==void 0&&(++Nt.current,x(null),i([]),A(null),$(!1),L(null),rt(),it(),R&&(async()=>{try{const B={};t&&(B.workspaceId=t);const se=(await fe("session.list",B)).sessions??[];y(se),se.length>0&&Me(se[0].key)}catch(B){console.error("Failed to load sessions:",B)}})()),n.current=t},[t]),m.useEffect(()=>{R&&((async()=>{try{const B={};t&&(B.workspaceId=t);const se=(await fe("session.list",B)).sessions??[];y(se),b?Me(b):se.length>0&&Me(se[0].key)}catch(B){console.error("Failed to load sessions:",B)}})(),me(),Oe(),$e())},[R]),m.useEffect(()=>{const B=new BroadcastChannel("siclaw-model-config");return B.onmessage=()=>{te.current()},()=>B.close()},[]),{messages:r,investigationProgress:a,dpActive:h,setDpActive:p,dpFocus:o,dpChecklist:u,sessions:g,currentSessionKey:b,isLoading:v,isLoadingHistory:j,hasMore:P,isLoadingMore:E,contextUsage:C,isCompacting:I,skills:Z,systemStatus:K,editingSkill:ie,pendingMessages:k,wsStatus:Te,isConnected:R,sendMessage:lt,abortResponse:Ss,loadHistory:Me,loadMoreHistory:He,createSession:Rg,deleteSession:F,loadSessions:Wt,setCurrentSessionKey:x,sendRpc:fe,startEditSkill:et,clearEditSkill:pt,loadSkills:me,loadSystemStatus:$e,updateMessageMeta:ks,clearPendingMessages:_o,removePendingMessage:mc,confirmHypotheses:Lg,dismissDpChecklist:qr,exitDpMode:mi,models:D,selectedModel:ne,selectedBrain:Q,selectBrain:X,sessionBrainType:ve}}function VQ(){const[e,t]=m.useState(!1),[n,r]=m.useState(null),i=$i(),a=va(),s=UQ(),{currentWorkspace:o}=Ed(),c=m.useRef(new Set);m.useEffect(()=>{s.loadSystemStatus()},[a]);const u=m.useCallback(()=>{s.clearEditSkill(),s.loadSkills()},[s]),d=m.useCallback(async p=>{(p.toolName==="create_skill"||p.toolName==="update_skill")&&await s.loadSkills(),r(null)},[s]),f=m.useCallback(p=>{r(null)},[]),h=m.useCallback(p=>{r(p)},[]);return m.useEffect(()=>{if(!n)return;const p=n.id;if(!p.startsWith("tool-")&&!p.startsWith("msg-"))return;const g=s.messages.find(y=>y.content===n.content&&y.toolName===n.toolName);g&&g.id!==n.id&&r(g)},[s.messages,n]),m.useEffect(()=>{const p=s.messages;if(p.length!==0)for(let g=p.length-1;g>=0;g--){const y=p[g];if(y.role!=="tool"||y.isStreaming||!y.content||y.isoTimestamp||y.toolName!=="create_skill"&&y.toolName!=="update_skill")continue;const b=`${y.toolName}:${y.content.slice(0,200)}`;if(c.current.has(b))continue;try{const v=JSON.parse(y.content);if(!(v!=null&&v.skill))continue}catch{continue}const x=y.metadata;if(!((x==null?void 0:x.skillCard)==="saved"||(x==null?void 0:x.skillCard)==="dismissed")){c.current.add(b),r(y);break}}},[s.messages]),l.jsxs("div",{className:"flex h-full relative bg-white overflow-hidden font-sans",children:[l.jsx(li,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(cn.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(cn.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(Ze,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 overflow-hidden",children:l.jsx(gG,{sessions:s.sessions,currentSessionKey:s.currentSessionKey,onSelectSession:p=>{s.loadHistory(p),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(lw,{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(In,{className:"w-5 h-5"})})})]}),l.jsx("div",{className:"flex-1 pt-16 flex flex-col min-h-0",children:l.jsx(VG,{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:u,onOpenSkillPanel:h,onOpenSchedulePanel:h,selectedWorkspaceId:(o==null?void 0:o.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})})]}),n&&(n.toolName==="create_skill"||n.toolName==="update_skill"?l.jsx(JG,{message:n,sendRpc:s.sendRpc,skills:s.skills,onSave:d,onDismiss:f,onClose:()=>r(null),updateMessageMeta:s.updateMessageMeta}):n.toolName==="manage_schedule"?l.jsx(eq,{message:n,sendRpc:s.sendRpc,onSave:d,onDismiss:f,onClose:()=>r(null),updateMessageMeta:s.updateMessageMeta,selectedWorkspaceId:(o==null?void 0:o.id)??null}):null)]})}const ut=({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(li,{children:i&&l.jsx(cn.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:`
|
|
603
|
+
relative px-3 py-1.5 text-xs font-semibold text-gray-700 bg-white
|
|
604
|
+
border border-gray-100 rounded-lg shadow-[0_4px_12px_-2px_rgba(0,0,0,0.08)]
|
|
605
|
+
whitespace-nowrap select-none
|
|
606
|
+
${n==="top"?"-translate-x-1/2 -translate-y-full":""}
|
|
607
|
+
${n==="bottom"?"-translate-x-1/2":""}
|
|
608
|
+
${n==="left"?"-translate-x-full -translate-y-1/2":""}
|
|
609
|
+
${n==="right"?"-translate-y-1/2":""}
|
|
610
|
+
`,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:X7,iconColor:"text-primary-600",iconBg:"bg-primary-50",button:"bg-primary-600 hover:bg-primary-700 focus:ring-primary-100"},danger:{icon:Ai,iconColor:"text-red-600",iconBg:"bg-red-50",button:"bg-red-600 hover:bg-red-700 focus:ring-red-100"},warning:{icon:Sr,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(Ze,{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 yC=30;function WQ(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,I=C??f;d(A),h(I),i(!0);try{const $=await nv(e,{limit:yC,offset:0,scope:A==="all"||A==="approvals"?void 0:A,search:I||void 0,pendingOnly:A==="approvals"?!0:void 0});n($.skills),c($.hasMore)}catch($){console.error("[useSkills] Failed to load:",$)}finally{i(!1)}},[e,u,f]),g=m.useCallback(async()=>{if(!(a||!o)){s(!0);try{const _=await nv(e,{limit:yC,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(I=>I.name===_.name?{...I,enabled:C}:I))}catch(A){console.error("[useSkills] toggleEnabled failed:",A)}},[e]),b=m.useCallback(async(_,C)=>{await e("skill.submit",{id:String(_.id),contributeToTeam:C}),await p()},[e,p]),x=m.useCallback(async _=>{await IQ(e,String(_.id)),await p()},[e,p]),v=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]),k=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]),S=m.useCallback(async _=>{try{await XD(e,String(_.id)),await p()}catch(C){console.error("[useSkills] copyToPersonal failed:",C)}},[e,p]),j=m.useCallback(async(_,C)=>{try{const A=await _Q(e,String(_.id),C);n(I=>I.map($=>$.id===_.id?{...$,upvotes:A.upvotes,downvotes:A.downvotes,userVote:A.userVote}:$))}catch(A){console.error("[useSkills] voteSkill failed:",A)}},[e]),N=m.useCallback(async(_,C)=>{try{await DQ(e,String(_.id),C),await p()}catch(A){console.error("[useSkills] revertSkill failed:",A)}},[e,p]),P=m.useCallback(async(_,C,A,I)=>{await MQ(e,String(_.id),C,A,I),await p()},[e,p]),T=m.useCallback(async(_,C)=>{try{await YD(e,String(_.id),C),await p()}catch(A){console.error("[useSkills] rollbackSkill failed:",A)}},[e,p]),E=m.useCallback(async _=>{try{(await LQ(e,String(_.id))).wasNew?n(A=>A.filter(I=>I.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:b,requestPublish:x,approveSkill:v,rejectSkill:w,deleteSkill:k,copyToPersonal:S,voteSkill:j,revertSkill:N,reviewSkill:P,withdrawSkill:E,rollbackSkill:T}}function ic(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 HQ(){var fe;const e=$i(),[t,n]=bd(),{sendRpc:r,isConnected:i}=$t(),{skills:a,isLoading:s,isLoadingMore:o,hasMore:c,loadSkills:u,loadMore:d,toggleEnabled:f,requestPublish:h,publishSkill:p,copyToPersonal:g,approveSkill:y,rejectSkill:b,deleteSkill:x,voteSkill:v,revertSkill:w,reviewSkill:k,withdrawSkill:S}=WQ(r),j=cs(),N=(j==null?void 0:j.username)==="admin",{isReviewer:P}=ic(r,i),T=t.get("tab"),E=sessionStorage.getItem("skills_tab"),[_,C]=m.useState(T||E||"all"),[A,I]=m.useState(""),[$,oe]=m.useState(new Set),[Z,M]=m.useState(!1),[K,O]=m.useState([]),ie=m.useRef(null),J=m.useRef(),D=m.useRef(null),H={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"},ee={Environment:["kubernetes","bare-metal","switch"],Domain:["network","rdma","scheduling","storage","compute","general"],Operation:["diagnostic","monitoring","performance","configuration"],...N?{Role:["sre","developer"]}:{}},be=m.useMemo(()=>{const R=new Set(K.map(et=>et.label)),me=new Map(K.map(et=>[et.label,et.count])),Oe=[],$e=new Set;for(const[et,pt]of Object.entries(ee)){const Wt=pt.filter(Ct=>R.has(Ct)).map(Ct=>({label:Ct,count:me.get(Ct)??0}));Wt.length>0&&(Oe.push({group:et,labels:Wt}),Wt.forEach(Ct=>$e.add(Ct.label)))}const ht=K.filter(et=>!$e.has(et.label)).map(et=>({label:et.label,count:et.count}));return ht.length>0&&Oe.push({group:"Other",labels:ht}),Oe},[K,N]),ne=R=>{oe(me=>{const Oe=new Set(me);return Oe.has(R)?Oe.delete(R):Oe.add(R),Oe})};m.useEffect(()=>{if(!Z)return;const R=me=>{ie.current&&!ie.current.contains(me.target)&&M(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[Z]);const ye=R=>{const me=R.target.value;I(me),clearTimeout(J.current),J.current=setTimeout(()=>{u(_,me)},300)},Q=R=>{C(R),sessionStorage.setItem("skills_tab",R),n(R==="all"?{}:{tab:R}),u(R,A)},re=m.useCallback(()=>{const R=D.current;!R||o||!c||R.scrollHeight-R.scrollTop-R.clientHeight<200&&d()},[o,c,d]),[ve,L]=m.useState({isOpen:!1,skill:null,reason:""}),[W,z]=m.useState({isOpen:!1,title:"",description:"",variant:"primary",confirmText:"Confirm",onConfirm:()=>{}}),te=()=>z(R=>({...R,isOpen:!1})),ae=m.useRef(!1);m.useEffect(()=>{i&&!ae.current&&(ae.current=!0,u(_,""),zQ(r).then(O).catch(()=>{}))},[i]),m.useEffect(()=>{const R=t.get("tab");if(!R)return;const me=R;me!==_&&(C(me),sessionStorage.setItem("skills_tab",me),u(me,A))},[t]);const _e=$.size===0?a:a.filter(R=>{const me=R.labels??[];return[...$].every(Oe=>me.includes(Oe))}),We=()=>e("/skills/new"),Qe=(R,me)=>{R.stopPropagation(),f(me)},Nt=R=>{z({isOpen:!0,title:"Error",description:R,variant:"warning",confirmText:"OK",onConfirm:()=>{}})},hn=(R,me)=>{R.stopPropagation(),z({isOpen:!0,title:"Publish Skill",description:`Are you sure you want to publish "${me.name}"? It will be reviewed by an admin before becoming available in production.`,variant:"primary",confirmText:"Request Publish",onConfirm:()=>{h(me).catch(Oe=>Nt((Oe==null?void 0:Oe.message)||String(Oe)))}})},Xt=(R,me)=>{R.stopPropagation(),z({isOpen:!0,title:"Contribute to Team",description:`Contribute "${me.name}" to the team? An admin will review before it becomes a shared team skill.`,variant:"primary",confirmText:"Contribute",onConfirm:()=>{p(me,!0).catch(Oe=>Nt((Oe==null?void 0:Oe.message)||String(Oe)))}})},xt=(R,me)=>{R.stopPropagation(),z({isOpen:!0,title:"Fork to Personal",description:`This will fork "${me.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(me)}})},rt=(R,me,Oe)=>{R.stopPropagation(),v(me,Oe)},it=(R,me)=>{R.stopPropagation(),L({isOpen:!0,skill:me,reason:""})},X=()=>{ve.skill&&w(ve.skill,ve.reason||void 0),L({isOpen:!1,skill:null,reason:""})},de=(R,me)=>{R.stopPropagation(),z({isOpen:!0,title:"Withdraw Publish Request",description:`Withdraw the publish request for "${me.name}"? The skill will revert to its previous state.`,variant:"warning",confirmText:"Withdraw",onConfirm:()=>{S(me)}})},Te=(R,me)=>{R.stopPropagation(),z({isOpen:!0,title:"Delete Skill",description:`Are you sure you want to permanently delete "${me.name}"? This action cannot be undone.`,variant:"danger",confirmText:"Delete",onConfirm:()=>{x(me)}})};return l.jsxs("div",{className:"h-full bg-white flex flex-col relative",children:[l.jsx(no,{isOpen:W.isOpen,onClose:te,onConfirm:W.onConfirm,title:W.title,description:W.description,variant:W.variant,confirmText:W.confirmText}),ve.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:()=>L({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(Nx,{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 "',(fe=ve.skill)==null?void 0:fe.name,`" back to the author's personal library.`]}),l.jsx("textarea",{value:ve.reason,onChange:R=>L(me=>({...me,reason:R.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:()=>L({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:X,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:uw},{id:"builtin",label:"System Skills",icon:hw},{id:"team",label:"Team Skills",icon:ta},{id:"personal",label:"My Skills",icon:Vu}].map(R=>l.jsx("button",{onClick:()=>Q(R.id),className:U("flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-all border",_===R.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:R.label},R.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:()=>Q("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(Wj,{className:"w-3.5 h-3.5"}),"Approvals",a.filter(R=>R.contributionStatus==="pending"||R.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(R=>R.contributionStatus==="pending"||R.reviewStatus==="pending").length})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative group",children:[l.jsx(Hn,{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:ye,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(ut,{content:"Create Skill",children:l.jsx("button",{onClick:We,className:"p-2 rounded-lg text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-all",children:l.jsx(In,{className:"w-5 h-5"})})})]})]}),K.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:ie,className:"relative",children:[l.jsxs("button",{onClick:()=>M(R=>!R),className:U("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border transition-all",Z?"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(mw,{className:"w-3 h-3"}),"Labels",$.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:$.size}),l.jsx(ea,{className:U("w-3 h-3 transition-transform",Z&&"rotate-180")})]}),Z&&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:be.map(({group:R,labels:me})=>l.jsxs("div",{children:[l.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold uppercase tracking-wider text-gray-400",children:R}),me.map(({label:Oe,count:$e})=>l.jsxs("button",{onClick:()=>ne(Oe),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",$.has(Oe)?"bg-gray-700 border-gray-700 text-white":"border-gray-300"),children:$.has(Oe)&&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",H[Oe]||"bg-gray-50 text-gray-600 border-gray-200"),children:Oe}),l.jsx("span",{className:"ml-auto text-gray-400 text-[10px]",children:$e})]},Oe))]},R))})]}),[...$].map(R=>l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",H[R]||"bg-gray-100 text-gray-700 border-gray-300"),children:[R,l.jsx("button",{onClick:()=>ne(R),className:"hover:opacity-70",children:l.jsx(Ze,{className:"w-3 h-3"})})]},R)),$.size>0&&l.jsx("button",{onClick:()=>oe(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:re,className:"flex-1 overflow-y-auto p-8",children:[s?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Fe,{className:"w-6 h-6 animate-spin text-gray-400"})}):_==="approvals"?l.jsxs("div",{className:"max-w-4xl mx-auto space-y-4",children:[_e.map(R=>{const me=R.reviewStatus==="pending",Oe=R.contributionStatus==="pending";return l.jsx(GQ,{skill:R,isScriptReview:me,isContributionReview:Oe,isAdmin:P,sendRpc:r,onApproveContribution:async()=>{await y(R)},onRejectContribution:async $e=>{await b(R,$e)},onReviewDecision:async($e,ht,et)=>{await k(R,$e,ht,et)},onNavigate:()=>e(`/skills/${R.id}`)},R.id)}),_e.length===0&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-gray-400 text-sm",children:[l.jsx(Wj,{className:"w-8 h-8 mb-3 opacity-20"}),"No pending approvals"]})]}):l.jsx("div",{className:"max-w-6xl mx-auto",children:_e.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:[_e.map(R=>l.jsxs("div",{className:U("group rounded-xl border p-6 hover:shadow-md transition-all duration-200 flex flex-col relative overflow-hidden",R.reviewStatus==="pending"?"bg-amber-50/30 border-amber-100":R.reviewStatus==="draft"?"bg-gray-50/50 border-gray-200":R.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",R.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(R.icon,{className:U("w-4 h-4",R.enabled?"text-gray-700":"text-gray-400")})}),l.jsx(qQ,{enabled:R.enabled,onToggle:me=>Qe(me,R),disabled:R.reviewStatus==="pending"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("h3",{className:U("font-bold mb-1",R.enabled?"text-gray-900":"text-gray-400"),children:R.name}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mb-2",children:[R.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"]}),R.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"}),R.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(Bu,{className:"w-2.5 h-2.5"}),"Pending Publish"]}),R.reviewStatus==="approved"&&(R.scope==="personal"||R.scope==="team")&&(()=>{const me=Number(String(R.version).replace(/^v/,""));return R.publishedVersion!=null&&me>R.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"]})})(),R.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",R.enabled?"text-gray-500":"text-gray-400"),children:R.description}),R.labels&&R.labels.length>0&&(()=>{const Oe=R.labels.slice(0,3),$e=R.labels.length-3;return l.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[Oe.map(ht=>l.jsx("span",{onClick:et=>{et.stopPropagation(),ne(ht)},className:U("px-1.5 py-0.5 rounded text-[10px] font-medium border cursor-pointer hover:opacity-80 transition-opacity",H[ht]||"bg-gray-50 text-gray-600 border-gray-200"),children:ht},ht)),$e>0&&l.jsx(ut,{content:R.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:["+",$e]})})]})})()]}),R.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:me=>rt(me,R,1),className:U("flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors",R.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(e_,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:R.upvotes||0})]}),l.jsxs("button",{onClick:me=>rt(me,R,-1),className:U("flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors",R.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(JO,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:R.downvotes||0})]})]}),l.jsxs("div",{className:U("pt-4 border-t border-gray-50 flex items-center justify-between",R.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",R.scope==="builtin"?"bg-gray-100 text-gray-700":R.scope==="team"?"bg-blue-50 text-blue-700":"bg-purple-50 text-purple-700"),children:[R.scope==="builtin"&&l.jsx(Qh,{className:"w-3 h-3"}),R.scope==="builtin"?"System":R.scope==="team"?"Team":"Personal"]}),(R.scope==="team"||R.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:R.version})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[R.scope==="personal"&&R.reviewStatus==="pending"&&l.jsx(ut,{content:"Withdraw",children:l.jsx("button",{onClick:me=>de(me,R),className:"p-1.5 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded-lg transition-colors",children:l.jsx(ZO,{className:"w-4 h-4"})})}),R.scope==="personal"&&R.reviewStatus!=="pending"&&l.jsx(ut,{content:"Request Publish",children:l.jsx("button",{onClick:me=>hn(me,R),className:"p-1.5 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",children:l.jsx(uB,{className:"w-4 h-4"})})}),R.scope==="personal"&&R.reviewStatus==="approved"&&R.contributionStatus!=="pending"&&l.jsx(ut,{content:"Contribute to Team",children:l.jsx("button",{onClick:me=>Xt(me,R),className:"p-1.5 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",children:l.jsx(t_,{className:"w-4 h-4"})})}),R.scope!=="personal"&&l.jsx(ut,{content:"Fork to Personal",children:l.jsx("button",{onClick:me=>xt(me,R),className:"p-1.5 text-gray-400 hover:text-purple-600 hover:bg-purple-50 rounded-lg transition-colors",children:l.jsx(ow,{className:"w-4 h-4"})})}),N&&R.scope==="team"&&l.jsx(ut,{content:"Revert to Personal",children:l.jsx("button",{onClick:me=>it(me,R),className:"p-1.5 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded-lg transition-colors",children:l.jsx(Nx,{className:"w-4 h-4"})})}),(R.scope==="personal"||N&&R.scope==="team")&&l.jsx(ut,{content:"Version History",children:l.jsx("button",{onClick:me=>{me.stopPropagation(),e(`/skills/${R.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(YO,{className:"w-4 h-4"})})}),l.jsx(ut,{content:R.scope==="personal"?"Configure Skill":"View Details",children:l.jsx("button",{onClick:()=>e(`/skills/${R.id}`),className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",children:R.scope==="personal"?l.jsx(Pm,{className:"w-4 h-4"}):l.jsx(wd,{className:"w-4 h-4"})})}),(R.scope==="personal"||N&&R.scope==="team")&&l.jsx(ut,{content:"Delete Skill",children:l.jsx("button",{onClick:me=>Te(me,R),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:l.jsx(sr,{className:"w-4 h-4"})})})]})]})]},R.id)),_==="personal"&&l.jsxs("button",{onClick:We,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(In,{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(Fe,{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"},KQ={critical:Ai,high:Ai,medium:Ai,low:jm};function GQ({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,b]=m.useState(!1),[x,v]=m.useState(""),[w,k]=m.useState(!1),[S,j]=m.useState(new Set),[N,P]=m.useState(null),[T,E]=m.useState(!1),[_,C]=m.useState(!1),[A,I]=m.useState({isOpen:!1,title:"",description:"",variant:"primary",confirmText:"",onConfirm:()=>{}}),[$,oe]=m.useState({isOpen:!1,message:""}),Z=async()=>{if(u){d(!1);return}d(!0),b(!0);try{const H=[rv(i,String(e.id)),hC(i,String(e.id))],ee=await Promise.all(H);g(ee[0]),ee[1]&&h(ee[1].reviews)}catch(H){console.error("[Approvals] Failed to load review data:",H)}finally{b(!1)}},M=async()=>{if(N!==null){C(!_);return}E(!0),C(!0);try{const H=await FQ(i,String(e.id),n);P(H.diff||"No changes detected.")}catch(H){console.error("[Approvals] Failed to load diff:",H),P("Failed to load diff.")}finally{E(!1)}},K=async H=>{k(!0);try{t?await o(H,x||void 0,p==null?void 0:p.stagingVersion):n&&(H==="approve"?await a():await s(x||void 0))}catch(ee){const be=(ee==null?void 0:ee.message)||String(ee);be.includes("STAGING_VERSION_CONFLICT")?oe({isOpen:!0,message:"Content has changed since you reviewed it. Please reload and review again."}):oe({isOpen:!0,message:be})}finally{k(!1)}},O=H=>{I(H==="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:()=>K("approve")}:{isOpen:!0,title:"Reject Skill",description:`Are you sure you want to reject "${e.name}"?${x?"":" You can add a reason above before confirming."}`,variant:"danger",confirmText:"Reject",onConfirm:()=>K("reject")})},ie=H=>{j(ee=>{const be=new Set(ee);return be.has(H)?be.delete(H):be.add(H),be})},J=f.find(H=>H.reviewerType==="ai");m.useEffect(()=>{if(!u||J||!e.id)return;const H=setInterval(async()=>{try{const ee=await hC(i,String(e.id));ee!=null&&ee.reviews&&ee.reviews.find(ne=>ne.reviewerType==="ai")&&(h(ee.reviews),clearInterval(H))}catch{}},3e3);return()=>clearInterval(H)},[u,J,e.id,i]);const D={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:Vu}}[e.scope]||{label:e.scope,cls:"bg-gray-100 text-gray-600",icon:Vu};return 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:()=>I(H=>({...H,isOpen:!1})),onConfirm:A.onConfirm,title:A.title,description:A.description,variant:A.variant,confirmText:A.confirmText}),l.jsx(no,{isOpen:$.isOpen,onClose:()=>oe({isOpen:!1,message:""}),onConfirm:()=>{},title:"Operation Failed",description:$.message,variant:"danger",confirmText:"OK"}),l.jsxs("div",{className:"p-4 flex items-center justify-between cursor-pointer",onClick:Z,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(Bu,{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",D.cls),children:[l.jsx(D.icon,{className:"w-2.5 h-2.5"}),D.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(eB,{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"]}),J&&l.jsx("span",{className:U("px-1.5 py-0.5 rounded-full text-[10px] font-bold border uppercase",Of[J.riskLevel]||Of.low),children:J.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(ut,{content:"View in Editor",children:l.jsx("button",{onClick:H=>{H.stopPropagation(),c()},className:"p-2 text-gray-400 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(wd,{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(Fe,{className:"w-5 h-5 animate-spin text-gray-400"})}):l.jsxs(l.Fragment,{children:[J&&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[J.riskLevel]||Of.low),children:J.riskLevel})]}),l.jsx("p",{className:"text-sm text-gray-600 mb-3",children:J.summary}),J.findings&&J.findings.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("span",{className:"text-xs font-medium text-gray-500",children:[J.findings.length," finding(s):"]}),J.findings.map((H,ee)=>{const be=KQ[H.severity]||jm;return l.jsxs("div",{className:U("flex items-start gap-2 p-2 rounded-md text-sm border",H.severity==="critical"?"bg-red-50/50 border-red-100":H.severity==="high"?"bg-orange-50/50 border-orange-100":H.severity==="medium"?"bg-yellow-50/50 border-yellow-100":"bg-gray-50 border-gray-100"),children:[l.jsx(be,{className:U("w-4 h-4 mt-0.5 shrink-0",H.severity==="critical"?"text-red-500":H.severity==="high"?"text-orange-500":H.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:H.description}),H.lineRef&&l.jsxs("span",{className:"text-gray-400 text-xs ml-2",children:["(",H.lineRef,")"]}),H.snippet&&l.jsx("pre",{className:"mt-1 text-xs bg-gray-100 rounded px-2 py-1 overflow-x-auto text-gray-600",children:H.snippet})]})]},ee)})]})]}),!J&&l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4 text-center text-sm text-gray-400",children:[l.jsx(Fe,{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:M,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(YO,{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(Fe,{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(`
|
|
611
|
+
`).map((H,ee)=>l.jsx("div",{className:U(H.startsWith("+")&&!H.startsWith("+++")?"text-green-400 bg-green-950/30":H.startsWith("-")&&!H.startsWith("---")?"text-red-400 bg-red-950/30":H.startsWith("@@")?"text-cyan-400":"text-[#d4d4d4]"),children:H},ee))})})]}),(()=>{const H=p==null?void 0:p.scripts;return H&&H.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:H.map(ee=>l.jsxs("div",{className:"border border-gray-100 rounded-lg overflow-hidden",children:[l.jsxs("button",{onClick:()=>ie(ee.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",ee.info==="python"?"bg-blue-50 text-blue-600":"bg-green-50 text-green-600"),children:ee.info==="python"?l.jsx(Ga,{className:"w-3 h-3"}):l.jsx(si,{className:"w-3 h-3"})}),l.jsx("span",{className:"font-medium text-gray-700 flex-1",children:ee.name}),S.has(ee.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"})]}),S.has(ee.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:ee.content})]},ee.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:x,onChange:H=>v(H.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:()=>O("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(Ze,{className:"w-4 h-4"}),"Reject"]}),l.jsxs("button",{onClick:()=>O("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 qQ({enabled:e,onToggle:t,disabled:n}){return l.jsx(ut,{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 QD={},an=Dn&&Dn.__assign||function(){return an=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},an.apply(this,arguments)},YQ=Dn&&Dn.__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]}),XQ=Dn&&Dn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ZQ=Dn&&Dn.__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)&&YQ(t,e,n);return XQ(t,e),t},QQ=Dn&&Dn.__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(QD,"__esModule",{value:!0});var Tr=ZQ(m),JQ=89,_f=90,eJ=77,xC=57,vC=219,bC=222,wC=192,SC=100,tJ=3e3,nJ=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),Q0=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),xh="npm__react-simple-code-editor__textarea",rJ=`
|
|
612
|
+
/**
|
|
613
|
+
* Reset the text fill color so that placeholder is visible
|
|
614
|
+
*/
|
|
615
|
+
.`.concat(xh,`:empty {
|
|
616
|
+
-webkit-text-fill-color: inherit !important;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Hack to apply on some CSS on IE10 and IE11
|
|
621
|
+
*/
|
|
622
|
+
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
|
623
|
+
/**
|
|
624
|
+
* IE doesn't support '-webkit-text-fill-color'
|
|
625
|
+
* So we use 'color: transparent' to make the text transparent on IE
|
|
626
|
+
* Unlike other browsers, it doesn't affect caret color in IE
|
|
627
|
+
*/
|
|
628
|
+
.`).concat(xh,` {
|
|
629
|
+
color: transparent !important;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.`).concat(xh,`::selection {
|
|
633
|
+
background-color: #accef7 !important;
|
|
634
|
+
color: transparent !important;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
`),iJ=Tr.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,b=t.onFocus,x=t.onKeyDown,v=t.onKeyUp,w=t.onValueChange,k=t.padding,S=k===void 0?0:k,j=t.placeholder,N=t.preClassName,P=t.readOnly,T=t.required,E=t.style,_=t.tabSize,C=_===void 0?2:_,A=t.textareaClassName,I=t.textareaId,$=t.value,oe=QQ(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"]),Z=Tr.useRef({stack:[],offset:-1}),M=Tr.useRef(null),K=Tr.useState(!0),O=K[0],ie=K[1],J={paddingTop:typeof S=="object"?S.top:S,paddingRight:typeof S=="object"?S.right:S,paddingBottom:typeof S=="object"?S.bottom:S,paddingLeft:typeof S=="object"?S.left:S},D=s($),H=function(W,z){return W.substring(0,z).split(`
|
|
638
|
+
`)},ee=Tr.useCallback(function(W,z){var te,ae,_e;z===void 0&&(z=!1);var We=Z.current,Qe=We.stack,Nt=We.offset;if(Qe.length&&Nt>-1){Z.current.stack=Qe.slice(0,Nt+1);var hn=Z.current.stack.length;if(hn>SC){var Xt=hn-SC;Z.current.stack=Qe.slice(Xt,hn),Z.current.offset=Math.max(Z.current.offset-Xt,0)}}var xt=Date.now();if(z){var rt=Z.current.stack[Z.current.offset];if(rt&&xt-rt.timestamp<tJ){var it=/[^a-z0-9]([a-z0-9]+)$/i,X=(te=H(rt.value,rt.selectionStart).pop())===null||te===void 0?void 0:te.match(it),de=(ae=H(W.value,W.selectionStart).pop())===null||ae===void 0?void 0:ae.match(it);if(X!=null&&X[1]&&(!((_e=de==null?void 0:de[1])===null||_e===void 0)&&_e.startsWith(X[1]))){Z.current.stack[Z.current.offset]=an(an({},W),{timestamp:xt});return}}}Z.current.stack.push(an(an({},W),{timestamp:xt})),Z.current.offset++},[]),be=Tr.useCallback(function(){var W=M.current;if(W){var z=W.value,te=W.selectionStart,ae=W.selectionEnd;ee({value:z,selectionStart:te,selectionEnd:ae})}},[ee]),ne=function(W){var z=M.current;z&&(z.value=W.value,z.selectionStart=W.selectionStart,z.selectionEnd=W.selectionEnd,w==null||w(W.value))},ye=function(W){var z=M.current,te=Z.current.stack[Z.current.offset];te&&z&&(Z.current.stack[Z.current.offset]=an(an({},te),{selectionStart:z.selectionStart,selectionEnd:z.selectionEnd})),ee(W),ne(W)},Q=function(){var W=Z.current,z=W.stack,te=W.offset,ae=z[te-1];ae&&(ne(ae),Z.current.offset=Math.max(te-1,0))},re=function(){var W=Z.current,z=W.stack,te=W.offset,ae=z[te+1];ae&&(ne(ae),Z.current.offset=Math.min(te+1,z.length-1))},ve=function(W){if(!(x&&(x(W),W.defaultPrevented))){W.key==="Escape"&&W.currentTarget.blur();var z=W.currentTarget,te=z.value,ae=z.selectionStart,_e=z.selectionEnd,We=(d?" ":" ").repeat(C);if(W.key==="Tab"&&!c&&O)if(W.preventDefault(),W.shiftKey){var Qe=H(te,ae),Nt=Qe.length-1,hn=H(te,_e).length-1,Xt=te.split(`
|
|
639
|
+
`).map(function($e,ht){return ht>=Nt&&ht<=hn&&$e.startsWith(We)?$e.substring(We.length):$e}).join(`
|
|
640
|
+
`);if(te!==Xt){var xt=Qe[Nt];ye({value:Xt,selectionStart:xt!=null&&xt.startsWith(We)?ae-We.length:ae,selectionEnd:_e-(te.length-Xt.length)})}}else if(ae!==_e){var Qe=H(te,ae),rt=Qe.length-1,it=H(te,_e).length-1,xt=Qe[rt];ye({value:te.split(`
|
|
641
|
+
`).map(function(et,pt){return pt>=rt&&pt<=it?We+et:et}).join(`
|
|
642
|
+
`),selectionStart:xt&&/\S/.test(xt)?ae+We.length:ae,selectionEnd:_e+We.length*(it-rt+1)})}else{var X=ae+We.length;ye({value:te.substring(0,ae)+We+te.substring(_e),selectionStart:X,selectionEnd:X})}else if(W.key==="Backspace"){var de=ae!==_e,Te=te.substring(0,ae);if(Te.endsWith(We)&&!de){W.preventDefault();var X=ae-We.length;ye({value:te.substring(0,ae-We.length)+te.substring(_e),selectionStart:X,selectionEnd:X})}}else if(W.key==="Enter"){if(ae===_e){var fe=H(te,ae).pop(),R=fe==null?void 0:fe.match(/^\s+/);if(R!=null&&R[0]){W.preventDefault();var me=`
|
|
643
|
+
`+R[0],X=ae+me.length;ye({value:te.substring(0,ae)+me+te.substring(_e),selectionStart:X,selectionEnd:X})}}}else if(W.keyCode===xC||W.keyCode===vC||W.keyCode===bC||W.keyCode===wC){var Oe=void 0;W.keyCode===xC&&W.shiftKey?Oe=["(",")"]:W.keyCode===vC?W.shiftKey?Oe=["{","}"]:Oe=["[","]"]:W.keyCode===bC?W.shiftKey?Oe=['"','"']:Oe=["'","'"]:W.keyCode===wC&&!W.shiftKey&&(Oe=["`","`"]),ae!==_e&&Oe&&(W.preventDefault(),ye({value:te.substring(0,ae)+Oe[0]+te.substring(ae,_e)+Oe[1]+te.substring(_e),selectionStart:ae,selectionEnd:_e+2}))}else(Q0?W.metaKey&&W.keyCode===_f:W.ctrlKey&&W.keyCode===_f)&&!W.shiftKey&&!W.altKey?(W.preventDefault(),Q()):(Q0?W.metaKey&&W.keyCode===_f&&W.shiftKey:nJ?W.ctrlKey&&W.keyCode===JQ:W.ctrlKey&&W.keyCode===_f&&W.shiftKey)&&!W.altKey?(W.preventDefault(),re()):W.keyCode===eJ&&W.ctrlKey&&(!Q0||W.shiftKey)&&(W.preventDefault(),ie(function($e){return!$e}))}},L=function(W){var z=W.currentTarget,te=z.value,ae=z.selectionStart,_e=z.selectionEnd;ee({value:te,selectionStart:ae,selectionEnd:_e},!0),w(te)};return Tr.useEffect(function(){be()},[be]),Tr.useImperativeHandle(n,function(){return{get session(){return{history:Z.current}},set session(W){Z.current=W.history}}},[]),Tr.createElement("div",an({},oe,{style:an(an({},Dc.container),E)}),Tr.createElement("pre",an({className:N,"aria-hidden":"true",style:an(an(an({},Dc.editor),Dc.highlight),J)},typeof D=="string"?{dangerouslySetInnerHTML:{__html:D+"<br />"}}:{children:D})),Tr.createElement("textarea",{ref:function(W){return M.current=W},style:an(an(an({},Dc.editor),Dc.textarea),J),className:xh+(A?" ".concat(A):""),id:I,value:$,onChange:L,onKeyDown:ve,onClick:y,onKeyUp:v,onFocus:b,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}),Tr.createElement("style",{dangerouslySetInnerHTML:{__html:rJ}}))}),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"}},aJ=QD.default=iJ,JD={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
644
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
645
|
+
*
|
|
646
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
647
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
648
|
+
* @namespace
|
|
649
|
+
* @public
|
|
650
|
+
*/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 v(w){return w instanceof c?new c(w.type,v(w.content),w.alias):Array.isArray(w)?w.map(v):w.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(v){return Object.prototype.toString.call(v).slice(8,-1)},objId:function(v){return v.__id||Object.defineProperty(v,"__id",{value:++a}),v.__id},clone:function v(w,k){k=k||{};var S,j;switch(o.util.type(w)){case"Object":if(j=o.util.objId(w),k[j])return k[j];S={},k[j]=S;for(var N in w)w.hasOwnProperty(N)&&(S[N]=v(w[N],k));return S;case"Array":return j=o.util.objId(w),k[j]?k[j]:(S=[],k[j]=S,w.forEach(function(P,T){S[T]=v(P,k)}),S);default:return w}},getLanguage:function(v){for(;v;){var w=i.exec(v.className);if(w)return w[1].toLowerCase();v=v.parentElement}return"none"},setLanguage:function(v,w){v.className=v.className.replace(RegExp(i,"gi"),""),v.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(S){var v=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(S.stack)||[])[1];if(v){var w=document.getElementsByTagName("script");for(var k in w)if(w[k].src==v)return w[k]}return null}},isActive:function(v,w,k){for(var S="no-"+w;v;){var j=v.classList;if(j.contains(w))return!0;if(j.contains(S))return!1;v=v.parentElement}return!!k}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(v,w){var k=o.util.clone(o.languages[v]);for(var S in w)k[S]=w[S];return k},insertBefore:function(v,w,k,S){S=S||o.languages;var j=S[v],N={};for(var P in j)if(j.hasOwnProperty(P)){if(P==w)for(var T in k)k.hasOwnProperty(T)&&(N[T]=k[T]);k.hasOwnProperty(P)||(N[P]=j[P])}var E=S[v];return S[v]=N,o.languages.DFS(o.languages,function(_,C){C===E&&_!=v&&(this[_]=N)}),N},DFS:function v(w,k,S,j){j=j||{};var N=o.util.objId;for(var P in w)if(w.hasOwnProperty(P)){k.call(w,P,w[P],S||P);var T=w[P],E=o.util.type(T);E==="Object"&&!j[N(T)]?(j[N(T)]=!0,v(T,k,null,j)):E==="Array"&&!j[N(T)]&&(j[N(T)]=!0,v(T,k,P,j))}}},plugins:{},highlightAll:function(v,w){o.highlightAllUnder(document,v,w)},highlightAllUnder:function(v,w,k){var S={callback:k,container:v,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",S),S.elements=Array.prototype.slice.apply(S.container.querySelectorAll(S.selector)),o.hooks.run("before-all-elements-highlight",S);for(var j=0,N;N=S.elements[j++];)o.highlightElement(N,w===!0,S.callback)},highlightElement:function(v,w,k){var S=o.util.getLanguage(v),j=o.languages[S];o.util.setLanguage(v,S);var N=v.parentElement;N&&N.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(N,S);var P=v.textContent,T={element:v,language:S,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),k&&k.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),k&&k.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(v,w,k){var S={code:v,grammar:w,language:k};if(o.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=o.tokenize(S.code,S.grammar),o.hooks.run("after-tokenize",S),c.stringify(o.util.encode(S.tokens),S.language)},tokenize:function(v,w){var k=w.rest;if(k){for(var S in k)w[S]=k[S];delete w.rest}var j=new f;return h(j,j.head,v),d(v,j,w,j.head,0),g(j)},hooks:{all:{},add:function(v,w){var k=o.hooks.all;k[v]=k[v]||[],k[v].push(w)},run:function(v,w){var k=o.hooks.all[v];if(!(!k||!k.length))for(var S=0,j;j=k[S++];)j(w)}},Token:c};r.Prism=o;function c(v,w,k,S){this.type=v,this.content=w,this.alias=k,this.length=(S||"").length|0}c.stringify=function v(w,k){if(typeof w=="string")return w;if(Array.isArray(w)){var S="";return w.forEach(function(E){S+=v(E,k)}),S}var j={type:w.type,content:v(w.content,k),tag:"span",classes:["token",w.type],attributes:{},language:k},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(v,w,k,S){v.lastIndex=w;var j=v.exec(k);if(j&&S&&j[1]){var N=j[1].length;j.index+=N,j[0]=j[0].slice(N)}return j}function d(v,w,k,S,j,N){for(var P in k)if(!(!k.hasOwnProperty(P)||!k[P])){var T=k[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,I=!!_.greedy,$=_.alias;if(I&&!_.pattern.global){var oe=_.pattern.toString().match(/[imsuy]*$/)[0];_.pattern=RegExp(_.pattern.source,oe+"g")}for(var Z=_.pattern||_,M=S.next,K=j;M!==w.tail&&!(N&&K>=N.reach);K+=M.value.length,M=M.next){var O=M.value;if(w.length>v.length)return;if(!(O instanceof c)){var ie=1,J;if(I){if(J=u(Z,K,v,A),!J||J.index>=v.length)break;var be=J.index,D=J.index+J[0].length,H=K;for(H+=M.value.length;be>=H;)M=M.next,H+=M.value.length;if(H-=M.value.length,K=H,M.value instanceof c)continue;for(var ee=M;ee!==w.tail&&(H<D||typeof ee.value=="string");ee=ee.next)ie++,H+=ee.value.length;ie--,O=v.slice(K,H),J.index-=K}else if(J=u(Z,0,O,A),!J)continue;var be=J.index,ne=J[0],ye=O.slice(0,be),Q=O.slice(be+ne.length),re=K+O.length;N&&re>N.reach&&(N.reach=re);var ve=M.prev;ye&&(ve=h(w,ve,ye),K+=ye.length),p(w,ve,ie);var L=new c(P,C?o.tokenize(ne,C):ne,$,ne);if(M=h(w,ve,L),Q&&h(w,M,Q),ie>1){var W={cause:P+","+E,reach:re};d(v,w,k,M.prev,K,W),N&&W.reach>N.reach&&(N.reach=W.reach)}}}}}}function f(){var v={value:null,prev:null,next:null},w={value:null,prev:v,next:null};v.next=w,this.head=v,this.tail=w,this.length=0}function h(v,w,k){var S=w.next,j={value:k,prev:w,next:S};return w.next=j,S.prev=j,v.length++,j}function p(v,w,k){for(var S=w.next,j=0;j<k&&S!==v.tail;j++)S=S.next;w.next=S,S.prev=w,v.length-=j}function g(v){for(var w=[],k=v.head.next;k!==v.tail;)w.push(k.value),k=k.next;return w}if(!r.document)return r.addEventListener&&(o.disableWorkerMessageHandler||r.addEventListener("message",function(v){var w=JSON.parse(v.data),k=w.language,S=w.code,j=w.immediateClose;r.postMessage(o.highlight(S,o.languages[k],k)),j&&r.close()},!1)),o;var y=o.util.currentScript();y&&(o.filename=y.src,y.hasAttribute("data-manual")&&(o.manual=!0));function b(){o.manual||o.highlightAll()}if(!o.manual){var x=document.readyState;x==="loading"||x==="interactive"&&y&&y.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return o}(t);e.exports&&(e.exports=n),typeof Dn<"u"&&(Dn.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,b){return"✖ Error "+y+" while fetching file: "+b},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,b,x){var v=new XMLHttpRequest;v.open("GET",y,!0),v.onreadystatechange=function(){v.readyState==4&&(v.status<400&&v.responseText?b(v.responseText):v.status>=400?x(i(v.status,v.statusText)):x(a))},v.send(null)}function p(y){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(y||"");if(b){var x=Number(b[1]),v=b[2],w=b[3];return v?w?[x,Number(w)]:[x,void 0]:[x,x]}}n.hooks.add("before-highlightall",function(y){y.selector+=", "+f}),n.hooks.add("before-sanity-check",function(y){var b=y.element;if(b.matches(f)){y.code="",b.setAttribute(o,c);var x=b.appendChild(document.createElement("CODE"));x.textContent=r;var v=b.getAttribute("data-src"),w=y.language;if(w==="none"){var k=(/\.(\w+)$/.exec(v)||[,"none"])[1];w=s[k]||k}n.util.setLanguage(x,w),n.util.setLanguage(b,w);var S=n.plugins.autoloader;S&&S.loadLanguages(w),h(v,function(j){b.setAttribute(o,u);var N=p(b.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(`
|
|
651
|
+
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(T+1))}x.textContent=j,n.highlightElement(x)},function(j){b.setAttribute(o,d),x.textContent=j})}}),n.plugins.fileHighlight={highlight:function(b){for(var x=(b||document).querySelectorAll(f),v=0,w;w=x[v++];)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)}}()})(JD);var sJ=JD.exports;const Df=hi(sJ);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 J0=`inputs:
|
|
652
|
+
- name: target
|
|
653
|
+
description: The target resource to analyze
|
|
654
|
+
required: true
|
|
655
|
+
|
|
656
|
+
outputs:
|
|
657
|
+
- name: analysis_report
|
|
658
|
+
description: Markdown formatted analysis result
|
|
659
|
+
|
|
660
|
+
troubleshooting:
|
|
661
|
+
- "Ensure network connectivity to the target"
|
|
662
|
+
|
|
663
|
+
examples:
|
|
664
|
+
- "run analysis --target=payment-service"`,iv=document.createElement("style");iv.textContent=`
|
|
665
|
+
code[class*="language-"], pre[class*="language-"] {
|
|
666
|
+
text-shadow: none !important;
|
|
667
|
+
font-family: "JetBrains Mono", "Fira Code", monospace !important;
|
|
668
|
+
}
|
|
669
|
+
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6a9955; }
|
|
670
|
+
.token.punctuation { color: #d4d4d4; }
|
|
671
|
+
.token.namespace { opacity: .7; }
|
|
672
|
+
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #b5cea8; }
|
|
673
|
+
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #ce9178; }
|
|
674
|
+
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #d4d4d4; }
|
|
675
|
+
.token.atrule, .token.attr-value, .token.keyword { color: #c586c0; }
|
|
676
|
+
.token.function, .token.class-name { color: #dcdcaa; }
|
|
677
|
+
.token.regex, .token.important, .token.variable { color: #d16969; }
|
|
678
|
+
`;document.head.querySelector("style[data-prism-custom]")||(iv.setAttribute("data-prism-custom","true"),document.head.appendChild(iv));const oJ=["Custom","Database","Security","Network","Core","Utility","Monitoring","Automation"],b1="siclaw_skill_draft:";function lJ(e,t){const n={name:t.name,description:t.description,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(b1+e,JSON.stringify(n))}catch{}}function cJ(e){try{const t=localStorage.getItem(b1+e);return t?JSON.parse(t):null}catch{return null}}function Mc(e){localStorage.removeItem(b1+e)}function kC(e,t){return!e||!t?!1:e.name!==t.name||e.description!==t.description||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 uJ(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 dJ(){var it,X,de,Te,fe,R,me,Oe,$e,ht,et,pt,Wt,Ct;const{id:e}=a7(),t=$i(),[n]=bd(),{sendRpc:r,isConnected:i}=$t(),[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,b]=m.useState(!1),x=m.useRef(null),v=m.useRef(null),[w,k]=m.useState(!1),[S,j]=m.useState(!1),[N,P]=m.useState(!1),[T,E]=m.useState([]),[_,C]=m.useState(!1),[A,I]=m.useState(null),[$,oe]=m.useState(null),[Z,M]=m.useState(null),K=e==="new",O=!!o&&o.scope!=="personal",ie=cs(),J=(ie==null?void 0:ie.username)==="admin",D=(o==null?void 0:o.authorId)===(ie==null?void 0:ie.id),H=async()=>{if(!(!o||!e))try{k(!0);const le=await XD(r,String(o.id));t(`/skills/${le.id}`)}catch(le){console.error("[SkillEditor] Fork failed:",le)}finally{k(!1)}},ee=async()=>{if(!(!e||K)){if(N){P(!1);return}C(!0);try{const le=await RQ(r,e);E(le.versions),P(!0)}catch(le){console.error("[SkillEditor] Failed to load history:",le)}finally{C(!1)}}},be=async le=>{if(!(!e||K))try{await YD(r,e,le);const Me=await rv(r,e);if(Me){const He={...Me,specs:Me.specs||J0,scripts:Me.scripts||[]};c(He),oe(He),Mc(e)}P(!1),I(null)}catch(Me){console.error("[SkillEditor] Rollback failed:",Me)}},ne=(o==null?void 0:o.scope)==="personal"&&D||(o==null?void 0:o.scope)==="team"&&J;m.useEffect(()=>{if(g(!1),b(!1),M(null),!e)return;const le=He=>{oe(He);const lt=cJ(e);lt&<.savedAt>0?(c({...He,name:lt.name,description:lt.description,type:lt.type,version:lt.version,specs:lt.specs,scripts:lt.scripts}),M({savedAt:lt.savedAt})):c(He)};if(e==="new"){v.current=null;const He={id:`new-${Date.now()}`,name:"New Custom Skill",description:"Describe what this skill does...",type:"Custom",icon:Gs,status:"not_installed",version:"0.0.1",specs:J0,scripts:[],scope:"personal",author:"Current User",contributionStatus:"none",enabled:!0};le(He),s(!1),d(null);return}if(!i||v.current===e)return;v.current=e;let Me=!1;return rv(r,e).then(He=>{if(!Me)if(He){const lt={...He,specs:He.specs||J0,scripts:He.scripts||[]};le(lt)}else t("/skills")}),()=>{Me=!0}},[e,t,i,r]),m.useEffect(()=>{n.get("history")==="true"&&!N&&!K&&ee()},[n]);const ye=m.useMemo(()=>kC(o,$),[o,$]);m.useEffect(()=>{if(!e||!o||!$||O)return;const le=setTimeout(()=>{kC(o,$)?lJ(e,o):Mc(e)},1e3);return()=>clearTimeout(le)},[e,o,$,O]),m.useEffect(()=>{const le=Me=>{ye&&Me.preventDefault()};return window.addEventListener("beforeunload",le),()=>window.removeEventListener("beforeunload",le)},[ye]);const Q=m.useRef(!1),re=m7(()=>ye&&!Q.current),ve=m.useCallback(()=>{e&&$&&(Mc(e),c($),M(null))},[e,$]),L=m.useCallback(()=>{M(null)},[]),W=async()=>{if(o)try{h(!0),await TQ(r,o,K),e&&Mc(e),oe(o),Q.current=!0,t("/skills")}catch(le){console.error("[SkillEditor] Save failed:",le)}finally{h(!1)}},z=()=>{o&&j(!0)},te=async()=>{if(o)try{await OQ(r,String(o.id)),e&&Mc(e),Q.current=!0,t("/skills")}catch(le){console.error("[SkillEditor] Delete failed:",le)}},[ae,_e]=m.useState(null),[We,Qe]=m.useState(""),Nt=le=>{_e(le),Qe(le==="python"?"script.py":"script.sh"),g(!1)},hn=()=>{if(!ae||!We.trim())return;const le={id:`new-${Date.now()}`,info:ae,name:We.trim(),content:ae==="python"?'print("New Python Script")':`#!/bin/bash
|
|
679
|
+
|
|
680
|
+
echo "New Shell Script"`};c(Me=>Me?{...Me,scripts:[...Me.scripts||[],le]}:null),d(le.id),_e(null),Qe("")},Xt=(le,Me)=>{if(le.stopPropagation(),!(o!=null&&o.scripts))return;const He=o.scripts.filter(lt=>lt.id!==Me);c({...o,scripts:He}),u===Me&&He.length>0?d(He[0].id):u===Me&&He.length===0&&d(null)},xt=le=>{var lt;const Me=(lt=le.target.files)==null?void 0:lt[0];if(!Me)return;const He=new FileReader;He.onload=Ss=>{var qr;const _o=(qr=Ss.target)==null?void 0:qr.result,mc=Me.name.endsWith(".py"),ks={id:`upload-${Date.now()}`,info:mc?"python":"shell",name:Me.name,content:_o};c(mi=>mi?{...mi,scripts:[...mi.scripts||[],ks]}:null),d(ks.id)},He.readAsText(Me),le.target.value=""},rt=le=>{o&&c({...o,name:le.target.value})};return o?l.jsxs("div",{className:"h-full bg-white flex flex-col relative",children:[l.jsx(li,{children:ae&&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(cn.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 ",ae==="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:We,onChange:le=>Qe(le.target.value),onKeyDown:le=>le.key==="Enter"&&hn(),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:ae==="python"?"script.py":"script.sh"}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{onClick:()=>_e(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:hn,disabled:!We.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(ut,{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:rt,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"}),ye&&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(ut,{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(rB,{className:"w-5 h-5"})})}),!K&&l.jsx(ut,{content:N?"Hide History":"Version History",children:l.jsx("button",{onClick:ee,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(Fe,{className:"w-5 h-5 animate-spin"}):l.jsx(lw,{className:"w-5 h-5"})})}),l.jsx("div",{className:"h-5 w-px bg-gray-200 mx-1"}),O?l.jsx(ut,{content:"Fork to Personal",children:l.jsx("button",{onClick:H,disabled:w,className:"p-2 text-purple-600 hover:bg-purple-50 rounded-lg transition-colors disabled:opacity-50",children:w?l.jsx(Fe,{className:"w-5 h-5 animate-spin"}):l.jsx(ow,{className:"w-5 h-5"})})}):l.jsxs(l.Fragment,{children:[l.jsx(ut,{content:f?"Saving...":"Save Changes",children:l.jsx("button",{onClick:W,disabled:f,className:"p-2 text-primary-600 hover:bg-primary-50 rounded-lg transition-colors disabled:opacity-50",children:f?l.jsx(Fe,{className:"w-5 h-5 animate-spin"}):l.jsx(Wn,{className:"w-5 h-5"})})}),l.jsx(ut,{content:"Delete Skill",children:l.jsx("button",{onClick:z,className:"p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:l.jsx(sr,{className:"w-5 h-5"})})})]})]})]}),Z&&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 (",uJ(Z.savedAt),")"]}),l.jsx("div",{className:"flex-1"}),l.jsx("button",{onClick:L,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:ve,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(Bu,{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(Bu,{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",{children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 block",children:"Description"}),l.jsx("textarea",{value:o.description,onChange:le=>!O&&c({...o,description:le.target.value}),readOnly:O,className:U("w-full px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-700 outline-none resize-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"),rows:2,placeholder:"Enter a description..."})]}),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:le=>!O&&c({...o,type:le.target.value}),onFocus:()=>!O&&b(!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:()=>b(!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:()=>b(!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:oJ.map(le=>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:le}),b(!1)},children:le},le))})]})]})]}),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)!==((it=o.version)==null?void 0:it.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(le=>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:[le,!O&&l.jsx("button",{onClick:()=>{const Me=(o.labels??[]).filter(He=>He!==le);c({...o,labels:Me}),K||pC(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(Ze,{className:"w-2.5 h-2.5"})})]},le)),!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:le=>{if(le.key==="Enter"||le.key===","){le.preventDefault();const Me=le.target.value.trim();if(Me&&!(o.labels??[]).includes(Me)){const He=[...o.labels??[],Me];c({...o,labels:He}),K||pC(r,String(o.id),He).catch(()=>{})}le.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:le=>!O&&c({...o,specs:le.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 (",((X=o.scripts)==null?void 0:X.length)||0,")"]}),!O&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{content:"Upload Script",children:l.jsx("button",{onClick:()=>{var le;return(le=x.current)==null?void 0:le.click()},className:"p-1.5 text-gray-400 hover:text-gray-700 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(tB,{className:"w-4 h-4"})})}),l.jsxs("div",{className:"relative",children:[l.jsx(ut,{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(In,{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:()=>Nt("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(si,{className:"w-3.5 h-3.5 text-green-600"}),"Shell Script"]}),l.jsxs("button",{onClick:()=>Nt("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:x,className:"hidden",accept:".sh,.py,.txt",onChange:xt})]})]}),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(Gs,{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(le=>l.jsxs("div",{onClick:()=>d(le.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",le.info==="python"?"bg-blue-50 text-blue-600":"bg-green-50 text-green-600"),children:le.info==="python"?l.jsx(Ga,{className:"w-4 h-4"}):l.jsx(si,{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:le.name}),l.jsxs("span",{className:"text-[10px] text-gray-400 font-mono",children:[le.info==="python"?"Python":"Bash"," · ",le.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(ut,{content:O?"View Script":"Edit Script",children:l.jsx("button",{onClick:Me=>{Me.stopPropagation(),d(le.id)},className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-md transition-colors",children:O?l.jsx(wd,{className:"w-4 h-4"}):l.jsx(Gs,{className:"w-4 h-4"})})}),!O&&l.jsx(ut,{content:"Delete Script",children:l.jsx("button",{onClick:Me=>Xt(Me,le.id),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors",children:l.jsx(sr,{className:"w-4 h-4"})})})]})]},le.id))})})]}),l.jsx(li,{children:N&&l.jsxs(cn.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(Ze,{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(le=>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",le.version]}),ne&&l.jsx(ut,{content:"Rollback to this version",children:l.jsx("button",{onClick:()=>I(le.version),className:"p-1 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded transition-colors",children:l.jsx(ZO,{className:"w-3.5 h-3.5"})})})]}),l.jsx("p",{className:"text-xs text-gray-500 truncate",children:le.message}),l.jsxs("div",{className:"flex items-center gap-2 mt-1.5 text-[10px] text-gray-400",children:[l.jsx("span",{children:le.author}),le.date&&l.jsx("span",{children:new Date(le.date).toLocaleDateString()})]})]},le.hash))})]})}),l.jsx(li,{children:u&&l.jsxs(cn.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=(de=o.scripts)==null?void 0:de.find(le=>le.id===u))==null?void 0:Te.info)==="python"?"bg-[#37373d] text-yellow-400":"bg-[#37373d] text-green-400"),children:((R=(fe=o.scripts)==null?void 0:fe.find(le=>le.id===u))==null?void 0:R.info)==="python"?l.jsx(Ga,{className:"w-4 h-4"}):l.jsx(si,{className:"w-4 h-4"})}),l.jsx("span",{className:"text-sm font-medium text-gray-200 font-mono",children:(Oe=(me=o.scripts)==null?void 0:me.find(le=>le.id===u))==null?void 0:Oe.name})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[!O&&l.jsx(ut,{content:"Save Script",children:l.jsx("button",{onClick:W,className:"p-1.5 text-gray-400 hover:text-white hover:bg-[#333] rounded transition-colors",children:l.jsx(Wn,{className:"w-5 h-5"})})}),l.jsx(ut,{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(Ze,{className:"w-5 h-5"})})})]})]}),l.jsx("div",{className:"flex-1 relative font-mono text-sm overflow-y-auto custom-scrollbar",children:l.jsx(aJ,{value:((ht=($e=o.scripts)==null?void 0:$e.find(le=>le.id===u))==null?void 0:ht.content)||"",onValueChange:le=>{var Me;O||c({...o,scripts:(Me=o.scripts)==null?void 0:Me.map(He=>He.id===u?{...He,content:le}:He)})},highlight:le=>{var lt;const Me=(lt=o.scripts)==null?void 0:lt.find(Ss=>Ss.id===u),He=(Me==null?void 0:Me.info)==="python"?Df.languages.python:Df.languages.bash;return Df.highlight(le,He||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(Gs,{className:"w-3 h-3 opacity-70"}),l.jsx("span",{children:((pt=(et=o.scripts)==null?void 0:et.find(le=>le.id===u))==null?void 0:pt.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 ",(Ct=(Wt=o.scripts)==null?void 0:Wt.find(le=>le.id===u))==null?void 0:Ct.content.split(`
|
|
681
|
+
`).length,", Col 1"]})]})]})})]}),l.jsx(no,{isOpen:S,onClose:()=>j(!1),onConfirm:te,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:()=>I(null),onConfirm:()=>A!==null&&be(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:re.state==="blocked",onClose:()=>{var le;return re.state==="blocked"&&((le=re.reset)==null?void 0:le.call(re))},onConfirm:()=>{var le;return re.state==="blocked"&&((le=re.proceed)==null?void 0:le.call(re))},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(Fe,{className:"animate-spin text-gray-400"})})}function fJ(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 hJ=[{id:"slack",name:"Slack",description:"Slack workspace bot with rich message formatting and threads.",icon:XO},{id:"discord",name:"Discord",description:"Discord server bot with slash commands and channel messaging.",icon:si},{id:"telegram",name:"Telegram",description:"Bot integration for Telegram groups and direct messages.",icon:Nm},{id:"lark",name:"Lark",description:"Enterprise bot for Lark with interactive cards and approval flows.",icon:sB},{id:"whatsapp",name:"WhatsApp",description:"WhatsApp Business API integration for customer messaging.",icon:oB,comingSoon:!0}];function pJ(e){return hJ.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 mJ({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(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.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(cn.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(Ze,{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(Da,{label:"App ID",value:i.appId||"",onChange:f=>a({...i,appId:f}),placeholder:"cli_...",required:!0}),l.jsx(Da,{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(Da,{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(Da,{label:"Bot Token",value:i.botToken||"",onChange:f=>a({...i,botToken:f}),placeholder:"xoxb-...",type:"password",required:!0}),l.jsx(Da,{label:"App Token",value:i.appToken||"",onChange:f=>a({...i,appToken:f}),placeholder:"xapp-...",type:"password",required:!0})]}),e.id==="discord"&&l.jsx(Da,{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(Da,{label:"Access Token",value:i.accessToken||"",onChange:f=>a({...i,accessToken:f}),placeholder:"Your access token...",type:"password",required:!0}),l.jsx(Da,{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(Wn,{className:"w-4 h-4"}),c?"Saving...":"Save Configuration"]})]})]})]})]})}):null}function Da({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 gJ(){const{sendRpc:e,isConnected:t}=$t(),{channels:n,loading:r,loadChannels:i,saveChannel:a}=fJ(e),[s,o]=m.useState(null),[c,u]=m.useState(!1),d=m.useRef(!1);m.useEffect(()=>{t&&!d.current&&(d.current=!0,i())},[t,i]);const f=pJ(n),h=g=>{g.comingSoon||(o(g),u(!0))},p=async(g,y,b)=>{await a(g,y,b),u(!1)};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.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:r?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:f.map(g=>l.jsxs("div",{className:U("group bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between transition-all",g.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",g.status==="connected"?"bg-white border-gray-200":"bg-gray-50 border-gray-200 grayscale"),children:l.jsx(g.icon,{className:U("w-4 h-4",g.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:g.name}),g.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"}),!g.comingSoon&&g.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"]}),!g.comingSoon&&g.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:g.description}),g.status==="error"&&g.error&&l.jsx("p",{className:"text-xs text-red-500 mt-1 max-w-xl truncate",children:g.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",g.status==="connected"?"text-green-600":g.status==="error"?"text-red-500":"text-gray-400"),children:g.comingSoon?"Coming Soon":g.status==="connected"?"Operational":g.status==="error"?"Error":"Not Configured"})]}),l.jsx("div",{className:"h-8 w-px bg-gray-100 hidden sm:block"}),l.jsx("button",{onClick:()=>h(g),disabled:g.comingSoon,className:U("px-4 py-2 rounded-lg font-medium text-sm transition-colors shadow-sm border min-w-[100px]",g.comingSoon?"bg-gray-100 border-gray-200 text-gray-400 cursor-not-allowed":g.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:g.comingSoon?"Coming Soon":g.status==="connected"?"Configure":"Connect"})]})]},g.id))})})}),l.jsx(mJ,{channel:s,isOpen:c,onClose:()=>u(!1),onSave:p})]})}function yJ(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 eM=[{id:"zap",icon:kd,label:"Zap"},{id:"wifi",icon:gw,label:"WiFi"},{id:"activity",icon:K7,label:"Activity"},{id:"server",icon:fB,label:"Server"},{id:"database",icon:qO,label:"Database"},{id:"cloud",icon:Z7,label:"Cloud"},{id:"box",icon:q7,label:"Box"},{id:"terminal",icon:si,label:"Terminal"},{id:"cpu",icon:mo,label:"CPU"},{id:"globe",icon:Il,label:"Globe"},{id:"message",icon:Nm,label:"Message"},{id:"bell",icon:iw,label:"Bell"}],xJ=e=>{var t;return((t=eM.find(n=>n.id===e))==null?void 0:t.icon)||kd};function vJ({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 b=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)}}},x=v=>{navigator.clipboard.writeText(v),p(!0),setTimeout(()=>p(!1),2e3)};return l.jsx(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.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(cn.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(Ze,{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:eM.map(v=>l.jsx("button",{onClick:()=>f(v.id),className:U("aspect-square flex flex-col items-center justify-center rounded-lg border transition-all hover:bg-gray-50",d===v.id?"border-primary-500 bg-primary-50 text-primary-600 ring-1 ring-primary-500":"border-gray-200 text-gray-500"),title:v.label,children:l.jsx(v.icon,{className:"w-5 h-5"})},v.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:v=>a(v.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:v=>o(v.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:()=>x(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(kx,{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(jm,{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:b,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(Wn,{className:"w-4 h-4"}),g?"Saving...":e?"Save Changes":"Create Endpoint"]})]})]})]})})}function bJ(){const{sendRpc:e,isConnected:t}=$t(),{triggers:n,loading:r,loadTriggers:i,saveTrigger:a,deleteTrigger:s}=yJ(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=x=>{d(x),c(!0)},g=async x=>{await a(x),c(!1)},y=async(x,v)=>{x.stopPropagation();const w=v.status==="active"?"inactive":"active";await a({...v,status:w})},b=async(x,v)=>{x.stopPropagation(),await s(v)};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(Hn,{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(ut,{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(In,{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(x=>l.jsxs("div",{onClick:()=>p(x),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",x.type==="webhook"?"bg-purple-50 border-purple-100 text-purple-600":"bg-emerald-50 border-emerald-100 text-emerald-600"),children:(()=>{const v=xJ(x.icon);return l.jsx(v,{className:"w-4 h-4"})})()}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:v=>y(v,x),className:U("p-2 rounded-lg transition-colors border",x.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:x.status==="active"?"Deactivate Endpoint":"Activate Endpoint",children:x.status==="active"?l.jsx(dw,{className:"w-4 h-4"}):l.jsx(Cm,{className:"w-4 h-4"})}),l.jsx("button",{onClick:v=>b(v,x.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(sr,{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:[x.name,l.jsx(WO,{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:x.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: ",x.id.split("_")[1]||x.id]}),l.jsxs("div",{children:["Last active: ",l.jsx("span",{className:"text-gray-600 font-medium",children:x.lastActive||"Never"})]})]})]},x.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(In,{className:"w-6 h-6"})}),l.jsx("span",{className:"font-medium",children:"Create New Endpoint"})]})]})}),l.jsx(vJ,{isOpen:o,onClose:()=>c(!1),trigger:u,onSave:g})]})}function wJ(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 SJ({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(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.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(cn.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(Ze,{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(ls,{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(Fe,{className:"w-4 h-4 animate-spin"}):l.jsx(Wn,{className:"w-4 h-4"}),d?"Saving...":e?"Save Job":"Create Schedule"]})]})]})]})})}function jC(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 NC(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 kJ({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(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.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(cn.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(Ze,{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(Fe,{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(ls,{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(Sr,{className:"w-4 h-4 text-green-500 flex-shrink-0"}):l.jsx(Ai,{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:jC(c.createdAt)}),c.durationMs!=null&&l.jsx("span",{className:"text-xs text-gray-400 ml-auto",children:NC(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(Pd,{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(Sr,{className:"w-4 h-4 text-green-500 flex-shrink-0"}):l.jsx(Ai,{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:jC(f.createdAt)}),f.durationMs!=null&&l.jsx("span",{className:"text-xs text-gray-300",children:NC(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(sw,{className:"w-3.5 h-3.5 text-gray-300 group-hover:text-primary-500 flex-shrink-0 transition-colors"})]},f.id))})})]})]})})}function jJ(){const{sendRpc:e,isConnected:t}=$t(),{jobs:n,loading:r,error:i,loadJobs:a,saveJob:s,deleteJob:o}=wJ(e),{currentWorkspace:c}=Ed(),[u,d]=m.useState(!1),[f,h]=m.useState(null),[p,g]=m.useState(null),[y,b]=m.useState(null),x=m.useRef(!1);m.useEffect(()=>{t&&!x.current&&(x.current=!0,a())},[t,a]);const v=()=>{h(null),d(!0)},w=P=>{h(P),d(!0)},k=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")}},S=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(Hn,{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(ut,{content:"Add Schedule",children:l.jsx("button",{onClick:v,className:"p-2 rounded-lg text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-all",children:l.jsx(In,{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(Uu,{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(aw,{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(),b(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(lw,{className:"w-4 h-4"})}),l.jsx("button",{onClick:T=>S(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(dw,{className:"w-4 h-4"}):l.jsx(Cm,{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(sr,{className:"w-4 h-4"})})]})]},P.id)),n.length===0&&l.jsxs("div",{className:"text-center py-20 text-gray-400",children:[l.jsx(Uu,{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:v,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(SJ,{isOpen:u,onClose:()=>d(!1),job:f,onSave:k}),y&&l.jsx(kJ,{job:y,isOpen:!!y,onClose:()=>b(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 NJ({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(Ze,{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 CJ(){const[e,t]=m.useState(Ll()),[n,r]=m.useState(!1),{sendRpc:i,isConnected:a}=$t(),s=cs(),[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=Ll();t(h)};return window.addEventListener("user-profile-updated",f),()=>window.removeEventListener("user-profile-updated",f)},[]);const d=async f=>{Jh(f);try{await n8(i,f)}catch{}};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx(NJ,{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(Hn,{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(Vu,{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(XO,{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(PJ,{sendRpc:i})]}),l.jsx("div",{className:"pt-6",children:l.jsxs("button",{onClick:c_,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(aB,{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 PJ({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(Fe,{className:"w-4 h-4 animate-spin"}),"Change Password"]})})]})]})}function EJ(){return l.jsx(nw,{})}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:fw,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:Il,fields:[{key:"grafanaUrl",label:"Grafana URL",type:"text",placeholder:"https://grafana.example.com/d/siclaw/overview?kiosk"}]},{key:"metrics",title:"Metrics & Monitoring",icon:rw,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 AJ(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n,loaded:r}=ic(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(k=>k.fields.filter(S=>S.writeOnly).map(S=>`${k.key}.${S.key}`))),[g,y]=m.useState(new Set),b=m.useCallback(async()=>{try{const S=(await e("system.getConfig")).config??{},j=new Set,N={};for(const[P,T]of Object.entries(S))p.has(P)?T&&j.add(P):N[P]=T;y(j),a(N),o(N)}catch(k){console.warn("[SystemSettings] Failed to load config:",k)}},[e]);m.useEffect(()=>{!t||!n||h.current||(h.current=!0,b())},[t,n,b]);const x=(k,S)=>{a(j=>({...j,[k]:S})),f(null)},v=k=>{const S=Mf.find(j=>j.key===k);return S?S.fields.some(j=>{const N=`${k}.${j.key}`;return j.writeOnly?!!i[N]:(i[N]??"")!==(s[N]??"")}):!1},w=async k=>{u(k),f(null);try{const S=Mf.find(N=>N.key===k),j={};for(const N of S.fields){const P=`${k}.${N.key}`,T=i[P]??"";T&&!T.includes("****")?j[N.key]=T:T||(j[N.key]="")}await e("system.saveSection",{section:k,values:j}),await b()}catch(S){f((S==null?void 0:S.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(k=>{const S=k.icon,j=v(k.key),N=c===k.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(S,{className:"w-4 h-4 text-gray-500"}),l.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:k.title})]}),l.jsxs("button",{onClick:()=>w(k.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(Fe,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Wn,{className:"w-3.5 h-3.5"}),"Save"]})]}),l.jsx("div",{className:"p-5 space-y-4",children:k.fields.map(P=>{const T=`${k.key}.${P.key}`;if(P.type==="toggle"){const I=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":I,onClick:()=>x(T,I?"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 "+(I?"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 "+(I?"translate-x-4":"translate-x-0")})})]},T)}const E=k.fields.find(I=>I.type==="toggle"),_=E?i[`${k.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:I=>x(T,I.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)})})]},k.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(Fe,{className:"w-5 h-5 animate-spin"})})}function TJ(){const{sendRpc:e,isConnected:t}=$t(),n=cs(),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 v=await e("permission.listUsers");a(v.users)}catch(v){console.error("[Permissions] Failed to load users:",v)}finally{o(!1)}},y=m.useRef(!1);m.useEffect(()=>{t&&r&&!y.current&&(y.current=!0,g())},[t]);const b=async(v,w)=>{const k=v.permissions.includes(w);u(v.id);try{k?await e("permission.revoke",{userId:v.id,permission:w}):await e("permission.grant",{userId:v.id,permission:w}),await g()}catch(S){console.error("[Permissions] Toggle failed:",S)}finally{u(null)}},x=async v=>{u(v.id);try{await e("user.setTestOnly",{userId:v.id,testOnly:!v.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(hw,{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(In,{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(Fe,{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(v=>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",v.isAdmin?"bg-primary-100 text-primary-700":"bg-gray-100 text-gray-600"),children:(v.name||v.username).charAt(0).toUpperCase()}),l.jsx("span",{className:"text-sm font-medium text-gray-900",children:v.name||v.username})]})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-sm text-gray-500",children:v.username})}),l.jsx("td",{className:"px-6 py-4 text-center",children:v.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:v.isAdmin?l.jsx("span",{className:"text-xs text-gray-300",children:"-"}):l.jsx("button",{onClick:()=>x(v),disabled:c===v.id,className:"inline-flex items-center justify-center",children:c===v.id?l.jsx(Fe,{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",v.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",v.testOnly?"translate-x-4":"translate-x-0")})})})}),l.jsx("td",{className:"px-6 py-4 text-center",children:v.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(fw,{className:"w-3 h-3"}),"Always"]}):l.jsx("button",{onClick:()=>b(v,"skill_reviewer"),disabled:c===v.id,className:"inline-flex items-center justify-center",children:c===v.id?l.jsx(Fe,{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",v.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",v.permissions.includes("skill_reviewer")?"translate-x-4":"translate-x-0")})})})}),l.jsx("td",{className:"px-6 py-4 text-center",children:!v.isAdmin&&!v.ssoUser&&l.jsxs("button",{onClick:()=>p(v.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"]})})]},v.id))})]})})})}),d&&l.jsx(OJ,{sendRpc:e,onClose:()=>f(!1),onCreated:g}),h&&l.jsx(_J,{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(QO,{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 OJ({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(Ze,{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(Fe,{className:"w-4 h-4 animate-spin"}):"Create"})]})]})]})})}function _J({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(Ze,{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(Fe,{className:"w-4 h-4 animate-spin"}):"Reset"})]})]})]})})}function DJ({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),[b,x]=m.useState(65536),[v,w]=m.useState(!1),[k,S]=m.useState(1024),[j,N]=m.useState(!1),[P,T]=m.useState(null),E=t.filter(M=>M.category!=="embedding"),_=t.filter(M=>M.category==="embedding"),C=s==="llm"?E:_,A=()=>{f(""),p(""),y(128e3),x(65536),w(!1),S(1024),u(!1)},I=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:b,reasoning:s==="embedding"?!1:v,category:s==="embedding"?"embedding":"llm"}),A()}catch(M){console.error("Failed to add model:",M)}finally{N(!1)}}},$=async M=>{T(M);try{await a(M)}catch(K){console.error("Failed to remove model:",K)}finally{T(null)}},oe=M=>{o(M),A()},Z=[{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(Ze,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex items-center gap-2",children:Z.map(M=>l.jsx("button",{onClick:()=>oe(M.id),className:["px-3 py-1 rounded-full text-xs font-medium transition-all border",s===M.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:M.label},M.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(M=>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:M.name}),l.jsx("div",{className:"text-xs text-gray-400 truncate",children:M.id}),l.jsx("div",{className:"flex gap-3 mt-1 text-xs text-gray-400",children:s==="embedding"?l.jsxs("span",{children:["Dimensions: ",M.dimensions??"—"]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:["Context: ",(M.contextWindow/1e3).toFixed(0),"k"]}),l.jsxs("span",{children:["Max: ",(M.maxTokens/1e3).toFixed(0),"k"]}),M.reasoning&&l.jsx("span",{className:"text-indigo-500",children:"Reasoning"})]})})]}),n&&l.jsx("button",{onClick:()=>$(M.id),disabled:P===M.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(sr,{className:"w-4 h-4"})})]},M.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:M=>f(M.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:M=>p(M.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:k,onChange:M=>S(Number(M.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:M=>y(Number(M.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:b,onChange:M=>x(Number(M.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:v,onChange:M=>w(M.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:I,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(In,{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 av=[{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 tM({baseUrl:e,apiKey:t,api:n,disabled:r}){const{sendRpc:i}=$t(),[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(gw,{className:"w-4 h-4"}),testing:l.jsx(Fe,{className:"w-4 h-4 animate-spin"}),success:l.jsx(Sr,{className:"w-4 h-4"}),error:l.jsx(ys,{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 MJ({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,b]=m.useState(!1),[x,v]=m.useState(!1),[w,k]=m.useState("");m.useEffect(()=>{if(e)if(k(""),v(!1),h(""),t){c(t.name),d(t.baseUrl),g(t.api),b(t.authHeader??!1);const P=av.find(T=>T.name===t.name);s(P??null)}else s(null),c(""),d(""),g("openai-completions"),b(!1)},[e,t]);const S=P=>{i||(s(P),c(P.name),d(P.baseUrl),g(P.api),b(P.authHeader??!1))},j=()=>{i||(s(null),c(""),d(""),g("openai-completions"),b(!1))},N=async()=>{if(!o.trim()){k("Provider name is required");return}v(!0),k("");try{await r({name:o.trim(),baseUrl:u.trim(),apiKey:f,api:p,authHeader:y}),n()}catch(P){k(P instanceof Error?P.message:"Failed to save")}finally{v(!1)}};return l.jsx(li,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(cn.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(cn.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(Ze,{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:[av.map(P=>l.jsx("button",{onClick:()=>S(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),b(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(tM,{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:x||!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(Wn,{className:"w-4 h-4"}),x?"Saving...":i?"Save Changes":"Create Provider"]})]})]})]})})}function IJ({onComplete:e}){const{sendRpc:t}=$t(),[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),[b,x]=m.useState(""),[v,w]=m.useState(""),[k,S]=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 I=A.models.find($=>$.category==="llm");I&&y(I)},T=()=>{r(null),a(!0),o(""),u(""),p("openai-completions"),y(null),x(""),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 I=i?b.trim():g==null?void 0:g.id,$=i?v.trim()||b.trim():g==null?void 0:g.name;if(!I){N("Please select or enter a model");return}S(!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:I,name:$,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(oe){N(oe instanceof Error?oe.message:"Failed to save")}finally{S(!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(kd,{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:[av.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:b,onChange:A=>x(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:v,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 I=C.find($=>$.id===A.target.value);I&&y(I)},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(tM,{baseUrl:c,apiKey:d,api:h}),l.jsx("button",{onClick:E,disabled:k||!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:k?"Saving...":"Save & Activate"})]})]})]})}function LJ(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n}=ic(e,t),[r,i]=m.useState([]),[a,s]=m.useState([]),[o,c]=m.useState(""),[u,d]=m.useState(""),[f,h]=m.useState(!1),[p,g]=m.useState(""),[y,b]=m.useState(1024),[x,v]=m.useState(null),[w,k]=m.useState(!1),[S,j]=m.useState(!1),[N,P]=m.useState(null),[T,E]=m.useState(null),_=m.useRef(!1),C=m.useCallback(async()=>{try{const L=await e("provider.list");i(L.providers??[])}catch(L){console.error("Failed to load providers:",L)}},[e]),A=m.useCallback(async()=>{try{const L=await e("model.list");if(s(L.models??[]),L.default){const W=`${L.default.provider}::${L.default.modelId}`;c(W),d(W)}}catch(L){console.error("Failed to load models:",L)}},[e]),I=m.useCallback(async()=>{try{const L=await e("embedding.getConfig");L.config&&(g(`${L.config.provider}::${L.config.model}`),b(L.config.dimensions),v(L.config))}catch(L){console.error("Failed to load embedding config:",L)}},[e]);m.useEffect(()=>{t&&!_.current&&(_.current=!0,C(),A(),I())},[t,C,A,I]);const $=L=>{const W=L.indexOf("::");return W<0?{provider:"",modelId:""}:{provider:L.slice(0,W),modelId:L.slice(W+2)}},oe=async()=>{const{provider:L,modelId:W}=$(o);if(!(!L||!W)){h(!0);try{await e("config.setDefaultModel",{provider:L,modelId:W}),d(o);try{new BroadcastChannel("siclaw-model-config").postMessage("default-changed")}catch{}}catch(z){console.error("Failed to save default model:",z)}finally{h(!1)}}},Z=async()=>{const{provider:L,modelId:W}=$(p);if(!(!L||!W||!y)){k(!0);try{await e("embedding.setConfig",{provider:L,model:W,dimensions:y}),v({provider:L,model:W,dimensions:y})}catch(z){console.error("Failed to save embedding config:",z)}finally{k(!1)}}},M=async L=>{const W={provider:L.name,baseUrl:L.baseUrl,api:L.api,authHeader:L.authHeader};L.apiKey&&(W.apiKey=L.apiKey),await e("provider.save",W),await C()},K=async(L,W)=>{await e("provider.addModel",{provider:L,model:W}),await Promise.all([C(),A()])},O=async(L,W)=>{await e("provider.removeModel",{provider:L,modelId:W}),await Promise.all([C(),A()])},ie=async L=>{if(window.confirm(`Delete provider "${L}" and all its models?`))try{await e("provider.delete",{provider:L}),await Promise.all([C(),A()])}catch(W){console.error("Failed to delete provider:",W)}},J=()=>{C(),A()},D=()=>{P(null),j(!0)},H=L=>{P(L),j(!0)},ee=a.filter(L=>L.category!=="embedding"),be=a.filter(L=>L.category==="embedding"),ne=L=>{var z;const W={};for(const te of L)(W[z=te.provider]??(W[z]=[])).push(te);return W},ye=ne(ee),Q=ne(be),re=o!==u,ve=x?p!==`${x.provider}::${x.model}`||y!==x.dimensions:!!p;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&&r.length>0&&l.jsxs("button",{onClick:D,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(In,{className:"w-4 h-4"}),"Add Provider"]})]}),r.length===0?n?l.jsx(IJ,{onComplete:J}):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:r.map(L=>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:L.name}),l.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-gray-100 text-gray-500",children:L.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(Il,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsx("span",{className:"truncate",children:L.baseUrl||"Not set"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[l.jsx(nB,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsx("span",{children:L.apiKeySet?L.apiKey:"Not set"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[l.jsx(cw,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsxs("span",{children:[L.modelCount," model",L.modelCount!==1?"s":""]})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>E(L.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:()=>H(L),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(Pm,{className:"w-3.5 h-3.5"}),"Settings"]}),l.jsx("button",{onClick:()=>ie(L.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(sr,{className:"w-3.5 h-3.5"})})]})]})]},L.name))})]}),r.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:o,onChange:L=>c(L.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(ye).map(([L,W])=>l.jsx("optgroup",{label:L,children:W.map(z=>l.jsx("option",{value:`${L}::${z.id}`,children:z.name},`${L}::${z.id}`))},L))]})]}),n&&l.jsxs("button",{onClick:oe,disabled:f||!re||!o,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(Wn,{className:"w-4 h-4"}),f?"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:p,onChange:L=>g(L.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(Q).map(([L,W])=>l.jsx("optgroup",{label:L,children:W.map(z=>l.jsx("option",{value:`${L}::${z.id}`,children:z.name},`${L}::${z.id}`))},L))]})]}),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:y,onChange:L=>b(Number(L.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:Z,disabled:w||!ve||!p||!y,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(Wn,{className:"w-4 h-4"}),w?"Saving...":"Save"]})]})})]})]})]})]}),l.jsx(MJ,{isOpen:S,provider:N,onClose:()=>j(!1),onSave:M}),T&&l.jsx(DJ,{provider:T,models:a.filter(L=>L.provider===T),isAdmin:n,onClose:()=>E(null),onAdd:L=>K(T,L),onRemove:L=>O(T,L)})]})}const RJ=[{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 CC({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 FJ({workspace:e,onClose:t,onSaved:n,sendRpc:r}){var L,W;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(((L=e==null?void 0:e.configJson)==null?void 0:L.color)??"indigo"),[h,p]=m.useState(((W=e==null?void 0:e.configJson)==null?void 0:W.systemPrompt)??""),[g,y]=m.useState(!1),[b,x]=m.useState((e==null?void 0:e.envType)??"prod"),[v,w]=m.useState(new Set),[k,S]=m.useState([]),[j,N]=m.useState(""),[P,T]=m.useState(null),[E,_]=m.useState(new Set),[C,A]=m.useState(new Set),[I,$]=m.useState(new Set),[oe,Z]=m.useState([]),[M,K]=m.useState([]),[O,ie]=m.useState([]);m.useEffect(()=>{r("skill.list",{limit:500}).then(z=>Z(z.skills??[])).catch(()=>{}),r("workspace.availableTools").then(z=>K(z.tools??[])).catch(()=>{}),r("credential.list").then(z=>ie(z.credentials??[])).catch(()=>{}),r("environment.list").then(z=>S(z.environments??[])).catch(()=>{}),e&&!e.isDefault&&r("workspace.getConfig",{id:e.id}).then(z=>{_(new Set(z.skills??[])),A(new Set(z.tools??[])),$(new Set(z.credentials??[])),w(new Set(z.environments??[]))}).catch(()=>{})},[r,e]);const J=m.useMemo(()=>{const z=new Set;for(const te of oe)te.labels&&te.labels.forEach(ae=>z.add(ae));return[...z].sort()},[oe]),D=m.useMemo(()=>{let z=oe;if(P&&(z=z.filter(te=>{var ae;return(ae=te.labels)==null?void 0:ae.includes(P)})),j.trim()){const te=j.toLowerCase();z=z.filter(ae=>ae.name.toLowerCase().includes(te))}return z},[oe,j,P]),H=m.useMemo(()=>b==="test"?k.filter(z=>z.isTest):k,[k,b]),ee=m.useCallback(z=>{_(te=>{const ae=new Set(te);return ae.has(z)?ae.delete(z):ae.add(z),ae})},[]),be=m.useCallback(z=>{A(te=>{const ae=new Set(te);return ae.has(z)?ae.delete(z):ae.add(z),ae})},[]),ne=m.useCallback(z=>{$(te=>{const ae=new Set(te);return ae.has(z)?ae.delete(z):ae.add(z),ae})},[]),ye=m.useCallback(z=>{w(te=>{const ae=new Set(te);return ae.has(z)?ae.delete(z):ae.add(z),ae})},[]),Q=async()=>{if(c.trim()){y(!0);try{if(i){const te=(await r("workspace.create",{name:c.trim(),envType:b,config:{color:d,systemPrompt:h||void 0}})).workspace.id;await Promise.all([r("workspace.setSkills",{workspaceId:te,skills:[...E]}),r("workspace.setTools",{workspaceId:te,tools:[...C]}),r("workspace.setCredentials",{workspaceId:te,credentialIds:[...I]}),r("workspace.setEnvironments",{workspaceId:te,envIds:[...v]})])}else a||(await r("workspace.update",{id:e.id,name:c.trim(),envType:b,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:[...I]}),r("workspace.setEnvironments",{workspaceId:e.id,envIds:[...v]})]));n()}catch(z){console.error("Failed to save workspace:",z)}finally{y(!1)}}},re=I.size+v.size,ve=[{key:"general",label:"General"},...a?[]:[{key:"skills",label:`Skills (${E.size})`},{key:"tools",label:`Tools (${C.size})`},{key:"access",label:`Access (${re})`}]];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:z=>z.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(Ze,{className:"w-5 h-5"})})]}),!a&&l.jsx("div",{className:"px-6 pt-3",children:l.jsx("input",{type:"text",value:c,onChange:z=>u(z.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:ve.map(z=>l.jsx("button",{onClick:()=>o(z.key),className:`px-3 py-2 text-sm font-medium rounded-t-md transition-colors ${s===z.key?"text-indigo-600 border-b-2 border-indigo-600":"text-gray-500 hover:text-gray-700"}`,children:z.label},z.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:()=>x("prod"),className:`px-4 py-2 rounded-lg text-sm font-medium border ${b==="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:()=>{x("test"),w(new Set)},className:`px-4 py-2 rounded-lg text-sm font-medium border ${b==="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:RJ.map(z=>l.jsx("button",{onClick:()=>!a&&f(z.name),disabled:a,className:`w-7 h-7 rounded-full ${z.class} flex items-center justify-center transition-transform ${d===z.name?"ring-2 ring-offset-2 ring-indigo-400 scale-110":"hover:scale-105"} disabled:opacity-50`,children:d===z.name&&l.jsx($n,{className:"w-3.5 h-3.5 text-white"})},z.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:z=>p(z.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(Hn,{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:z=>N(z.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"})]}),J.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"}),J.map(z=>l.jsx("button",{onClick:()=>T(P===z?null:z),className:`px-2 py-0.5 rounded-full text-xs font-medium transition-colors ${P===z?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-500 hover:bg-gray-200"}`,children:z},z))]}),l.jsx(CC,{total:D.length,selected:D.filter(z=>E.has(z.name)).length,onSelectAll:()=>_(z=>{const te=new Set(z);return D.forEach(ae=>te.add(ae.name)),te}),onDeselectAll:()=>_(z=>{const te=new Set(z);return D.forEach(ae=>te.delete(ae.name)),te})}),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(z=>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(z.name),onChange:()=>ee(z.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:z.name}),z.labels&&z.labels.length>0&&l.jsx("span",{className:"text-xs text-gray-400 truncate max-w-[120px]",children:z.labels.join(", ")}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 text-gray-500 shrink-0",children:z.scope})]},z.name))})]}),s==="tools"&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(CC,{total:M.length,selected:C.size,onSelectAll:()=>A(new Set(M)),onDeselectAll:()=>A(new Set)}),M.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:M.map(z=>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(z),onChange:()=>be(z),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),l.jsx("span",{className:"text-sm text-gray-900 font-mono",children:z})]},z))})]}),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 Environments"}),H.length===0?l.jsx("p",{className:"text-sm text-gray-400 py-2 text-center",children:"No environments available"}):l.jsx("div",{className:"space-y-0.5",children:H.map(z=>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:v.has(z.id),onChange:()=>ye(z.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:z.name}),l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${z.isTest?"bg-amber-50 text-amber-600":"bg-blue-50 text-blue-600"}`,children:z.isTest?"test":"prod"}),l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:z.apiServer})]},z.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(z=>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:I.has(z.id),onChange:()=>ne(z.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:z.name}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 text-gray-500",children:z.type})]},z.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:Q,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 zJ={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 $J(e){return zJ[e??""]??"bg-indigo-500"}function BJ(){const{sendRpc:e,isConnected:t}=$t(),{reload:n}=Ed(),[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),b=m.useCallback(async()=>{if(t)try{const k=(await e("workspace.list")).workspaces??[];i(k);for(const S of k)S.isDefault||e("workspace.getConfig",{id:S.id}).then(j=>{d(N=>{var P;return{...N,[S.id]:((P=j.skills)==null?void 0:P.length)??0}}),h(N=>{var P;return{...N,[S.id]:((P=j.tools)==null?void 0:P.length)??0}}),g(N=>{var P;return{...N,[S.id]:((P=j.environments)==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,b())},[t,b]);const x=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 b(),n()}catch(k){console.error("Failed to delete workspace:",k)}},v=()=>{s(null),c(!1),b(),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 environments."})]}),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(In,{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 k;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 ${$J((k=w.configJson)==null?void 0:k.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(gB,{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(aw,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsx("span",{children:"All skills, tools & environments"})]}):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," environments"]})]})]})}),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(Sd,{className:"w-3.5 h-3.5"}),w.isDefault?"View":"Edit"]}),!w.isDefault&&l.jsx("button",{onClick:()=>x(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(sr,{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(In,{className:"w-6 h-6"}),l.jsx("span",{className:"text-sm font-medium",children:"Create Workspace"})]})]})]}),(a||o)&&l.jsx(FJ,{workspace:a,onClose:()=>{s(null),c(!1)},onSaved:v,sendRpc:e})]})}function UJ(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 VJ={stdio:"Stdio",sse:"SSE","streamable-http":"Streamable HTTP"},nM=[{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"Stdio"}];function PC(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 EC(e){return!e||Object.keys(e).length===0?[{key:"",value:""}]:[...Object.entries(e).map(([t,n])=>({key:t,value:n})),{key:"",value:""}]}function AC({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(In,{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(sr,{className:"w-3.5 h-3.5"})})]},o))})]})}function WJ({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(""),[b,x]=m.useState(""),[v,w]=m.useState([{key:"",value:""}]),[k,S]=m.useState([{key:"",value:""}]),[j,N]=m.useState(""),[P,T]=m.useState(!1);m.useEffect(()=>{var I;t&&(N(""),T(!1),e?(o(e.transport),u(e.name),f(e.description??""),p(e.url??""),y(e.command??""),x(((I=e.argsJson)==null?void 0:I.join(" "))??""),w(EC(e.envJson)),S(EC(e.headersJson))):(o("streamable-http"),u(""),f(""),p(""),y(""),x(""),w([{key:"",value:""}]),S([{key:"",value:""}])))},[t,e]);const E=()=>c.trim()?s==="stdio"?!!g.trim():!!h.trim():!1,_=async()=>{if(!P){T(!0),N("");try{const I={name:c,transport:s,description:d||void 0};s==="stdio"?(I.command=g,b.trim()&&(I.argsJson=b.split(/\s+/).filter(Boolean)),I.envJson=PC(v)):(I.url=h,I.headersJson=PC(k)),a?await i(e.id,I):await r(I),n()}catch(I){N((I==null?void 0:I.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(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.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(cn.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(Ze,{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:nM.map(I=>{const $=s===I.value;return l.jsx("button",{type:"button",disabled:a,onClick:()=>o(I.value),className:U("px-3 py-2 rounded-lg border text-sm font-medium transition-colors text-center",$?"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:I.label},I.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:I=>u(I.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:I=>f(I.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:I=>y(I.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:b,onChange:I=>x(I.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(AC,{label:"Environment Variables",pairs:v,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:I=>p(I.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(AC,{label:"Headers",pairs:k,onChange:S})]}),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(Wn,{className:"w-4 h-4"}),P?"Saving...":a?"Save Changes":"Create Server"]})]})]})]})})}const HJ={"streamable-http":"bg-blue-50 text-blue-700",sse:"bg-purple-50 text-purple-700",stdio:"bg-emerald-50 text-emerald-700"},KJ={seed:"bg-gray-50 text-gray-500",db:"bg-indigo-50 text-indigo-600",file:"bg-amber-50 text-amber-600"};function GJ(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n}=ic(e,t),{servers:r,loading:i,loadServers:a,createServer:s,updateServer:o,toggleServer:c,deleteServer:u}=UJ(e),[d,f]=m.useState(""),[h,p]=m.useState(""),[g,y]=m.useState(!1),[b,x]=m.useState(null),[v,w]=m.useState(null),[k,S]=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(I=>I.name.toLowerCase().includes(A)||(I.description??"").toLowerCase().includes(A)||(I.url??"").toLowerCase().includes(A)||(I.command??"").toLowerCase().includes(A))}return C},[r,d,h]),P=()=>{x(null),y(!0)},T=C=>{x(C),y(!0)},E=async(C,A)=>{if(C.stopPropagation(),!k){S(A);try{await c(A)}catch(I){console.error("[McpServers] Toggle failed:",I)}finally{S(null)}}},_=async(C,A,I)=>{if(C.stopPropagation(),!v&&window.confirm(`Delete MCP server "${I}"?`)){w(A);try{await u(A)}catch($){console.error("[McpServers] Delete failed:",$),alert(`Delete failed: ${($==null?void 0:$.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(jx,{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(In,{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(Hn,{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"}),nM.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(Fe,{className:"w-6 h-6 animate-spin text-gray-400"})}):N.length===0?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(jx,{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",HJ[C.transport]??"bg-gray-50 text-gray-600"),children:VJ[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",KJ[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:k===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:k===C.id?l.jsx(Fe,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(lB,{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(Sd,{className:"w-3.5 h-3.5"})}),l.jsx("button",{onClick:A=>_(A,C.id,C.name),disabled:v===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:v===C.id?l.jsx(Fe,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(sr,{className:"w-3.5 h-3.5"})})]})})]},C.id))})]})})]})}),n&&l.jsx(WJ,{server:b,isOpen:g,onClose:()=>y(!1),onSave:async C=>{await s(C)},onUpdate:async(C,A)=>{await o(C,A)}})]})}const qJ={name:"",isTest:!1,apiServer:"",allowedServers:"",defaultKubeconfig:""};function YJ({environment:e,onClose:t,onSaved:n,sendRpc:r}){const i=!e,[a,s]=m.useState(()=>e?{name:e.name,isTest:e.isTest,apiServer:e.apiServer,allowedServers:e.allowedServers.join(", "),defaultKubeconfig:""}:{...qJ}),[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(p=>p.trim()).filter(Boolean):void 0,h=a.isTest&&a.defaultKubeconfig.trim()?a.defaultKubeconfig.trim():void 0;i?await r("environment.create",{name:a.name.trim(),isTest:a.isTest,apiServer:a.apiServer.trim(),allowedServers:f,defaultKubeconfig:h}):await r("environment.update",{id:e.id,name:a.name.trim(),isTest:a.isTest,apiServer:a.apiServer.trim(),allowedServers:f,defaultKubeconfig:h}),n()}catch(f){console.error("[Environments] 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 Environment":`Edit: ${e.name}`}),l.jsx("button",{onClick:t,className:"p-1.5 text-gray-400 hover:text-gray-600 rounded-md",children:l.jsx(Ze,{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-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:"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 XJ(e){try{const t=e.split(`
|
|
682
|
+
`),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 ZJ({environments:e,initialEnvId:t,onClose:n,onUploaded:r,sendRpc:i}){const[a,s]=m.useState(t??""),[o,c]=m.useState(""),[u,d]=m.useState(!1),[f,h]=m.useState(""),p=e.find(x=>x.id===a),g=m.useMemo(()=>o.trim()?XJ(o):null,[o]),y=g!==null,b=async()=>{if(!(!a||!o.trim())){d(!0),h("");try{await i("userEnvConfig.set",{envId:a,kubeconfig:o}),r()}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:n,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",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Environment"}),l.jsxs("select",{value:a,onChange:x=>s(x.target.value),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 bg-white",children:[l.jsx("option",{value:"",children:"Select an environment..."}),e.map(x=>l.jsxs("option",{value:x.id,children:[x.name," (",x.apiServer,") ",x.hasUserKubeconfig?"— replace":""]},x.id))]}),p&&l.jsxs("p",{className:"text-xs text-gray-400 mt-1.5",children:["API Server: ",l.jsx("span",{className:"font-mono",children:p.apiServer}),p.hasUserKubeconfig&&" — existing kubeconfig will be replaced"]})]}),y?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(Sr,{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:[g.clusters.map(x=>l.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600",children:[l.jsx(sw,{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)),g.currentContext&&l.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["Context: ",l.jsx("span",{className:"font-mono",children:g.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:n,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:b,disabled:!a||!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 TC={production:"bg-blue-50 text-blue-700",testing:"bg-amber-50 text-amber-700"};function QJ(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n,loaded:r}=ic(e,t),[i,a]=bd(),s=i.get("tab"),o=s==="ssh"?"ssh":s==="api"?"api":s==="credentials"?"ssh":"environments",c=D=>{a(D==="environments"?{}:{tab:D})},[u,d]=m.useState([]),[f,h]=m.useState(!1),[p,g]=m.useState(!0),[y,b]=m.useState(""),[x,v]=m.useState(!1),[w,k]=m.useState(null),[S,j]=m.useState(null),[N,P]=m.useState(!1),[T,E]=m.useState(),_=m.useRef(!1),C=m.useCallback(async()=>{g(!0);try{const D=await e("environment.list");d(D.environments??[]),h(D.isAdmin??!1)}catch(D){console.error("[Environments] Failed to load:",D)}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 D=y.toLowerCase();return u.filter(H=>H.name.toLowerCase().includes(D)||H.apiServer.toLowerCase().includes(D)||H.allowedServers.some(ee=>ee.toLowerCase().includes(D)))},[u,y]),I=()=>{k(null),v(!0)},$=D=>{k(D),v(!0)},oe=async(D,H)=>{if(D.stopPropagation(),!S&&window.confirm(`Delete environment "${H.name}"? This action cannot be undone.`)){j(H.id);try{await e("environment.delete",{id:H.id}),await C()}catch(ee){console.error("[Environments] Delete failed:",ee)}finally{j(null)}}},Z=()=>{v(!1),k(null),C()},M=D=>{E(D),P(!0)},K=()=>{P(!1),E(void 0),C()},O=async D=>{if(window.confirm("Remove your kubeconfig for this environment?"))try{await e("userEnvConfig.remove",{envId:D}),await C()}catch(H){console.error("Failed to remove env config:",H)}},ie=n||f,J=D=>D.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"}):D.hasDefaultKubeconfig&&D.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 environments, 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:"environments",label:"Kubernetes"},{key:"ssh",label:"SSH"},{key:"api",label:"API"}].map(D=>l.jsx("button",{onClick:()=>c(D.key),className:U("py-3 text-sm font-medium border-b-2 transition-colors",o===D.key?"border-primary-600 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:D.label},D.key))})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsx("div",{className:"max-w-5xl mx-auto",children:o!=="environments"?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(Il,{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(Hn,{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:D=>b(D.target.value),placeholder:"Search environments...",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"}),ie&&l.jsxs("button",{onClick:I,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(In,{className:"w-4 h-4"}),"New Kubernetes"]})]}),p?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(Fe,{className:"w-6 h-6 animate-spin text-gray-400"})}):A.length===0?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(Il,{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 environments yet":"No matching environments"}),l.jsx("p",{className:"text-xs text-gray-500",children:u.length===0?ie?"Create your first environment to get started.":"No environments 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(D=>l.jsxs("tr",{className:U("border-b border-gray-50 last:border-0 hover:bg-gray-50/50 transition-colors",ie&&"cursor-pointer"),onClick:()=>ie&&$(D),children:[l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-sm font-medium text-gray-900",children:D.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",D.isTest?TC.testing:TC.production),children:D.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:D.apiServer})}),l.jsx("td",{className:"px-6 py-4",children:J(D)}),l.jsx("td",{className:"px-6 py-4 text-center",children:l.jsxs("div",{className:"inline-flex items-center gap-1",children:[D.hasUserKubeconfig?l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:H=>{H.stopPropagation(),M(D.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:H=>{H.stopPropagation(),O(D.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:H=>{H.stopPropagation(),M(D.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(t_,{className:"w-3 h-3 inline mr-1"}),"Upload"]}),ie&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-px h-4 bg-gray-200 mx-1"}),l.jsx("button",{onClick:H=>{H.stopPropagation(),$(D)},className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",title:"Edit environment",children:l.jsx(Sd,{className:"w-3.5 h-3.5"})}),l.jsx("button",{onClick:H=>oe(H,D),disabled:S===D.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 environment",children:S===D.id?l.jsx(Fe,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(sr,{className:"w-3.5 h-3.5"})})]})]})})]},D.id))})]})})]})})}),x&&ie&&l.jsx(YJ,{environment:w,onClose:()=>{v(!1),k(null)},onSaved:Z,sendRpc:e}),N&&l.jsx(ZJ,{environments:u.map(D=>({id:D.id,name:D.name,apiServer:D.apiServer,hasUserKubeconfig:D.hasUserKubeconfig})),initialEnvId:T,onClose:()=>{P(!1),E(void 0)},onUploaded:K,sendRpc:e})]}):l.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:l.jsx(Fe,{className:"w-5 h-5 animate-spin"})})}function JJ(e){const{sendRpc:t,isConnected:n}=$t(),[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 eee(e){const{sendRpc:t,isConnected:n}=$t(),[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 OC(e){return e===0?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function _C(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 tee({buckets:e,snapshot:t,range:n}){const r=e.reduce((g,y)=>g+y.tokensInput+y.tokensOutput,0),i=_C(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=_C(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(kd,{className:"w-4 h-4 text-indigo-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:OC(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(Nm,{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(n_,{className:"w-4 h-4 text-emerald-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:OC(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(uw,{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 nee=["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 w1(e){if(typeof e!="string")return!1;var t=nee;return t.includes(e)}var ree=["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"],iee=new Set(ree);function rM(e){return typeof e!="string"?!1:iee.has(e)}function iM(e){return typeof e=="string"&&e.startsWith("data-")}function di(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(rM(n)||iM(n))&&(t[n]=e[n]);return t}function Bm(e){if(e==null)return null;if(m.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return di(t)}return typeof e=="object"&&!Array.isArray(e)?di(e):null}function jr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(rM(n)||iM(n)||w1(n))&&(t[n]=e[n]);return t}function aee(e){return e==null?null:m.isValidElement(e)?jr(e.props):typeof e=="object"&&!Array.isArray(e)?jr(e):null}var see=["children","width","height","viewBox","className","style","title","desc"];function sv(){return sv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sv.apply(null,arguments)}function oee(e,t){if(e==null)return{};var n,r,i=lee(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 lee(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 S1=m.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:s,style:o,title:c,desc:u}=e,d=oee(e,see),f=a||{width:r,height:i,x:0,y:0},h=ot("recharts-surface",s);return m.createElement("svg",sv({},jr(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)}),cee=["children","className"];function ov(){return ov=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ov.apply(null,arguments)}function uee(e,t){if(e==null)return{};var n,r,i=dee(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 dee(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 Mi=m.forwardRef((e,t)=>{var{children:n,className:r}=e,i=uee(e,cee),a=ot("recharts-layer",r);return m.createElement("g",ov({className:a},jr(i),{ref:t}),n)}),aM=m.createContext(null),fee=()=>m.useContext(aM);function gt(e){return function(){return e}}const sM=Math.cos,dp=Math.sin,pi=Math.sqrt,fp=Math.PI,Um=2*fp,lv=Math.PI,cv=2*lv,Rs=1e-6,hee=cv-Rs;function oM(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function pee(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return oM;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 mee{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?oM:pee(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,b=p*p+g*g,x=Math.sqrt(y),v=Math.sqrt(h),w=a*Math.tan((lv-Math.acos((y+h-b)/(2*x*v)))/2),k=w/v,S=w/x;Math.abs(k-1)>Rs&&this._append`L${t+k*d},${n+k*f}`,this._append`A${a},${a},0,0,${+(f*p>d*g)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,i,a,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%cv+cv),h>hee?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>=lv)},${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 k1(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 mee(t)}function j1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lM(e){this._context=e}lM.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 Vm(e){return new lM(e)}function cM(e){return e[0]}function uM(e){return e[1]}function dM(e,t){var n=gt(!0),r=null,i=Vm,a=null,s=k1(o);e=typeof e=="function"?e:e===void 0?cM:gt(e),t=typeof t=="function"?t:t===void 0?uM:gt(t);function o(c){var u,d=(c=j1(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:gt(+c),o):e},o.y=function(c){return arguments.length?(t=typeof c=="function"?c:gt(+c),o):t},o.defined=function(c){return arguments.length?(n=typeof c=="function"?c:gt(!!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=gt(!0),a=null,s=Vm,o=null,c=k1(u);e=typeof e=="function"?e:e===void 0?cM:gt(+e),t=typeof t=="function"?t:gt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?uM:gt(+n);function u(f){var h,p,g,y=(f=j1(f)).length,b,x=!1,v,w=new Array(y),k=new Array(y);for(a==null&&(o=s(v=c())),h=0;h<=y;++h){if(!(h<y&&i(b=f[h],h,f))===x)if(x=!x)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=h-1;g>=p;--g)o.point(w[g],k[g]);o.lineEnd(),o.areaEnd()}x&&(w[h]=+e(b,h,f),k[h]=+t(b,h,f),o.point(r?+r(b,h,f):w[h],n?+n(b,h,f):k[h]))}if(v)return o=null,v+""||null}function d(){return dM().defined(i).curve(s).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:gt(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:gt(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:gt(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:gt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:gt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:gt(+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:gt(!!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 fM{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 gee(e){return new fM(e,!0)}function yee(e){return new fM(e,!1)}const N1={draw(e,t){const n=pi(t/fp);e.moveTo(n,0),e.arc(0,0,n,0,Um)}},xee={draw(e,t){const n=pi(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()}},hM=pi(1/3),vee=hM*2,bee={draw(e,t){const n=pi(t/vee),r=n*hM;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},wee={draw(e,t){const n=pi(t),r=-n/2;e.rect(r,r,n,n)}},See=.8908130915292852,pM=dp(fp/10)/dp(7*fp/10),kee=dp(Um/10)*pM,jee=-sM(Um/10)*pM,Nee={draw(e,t){const n=pi(t*See),r=kee*n,i=jee*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=Um*a/5,o=sM(s),c=dp(s);e.lineTo(c*n,-o*n),e.lineTo(o*r-c*i,c*r+o*i)}e.closePath()}},ey=pi(3),Cee={draw(e,t){const n=-pi(t/(ey*3));e.moveTo(0,n*2),e.lineTo(-ey*n,-n),e.lineTo(ey*n,-n),e.closePath()}},Or=-.5,_r=pi(3)/2,uv=1/pi(12),Pee=(uv/2+1)*3,Eee={draw(e,t){const n=pi(t/Pee),r=n/2,i=n*uv,a=r,s=n*uv+n,o=-a,c=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(o,c),e.lineTo(Or*r-_r*i,_r*r+Or*i),e.lineTo(Or*a-_r*s,_r*a+Or*s),e.lineTo(Or*o-_r*c,_r*o+Or*c),e.lineTo(Or*r+_r*i,Or*i-_r*r),e.lineTo(Or*a+_r*s,Or*s-_r*a),e.lineTo(Or*o+_r*c,Or*c-_r*o),e.closePath()}};function Aee(e,t){let n=null,r=k1(i);e=typeof e=="function"?e:gt(e||N1),t=typeof t=="function"?t:gt(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:gt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:gt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function hp(){}function pp(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 mM(e){this._context=e}mM.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:pp(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:pp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tee(e){return new mM(e)}function gM(e){this._context=e}gM.prototype={areaStart:hp,areaEnd:hp,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:pp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Oee(e){return new gM(e)}function yM(e){this._context=e}yM.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:pp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _ee(e){return new yM(e)}function xM(e){this._context=e}xM.prototype={areaStart:hp,areaEnd:hp,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 Dee(e){return new xM(e)}function DC(e){return e<0?-1:1}function MC(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(DC(a)+DC(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function IC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ty(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 mp(e){this._context=e}mp.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:ty(this,this._t0,IC(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,ty(this,IC(this,n=MC(this,e,t)),n);break;default:ty(this,this._t0,n=MC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function vM(e){this._context=new bM(e)}(vM.prototype=Object.create(mp.prototype)).point=function(e,t){mp.prototype.point.call(this,t,e)};function bM(e){this._context=e}bM.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 Mee(e){return new mp(e)}function Iee(e){return new vM(e)}function wM(e){this._context=e}wM.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=LC(e),i=LC(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 LC(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 Lee(e){return new wM(e)}function Wm(e,t){this._context=e,this._t=t}Wm.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 Ree(e){return new Wm(e,.5)}function Fee(e){return new Wm(e,0)}function zee(e){return new Wm(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 dv(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function $ee(e,t){return e[t]}function Bee(e){const t=[];return t.key=e,t}function Uee(){var e=gt([]),t=dv,n=yo,r=$ee;function i(a){var s=Array.from(e.apply(this,arguments),Bee),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=j1(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:gt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:gt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?dv:typeof a=="function"?a:gt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??yo,i):n},i}function Vee(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 Wee(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 Hee(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]],b=y[r][1]||0,x=y[r-1][1]||0;p+=b-x}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 Hm={},SM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(SM);var C1={};(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})(C1);var Km={};(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})(Km);var Gm={},kM={};(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})(kM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kM,n=Km;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})(Gm);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=SM,n=C1,r=Km,i=Gm;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})(Hm);var Kee=Hm.get;const qm=hi(Kee);var Gee=4;function qa(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gee,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function yn(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+qa(o)+a:i+a},"")}var $r=e=>e===0?0:e>0?1:-1,Ii=e=>typeof e=="number"&&e!=+e,xo=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ae=e=>(typeof e=="number"||e instanceof Number)&&!Ii(e),Li=e=>Ae(e)||typeof e=="string",qee=0,Qu=e=>{var t=++qee;return"".concat(e||"").concat(t)},fs=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ae(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 Ii(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},jM=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 Ae(e)&&Ae(t)?qa(e+n*(t-e)):t}function NM(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):qm(r,t))===n)}var kn=e=>e===null||typeof e>"u",Dd=e=>kn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function tr(e){return e!=null}function Ao(){}var Yee=["type","size","sizeType"];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 RC(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 FC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RC(Object(n),!0).forEach(function(r){Xee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xee(e,t,n){return(t=Zee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zee(e){var t=Qee(e,"string");return typeof t=="symbol"?t:t+""}function Qee(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 Jee(e,t){if(e==null)return{};var n,r,i=ete(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 ete(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 CM={symbolCircle:N1,symbolCross:xee,symbolDiamond:bee,symbolSquare:wee,symbolStar:Nee,symbolTriangle:Cee,symbolWye:Eee},tte=Math.PI/180,nte=e=>{var t="symbol".concat(Dd(e));return CM[t]||N1},rte=(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*tte;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}},ite=(e,t)=>{CM["symbol".concat(Dd(e))]=t},PM=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Jee(e,Yee),a=FC(FC({},i),{},{type:t,size:n,sizeType:r}),s="circle";typeof t=="string"&&(s=t);var o=()=>{var h=nte(s),p=Aee().type(h).size(rte(n,r,s)),g=p();if(g!==null)return g},{className:c,cx:u,cy:d}=a,f=jr(a);return Ae(u)&&Ae(d)&&Ae(n)?m.createElement("path",fv({},f,{className:ot("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:o()})):null};PM.registerSymbol=ite;var EM=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,P1=(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=>{w1(i)&&typeof n[i]=="function"&&(r[i]=a=>n[i](n,a))}),r},ate=(e,t,n)=>r=>(e(t,n,r),null),AM=(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];w1(i)&&typeof a=="function"&&(r||(r={}),r[i]=ate(a,t,n))}),r};function zC(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 ste(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zC(Object(n),!0).forEach(function(r){ote(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ote(e,t,n){return(t=lte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lte(e){var t=cte(e,"string");return typeof t=="symbol"?t:t+""}function cte(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 lr(e,t){var n=ste({},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 gp(){return gp=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},gp.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 TM(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){ute(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 ute(e,t,n){return(t=dte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dte(e){var t=fte(e,"string");return typeof t=="symbol"?t:t+""}function fte(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 Ir=32,hte={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function pte(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function mte(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Ir/2,a=Ir/6,s=Ir/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:pte(t.payload),x1:0,y1:i,x2:Ir,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,`
|
|
683
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(i,`
|
|
684
|
+
H`).concat(Ir,"M").concat(2*s,",").concat(i,`
|
|
685
|
+
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(Ir/8,"h").concat(Ir,"v").concat(Ir*3/4,"h").concat(-Ir,"z"),className:"recharts-legend-icon"});if(m.isValidElement(t.legendIcon)){var u=TM({},t);return delete u.legendIcon,m.cloneElement(t.legendIcon,u)}return m.createElement(PM,{fill:o,cx:i,cy:i,size:Ir,sizeType:"diameter",type:c})}function gte(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:s,labelStyle:o}=e,c={x:0,y:0,width:Ir,height:Ir},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=ot({"recharts-legend-item":!0,["legend-item-".concat(h)]:!0,inactive:f.inactive});if(f.type==="none")return null;var y=typeof o=="object"?TM({},o):{};y.color=f.inactive?a:y.color||f.color;var b=p?p(f.value,f,h):f.value;return m.createElement("li",gp({className:g,style:u,key:"legend-item-".concat(h)},AM(e,f,h)),m.createElement(S1,{width:n,height:n,viewBox:c,style:d,"aria-label":"".concat(b," legend icon")},m.createElement(mte,{data:f,iconType:s,inactiveColor:a})),m.createElement("span",{className:"recharts-legend-item-text",style:y},b))})}var yte=e=>{var t=lr(e,hte),{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(gte,gp({},t,{payload:n})))},OM={},_M={};(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})(_M);var DM={};(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})(DM);var E1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(E1);var MM={},A1={},IM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(IM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IM;function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(A1);var LM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(LM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=A1,n=LM;function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(MM);var RM={},FM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hm;function n(r){return function(i){return t.get(i,r)}}e.property=n})(FM);var zM={},T1={},$M={},O1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(O1);var _1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(_1);var D1={};(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})(D1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=O1,n=_1,r=D1;function i(d,f,h){return typeof h!="function"?i(d,f,()=>{}):a(d,f,function p(g,y,b,x,v,w){const k=h(g,y,b,x,v,w);return k!==void 0?!!k: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 b=g[y];if(!n.isPrimitive(d)&&!(b in d)||f[b]===void 0&&d[b]!==void 0||f[b]===null&&d[b]!==null||!h(d[b],f[b],b,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 b=d.get(g);if(h(b,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 b=f[y];let x=!1;for(let v=0;v<d.length;v++){if(g.has(v))continue;const w=d[v];let k=!1;if(h(w,b,y,d,f,p)&&(k=!0),k){g.add(v),x=!0;break}}if(!x)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})($M);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$M;function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(T1);var BM={},M1={},UM={};(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})(UM);var Ym={};(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})(Ym);var I1={};(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]",b="[object Uint8Array]",x="[object Uint8ClampedArray]",v="[object Uint16Array]",w="[object Uint32Array]",k="[object BigUint64Array]",S="[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=k,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=S,e.mapTag=c,e.numberTag=r,e.objectTag=p,e.regexpTag=t,e.setTag=u,e.stringTag=n,e.symbolTag=s,e.uint16ArrayTag=v,e.uint32ArrayTag=w,e.uint8ArrayTag=b,e.uint8ClampedArrayTag=x})(I1);var VM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(VM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UM,n=Ym,r=I1,i=_1,a=VM;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 b=new Array(d.length);p.set(d,b);for(let x=0;x<d.length;x++)b[x]=o(d[x],x,h,p,g);return Object.hasOwn(d,"index")&&(b.index=d.index),Object.hasOwn(d,"input")&&(b.input=d.input),b}if(d instanceof Date)return new Date(d.getTime());if(d instanceof RegExp){const b=new RegExp(d.source,d.flags);return b.lastIndex=d.lastIndex,b}if(d instanceof Map){const b=new Map;p.set(d,b);for(const[x,v]of d)b.set(x,o(v,x,h,p,g));return b}if(d instanceof Set){const b=new Set;p.set(d,b);for(const x of d)b.add(o(x,void 0,h,p,g));return b}if(typeof Buffer<"u"&&Buffer.isBuffer(d))return d.subarray();if(a.isTypedArray(d)){const b=new(Object.getPrototypeOf(d)).constructor(d.length);p.set(d,b);for(let x=0;x<d.length;x++)b[x]=o(d[x],x,h,p,g);return b}if(d instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&d instanceof SharedArrayBuffer)return d.slice(0);if(d instanceof DataView){const b=new DataView(d.buffer.slice(0),d.byteOffset,d.byteLength);return p.set(d,b),c(b,d,h,p,g),b}if(typeof File<"u"&&d instanceof File){const b=new File([d],d.name,{type:d.type});return p.set(d,b),c(b,d,h,p,g),b}if(typeof Blob<"u"&&d instanceof Blob){const b=new Blob([d],{type:d.type});return p.set(d,b),c(b,d,h,p,g),b}if(d instanceof Error){const b=structuredClone(d);return p.set(d,b),b.message=d.message,b.name=d.name,b.stack=d.stack,b.cause=d.cause,b.constructor=d.constructor,c(b,d,h,p,g),b}if(d instanceof Boolean){const b=new Boolean(d.valueOf());return p.set(d,b),c(b,d,h,p,g),b}if(d instanceof Number){const b=new Number(d.valueOf());return p.set(d,b),c(b,d,h,p,g),b}if(d instanceof String){const b=new String(d.valueOf());return p.set(d,b),c(b,d,h,p,g),b}if(typeof d=="object"&&u(d)){const b=Object.create(Object.getPrototypeOf(d));return p.set(d,b),c(b,d,h,p,g),b}return d}function c(d,f,h=d,p,g){const y=[...Object.keys(f),...t.getSymbols(f)];for(let b=0;b<y.length;b++){const x=y[b],v=Object.getOwnPropertyDescriptor(d,x);(v==null||v.writable)&&(d[x]=o(f[x],x,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})(M1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M1;function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(BM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=T1,n=BM;function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(zM);var WM={},HM={},KM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M1,n=Ym,r=I1;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})(KM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KM;function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(HM);var GM={},L1={};(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})(L1);var qM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ym;function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(qM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=C1,n=L1,r=qM,i=Gm;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=T1,n=Km,r=HM,i=Hm,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})(WM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=E1,n=FM,r=zM,i=WM;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})(RM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_M,n=DM,r=E1,i=MM,a=RM;function s(o,c=r.identity){return i.isArrayLikeObject(o)?t.uniqBy(Array.from(o),n.ary(a.iteratee(c),1)):[]}e.uniqBy=s})(OM);var xte=OM.uniqBy;const BC=hi(xte);function YM(e,t,n){return t===!0?BC(e,n):typeof t=="function"?BC(e,t):e}var XM={exports:{}},ZM={},QM={exports:{}},JM={};/**
|
|
686
|
+
* @license React
|
|
687
|
+
* use-sync-external-store-shim.production.js
|
|
688
|
+
*
|
|
689
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
690
|
+
*
|
|
691
|
+
* This source code is licensed under the MIT license found in the
|
|
692
|
+
* LICENSE file in the root directory of this source tree.
|
|
693
|
+
*/var Bl=m;function vte(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bte=typeof Object.is=="function"?Object.is:vte,wte=Bl.useState,Ste=Bl.useEffect,kte=Bl.useLayoutEffect,jte=Bl.useDebugValue;function Nte(e,t){var n=t(),r=wte({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return kte(function(){i.value=n,i.getSnapshot=t,ny(i)&&a({inst:i})},[e,n,t]),Ste(function(){return ny(i)&&a({inst:i}),e(function(){ny(i)&&a({inst:i})})},[e]),jte(n),n}function ny(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bte(e,n)}catch{return!0}}function Cte(e,t){return t()}var Pte=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Cte:Nte;JM.useSyncExternalStore=Bl.useSyncExternalStore!==void 0?Bl.useSyncExternalStore:Pte;QM.exports=JM;var Ete=QM.exports;/**
|
|
694
|
+
* @license React
|
|
695
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
696
|
+
*
|
|
697
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
698
|
+
*
|
|
699
|
+
* This source code is licensed under the MIT license found in the
|
|
700
|
+
* LICENSE file in the root directory of this source tree.
|
|
701
|
+
*/var Xm=m,Ate=Ete;function Tte(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ote=typeof Object.is=="function"?Object.is:Tte,_te=Ate.useSyncExternalStore,Dte=Xm.useRef,Mte=Xm.useEffect,Ite=Xm.useMemo,Lte=Xm.useDebugValue;ZM.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=Dte(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=Ite(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,Ote(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=_te(e,a[0],a[1]);return Mte(function(){s.hasValue=!0,s.value=o},[o]),Lte(o),o};XM.exports=ZM;var Rte=XM.exports,R1=m.createContext(null),Fte=e=>e,Bt=()=>{var e=m.useContext(R1);return e?e.store.dispatch:Fte},vh=()=>{},zte=()=>vh,$te=(e,t)=>e===t;function De(e){var t=m.useContext(R1),n=m.useMemo(()=>t?r=>{if(r!=null)return e(r)}:vh,[t,e]);return Rte.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:zte,t?t.store.getState:vh,t?t.store.getState:vh,n,$te)}function Bte(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ute(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Vte(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 UC=e=>Array.isArray(e)?e:[e];function Wte(e){const t=Array.isArray(e[0])?e[0]:e;return Vte(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Hte(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Kte=class{constructor(e){this.value=e}deref(){return this.value}},Gte=typeof WeakRef<"u"?WeakRef:Kte,qte=0,VC=1;function Lf(){return{s:qte,v:void 0,o:null,p:null}}function eI(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 b=y.get(g);b===void 0?(o=Lf(),y.set(g,o)):o=b}else{let y=o.p;y===null&&(o.p=y=new Map);const b=y.get(g);b===void 0?(o=Lf(),y.set(g,o)):o=b}}const u=o;let d;if(o.s===VC)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 Gte(d):d}return u.s=VC,u.v=d,d}return s.clearCache=()=>{n=Lf(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function Yte(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()),Bte(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:f,memoizeOptions:h=[],argsMemoize:p=eI,argsMemoizeOptions:g=[]}=d,y=UC(h),b=UC(g),x=Wte(i),v=f(function(){return a++,u.apply(null,arguments)},...y),w=p(function(){s++;const S=Hte(x,arguments);return o=v.apply(null,S),o},...b);return Object.assign(w,{resultFunc:u,memoizedResultFunc:v,dependencies:x,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=Yte(eI),Xte=Object.assign((e,t=q)=>{Ute(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:()=>Xte}),tI={},nI={},rI={};(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})(rI);var iI={},F1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(F1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F1,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})(iI);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rI,n=iI,r=Gm;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 b=0;b<g.length&&y!=null;++b)y=y[g[b]];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 b=t.compareValues(p.criteria[y],g.criteria[y],o[y]);if(b!==0)return b}return 0}).map(p=>p.original)}e.orderBy=i})(nI);var aI={};(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})(aI);var z1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=L1,n=A1,r=O1,i=D1;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})(z1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nI,n=aI,r=z1;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})(tI);var Zte=tI.sortBy;const Zm=hi(Zte);var sI=e=>e.legend.settings,Qte=e=>e.legend.size,Jte=e=>e.legend.payload,ene=q([Jte,sI],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Zm(r,n):r});function tne(){return De(ene)}var Rf=1;function oI(){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 pn(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 nne=typeof Symbol=="function"&&Symbol.observable||"@@observable",WC=nne,ry=()=>Math.random().toString(36).substring(7).split("").join("."),rne={INIT:`@@redux/INIT${ry()}`,REPLACE:`@@redux/REPLACE${ry()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ry()}`},yp=rne;function $1(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 lI(e,t,n){if(typeof e!="function")throw new Error(pn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(pn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(pn(1));return n(lI)(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((b,x)=>{s.set(x,b)}))}function d(){if(c)throw new Error(pn(3));return i}function f(b){if(typeof b!="function")throw new Error(pn(4));if(c)throw new Error(pn(5));let x=!0;u();const v=o++;return s.set(v,b),function(){if(x){if(c)throw new Error(pn(6));x=!1,u(),s.delete(v),a=null}}}function h(b){if(!$1(b))throw new Error(pn(7));if(typeof b.type>"u")throw new Error(pn(8));if(typeof b.type!="string")throw new Error(pn(17));if(c)throw new Error(pn(9));try{c=!0,i=r(i,b)}finally{c=!1}return(a=s).forEach(v=>{v()}),b}function p(b){if(typeof b!="function")throw new Error(pn(10));r=b,h({type:yp.REPLACE})}function g(){const b=f;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(pn(11));function v(){const k=x;k.next&&k.next(d())}return v(),{unsubscribe:b(v)}},[WC](){return this}}}return h({type:yp.INIT}),{dispatch:h,subscribe:f,getState:d,replaceReducer:p,[WC]:g}}function ine(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:yp.INIT})>"u")throw new Error(pn(12));if(typeof n(void 0,{type:yp.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(pn(13))})}function cI(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{ine(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(pn(14));u[f]=g,c=c||g!==p}return c=c||r.length!==Object.keys(s).length,c?u:s}}function xp(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function ane(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(pn(15))};const s={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},o=e.map(c=>c(s));return a=xp(...o)(i.dispatch),{...i,dispatch:a}}}function uI(e){return $1(e)&&"type"in e&&typeof e.type=="string"}var dI=Symbol.for("immer-nothing"),HC=Symbol.for("immer-draftable"),Kn=Symbol.for("immer-state");function ti(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var gr=Object,Ul=gr.getPrototypeOf,vp="constructor",Qm="prototype",hv="configurable",bp="enumerable",bh="writable",Ju="value",fa=e=>!!e&&!!e[Kn];function fi(e){var t;return e?fI(e)||eg(e)||!!e[HC]||!!((t=e[vp])!=null&&t[HC])||tg(e)||ng(e):!1}var sne=gr[Qm][vp].toString(),KC=new WeakMap;function fI(e){if(!e||!B1(e))return!1;const t=Ul(e);if(t===null||t===gr[Qm])return!0;const n=gr.hasOwnProperty.call(t,vp)&&t[vp];if(n===Object)return!0;if(!Go(n))return!1;let r=KC.get(n);return r===void 0&&(r=Function.toString.call(n),KC.set(n,r)),r===sne}function Jm(e,t,n=!0){Md(e)===0?(n?Reflect.ownKeys(e):gr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Md(e){const t=e[Kn];return t?t.type_:eg(e)?1:tg(e)?2:ng(e)?3:0}var GC=(e,t,n=Md(e))=>n===2?e.has(t):gr[Qm].hasOwnProperty.call(e,t),pv=(e,t,n=Md(e))=>n===2?e.get(t):e[t],wp=(e,t,n,r=Md(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function one(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var eg=Array.isArray,tg=e=>e instanceof Map,ng=e=>e instanceof Set,B1=e=>typeof e=="object",Go=e=>typeof e=="function",iy=e=>typeof e=="boolean";function lne(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ki=e=>e.copy_||e.base_,U1=e=>e.modified_?e.copy_:e.base_;function mv(e,t){if(tg(e))return new Map(e);if(ng(e))return new Set(e);if(eg(e))return Array[Qm].slice.call(e);const n=fI(e);if(t===!0||t==="class_only"&&!n){const r=gr.getOwnPropertyDescriptors(e);delete r[Kn];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[hv]=!0),(o.get||o.set)&&(r[s]={[hv]:!0,[bh]:!0,[bp]:o[bp],[Ju]:e[s]})}return gr.create(Ul(e),r)}else{const r=Ul(e);if(r!==null&&n)return{...e};const i=gr.create(r);return gr.assign(i,e)}}function V1(e,t=!1){return rg(e)||fa(e)||!fi(e)||(Md(e)>1&&gr.defineProperties(e,{set:Ff,add:Ff,clear:Ff,delete:Ff}),gr.freeze(e),t&&Jm(e,(n,r)=>{V1(r,!0)},!1)),e}function cne(){ti(2)}var Ff={[Ju]:cne};function rg(e){return e===null||!B1(e)?!0:gr.isFrozen(e)}var Sp="MapSet",gv="Patches",qC="ArrayMethods",hI={};function vo(e){const t=hI[e];return t||ti(0,e),t}var YC=e=>!!hI[e],ed,pI=()=>ed,une=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:YC(Sp)?vo(Sp):void 0,arrayMethodsPlugin_:YC(qC)?vo(qC):void 0});function XC(e,t){t&&(e.patchPlugin_=vo(gv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function yv(e){xv(e),e.drafts_.forEach(dne),e.drafts_=null}function xv(e){e===ed&&(ed=e.parent_)}var ZC=e=>ed=une(ed,e);function dne(e){const t=e[Kn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function QC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Kn].modified_&&(yv(t),ti(4)),fi(e)&&(e=JC(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Kn].base_,e,t)}else e=JC(t,n);return fne(t,e,!0),yv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==dI?e:void 0}function JC(e,t){if(rg(t))return t;const n=t[Kn];if(!n)return kp(t,e.handledSet_,e);if(!ig(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);yI(n,e)}return n.copy_}function fne(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&V1(t,n)}function mI(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ig=(e,t)=>e.scope_===t,hne=[];function gI(e,t,n,r){const i=Ki(e),a=e.type_;if(r!==void 0&&pv(i,r,a)===t){wp(i,r,n,a);return}if(!e.draftLocations_){const o=e.draftLocations_=new Map;Jm(i,(c,u)=>{if(fa(u)){const d=o.get(u)||[];d.push(c),o.set(u,d)}})}const s=e.draftLocations_.get(t)??hne;for(const o of s)wp(i,o,n,a)}function pne(e,t,n){e.callbacks_.push(function(i){var o;const a=t;if(!a||!ig(a,i))return;(o=i.mapSetPlugin_)==null||o.fixSetContents(a);const s=U1(a);gI(e,a.draft_??a,s,n),yI(a,i)})}function yI(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)}mI(e)}}function mne(e,t,n){const{scope_:r}=e;if(fa(n)){const i=n[Kn];ig(i,r)&&i.callbacks_.push(function(){wh(e);const s=U1(i);gI(e,n,s,t)})}else fi(n)&&e.callbacks_.push(function(){const a=Ki(e);e.type_===3?a.has(n)&&kp(n,r.handledSet_,r):pv(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&kp(pv(e.copy_,t,e.type_),r.handledSet_,r)})}function kp(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||fa(e)||t.has(e)||!fi(e)||rg(e)||(t.add(e),Jm(e,(r,i)=>{if(fa(i)){const a=i[Kn];if(ig(a,n)){const s=U1(a);wp(e,r,s,e.type_),mI(a)}}else fi(i)&&kp(i,t,n)})),e}function gne(e,t){const n=eg(e),r={type_:n?1:0,scope_:t?t.scope_:pI(),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=jp;n&&(i=[r],a=td);const{revoke:s,proxy:o}=Proxy.revocable(i,a);return r.draft_=o,r.revoke_=s,[o,r]}var jp={get(e,t){if(t===Kn)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(!GC(i,t,e.type_))return yne(e,i,t);const a=i[t];if(e.finalized_||!fi(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&lne(t))return a;if(a===ay(e.base_,t)){wh(e);const s=e.type_===1?+t:t,o=bv(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=xI(Ki(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ay(Ki(e),t),a=i==null?void 0:i[Kn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(one(n,i)&&(n!==void 0||GC(e.base_,t,e.type_)))return!0;wh(e),vv(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),mne(e,t,n)),!0},deleteProperty(e,t){return wh(e),ay(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vv(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,[hv]:e.type_!==1||t!=="length",[bp]:r[bp],[Ju]:n[t]}},defineProperty(){ti(11)},getPrototypeOf(e){return Ul(e.base_)},setPrototypeOf(){ti(12)}},td={};for(let e in jp){let t=jp[e];td[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}td.deleteProperty=function(e,t){return td.set.call(this,e,t,void 0)};td.set=function(e,t,n){return jp.set.call(this,e[0],t,n,e[0])};function ay(e,t){const n=e[Kn];return(n?Ki(n):e)[t]}function yne(e,t,n){var i;const r=xI(t,n);return r?Ju in r?r[Ju]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function xI(e,t){if(!(t in e))return;let n=Ul(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ul(n)}}function vv(e){e.modified_||(e.modified_=!0,e.parent_&&vv(e.parent_))}function wh(e){e.copy_||(e.assigned_=new Map,e.copy_=mv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var xne=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Go(n)&&!Go(r)){const s=r;r=n;const o=this;return function(u=s,...d){return o.produce(u,f=>r.call(this,f,...d))}}Go(r)||ti(6),i!==void 0&&!Go(i)&&ti(7);let a;if(fi(n)){const s=ZC(this),o=bv(s,n,void 0);let c=!0;try{a=r(o),c=!1}finally{c?yv(s):xv(s)}return XC(s,i),QC(a,s)}else if(!n||!B1(n)){if(a=r(n),a===void 0&&(a=n),a===dI&&(a=void 0),this.autoFreeze_&&V1(a,!0),i){const s=[],o=[];vo(gv).generateReplacementPatches_(n,a,{patches_:s,inversePatches_:o}),i(s,o)}return a}else ti(1,n)},this.produceWithPatches=(n,r)=>{if(Go(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]},iy(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),iy(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),iy(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){fi(t)||ti(8),fa(t)&&(t=Br(t));const n=ZC(this),r=bv(n,t,void 0);return r[Kn].isManual_=!0,xv(n),r}finishDraft(t,n){const r=t&&t[Kn];(!r||!r.isManual_)&&ti(9);const{scope_:i}=r;return XC(i,n),QC(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(gv).applyPatches_;return fa(t)?i(t,n):this.produce(t,a=>i(a,n))}};function bv(e,t,n,r){const[i,a]=tg(t)?vo(Sp).proxyMap_(t,n):ng(t)?vo(Sp).proxySet_(t,n):gne(t,n);return((n==null?void 0:n.scope_)??pI()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?pne(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 Br(e){return fa(e)||ti(10,e),vI(e)}function vI(e){if(!fi(e)||rg(e))return e;const t=e[Kn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=mv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=mv(e,!0);return Jm(n,(i,a)=>{wp(n,i,vI(a))},r),t&&(t.finalized_=!1),n}var vne=new xne,bI=vne.produce;function wI(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var bne=wI(),wne=wI,Sne=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?xp:xp.apply(null,arguments)};function Nr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(br(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=>uI(r)&&r.type===e,n}var SI=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 eP(e){return fi(e)?bI(e,()=>{}):e}function zf(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function kne(e){return typeof e=="boolean"}var jne=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let s=new SI;return n&&(kne(n)?s.push(bne):s.push(wne(n.extraArgument))),s},kI="RTK_autoBatch",wt=()=>e=>({payload:e,meta:{[kI]:!0}}),tP=e=>t=>{setTimeout(t,e)},jI=(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:tP(10):e.type==="callback"?e.queueNotification:tP(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[kI]),a=!i,a&&(s||(s=!0,c(u))),r.dispatch(d)}finally{i=!0}}})},Nne=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new SI(e);return r&&i.push(jI(typeof r=="object"?r:void 0)),i};function Cne(e){const t=jne(),{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($1(n))o=cI(n);else throw new Error(br(1));let c;typeof r=="function"?c=r(t):c=t();let u=xp;i&&(u=Sne({trace:!1,...typeof i=="object"&&i}));const d=ane(...c),f=Nne(d);let h=typeof s=="function"?s(f):f();const p=u(...h);return lI(o,a,p)}function NI(e){const t={},n=[];let r;const i={addCase(a,s){const o=typeof a=="string"?a:a.type;if(!o)throw new Error(br(28));if(o in t)throw new Error(br(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 Pne(e){return typeof e=="function"}function Ene(e,t){let[n,r,i]=NI(t),a;if(Pne(e))a=()=>eP(e());else{const o=eP(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(fi(d))return bI(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 Ane="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Tne=(e=21)=>{let t="",n=e;for(;n--;)t+=Ane[Math.random()*64|0];return t},One=Symbol.for("rtk-slice-createasyncthunk");function _ne(e,t){return`${e}/${t}`}function Dne({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[One];return function(i){const{name:a,reducerPath:s=a}=i;if(!a)throw new Error(br(11));const o=(typeof i.reducers=="function"?i.reducers(Ine()):i.reducers)||{},c=Object.keys(o),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(k,S){const j=typeof k=="string"?k:k.type;if(!j)throw new Error(br(12));if(j in u.sliceCaseReducersByType)throw new Error(br(13));return u.sliceCaseReducersByType[j]=S,d},addMatcher(k,S){return u.sliceMatchers.push({matcher:k,reducer:S}),d},exposeAction(k,S){return u.actionCreators[k]=S,d},exposeCaseReducer(k,S){return u.sliceCaseReducersByName[k]=S,d}};c.forEach(k=>{const S=o[k],j={reducerName:k,type:_ne(a,k),createNotation:typeof i.reducers=="function"};Rne(S)?zne(j,S,d,t):Lne(j,S,d)});function f(){const[k={},S=[],j=void 0]=typeof i.extraReducers=="function"?NI(i.extraReducers):[i.extraReducers],N={...k,...u.sliceCaseReducersByType};return Ene(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 S)P.addMatcher(T.matcher,T.reducer);j&&P.addDefaultCase(j)})}const h=k=>k,p=new Map,g=new WeakMap;let y;function b(k,S){return y||(y=f()),y(k,S)}function x(){return y||(y=f()),y.getInitialState()}function v(k,S=!1){function j(P){let T=P[k];return typeof T>"u"&&S&&(T=zf(g,j,x)),T}function N(P=h){const T=zf(p,S,()=>new WeakMap);return zf(T,P,()=>{const E={};for(const[_,C]of Object.entries(i.selectors??{}))E[_]=Mne(C,P,()=>zf(g,P,x),S);return E})}return{reducerPath:k,getSelectors:N,get selectors(){return N(j)},selectSlice:j}}const w={name:a,reducer:b,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:x,...v(s),injectInto(k,{reducerPath:S,...j}={}){const N=S??s;return k.inject({reducerPath:N,reducer:b},j),{...w,...v(N,!0)}}};return w}}function Mne(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 Rn=Dne();function Ine(){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 Lne({type:e,reducerName:t,createNotation:n},r,i){let a,s;if("reducer"in r){if(n&&!Fne(r))throw new Error(br(17));a=r.reducer,s=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?Nr(e,s):Nr(e))}function Rne(e){return e._reducerDefinitionType==="asyncThunk"}function Fne(e){return e._reducerDefinitionType==="reducerWithPrepare"}function zne({type:e,reducerName:t},n,r,i){if(!i)throw new Error(br(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 $ne="task",CI="listener",PI="completed",W1="cancelled",Bne=`task-${W1}`,Une=`task-${PI}`,wv=`${CI}-${W1}`,Vne=`${CI}-${PI}`,ag=class{constructor(e){Fg(this,"name","TaskAbortError");Fg(this,"message");this.code=e,this.message=`${$ne} ${W1} (reason: ${e})`}},H1=(e,t)=>{if(typeof e!="function")throw new TypeError(br(32))},Np=()=>{},EI=(e,t=Np)=>(e.catch(t),e),AI=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ro=e=>{if(e.aborted)throw new ag(e.reason)};function TI(e,t){let n=Np;return new Promise((r,i)=>{const a=()=>i(new ag(e.reason));if(e.aborted){a();return}n=AI(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Np})}var Wne=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof ag?"cancelled":"rejected",error:n}}finally{t==null||t()}},Cp=e=>t=>EI(TI(e,t).then(n=>(ro(e),n))),OI=e=>{const t=Cp(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Sl}=Object,nP={},sg="listenerMiddleware",Hne=(e,t)=>{const n=r=>AI(e,()=>r.abort(e.reason));return(r,i)=>{H1(r);const a=new AbortController;n(a);const s=Wne(async()=>{ro(e),ro(a.signal);const o=await r({pause:Cp(a.signal),delay:OI(a.signal),signal:a.signal});return ro(a.signal),o},()=>a.abort(Une));return i!=null&&i.autoJoin&&t.push(s.catch(Np)),{result:Cp(e)(s),cancel(){a.abort(Bne)}}}},Kne=(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 TI(t,Promise.race(o));return ro(t),c}finally{a()}};return(r,i)=>EI(n(r,i))},_I=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Nr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(br(21));return H1(a),{predicate:i,type:t,effect:a}},DI=Sl(e=>{const{type:t,predicate:n,effect:r}=_I(e);return{id:Tne(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(br(22))}}},{withTypes:()=>DI}),rP=(e,t)=>{const{type:n,effect:r,predicate:i}=_I(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Sv=e=>{e.pending.forEach(t=>{t.abort(wv)})},Gne=(e,t)=>()=>{for(const n of t.keys())Sv(n);e.clear()},iP=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},MI=Sl(Nr(`${sg}/add`),{withTypes:()=>MI}),qne=Nr(`${sg}/removeAll`),II=Sl(Nr(`${sg}/remove`),{withTypes:()=>II}),Yne=(...e)=>{console.error(`${sg}/error`,...e)},Id=(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=Yne}=e;H1(s);const o=p=>(p.unsubscribe=()=>t.delete(p.id),t.set(p.id,p),g=>{p.unsubscribe(),g!=null&&g.cancelActive&&Sv(p)}),c=p=>{const g=rP(t,p)??DI(p);return o(g)};Sl(c,{withTypes:()=>c});const u=p=>{const g=rP(t,p);return g&&(g.unsubscribe(),p.cancelActive&&Sv(g)),!!g};Sl(u,{withTypes:()=>u});const d=async(p,g,y,b)=>{const x=new AbortController,v=Kne(c,x.signal),w=[];try{p.pending.add(x),r(p),await Promise.resolve(p.effect(g,Sl({},y,{getOriginalState:b,condition:(k,S)=>v(k,S).then(Boolean),take:v,delay:OI(x.signal),pause:Cp(x.signal),extra:a,signal:x.signal,fork:Hne(x.signal,w),unsubscribe:p.unsubscribe,subscribe:()=>{t.set(p.id,p)},cancelActiveListeners:()=>{p.pending.forEach((k,S,j)=>{k!==x&&(k.abort(wv),j.delete(k))})},cancel:()=>{x.abort(wv),p.pending.delete(x)},throwIfCancelled:()=>{ro(x.signal)}})))}catch(k){k instanceof ag||iP(s,k,{raisedBy:"effect"})}finally{await Promise.all(w),x.abort(Vne),i(p),p.pending.delete(x)}},f=Gne(t,n);return{middleware:p=>g=>y=>{if(!uI(y))return g(y);if(MI.match(y))return c(y.payload);if(qne.match(y)){f();return}if(II.match(y))return u(y.payload);let b=p.getState();const x=()=>{if(b===nP)throw new Error(br(23));return b};let v;try{if(v=g(y),t.size>0){const w=p.getState(),k=Array.from(t.values());for(const S of k){let j=!1;try{j=S.predicate(y,w,b)}catch(N){j=!1,iP(s,N,{raisedBy:"predicate"})}j&&d(S,y,p,x)}}}finally{b=nP}return v},startListening:c,stopListening:u,clearListeners:f}};function br(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 Xne={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},LI=Rn({name:"chartLayout",initialState:Xne,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:Zne,setLayout:Qne,setChartSize:Jne,setScale:ere}=LI.actions,tre=LI.reducer;function RI(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function qe(e){return Number.isFinite(e)}function Ri(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}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 dl(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){nre(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 nre(e,t,n){return(t=rre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rre(e){var t=ire(e,"string");return typeof t=="symbol"?t:t+""}function ire(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 wn(e,t,n){return kn(e)||kn(t)?n:Li(t)?qm(e,t,n):typeof t=="function"?t(e):n}var are=(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"&&Ae(e[a]))return dl(dl({},e),{},{[a]:e[a]+(r||0)});if((o==="horizontal"||o==="vertical"&&a==="center")&&s!=="middle"&&Ae(e[s]))return dl(dl({},e),{},{[s]:e[s]+(i||0)})}return e},Ui=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",FI=(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},zI=(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?$r(a[0]-a[1])*2*y:y,f||h){var b=(f||h||[]).map((x,v)=>{var w=r?r.indexOf(x):x,k=s.map(w);return qe(k)?{coordinate:k+y,value:x,offset:y,index:v}:null}).filter(tr);return b}return c&&u?u.map((x,v)=>{var w=s.map(x);return qe(w)?{coordinate:w+y,value:x,index:v,offset:y}:null}).filter(tr):s.ticks&&d!=null?s.ticks(d).map((x,v)=>{var w=s.map(x);return qe(w)?{coordinate:w+y,value:x,index:v,offset:y}:null}).filter(tr):s.domain().map((x,v)=>{var w=s.map(x);return qe(w)?{coordinate:w+y,value:r?r[x]:x,index:v,offset:y}:null}).filter(tr)},sre=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=Ii(d)?f:d;h>=0?(u[0]=a,a+=h,u[1]=a):(u[0]=s,s+=h,u[1]=s)}}}},ore=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=Ii(c[1])?c[0]:c[1];u>=0?(c[0]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},lre={sign:sre,expand:Vee,none:yo,silhouette:Wee,wiggle:Hee,positive:ore},cre=(e,t,n)=>{var r,i=(r=lre[n])!==null&&r!==void 0?r:yo,a=Uee().keys(t).value((o,c)=>Number(wn(o,c,0))).order(dv).offset(i),s=a(e);return s.forEach((o,c)=>{o.forEach((u,d)=>{var f=wn(e[d],t[c],0);Array.isArray(f)&&f.length===2&&Ae(f[0])&&Ae(f[1])&&(u[0]=f[0],u[1]=f[1])})}),s};function ure(e){return e==null?void 0:String(e)}function sP(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:s}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!kn(i[t.dataKey])){var o=NM(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=wn(i,kn(s)?t.dataKey:s),u=t.scale.map(c);return Ae(u)?u:null}var dre=e=>{var t=e.flat(2).filter(Ae);return[Math.min(...t),Math.max(...t)]},fre=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],hre=(e,t,n)=>{if(e!=null)return fre(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=RI(u,t,n),f=dre(d);return!qe(f[0])||!qe(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]))},oP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,lP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Pp=(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=Zm(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 cP(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 $I(e,t){if(e)return String(e);if(typeof t=="string")return t}var pre=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},mre=(e,t)=>t==="centric"?e.angle:e.radius,wa=e=>e.layout.width,Sa=e=>e.layout.height,gre=e=>e.layout.scale,BI=e=>e.layout.margin,og=q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),lg=q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),yre="data-recharts-item-index",xre="data-recharts-item-id",Ld=60;function uP(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?uP(Object(n),!0).forEach(function(r){vre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vre(e,t,n){return(t=bre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bre(e){var t=wre(e,"string");return typeof t=="symbol"?t:t+""}function wre(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 Sre=e=>e.brush.height;function kre(e){var t=lg(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Ld;return n+i}return n},0)}function jre(e){var t=lg(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Ld;return n+i}return n},0)}function Nre(e){var t=og(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Cre(e){var t=og(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var jn=q([wa,Sa,BI,Sre,kre,jre,Nre,Cre,sI,Qte],(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=are(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)})}),Pre=q(jn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),UI=q(wa,Sa,(e,t)=>({x:0,y:0,width:e,height:t})),Ere=m.createContext(null),cr=()=>m.useContext(Ere)!=null,cg=e=>e.brush,ug=q([cg,jn,BI],(e,t,n)=>({height:e.height,x:Ae(e.x)?e.x:t.left,y:Ae(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Ae(e.width)?e.width:t.width})),VI={},WI={},HI={};(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},b=()=>{d()},x=function(...v){if(i!=null&&i.aborted)return;s=this,o=v;const w=h==null;p(),c&&w&&d()};return x.schedule=p,x.cancel=y,x.flush=b,i==null||i.addEventListener("abort",y,{once:!0}),x}e.debounce=t})(HI);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=HI;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})(WI);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WI;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})(VI);var Are=VI.throttle;const Tre=hi(Are);var Ep=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}},KI=(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}},Ore={width:0,height:0,overflow:"visible"},_re={width:0,overflowX:"visible"},Dre={height:0,overflowY:"visible"},Mre={},Ire=e=>{var{width:t,height:n}=e,r=xo(t),i=xo(n);return r&&i?Ore:r?_re:i?Dre:Mre};function Lre(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 kv(){return kv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kv.apply(null,arguments)}function dP(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 fP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dP(Object(n),!0).forEach(function(r){Rre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rre(e,t,n){return(t=Fre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fre(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 $re(e){return Ri(e.width)&&Ri(e.height)}function qI(e){var{children:t,width:n,height:r}=e,i=m.useMemo(()=>({width:n,height:r}),[n,r]);return $re(i)?m.createElement(GI.Provider,{value:i},t):null}var K1=()=>m.useContext(GI),Bre=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),b=m.useRef();b.current=p,m.useImperativeHandle(t,()=>y.current);var[x,v]=m.useState({containerWidth:r.width,containerHeight:r.height}),w=m.useCallback((P,T)=>{v(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,I=C[0];if(I!=null){var{width:$,height:oe}=I.contentRect;w($,oe),(A=b.current)===null||A===void 0||A.call(b,$,oe)}};d>0&&(P=Tre(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:k,containerHeight:S}=x;Ep(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:j,calculatedHeight:N}=KI(k,S,{width:i,height:a,aspect:n,maxHeight:c});return Ep(j!=null&&j>0||N!=null&&N>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
702
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
703
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
704
|
+
height and width.`,j,N,i,a,s,o,n),m.createElement("div",{id:f?"".concat(f):void 0,className:ot("recharts-responsive-container",h),style:fP(fP({},g),{},{width:i,height:a,minWidth:s,minHeight:o,maxHeight:c}),ref:y},m.createElement("div",{style:Ire({width:i,height:a})},m.createElement(qI,{width:j,height:N},u)))}),G1=m.forwardRef((e,t)=>{var n=K1();if(Ri(n.width)&&Ri(n.height))return e.children;var{width:r,height:i}=Lre({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:s}=KI(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ae(a)&&Ae(s)?m.createElement(qI,{width:a,height:s},e.children):m.createElement(Bre,kv({},e,{width:r,height:i,ref:t}))});function q1(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 dg=()=>{var e,t=cr(),n=De(Pre),r=De(ug),i=(e=De(cg))===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}},Ure={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},YI=()=>{var e;return(e=De(jn))!==null&&e!==void 0?e:Ure},Y1=()=>De(wa),X1=()=>De(Sa),Vre=()=>De(e=>e.layout.margin),Tt=e=>e.layout.layoutType,ac=()=>De(Tt),Z1=()=>{var e=ac();if(e==="horizontal"||e==="vertical")return e},XI=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Wre=()=>{var e=ac();return e!==void 0},Rd=e=>{var t=Bt(),n=cr(),{width:r,height:i}=e,a=K1(),s=r,o=i;return a&&(s=a.width>0?a.width:r,o=a.height>0?a.height:i),m.useEffect(()=>{!n&&Ri(s)&&Ri(o)&&t(Jne({width:s,height:o}))},[t,n,s,o]),null},ZI=Symbol.for("immer-nothing"),hP=Symbol.for("immer-draftable"),Cr=Symbol.for("immer-state");function ni(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var nd=Object.getPrototypeOf;function Vl(e){return!!e&&!!e[Cr]}function bo(e){var t;return e?QI(e)||Array.isArray(e)||!!e[hP]||!!((t=e.constructor)!=null&&t[hP])||Fd(e)||hg(e):!1}var Hre=Object.prototype.constructor.toString(),pP=new WeakMap;function QI(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=pP.get(n);return r===void 0&&(r=Function.toString.call(n),pP.set(n,r)),r===Hre}function Ap(e,t,n=!0){fg(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 fg(e){const t=e[Cr];return t?t.type_:Array.isArray(e)?1:Fd(e)?2:hg(e)?3:0}function jv(e,t){return fg(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function JI(e,t,n){const r=fg(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Kre(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Fd(e){return e instanceof Map}function hg(e){return e instanceof Set}function Fs(e){return e.copy_||e.base_}function Nv(e,t){if(Fd(e))return new Map(e);if(hg(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=QI(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Cr];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(nd(e),r)}else{const r=nd(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Q1(e,t=!1){return pg(e)||Vl(e)||!bo(e)||(fg(e)>1&&Object.defineProperties(e,{set:Uf,add:Uf,clear:Uf,delete:Uf}),Object.freeze(e),t&&Object.values(e).forEach(n=>Q1(n,!0))),e}function Gre(){ni(2)}var Uf={value:Gre};function pg(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var qre={};function wo(e){const t=qre[e];return t||ni(0,e),t}var rd;function e3(){return rd}function Yre(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function mP(e,t){t&&(wo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Cv(e){Pv(e),e.drafts_.forEach(Xre),e.drafts_=null}function Pv(e){e===rd&&(rd=e.parent_)}function gP(e){return rd=Yre(rd,e)}function Xre(e){const t=e[Cr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Cr].modified_&&(Cv(t),ni(4)),bo(e)&&(e=Tp(t,e),t.parent_||Op(t,e)),t.patches_&&wo("Patches").generateReplacementPatches_(n[Cr].base_,e,t.patches_,t.inversePatches_)):e=Tp(t,n,[]),Cv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ZI?e:void 0}function Tp(e,t,n){if(pg(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Cr];if(!i)return Ap(t,(a,s)=>xP(e,i,t,a,s,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Op(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),Ap(s,(c,u)=>xP(e,i,a,c,u,n,o),r),Op(e,a,!1),n&&e.patches_&&wo("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function xP(e,t,n,r,i,a,s){if(i==null||typeof i!="object"&&!s)return;const o=pg(i);if(!(o&&!s)){if(Vl(i)){const c=a&&t&&t.type_!==3&&!jv(t.assigned_,r)?a.concat(r):void 0,u=Tp(e,i,c);if(JI(n,r,u),Vl(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;Tp(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Fd(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Op(e,i)}}}function Op(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Q1(t,n)}function Zre(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:e3(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=J1;n&&(i=[r],a=id);const{revoke:s,proxy:o}=Proxy.revocable(i,a);return r.draft_=o,r.revoke_=s,o}var J1={get(e,t){if(t===Cr)return e;const n=Fs(e);if(!jv(n,t))return Qre(e,n,t);const r=n[t];return e.finalized_||!bo(r)?r:r===sy(e.base_,t)?(oy(e),e.copy_[t]=Av(r,e)):r},has(e,t){return t in Fs(e)},ownKeys(e){return Reflect.ownKeys(Fs(e))},set(e,t,n){const r=t3(Fs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=sy(Fs(e),t),a=i==null?void 0:i[Cr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Kre(n,i)&&(n!==void 0||jv(e.base_,t)))return!0;oy(e),Ev(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 sy(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,oy(e),Ev(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(){ni(11)},getPrototypeOf(e){return nd(e.base_)},setPrototypeOf(){ni(12)}},id={};Ap(J1,(e,t)=>{id[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});id.deleteProperty=function(e,t){return id.set.call(this,e,t,void 0)};id.set=function(e,t,n){return J1.set.call(this,e[0],t,n,e[0])};function sy(e,t){const n=e[Cr];return(n?Fs(n):e)[t]}function Qre(e,t,n){var i;const r=t3(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function t3(e,t){if(!(t in e))return;let n=nd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=nd(n)}}function Ev(e){e.modified_||(e.modified_=!0,e.parent_&&Ev(e.parent_))}function oy(e){e.copy_||(e.copy_=Nv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Jre=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"&&ni(6),r!==void 0&&typeof r!="function"&&ni(7);let i;if(bo(t)){const a=gP(this),s=Av(t,void 0);let o=!0;try{i=n(s),o=!1}finally{o?Cv(a):Pv(a)}return mP(a,r),yP(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===ZI&&(i=void 0),this.autoFreeze_&&Q1(i,!0),r){const a=[],s=[];wo("Patches").generateReplacementPatches_(t,i,a,s),r(a,s)}return i}else ni(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)||ni(8),Vl(e)&&(e=eie(e));const t=gP(this),n=Av(e,void 0);return n[Cr].isManual_=!0,Pv(t),n}finishDraft(e,t){const n=e&&e[Cr];(!n||!n.isManual_)&&ni(9);const{scope_:r}=n;return mP(r,t),yP(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 Vl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Av(e,t){const n=Fd(e)?wo("MapSet").proxyMap_(e,t):hg(e)?wo("MapSet").proxySet_(e,t):Zre(e,t);return(t?t.scope_:e3()).drafts_.push(n),n}function eie(e){return Vl(e)||ni(10,e),n3(e)}function n3(e){if(!bo(e)||pg(e))return e;const t=e[Cr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Nv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Nv(e,!0);return Ap(n,(i,a)=>{JI(n,i,n3(a))},r),t&&(t.finalized_=!1),n}var tie=new Jre;tie.produce;var nie={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},r3=Rn({name:"legend",initialState:nie,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:wt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Br(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:wt()},removeLegendPayload:{reducer(e,t){var n=Br(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:wt()}}}),{setLegendSize:vP,setLegendSettings:rie,addLegendPayload:iie,replaceLegendPayload:aie,removeLegendPayload:sie}=r3.actions,oie=r3.reducer,lie={};/**
|
|
705
|
+
* @license React
|
|
706
|
+
* use-sync-external-store-with-selector.production.js
|
|
707
|
+
*
|
|
708
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
709
|
+
*
|
|
710
|
+
* This source code is licensed under the MIT license found in the
|
|
711
|
+
* LICENSE file in the root directory of this source tree.
|
|
712
|
+
*/var zd=m;function cie(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uie=typeof Object.is=="function"?Object.is:cie,die=zd.useSyncExternalStore,fie=zd.useRef,hie=zd.useEffect,pie=zd.useMemo,mie=zd.useDebugValue;lie.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=fie(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=pie(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,uie(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=die(e,a[0],a[1]);return hie(function(){s.hasValue=!0,s.value=o},[o]),mie(o),o};function gie(e){e()}function yie(){let e=null,t=null;return{clear(){e=null,t=null},notify(){gie(()=>{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 bP={notify(){},get:()=>[]};function xie(e,t){let n,r=bP,i=0,a=!1;function s(y){d();const b=r.subscribe(y);let x=!1;return()=>{x||(x=!0,b(),f())}}function o(){r.notify()}function c(){g.onStateChange&&g.onStateChange()}function u(){return a}function d(){i++,n||(n=e.subscribe(c),r=yie())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=bP)}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 vie=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bie=vie(),wie=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Sie=wie(),kie=()=>bie||Sie?m.useLayoutEffect:m.useEffect,jie=kie();function wP(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Nie(e,t){if(wP(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])||!wP(e[n[i]],t[n[i]]))return!1;return!0}var ly=Symbol.for("react-redux-context"),cy=typeof globalThis<"u"?globalThis:{};function Cie(){if(!m.createContext)return{};const e=cy[ly]??(cy[ly]=new Map);let t=e.get(m.createContext);return t||(t=m.createContext(null),e.set(m.createContext,t)),t}var Pie=Cie();function Eie(e){const{children:t,context:n,serverState:r,store:i}=e,a=m.useMemo(()=>{const c=xie(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),s=m.useMemo(()=>i.getState(),[i]);jie(()=>{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||Pie;return m.createElement(o.Provider,{value:a},t)}var Aie=Eie,Tie=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Oie(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function $d(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Tie.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Nie(e[r],t[r]))return!1}else if(!Oie(e[r],t[r]))return!1;return!0}var _ie=["contextPayload"];function Tv(){return Tv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tv.apply(null,arguments)}function SP(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 Wl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SP(Object(n),!0).forEach(function(r){Die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Die(e,t,n){return(t=Mie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mie(e){var t=Iie(e,"string");return typeof t=="symbol"?t:t+""}function Iie(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 Lie(e,t){if(e==null)return{};var n,r,i=Rie(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 Rie(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 Fie(e){return e.value}function zie(e){var{contextPayload:t}=e,n=Lie(e,_ie),r=YM(t,e.payloadUniqBy,Fie),i=Wl(Wl({},n),{},{payload:r});return m.isValidElement(e.content)?m.cloneElement(e.content,i):typeof e.content=="function"?m.createElement(e.content,i):m.createElement(yte,i)}function $ie(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}),Wl(Wl({},u),d)}function Bie(e){var t=Bt();return m.useEffect(()=>{t(rie(e))},[t,e]),null}function Uie(e){var t=Bt();return m.useEffect(()=>(t(vP(e)),()=>{t(vP({width:0,height:0}))}),[t,e]),null}function Vie(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Wie={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Hie(e){var t=lr(e,Wie),n=tne(),r=fee(),i=Vre(),{width:a,height:s,wrapperStyle:o,portal:c}=t,[u,d]=oI([n]),f=Y1(),h=X1();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=Vie(t.layout,s,a,p),y=c?o:Wl(Wl({position:"absolute",width:(g==null?void 0:g.width)||a||"auto",height:(g==null?void 0:g.height)||s||"auto"},$ie(o,t,i,f,h,u)),o),b=c??r;if(b==null||n==null)return null;var x=m.createElement("div",{className:"recharts-legend-wrapper",style:y,ref:d},m.createElement(Bie,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&m.createElement(Uie,{width:u.width,height:u.height}),m.createElement(zie,Tv({},t,g,{margin:i,chartWidth:f,chartHeight:h,contextPayload:n})));return Co.createPortal(x,b)}var mg=m.memo(Hie,$d);mg.displayName="Legend";function Ov(){return Ov=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ov.apply(null,arguments)}function kP(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?kP(Object(n),!0).forEach(function(r){Kie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kie(e,t,n){return(t=Gie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gie(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 Yie(e){return Array.isArray(e)&&Li(e[0])&&Li(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 Xie(e,t){return t==null?e:Zm(e,t)}var Zie=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 S={padding:0,margin:0},j=Xie(a,o),N=j.map((P,T)=>{if(P.type==="none")return null;var E=P.formatter||s||Yie,{value:_,name:C}=P,A=_,I=C;if(E){var $=E(_,C,P,T,a);if(Array.isArray($))[A,I]=$;else if($!=null)A=$;else return null}var oe=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:oe},Li(I)?m.createElement("span",{className:"recharts-tooltip-item-name"},I):null,Li(I)?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:S},N)}return null},g=Ic(Ic({},Fo.contentStyle),n),y=Ic({margin:0},i),b=!kn(d),x=b?d:"",v=ot("recharts-default-tooltip",c),w=ot("recharts-tooltip-label",u);b&&f&&a!==void 0&&a!==null&&(x=f(d,a));var k=h?{role:"status","aria-live":"assertive"}:{};return m.createElement("div",Ov({className:v,style:g},k),m.createElement("p",{className:w,style:y},m.isValidElement(x)?x:"".concat(x)),p())},Lc="recharts-tooltip-wrapper",Qie={visibility:"hidden"};function Jie(e){var{coordinate:t,translateX:n,translateY:r}=e;return ot(Lc,{["".concat(Lc,"-right")]:Ae(n)&&t&&Ae(t.x)&&n>=t.x,["".concat(Lc,"-left")]:Ae(n)&&t&&Ae(t.x)&&n<t.x,["".concat(Lc,"-bottom")]:Ae(r)&&t&&Ae(t.y)&&r>=t.y,["".concat(Lc,"-top")]:Ae(r)&&t&&Ae(t.y)&&r<t.y})}function jP(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:s,tooltipDimension:o,viewBox:c,viewBoxDimension:u}=e;if(a&&Ae(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,b=h+u;return y>b?Math.max(d,h):Math.max(f,h)}function eae(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 tae(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=jP({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:s,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),h=jP({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:s,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=eae({translateX:f,translateY:h,useTranslate3d:c})):d=Qie,{cssProperties:d,cssClasses:Jie({translateX:f,translateY:h,coordinate:n})}}var nae=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Bd={isSsr:nae()};function i3(){var[e,t]=m.useState(()=>Bd.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 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 zo(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){rae(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 rae(e,t,n){return(t=iae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iae(e){var t=aae(e,"string");return typeof t=="symbol"?t:t+""}function aae(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 sae(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function oae(e){var t,n,r,i,a,s,o=i3(),[c,u]=m.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));m.useEffect(()=>{var g=y=>{if(y.key==="Escape"){var b,x,v,w;u({dismissed:!0,dismissedAtCoordinate:{x:(b=(x=e.coordinate)===null||x===void 0?void 0:x.x)!==null&&b!==void 0?b:0,y:(v=(w=e.coordinate)===null||w===void 0?void 0:w.y)!==null&&v!==void 0?v: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}=tae({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:sae({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 lae=m.memo(oae),a3=()=>{var e;return(e=De(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function _v(){return _v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_v.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 PP(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){cae(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 cae(e,t,n){return(t=uae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uae(e){var t=dae(e,"string");return typeof t=="symbol"?t:t+""}function dae(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 EP={curveBasisClosed:Oee,curveBasisOpen:_ee,curveBasis:Tee,curveBumpX:gee,curveBumpY:yee,curveLinearClosed:Dee,curveLinear:Vm,curveMonotoneX:Mee,curveMonotoneY:Iee,curveNatural:Lee,curveStep:Ree,curveStepAfter:zee,curveStepBefore:Fee},_p=e=>qe(e.x)&&qe(e.y),AP=e=>e.base!=null&&_p(e.base)&&_p(e),Rc=e=>e.x,Fc=e=>e.y,fae=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Dd(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=EP["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return EP[n]||Vm},TP={connectNulls:!1,type:"linear"},hae=e=>{var{type:t=TP.type,points:n=[],baseLine:r,layout:i,connectNulls:a=TP.connectNulls}=e,s=fae(t,i),o=a?n.filter(_p):n;if(Array.isArray(r)){var c,u=n.map((g,y)=>PP(PP({},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(AP).curve(s),f=a?u.filter(AP):u;return d(f)}var h;i==="vertical"&&Ae(r)?h=If().y(Fc).x1(Rc).x0(r):Ae(r)?h=If().x(Rc).y1(Fc).y0(r):h=dM().x(Rc).y(Fc);var p=h.defined(_p).curve(s);return p(o)},Sh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=ac();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?hae(s):r;return m.createElement("path",_v({},di(e),P1(e),{className:ot("recharts-curve",t),d:o===null?void 0:o,ref:i}))},pae=["x","y","top","left","width","height","className"];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 OP(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 mae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OP(Object(n),!0).forEach(function(r){gae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gae(e,t,n){return(t=yae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yae(e){var t=xae(e,"string");return typeof t=="symbol"?t:t+""}function xae(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 vae(e,t){if(e==null)return{};var n,r,i=bae(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 bae(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 wae=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Sae=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:s=0,className:o}=e,c=vae(e,pae),u=mae({x:t,y:n,top:r,left:i,width:a,height:s},c);return!Ae(t)||!Ae(n)||!Ae(a)||!Ae(s)||!Ae(r)||!Ae(i)?null:m.createElement("path",Dv({},jr(u),{className:ot("recharts-cross",o),d:wae(t,n,a,s,r,i)}))};function kae(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 _P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_P(Object(n),!0).forEach(function(r){jae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_P(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jae(e,t,n){return(t=Nae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nae(e){var t=Cae(e,"string");return typeof t=="symbol"?t:t+""}function Cae(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 Pae=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Eae=(e,t,n)=>e.map(r=>"".concat(Pae(r)," ").concat(t,"ms ").concat(n)).join(","),Aae=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),ad=(e,t)=>Object.keys(t).reduce((n,r)=>DP(DP({},n),{},{[r]:e(r,t[r])}),{});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 en(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){Tae(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 Tae(e,t,n){return(t=Oae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oae(e){var t=_ae(e,"string");return typeof t=="symbol"?t:t+""}function _ae(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 Dp=(e,t,n)=>e+(t-e)*n,Mv=e=>{var{from:t,to:n}=e;return t!==n},s3=(e,t,n)=>{var r=ad((i,a)=>{if(Mv(a)){var[s,o]=e(a.from,a.to,a.velocity);return en(en({},a),{},{from:s,velocity:o})}return a},t);return n<1?ad((i,a)=>Mv(a)&&r[i]!=null?en(en({},a),{},{velocity:Dp(a.velocity,r[i].velocity,n),from:Dp(a.from,r[i].from,n)}):a,t):s3(e,r,n-1)};function Dae(e,t,n,r,i,a){var s,o=r.reduce((h,p)=>en(en({},h),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),c=()=>ad((h,p)=>p.from,o),u=()=>!Object.values(o).filter(Mv).length,d=null,f=h=>{s||(s=h);var p=h-s,g=p/n.dt;o=s3(n,o,g),i(en(en(en({},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 Mae(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:en(en({},f),{},{[h]:[p,g]})},{}),u,d=f=>{u||(u=f);var h=(f-u)/r,p=ad((y,b)=>Dp(...b,n(h)),c);if(a(en(en(en({},e),t),p)),h<1)o=s.setTimeout(d);else{var g=ad((y,b)=>Dp(...b,n(1)),c);a(en(en(en({},e),t),g))}};return()=>(o=s.setTimeout(d),()=>{var f;(f=o)===null||f===void 0||f()})}const Iae=(e,t,n,r,i,a)=>{var s=Aae(e,t);return n==null?()=>(i(en(en({},e),t)),()=>{}):n.isStepper===!0?Dae(e,t,n,s,i,a):Mae(e,t,n,r,s,i,a)};var Mp=1e-4,o3=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],l3=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),IP=(e,t)=>n=>{var r=o3(e,t);return l3(r,n)},Lae=(e,t)=>n=>{var r=o3(e,t),i=[...r.map((a,s)=>a*s).slice(1),0];return l3(i,n)},Rae=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]]},Fae=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=Rae(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},zae=(e,t,n,r)=>{var i=IP(e,n),a=IP(t,r),s=Lae(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)<Mp||g<Mp)return a(f);f=o(f-p/g)}return a(f)};return c.isStepper=!1,c},LP=function(){return zae(...Fae(...arguments))},$ae=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)<Mp&&Math.abs(f)<Mp?[o,0]:[h,f]};return a.isStepper=!0,a.dt=i,a},Bae=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return LP(e);case"spring":return $ae();default:if(e.split("(")[0]==="cubic-bezier")return LP(e)}return typeof e=="function"?e:null};function Uae(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 Vae{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 Wae(){return Uae(new Vae)}var Hae=m.createContext(Wae);function Kae(e,t){var n=m.useContext(Hae);return m.useMemo(()=>t??n(e),[e,t,n])}var Gae={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},RP={t:0},uy={t:1};function c3(e){var t=lr(e,Gae),{isActive:n,canBegin:r,duration:i,easing:a,begin:s,onAnimationEnd:o,onAnimationStart:c,children:u}=t,d=i3(),f=n==="auto"?!Bd.isSsr&&!d:n,h=Kae(t.animationId,t.animationManager),[p,g]=m.useState(f?RP:uy),y=m.useRef(null);return m.useEffect(()=>{f||g(uy)},[f]),m.useEffect(()=>{if(!f||!r)return Ao;var b=Iae(RP,uy,Bae(a),i,g,h.getTimeoutController()),x=()=>{y.current=b()};return h.start([c,s,x,i,o]),()=>{h.stop(),y.current&&y.current(),o()}},[f,r,i,a,s,c,o,h]),u(p.t)}function u3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=m.useRef(Qu(t)),r=m.useRef(e);return r.current!==e&&(n.current=Qu(t),r.current=e),n.current}var qae=["radius"],Yae=["radius"],FP,zP,$P,BP,UP,VP,WP,HP,KP,GP;function qP(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 YP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qP(Object(n),!0).forEach(function(r){Xae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xae(e,t,n){return(t=Zae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zae(e){var t=Qae(e,"string");return typeof t=="symbol"?t:t+""}function Qae(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 Ip(){return Ip=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},Ip.apply(null,arguments)}function XP(e,t){if(e==null)return{};var n,r,i=Jae(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 Jae(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 ZP=(e,t,n,r,i)=>{var a=qa(n),s=qa(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,b=(y=i[p])!==null&&y!==void 0?y:0;h[p]=b>o?o:b}f=yn(FP||(FP=yi(["M",",",""])),e,t+c*h[0]),h[0]>0&&(f+=yn(zP||(zP=yi(["A ",",",",0,0,",",",",",""])),h[0],h[0],d,e+u*h[0],t)),f+=yn($P||($P=yi(["L ",",",""])),e+n-u*h[1],t),h[1]>0&&(f+=yn(BP||(BP=yi(["A ",",",",0,0,",`,
|
|
713
|
+
`,",",""])),h[1],h[1],d,e+n,t+c*h[1])),f+=yn(UP||(UP=yi(["L ",",",""])),e+n,t+r-c*h[2]),h[2]>0&&(f+=yn(VP||(VP=yi(["A ",",",",0,0,",`,
|
|
714
|
+
`,",",""])),h[2],h[2],d,e+n-u*h[2],t+r)),f+=yn(WP||(WP=yi(["L ",",",""])),e+u*h[3],t+r),h[3]>0&&(f+=yn(HP||(HP=yi(["A ",",",",0,0,",`,
|
|
715
|
+
`,",",""])),h[3],h[3],d,e,t+r-c*h[3])),f+="Z"}else if(o>0&&i===+i&&i>0){var x=Math.min(o,i);f=yn(KP||(KP=yi(["M ",",",`
|
|
716
|
+
A `,",",",0,0,",",",",",`
|
|
717
|
+
L `,",",`
|
|
718
|
+
A `,",",",0,0,",",",",",`
|
|
719
|
+
L `,",",`
|
|
720
|
+
A `,",",",0,0,",",",",",`
|
|
721
|
+
L `,",",`
|
|
722
|
+
A `,",",",0,0,",",",","," Z"])),e,t+c*x,x,x,d,e+u*x,t,e+n-u*x,t,x,x,d,e+n,t+c*x,e+n,t+r-c*x,x,x,d,e+n-u*x,t+r,e+u*x,t+r,x,x,d,e,t+r-c*x)}else f=yn(GP||(GP=yi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return f},QP={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ese=e=>{var t=lr(e,QP),n=m.useRef(null),[r,i]=m.useState(-1);m.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var Z=n.current.getTotalLength();Z&&i(Z)}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,b=m.useRef(o),x=m.useRef(c),v=m.useRef(a),w=m.useRef(s),k=m.useMemo(()=>({x:a,y:s,width:o,height:c,radius:u}),[a,s,o,c,u]),S=u3(k,"rectangle-");if(a!==+a||s!==+s||o!==+o||c!==+c||o===0||c===0)return null;var j=ot("recharts-rectangle",d);if(!y){var N=jr(t),{radius:P}=N,T=XP(N,qae);return m.createElement("path",Ip({},T,{x:qa(a),y:qa(s),width:qa(o),height:qa(c),radius:typeof u=="number"?u:void 0,className:j,d:ZP(a,s,o,c,u)}))}var E=b.current,_=x.current,C=v.current,A=w.current,I="0px ".concat(r===-1?1:r,"px"),$="".concat(r,"px ").concat(r,"px"),oe=Eae(["strokeDasharray"],h,typeof f=="string"?f:QP.animationEasing);return m.createElement(c3,{animationId:S,key:S,canBegin:r>0,duration:h,easing:f,isActive:y,begin:p},Z=>{var M=ki(E,o,Z),K=ki(_,c,Z),O=ki(C,a,Z),ie=ki(A,s,Z);n.current&&(b.current=M,x.current=K,v.current=O,w.current=ie);var J;g?Z>0?J={transition:oe,strokeDasharray:$}:J={strokeDasharray:I}:J={strokeDasharray:$};var D=jr(t),{radius:H}=D,ee=XP(D,Yae);return m.createElement("path",Ip({},ee,{radius:typeof u=="number"?u:void 0,className:j,d:ZP(O,ie,M,K,u),ref:n,style:YP(YP({},J),t.style)}))})};function JP(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 eE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JP(Object(n),!0).forEach(function(r){tse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tse(e,t,n){return(t=nse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nse(e){var t=rse(e,"string");return typeof t=="symbol"?t:t+""}function rse(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 Lp=Math.PI/180,ise=e=>e*180/Math.PI,vn=(e,t,n,r)=>({x:e+Math.cos(-Lp*r)*n,y:t+Math.sin(-Lp*r)*n}),ase=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},sse=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},ose=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,s=sse({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:ise(c),angleInRadian:c}},lse=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}},cse=(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},use=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=ose({x:n,y:r},t),{innerRadius:s,outerRadius:o}=t;if(i<s||i>o||i===0)return null;var{startAngle:c,endAngle:u}=lse(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?eE(eE({},t),{},{radius:i,angle:cse(d,t)}):null};function d3(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,s=vn(t,n,r,i),o=vn(t,n,r,a);return{points:[s,o],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var tE,nE,rE,iE,aE,sE,oE;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 Ys(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var dse=(e,t)=>{var n=$r(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)/Lp,f=c?i:i+a*d,h=vn(t,n,u,f),p=vn(t,n,r,f),g=c?i-a*d:i,y=vn(t,n,u*Math.cos(d*Lp),g);return{center:h,circleTangency:p,lineTangency:y,theta:d}},f3=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:s}=e,o=dse(a,s),c=a+o,u=vn(t,n,i,a),d=vn(t,n,i,c),f=yn(tE||(tE=Ys(["M ",",",`
|
|
723
|
+
A `,",",`,0,
|
|
724
|
+
`,",",`,
|
|
725
|
+
`,",",`
|
|
726
|
+
`])),u.x,u.y,i,i,+(Math.abs(o)>180),+(a>c),d.x,d.y);if(r>0){var h=vn(t,n,r,a),p=vn(t,n,r,c);f+=yn(nE||(nE=Ys(["L ",",",`
|
|
727
|
+
A `,",",`,0,
|
|
728
|
+
`,",",`,
|
|
729
|
+
`,","," Z"])),p.x,p.y,r,r,+(Math.abs(o)>180),+(a<=c),h.x,h.y)}else f+=yn(rE||(rE=Ys(["L ",","," Z"])),t,n);return f},fse=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:s,cornerIsExternal:o,startAngle:c,endAngle:u}=e,d=$r(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:b}=Vf({cx:t,cy:n,radius:i,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:o}),x=o?Math.abs(c-u):Math.abs(c-u)-p-b;if(x<0)return s?yn(iE||(iE=Ys(["M ",",",`
|
|
730
|
+
a`,",",",0,0,1,",`,0
|
|
731
|
+
a`,",",",0,0,1,",`,0
|
|
732
|
+
`])),h.x,h.y,a,a,a*2,a,a,-a*2):f3({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var v=yn(aE||(aE=Ys(["M ",",",`
|
|
733
|
+
A`,",",",0,0,",",",",",`
|
|
734
|
+
A`,",",",0,",",",",",",",`
|
|
735
|
+
A`,",",",0,0,",",",",",`
|
|
736
|
+
`])),h.x,h.y,a,a,+(d<0),f.x,f.y,i,i,+(x>180),+(d<0),g.x,g.y,a,a,+(d<0),y.x,y.y);if(r>0){var{circleTangency:w,lineTangency:k,theta:S}=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)-S-P;if(T<0&&a===0)return"".concat(v,"L").concat(t,",").concat(n,"Z");v+=yn(sE||(sE=Ys(["L",",",`
|
|
737
|
+
A`,",",",0,0,",",",",",`
|
|
738
|
+
A`,",",",0,",",",",",",",`
|
|
739
|
+
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),k.x,k.y)}else v+=yn(oE||(oE=Ys(["L",",","Z"])),t,n);return v},hse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pse=e=>{var t=lr(e,hse),{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=ot("recharts-sector",f),p=a-i,g=fs(s,p,0,!0),y;return g>0&&Math.abs(u-d)<360?y=fse({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,p/2),forceCornerRadius:o,cornerIsExternal:c,startAngle:u,endAngle:d}):y=f3({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d}),m.createElement("path",Iv({},jr(t),{className:h,d:y}))};function mse(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(EM(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:s,angle:o}=t,c=vn(r,i,a,o),u=vn(r,i,s,o);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return d3(t)}}var h3={},p3={},m3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F1;function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(m3);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=m3;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})(p3);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=z1,n=p3;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})(h3);var gse=h3.range;const g3=hi(gse);var ka=e=>e.chartData,y3=q([ka],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),x3=(e,t,n,r)=>r?y3(e):ka(e),yse=(e,t,n)=>n?y3(e):ka(e);function _i(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(qe(t)&&qe(n))return!0}return!1}function lE(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function v3(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(qe(n))i=n;else if(typeof n=="function")return;if(qe(r))a=r;else if(typeof r=="function")return;var s=[i,a];if(_i(s))return s}}function xse(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(_i(r))return lE(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(Ae(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"&&oP.test(i)){var c=oP.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(Ae(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"&&lP.test(a)){var d=lP.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(_i(h))return t==null?h:lE(h,t,n)}}}var sc=1e9,vse={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},tS,At=!0,Kr="[DecimalError] ",io=Kr+"Invalid argument: ",eS=Kr+"Exponent out of range: ",oc=Math.floor,zs=Math.pow,bse=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pr,sn=1e7,St=7,b3=9007199254740991,Rp=oc(b3/St),Ce={};Ce.absoluteValue=Ce.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ce.comparedTo=Ce.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};Ce.decimalPlaces=Ce.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*St;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ce.dividedBy=Ce.div=function(e){return ia(this,new this.constructor(e))};Ce.dividedToIntegerBy=Ce.idiv=function(e){var t=this,n=t.constructor;return dt(ia(t,new n(e),0,1),n.precision)};Ce.equals=Ce.eq=function(e){return!this.cmp(e)};Ce.exponent=function(){return Yt(this)};Ce.greaterThan=Ce.gt=function(e){return this.cmp(e)>0};Ce.greaterThanOrEqualTo=Ce.gte=function(e){return this.cmp(e)>=0};Ce.isInteger=Ce.isint=function(){return this.e>this.d.length-2};Ce.isNegative=Ce.isneg=function(){return this.s<0};Ce.isPositive=Ce.ispos=function(){return this.s>0};Ce.isZero=function(){return this.s===0};Ce.lessThan=Ce.lt=function(e){return this.cmp(e)<0};Ce.lessThanOrEqualTo=Ce.lte=function(e){return this.cmp(e)<1};Ce.logarithm=Ce.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(pr))throw Error(Kr+"NaN");if(n.s<1)throw Error(Kr+(n.s?"NaN":"-Infinity"));return n.eq(pr)?new r(0):(At=!1,t=ia(sd(n,a),sd(e,a),a),At=!0,dt(t,i))};Ce.minus=Ce.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?k3(t,e):w3(t,(e.s=-e.s,e))};Ce.modulo=Ce.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Kr+"NaN");return n.s?(At=!1,t=ia(n,e,0,1).times(e),At=!0,n.minus(t)):dt(new r(n),i)};Ce.naturalExponential=Ce.exp=function(){return S3(this)};Ce.naturalLogarithm=Ce.ln=function(){return sd(this)};Ce.negated=Ce.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ce.plus=Ce.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?w3(t,e):k3(t,(e.s=-e.s,e))};Ce.precision=Ce.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=Yt(i)+1,r=i.d.length-1,n=r*St+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};Ce.squareRoot=Ce.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(Kr+"NaN")}for(e=Yt(o),At=!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=oc((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(dt(a,n+1,0),a.times(a).eq(o)){r=a;break}}else if(t!="9999")break;s+=4}return At=!0,dt(r,n)};Ce.times=Ce.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%sn|0,t=o/sn|0;a[i]=(a[i]+t)%sn|0}for(;!a[--s];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,At?dt(e,f.precision):e};Ce.toDecimalPlaces=Ce.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Fi(e,0,sc),t===void 0?t=r.rounding:Fi(t,0,8),dt(n,e+Yt(n)+1,t))};Ce.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=So(r,!0):(Fi(e,0,sc),t===void 0?t=i.rounding:Fi(t,0,8),r=dt(new i(r),e+1,t),n=So(r,!0,e+1)),n};Ce.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?So(i):(Fi(e,0,sc),t===void 0?t=a.rounding:Fi(t,0,8),r=dt(new a(i),e+Yt(i)+1,t),n=So(r.abs(),!1,e+Yt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ce.toInteger=Ce.toint=function(){var e=this,t=e.constructor;return dt(new t(e),Yt(e)+1,t.rounding)};Ce.toNumber=function(){return+this};Ce.toPower=Ce.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(pr);if(o=new c(o),!o.s){if(e.s<1)throw Error(Kr+"Infinity");return o}if(o.eq(pr))return o;if(r=c.precision,e.eq(pr))return dt(o,r);if(t=e.e,n=e.d.length-1,s=t>=n,a=o.s,s){if((n=d<0?-d:d)<=b3){for(i=new c(pr),t=Math.ceil(r/St+4),At=!1;n%2&&(i=i.times(o),uE(i.d,t)),n=oc(n/2),n!==0;)o=o.times(o),uE(o.d,t);return At=!0,e.s<0?new c(pr).div(i):dt(i,r)}}else if(a<0)throw Error(Kr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,o.s=1,At=!1,i=e.times(sd(o,r+u)),At=!0,i=S3(i),i.s=a,i};Ce.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Yt(i),r=So(i,n<=a.toExpNeg||n>=a.toExpPos)):(Fi(e,1,sc),t===void 0?t=a.rounding:Fi(t,0,8),i=dt(new a(i),e,t),n=Yt(i),r=So(i,e<=n||n<=a.toExpNeg,e)),r};Ce.toSignificantDigits=Ce.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Fi(e,1,sc),t===void 0?t=r.rounding:Fi(t,0,8)),dt(new r(n),e,t)};Ce.toString=Ce.valueOf=Ce.val=Ce.toJSON=Ce[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Yt(e),n=e.constructor;return So(e,t<=n.toExpNeg||t>=n.toExpPos)};function w3(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)),At?dt(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/St),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)/sn|0,c[a]%=sn;for(n&&(c.unshift(n),++i),o=c.length;c[--o]==0;)c.pop();return t.d=c,t.e=i,At?dt(t,f):t}function Fi(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=St-r.length,n&&(a+=za(n)),a+=r;s=e[t],r=s+"",n=St-r.length,n&&(a+=za(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%sn|0,s=a/sn|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*sn+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,b,x,v,w,k,S,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(Kr+"Division by zero");for(c=r.e-i.e,N=C.length,S=_.length,p=new T(E),g=p.d=[],u=0;C[u]==(_[u]||0);)++u;if(C[u]>(_[u]||0)&&--c,a==null?v=a=T.precision:s?v=a+(Yt(r)-Yt(i))+1:v=a,v<0)return new T(0);if(v=v/St+2|0,u=0,N==1)for(d=0,C=C[0],v++;(u<S||d)&&v--;u++)w=d*sn+(_[u]||0),g[u]=w/C|0,d=w%C|0;else{for(d=sn/(C[0]+1)|0,d>1&&(C=e(C,d),_=e(_,d),N=C.length,S=_.length),k=N,y=_.slice(0,N),b=y.length;b<N;)y[b++]=0;P=C.slice(),P.unshift(0),j=C[0],C[1]>=sn/2&&++j;do d=0,o=t(C,y,N,b),o<0?(x=y[0],N!=b&&(x=x*sn+(y[1]||0)),d=x/j|0,d>1?(d>=sn&&(d=sn-1),f=e(C,d),h=f.length,b=y.length,o=t(f,y,h,b),o==1&&(d--,n(f,N<h?P:C,h))):(d==0&&(o=d=1),f=C.slice()),h=f.length,h<b&&f.unshift(0),n(y,f,b),o==-1&&(b=y.length,o=t(C,y,N,b),o<1&&(d++,n(y,N<b?P:C,b))),b=y.length):o===0&&(d++,y=[0]),g[u++]=d,o&&y[0]?y[b++]=_[k]||0:(y=[_[k]],b=1);while((k++<S||y[0]!==void 0)&&v--)}return g[0]||g.shift(),p.e=c,dt(p,s?a+Yt(p)+1:a)}}();function S3(e,t){var n,r,i,a,s,o,c=0,u=0,d=e.constructor,f=d.precision;if(Yt(e)>16)throw Error(eS+Yt(e));if(!e.s)return new d(pr);for(At=!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(pr),d.precision=o;;){if(i=dt(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=dt(a.times(a),o);return d.precision=f,t==null?(At=!0,dt(a,f)):a}a=s}}function Yt(e){for(var t=e.e*St,n=e.d[0];n>=10;n/=10)t++;return t}function dy(e,t,n){if(t>e.LN10.sd())throw At=!0,n&&(e.precision=n),Error(Kr+"LN10 precision limit exceeded");return dt(new e(e.LN10),t)}function za(e){for(var t="";e--;)t+="0";return t}function sd(e,t){var n,r,i,a,s,o,c,u,d,f=1,h=10,p=e,g=p.d,y=p.constructor,b=y.precision;if(p.s<1)throw Error(Kr+(p.s?"NaN":"-Infinity"));if(p.eq(pr))return new y(0);if(t==null?(At=!1,u=b):u=t,p.eq(10))return t==null&&(At=!0),dy(y,u);if(u+=h,y.precision=u,n=Ci(g),r=n.charAt(0),a=Yt(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=Yt(p),r>1?(p=new y("0."+n),a++):p=new y(r+"."+n.slice(1))}else return c=dy(y,u+2,b).times(a+""),p=sd(new y(r+"."+n.slice(1)),u-h).plus(c),y.precision=b,t==null?(At=!0,dt(p,b)):p;for(o=s=p=ia(p.minus(pr),p.plus(pr),u),d=dt(p.times(p),u),i=3;;){if(s=dt(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(dy(y,u+2,b).times(a+""))),o=ia(o,new y(f),u),y.precision=b,t==null?(At=!0,dt(o,b)):o;o=c,i+=2}}function cE(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=oc(n/St),e.d=[],r=(n+1)%St,n<0&&(r+=St),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=St;r<i;)e.d.push(+t.slice(r,r+=St));t=t.slice(r),r=St-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),At&&(e.e>Rp||e.e<-Rp))throw Error(eS+n)}else e.s=0,e.e=0,e.d=[0];return e}function dt(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+=St,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/St),a=f.length,d>=a)return e;for(u=a=f[d],s=1;a>=10;a/=10)s++;r%=St,i=r-St+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=Yt(e),f.length=1,t=t-a-1,f[0]=zs(10,(St-t%St)%St),e.e=oc(-t/St)||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,St-r),f[d]=i>0?(u/zs(10,s-i)%zs(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==sn&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=sn)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(At&&(e.e>Rp||e.e<-Rp))throw Error(eS+Yt(e));return e}function k3(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),At?dt(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/St),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]=sn-1;--c[a],c[i]+=sn}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,At?dt(t,p):t):new h(0)}function So(e,t,n){var r,i=Yt(e),a=Ci(e.d),s=a.length;return t?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+za(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+za(-i-1)+a,n&&(r=n-s)>0&&(a+=za(r))):i>=s?(a+=za(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+za(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=za(r))),e.s<0?"-"+a:a}function uE(e,t){if(e.length>t)return e.length=t,!0}function j3(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 cE(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,bse.test(a))cE(s,a);else throw Error(io+a)}if(i.prototype=Ce,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=j3,i.config=i.set=wse,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 wse(e){if(!e||typeof e!="object")throw Error(Kr+"Object expected");var t,n,r,i=["precision",1,sc,"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(oc(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 tS=j3(vse);pr=new tS(1);const Ye=tS;function N3(e){var t;return e===0?t=1:t=Math.floor(new Ye(e).abs().log(10).toNumber())+1,t}function C3(e,t,n){for(var r=new Ye(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var P3=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},nS=(e,t,n)=>{if(e.lte(0))return new Ye(0);var r=N3(e.toNumber()),i=new Ye(10).pow(r),a=e.div(i),s=r!==1?.05:.1,o=new Ye(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=o.mul(i);return t?new Ye(c.toNumber()):new Ye(Math.ceil(c.toNumber()))},E3=(e,t,n)=>{var r;if(e.lte(0))return new Ye(0);var i=[1,2,2.5,5],a=e.toNumber(),s=Math.floor(new Ye(a).abs().log(10).toNumber()),o=new Ye(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 Ye(10).pow(d))}var f=(r=i[u])!==null&&r!==void 0?r:1,h=new Ye(f).mul(o);return t?h:new Ye(Math.ceil(h.toNumber()))},Sse=(e,t,n)=>{var r=new Ye(1),i=new Ye(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Ye(10).pow(N3(e)-1),i=new Ye(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Ye(Math.floor(e)))}else e===0?i=new Ye(Math.floor((t-1)/2)):n||(i=new Ye(Math.floor(e)));for(var s=Math.floor((t-1)/2),o=[],c=0;c<t;c++)o.push(i.add(new Ye(c-s).mul(r)).toNumber());return o},A3=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]:nS;if(!Number.isFinite((n-t)/(r-1)))return{step:new Ye(0),tickMin:new Ye(0),tickMax:new Ye(0)};var o=s(new Ye(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new Ye(0):(c=new Ye(t).add(n).div(2),c=c.sub(new Ye(c).mod(o)));var u=Math.ceil(c.sub(t).div(o).toNumber()),d=Math.ceil(new Ye(n).sub(c).div(o).toNumber()),f=u+d+1;return f>r?A3(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 Ye(u).mul(o)),tickMax:c.add(new Ye(d).mul(o))})},dE=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]=P3([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 Sse(c,i,a);var f=s==="snap125"?E3:nS,{step:h,tickMin:p,tickMax:g}=A3(c,u,o,a,0,f),y=C3(p,g.add(new Ye(.1).mul(h)),h);return n>r?y.reverse():y},fE=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]=P3([r,i]);if(o===-1/0||c===1/0)return[r,i];if(o===c)return[o];var u=s==="snap125"?E3:nS,d=Math.max(n,2),f=u(new Ye(c).sub(o).div(d-1),a,0),h=[...C3(new Ye(o),new Ye(c),f),c];return a===!1&&(h=h.map(p=>Math.round(p))),r>i?h.reverse():h},kse=e=>e.rootProps.barCategoryGap,gg=e=>e.rootProps.stackOffset,T3=e=>e.rootProps.reverseStackOrder,rS=e=>e.options.chartName,iS=e=>e.rootProps.syncId,O3=e=>e.rootProps.syncMethod,aS=e=>e.options.eventEmitter,jse=e=>e.rootProps.baseValue,Bn={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"},yg=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function xg(e,t,n){if(n!=="auto")return n;if(e!=null)return Ui(e,t)?"category":"number"}function hE(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 Fp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hE(Object(n),!0).forEach(function(r){Nse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nse(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=Pse(e,"string");return typeof t=="symbol"?t:t+""}function Pse(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 pE={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"},mE={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"},Ese=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},sS=q([Ese,XI],(e,t)=>{var n;if(e!=null)return e;var r=(n=xg(t,"angleAxis",pE.type))!==null&&n!==void 0?n:"category";return Fp(Fp({},pE),{},{type:r})}),Ase=(e,t)=>e.polarAxis.radiusAxis[t],oS=q([Ase,XI],(e,t)=>{var n;if(e!=null)return e;var r=(n=xg(t,"radiusAxis",mE.type))!==null&&n!==void 0?n:"category";return Fp(Fp({},mE),{},{type:r})}),vg=e=>e.polarOptions,lS=q([wa,Sa,jn],ase),_3=q([vg,lS],(e,t)=>{if(e!=null)return fs(e.innerRadius,t,0)}),D3=q([vg,lS],(e,t)=>{if(e!=null)return fs(e.outerRadius,t,t*.8)}),Tse=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},M3=q([vg],Tse);q([sS,M3],yg);var I3=q([lS,_3,D3],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});q([oS,I3],yg);var L3=q([Tt,vg,_3,D3,wa,Sa],(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:fs(s,i,i/2),cy:fs(o,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),un=(e,t)=>t,bg=(e,t,n)=>n;function cS(e){return e==null?void 0:e.id}function R3(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=cS(o);u.forEach((f,h)=>{var p=a==null||i?h:String(wn(f,a,null)),g=wn(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 uS(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var wg=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Sg(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Ose(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 dn=e=>{var t=Tt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},lc=e=>e.tooltip.settings.axisId;function dS(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 _se=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!_i(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];qe(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 rs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Dse(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function fS(e){let t,n,r;e.length!==2?(t=rs,n=(o,c)=>rs(e(o),c),r=(o,c)=>e(o)-c):(t=e===rs||e===Dse?e:Mse,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 Mse(){return 0}function F3(e){return e===null?NaN:+e}function*Ise(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Lse=fS(rs),Ud=Lse.right;fS(F3).center;class gE 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(yE(this,t))}has(t){return super.has(yE(this,t))}set(t,n){return super.set(Rse(this,t),n)}delete(t){return super.delete(Fse(this,t))}}function yE({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Rse({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Fse({_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 $se(e=rs){if(e===rs)return z3;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 z3(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Bse=Math.sqrt(50),Use=Math.sqrt(10),Vse=Math.sqrt(2);function zp(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>=Bse?10:a>=Use?5:a>=Vse?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?zp(e,t,n*2):[o,c,u]}function Lv(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?zp(t,e,n):zp(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 Rv(e,t,n){return t=+t,e=+e,n=+n,zp(e,t,n)[2]}function Fv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Rv(t,e,n):Rv(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function xE(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function vE(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function $3(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?z3:$se(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));$3(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 Wse(e,t,n){if(e=Float64Array.from(Ise(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return vE(e);if(t>=1)return xE(e);var r,i=(r-1)*t,a=Math.floor(i),s=xE($3(e,a).subarray(0,a+1)),o=vE(e.subarray(a+1));return s+(o-s)*(i-a)}}function Hse(e,t,n=F3){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 Kse(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 Gr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ja(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 zv=Symbol("implicit");function hS(){var e=new gE,t=[],n=[],r=zv;function i(a){let s=e.get(a);if(s===void 0){if(r!==zv)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 gE;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 hS(t,n).unknown(r)},Gr.apply(i,arguments),i}function pS(){var e=hS().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 b=Kse(h).map(function(x){return g+a*x});return n(p?b.reverse():b)}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 pS(t(),[r,i]).round(o).paddingInner(c).paddingOuter(u).align(d)},Gr.apply(f(),arguments)}function B3(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return B3(t())},e}function Gse(){return B3(pS.apply(null,arguments).paddingInner(1))}function mS(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function U3(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Vd(){}var od=.7,$p=1/od,kl="\\s*([+-]?\\d+)\\s*",ld="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Di="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qse=/^#([0-9a-f]{3,8})$/,Yse=new RegExp(`^rgb\\(${kl},${kl},${kl}\\)$`),Xse=new RegExp(`^rgb\\(${Di},${Di},${Di}\\)$`),Zse=new RegExp(`^rgba\\(${kl},${kl},${kl},${ld}\\)$`),Qse=new RegExp(`^rgba\\(${Di},${Di},${Di},${ld}\\)$`),Jse=new RegExp(`^hsl\\(${ld},${Di},${Di}\\)$`),eoe=new RegExp(`^hsla\\(${ld},${Di},${Di},${ld}\\)$`),bE={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};mS(Vd,cd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wE,formatHex:wE,formatHex8:toe,formatHsl:noe,formatRgb:SE,toString:SE});function wE(){return this.rgb().formatHex()}function toe(){return this.rgb().formatHex8()}function noe(){return V3(this).formatHsl()}function SE(){return this.rgb().formatRgb()}function cd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=qse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kE(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=Yse.exec(e))?new nr(t[1],t[2],t[3],1):(t=Xse.exec(e))?new nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Zse.exec(e))?Wf(t[1],t[2],t[3],t[4]):(t=Qse.exec(e))?Wf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Jse.exec(e))?CE(t[1],t[2]/100,t[3]/100,1):(t=eoe.exec(e))?CE(t[1],t[2]/100,t[3]/100,t[4]):bE.hasOwnProperty(e)?kE(bE[e]):e==="transparent"?new nr(NaN,NaN,NaN,0):null}function kE(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 roe(e){return e instanceof Vd||(e=cd(e)),e?(e=e.rgb(),new nr(e.r,e.g,e.b,e.opacity)):new nr}function $v(e,t,n,r){return arguments.length===1?roe(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}mS(nr,$v,U3(Vd,{brighter(e){return e=e==null?$p:Math.pow($p,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?od:Math.pow(od,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),Bp(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:jE,formatHex:jE,formatHex8:ioe,formatRgb:NE,toString:NE}));function jE(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}`}function ioe(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}${Xs((isNaN(this.opacity)?1:this.opacity)*255)}`}function NE(){const e=Bp(this.opacity);return`${e===1?"rgb(":"rgba("}${ao(this.r)}, ${ao(this.g)}, ${ao(this.b)}${e===1?")":`, ${e})`}`}function Bp(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 CE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ri(e,t,n,r)}function V3(e){if(e instanceof ri)return new ri(e.h,e.s,e.l,e.opacity);if(e instanceof Vd||(e=cd(e)),!e)return new ri;if(e instanceof ri)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 ri(s,o,c,e.opacity)}function aoe(e,t,n,r){return arguments.length===1?V3(e):new ri(e,t,n,r??1)}function ri(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}mS(ri,aoe,U3(Vd,{brighter(e){return e=e==null?$p:Math.pow($p,e),new ri(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?od:Math.pow(od,e),new ri(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(fy(e>=240?e-240:e+120,i,r),fy(e,i,r),fy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ri(PE(this.h),Hf(this.s),Hf(this.l),Bp(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=Bp(this.opacity);return`${e===1?"hsl(":"hsla("}${PE(this.h)}, ${Hf(this.s)*100}%, ${Hf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function PE(e){return e=(e||0)%360,e<0?e+360:e}function Hf(e){return Math.max(0,Math.min(1,e||0))}function fy(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 gS=e=>()=>e;function soe(e,t){return function(n){return e+n*t}}function ooe(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 loe(e){return(e=+e)==1?W3:function(t,n){return n-t?ooe(t,n,e):gS(isNaN(t)?n:t)}}function W3(e,t){var n=t-e;return n?soe(e,n):gS(isNaN(e)?t:e)}const EE=function e(t){var n=loe(t);function r(i,a){var s=n((i=$v(i)).r,(a=$v(a)).r),o=n(i.g,a.g),c=n(i.b,a.b),u=W3(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 coe(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 uoe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function doe(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]=cc(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 foe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Up(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function hoe(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]=cc(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Bv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hy=new RegExp(Bv.source,"g");function poe(e){return function(){return e}}function moe(e){return function(t){return e(t)+""}}function goe(e,t){var n=Bv.lastIndex=hy.lastIndex=0,r,i,a,s=-1,o=[],c=[];for(e=e+"",t=t+"";(r=Bv.exec(e))&&(i=hy.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:Up(r,i)})),n=hy.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?c[0]?moe(c[0].x):poe(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 cc(e,t){var n=typeof t,r;return t==null||n==="boolean"?gS(t):(n==="number"?Up:n==="string"?(r=cd(t))?(t=r,EE):goe:t instanceof cd?EE:t instanceof Date?foe:uoe(t)?coe:Array.isArray(t)?doe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?hoe:Up)(e,t)}function yS(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function yoe(e,t){t===void 0&&(t=e,e=cc);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 xoe(e){return function(){return e}}function Vp(e){return+e}var AE=[0,1];function Un(e){return e}function Uv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:xoe(isNaN(t)?NaN:.5)}function voe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function boe(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=Uv(i,r),a=n(s,a)):(r=Uv(r,i),a=n(a,s)),function(o){return a(r(o))}}function woe(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]=Uv(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(o){var c=Ud(e,o,1,r)-1;return a[c](i[c](o))}}function Wd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function kg(){var e=AE,t=AE,n=cc,r,i,a,s=Un,o,c,u;function d(){var h=Math.min(e.length,t.length);return s!==Un&&(s=voe(e[0],e[h-1])),o=h>2?woe:boe,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),Up)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Vp),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=yS,d()},f.clamp=function(h){return arguments.length?(s=h?!0:Un,d()):s!==Un},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 xS(){return kg()(Un,Un)}function Soe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Wp(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 Hl(e){return e=Wp(Math.abs(e)),e?e[1]:NaN}function koe(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 joe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Noe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ud(e){if(!(t=Noe.exec(e)))throw new Error("invalid format: "+e);var t;return new vS({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]})}ud.prototype=vS.prototype;function vS(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+""}vS.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 Coe(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 Hp;function Poe(e,t){var n=Wp(e,t);if(!n)return Hp=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Hp=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")+Wp(e,Math.max(0,t+a-1))[0]}function TE(e,t){var n=Wp(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 OE={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Soe,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)=>TE(e*100,t),r:TE,s:Poe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function _E(e){return e}var DE=Array.prototype.map,ME=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Eoe(e){var t=e.grouping===void 0||e.thousands===void 0?_E:koe(DE.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?_E:joe(DE.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=ud(f);var p=f.fill,g=f.align,y=f.sign,b=f.symbol,x=f.zero,v=f.width,w=f.comma,k=f.precision,S=f.trim,j=f.type;j==="n"?(w=!0,j="g"):OE[j]||(k===void 0&&(k=12),S=!0,j="g"),(x||p==="0"&&g==="=")&&(x=!0,p="0",g="=");var N=(h&&h.prefix!==void 0?h.prefix:"")+(b==="$"?n:b==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),P=(b==="$"?r:/[%p]/.test(j)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),T=OE[j],E=/[defgprs%]/.test(j);k=k===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function _(C){var A=N,I=P,$,oe,Z;if(j==="c")I=T(C)+I,C="";else{C=+C;var M=C<0||1/C<0;if(C=isNaN(C)?c:T(Math.abs(C),k),S&&(C=Coe(C)),M&&+C==0&&y!=="+"&&(M=!1),A=(M?y==="("?y:o:y==="-"||y==="("?"":y)+A,I=(j==="s"&&!isNaN(C)&&Hp!==void 0?ME[8+Hp/3]:"")+I+(M&&y==="("?")":""),E){for($=-1,oe=C.length;++$<oe;)if(Z=C.charCodeAt($),48>Z||Z>57){I=(Z===46?i+C.slice($+1):C.slice($))+I,C=C.slice(0,$);break}}}w&&!x&&(C=t(C,1/0));var K=A.length+C.length+I.length,O=K<v?new Array(v-K+1).join(p):"";switch(w&&x&&(C=t(O+C,O.length?v-I.length:1/0),O=""),g){case"<":C=A+C+I+O;break;case"=":C=A+O+C+I;break;case"^":C=O.slice(0,K=O.length>>1)+A+C+I+O.slice(K);break;default:C=O+A+C+I;break}return a(C)}return _.toString=function(){return f+""},_}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(Hl(h)/3)))*3,g=Math.pow(10,-p),y=u((f=ud(f),f.type="f",f),{suffix:ME[8+p/3]});return function(b){return y(g*b)}}return{format:u,formatPrefix:d}}var Kf,bS,H3;Aoe({thousands:",",grouping:[3],currency:["$",""]});function Aoe(e){return Kf=Eoe(e),bS=Kf.format,H3=Kf.formatPrefix,Kf}function Toe(e){return Math.max(0,-Hl(Math.abs(e)))}function Ooe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hl(t)/3)))*3-Hl(Math.abs(e)))}function _oe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hl(t)-Hl(e))+1}function K3(e,t,n,r){var i=Fv(e,t,n),a;switch(r=ud(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Ooe(i,s))&&(r.precision=a),H3(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=_oe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Toe(i))&&(r.precision=a-(r.type==="%")*2);break}}return bS(r)}function bs(e){var t=e.domain;return e.ticks=function(n){var r=t();return Lv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return K3(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=Rv(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=xS();return e.copy=function(){return Wd(e,G3())},Gr.apply(e,arguments),bs(e)}function q3(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,Vp),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return q3(e).unknown(t)},e=arguments.length?Array.from(e,Vp):[0,1],bs(n)}function Y3(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 IE(e){return Math.log(e)}function LE(e){return Math.exp(e)}function Doe(e){return-Math.log(-e)}function Moe(e){return-Math.exp(-e)}function Ioe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Loe(e){return e===10?Ioe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Roe(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 RE(e){return(t,n)=>-e(-t,n)}function wS(e){const t=e(IE,LE),n=t.domain;let r=10,i,a;function s(){return i=Roe(r),a=Loe(r),n()[0]<0?(i=RE(i),a=RE(a),e(Doe,Moe)):e(IE,LE),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 b=o==null?10:+o;let x=[];if(!(r%1)&&p-h<b){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;x.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;x.push(y)}x.length*2<b&&(x=Lv(u,d,b))}else x=Lv(h,p,Math.min(p-h,b)).map(a);return f?x.reverse():x},t.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=ud(c)).precision==null&&(c.trim=!0),c=bS(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(Y3(n(),{floor:o=>a(Math.floor(i(o))),ceil:o=>a(Math.ceil(i(o)))})),t}function X3(){const e=wS(kg()).domain([1,10]);return e.copy=()=>Wd(e,X3()).base(e.base()),Gr.apply(e,arguments),e}function FE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function zE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function SS(e){var t=1,n=e(FE(t),zE(t));return n.constant=function(r){return arguments.length?e(FE(t=+r),zE(t)):t},bs(n)}function Z3(){var e=SS(kg());return e.copy=function(){return Wd(e,Z3()).constant(e.constant())},Gr.apply(e,arguments)}function $E(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Foe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function zoe(e){return e<0?-e*e:e*e}function kS(e){var t=e(Un,Un),n=1;function r(){return n===1?e(Un,Un):n===.5?e(Foe,zoe):e($E(n),$E(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},bs(t)}function jS(){var e=kS(kg());return e.copy=function(){return Wd(e,jS()).exponent(e.exponent())},Gr.apply(e,arguments),e}function $oe(){return jS.apply(null,arguments).exponent(.5)}function BE(e){return Math.sign(e)*e*e}function Boe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Q3(){var e=xS(),t=[0,1],n=!1,r;function i(a){var s=Boe(e(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return e.invert(BE(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,Vp)).map(BE)),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 Q3(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Gr.apply(i,arguments),bs(i)}function J3(){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]=Hse(e,s/o);return a}function a(s){return s==null||isNaN(s=+s)?r:t[Ud(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(rs),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 J3().domain(e).range(t).unknown(r)},Gr.apply(a,arguments)}function eL(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[Ud(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 eL().domain([e,t]).range(i).unknown(a)},Gr.apply(bs(s),arguments)}function tL(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Ud(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 tL().domain(e).range(t).unknown(n)},Gr.apply(i,arguments)}const py=new Date,my=new Date;function nn(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=>nn(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)=>(py.setTime(+a),my.setTime(+s),e(py),e(my),Math.floor(n(py,my))),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 Kp=nn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Kp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?nn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Kp);Kp.range;const Xi=1e3,Ur=Xi*60,Zi=Ur*60,ha=Zi*24,NS=ha*7,UE=ha*30,gy=ha*365,Zs=nn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xi)},(e,t)=>(t-e)/Xi,e=>e.getUTCSeconds());Zs.range;const CS=nn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xi)},(e,t)=>{e.setTime(+e+t*Ur)},(e,t)=>(t-e)/Ur,e=>e.getMinutes());CS.range;const PS=nn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ur)},(e,t)=>(t-e)/Ur,e=>e.getUTCMinutes());PS.range;const ES=nn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xi-e.getMinutes()*Ur)},(e,t)=>{e.setTime(+e+t*Zi)},(e,t)=>(t-e)/Zi,e=>e.getHours());ES.range;const AS=nn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Zi)},(e,t)=>(t-e)/Zi,e=>e.getUTCHours());AS.range;const Hd=nn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ur)/ha,e=>e.getDate()-1);Hd.range;const jg=nn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ha,e=>e.getUTCDate()-1);jg.range;const nL=nn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ha,e=>Math.floor(e/ha));nL.range;function To(e){return nn(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())*Ur)/NS)}const Ng=To(0),Gp=To(1),Uoe=To(2),Voe=To(3),Kl=To(4),Woe=To(5),Hoe=To(6);Ng.range;Gp.range;Uoe.range;Voe.range;Kl.range;Woe.range;Hoe.range;function Oo(e){return nn(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)/NS)}const Cg=Oo(0),qp=Oo(1),Koe=Oo(2),Goe=Oo(3),Gl=Oo(4),qoe=Oo(5),Yoe=Oo(6);Cg.range;qp.range;Koe.range;Goe.range;Gl.range;qoe.range;Yoe.range;const TS=nn(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());TS.range;const OS=nn(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());OS.range;const pa=nn(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:nn(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=nn(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:nn(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 rL(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,Ur],[a,5,5*Ur],[a,15,15*Ur],[a,30,30*Ur],[i,1,Zi],[i,3,3*Zi],[i,6,6*Zi],[i,12,12*Zi],[r,1,ha],[r,2,2*ha],[n,1,NS],[t,1,UE],[t,3,3*UE],[e,1,gy]];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=fS(([,,b])=>b).right(s,h);if(p===s.length)return e.every(Fv(u/gy,d/gy,f));if(p===0)return Kp.every(Math.max(Fv(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[Xoe,Zoe]=rL(ma,OS,Cg,nL,AS,PS),[Qoe,Joe]=rL(pa,TS,Ng,Hd,ES,CS);function yy(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 xy(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 ele(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),b=Uc(o),x=Bc(c),v=Uc(c),w={a:Z,A:M,b:K,B:O,c:null,d:qE,e:qE,f:kle,g:Dle,G:Ile,H:ble,I:wle,j:Sle,L:iL,m:jle,M:Nle,p:ie,q:J,Q:ZE,s:QE,S:Cle,u:Ple,U:Ele,V:Ale,w:Tle,W:Ole,x:null,X:null,y:_le,Y:Mle,Z:Lle,"%":XE},k={a:D,A:H,b:ee,B:be,c:null,d:YE,e:YE,f:$le,g:Xle,G:Qle,H:Rle,I:Fle,j:zle,L:sL,m:Ble,M:Ule,p:ne,q:ye,Q:ZE,s:QE,S:Vle,u:Wle,U:Hle,V:Kle,w:Gle,W:qle,x:null,X:null,y:Yle,Y:Zle,Z:Jle,"%":XE},S={a:E,A:_,b:C,B:A,c:I,d:KE,e:KE,f:gle,g:HE,G:WE,H:GE,I:GE,j:fle,L:mle,m:dle,M:hle,p:T,q:ule,Q:xle,s:vle,S:ple,u:ale,U:sle,V:ole,w:ile,W:lle,x:$,X:oe,y:HE,Y:WE,Z:cle,"%":yle};w.x=j(n,w),w.X=j(r,w),w.c=j(t,w),k.x=j(n,k),k.X=j(r,k),k.c=j(t,k);function j(Q,re){return function(ve){var L=[],W=-1,z=0,te=Q.length,ae,_e,We;for(ve instanceof Date||(ve=new Date(+ve));++W<te;)Q.charCodeAt(W)===37&&(L.push(Q.slice(z,W)),(_e=VE[ae=Q.charAt(++W)])!=null?ae=Q.charAt(++W):_e=ae==="e"?" ":"0",(We=re[ae])&&(ae=We(ve,_e)),L.push(ae),z=W+1);return L.push(Q.slice(z,W)),L.join("")}}function N(Q,re){return function(ve){var L=$c(1900,void 0,1),W=P(L,Q,ve+="",0),z,te;if(W!=ve.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(L.s*1e3+("L"in L?L.L:0));if(re&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+L.p*12),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(z=xy($c(L.y,0,1)),te=z.getUTCDay(),z=te>4||te===0?qp.ceil(z):qp(z),z=jg.offset(z,(L.V-1)*7),L.y=z.getUTCFullYear(),L.m=z.getUTCMonth(),L.d=z.getUTCDate()+(L.w+6)%7):(z=yy($c(L.y,0,1)),te=z.getDay(),z=te>4||te===0?Gp.ceil(z):Gp(z),z=Hd.offset(z,(L.V-1)*7),L.y=z.getFullYear(),L.m=z.getMonth(),L.d=z.getDate()+(L.w+6)%7)}else("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),te="Z"in L?xy($c(L.y,0,1)).getUTCDay():yy($c(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+L.W*7-(te+5)%7:L.w+L.U*7-(te+6)%7);return"Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,xy(L)):yy(L)}}function P(Q,re,ve,L){for(var W=0,z=re.length,te=ve.length,ae,_e;W<z;){if(L>=te)return-1;if(ae=re.charCodeAt(W++),ae===37){if(ae=re.charAt(W++),_e=S[ae in VE?re.charAt(W++):ae],!_e||(L=_e(Q,ve,L))<0)return-1}else if(ae!=ve.charCodeAt(L++))return-1}return L}function T(Q,re,ve){var L=u.exec(re.slice(ve));return L?(Q.p=d.get(L[0].toLowerCase()),ve+L[0].length):-1}function E(Q,re,ve){var L=p.exec(re.slice(ve));return L?(Q.w=g.get(L[0].toLowerCase()),ve+L[0].length):-1}function _(Q,re,ve){var L=f.exec(re.slice(ve));return L?(Q.w=h.get(L[0].toLowerCase()),ve+L[0].length):-1}function C(Q,re,ve){var L=x.exec(re.slice(ve));return L?(Q.m=v.get(L[0].toLowerCase()),ve+L[0].length):-1}function A(Q,re,ve){var L=y.exec(re.slice(ve));return L?(Q.m=b.get(L[0].toLowerCase()),ve+L[0].length):-1}function I(Q,re,ve){return P(Q,t,re,ve)}function $(Q,re,ve){return P(Q,n,re,ve)}function oe(Q,re,ve){return P(Q,r,re,ve)}function Z(Q){return s[Q.getDay()]}function M(Q){return a[Q.getDay()]}function K(Q){return c[Q.getMonth()]}function O(Q){return o[Q.getMonth()]}function ie(Q){return i[+(Q.getHours()>=12)]}function J(Q){return 1+~~(Q.getMonth()/3)}function D(Q){return s[Q.getUTCDay()]}function H(Q){return a[Q.getUTCDay()]}function ee(Q){return c[Q.getUTCMonth()]}function be(Q){return o[Q.getUTCMonth()]}function ne(Q){return i[+(Q.getUTCHours()>=12)]}function ye(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var re=j(Q+="",w);return re.toString=function(){return Q},re},parse:function(Q){var re=N(Q+="",!1);return re.toString=function(){return Q},re},utcFormat:function(Q){var re=j(Q+="",k);return re.toString=function(){return Q},re},utcParse:function(Q){var re=N(Q+="",!0);return re.toString=function(){return Q},re}}}var VE={"-":"",_:" ",0:"0"},fn=/^\s*\d+/,tle=/^%/,nle=/[\\^$*+?|[\]().{}]/g;function nt(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 rle(e){return e.replace(nle,"\\$&")}function Bc(e){return new RegExp("^(?:"+e.map(rle).join("|")+")","i")}function Uc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function ile(e,t,n){var r=fn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ale(e,t,n){var r=fn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function sle(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ole(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function lle(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function WE(e,t,n){var r=fn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function HE(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function cle(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 ule(e,t,n){var r=fn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function dle(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function KE(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function fle(e,t,n){var r=fn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function GE(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function hle(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ple(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function mle(e,t,n){var r=fn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function gle(e,t,n){var r=fn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function yle(e,t,n){var r=tle.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function xle(e,t,n){var r=fn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function vle(e,t,n){var r=fn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qE(e,t){return nt(e.getDate(),t,2)}function ble(e,t){return nt(e.getHours(),t,2)}function wle(e,t){return nt(e.getHours()%12||12,t,2)}function Sle(e,t){return nt(1+Hd.count(pa(e),e),t,3)}function iL(e,t){return nt(e.getMilliseconds(),t,3)}function kle(e,t){return iL(e,t)+"000"}function jle(e,t){return nt(e.getMonth()+1,t,2)}function Nle(e,t){return nt(e.getMinutes(),t,2)}function Cle(e,t){return nt(e.getSeconds(),t,2)}function Ple(e){var t=e.getDay();return t===0?7:t}function Ele(e,t){return nt(Ng.count(pa(e)-1,e),t,2)}function aL(e){var t=e.getDay();return t>=4||t===0?Kl(e):Kl.ceil(e)}function Ale(e,t){return e=aL(e),nt(Kl.count(pa(e),e)+(pa(e).getDay()===4),t,2)}function Tle(e){return e.getDay()}function Ole(e,t){return nt(Gp.count(pa(e)-1,e),t,2)}function _le(e,t){return nt(e.getFullYear()%100,t,2)}function Dle(e,t){return e=aL(e),nt(e.getFullYear()%100,t,2)}function Mle(e,t){return nt(e.getFullYear()%1e4,t,4)}function Ile(e,t){var n=e.getDay();return e=n>=4||n===0?Kl(e):Kl.ceil(e),nt(e.getFullYear()%1e4,t,4)}function Lle(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+nt(t/60|0,"0",2)+nt(t%60,"0",2)}function YE(e,t){return nt(e.getUTCDate(),t,2)}function Rle(e,t){return nt(e.getUTCHours(),t,2)}function Fle(e,t){return nt(e.getUTCHours()%12||12,t,2)}function zle(e,t){return nt(1+jg.count(ma(e),e),t,3)}function sL(e,t){return nt(e.getUTCMilliseconds(),t,3)}function $le(e,t){return sL(e,t)+"000"}function Ble(e,t){return nt(e.getUTCMonth()+1,t,2)}function Ule(e,t){return nt(e.getUTCMinutes(),t,2)}function Vle(e,t){return nt(e.getUTCSeconds(),t,2)}function Wle(e){var t=e.getUTCDay();return t===0?7:t}function Hle(e,t){return nt(Cg.count(ma(e)-1,e),t,2)}function oL(e){var t=e.getUTCDay();return t>=4||t===0?Gl(e):Gl.ceil(e)}function Kle(e,t){return e=oL(e),nt(Gl.count(ma(e),e)+(ma(e).getUTCDay()===4),t,2)}function Gle(e){return e.getUTCDay()}function qle(e,t){return nt(qp.count(ma(e)-1,e),t,2)}function Yle(e,t){return nt(e.getUTCFullYear()%100,t,2)}function Xle(e,t){return e=oL(e),nt(e.getUTCFullYear()%100,t,2)}function Zle(e,t){return nt(e.getUTCFullYear()%1e4,t,4)}function Qle(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Gl(e):Gl.ceil(e),nt(e.getUTCFullYear()%1e4,t,4)}function Jle(){return"+0000"}function XE(){return"%"}function ZE(e){return+e}function QE(e){return Math.floor(+e/1e3)}var $o,lL,cL;ece({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 ece(e){return $o=ele(e),lL=$o.format,$o.parse,cL=$o.utcFormat,$o.utcParse,$o}function tce(e){return new Date(e)}function nce(e){return e instanceof Date?+e:+new Date(+e)}function _S(e,t,n,r,i,a,s,o,c,u){var d=xS(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),y=u("%I:%M"),b=u("%I %p"),x=u("%a %d"),v=u("%b %d"),w=u("%B"),k=u("%Y");function S(j){return(c(j)<j?p:o(j)<j?g:s(j)<j?y:a(j)<j?b:r(j)<j?i(j)<j?x:v:n(j)<j?w:k)(j)}return d.invert=function(j){return new Date(f(j))},d.domain=function(j){return arguments.length?h(Array.from(j,nce)):h().map(tce)},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?S: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(Y3(N,j)):d},d.copy=function(){return Wd(d,_S(e,t,n,r,i,a,s,o,c,u))},d}function rce(){return Gr.apply(_S(Qoe,Joe,pa,TS,Ng,Hd,ES,CS,Zs,lL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ice(){return Gr.apply(_S(Xoe,Zoe,ma,OS,Cg,jg,AS,PS,Zs,cL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Pg(){var e=0,t=1,n,r,i,a,s=Un,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(cc),u.rangeRound=d(yS),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 ws(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function uL(){var e=bs(Pg()(Un));return e.copy=function(){return ws(e,uL())},ja.apply(e,arguments)}function dL(){var e=wS(Pg()).domain([1,10]);return e.copy=function(){return ws(e,dL()).base(e.base())},ja.apply(e,arguments)}function fL(){var e=SS(Pg());return e.copy=function(){return ws(e,fL()).constant(e.constant())},ja.apply(e,arguments)}function DS(){var e=kS(Pg());return e.copy=function(){return ws(e,DS()).exponent(e.exponent())},ja.apply(e,arguments)}function ace(){return DS.apply(null,arguments).exponent(.5)}function hL(){var e=[],t=Un;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ud(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(rs),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)=>Wse(e,a/r))},n.copy=function(){return hL(t).domain(e)},ja.apply(n,arguments)}function Eg(){var e=0,t=.5,n=1,r=1,i,a,s,o,c,u=Un,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(b){var x,v,w;return arguments.length?([x,v,w]=b,u=yoe(y,[x,v,w]),p):[u(0),u(.5),u(1)]}}return p.range=g(cc),p.rangeRound=g(yS),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 pL(){var e=bs(Eg()(Un));return e.copy=function(){return ws(e,pL())},ja.apply(e,arguments)}function mL(){var e=wS(Eg()).domain([.1,1,10]);return e.copy=function(){return ws(e,mL()).base(e.base())},ja.apply(e,arguments)}function gL(){var e=SS(Eg());return e.copy=function(){return ws(e,gL()).constant(e.constant())},ja.apply(e,arguments)}function MS(){var e=kS(Eg());return e.copy=function(){return ws(e,MS()).exponent(e.exponent())},ja.apply(e,arguments)}function sce(){return MS.apply(null,arguments).exponent(.5)}const tu=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:pS,scaleDiverging:pL,scaleDivergingLog:mL,scaleDivergingPow:MS,scaleDivergingSqrt:sce,scaleDivergingSymlog:gL,scaleIdentity:q3,scaleImplicit:zv,scaleLinear:G3,scaleLog:X3,scaleOrdinal:hS,scalePoint:Gse,scalePow:jS,scaleQuantile:J3,scaleQuantize:eL,scaleRadial:Q3,scaleSequential:uL,scaleSequentialLog:dL,scaleSequentialPow:DS,scaleSequentialQuantile:hL,scaleSequentialSqrt:ace,scaleSequentialSymlog:fL,scaleSqrt:$oe,scaleSymlog:Z3,scaleThreshold:tL,scaleTime:rce,scaleUtc:ice,tickFormat:K3},Symbol.toStringTag,{value:"Module"}));function oce(e){if(e in tu)return tu[e]();var t="scale".concat(Dd(e));if(t in tu)return tu[t]()}function JE(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=oce(e);if(r!=null)return r.domain(t).range(n),r}}function IS(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?JE(e.scale,n,r):JE(t,n,r)}function lce(e){return"scale".concat(Dd(e))}function cce(e){return lce(e)in tu}var yL=(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 cce(r)?r:"point"}};function uce(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 xL(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=uce(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 dce(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):xL(e,void 0)}function e5(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 Yp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e5(Object(n),!0).forEach(function(r){fce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fce(e,t,n){return(t=hce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hce(e){var t=pce(e,"string");return typeof t=="symbol"?t:t+""}function pce(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 Vv=[0,"auto"],Zt={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"},vL=(e,t)=>e.cartesianAxis.xAxis[t],Na=(e,t)=>{var n=vL(e,t);return n??Zt},Qt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Vv,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:Ld},bL=(e,t)=>e.cartesianAxis.yAxis[t],Ca=(e,t)=>{var n=bL(e,t);return n??Qt},mce={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:""},LS=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??mce},Yn=(e,t,n)=>{switch(t){case"xAxis":return Na(e,n);case"yAxis":return Ca(e,n);case"zAxis":return LS(e,n);case"angleAxis":return sS(e,n);case"radiusAxis":return oS(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},gce=(e,t,n)=>{switch(t){case"xAxis":return Na(e,n);case"yAxis":return Ca(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Kd=(e,t,n)=>{switch(t){case"xAxis":return Na(e,n);case"yAxis":return Ca(e,n);case"angleAxis":return sS(e,n);case"radiusAxis":return oS(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},wL=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function SL(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 kL=e=>e.graphicalItems.cartesianItems,yce=q([un,bg],SL),jL=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Gd=q([kL,Yn,yce],jL,{memoizeOptions:{resultEqualityCheck:Sg}}),NL=q([Gd],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(uS)),CL=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),xce=q([Gd],CL),PL=e=>e.map(t=>t.data).filter(Boolean).flat(1),vce=q([Gd],PL,{memoizeOptions:{resultEqualityCheck:Sg}}),EL=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},RS=q([vce,x3],EL),AL=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:wn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:wn(i,r)}))):e.map(r=>({value:r})),qd=q([RS,Yn,Gd],AL);function jl(e){if(Li(e)||e instanceof Date){var t=Number(e);if(qe(t))return t}}function t5(e){if(Array.isArray(e)){var t=[jl(e[0]),jl(e[1])];return _i(t)?t:void 0}var n=jl(e);if(n!=null)return[n,n]}function ga(e){return e.map(jl).filter(tr)}function bce(e,t){var n=jl(e),r=jl(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var wce=q([qd],e=>e==null?void 0:e.map(t=>t.value).sort(bce));function TL(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Sce(e,t,n){return!n||typeof t!="number"||Ii(t)?[]:n.length?ga(n.flatMap(r=>{var i=wn(e,r.dataKey),a,s;if(Array.isArray(i)?[a,s]=i:a=s=i,!(!qe(a)||!qe(s)))return[t-a,t+s]})):[]}var rn=e=>{var t=dn(e),n=lc(e);return Kd(e,t,n)},Yd=q([rn],e=>e==null?void 0:e.dataKey),kce=q([NL,x3,rn],R3),OL=(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(cS);return[o,{stackedData:cre(e,d,n),graphicalItems:u}]}))},_L=q([kce,NL,gg,T3],OL),DL=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var s=hre(e,i,a);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},jce=q([Yn],e=>e.allowDataOverflow),FS=e=>{var t;if(e==null||!("domain"in e))return Vv;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:Vv},ML=q([Yn],FS),IL=q([ML,jce],v3),Nce=q([_L,ka,un,IL],DL,{memoizeOptions:{resultEqualityCheck:wg}}),zS=e=>e.errorBars,Cce=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>TL(n,r)),Xp=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]}},LL=(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(x=>TL(i,x)),h=wn(o,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),p=Sce(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 b=t5(h);b!=null&&(a=a==null?b[0]:Math.min(a,b[0]),s=s==null?b[1]:Math.max(s,b[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(o=>{var c=t5(wn(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]))}),qe(a)&&qe(s))return[a,s]},Pce=q([RS,Yn,xce,zS,un],LL,{memoizeOptions:{resultEqualityCheck:wg}});function Ece(e){var{value:t}=e;if(Li(t)||t instanceof Date)return t}var Ace=(e,t,n)=>{var r=e.map(Ece).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&jM(r))?g3(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},RL=e=>e.referenceElements.dots,uc=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Tce=q([RL,un,bg],uc),FL=e=>e.referenceElements.areas,Oce=q([FL,un,bg],uc),zL=e=>e.referenceElements.lines,_ce=q([zL,un,bg],uc),$L=(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)]}},Dce=q(Tce,un,$L),BL=(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)]}},Mce=q([Oce,un],BL);function Ice(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 Lce(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 UL=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Ice(r):Lce(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Rce=q([_ce,un],UL),Fce=q(Dce,Rce,Mce,(e,t,n)=>Xp(e,n,t)),VL=(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?Xp(r,a,i):Xp(a,i);return xse(t,u,e.allowDataOverflow)},zce=q([Yn,ML,IL,Nce,Pce,Fce,Tt,un],VL,{memoizeOptions:{resultEqualityCheck:wg}}),$ce=[0,1],WL=(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=Ui(t,a);if(u&&o==null){var d;return g3(0,(d=n==null?void 0:n.length)!==null&&d!==void 0?d:0)}return c==="category"?Ace(r,e,u):i==="expand"?$ce:s}},$S=q([Yn,Tt,RS,qd,gg,un,zce],WL),dc=q([Yn,wL,rS],yL),HL=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=FS(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&_i(e)){if(a)return dE(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return fE(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&_i(e))return dE(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&_i(e))return fE(e,t.tickCount,t.allowDecimals,"adaptive")}}},BS=q([$S,Kd,dc],HL),KL=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&_i(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},Bce=q([Yn,$S,BS,un],KL),Uce=q(qd,Yn,(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(Uce,Tt,kse,jn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!qe(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var s=fs(n,e*a),o=e*a/2;return o-s-(o-s)/a*s}return 0}),Vce=(e,t,n)=>{var r=Na(e,t);return r==null||typeof r.padding!="string"?0:GL(e,"xAxis",t,n,r.padding)},Wce=(e,t,n)=>{var r=Ca(e,t);return r==null||typeof r.padding!="string"?0:GL(e,"yAxis",t,n,r.padding)},Hce=q(Na,Vce,(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}}),Kce=q(Ca,Wce,(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}}),Gce=q([jn,Hce,ug,cg,(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]}),qce=q([jn,Tt,Kce,ug,cg,(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]}),Xd=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Gce(e,n,r);case"yAxis":return qce(e,n,r);case"zAxis":return(i=LS(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return M3(e);case"radiusAxis":return I3(e,n);default:return}},qL=q([Yn,Xd],yg),Yce=q([dc,Bce],_se),US=q([Yn,dc,Yce,qL],IS),YL=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,s=Ui(e,r);if(s&&(i==="number"||a!=="auto"))return t.map(o=>o.value)}},VS=q([Tt,qd,Kd,un],YL),Ag=q([US],dS);q([US],dce);q([US,wce],xL);q([Gd,zS,un],Cce);function XL(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Tg=(e,t)=>t,Og=(e,t,n)=>n,Xce=q(og,Tg,Og,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(XL)),Zce=q(lg,Tg,Og,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(XL)),ZL=(e,t)=>({width:e.width,height:t.height}),Qce=(e,t)=>{var n=typeof t.width=="number"?t.width:Ld;return{width:n,height:e.height}},Jce=q(jn,Na,ZL),eue=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},tue=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},nue=q(Sa,jn,Xce,Tg,Og,(e,t,n,r,i)=>{var a={},s;return n.forEach(o=>{var c=ZL(t,o);s==null&&(s=eue(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}),rue=q(wa,jn,Zce,Tg,Og,(e,t,n,r,i)=>{var a={},s;return n.forEach(o=>{var c=Qce(t,o);s==null&&(s=tue(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}),iue=(e,t)=>{var n=Na(e,t);if(n!=null)return nue(e,n.orientation,n.mirror)},aue=q([jn,Na,iue,(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}}}),sue=(e,t)=>{var n=Ca(e,t);if(n!=null)return rue(e,n.orientation,n.mirror)},oue=q([jn,Ca,sue,(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}}}),lue=q(jn,Ca,(e,t)=>{var n=typeof t.width=="number"?t.width:Ld;return{width:n,height:e.height}}),QL=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:s}=n,o=Ui(e,r),c=t.map(u=>u.value);if(s&&o&&a==="category"&&i&&jM(c))return c}},WS=q([Tt,qd,Yn,un],QL),n5=q([Tt,gce,dc,Ag,WS,VS,Xd,BS,un],(e,t,n,r,i,a,s,o,c)=>{if(t!=null){var u=Ui(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}}}),cue=(e,t,n,r,i,a,s,o,c)=>{if(!(t==null||r==null)){var u=Ui(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?$r(a[0]-a[1])*2*g:g;var y=f||i;return y?y.map((b,x)=>{var v=s?s.indexOf(b):b,w=r.map(v);return qe(w)?{index:x,coordinate:w+g,value:b,offset:g}:null}).filter(tr):u&&o?o.map((b,x)=>{var v=r.map(b);return qe(v)?{coordinate:v+g,value:b,index:x,offset:g}:null}).filter(tr):r.ticks?r.ticks(h).map((b,x)=>{var v=r.map(b);return qe(v)?{coordinate:v+g,value:b,index:x,offset:g}:null}).filter(tr):r.domain().map((b,x)=>{var v=r.map(b);return qe(v)?{coordinate:v+g,value:s?s[b]:b,index:x,offset:g}:null}).filter(tr)}},JL=q([Tt,Kd,dc,Ag,BS,Xd,WS,VS,un],cue),uue=(e,t,n,r,i,a,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var o=Ui(e,s),{tickCount:c}=t,u=0;return u=s==="angleAxis"&&(r==null?void 0:r.length)>=2?$r(r[0]-r[1])*2*u:u,o&&a?a.map((d,f)=>{var h=n.map(d);return qe(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 qe(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter(tr):n.domain().map((d,f)=>{var h=n.map(d);return qe(h)?{coordinate:h+u,value:i?i[d]:d,index:f,offset:u}:null}).filter(tr)}},eR=q([Tt,Kd,Ag,Xd,WS,VS,un],uue),tR=q(Yn,Ag,(e,t)=>{if(!(e==null||t==null))return Yp(Yp({},e),{},{scale:t})}),due=q([Yn,dc,$S,qL],IS),fue=q([due],dS);q((e,t,n)=>LS(e,n),fue,(e,t)=>{if(!(e==null||t==null))return Yp(Yp({},e),{},{scale:t})});var hue=q([Tt,og,lg],(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}}),pue=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};q([pue],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 nR=e=>e.options.defaultTooltipEventType,rR=e=>e.options.validateTooltipEventTypes;function iR(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function HS(e,t){var n=nR(e),r=rR(e);return iR(t,n,r)}function mue(e){return De(t=>HS(t,e))}var aR=(e,t)=>{var n,r=Number(t);if(!(Ii(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},gue=e=>e.tooltip.settings,Va={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},yue={itemInteraction:{click:Va,hover:Va},axisInteraction:{click:Va,hover:Va},keyboardInteraction:Va,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}},sR=Rn({name:"tooltip",initialState:yue,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:wt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Br(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:wt()},removeTooltipEntrySettings:{reducer(e,t){var n=Br(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:wt()},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:xue,replaceTooltipEntrySettings:vue,removeTooltipEntrySettings:bue,setTooltipSettingsState:wue,setActiveMouseOverItemIndex:Sue,mouseLeaveItem:J0e,mouseLeaveChart:oR,setActiveClickItemIndex:eye,setMouseOverAxisIndex:lR,setMouseClickAxisIndex:kue,setSyncInteraction:Wv,setKeyboardInteraction:Zp}=sR.actions,jue=sR.reducer;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 Gf(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){Nue(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 Nue(e,t,n){return(t=Cue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cue(e){var t=Pue(e,"string");return typeof t=="symbol"?t:t+""}function Pue(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 Eue(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Aue(e){return e.index!=null}var cR=(e,t,n,r)=>{if(t==null)return Va;var i=Eue(e,t,n);if(i==null)return Va;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(Aue(i)){if(a)return Gf(Gf({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Gf(Gf({},Va),{},{coordinate:i.coordinate})};function Tue(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 Oue(e,t){var n=Tue(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 _ue(e,t,n){if(n==null||t==null)return!0;var r=wn(e,t);return r==null||!_i(n)?!0:Oue(r,n)}var KS=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!qe(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||_ue(u,n,r)?String(c):null},uR=(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}}}},dR=(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})},fR=e=>e.options.tooltipPayloadSearcher,fc=e=>e.tooltip;function i5(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 a5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i5(Object(n),!0).forEach(function(r){Due(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Due(e,t,n){return(t=Mue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mue(e){var t=Iue(e,"string");return typeof t=="symbol"?t:t+""}function Iue(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 Lue(e){if(typeof e=="string"||typeof e=="number")return e}function Rue(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Fue(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function s5(e){if(typeof e=="string")return e}function zue(e){if(!(e==null||typeof e!="object")){var t="name"in e?Lue(e.name):void 0,n="unit"in e?Rue(e.unit):void 0,r="dataKey"in e?Fue(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?s5(e.color):void 0,s="fill"in e?s5(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:s}}}function $ue(e,t){return e??t}var hR=(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:b}=p,x=$ue(y,o),v=Array.isArray(x)?RI(x,u,d):x,w=(g=b==null?void 0:b.dataKey)!==null&&g!==void 0?g:r,k=b==null?void 0:b.nameKey,S;if(r&&Array.isArray(v)&&!Array.isArray(v[0])&&s==="axis"?S=NM(v,r,i):S=a(v,t,c,k),Array.isArray(S))S.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,I=a5(a5({},b),{},{name:_,unit:E==null?void 0:E.unit,color:(P=E==null?void 0:E.color)!==null&&P!==void 0?P:b==null?void 0:b.color,fill:(T=E==null?void 0:E.fill)!==null&&T!==void 0?T:b==null?void 0:b.fill});h.push(cP({tooltipEntrySettings:I,dataKey:C,payload:A,value:wn(A,C),name:_==null?void 0:String(_)}))});else{var j;h.push(cP({tooltipEntrySettings:b,dataKey:w,payload:S,value:wn(S,w),name:(j=wn(S,k))!==null&&j!==void 0?j:b==null?void 0:b.name}))}return h},f)}},GS=q([rn,wL,rS],yL),Bue=q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Uue=q([dn,lc],SL),hc=q([Bue,rn,Uue],jL,{memoizeOptions:{resultEqualityCheck:Sg}}),Vue=q([hc],e=>e.filter(uS)),Wue=q([hc],PL,{memoizeOptions:{resultEqualityCheck:Sg}}),pc=q([Wue,ka],EL),Hue=q([Vue,ka,rn],R3),qS=q([pc,rn,hc],AL),pR=q([rn],FS),Kue=q([rn],e=>e.allowDataOverflow),mR=q([pR,Kue],v3),Gue=q([hc],e=>e.filter(uS)),que=q([Hue,Gue,gg,T3],OL),Yue=q([que,ka,dn,mR],DL),Xue=q([hc],CL),Zue=q([pc,rn,Xue,zS,dn],LL,{memoizeOptions:{resultEqualityCheck:wg}}),Que=q([RL,dn,lc],uc),Jue=q([Que,dn],$L),ede=q([FL,dn,lc],uc),tde=q([ede,dn],BL),nde=q([zL,dn,lc],uc),rde=q([nde,dn],UL),ide=q([Jue,rde,tde],Xp),ade=q([rn,pR,mR,Yue,Zue,ide,Tt,dn],VL),Zd=q([rn,Tt,pc,qS,gg,dn,ade],WL),sde=q([Zd,rn,GS],HL),ode=q([rn,Zd,sde,dn],KL),gR=e=>{var t=dn(e),n=lc(e),r=!1;return Xd(e,t,n,r)},yR=q([rn,gR],yg),lde=q([rn,GS,ode,yR],IS),xR=q([lde],dS),cde=q([Tt,qS,rn,dn],QL),ude=q([Tt,qS,rn,dn],YL),dde=(e,t,n,r,i,a,s,o)=>{if(t){var{type:c}=t,u=Ui(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?$r(i[0]-i[1])*2*f:f,u&&s?s.map((h,p)=>{var g=r.map(h);return qe(g)?{coordinate:g+f,value:h,index:p,offset:f}:null}).filter(tr):r.domain().map((h,p)=>{var g=r.map(h);return qe(g)?{coordinate:g+f,value:a?a[h]:h,index:p,offset:f}:null}).filter(tr)}}},Pa=q([Tt,rn,GS,xR,gR,cde,ude,dn],dde),YS=q([nR,rR,gue],(e,t,n)=>iR(n.shared,e,t)),vR=e=>e.tooltip.settings.trigger,XS=e=>e.tooltip.settings.defaultIndex,Qd=q([fc,YS,vR,XS],cR),dd=q([Qd,pc,Yd,Zd],KS),bR=q([Pa,dd],aR),fde=q([Qd],e=>{if(e)return e.dataKey}),hde=q([Qd],e=>{if(e)return e.graphicalItemId}),wR=q([fc,YS,vR,XS],dR),pde=q([wa,Sa,Tt,jn,Pa,XS,wR],uR),mde=q([Qd,pde],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),gde=q([Qd],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),yde=q([wR,dd,ka,Yd,bR,fR,YS],hR),xde=q([yde],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});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){vde(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 vde(e,t,n){return(t=bde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bde(e){var t=wde(e,"string");return typeof t=="symbol"?t:t+""}function wde(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 Sde=()=>De(rn),kde=()=>{var e=Sde(),t=De(Pa),n=De(xR);return Pp(!e||!n?void 0:l5(l5({},e),{},{scale:n}),t)};function c5(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?c5(Object(n),!0).forEach(function(r){jde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jde(e,t,n){return(t=Nde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nde(e){var t=Cde(e,"string");return typeof t=="symbol"?t:t+""}function Cde(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 Pde=(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}},Ede=(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),vn(r.cx,r.cy,s,a)),{},{angle:a,radius:s})}var o=i.coordinate,{angle:c}=r;return Bo(Bo(Bo({},r),vn(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 Ade(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 SR=(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,b=void 0;if(!(p==null||g==null||y==null))if($r(g-p)!==$r(y-g)){var x=[];if($r(y-g)===$r(i[1]-i[0])){b=y;var v=g+i[1]-i[0];x[0]=Math.min(v,(v+p)/2),x[1]=Math.max(v,(v+p)/2)}else{b=p;var w=y+i[1]-i[0];x[0]=Math.min(g,(w+g)/2),x[1]=Math.max(g,(w+g)/2)}var k=[Math.min(g,(b+g)/2),Math.max(g,(b+g)/2)];if(e>k[0]&&e<=k[1]||e>=x[0]&&e<=x[1]){var S;return(S=n[o])===null||S===void 0?void 0:S.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},kR=()=>De(rS),ZS=(e,t)=>t,jR=(e,t,n)=>n,QS=(e,t,n,r)=>r,Tde=q(Pa,e=>Zm(e,t=>t.coordinate)),JS=q([fc,ZS,jR,QS],cR),ek=q([JS,pc,Yd,Zd],KS),Ode=(e,t,n)=>{if(t!=null){var r=fc(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},NR=q([fc,ZS,jR,QS],dR),Qp=q([wa,Sa,Tt,jn,Pa,QS,NR],uR),_de=q([JS,Qp],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),CR=q([Pa,ek],aR),Dde=q([NR,ek,ka,Yd,CR,fR,ZS],hR),Mde=q([JS,ek],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Ide=(e,t,n,r,i,a,s)=>{if(!(!e||!n||!r||!i)&&Ade(e,s)){var o=pre(e,t),c=SR(o,a,i,n,r),u=Pde(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},Lde=(e,t,n,r,i,a,s)=>{if(!(!e||!r||!i||!a||!n)){var o=use(e,n);if(o){var c=mre(o,t),u=SR(c,s,a,r,i),d=Ede(t,a,u,o);return{activeIndex:String(u),activeCoordinate:d}}}},Rde=(e,t,n,r,i,a,s,o)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Ide(e,t,r,i,a,s,o):Lde(e,t,n,r,i,a,s)},Fde=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(Bn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Ose}});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){$de(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 $de(e,t,n){return(t=Bde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bde(e){var t=Ude(e,"string");return typeof t=="symbol"?t:t+""}function Ude(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 Vde={},Wde={zIndexMap:Object.values(Bn).reduce((e,t)=>d5(d5({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Vde)},Hde=new Set(Object.values(Bn));function Kde(e){return Hde.has(e)}var PR=Rn({name:"zIndex",initialState:Wde,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:wt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Kde(n)&&delete e.zIndexMap[n])},prepare:wt()},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:wt()},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:wt()}}}),{registerZIndexPortal:Gde,unregisterZIndexPortal:qde,registerZIndexPortalElement:Yde,unregisterZIndexPortalElement:Xde}=PR.actions,Zde=PR.reducer;function Ea(e){var{zIndex:t,children:n}=e,r=Wre(),i=r&&t!==void 0&&t!==0,a=cr(),s=Bt();m.useLayoutEffect(()=>i?(s(Gde({zIndex:t})),()=>{s(qde({zIndex:t}))}):Ao,[s,t,i]);var o=De(c=>Fde(c,t,a));return i?o?Co.createPortal(n,o):null:n}function Hv(){return Hv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hv.apply(null,arguments)}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 qf(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){Qde(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 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)}function tfe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return m.isValidElement(t)?m.cloneElement(t,r):m.createElement(n,r)}function nfe(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,b;if(d==="ScatterChart")g=f,y=Sae,b=Bn.cursorLine;else if(d==="BarChart")g=kae(o,f,a,s),y=ese,b=Bn.cursorRectangle;else if(o==="radial"&&EM(f)){var{cx:x,cy:v,radius:w,startAngle:k,endAngle:S}=d3(f);g={cx:x,cy:v,startAngle:k,endAngle:S,innerRadius:w,outerRadius:w},y=pse,b=Bn.cursorLine}else g={points:mse(o,f,a)},y=Sh,b=Bn.cursorLine;var j=typeof c=="object"&&"className"in c?c.className:void 0,N=qf(qf(qf(qf({stroke:"#ccc",pointerEvents:"none"},a),g),Bm(c)),{},{payload:h,payloadIndex:p,className:ot("recharts-tooltip-cursor",j)});return m.createElement(Ea,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:b},m.createElement(tfe,{cursor:c,cursorComp:y,cursorProps:N}))}function rfe(e){var t=kde(),n=YI(),r=ac(),i=kR();return t==null||n==null||r==null||i==null?null:m.createElement(nfe,Hv({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var ER=m.createContext(null),ife=()=>m.useContext(ER),AR={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 b=this._events[y],x=arguments.length,v,w;if(b.fn){switch(b.once&&this.removeListener(u,b.fn,void 0,!0),x){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,d),!0;case 3:return b.fn.call(b.context,d,f),!0;case 4:return b.fn.call(b.context,d,f,h),!0;case 5:return b.fn.call(b.context,d,f,h,p),!0;case 6:return b.fn.call(b.context,d,f,h,p,g),!0}for(w=1,v=new Array(x-1);w<x;w++)v[w-1]=arguments[w];b.fn.apply(b.context,v)}else{var k=b.length,S;for(w=0;w<k;w++)switch(b[w].once&&this.removeListener(u,b[w].fn,void 0,!0),x){case 1:b[w].fn.call(b[w].context);break;case 2:b[w].fn.call(b[w].context,d);break;case 3:b[w].fn.call(b[w].context,d,f);break;case 4:b[w].fn.call(b[w].context,d,f,h);break;default:if(!v)for(S=1,v=new Array(x-1);S<x;S++)v[S-1]=arguments[S];b[w].fn.apply(b[w].context,v)}}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,b=[],x=g.length;y<x;y++)(g[y].fn!==d||h&&!g[y].once||f&&g[y].context!==f)&&b.push(g[y]);b.length?this._events[p]=b.length===1?b[0]:b: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})(AR);var afe=AR.exports;const sfe=hi(afe);var fd=new sfe,Kv="recharts.syncEvent.tooltip",h5="recharts.syncEvent.brush",ofe=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Ii(n))return e[n]}},lfe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},TR=Rn({name:"options",initialState:lfe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),cfe=TR.reducer,{createEventEmitter:ufe}=TR.actions;function dfe(e){return e.tooltip.syncInteraction}var ffe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},OR=Rn({name:"chartData",initialState:ffe,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:p5,setDataStartEndIndexes:hfe,setComputedData:tye}=OR.actions,pfe=OR.reducer,mfe=["x","y"];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 Uo(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){gfe(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 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)}function vfe(e,t){if(e==null)return{};var n,r,i=bfe(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 bfe(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 wfe(){var e=De(iS),t=De(aS),n=Bt(),r=De(O3),i=De(Pa),a=ac(),s=dg(),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,b=vfe(p,mfe),{x,y:v,width:w,height:k}=d.payload.sourceViewBox,S=Uo(Uo({},b),{},{x:s.x+(w?(g-x)/w:0)*s.width,y:s.y+(k?(y-v)/k:0)*s.height});n(Uo(Uo({},d),{},{payload:Uo(Uo({},d.payload),{},{coordinate:S})}))}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(oe=>String(oe.value)===d.payload.label));var{coordinate:T}=d.payload;if(j==null||d.payload.active===!1||T==null||s==null){n(Wv({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),I={x:a==="horizontal"?j.coordinate:C,y:a==="horizontal"?A:j.coordinate},$=Wv({active:d.payload.active,coordinate:I,dataKey:d.payload.dataKey,index:String(j.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n($)}}};return fd.on(Kv,c),()=>{fd.off(Kv,c)}},[o,n,t,e,r,i,a,s])}function Sfe(){var e=De(iS),t=De(aS),n=Bt();m.useEffect(()=>{if(e==null)return Ao;var r=(i,a,s)=>{t!==s&&e===i&&n(hfe(a))};return fd.on(h5,r),()=>{fd.off(h5,r)}},[n,t,e])}function kfe(){var e=Bt();m.useEffect(()=>{e(ufe())},[e]),wfe(),Sfe()}function jfe(e,t,n,r,i,a){var s=De(g=>Ode(g,e,t)),o=De(hde),c=De(aS),u=De(iS),d=De(O3),f=De(dfe),h=f==null?void 0:f.active,p=dg();m.useEffect(()=>{if(!h&&u!=null&&c!=null){var g=Wv({active:a,coordinate:n,dataKey:s,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:p,graphicalItemId:o});fd.emit(Kv,u,g,c)}},[h,n,s,o,i,r,c,u,d,a,p])}function g5(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 y5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g5(Object(n),!0).forEach(function(r){Nfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nfe(e,t,n){return(t=Cfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cfe(e){var t=Pfe(e,"string");return typeof t=="symbol"?t:t+""}function Pfe(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 Efe(e){return e.dataKey}function Afe(e,t){return m.isValidElement(e)?m.cloneElement(e,t):typeof e=="function"?m.createElement(e,t):m.createElement(Zie,t)}var x5=[],Tfe={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 tk(e){var t,n,r=lr(e,Tfe),{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:b,cursor:x,shared:v,trigger:w,defaultIndex:k,portal:S,axisId:j}=r,N=Bt(),P=typeof k=="number"?String(k):k;m.useEffect(()=>{N(wue({shared:v,trigger:w,axisId:j,active:i,defaultIndex:P}))},[N,v,w,j,i,P]);var T=dg(),E=a3(),_=mue(v),{activeIndex:C,isActive:A}=(t=De(ye=>Mde(ye,_,w,P)))!==null&&t!==void 0?t:{},I=De(ye=>Dde(ye,_,w,P)),$=De(ye=>CR(ye,_,w,P)),oe=De(ye=>_de(ye,_,w,P)),Z=I,M=ife(),K=(n=i??A)!==null&&n!==void 0?n:!1,[O,ie]=oI([Z,K]),J=_==="axis"?$:void 0;jfe(_,w,oe,J,C,K);var D=S??M;if(D==null||T==null||_==null)return null;var H=Z??x5;K||(H=x5),u&&H.length&&(H=YM(H.filter(ye=>ye.value!=null&&(ye.hide!==!0||r.includeHidden)),h,Efe));var ee=H.length>0,be=y5(y5({},r),{},{payload:H,label:J,active:K,activeIndex:C,coordinate:oe,accessibilityLayer:E}),ne=m.createElement(lae,{allowEscapeViewBox:a,animationDuration:s,animationEasing:o,isAnimationActive:d,active:K,coordinate:oe,hasPayload:ee,offset:f,position:p,reverseDirection:g,useTranslate3d:y,viewBox:T,wrapperStyle:b,lastBoundingBox:O,innerRef:ie,hasPortalFromProps:!!S},Afe(c,be));return m.createElement(m.Fragment,null,Co.createPortal(ne,D),K&&m.createElement(rfe,{cursor:x,tooltipEventType:_,coordinate:oe,payload:H,index:C}))}function Ofe(e,t,n){return(t=_fe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _fe(e){var t=Dfe(e,"string");return typeof t=="symbol"?t:t+""}function Dfe(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 Mfe{constructor(t){Ofe(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 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 Ife(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){Lfe(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 Lfe(e,t,n){return(t=Rfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rfe(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)}var zfe={cacheSize:2e3,enableCache:!0},_R=Ife({},zfe),b5=new Mfe(_R.cacheSize),$fe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},w5="recharts_measurement_span";function Bfe(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 S5=(e,t)=>{try{var n=document.getElementById(w5);n||(n=document.createElement("span"),n.setAttribute("id",w5),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,$fe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},vu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Bd.isSsr)return{width:0,height:0};if(!_R.enableCache)return S5(t,n);var r=Bfe(t,n),i=b5.get(r);if(i)return i;var a=S5(t,n);return b5.set(r,a),a},DR;function Ufe(e,t,n){return(t=Vfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vfe(e){var t=Wfe(e,"string");return typeof t=="symbol"?t:t+""}function Wfe(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 k5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,j5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Hfe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Kfe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Gfe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},qfe=["cm","mm","pt","pc","in","Q","px"];function Yfe(e){return qfe.includes(e)}var fl="NaN";function Xfe(e,t){return e*Gfe[t]}class xn{static parse(t){var n,[,r,i]=(n=Kfe.exec(t))!==null&&n!==void 0?n:[];return r==null?xn.NaN:new xn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Ii(t)&&(this.unit=""),n!==""&&!Hfe.test(n)&&(this.num=NaN,this.unit=""),Yfe(n)&&(this.num=Xfe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new xn(NaN,""):new xn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new xn(NaN,""):new xn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new xn(NaN,""):new xn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new xn(NaN,""):new xn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Ii(this.num)}}DR=xn;Ufe(xn,"NaN",new DR(NaN,""));function MR(e){if(e==null||e.includes(fl))return fl;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=k5.exec(t))!==null&&n!==void 0?n:[],s=xn.parse(r??""),o=xn.parse(a??""),c=i==="*"?s.multiply(o):s.divide(o);if(c.isNaN())return fl;t=t.replace(k5,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,h]=(u=j5.exec(t))!==null&&u!==void 0?u:[],p=xn.parse(d??""),g=xn.parse(h??""),y=f==="+"?p.add(g):p.subtract(g);if(y.isNaN())return fl;t=t.replace(j5,y.toString())}return t}var N5=/\(([^()]*)\)/;function Zfe(e){for(var t=e,n;(n=N5.exec(t))!=null;){var[,r]=n;t=t.replace(N5,MR(r))}return t}function Qfe(e){var t=e.replace(/\s+/g,"");return t=Zfe(t),t=MR(t),t}function Jfe(e){try{return Qfe(e)}catch{return fl}}function vy(e){var t=Jfe(e.slice(5,-1));return t===fl?"":t}var ehe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],the=["dx","dy","angle","className","breakAll"];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 C5(e,t){if(e==null)return{};var n,r,i=nhe(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 nhe(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 IR=/[ \f\n\r\t\v\u2028\u2029]+/,LR=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];kn(t)||(n?i=t.toString().split(""):i=t.toString().split(IR));var a=i.map(o=>({word:o,width:vu(o,r).width})),s=n?0:vu(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}};function RR(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function rhe(e){return kn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var FR=(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},[]),zR=e=>e.reduce((t,n)=>t.width>n.width?t:n),ihe="…",P5=(e,t,n,r,i,a,s,o)=>{var c=e.slice(0,t),u=LR({breakAll:n,style:r,children:c+ihe});if(!u)return[!1,[]];var d=FR(u.wordsWithComputedWidth,a,s,o),f=d.length>i||zR(d).width>Number(a);return[f,d]},ahe=(e,t,n,r,i)=>{var{maxLines:a,children:s,style:o,breakAll:c}=e,u=Ae(a),d=String(s),f=FR(t,r,n,i);if(!u||i)return f;var h=f.length>a||zR(f).width>Number(r);if(!h)return f;for(var p=0,g=d.length-1,y=0,b;p<=g&&y<=d.length-1;){var x=Math.floor((p+g)/2),v=x-1,[w,k]=P5(d,v,c,o,a,r,n,i),[S]=P5(d,x,c,o,a,r,n,i);if(!w&&!S&&(p=x+1),w&&S&&(g=x-1),!w&&S){b=k;break}y++}return b||f},E5=e=>{var t=kn(e)?[]:e.toString().split(IR);return[{words:t,width:void 0}]},she=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:s}=e;if((t||n)&&!Bd.isSsr){var o,c,u=LR({breakAll:a,children:r,style:i});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;o=d,c=f}else return E5(r);return ahe({breakAll:a,children:r,maxLines:s,style:i},o,c,t,!!n)}return E5(r)},$R="#808080",ohe={angle:0,breakAll:!1,capHeight:"0.71em",fill:$R,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},nk=m.forwardRef((e,t)=>{var n=lr(e,ohe),{x:r,y:i,lineHeight:a,capHeight:s,fill:o,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,f=C5(n,ehe),h=m.useMemo(()=>she({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:b,breakAll:x}=f,v=C5(f,the);if(!Li(r)||!Li(i)||h.length===0)return null;var w=Number(r)+(Ae(p)?p:0),k=Number(i)+(Ae(g)?g:0);if(!qe(w)||!qe(k))return null;var S;switch(d){case"start":S=vy("calc(".concat(s,")"));break;case"middle":S=vy("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(s," / 2))"));break;default:S=vy("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(Ae(T)&&Ae(P)?T/P:1,")"))}return y&&j.push("rotate(".concat(y,", ").concat(w,", ").concat(k,")")),j.length&&(v.transform=j.join(" ")),m.createElement("text",Gv({},jr(v),{ref:t,x:w,y:k,className:ot("recharts-text",b),textAnchor:u,fill:o.includes("url")?$R:o}),h.map((E,_)=>{var C=E.words.join(x?"":" ");return m.createElement("tspan",{x:w,dy:_===0?S:a,key:"".concat(C,"-").concat(_)},C)}))});nk.displayName="Text";function A5(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?A5(Object(n),!0).forEach(function(r){lhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lhe(e,t,n){return(t=che(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function che(e){var t=uhe(e,"string");return typeof t=="symbol"?t:t+""}function uhe(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 dhe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:s,height:o,upperWidth:c,lowerWidth:u}=q1(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,b=y*r,x=y>0?"end":"start",v=y>0?"start":"end",w=c>=0?1:-1,k=w*r,S=w>0?"end":"start",j=w>0?"start":"end",N=i;if(n==="top"){var P={x:d+c/2,y:s-b,horizontalAnchor:"middle",verticalAnchor:x};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+b,horizontalAnchor:"middle",verticalAnchor:v};return N&&(T.height=Math.max(N.y+N.height-(s+o),0),T.width=u),T}if(n==="left"){var E={x:h-k,y:s+o/2,horizontalAnchor:S,verticalAnchor:"middle"};return N&&(E.width=Math.max(E.x-N.x,0),E.height=o),E}if(n==="right"){var _={x:h+p+k,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+k,y:s+o/2,horizontalAnchor:j,verticalAnchor:"middle"},C):n==="insideRight"?vi({x:h+p-k,y:s+o/2,horizontalAnchor:S,verticalAnchor:"middle"},C):n==="insideTop"?vi({x:d+c/2,y:s+b,horizontalAnchor:"middle",verticalAnchor:v},C):n==="insideBottom"?vi({x:f+u/2,y:s+o-b,horizontalAnchor:"middle",verticalAnchor:x},C):n==="insideTopLeft"?vi({x:d+k,y:s+b,horizontalAnchor:j,verticalAnchor:v},C):n==="insideTopRight"?vi({x:d+c-k,y:s+b,horizontalAnchor:S,verticalAnchor:v},C):n==="insideBottomLeft"?vi({x:f+k,y:s+o-b,horizontalAnchor:j,verticalAnchor:x},C):n==="insideBottomRight"?vi({x:f+u-k,y:s+o-b,horizontalAnchor:S,verticalAnchor:x},C):n&&typeof n=="object"&&(Ae(n.x)||xo(n.x))&&(Ae(n.y)||xo(n.y))?vi({x:a+fs(n.x,p),y:s+fs(n.y,o),horizontalAnchor:"end",verticalAnchor:"end"},C):vi({x:g,y:s+o/2,horizontalAnchor:"middle",verticalAnchor:"middle"},C)},fhe=["labelRef"],hhe=["content"];function T5(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}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 nu(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){mhe(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 mhe(e,t,n){return(t=ghe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ghe(e){var t=yhe(e,"string");return typeof t=="symbol"?t:t+""}function yhe(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 Gi(){return Gi=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},Gi.apply(null,arguments)}var BR=m.createContext(null),xhe=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(BR.Provider,{value:c},o)},UR=()=>{var e=m.useContext(BR),t=dg();return e||(t?q1(t):void 0)},vhe=m.createContext(null),bhe=()=>{var e=m.useContext(vhe),t=De(L3);return e||t},whe=e=>{var{value:t,formatter:n}=e,r=kn(e.children)?t:e.children;return typeof n=="function"?n(r):r},rk=e=>e!=null&&typeof e=="function",She=(e,t)=>{var n=$r(t-e),r=Math.min(Math.abs(t-e),360);return n*r},khe=(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=She(f,h),b=y>=0?1:-1,x,v;switch(t){case"insideStart":x=f+b*a,v=p;break;case"insideEnd":x=h-b*a,v=!p;break;case"end":x=h+b*a,v=p;break;default:throw new Error("Unsupported position ".concat(t))}v=y<=0?v:!v;var w=vn(o,c,g,x),k=vn(o,c,g,x+(v?1:-1)*359),S="M".concat(w.x,",").concat(w.y,`
|
|
740
|
+
A`).concat(g,",").concat(g,",0,1,").concat(v?0:1,`,
|
|
741
|
+
`).concat(k.x,",").concat(k.y),j=kn(e.id)?Qu("recharts-radial-line-"):e.id;return m.createElement("text",Gi({},r,{dominantBaseline:"central",className:ot("recharts-radial-bar-label",s)}),m.createElement("defs",null,m.createElement("path",{id:j,d:S})),m.createElement("textPath",{xlinkHref:"#".concat(j)},n))},jhe=(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}=vn(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}=vn(r,i,h,u);return{x:p,y:g,textAnchor:"middle",verticalAnchor:"middle"}},kh=e=>e!=null&&"cx"in e&&Ae(e.cx),Nhe={angle:0,offset:5,zIndex:Bn.label,position:"middle",textBreakAll:!1};function Che(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 $a(e){var t=lr(e,Nhe),{viewBox:n,parentViewBox:r,position:i,value:a,children:s,content:o,className:c="",textBreakAll:u,labelRef:d}=t,f=bhe(),h=UR(),p=i==="center"?h:f??h,g,y,b;n==null?g=p:kh(n)?g=n:g=q1(n);var x=Che(g);if(!g||kn(a)&&kn(s)&&!m.isValidElement(o)&&typeof o!="function")return null;var v=nu(nu({},t),{},{viewBox:g});if(m.isValidElement(o)){var{labelRef:w}=v,k=T5(v,fhe);return m.cloneElement(o,k)}if(typeof o=="function"){var{content:S}=v,j=T5(v,hhe);if(y=m.createElement(o,j),m.isValidElement(y))return y}else y=whe(t);var N=jr(t);if(kh(g)){if(i==="insideStart"||i==="insideEnd"||i==="end")return khe(t,i,y,N,g);b=jhe(g,t.offset,t.position)}else{if(!x)return null;var P=dhe({viewBox:x,position:i,offset:t.offset,parentViewBox:kh(r)?void 0:r});b=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(Ea,{zIndex:t.zIndex},m.createElement(nk,Gi({ref:d,className:ot("recharts-label",c)},N,b,{textAnchor:RR(N.textAnchor)?N.textAnchor:b.textAnchor,breakAll:u}),y))}$a.displayName="Label";var Phe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?m.createElement($a,Gi({key:"label-implicit"},r)):Li(e)?m.createElement($a,Gi({key:"label-implicit",value:e},r)):m.isValidElement(e)?e.type===$a?m.cloneElement(e,nu({key:"label-implicit"},r)):m.createElement($a,Gi({key:"label-implicit",content:e},r)):rk(e)?m.createElement($a,Gi({key:"label-implicit",content:e},r)):e&&typeof e=="object"?m.createElement($a,Gi({},e,{key:"label-implicit"},r)):null};function Ehe(e){var{label:t,labelRef:n}=e,r=UR();return Phe(t,r,n)||null}var Ahe=["valueAccessor"],The=["dataKey","clockWise","id","textBreakAll","zIndex"];function Jp(){return Jp=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},Jp.apply(null,arguments)}function _5(e,t){if(e==null)return{};var n,r,i=Ohe(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 Ohe(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 _he=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(rhe(t))return t},VR=m.createContext(void 0),Dhe=VR.Provider,WR=m.createContext(void 0);WR.Provider;function Mhe(){return m.useContext(VR)}function Ihe(){return m.useContext(WR)}function jh(e){var{valueAccessor:t=_he}=e,n=_5(e,Ahe),{dataKey:r,clockWise:i,id:a,textBreakAll:s,zIndex:o}=n,c=_5(n,The),u=Mhe(),d=Ihe(),f=u||d;return!f||!f.length?null:m.createElement(Ea,{zIndex:o??Bn.label},m.createElement(Mi,{className:"recharts-label-list"},f.map((h,p)=>{var g,y=kn(r)?t(h,p):wn(h.payload,r),b=kn(a)?{}:{id:"".concat(a,"-").concat(p)};return m.createElement($a,Jp({key:"label-".concat(p)},jr(h),c,b,{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 Lhe(e){var{label:t}=e;return t?t===!0?m.createElement(jh,{key:"labelList-implicit"}):m.isValidElement(t)||rk(t)?m.createElement(jh,{key:"labelList-implicit",content:t}):typeof t=="object"?m.createElement(jh,Jp({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}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)}var HR=e=>{var{cx:t,cy:n,r,className:i}=e,a=ot("recharts-dot",i);return Ae(t)&&Ae(n)&&Ae(r)?m.createElement("circle",qv({},di(e),P1(e),{className:a,cx:t,cy:n,r})):null},Rhe={radiusAxis:{},angleAxis:{}},KR=Rn({name:"polarAxis",initialState:Rhe,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:nye,removeRadiusAxis:rye,addAngleAxis:iye,removeAngleAxis:aye}=KR.actions,Fhe=KR.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 $he(e){var{tooltipEntrySettings:t}=e,n=Bt(),r=cr(),i=m.useRef(null);return m.useLayoutEffect(()=>{r||(i.current===null?n(xue(t)):i.current!==t&&n(vue({prev:i.current,next:t})),i.current=t)},[t,n,r]),m.useLayoutEffect(()=>()=>{i.current&&(n(bue(i.current)),i.current=null)},[n]),null}function Bhe(e){var{legendPayload:t}=e,n=Bt(),r=cr(),i=m.useRef(null);return m.useLayoutEffect(()=>{r||(i.current===null?n(iie(t)):i.current!==t&&n(aie({prev:i.current,next:t})),i.current=t)},[n,r,t]),m.useLayoutEffect(()=>()=>{i.current&&(n(sie(i.current)),i.current=null)},[n]),null}var by,Uhe=()=>{var[e]=m.useState(()=>Qu("uid-"));return e},Vhe=(by=SA.useId)!==null&&by!==void 0?by:Uhe;function Whe(e,t){var n=Vhe();return t||(e?"".concat(e,"-").concat(n):n)}var Hhe=m.createContext(void 0),Khe=e=>{var{id:t,type:n,children:r}=e,i=Whe("recharts-".concat(n),t);return m.createElement(Hhe.Provider,{value:i},r(i))},Ghe={cartesianItems:[],polarItems:[]},qR=Rn({name:"graphicalItems",initialState:Ghe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:wt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Br(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:wt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Br(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:wt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:wt()},removePolarGraphicalItem:{reducer(e,t){var n=Br(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:wt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Br(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:wt()}}}),{addCartesianGraphicalItem:qhe,replaceCartesianGraphicalItem:Yhe,removeCartesianGraphicalItem:Xhe,addPolarGraphicalItem:sye,removePolarGraphicalItem:oye,replacePolarGraphicalItem:lye}=qR.actions,Zhe=qR.reducer,Qhe=e=>{var t=Bt(),n=m.useRef(null);return m.useLayoutEffect(()=>{n.current===null?t(qhe(e)):n.current!==e&&t(Yhe({prev:n.current,next:e})),n.current=e},[t,e]),m.useLayoutEffect(()=>()=>{n.current&&(t(Xhe(n.current)),n.current=null)},[t]),null},Jhe=m.memo(Qhe),epe=["points"];function D5(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 wy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D5(Object(n),!0).forEach(function(r){tpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tpe(e,t,n){return(t=npe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function npe(e){var t=rpe(e,"string");return typeof t=="symbol"?t:t+""}function rpe(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 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 ipe(e,t){if(e==null)return{};var n,r,i=ape(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 ape(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 spe(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=ot(r,typeof t!="boolean"?t.className:""),a=n??{},{points:s}=a,o=ipe(a,epe);return m.createElement(HR,em({},o,{className:i}))}function ope(e,t){return e==null?!1:t?!0:e.length===1}function lpe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:s,needClip:o,clipPathId:c,zIndex:u=Bn.scatter}=e;if(!ope(t,n))return null;var d=GR(n),f=aee(n),h=t.map((g,y)=>{var b,x,v=wy(wy(wy({r:3},s),f),{},{index:y,cx:(b=g.x)!==null&&b!==void 0?b:void 0,cy:(x=g.y)!==null&&x!==void 0?x:void 0,dataKey:a,value:g.value,payload:g.payload,points:t});return m.createElement(spe,{key:"dot-".concat(y),option:n,dotProps:v,className:i})}),p={};return o&&c!=null&&(p.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),m.createElement(Ea,{zIndex:u},m.createElement(Mi,em({className:r},p),h))}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 I5(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){cpe(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 cpe(e,t,n){return(t=upe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function upe(e){var t=dpe(e,"string");return typeof t=="symbol"?t:t+""}function dpe(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 YR=0,fpe={xAxis:{},yAxis:{},zAxis:{}},XR=Rn({name:"cartesianAxis",initialState:fpe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:wt()},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:wt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:wt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:wt()},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:wt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:wt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:wt()},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:wt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:wt()},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]=I5(I5({},i),{},{width:r,widthHistory:o})}}}}),{addXAxis:hpe,replaceXAxis:ppe,removeXAxis:mpe,addYAxis:gpe,replaceYAxis:ype,removeYAxis:xpe,addZAxis:cye,replaceZAxis:uye,removeZAxis:dye,updateYAxisWidth:vpe}=XR.actions,bpe=XR.reducer,wpe=q([jn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Spe=q([wpe,wa,Sa],(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)}}),ik=()=>De(Spe),kpe=()=>De(xde);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 Sy(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){jpe(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 jpe(e,t,n){return(t=Npe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Npe(e){var t=Cpe(e,"string");return typeof t=="symbol"?t:t+""}function Cpe(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 Ppe=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=Sy(Sy(Sy({},o),Bm(i)),P1(i)),u;return m.isValidElement(i)?u=m.cloneElement(i,c):typeof i=="function"?u=i(c):u=m.createElement(HR,c),m.createElement(Mi,{className:"recharts-active-dot",clipPath:s},u)};function R5(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:s=Bn.activeDot}=e,o=De(dd),c=kpe();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return kn(u)?null:m.createElement(Ea,{zIndex:s},m.createElement(Ppe,{point:u,childIndex:Number(o),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var Epe=e=>{var{chartData:t}=e,n=Bt(),r=cr();return m.useEffect(()=>r?()=>{}:(n(p5(t)),()=>{n(p5(void 0))}),[t,n,r]),null},F5={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},ZR=Rn({name:"brush",initialState:F5,reducers:{setBrushSettings(e,t){return t.payload==null?F5:t.payload}}}),{setBrushSettings:fye}=ZR.actions,Ape=ZR.reducer;function Tpe(e){return(e%180+180)%180}var Ope=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Tpe(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)},_pe={dots:[],areas:[],lines:[]},QR=Rn({name:"referenceElements",initialState:_pe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Br(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=Br(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=Br(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:hye,removeDot:pye,addArea:mye,removeArea:gye,addLine:yye,removeLine:xye}=QR.actions,Dpe=QR.reducer,Mpe=m.createContext(void 0),Ipe=e=>{var{children:t}=e,[n]=m.useState("".concat(Qu("recharts"),"-clip")),r=ik();if(r==null)return null;var{x:i,y:a,width:s,height:o}=r;return m.createElement(Mpe.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 JR(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 Lpe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Ope(r,n)}function Rpe(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 hd(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 Fpe(e,t){return JR(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:JR(r,u)};var y=c,b,x=()=>(b===void 0&&(b=n(g,y)),b),v=g.coordinate,w=c===0||hd(e,v,x,d,o);w||(c=0,d=s,u+=1),w&&(d=v+e*(x()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function $pe(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 k=r[y];if(k==null)return 0;var S=y,j,N=()=>(j===void 0&&(j=n(k,S)),j),P=k.coordinate,T=y===d||hd(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 b=[],x=d;x<s;x+=u){var v=r[x];v!=null&&b.push(v)}return b}}return[]}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 En(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){Bpe(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 Bpe(e,t,n){return(t=Upe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Upe(e){var t=Vpe(e,"string");return typeof t=="symbol"?t:t+""}function Vpe(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 Wpe(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,b=()=>(y===void 0&&(y=n(p,h)),y);if(h===s-1){var x=e*(g.coordinate+e*b()/2-c);a[h]=g=En(En({},g),{},{tickCoord:x>0?g.coordinate-x*e:g.coordinate})}else a[h]=g=En(En({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var v=hd(e,g.tickCoord,b,o,c);v&&(c=g.tickCoord-e*(b()/2+i),a[h]=En(En({},g),{},{isShow:!0}))}},d=s-1;d>=0;d--)u(d);return a}function Hpe(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=En(En({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=hd(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+i),s[o-1]=En(En({},d),{},{isShow:!0}))}}}for(var g=a?o-1:o,y=function(v){var w=s[v];if(w==null)return 1;var k=w,S,j=()=>(S===void 0&&(S=n(w,v)),S);if(v===0){var N=e*(k.coordinate-e*j()/2-c);s[v]=k=En(En({},k),{},{tickCoord:N<0?k.coordinate-N*e:k.coordinate})}else s[v]=k=En(En({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var P=hd(e,k.tickCoord,j,c,u);P&&(c=k.tickCoord+e*(j()/2+i),s[v]=En(En({},k),{},{isShow:!0}))}},b=0;b<g;b++)y(b);return s}function ak(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(Ae(c)||Bd.isSsr){var h;return(h=Fpe(i,Ae(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],g=o==="top"||o==="bottom"?"width":"height",y=d&&g==="width"?vu(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=(S,j)=>{var N=typeof u=="function"?u(S.value,j):S.value;return g==="width"?Lpe(vu(N,{fontSize:t,letterSpacing:n}),y,f):vu(N,{fontSize:t,letterSpacing:n})[g]},x=i[0],v=i[1],w=i.length>=2&&x!=null&&v!=null?$r(v.coordinate-x.coordinate):1,k=Rpe(a,w,g);return c==="equidistantPreserveStart"?zpe(w,k,b,i,s):c==="equidistantPreserveEnd"?$pe(w,k,b,i,s):(c==="preserveStart"||c==="preserveStartEnd"?p=Hpe(w,k,b,i,s,c==="preserveStartEnd"):p=Wpe(w,k,b,i,s),p.filter(S=>S.isShow))}var Kpe=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},Gpe={xAxis:{},yAxis:{}},e6=Rn({name:"renderedTicks",initialState:Gpe,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:qpe,removeRenderedTicks:Ype}=e6.actions,Xpe=e6.reducer,Zpe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Qpe(e,t){if(e==null)return{};var n,r,i=Jpe(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 Jpe(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 $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 Rt(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){eme(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 eme(e,t,n){return(t=tme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tme(e){var t=nme(e,"string");return typeof t=="symbol"?t:t+""}function nme(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:Bn.axis};function rme(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=Rt(Rt(Rt({},c),di(o)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!s||a==="bottom"&&s);u=Rt(Rt({},u),{},{x1:t,y1:n+d*i,x2:t+r,y2:n+d*i})}else{var f=+(a==="left"&&!s||a==="right"&&s);u=Rt(Rt({},u),{},{x1:t+f*r,y1:n,x2:t+f*r,y2:n+i})}return m.createElement("line",ko({},u,{className:ot("recharts-cartesian-axis-line",qm(o,"className"))}))}function ime(e,t,n,r,i,a,s,o,c){var u,d,f,h,p,g,y=o?-1:1,b=e.tickSize||s,x=Ae(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=n+ +!o*i,f=h-y*b,g=f-y*c,p=x;break;case"left":f=h=e.coordinate,d=t+ +!o*r,u=d-y*b,p=u-y*c,g=x;break;case"right":f=h=e.coordinate,d=t+ +o*r,u=d+y*b,p=u+y*c,g=x;break;default:u=d=e.coordinate,h=n+ +o*i,f=h+y*b,g=f+y*c,p=x;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:g}}}function ame(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function sme(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function ome(e){var{option:t,tickProps:n,value:r}=e,i,a=ot(n.className,"recharts-cartesian-axis-tick-value");if(m.isValidElement(t))i=m.cloneElement(t,Rt(Rt({},n),{},{className:a}));else if(typeof t=="function")i=t(Rt(Rt({},n),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=ot(s,zhe(t))),i=m.createElement(nk,ko({},n,{className:s}),r)}return i}function lme(e){var{ticks:t,axisType:n,axisId:r}=e,i=Bt();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(qpe({ticks:a,axisId:r,axisType:n})),()=>{i(Ype({axisId:r,axisType:n}))}},[i,t,r,n]),null}var cme=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:b,tickMargin:x,fontSize:v,letterSpacing:w,getTicksConfig:k,events:S,axisType:j,axisId:N}=e,P=ak(Rt(Rt({},k),{},{ticks:n}),v,w),T=di(k),E=Bm(r),_=RR(T.textAnchor)?T.textAnchor:ame(d,f),C=sme(d,f),A={};typeof i=="object"&&(A=i);var I=Rt(Rt({},T),{},{fill:"none"},A),$=P.map(M=>Rt({entry:M},ime(M,h,p,g,y,d,b,f,x))),oe=$.map(M=>{var{entry:K,line:O}=M;return m.createElement(Mi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(K.value,"-").concat(K.coordinate,"-").concat(K.tickCoord)},i&&m.createElement("line",ko({},I,O,{className:ot("recharts-cartesian-axis-tick-line",qm(i,"className"))})))}),Z=$.map((M,K)=>{var O,ie,{entry:J,tick:D}=M,H=Rt(Rt(Rt(Rt({verticalAnchor:C},T),{},{textAnchor:_,stroke:"none",fill:a},D),{},{index:K,payload:J,visibleTicksCount:P.length,tickFormatter:s,padding:c},u),{},{angle:(O=(ie=u==null?void 0:u.angle)!==null&&ie!==void 0?ie:T.angle)!==null&&O!==void 0?O:0}),ee=Rt(Rt({},H),E);return m.createElement(Mi,ko({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(J.value,"-").concat(J.coordinate,"-").concat(J.tickCoord)},AM(S,J,K)),r&&m.createElement(ome,{option:r,tickProps:ee,value:"".concat(typeof s=="function"?s(J.value,K):J.value).concat(o||"")}))});return m.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(j,"-ticks")},m.createElement(lme,{ticks:P,axisId:N,axisType:j}),Z.length>0&&m.createElement(Ea,{zIndex:Bn.label},m.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(j,"-tick-labels"),ref:t},Z)),oe.length>0&&m.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(j,"-tick-lines")},oe))}),ume=m.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:s,ticks:o,axisType:c,axisId:u}=e,d=Qpe(e,Zpe),[f,h]=m.useState(""),[p,g]=m.useState(""),y=m.useRef(null);m.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return Kpe({ticks:y.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var b=m.useCallback(x=>{if(x){var v=x.getElementsByClassName("recharts-cartesian-axis-tick-value");y.current=v;var w=v[0];if(w){var k=window.getComputedStyle(w),S=k.fontSize,j=k.letterSpacing;(S!==f||j!==p)&&(h(S),g(j))}}},[f,p]);return s||r!=null&&r<=0||i!=null&&i<=0?null:m.createElement(Ea,{zIndex:e.zIndex},m.createElement(Mi,{className:ot("recharts-cartesian-axis",a)},m.createElement(rme,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:di(e)}),m.createElement(cme,{ref:b,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(xhe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},m.createElement(Ehe,{label:e.label,labelRef:e.labelRef}),e.children)))}),sk=m.forwardRef((e,t)=>{var n=lr(e,aa);return m.createElement(ume,ko({},n,{ref:t}))});sk.displayName="CartesianAxis";var dme=["x1","y1","x2","y2","key"],fme=["offset"],hme=["xAxisId","yAxisId"],pme=["xAxisId","yAxisId"];function B5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B5(Object(n),!0).forEach(function(r){mme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mme(e,t,n){return(t=gme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gme(e){var t=yme(e,"string");return typeof t=="symbol"?t:t+""}function yme(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 tm(e,t){if(e==null)return{};var n,r,i=xme(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 xme(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 vme=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 t6(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=tm(n,dme),f=(i=di(d))!==null&&i!==void 0?i:{},{offset:h}=f,p=tm(f,fme);r=m.createElement("line",Qs({},p,{x1:a,y1:s,x2:o,y2:c,fill:"none",key:u}))}return r}function bme(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=tm(e,hme),c=i.map((u,d)=>{var f=Tn(Tn({},o),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return m.createElement(t6,{key:"line-".concat(d),option:r,lineItemProps:f})});return m.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function wme(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=tm(e,pme),c=i.map((u,d)=>{var f=Tn(Tn({},o),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return m.createElement(t6,{option:r,lineItemProps:f,key:"line-".concat(d)})});return m.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function Sme(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 b=h%t.length;return m.createElement("rect",{key:"react-".concat(h),y:f,x:r,height:y,width:a,stroke:"none",fill:t[b],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return m.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function kme(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 b=h%n.length;return m.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:y,height:o,stroke:"none",fill:n[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return m.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var jme=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return FI(ak(Tn(Tn(Tn({},aa),n),{},{ticks:zI(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Nme=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return FI(ak(Tn(Tn(Tn({},aa),n),{},{ticks:zI(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Cme={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Bn.grid};function _g(e){var t=Y1(),n=X1(),r=YI(),i=Tn(Tn({},lr(e,Cme)),{},{x:Ae(e.x)?e.x:r.left,y:Ae(e.y)?e.y:r.top,width:Ae(e.width)?e.width:r.width,height:Ae(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=cr(),y=De(T=>n5(T,"xAxis",a,g)),b=De(T=>n5(T,"yAxis",s,g));if(!Ri(u)||!Ri(d)||!Ae(o)||!Ae(c))return null;var x=i.verticalCoordinatesGenerator||jme,v=i.horizontalCoordinatesGenerator||Nme,{horizontalPoints:w,verticalPoints:k}=i;if((!w||!w.length)&&typeof v=="function"){var S=h&&h.length,j=v({yAxis:b?Tn(Tn({},b),{},{ticks:S?h:b.ticks}):void 0,width:t??u,height:n??d,offset:r},S?!0:f);Ep(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(w=j)}if((!k||!k.length)&&typeof x=="function"){var N=p&&p.length,P=x({xAxis:y?Tn(Tn({},y),{},{ticks:N?p:y.ticks}):void 0,width:t??u,height:n??d,offset:r},N?!0:f);Ep(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(k=P)}return m.createElement(Ea,{zIndex:i.zIndex},m.createElement("g",{className:"recharts-cartesian-grid"},m.createElement(vme,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),m.createElement(Sme,Qs({},i,{horizontalPoints:w})),m.createElement(kme,Qs({},i,{verticalPoints:k})),m.createElement(bme,Qs({},i,{offset:r,horizontalPoints:w,xAxis:y,yAxis:b})),m.createElement(wme,Qs({},i,{offset:r,verticalPoints:k,xAxis:y,yAxis:b}))))}_g.displayName="CartesianGrid";var Pme={},n6=Rn({name:"errorBars",initialState:Pme,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:vye,replaceErrorBar:bye,removeErrorBar:wye}=n6.actions,Eme=n6.reducer;function r6(e,t){var n,r,i=De(u=>Na(u,e)),a=De(u=>Ca(u,t)),s=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Zt.allowDataOverflow,o=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:Qt.allowDataOverflow,c=s||o;return{needClip:c,needClipX:s,needClipY:o}}function Ame(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=ik(),{needClipX:a,needClipY:s,needClip:o}=r6(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 Tme(e){var t=Bm(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 ok(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:YR}function lk(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:YR}var i6=(e,t,n)=>tR(e,"xAxis",ok(e,t),n),a6=(e,t,n)=>eR(e,"xAxis",ok(e,t),n),s6=(e,t,n)=>tR(e,"yAxis",lk(e,t),n),o6=(e,t,n)=>eR(e,"yAxis",lk(e,t),n),Ome=q([Tt,i6,s6,a6,o6],(e,t,n,r,i)=>Ui(e,"xAxis")?Pp(t,r,!1):Pp(n,i,!1)),_me=(e,t)=>t,l6=q([kL,_me],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),c6=e=>{var t=Tt(e),n=Ui(t,"xAxis");return n?"yAxis":"xAxis"},Dme=(e,t)=>{var n=c6(e);return n==="yAxis"?lk(e,t):ok(e,t)},Mme=(e,t,n)=>_L(e,c6(e),Dme(e,t),n),Ime=q([l6,Mme],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=cS(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]])}}}),Lme=q([Tt,i6,s6,a6,o6,Ime,yse,Ome,l6,jse],(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 nge({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:g,chartBaseValue:u,bandSize:o})}}),Rme=["id"],Fme=["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 u6(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 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 hl(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){$me(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 $me(e,t,n){return(t=Bme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bme(e){var t=Ume(e,"string");return typeof t=="symbol"?t:t+""}function Ume(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 nm(e,t){return e&&e!=="none"?e:t}var Vme=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:s}=e;return[{inactive:s,dataKey:t,type:a,color:nm(r,i),value:$I(n,t),payload:e}]},Wme=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:$I(s,t),hide:o,type:u,color:nm(r,a),unit:c,graphicalItemId:d}};return m.createElement($he,{tooltipEntrySettings:f})});function Hme(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:s}=r,o=di(r);return m.createElement(lpe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:s,baseProps:o,needClip:i,clipPathId:t})}function Kme(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(Dhe,{value:t?i:void 0},n)}function V5(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=u6(a,Rme),p=di(h),g=jr(h);return m.createElement(m.Fragment,null,(t==null?void 0:t.length)>1&&m.createElement(Mi,{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(Hme,{points:t,props:h,clipPathId:i}))}function Gme(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(!qe(o)||!qe(c))return null;var u=r*Math.abs(o-c),d=Math.max(...a.map(f=>f.x||0));return Ae(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.x||0),d)),Ae(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 qme(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(!qe(o)||!qe(c))return null;var u=r*Math.abs(o-c),d=Math.max(...a.map(f=>f.y||0));return Ae(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.y||0),d)),Ae(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 Yme(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?m.createElement(Gme,{alpha:t,points:r,baseLine:i,strokeWidth:a}):m.createElement(qme,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Xme(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=u3(g,"recharts-area-"),b=Z1(),[x,v]=m.useState(!1),w=!x,k=m.useCallback(()=>{typeof p=="function"&&p(),v(!1)},[p]),S=m.useCallback(()=>{typeof h=="function"&&h(),v(!0)},[h]);if(b==null)return null;var j=i.current,N=a.current;return m.createElement(Kme,{showLabels:w,points:s},r.children,m.createElement(c3,{animationId:y,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:k,onAnimationStart:S,key:y},P=>{if(j){var T=j.length/s.length,E=P===1?s:s.map((C,A)=>{var I=Math.floor(A*T);if(j[I]){var $=j[I];return hl(hl({},C),{},{x:ki($.x,C.x,P),y:ki($.y,C.y,P)})}return C}),_;return Ae(o)?_=ki(N,o,P):kn(o)||Ii(o)?_=ki(N,0,P):_=o.map((C,A)=>{var I=Math.floor(A*T);if(Array.isArray(N)&&N[I]){var $=N[I];return hl(hl({},C),{},{x:ki($.x,C.x,P),y:ki($.y,C.y,P)})}return C}),P>0&&(i.current=E,a.current=_),m.createElement(V5,{points:E,baseLine:_,needClip:t,clipPathId:n,props:r})}return P>0&&(i.current=s,a.current=o),m.createElement(Mi,null,c&&m.createElement("defs",null,m.createElement("clipPath",{id:"animationClipPath-".concat(n)},m.createElement(Yme,{alpha:P,points:s,baseLine:o,layout:b,strokeWidth:r.strokeWidth}))),m.createElement(Mi,{clipPath:"url(#animationClipPath-".concat(n,")")},m.createElement(V5,{points:s,baseLine:o,needClip:t,clipPathId:n,props:r})))}),m.createElement(Lhe,{label:r.label}))}function Zme(e){var{needClip:t,clipPathId:n,props:r}=e,i=m.useRef(null),a=m.useRef();return m.createElement(Xme,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class Qme 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=ot("recharts-area",i),b=h,{r:x,strokeWidth:v}=Tme(n),w=GR(n),k=x*2+v,S=o?"url(#clipPath-".concat(w?"":"dots-").concat(b,")"):void 0;return m.createElement(Ea,{zIndex:g},m.createElement(Mi,{className:y},o&&m.createElement("defs",null,m.createElement(Ame,{clipPathId:b,xAxisId:c,yAxisId:u}),!w&&m.createElement("clipPath",{id:"clipPath-dots-".concat(b)},m.createElement("rect",{x:s-k/2,y:a-k/2,width:d+k,height:f+k}))),m.createElement(Zme,{needClip:o,clipPathId:b,props:this.props})),m.createElement(R5,{points:r,mainColor:nm(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(p)&&m.createElement(R5,{points:p,mainColor:nm(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}}var Jme={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:Bn.area};function ege(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,b=u6(e,Fme),x=ac(),v=kR(),{needClip:w}=r6(g,y),k=cr(),{points:S,isRange:j,baseLine:N}=(t=De(A=>Lme(A,e.id,k)))!==null&&t!==void 0?t:{},P=ik();if(x!=="horizontal"&&x!=="vertical"||P==null||v!=="AreaChart"&&v!=="ComposedChart")return null;var{height:T,width:E,x:_,y:C}=P;return!S||!S.length?null:m.createElement(Qme,so({},b,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:N,connectNulls:s,dot:o,fill:c,fillOpacity:u,height:T,hide:d,layout:x,isAnimationActive:f,isRange:j,legendType:h,needClip:w,points:S,stroke:p,width:E,left:_,top:C,xAxisId:g,yAxisId:y}))}var tge=(e,t,n,r,i)=>{var a=n??t;if(Ae(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 nge(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=tge(a,s,n,o,c),b=a==="horizontal",x=!1,v=u.map((k,S)=>{var j,N,P,T;if(g)T=i[d+S];else{var E=wn(k,r);Array.isArray(E)?(T=E,x=!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&&wn(k,r)==null;if(b){var A;return{x:sP({axis:o,ticks:f,bandSize:p,entry:k,index:S}),y:C?null:(A=c.scale.map(_))!==null&&A!==void 0?A:null,value:T,payload:k}}return{x:C?null:(P=o.scale.map(_))!==null&&P!==void 0?P:null,y:sP({axis:c,ticks:h,bandSize:p,entry:k,index:S}),value:T,payload:k}}),w;return g||x?w=v.map(k=>{var S,j=Array.isArray(k.value)?k.value[0]:null;if(b){var N;return{x:k.x,y:j!=null&&k.y!=null&&(N=c.scale.map(j))!==null&&N!==void 0?N:null,payload:k.payload}}return{x:j!=null&&(S=o.scale.map(j))!==null&&S!==void 0?S:null,y:k.y,payload:k.payload}}):w=b?c.scale.map(y):o.scale.map(y),{points:v,baseLine:w??0,isRange:x}}function rge(e){var t=lr(e,Jme),n=cr();return m.createElement(Khe,{id:t.id,type:"area"},r=>m.createElement(m.Fragment,null,m.createElement(Bhe,{legendPayload:Vme(t)}),m.createElement(Wme,{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(Jhe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:ure(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),m.createElement(ege,so({},t,{id:r}))))}var is=m.memo(rge,$d);is.displayName="Area";var ige=["domain","range"],age=["domain","range"];function W5(e,t){if(e==null)return{};var n,r,i=sge(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 sge(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){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 d6(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=W5(e,ige),{domain:a,range:s}=t,o=W5(t,age);return!H5(n,a)||!H5(r,s)?!1:$d(i,o)}var oge=["type"],lge=["dangerouslySetInnerHTML","ticks","scale"],cge=["id","scale"];function Yv(){return Yv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yv.apply(null,arguments)}function K5(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 G5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K5(Object(n),!0).forEach(function(r){uge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uge(e,t,n){return(t=dge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dge(e){var t=fge(e,"string");return typeof t=="symbol"?t:t+""}function fge(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 Xv(e,t){if(e==null)return{};var n,r,i=hge(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 hge(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 pge(e){var t=Bt(),n=m.useRef(null),r=Z1(),{type:i}=e,a=Xv(e,oge),s=xg(r,"xAxis",i),o=m.useMemo(()=>{if(s!=null)return G5(G5({},a),{},{type:s})},[a,s]);return m.useLayoutEffect(()=>{o!=null&&(n.current===null?t(hpe(o)):n.current!==o&&t(ppe({prev:n.current,next:o})),n.current=o)},[o,t]),m.useLayoutEffect(()=>()=>{n.current&&(t(mpe(n.current)),n.current=null)},[t]),null}var mge=e=>{var{xAxisId:t,className:n}=e,r=De(UI),i=cr(),a="xAxis",s=De(x=>JL(x,a,t,i)),o=De(x=>Jce(x,t)),c=De(x=>aue(x,t)),u=De(x=>vL(x,t));if(o==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Xv(e,lge),{id:g,scale:y}=u,b=Xv(u,cge);return m.createElement(sk,Yv({},p,b,{x:c.x,y:c.y,width:o.width,height:o.height,className:ot("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:s,axisType:a,axisId:t}))},gge={allowDataOverflow:Zt.allowDataOverflow,allowDecimals:Zt.allowDecimals,allowDuplicatedCategory:Zt.allowDuplicatedCategory,angle:Zt.angle,axisLine:aa.axisLine,height:Zt.height,hide:!1,includeHidden:Zt.includeHidden,interval:Zt.interval,label:!1,minTickGap:Zt.minTickGap,mirror:Zt.mirror,orientation:Zt.orientation,padding:Zt.padding,reversed:Zt.reversed,scale:Zt.scale,tick:Zt.tick,tickCount:Zt.tickCount,tickLine:aa.tickLine,tickSize:aa.tickSize,type:Zt.type,niceTicks:Zt.niceTicks,xAxisId:0},yge=e=>{var t=lr(e,gge);return m.createElement(m.Fragment,null,m.createElement(pge,{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(mge,t))},Dg=m.memo(yge,d6);Dg.displayName="XAxis";var xge=["type"],vge=["dangerouslySetInnerHTML","ticks","scale"],bge=["id","scale"];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)}function q5(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 Y5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q5(Object(n),!0).forEach(function(r){wge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wge(e,t,n){return(t=Sge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sge(e){var t=kge(e,"string");return typeof t=="symbol"?t:t+""}function kge(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 Qv(e,t){if(e==null)return{};var n,r,i=jge(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 jge(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 Nge(e){var t=Bt(),n=m.useRef(null),r=Z1(),{type:i}=e,a=Qv(e,xge),s=xg(r,"yAxis",i),o=m.useMemo(()=>{if(s!=null)return Y5(Y5({},a),{},{type:s})},[s,a]);return m.useLayoutEffect(()=>{o!=null&&(n.current===null?t(gpe(o)):n.current!==o&&t(ype({prev:n.current,next:o})),n.current=o)},[o,t]),m.useLayoutEffect(()=>()=>{n.current&&(t(xpe(n.current)),n.current=null)},[t]),null}function Cge(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=m.useRef(null),s=m.useRef(null),o=De(UI),c=cr(),u=Bt(),d="yAxis",f=De(j=>lue(j,t)),h=De(j=>oue(j,t)),p=De(j=>JL(j,d,t,c)),g=De(j=>bL(j,t));if(m.useLayoutEffect(()=>{if(!(r!=="auto"||!f||rk(i)||m.isValidElement(i)||g==null)){var j=a.current;if(j){var N=j.getCalculatedWidth();Math.round(f.width)!==Math.round(N)&&u(vpe({id:t,width:N}))}}},[p,f,u,i,t,r,g]),f==null||h==null||g==null)return null;var{dangerouslySetInnerHTML:y,ticks:b,scale:x}=e,v=Qv(e,vge),{id:w,scale:k}=g,S=Qv(g,bge);return m.createElement(sk,Zv({},v,S,{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:ot("recharts-".concat(d," ").concat(d),n),viewBox:o,ticks:p,axisType:d,axisId:t}))}var Pge={allowDataOverflow:Qt.allowDataOverflow,allowDecimals:Qt.allowDecimals,allowDuplicatedCategory:Qt.allowDuplicatedCategory,angle:Qt.angle,axisLine:aa.axisLine,hide:!1,includeHidden:Qt.includeHidden,interval:Qt.interval,label:!1,minTickGap:Qt.minTickGap,mirror:Qt.mirror,orientation:Qt.orientation,padding:Qt.padding,reversed:Qt.reversed,scale:Qt.scale,tick:Qt.tick,tickCount:Qt.tickCount,tickLine:aa.tickLine,tickSize:aa.tickSize,type:Qt.type,niceTicks:Qt.niceTicks,width:Qt.width,yAxisId:0},Ege=e=>{var t=lr(e,Pge);return m.createElement(m.Fragment,null,m.createElement(Nge,{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(Cge,t))},Mg=m.memo(Ege,d6);Mg.displayName="YAxis";var Age=(e,t)=>t,ck=q([Age,Tt,L3,dn,yR,Pa,Tde,jn],Rde);function Tge(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function uk(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Tge(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 f6=Nr("mouseClick"),h6=Id();h6.startListening({actionCreator:f6,effect:(e,t)=>{var n=e.payload,r=ck(t.getState(),uk(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(kue({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Jv=Nr("mouseMove"),p6=Id(),Vo=null,Ts=null,ky=null;p6.startListening({actionCreator:Jv,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),ky=uk(n);var o=()=>{var c=t.getState(),u=HS(c,c.tooltip.settings.shared);if(!ky){Vo=null,Ts=null;return}if(u==="axis"){var d=ck(c,ky);(d==null?void 0:d.activeIndex)!=null?t.dispatch(lR({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(oR())}Vo=null,Ts=null};if(!s){o();return}i==="raf"?Vo=requestAnimationFrame(o):typeof i=="number"&&Ts===null&&(Ts=setTimeout(o,i))}});function Oge(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 X5={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},m6=Rn({name:"rootProps",initialState:X5,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:X5.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}}}),_ge=m6.reducer,{updateOptions:Dge}=m6.actions,Mge=null,Ige={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)},g6=Rn({name:"polarOptions",initialState:Mge,reducers:Ige}),{updatePolarOptions:Sye}=g6.actions,Lge=g6.reducer,y6=Nr("keyDown"),x6=Nr("focus"),v6=Nr("blur"),Ig=Id(),Wo=null,Os=null,Yf=null;Ig.startListening({actionCreator:y6,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=KS(u,pc(o),Yd(o),Zd(o)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=Pa(o);if(d==="Enter"){var g=Qp(o,"axis","hover",String(u.index));t.dispatch(Zp({active:!u.active,activeIndex:u.index,activeCoordinate:g}));return}var y=hue(o),b=y==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,v=h+x*b;if(p==null||v>=p.length||v<0)return;var w=Qp(o,"axis","hover",String(v));t.dispatch(Zp({active:!0,activeIndex:v.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))}});Ig.startListening({actionCreator:x6,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=Qp(n,"axis","hover",String(a));t.dispatch(Zp({active:!0,activeIndex:a,activeCoordinate:s}))}}}});Ig.startListening({actionCreator:v6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Zp({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function b6(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 Dr=Nr("externalEvent"),w6=Id(),Xf=new Map,Vc=new Map,jy=new Map;w6.startListening({actionCreator:Dr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=b6(r);jy.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 b=jy.get(i);try{if(!b)return;var{handler:x,reactEvent:v}=b,w=t.getState(),k={activeCoordinate:mde(w),activeDataKey:fde(w),activeIndex:dd(w),activeLabel:bR(w),activeTooltipIndex:dd(w),isTooltipActive:gde(w)};x&&x(k,v)}finally{Xf.delete(i),Vc.delete(i),jy.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 Rge=q([fc],e=>e.tooltipItemPayloads),Fge=q([Rge,(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)}}}),S6=Nr("touchMove"),k6=Id(),_s=null,Ma=null,Z5=null,Wc=null;k6.startListening({actionCreator:S6,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Wc=b6(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,s=a==="all"||a.includes("touchmove");_s!==null&&(cancelAnimationFrame(_s),_s=null),Ma!==null&&(typeof i!="number"||!s)&&(clearTimeout(Ma),Ma=null),Z5=Array.from(n.touches).map(c=>uk({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var o=()=>{if(Wc!=null){var c=t.getState(),u=HS(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=Z5)===null||d===void 0?void 0:d[0];if(f==null){_s=null,Ma=null;return}var h=ck(c,f);(h==null?void 0:h.activeIndex)!=null&&t.dispatch(lR({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 b=y.getAttribute(yre),x=(p=y.getAttribute(xre))!==null&&p!==void 0?p:void 0,v=hc(c).find(S=>S.id===x);if(b==null||v==null||x==null)return;var{dataKey:w}=v,k=Fge(c,b,x);t.dispatch(Sue({activeDataKey:w,activeIndex:b,activeCoordinate:k,activeGraphicalItemId:x}))}_s=null,Ma=null}};if(!s){o();return}i==="raf"?_s=requestAnimationFrame(o):typeof i=="number"&&Ma===null&&(o(),Wc=null,Ma=setTimeout(()=>{Wc?o():(Ma=null,_s=null)},i))}}});var j6={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},N6=Rn({name:"eventSettings",initialState:j6,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:zge}=N6.actions,$ge=N6.reducer,Bge=cI({brush:Ape,cartesianAxis:bpe,chartData:pfe,errorBars:Eme,eventSettings:$ge,graphicalItems:Zhe,layout:tre,legend:oie,options:cfe,polarAxis:Fhe,polarOptions:Lge,referenceElements:Dpe,renderedTicks:Xpe,rootProps:_ge,tooltip:jue,zIndex:Zde}),Uge=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Cne({reducer:Bge,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([h6.middleware,p6.middleware,Ig.middleware,w6.middleware,k6.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(jI({type:"raf"}))},devTools:{serialize:{replacer:Oge},name:"recharts-".concat(n)}})};function Vge(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=cr(),a=m.useRef(null);if(i)return n;a.current==null&&(a.current=Uge(t,r));var s=R1;return m.createElement(Aie,{context:s,store:a.current},n)}function Wge(e){var{layout:t,margin:n}=e,r=Bt(),i=cr();return m.useEffect(()=>{i||(r(Qne(t)),r(Zne(n)))},[r,i,t,n]),null}var Hge=m.memo(Wge,$d);function Kge(e){var t=Bt();return m.useEffect(()=>{t(Dge(e))},[t,e]),null}var Gge=e=>{var t=Bt();return m.useEffect(()=>{t(zge(e))},[t,e]),null},qge=m.memo(Gge,$d);function Q5(e){var{zIndex:t,isPanorama:n}=e,r=m.useRef(null),i=Bt();return m.useLayoutEffect(()=>(r.current&&i(Yde({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Xde({zIndex:t,isPanorama:n}))}),[i,t,n]),m.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function J5(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(Q5,{key:s,zIndex:s,isPanorama:n})),t,a.map(s=>m.createElement(Q5,{key:s,zIndex:s,isPanorama:n})))}var Yge=["children"];function Xge(e,t){if(e==null)return{};var n,r,i=Zge(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 Zge(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 rm(){return rm=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},rm.apply(null,arguments)}var Qge={width:"100%",height:"100%",display:"block"},Jge=m.forwardRef((e,t)=>{var n=Y1(),r=X1(),i=a3();if(!Ri(n)||!Ri(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(S1,rm({},s,{title:o,desc:c,role:d,tabIndex:u,width:n,height:r,style:Qge,ref:t}),a)}),e0e=e=>{var{children:t}=e,n=De(ug);if(!n)return null;var{width:r,height:i,y:a,x:s}=n;return m.createElement(S1,{width:r,height:i,x:s,y:a},t)},eA=m.forwardRef((e,t)=>{var{children:n}=e,r=Xge(e,Yge),i=cr();return i?m.createElement(e0e,null,m.createElement(J5,{isPanorama:!0},n)):m.createElement(Jge,rm({ref:t},r),m.createElement(J5,{isPanorama:!1},n))});function t0e(){var e=Bt(),[t,n]=m.useState(null),r=De(gre);return m.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;qe(a)&&a!==r&&e(ere(a))}},[t,e,r]),n}function tA(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 n0e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tA(Object(n),!0).forEach(function(r){r0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r0e(e,t,n){return(t=i0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i0e(e){var t=a0e(e,"string");return typeof t=="symbol"?t:t+""}function a0e(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 as(){return as=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},as.apply(null,arguments)}var s0e=()=>(kfe(),null);function im(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var o0e=m.forwardRef((e,t)=>{var n,r,i=m.useRef(null),[a,s]=m.useState({containerWidth:im((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:im((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:b,height:x}=y.contentRect;o(b,x)}},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(Rd,{width:a.containerWidth,height:a.containerHeight}),m.createElement("div",as({ref:c},e)))}),l0e=m.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=m.useState({containerWidth:im(n),containerHeight:im(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(Rd,{width:i.containerWidth,height:i.containerHeight}),m.createElement("div",as({ref:o},e)))}),c0e=m.forwardRef((e,t)=>{var{width:n,height:r}=e;return m.createElement(m.Fragment,null,m.createElement(Rd,{width:n,height:r}),m.createElement("div",as({ref:t},e)))}),u0e=m.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?m.createElement(l0e,as({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?m.createElement(c0e,as({},e,{width:n,height:r,ref:t})):m.createElement(m.Fragment,null,m.createElement(Rd,{width:n,height:r}),m.createElement("div",as({ref:t},e)))});function d0e(e){return e?o0e:u0e}var f0e=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:b,width:x,responsive:v,dispatchTouchEvents:w=!0}=e,k=m.useRef(null),S=Bt(),[j,N]=m.useState(null),[P,T]=m.useState(null),E=t0e(),_=K1(),C=(_==null?void 0:_.width)>0?_.width:x,A=(_==null?void 0:_.height)>0?_.height:i,I=m.useCallback(re=>{E(re),typeof t=="function"&&t(re),N(re),T(re),re!=null&&(k.current=re)},[E,t,N,T]),$=m.useCallback(re=>{S(f6(re)),S(Dr({handler:a,reactEvent:re}))},[S,a]),oe=m.useCallback(re=>{S(Jv(re)),S(Dr({handler:u,reactEvent:re}))},[S,u]),Z=m.useCallback(re=>{S(oR()),S(Dr({handler:d,reactEvent:re}))},[S,d]),M=m.useCallback(re=>{S(Jv(re)),S(Dr({handler:f,reactEvent:re}))},[S,f]),K=m.useCallback(()=>{S(x6())},[S]),O=m.useCallback(()=>{S(v6())},[S]),ie=m.useCallback(re=>{S(y6(re.key))},[S]),J=m.useCallback(re=>{S(Dr({handler:s,reactEvent:re}))},[S,s]),D=m.useCallback(re=>{S(Dr({handler:o,reactEvent:re}))},[S,o]),H=m.useCallback(re=>{S(Dr({handler:c,reactEvent:re}))},[S,c]),ee=m.useCallback(re=>{S(Dr({handler:h,reactEvent:re}))},[S,h]),be=m.useCallback(re=>{S(Dr({handler:y,reactEvent:re}))},[S,y]),ne=m.useCallback(re=>{w&&S(S6(re)),S(Dr({handler:g,reactEvent:re}))},[S,w,g]),ye=m.useCallback(re=>{S(Dr({handler:p,reactEvent:re}))},[S,p]),Q=d0e(v);return m.createElement(ER.Provider,{value:j},m.createElement(aM.Provider,{value:P},m.createElement(Q,{width:C??(b==null?void 0:b.width),height:A??(b==null?void 0:b.height),className:ot("recharts-wrapper",r),style:n0e({position:"relative",cursor:"default",width:C,height:A},b),onClick:$,onContextMenu:J,onDoubleClick:D,onFocus:K,onBlur:O,onKeyDown:ie,onMouseDown:H,onMouseEnter:oe,onMouseLeave:Z,onMouseMove:M,onMouseUp:ee,onTouchEnd:ye,onTouchMove:ne,onTouchStart:be,ref:I},m.createElement(s0e,null),n)))}),h0e=["width","height","responsive","children","className","style","compact","title","desc"];function p0e(e,t){if(e==null)return{};var n,r,i=m0e(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 m0e(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 g0e=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=p0e(e,h0e),h=di(f);return c?m.createElement(m.Fragment,null,m.createElement(Rd,{width:n,height:r}),m.createElement(eA,{otherAttributes:h,title:u,desc:d},a)):m.createElement(f0e,{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(eA,{otherAttributes:h,title:u,desc:d,ref:t},m.createElement(Ipe,null,a)))});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 nA(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 y0e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nA(Object(n),!0).forEach(function(r){x0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function x0e(e,t,n){return(t=v0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v0e(e){var t=b0e(e,"string");return typeof t=="symbol"?t:t+""}function b0e(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 w0e={top:5,right:5,bottom:5,left:5},S0e=y0e({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:w0e,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},j6),k0e=m.forwardRef(function(t,n){var r,i=lr(t.categoricalChartProps,S0e),{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(Vge,{preloadedState:{options:d},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},m.createElement(Epe,{chartData:u.data}),m.createElement(Hge,{layout:i.layout,margin:i.margin}),m.createElement(qge,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),m.createElement(Kge,{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(g0e,eb({},i,{ref:n})))}),j0e=["axis"],dk=m.forwardRef((e,t)=>m.createElement(k0e,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:j0e,tooltipPayloadSearcher:ofe,categoricalChartProps:e,ref:t}));function rA(e){return e===0?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function iA(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function N0e({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",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Token Usage"}),l.jsx("div",{className:"h-[200px]",children:l.jsx(G1,{width:"100%",height:"100%",children:l.jsxs(dk,{data:t,children:[l.jsx(_g,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),l.jsx(Dg,{dataKey:"time",tickFormatter:iA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(Mg,{tickFormatter:rA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1,width:50}),l.jsx(tk,{labelFormatter:n=>iA(Number(n)),formatter:(n,r)=>[rA(Number(n)),r]}),l.jsx(mg,{verticalAlign:"top",align:"right",iconType:"circle",iconSize:8}),l.jsx(is,{type:"monotone",dataKey:"input",name:"Input",stroke:"#6366f1",fill:"#6366f1",fillOpacity:.1,strokeWidth:2}),l.jsx(is,{type:"monotone",dataKey:"output",name:"Output",stroke:"#a78bfa",fill:"#a78bfa",fillOpacity:.1,strokeWidth:2}),l.jsx(is,{type:"monotone",dataKey:"cache",name:"Cache",stroke:"#cbd5e1",fill:"#cbd5e1",fillOpacity:.1,strokeWidth:2,strokeDasharray:"4 4"})]})})})]})}function aA(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 C0e({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",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Prompt Latency"}),l.jsx("div",{className:"h-[200px]",children:l.jsx(G1,{width:"100%",height:"100%",children:l.jsxs(dk,{data:t,children:[l.jsx(_g,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),l.jsx(Dg,{dataKey:"time",tickFormatter:aA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(Mg,{tickFormatter:Hc,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1,width:50}),l.jsx(tk,{labelFormatter:o=>aA(Number(o)),formatter:(o,c)=>[Hc(Number(o)),c]}),l.jsx(mg,{verticalAlign:"top",align:"right",iconType:"circle",iconSize:8}),l.jsx(is,{type:"monotone",dataKey:"avg",name:"Avg",stroke:"#6366f1",fill:"#6366f1",fillOpacity:.1,strokeWidth:2}),l.jsx(is,{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 sA(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function P0e({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",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Sessions & Connections"}),l.jsx("div",{className:"h-[200px]",children:l.jsx(G1,{width:"100%",height:"100%",children:l.jsxs(dk,{data:t,children:[l.jsx(_g,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),l.jsx(Dg,{dataKey:"time",tickFormatter:sA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(Mg,{allowDecimals:!1,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1,width:30}),l.jsx(tk,{labelFormatter:i=>sA(Number(i)),formatter:(i,a)=>[Number(i),a]}),l.jsx(mg,{verticalAlign:"top",align:"right",iconType:"circle",iconSize:8}),l.jsx(is,{type:"stepAfter",dataKey:"sessions",name:"Sessions",stroke:"#3b82f6",fill:"#3b82f6",fillOpacity:.1,strokeWidth:2}),l.jsx(is,{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 E0e({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 A0e={builtin:"bg-blue-100 text-blue-800",team:"bg-amber-100 text-amber-800",personal:"bg-purple-100 text-purple-800"},T0e={builtin:"core",team:"team",personal:"personal"};function O0e({scope:e}){return l.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${A0e[e]??"bg-gray-100 text-gray-600"}`,children:T0e[e]??e})}function _0e({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(O0e,{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 oA=["bg-indigo-500","bg-violet-400","bg-emerald-400","bg-amber-400"];function tb(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:[tb(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 D0e(){var o;const[e,t]=m.useState("today"),{data:n,loading:r}=eee(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:tb((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:[tb(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",oA[Math.min(u,oA.length-1)]),style:{width:`${c.percentage}%`}})})]},`${c.provider}-${c.model}`))]})]})]})]})}function M0e({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(tee,{buckets:r,snapshot:i,range:t}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(N0e,{buckets:r}),l.jsx(C0e,{buckets:r})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(E0e,{topTools:a}),l.jsx(_0e,{topSkills:s})]}),l.jsx(P0e,{buckets:r}),l.jsx(D0e,{})]})})}const lA=[{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}],I0e=["All","bash","restricted_bash","run_skill","node_exec","pod_exec","kubectl"],L0e=["All","success","error","blocked"];function R0e(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 C6(e){return e==null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function F0e(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 $0e({outcome:e}){switch(e){case"success":return l.jsx(Y7,{className:"w-4 h-4 text-green-500"});case"error":return l.jsx(ys,{className:"w-4 h-4 text-red-500"});case"blocked":return l.jsx(HO,{className:"w-4 h-4 text-amber-500"});default:return l.jsx("span",{className:"text-gray-400 text-xs",children:"—"})}}function B0e(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n}=ic(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,b]=m.useState(!1),[x,v]=m.useState(!1),[w,k]=m.useState(null),[S,j]=m.useState({}),[N,P]=m.useState(!1),T=m.useRef(r);T.current=r;const E=m.useCallback(async A=>{var I;b(!0);try{const $=((I=lA.find(ie=>ie.value===u))==null?void 0:I.ms)??864e5,oe=new Date,Z=new Date(oe.getTime()-$).toISOString(),M=oe.toISOString(),K={startDate:Z,endDate:M,limit:50};n&&T.current&&(K.userName=T.current),a!=="All"&&(K.toolName=a),o!=="All"&&(K.outcome=o),A&&(K.cursorTs=A.ts,K.cursorId=A.id);const O=await e("audit.list",K);h(A?ie=>[...ie,...O.logs]:O.logs),g(O.hasMore),v(!0)}catch($){console.error("[AuditTab] search failed:",$)}finally{b(!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],I=Math.floor(new Date(A.timestamp).getTime()/1e3);E({ts:I,id:A.id})},[f,E]),C=m.useCallback(async A=>{if(w===A){k(null);return}if(k(A),!S[A]){P(!0);try{const I=await e("audit.detail",{messageId:A});j($=>{const oe=Object.entries($);return{...oe.length>=50?Object.fromEntries(oe.slice(-49)):$,[A]:I}})}catch(I){console.error("[AuditTab] detail load failed:",I)}finally{P(!1)}}},[w,S,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:I0e.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:L0e.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:lA.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(Hn,{className:"w-3.5 h-3.5"}),"Search"]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:x?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(U0e,{log:A,expanded:w===A.id,detail:S[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(Fe,{className:"w-3.5 h-3.5 animate-spin"}),"Load More"]})})]})}function U0e({log:e,expanded:t,detail:n,detailLoading:r,onToggle:i}){const a=R0e(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)}),F0e(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($0e,{outcome:e.outcome})}),l.jsx("td",{className:"px-6 py-2.5 text-right text-gray-500 tabular-nums",children:C6(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(Fe,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):n?l.jsx(V0e,{detail:n}):l.jsx("div",{className:"text-gray-400 text-sm",children:"Failed to load details"})})})]})}function V0e({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:C6(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 W0e({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(rw,{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(UO,{to:"/settings/system",className:"text-primary-600 hover:underline",children:"System Settings"})," ","to enable."]})]})})}function H0e(){const[e,t]=m.useState("dashboard"),[n,r]=m.useState("1h"),[i,a]=m.useState(null),{sendRpc:s,isConnected:o}=$t(),{data:c,loading:u,refresh:d}=JJ(n);m.useEffect(()=>{o&&s("system.getConfig").then(y=>{var b;a(((b=y.config)==null?void 0:b["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(cB,{className:U("w-4 h-4 transition-transform duration-500",f&&"animate-spin")})})]})]}),e==="dashboard"?l.jsx(M0e,{data:c,range:n,loading:u}):e==="audit"?l.jsx(B0e,{}):l.jsx(W0e,{grafanaUrl:i})]})}function K0e({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 G0e=P7([{path:"/login",element:l.jsx(pG,{})},{path:"/login/sso-callback",element:l.jsx(mG,{})},{element:l.jsx(hG,{}),children:[{path:"/",element:l.jsx(fG,{}),children:[{index:!0,element:l.jsx(dh,{to:"/pilot",replace:!0})},{path:"pilot",element:l.jsx(VQ,{})},{path:"skills",children:[{index:!0,element:l.jsx(HQ,{})},{path:":id",element:l.jsx(dJ,{})}]},{path:"channels",element:l.jsx(gJ,{})},{path:"triggers",element:l.jsx(bJ,{})},{path:"cron",element:l.jsx(jJ,{})},{path:"permissions",element:l.jsx(TJ,{})},{path:"settings",element:l.jsx(EJ,{}),children:[{index:!0,element:l.jsx(CJ,{})},{path:"system",element:l.jsx(AJ,{})}]},{path:"credentials",element:l.jsx(QJ,{})},{path:"sessions",element:l.jsx(K0e,{title:"Sessions"})},{path:"workspace",element:l.jsx(BJ,{})},{path:"mcp",element:l.jsx(GJ,{})},{path:"environments",element:l.jsx(dh,{to:"/credentials",replace:!0})},{path:"models",element:l.jsx(LJ,{})},{path:"metrics",element:l.jsx(H0e,{})}]}]},{path:"*",element:l.jsx(dh,{to:"/login",replace:!0})}]);function q0e(){return l.jsx(I7,{router:G0e})}class Y0e 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}}Ny.createRoot(document.getElementById("root")).render(l.jsx(Y0e,{children:l.jsx(q0e,{})}));
|